feat: support gemini pro

This commit is contained in:
Hk-Gosuto
2023-12-20 19:36:59 +08:00
parent 4044891f85
commit ee08ab4070
14 changed files with 817 additions and 26 deletions

View File

@@ -11,6 +11,7 @@ export const RUNTIME_CONFIG_DOM = "danger-runtime-config";
export const DEFAULT_CORS_HOST = "https://a.nextweb.fun";
export const DEFAULT_API_HOST = `${DEFAULT_CORS_HOST}/api/proxy`;
export const OPENAI_BASE_URL = "https://api.openai.com";
export const GOOGLE_BASE_URL = "https://generativelanguage.googleapis.com";
export enum Path {
Home = "/",
@@ -25,6 +26,7 @@ export enum Path {
export enum ApiPath {
Cors = "/api/cors",
OpenAI = "/api/openai",
GoogleAI = "/api/google",
}
export enum SlotID {
@@ -78,6 +80,11 @@ export const OpenaiPath = {
ListModelPath: "v1/models",
};
export const GooglePath = {
ChatPath: "v1/models/{{model}}:streamGenerateContent",
ListModelPath: "v1/models",
};
export const Azure = {
ExampleEndpoint: "https://{resource-url}/openai/deployments/{deploy-id}",
};
@@ -145,6 +152,10 @@ export const DEFAULT_MODELS = [
name: "gpt-3.5-turbo-16k-0613",
available: true,
},
{
name: "gemini-pro",
available: true,
},
] as const;
export const CHAT_PAGE_SIZE = 15;