Repository navigation
feat: add Atlas Cloud provider #1123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -36,6 +36,8 @@ function defaultModelFor(providerType: ProviderConfig["provider"]): string { | |||||||||||||||||||||||||||||||||
| switch (providerType) { | ||||||||||||||||||||||||||||||||||
| case "openai": | ||||||||||||||||||||||||||||||||||
| return getEnvVar("OPENAI_MODEL") || "gpt-4o-mini"; | ||||||||||||||||||||||||||||||||||
| case "atlascloud": | ||||||||||||||||||||||||||||||||||
| return getEnvVar("ATLASCLOUD_MODEL") || "deepseek-ai/deepseek-v4-pro"; | ||||||||||||||||||||||||||||||||||
| case "anthropic": | ||||||||||||||||||||||||||||||||||
| return getEnvVar("ANTHROPIC_MODEL") || "claude-sonnet-4-20250514"; | ||||||||||||||||||||||||||||||||||
| case "gemini": | ||||||||||||||||||||||||||||||||||
|
|
@@ -94,6 +96,13 @@ export function createFallbackProvider( | |||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| function createBaseProvider(config: ProviderConfig): MemoryProvider { | ||||||||||||||||||||||||||||||||||
| switch (config.provider) { | ||||||||||||||||||||||||||||||||||
| case "atlascloud": | ||||||||||||||||||||||||||||||||||
| return new OpenAIProvider( | ||||||||||||||||||||||||||||||||||
| requireEnvVar("ATLASCLOUD_API_KEY"), | ||||||||||||||||||||||||||||||||||
| config.model, | ||||||||||||||||||||||||||||||||||
| config.maxTokens, | ||||||||||||||||||||||||||||||||||
| config.baseURL || "https://api.atlascloud.ai/v1", | ||||||||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||||||||
|
Comment on lines
+99
to
+105
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win Honor Fallback configs omit Proposed fix- config.baseURL || "https://api.atlascloud.ai/v1",
+ config.baseURL ||
+ getEnvVar("ATLASCLOUD_BASE_URL") ||
+ "https://api.atlascloud.ai/v1",📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||
| case "minimax": | ||||||||||||||||||||||||||||||||||
| return new MinimaxProvider( | ||||||||||||||||||||||||||||||||||
| requireEnvVar("MINIMAX_API_KEY"), | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,54 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| import { afterEach, beforeEach, describe, expect, it } from "vitest"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| import { loadConfig, loadFallbackConfig } from "../src/config.js"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| import { createProvider } from "../src/providers/index.js"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| const providerEnvKeys = [ | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| "ANTHROPIC_API_KEY", | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| "ATLASCLOUD_API_KEY", | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| "ATLASCLOUD_BASE_URL", | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| "ATLASCLOUD_MODEL", | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| "GEMINI_API_KEY", | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| "GOOGLE_API_KEY", | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| "MINIMAX_API_KEY", | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| "OPENAI_API_KEY", | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| "OPENROUTER_API_KEY", | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| "FALLBACK_PROVIDERS", | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| ]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+5
to
+16
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win Isolate An ambient Proposed fix const providerEnvKeys = [
+ "MAX_TOKENS",
"ANTHROPIC_API_KEY",📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| describe("Atlas Cloud provider", () => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| const savedEnv: Record<string, string | undefined> = {}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| beforeEach(() => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| for (const key of providerEnvKeys) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| savedEnv[key] = process.env[key]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| process.env[key] = ""; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| afterEach(() => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| for (const key of providerEnvKeys) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (savedEnv[key] === undefined) delete process.env[key]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| else process.env[key] = savedEnv[key]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| it("selects Atlas Cloud defaults from ATLASCLOUD_API_KEY", () => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| process.env.ATLASCLOUD_API_KEY = "atlas-test-key"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| const config = loadConfig(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| expect(config.provider).toEqual({ | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| provider: "atlascloud", | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| model: "deepseek-ai/deepseek-v4-pro", | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| maxTokens: 4096, | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| baseURL: "https://api.atlascloud.ai/v1", | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| expect(() => createProvider(config.provider)).not.toThrow(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| it("supports Atlas Cloud as a fallback provider", () => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| process.env.FALLBACK_PROVIDERS = "atlascloud"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| expect(loadFallbackConfig().providers).toEqual(["atlascloud"]); | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Include Atlas Cloud in the no-provider setup guidance.
The no-key warning still lists supported providers without
ATLASCLOUD_API_KEY, so the newly supported provider is omitted from the remediation users see.Proposed fix
🤖 Prompt for AI Agents