chroe: update model name

This commit is contained in:
Fred Liang
2023-12-24 04:22:12 +08:00
parent 7d9a2132cb
commit ae19a0dc5f
8 changed files with 19 additions and 19 deletions

View File

@@ -7,7 +7,7 @@ import {
} from "../constant";
import { ChatMessage, ModelType, useAccessStore, useChatStore } from "../store";
import { ChatGPTApi } from "./platforms/openai";
import { GeminiApi } from "./platforms/google";
import { GeminiProApi } from "./platforms/google";
export const ROLES = ["system", "user", "assistant"] as const;
export type MessageRole = (typeof ROLES)[number];
@@ -86,8 +86,8 @@ export class ClientApi {
public llm: LLMApi;
constructor(provider: ModelProvider = ModelProvider.GPT) {
if (provider === ModelProvider.Gemini) {
this.llm = new GeminiApi();
if (provider === ModelProvider.GeminiPro) {
this.llm = new GeminiProApi();
return;
}
this.llm = new ChatGPTApi();
@@ -146,7 +146,7 @@ export function getHeaders() {
"x-requested-with": "XMLHttpRequest",
};
const modelConfig = useChatStore.getState().currentSession().mask.modelConfig;
const isGoogle = modelConfig.model === "gemini";
const isGoogle = modelConfig.model === "gemini-pro";
const isAzure = accessStore.provider === ServiceProvider.Azure;
const authHeader = isAzure ? "api-key" : "Authorization";
const apiKey = isGoogle