UNPKG

@xynehq/jaf

Version:

Juspay Agent Framework - A purely functional agent framework with immutable state and composable tools

84 lines 2.08 kB
import { ModelProvider } from '../core/types.js'; export type AiSdkFunctionTool = { type: 'function'; function: { name: string; description?: string; parameters: unknown; }; }; export type AiSdkChatMessageParam = { role: 'system'; content: string; } | { role: 'user' | 'assistant' | 'tool'; content: string | null; tool_calls?: Array<{ id: string; type: 'function'; function: { name: string; arguments: string | any; }; }>; tool_call_id?: string; }; export type AiSdkChatRequest = { model: string; messages: AiSdkChatMessageParam[]; temperature?: number; max_tokens?: number; maxTokens?: number; tools?: AiSdkFunctionTool[]; tool_choice?: 'auto' | 'none' | { type: 'function'; function: { name: string; }; }; response_format?: { type: 'json_object'; }; [key: string]: unknown; }; export type AiSdkChatResponse = { message?: { content?: string | null; tool_calls?: Array<{ id: string; type: 'function'; function: { name: string; arguments: string | any; }; }>; }; choices?: Array<{ message?: { content?: string | null; tool_calls?: Array<{ id: string; type: 'function'; function: { name: string; arguments: string | any; }; }>; }; }>; text?: string | null; id?: string; model?: string; created?: number; usage?: { prompt_tokens?: number; completion_tokens?: number; total_tokens?: number; }; [key: string]: unknown; }; export interface AiSdkClient { chat: (request: AiSdkChatRequest) => Promise<AiSdkChatResponse>; } export declare const createAiSdkProvider: <Ctx>(model: unknown) => ModelProvider<Ctx>; //# sourceMappingURL=ai-sdk.d.ts.map