feat(ai): Implement Gemini provider with streaming and tool support
- Added GeminiLLM provider implementation with GoogleGenerativeAI SDK - Supports streaming with text/thinking content and completion signals - Handles Gemini's parts-based content system (text, thought, functionCall) - Implements tool/function calling with proper format conversion - Maps between unified types and Gemini-specific formats (model vs assistant role) - Added test example matching other provider patterns - Fixed typo in AssistantMessage type (stopResaon -> stopReason) across all providers
This commit is contained in:
@@ -163,7 +163,7 @@ export class OpenAICompletionsLLM implements LLM<OpenAICompletionsLLMOptions> {
|
||||
toolCalls: toolCalls.length > 0 ? toolCalls : undefined,
|
||||
model: this.model,
|
||||
usage,
|
||||
stopResaon: this.mapStopReason(finishReason),
|
||||
stopReason: this.mapStopReason(finishReason),
|
||||
};
|
||||
} catch (error) {
|
||||
return {
|
||||
@@ -175,7 +175,7 @@ export class OpenAICompletionsLLM implements LLM<OpenAICompletionsLLMOptions> {
|
||||
cacheRead: 0,
|
||||
cacheWrite: 0,
|
||||
},
|
||||
stopResaon: "error",
|
||||
stopReason: "error",
|
||||
error: error instanceof Error ? error.message : String(error),
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user