fix: update ollama api

This commit is contained in:
Gabe
2025-09-03 14:02:55 +08:00
parent 6dd6b73c2f
commit b631703aa6
2 changed files with 16 additions and 4 deletions

View File

@@ -554,6 +554,8 @@ const genOllama = ({
systemPrompt,
userPrompt,
model,
temperature,
maxTokens,
customHeader,
customBody,
docInfo,
@@ -565,9 +567,19 @@ const genOllama = ({
const data = {
model,
system: systemPrompt,
prompt: userPrompt,
think: think,
messages: [
{
role: "system",
content: systemPrompt,
},
{
role: "user",
content: userPrompt,
},
],
temperature,
max_tokens: maxTokens,
think,
stream: false,
...customBody,
};

View File

@@ -379,7 +379,7 @@ const defaultOpenaiApi = {
};
const defaultOllamaApi = {
...defaultApi,
url: "http://localhost:11434/api/generate",
url: "http://localhost:11434/v1/chat/completions",
model: "llama3.1",
};
export const DEFAULT_TRANS_APIS = {