import { SkaiAgent, SkaiChatRequestParams, SkaiChatResponse } from '../types/agents-api-types'; import { Logger, SkaiBaseClient } from './base-client'; /** * Configuration for SKAI Agents Client */ export interface SkaiAgentsClientConfig { /** Base URL for SKAI API (e.g., 'https://api-dev.agents.skillfulai.io') */ baseUrl: string; /** User API key for agent operations */ userApiKey: string; /** Request timeout in milliseconds (optional, defaults to 5 minutes) */ timeout?: number; /** Organization ID for multi-tenant operations (optional) */ organizationId?: string; } /** * SKAI Agents Client for managing SKAI AI agents and chat interactions * * Provides access to SKAI Agents API endpoints: * - List user agents * - Chat with agents (non-streaming and streaming) * * Usage: * ```typescript * const agentsClient = new SkaiAgentsClient(log, { * baseUrl: 'https://api-dev.agents.skillfulai.io', * userApiKey: 'sk-...' * }) * * // List all agents for a user * const agents = await agentsClient.listAgents() * * // Chat with an agent * const response = await agentsClient.chat({ * agentId: 'agent-uuid', * message: 'Hello!' * }) * ``` */ export declare class SkaiAgentsClient extends SkaiBaseClient { private readonly userApiKey; private readonly organizationId?; constructor(log: Logger, config: SkaiAgentsClientConfig); /** * List all agents for the authenticated user * GET /api/agents * * @returns Array of user's agents */ listAgents(): Promise; /** * Get a specific agent by ID * GET /api/agents/{agent_id} * * @param agentId - The agent ID to retrieve * @returns The requested agent */ getAgent(agentId: string): Promise; /** * Send a message to an agent and get a complete response (non-streaming) * POST /api/agents/{agent_id}/chat/message * POST /api/agents/{agent_id}/chat/{chat_history_id}/message * * @param params - Chat request parameters * @returns Complete chat response */ chat(params: Omit): Promise; /** * Send a message to an agent using streaming (avoids API gateway timeouts) * POST /api/agents/{agent_id}/chat * POST /api/agents/{agent_id}/chat/{chat_history_id} * * @param params - Chat request parameters * @returns Complete chat response (same format as non-streaming) */ chatStream(params: Omit): Promise; /** * Send a test message to an agent using streaming (doesn't consume allowance) * * @param params - Test chat parameters * @returns Test chat response */ testChatStream(params: Omit): Promise; /** * Internal method to handle streaming responses from agents-api * Processes Server-Sent Events and buffers complete response * Returns the same format as non-streaming chat for backward compatibility */ private makeStreamingRequest; /** * Send a test message to an agent (does not consume user allowance) * * @param params - Test chat parameters * @returns Test chat response */ testChat(params: Omit): Promise; /** * Create a new SKAI Agents client instance */ static create(log: Logger, config: SkaiAgentsClientConfig): SkaiAgentsClient; }