File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2626import click
2727from fastapi import FastAPI
2828from fastapi import UploadFile
29+ from fastapi .responses import FileResponse
30+ from fastapi .responses import PlainTextResponse
2931from opentelemetry .sdk .trace import export
3032from opentelemetry .sdk .trace import TracerProvider
3133from 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
You can’t perform that action at this time.
0 commit comments