Skip to content

Commit b83b0a6

Browse files
wyf7107copybara-github
authored andcommitted
chore: experiment endpoint
PiperOrigin-RevId: 787164869
1 parent a3ff21e commit b83b0a6

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

src/google/adk/cli/fast_api.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
import click
2727
from fastapi import FastAPI
2828
from fastapi import UploadFile
29+
from fastapi.responses import FileResponse
30+
from fastapi.responses import PlainTextResponse
2931
from opentelemetry.sdk.trace import export
3032
from opentelemetry.sdk.trace import TracerProvider
3133
from starlette.types import Lifespan
@@ -269,6 +271,27 @@ async def builder_build(files: list[UploadFile]) -> bool:
269271

270272
return True
271273

274+
@working_in_progress("builder_get is not ready for use.")
275+
@app.get(
276+
"/builder/app/{app_name}",
277+
response_model_exclude_none=True,
278+
response_class=PlainTextResponse,
279+
)
280+
async def get_agent_builder(app_name: str):
281+
base_path = Path.cwd() / agents_dir
282+
agent_dir = base_path / app_name
283+
file_name = "root_agent.yaml"
284+
file_path = agent_dir / file_name
285+
if not file_path.is_file():
286+
return ""
287+
else:
288+
return FileResponse(
289+
path=file_path,
290+
media_type="application/x-yaml",
291+
filename="${app_name}.yaml",
292+
headers={"Cache-Control": "no-store"},
293+
)
294+
272295
if a2a:
273296
try:
274297
from a2a.server.apps import A2AStarletteApplication

0 commit comments

Comments
 (0)