UNPKG

@squidcloud/client

Version:

A typescript implementation of the Squid client

39 lines (38 loc) 1.31 kB
import { AiAgent, AiAgentId } from '../public-types'; import { AiAgentReference } from './ai-agent-client-reference'; /** * Allows the user to provide custom options to the agent client * * @category AI */ export type AiAgentClientOptions = { /** * Allows providing an agent API key that can be used instead of the app API key */ apiKey?: string; }; /** * AiAgentClient manages AI agent interactions, including listing agents, * handling real-time chat responses, and processing AI status updates * through WebSocket notifications. * @category AI */ export declare class AiAgentClient { private readonly rpcManager; private readonly socketManager; private readonly jobClient; private readonly backendFunctionManager; private readonly getMetricAnnotations; private readonly ongoingChatSequences; /** * Retrieves an instance of AiAgentReference for a specific agent ID. * This reference provides methods for interacting with the agent. */ agent(id: AiAgentId, options?: AiAgentClientOptions | undefined): AiAgentReference; /** * Lists all agents available in the system. * @returns A promise that resolves to an array of AiAgent instances. */ listAgents(): Promise<Array<AiAgent>>; private handleChatResponse; }