Skip to main content

getConversations

codebolt.agentPortfolio.getConversations(agentId: string, limit: number, offset: number): Promise<GetConversationsResponse>

Gets conversations involving an agent with pagination support for handling large conversation histories.

Parameters

  • agentId (string): The ID of the agent.
  • limit (number, optional): Maximum number of conversations to return.
  • offset (number, optional): Offset for pagination.

Returns

  • Promise<[GetConversationsResponse](/docs/reference/type-reference/codeboltjs/interfaces/GetConversationsResponse)>: A promise that resolves to the list of conversations.

Examples

// Get recent conversations
const conversations = await codebolt.agentPortfolio.getConversations('agent-123', 10);

// Paginate through history
const page1 = await codebolt.agentPortfolio.getConversations('agent-123', 20, 0);
const page2 = await codebolt.agentPortfolio.getConversations('agent-123', 20, 20);

Notes

  • Use pagination for large conversation histories
  • Conversations are ordered by most recent first