Commit d5865fc
authored
feat: add Openrouter support (#75)
* feat: add openrouter support
- Introduce ModelProvider abstraction for LLM service
- Added ModelProviderName enum and ModelProviders mapping to centralize model provider definitions, enhancing maintainability and readability.
- Updated LLMService to utilize the new ModelProviderName for provider identification, improving code clarity.
- Refactored getProviderFromModel method to return ModelProviderName values, streamlining model provider retrieval logic.
- Introduced openrouter support in LLMService, expanding model provider capabilities.
* test: add ModelAdapter tests for unsupported provider handling
- Introduced a new test suite for ModelAdapter to validate error handling for unsupported providers.
- Enhanced existing tests for DummyLLM to ensure comprehensive coverage of LLM functionalities.
- This update improves the robustness of the testing framework and ensures adherence to expected behaviors in the LLM module.
* chore: update package dependencies
- Upgraded versions of several @AI-SDK packages to their latest releases for improved functionality and compatibility.
- Updated the "ai" package from version 4.3 to 4.3.15 to ensure alignment with the latest features and enhancements.
- Added @openrouter/ai-sdk-provider dependency to support new functionalities.
* refactor: update RevenueProjectSchema and handle null values in project data
- Modified RevenueProjectSchema to allow nullable fields for arr, mrr, and normalizedRevenueFor30Days, enhancing data flexibility.
- Updated RevenueDataExecutor to handle null values by converting them to 0, ensuring consistent data structure when fetching project data.
- Added error handling for cases where no project data is returned, improving robustness and user feedback.
* chore: update pnpm-lock.yaml with dependency version changes
- Upgraded several @AI-SDK packages to their latest versions, including '@ai-sdk/anthropic' to 1.2.11, '@ai-sdk/deepseek' to 0.2.14, and '@ai-sdk/openai' to 1.3.22, enhancing functionality and compatibility.
- Added '@openrouter/ai-sdk-provider' version 0.4.5 to support new features.
- Updated the 'ai' package from version 4.3.13 to 4.3.15 for improved performance and stability.1 parent 7170636 commit d5865fc
File tree
8 files changed
+156
-94
lines changed- src
- __tests__
- llm
- tools
8 files changed
+156
-94
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | | - | |
25 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | | - | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
13 | 21 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
49 | 59 | | |
50 | 60 | | |
51 | 61 | | |
| |||
0 commit comments