Import Agent
client.agents.importFile(AgentImportFileParams { file, append_copy_suffix, embedding, 11 more } params, RequestOptionsoptions?): AgentImportFileResponse { agent_ids }
POST/v1/agents/import
Import a serialized agent file and recreate the agent(s) in the system. Returns the IDs of all imported agents.
Import Agent
import fs from 'fs';
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
});
const response = await client.agents.importFile({ file: fs.createReadStream('path/to/file') });
console.log(response.agent_ids);{
"agent_ids": [
"string"
]
}Returns Examples
{
"agent_ids": [
"string"
]
}