UNPKG

@unified-llm/core

Version:

Unified LLM interface (in-memory).

27 lines (26 loc) 997 B
import { UnifiedChatRequest, UnifiedChatResponse, Tool } from '../../types/unified-api'; import BaseProvider from '../base-provider'; /** スタブ実装。SDK を呼ばずにビルドだけ通す */ export declare class GeminiProvider extends BaseProvider { private client; constructor({ apiKey, model, tools }: { apiKey: string; model?: string; tools?: Tool[]; }); chat(request: UnifiedChatRequest): Promise<UnifiedChatResponse>; stream(request: UnifiedChatRequest): AsyncIterableIterator<UnifiedChatResponse>; private convertToolsToGeminiFormat; private hasFunctionCalls; private extractFunctionCalls; private convertToGeminiHistory; private extractPromptFromMessage; private convertGenerationConfig; private convertToGoogleSchema; private mapToGoogleType; private convertFromGeminiFormat; private convertStreamChunk; private mapFinishReason; private extractTextFromContent; private handleError; }