update for custom model, ollama

This commit is contained in:
duanfuxiang
2025-03-20 12:44:53 +08:00
parent 76ecca0da9
commit 570e8d9564
9 changed files with 155 additions and 115 deletions

View File

@@ -10,7 +10,6 @@ export enum ApiProvider {
Groq = "Groq",
Ollama = "Ollama",
OpenAICompatible = "OpenAICompatible",
TransformersJs = "TransformersJs",
}
export type LLMModel = {

View File

@@ -125,14 +125,14 @@ const OpenAICompatibleProviderSchema = z.object({
const OllamaProviderSchema = z.object({
name: z.literal('Ollama'),
apiKey: z.string().catch(''),
apiKey: z.string().catch('ollama'),
baseUrl: z.string().catch(''),
useCustomUrl: z.boolean().catch(false)
}).catch({
name: 'Ollama',
apiKey: '',
apiKey: 'ollama',
baseUrl: '',
useCustomUrl: false
useCustomUrl: true
})
const GroqProviderSchema = z.object({