feat: init support for deepseek

This commit is contained in:
Fred
2024-05-15 14:47:43 +08:00
parent 3513c6801e
commit 27ac18d9d7
8 changed files with 54 additions and 25 deletions

View File

@@ -70,7 +70,7 @@ export abstract class LLMApi {
abstract models(): Promise<LLMModel[]>;
}
type ProviderName = "openai" | "azure" | "claude" | "palm";
type ProviderName = "openai" | "azure" | "claude" | "palm" | "deepseek";
interface Model {
name: string;
@@ -162,6 +162,7 @@ export function getHeaders() {
const modelConfig = useChatStore.getState().currentSession().mask.modelConfig;
const isGoogle = modelConfig.model.startsWith("gemini");
const isAzure = accessStore.provider === ServiceProvider.Azure;
const isDeepSeek = accessStore.provider === ServiceProvider.DeepSeek;
const authHeader = isAzure ? "api-key" : "Authorization";
const apiKey = isGoogle
? accessStore.googleApiKey