feat: add descriptive titles to folders routes for docs search [LET-5758] (#5606)

feat: add descriptive titles to folders routes for docs search
This commit is contained in:
cthomas
2025-10-21 13:03:25 -07:00
committed by Caren Thomas
parent 952019b072
commit 3cf17359a9
2 changed files with 25 additions and 25 deletions

View File

@@ -4762,9 +4762,9 @@
"/v1/agents/{agent_id}/files/close-all": {
"patch": {
"tags": ["agents"],
"summary": "Close All Open Files",
"summary": "Close All Files For Agent",
"description": "Closes all currently open files for a given agent.\n\nThis endpoint updates the file state for the agent so that no files are marked as open.\nTypically used to reset the working memory view for the agent.",
"operationId": "close_all_open_files",
"operationId": "close_all_files_for_agent",
"parameters": [
{
"name": "agent_id",
@@ -4792,7 +4792,7 @@
"items": {
"type": "string"
},
"title": "Response Close All Open Files"
"title": "Response Close All Files For Agent"
}
}
}
@@ -4813,9 +4813,9 @@
"/v1/agents/{agent_id}/files/{file_id}/open": {
"patch": {
"tags": ["agents"],
"summary": "Open File",
"summary": "Open File For Agent",
"description": "Opens a specific file for a given agent.\n\nThis endpoint marks a specific file as open in the agent's file state.\nThe file will be included in the agent's working memory view.\nReturns a list of file names that were closed due to LRU eviction.",
"operationId": "open_file",
"operationId": "open_file_for_agent",
"parameters": [
{
"name": "file_id",
@@ -4858,7 +4858,7 @@
"items": {
"type": "string"
},
"title": "Response Open File"
"title": "Response Open File For Agent"
}
}
}
@@ -4879,9 +4879,9 @@
"/v1/agents/{agent_id}/files/{file_id}/close": {
"patch": {
"tags": ["agents"],
"summary": "Close File",
"summary": "Close File For Agent",
"description": "Closes a specific file for a given agent.\n\nThis endpoint marks a specific file as closed in the agent's file state.\nThe file will be removed from the agent's working memory view.",
"operationId": "close_file",
"operationId": "close_file_for_agent",
"parameters": [
{
"name": "file_id",
@@ -5071,9 +5071,9 @@
"/v1/agents/{agent_id}/folders": {
"get": {
"tags": ["agents"],
"summary": "List Agent Folders",
"summary": "List Folders For Agent",
"description": "Get the folders associated with an agent.",
"operationId": "list_agent_folders",
"operationId": "list_folders_for_agent",
"parameters": [
{
"name": "agent_id",
@@ -5182,7 +5182,7 @@
"items": {
"$ref": "#/components/schemas/Source"
},
"title": "Response List Agent Folders"
"title": "Response List Folders For Agent"
}
}
}
@@ -5203,9 +5203,9 @@
"/v1/agents/{agent_id}/files": {
"get": {
"tags": ["agents"],
"summary": "List Agent Files",
"description": "Get the files attached to an agent with their open/closed status (paginated).",
"operationId": "list_agent_files",
"summary": "List Files For Agent",
"description": "Get the files attached to an agent with their open/closed status.",
"operationId": "list_files_for_agent",
"parameters": [
{
"name": "agent_id",

View File

@@ -597,8 +597,8 @@ async def detach_folder_from_agent(
return agent_state
@router.patch("/{agent_id}/files/close-all", response_model=List[str], operation_id="close_all_open_files")
async def close_all_open_files(
@router.patch("/{agent_id}/files/close-all", response_model=List[str], operation_id="close_all_files_for_agent")
async def close_all_files_for_agent(
agent_id: str = PATH_VALIDATORS[AgentState.__id_prefix__],
server: "SyncServer" = Depends(get_letta_server),
headers: HeaderParams = Depends(get_headers),
@@ -614,8 +614,8 @@ async def close_all_open_files(
return await server.file_agent_manager.close_all_other_files(agent_id=agent_id, keep_file_names=[], actor=actor)
@router.patch("/{agent_id}/files/{file_id}/open", response_model=List[str], operation_id="open_file")
async def open_file(
@router.patch("/{agent_id}/files/{file_id}/open", response_model=List[str], operation_id="open_file_for_agent")
async def open_file_for_agent(
file_id: str = PATH_VALIDATORS[FileMetadataBase.__id_prefix__],
agent_id: str = PATH_VALIDATORS[AgentState.__id_prefix__],
server: "SyncServer" = Depends(get_letta_server),
@@ -663,8 +663,8 @@ async def open_file(
return closed_files
@router.patch("/{agent_id}/files/{file_id}/close", response_model=None, operation_id="close_file")
async def close_file(
@router.patch("/{agent_id}/files/{file_id}/close", response_model=None, operation_id="close_file_for_agent")
async def close_file_for_agent(
file_id: str = PATH_VALIDATORS[FileMetadataBase.__id_prefix__],
agent_id: str = PATH_VALIDATORS[AgentState.__id_prefix__],
server: "SyncServer" = Depends(get_letta_server),
@@ -756,8 +756,8 @@ async def list_agent_sources(
)
@router.get("/{agent_id}/folders", response_model=list[Source], operation_id="list_agent_folders")
async def list_agent_folders(
@router.get("/{agent_id}/folders", response_model=list[Source], operation_id="list_folders_for_agent")
async def list_folders_for_agent(
agent_id: str = PATH_VALIDATORS[AgentState.__id_prefix__],
server: "SyncServer" = Depends(get_letta_server),
headers: HeaderParams = Depends(get_headers),
@@ -787,8 +787,8 @@ async def list_agent_folders(
)
@router.get("/{agent_id}/files", response_model=PaginatedAgentFiles, operation_id="list_agent_files")
async def list_agent_files(
@router.get("/{agent_id}/files", response_model=PaginatedAgentFiles, operation_id="list_files_for_agent")
async def list_files_for_agent(
agent_id: str = PATH_VALIDATORS[AgentState.__id_prefix__],
before: Optional[str] = Query(
None, description="File ID cursor for pagination. Returns files that come before this file ID in the specified sort order"
@@ -809,7 +809,7 @@ async def list_agent_files(
headers: HeaderParams = Depends(get_headers),
):
"""
Get the files attached to an agent with their open/closed status (paginated).
Get the files attached to an agent with their open/closed status.
"""
actor = await server.user_manager.get_actor_or_default_async(actor_id=headers.actor_id)