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:
Mario Zechner 2025-08-24 20:41:10 +02:00
parent cb4c32faaa
commit a8ba19f0b4
8 changed files with 360 additions and 14 deletions

View file

@ -5,7 +5,10 @@
"type": "module",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"files": ["dist", "README.md"],
"files": [
"dist",
"README.md"
],
"scripts": {
"clean": "rm -rf dist",
"build": "tsc -p tsconfig.build.json",
@ -13,13 +16,21 @@
"prepublishOnly": "npm run clean && npm run build"
},
"dependencies": {
"openai": "5.12.2",
"@anthropic-ai/sdk": "0.60.0",
"@google/genai": "1.14.0",
"chalk": "^5.5.0"
"@google/generative-ai": "^0.24.1",
"chalk": "^5.5.0",
"openai": "5.12.2"
},
"devDependencies": {},
"keywords": ["ai", "llm", "openai", "anthropic", "gemini", "unified", "api"],
"keywords": [
"ai",
"llm",
"openai",
"anthropic",
"gemini",
"unified",
"api"
],
"author": "Mario Zechner",
"license": "MIT",
"repository": {
@ -30,4 +41,4 @@
"engines": {
"node": ">=20.0.0"
}
}
}