fix: Resolved
This commit is contained in:
@@ -58,7 +58,10 @@ export function getGroqModel(apiKey: string, model: string) {
|
||||
}
|
||||
|
||||
export function getOllamaModel(baseURL: string, model: string) {
|
||||
let Ollama = ollama(model);
|
||||
let Ollama = ollama(model, {
|
||||
numCtx: 32768,
|
||||
});
|
||||
|
||||
Ollama.config.baseURL = `${baseURL}/api`;
|
||||
return Ollama;
|
||||
}
|
||||
@@ -80,6 +83,15 @@ export function getOpenRouterModel(apiKey: string, model: string) {
|
||||
return openRouter.chat(model);
|
||||
}
|
||||
|
||||
export function getXAIModel(apiKey: string, model: string) {
|
||||
const openai = createOpenAI({
|
||||
baseURL: 'https://api.x.ai/v1',
|
||||
apiKey,
|
||||
});
|
||||
|
||||
return openai(model);
|
||||
}
|
||||
|
||||
export function getModel(provider: string, model: string, env: Env, apiKeys?: Record<string, string>) {
|
||||
const apiKey = getAPIKey(env, provider, apiKeys);
|
||||
const baseURL = getBaseURL(env, provider);
|
||||
@@ -101,6 +113,8 @@ export function getModel(provider: string, model: string, env: Env, apiKeys?: Re
|
||||
return getDeepseekModel(apiKey, model)
|
||||
case 'Mistral':
|
||||
return getMistralModel(apiKey, model);
|
||||
case 'xAI':
|
||||
return getXAIModel(apiKey, model);
|
||||
default:
|
||||
return getOllamaModel(baseURL, model);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user