fix: update ollama api
This commit is contained in:
@@ -554,6 +554,8 @@ const genOllama = ({
|
|||||||
systemPrompt,
|
systemPrompt,
|
||||||
userPrompt,
|
userPrompt,
|
||||||
model,
|
model,
|
||||||
|
temperature,
|
||||||
|
maxTokens,
|
||||||
customHeader,
|
customHeader,
|
||||||
customBody,
|
customBody,
|
||||||
docInfo,
|
docInfo,
|
||||||
@@ -565,9 +567,19 @@ const genOllama = ({
|
|||||||
|
|
||||||
const data = {
|
const data = {
|
||||||
model,
|
model,
|
||||||
system: systemPrompt,
|
messages: [
|
||||||
prompt: userPrompt,
|
{
|
||||||
think: think,
|
role: "system",
|
||||||
|
content: systemPrompt,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
role: "user",
|
||||||
|
content: userPrompt,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
temperature,
|
||||||
|
max_tokens: maxTokens,
|
||||||
|
think,
|
||||||
stream: false,
|
stream: false,
|
||||||
...customBody,
|
...customBody,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -379,7 +379,7 @@ const defaultOpenaiApi = {
|
|||||||
};
|
};
|
||||||
const defaultOllamaApi = {
|
const defaultOllamaApi = {
|
||||||
...defaultApi,
|
...defaultApi,
|
||||||
url: "http://localhost:11434/api/generate",
|
url: "http://localhost:11434/v1/chat/completions",
|
||||||
model: "llama3.1",
|
model: "llama3.1",
|
||||||
};
|
};
|
||||||
export const DEFAULT_TRANS_APIS = {
|
export const DEFAULT_TRANS_APIS = {
|
||||||
|
|||||||
Reference in New Issue
Block a user