feat(ai-client-factory): Add xAI and OpenRouter provider support, enhance tests

- Integrate  for Grok models and  for OpenRouter into the AI client factory ().
- Install necessary provider dependencies (, , and other related  packages, updated  core).
- Update environment variable checks () and client creation logic () for the new providers.
- Add and correct unit tests in  to cover xAI and OpenRouter instantiation, error handling, and environment variable resolution.
- Corrected mock paths and names in tests to align with official package names.
- Verify all tests (28 total) pass for .
- Confirm test coverage remains high (~90%) after additions.
This commit is contained in:
Eyal Toledano
2025-04-19 17:00:47 -04:00
parent d181c40a95
commit 11b8d1bda5
6 changed files with 1132 additions and 7 deletions

View File

@@ -38,8 +38,16 @@
"author": "Eyal Toledano",
"license": "MIT WITH Commons-Clause",
"dependencies": {
"@ai-sdk/anthropic": "^1.2.10",
"@ai-sdk/azure": "^1.3.17",
"@ai-sdk/google": "^1.2.12",
"@ai-sdk/mistral": "^1.2.7",
"@ai-sdk/openai": "^1.3.16",
"@ai-sdk/perplexity": "^1.1.7",
"@ai-sdk/xai": "^1.2.13",
"@anthropic-ai/sdk": "^0.39.0",
"ai": "^4.3.6",
"@openrouter/ai-sdk-provider": "^0.4.5",
"ai": "^4.3.9",
"boxen": "^8.0.1",
"chalk": "^4.1.2",
"cli-table3": "^0.6.5",
@@ -55,6 +63,7 @@
"inquirer": "^12.5.0",
"jsonwebtoken": "^9.0.2",
"lru-cache": "^10.2.0",
"ollama-ai-provider": "^1.2.0",
"openai": "^4.89.0",
"ora": "^8.2.0",
"uuid": "^11.1.0"