mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-20 20:01:06 +00:00
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:
parent
cb4c32faaa
commit
a8ba19f0b4
8 changed files with 360 additions and 14 deletions
|
|
@ -186,7 +186,7 @@ export class AnthropicLLM implements LLM<AnthropicLLMOptions> {
|
|||
toolCalls,
|
||||
model: this.model,
|
||||
usage,
|
||||
stopResaon: this.mapStopReason(msg.stop_reason),
|
||||
stopReason: this.mapStopReason(msg.stop_reason),
|
||||
};
|
||||
} catch (error) {
|
||||
return {
|
||||
|
|
@ -198,7 +198,7 @@ export class AnthropicLLM implements LLM<AnthropicLLMOptions> {
|
|||
cacheRead: 0,
|
||||
cacheWrite: 0,
|
||||
},
|
||||
stopResaon: "error",
|
||||
stopReason: "error",
|
||||
error: error instanceof Error ? error.message : String(error),
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue