doc_chat_ai
Version:
Backend SDK for ChatAI - Simple and efficient communication with ChatAI API
53 lines • 1.27 kB
TypeScript
export interface ChatAIConfig {
apiKey: string;
timeout?: number;
origin?: string;
headers?: Record<string, string>;
}
export interface ChatOptions {
sessionId?: string;
stream?: boolean;
model?: string;
temperature?: number;
maxTokens?: number;
context?: string;
metadata?: Record<string, any>;
}
export interface ChatRequest {
apikey: string;
query: string;
stream: boolean;
sessionId?: string;
model?: string;
temperature?: number;
maxTokens?: number;
context?: string;
metadata?: Record<string, any>;
}
export interface ChatResponse {
error: boolean;
sessionId: string;
response: string;
outOfContext?: boolean;
}
export interface ChatChunk {
type: "session" | "content" | "done" | "error";
sessionId?: string;
content?: string;
timestamp?: string;
timing?: {
total: number;
};
outOfContext?: boolean;
message?: string;
}
export interface ChatAIError extends Error {
status?: number;
response?: any;
}
export declare class ChatAIError extends Error {
status?: number | undefined;
response?: any;
constructor(message: string, status?: number | undefined, response?: any);
}
//# sourceMappingURL=types.d.ts.map