import { QelosSDKOptions } from '../types'; import BaseSDK from '../base-sdk'; import ThreadsSDK from './threads'; import ChatSDK from './chat'; import RagSDK from './rag'; import AgentsSDK from './agents'; import { IMessage, IMessageSummary, IThread, IChatCompletionOptions, ISSEStreamProcessor, IChatCompletionResponse, ICreateThreadRequest, ICreateVectorStorageRequest, IUploadContentRequest, IClearStorageRequest, IVectorStore, IAgent, IAgentChatOptions, IAgentTool, ICreateAgentRequest, IUpdateAgentRequest } from './types'; export * from './types'; export { IMessage, IMessageSummary, IThread, IChatCompletionOptions, ISSEStreamProcessor, IChatCompletionResponse, ICreateThreadRequest, ICreateVectorStorageRequest, IUploadContentRequest, IClearStorageRequest, IVectorStore, IAgent, IAgentChatOptions, IAgentTool, ICreateAgentRequest, IUpdateAgentRequest, }; /** * Qelos AI SDK - Main SDK class with three sub-SDKs * * This class provides access to AI functionality through sub-SDKs: * - `agents`: Agent management and agent-centric chat (recommended entry point) * - `threads`: Thread CRUD operations for managing conversation threads * - `chat`: Chat completion operations (streaming and non-streaming) * - `rag`: Vector storage management for Retrieval-Augmented Generation * * @example * ```typescript * const sdk = new QelosSDK({ * appUrl: 'https://your-qelos-instance.com', * fetch: globalThis.fetch, * accessToken: 'your-token' * }); * * // Create a thread * const thread = await sdk.ai.threads.create({ integration: 'id' }); * * // Stream chat * const stream = await sdk.ai.chat.stream('id', { messages: [...] }); * for await (const chunk of sdk.ai.chat.parseSSEStream(stream)) { * console.log(chunk); * } * * // Upload RAG content * await sdk.ai.rag.uploadContent('sourceId', { content: '...' }); * ``` */ export default class QlAI extends BaseSDK { /** * Threads sub-SDK for managing conversation threads */ threads: ThreadsSDK; /** * Chat sub-SDK for chat completion operations */ chat: ChatSDK; /** * RAG sub-SDK for vector storage management */ rag: RagSDK; /** * Agents sub-SDK for managing AI agents and agent-centric chat */ agents: AgentsSDK; /** * Initialize the AI SDK with sub-SDKs * * @param options - SDK configuration options */ constructor(options: QelosSDKOptions); /** * @deprecated Use sdk.threads.create() instead */ createThread(data: ICreateThreadRequest): Promise; /** * @deprecated Use sdk.threads.getOne() instead */ getThread(threadId: string): Promise; /** * @deprecated Use sdk.threads.list() instead */ listThreads(options?: { integration?: string; limit?: number; page?: number; sort?: string; user?: string; workspace?: string; [key: string]: string | number; }): Promise; /** * @deprecated Use sdk.threads.delete() instead */ deleteThread(threadId: string): Promise<{ success: boolean; }>; /** * @deprecated Use sdk.chat.chat() instead */ chatCompletion(integrationId: string, options: IChatCompletionOptions): Promise; /** * @deprecated Use sdk.chat.chatInThread() instead */ chatCompletionInThread(integrationId: string, threadId: string, options: IChatCompletionOptions): Promise; /** * @deprecated Use sdk.chat.stream() instead */ streamChat(integrationId: string, options: IChatCompletionOptions): Promise>; /** * @deprecated Use sdk.chat.streamInThread() instead */ streamChatInThread(integrationId: string, threadId: string, options: IChatCompletionOptions): Promise>; /** * @deprecated Use sdk.chat.parseSSEStream() instead */ parseSSEStream(stream: ReadableStream): ISSEStreamProcessor; }