List Files For Agent
client.agents.files.list(stringagentID, FileListParams { after, before, cursor, 4 more } query?, RequestOptionsoptions?): NextFilesPage<FileListResponse { id, file_id, file_name, 7 more } >
/v1/agents/{agent_id}/files
Get the files attached to an agent with their open/closed status.
Parameters
Returns
List Files For Agent
import Letta from '@letta-ai/letta-client';
const client = new Letta({
apiKey: process.env['LETTA_API_KEY'], // This is the default and can be omitted
});
// Automatically fetches more pages as needed.
for await (const fileListResponse of client.agents.files.list('agent-123e4567-e89b-42d3-8456-426614174000')) {
console.log(fileListResponse.id);
}
{
"files": [
{
"id": "id",
"file_id": "file_id",
"file_name": "file_name",
"folder_id": "folder_id",
"folder_name": "folder_name",
"is_open": true,
"end_line": 0,
"last_accessed_at": "2019-12-27T18:11:19.117Z",
"start_line": 0,
"visible_content": "visible_content"
}
],
"has_more": true,
"next_cursor": "next_cursor"
}
Returns Examples
{
"files": [
{
"id": "id",
"file_id": "file_id",
"file_name": "file_name",
"folder_id": "folder_id",
"folder_name": "folder_name",
"is_open": true,
"end_line": 0,
"last_accessed_at": "2019-12-27T18:11:19.117Z",
"start_line": 0,
"visible_content": "visible_content"
}
],
"has_more": true,
"next_cursor": "next_cursor"
}