diff --git a/letta/server/rest_api/routers/v1/agents.py b/letta/server/rest_api/routers/v1/agents.py index 417a88a0..1493bbd8 100644 --- a/letta/server/rest_api/routers/v1/agents.py +++ b/letta/server/rest_api/routers/v1/agents.py @@ -162,8 +162,8 @@ class IndentedORJSONResponse(Response): return orjson.dumps(content, option=orjson.OPT_INDENT_2) -@router.get("/{agent_id}/export", response_class=IndentedORJSONResponse, operation_id="export_agent_serialized") -async def export_agent_serialized( +@router.get("/{agent_id}/export", response_class=IndentedORJSONResponse, operation_id="export_agent") +async def export_agent( agent_id: str, max_steps: int = 100, server: "SyncServer" = Depends(get_letta_server), @@ -256,7 +256,7 @@ def import_agent_legacy( raise HTTPException(status_code=500, detail=f"An unexpected error occurred while uploading the agent: {e!s}") -async def import_agent( +async def _import_agent( agent_file_json: dict, server: "SyncServer", actor: User, @@ -313,8 +313,8 @@ async def import_agent( raise HTTPException(status_code=500, detail=f"An unexpected error occurred while importing agents: {e!s}") -@router.post("/import", response_model=ImportedAgentsResponse, operation_id="import_agent_serialized") -async def import_agent_serialized( +@router.post("/import", response_model=ImportedAgentsResponse, operation_id="import_agent") +async def import_agent( file: UploadFile = File(...), server: "SyncServer" = Depends(get_letta_server), actor_id: str | None = Header(None, alias="user_id"), @@ -367,7 +367,7 @@ async def import_agent_serialized( # TODO: This is kind of hacky, but should work as long as dont' change the schema if "agents" in agent_json and isinstance(agent_json.get("agents"), list): # This is an AgentFileSchema - agent_ids = await import_agent( + agent_ids = await _import_agent( agent_file_json=agent_json, server=server, actor=actor,