chore: prepare for deployment
Publish Docker Images / Smoke test (api) (push) Canceled after 0s
Publish Docker Images / Smoke test (dashboard) (push) Canceled after 0s
Publish Docker Images / Smoke test (jobs) (push) Canceled after 0s
Publish Docker Images / build-and-push (./docker/Dockerfile.api, api, api) (push) Canceled after 0s
Publish Docker Images / build-and-push (./docker/Dockerfile.dashboard, dashboard, dashboard) (push) Canceled after 0s
Publish Docker Images / build-and-push (./docker/Dockerfile.jobs, jobs, jobs) (push) Canceled after 0s
MCP package build check / build (push) Canceled after 0s
Package build check / build (push) Canceled after 0s
Upload OpenAPI Spec to R2 / generate-and-upload-openapi (push) Canceled after 0s
Publish Docker Images / Smoke test (api) (push) Canceled after 0s
Publish Docker Images / Smoke test (dashboard) (push) Canceled after 0s
Publish Docker Images / Smoke test (jobs) (push) Canceled after 0s
Publish Docker Images / build-and-push (./docker/Dockerfile.api, api, api) (push) Canceled after 0s
Publish Docker Images / build-and-push (./docker/Dockerfile.dashboard, dashboard, dashboard) (push) Canceled after 0s
Publish Docker Images / build-and-push (./docker/Dockerfile.jobs, jobs, jobs) (push) Canceled after 0s
MCP package build check / build (push) Canceled after 0s
Package build check / build (push) Canceled after 0s
Upload OpenAPI Spec to R2 / generate-and-upload-openapi (push) Canceled after 0s
This commit is contained in:
@@ -2,6 +2,7 @@ import { createOpenAI } from '@ai-sdk/openai';
|
||||
import { createAnthropic } from '@ai-sdk/anthropic';
|
||||
import { createGoogleGenerativeAI } from '@ai-sdk/google';
|
||||
import { createMoonshotAI } from '@ai-sdk/moonshotai';
|
||||
import { createDeepSeek } from '@ai-sdk/deepseek';
|
||||
import type { LanguageModel } from 'ai';
|
||||
import { AIProvider, type AIProviderConfig } from '../types';
|
||||
|
||||
@@ -9,14 +10,16 @@ const DEFAULT_MODELS: Record<AIProvider, string> = {
|
||||
[AIProvider.OPENAI]: 'gpt-5.4-mini',
|
||||
[AIProvider.ANTHROPIC]: 'claude-sonnet-4-20250514',
|
||||
[AIProvider.GOOGLE]: 'gemini-3.1-flash-lite',
|
||||
[AIProvider.MOONSHOT]: 'kimi-k2.6'
|
||||
[AIProvider.MOONSHOT]: 'kimi-k2.6',
|
||||
[AIProvider.DEEPSEEK]: 'deepseek-chat'
|
||||
};
|
||||
|
||||
const PROVIDER_API_KEY_ENV: Record<AIProvider, string> = {
|
||||
[AIProvider.OPENAI]: 'OPENAI_API_KEY',
|
||||
[AIProvider.ANTHROPIC]: 'ANTHROPIC_API_KEY',
|
||||
[AIProvider.GOOGLE]: 'GOOGLE_API_KEY',
|
||||
[AIProvider.MOONSHOT]: 'MOONSHOT_API_KEY'
|
||||
[AIProvider.MOONSHOT]: 'MOONSHOT_API_KEY',
|
||||
[AIProvider.DEEPSEEK]: 'DEEPSEEK_API_KEY'
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -43,6 +46,10 @@ export function createModel(config: AIProviderConfig): LanguageModel {
|
||||
const moonshot = createMoonshotAI({ apiKey: config.apiKey });
|
||||
return moonshot(modelName);
|
||||
}
|
||||
case AIProvider.DEEPSEEK: {
|
||||
const deepseek = createDeepSeek({ apiKey: config.apiKey });
|
||||
return deepseek(modelName);
|
||||
}
|
||||
default:
|
||||
throw new Error(`Unsupported AI provider: ${config.provider}`);
|
||||
}
|
||||
@@ -64,7 +71,7 @@ export function getProviderConfigForProvider(provider: AIProvider): AIProviderCo
|
||||
* Used by routes that don't take an explicit model (status check, title generation).
|
||||
*/
|
||||
export function pickAnyConfiguredProvider(): AIProviderConfig | null {
|
||||
const order: AIProvider[] = [AIProvider.GOOGLE, AIProvider.OPENAI, AIProvider.ANTHROPIC];
|
||||
const order: AIProvider[] = [AIProvider.DEEPSEEK, AIProvider.GOOGLE, AIProvider.OPENAI, AIProvider.ANTHROPIC];
|
||||
|
||||
for (const provider of order) {
|
||||
const config = getProviderConfigForProvider(provider);
|
||||
|
||||
@@ -15,7 +15,8 @@ export const AIProvider = {
|
||||
OPENAI: 'openai',
|
||||
ANTHROPIC: 'anthropic',
|
||||
GOOGLE: 'google',
|
||||
MOONSHOT: 'moonshot'
|
||||
MOONSHOT: 'moonshot',
|
||||
DEEPSEEK: 'deepseek'
|
||||
} as const;
|
||||
|
||||
export type AIProvider = (typeof AIProvider)[keyof typeof AIProvider];
|
||||
|
||||
Reference in New Issue
Block a user