File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change 26
26
import click
27
27
from fastapi import FastAPI
28
28
from fastapi import UploadFile
29
+ from fastapi .responses import FileResponse
30
+ from fastapi .responses import PlainTextResponse
29
31
from opentelemetry .sdk .trace import export
30
32
from opentelemetry .sdk .trace import TracerProvider
31
33
from starlette .types import Lifespan
@@ -269,6 +271,27 @@ async def builder_build(files: list[UploadFile]) -> bool:
269
271
270
272
return True
271
273
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
+
272
295
if a2a :
273
296
try :
274
297
from a2a .server .apps import A2AStarletteApplication
You can’t perform that action at this time.
0 commit comments