forked from open-webui/open-webui
chore: commented code removed
This commit is contained in:
parent
3e5208c11e
commit
0b1abf1643
2 changed files with 0 additions and 62 deletions
|
@ -106,7 +106,6 @@
|
||||||
const sendPromptOllama = async (model, userPrompt, parentId, _chatId) => {
|
const sendPromptOllama = async (model, userPrompt, parentId, _chatId) => {
|
||||||
console.log('sendPromptOllama');
|
console.log('sendPromptOllama');
|
||||||
let responseMessageId = uuidv4();
|
let responseMessageId = uuidv4();
|
||||||
|
|
||||||
let responseMessage = {
|
let responseMessage = {
|
||||||
parentId: parentId,
|
parentId: parentId,
|
||||||
id: responseMessageId,
|
id: responseMessageId,
|
||||||
|
@ -126,38 +125,8 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
await tick();
|
await tick();
|
||||||
|
|
||||||
window.scrollTo({ top: document.body.scrollHeight });
|
window.scrollTo({ top: document.body.scrollHeight });
|
||||||
|
|
||||||
// const res = await fetch(`${$settings?.API_BASE_URL ?? OLLAMA_API_BASE_URL}/generate`, {
|
|
||||||
// method: 'POST',
|
|
||||||
// headers: {
|
|
||||||
// 'Content-Type': 'text/event-stream',
|
|
||||||
// ...($settings.authHeader && { Authorization: $settings.authHeader }),
|
|
||||||
// ...($user && { Authorization: `Bearer ${localStorage.token}` })
|
|
||||||
// },
|
|
||||||
// body: JSON.stringify({
|
|
||||||
// model: model,
|
|
||||||
// prompt: userPrompt,
|
|
||||||
// system: $settings.system ?? undefined,
|
|
||||||
// options: {
|
|
||||||
// seed: $settings.seed ?? undefined,
|
|
||||||
// temperature: $settings.temperature ?? undefined,
|
|
||||||
// repeat_penalty: $settings.repeat_penalty ?? undefined,
|
|
||||||
// top_k: $settings.top_k ?? undefined,
|
|
||||||
// top_p: $settings.top_p ?? undefined,
|
|
||||||
// num_ctx: $settings.num_ctx ?? undefined,
|
|
||||||
// ...($settings.options ?? {})
|
|
||||||
// },
|
|
||||||
// format: $settings.requestFormat ?? undefined,
|
|
||||||
// context:
|
|
||||||
// history.messages[parentId] !== null &&
|
|
||||||
// history.messages[parentId].parentId in history.messages
|
|
||||||
// ? history.messages[history.messages[parentId].parentId]?.context ?? undefined
|
|
||||||
// : undefined
|
|
||||||
// })
|
|
||||||
// });
|
|
||||||
|
|
||||||
const res = await fetch(`${$settings?.API_BASE_URL ?? OLLAMA_API_BASE_URL}/chat`, {
|
const res = await fetch(`${$settings?.API_BASE_URL ?? OLLAMA_API_BASE_URL}/chat`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
|
|
|
@ -133,7 +133,6 @@
|
||||||
const sendPromptOllama = async (model, userPrompt, parentId, _chatId) => {
|
const sendPromptOllama = async (model, userPrompt, parentId, _chatId) => {
|
||||||
console.log('sendPromptOllama');
|
console.log('sendPromptOllama');
|
||||||
let responseMessageId = uuidv4();
|
let responseMessageId = uuidv4();
|
||||||
|
|
||||||
let responseMessage = {
|
let responseMessage = {
|
||||||
parentId: parentId,
|
parentId: parentId,
|
||||||
id: responseMessageId,
|
id: responseMessageId,
|
||||||
|
@ -153,38 +152,8 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
await tick();
|
await tick();
|
||||||
|
|
||||||
window.scrollTo({ top: document.body.scrollHeight });
|
window.scrollTo({ top: document.body.scrollHeight });
|
||||||
|
|
||||||
// const res = await fetch(`${$settings?.API_BASE_URL ?? OLLAMA_API_BASE_URL}/generate`, {
|
|
||||||
// method: 'POST',
|
|
||||||
// headers: {
|
|
||||||
// 'Content-Type': 'text/event-stream',
|
|
||||||
// ...($settings.authHeader && { Authorization: $settings.authHeader }),
|
|
||||||
// ...($user && { Authorization: `Bearer ${localStorage.token}` })
|
|
||||||
// },
|
|
||||||
// body: JSON.stringify({
|
|
||||||
// model: model,
|
|
||||||
// prompt: userPrompt,
|
|
||||||
// system: $settings.system ?? undefined,
|
|
||||||
// options: {
|
|
||||||
// seed: $settings.seed ?? undefined,
|
|
||||||
// temperature: $settings.temperature ?? undefined,
|
|
||||||
// repeat_penalty: $settings.repeat_penalty ?? undefined,
|
|
||||||
// top_k: $settings.top_k ?? undefined,
|
|
||||||
// top_p: $settings.top_p ?? undefined,
|
|
||||||
// num_ctx: $settings.num_ctx ?? undefined,
|
|
||||||
// ...($settings.options ?? {})
|
|
||||||
// },
|
|
||||||
// format: $settings.requestFormat ?? undefined,
|
|
||||||
// context:
|
|
||||||
// history.messages[parentId] !== null &&
|
|
||||||
// history.messages[parentId].parentId in history.messages
|
|
||||||
// ? history.messages[history.messages[parentId].parentId]?.context ?? undefined
|
|
||||||
// : undefined
|
|
||||||
// })
|
|
||||||
// });
|
|
||||||
|
|
||||||
const res = await fetch(`${$settings?.API_BASE_URL ?? OLLAMA_API_BASE_URL}/chat`, {
|
const res = await fetch(`${$settings?.API_BASE_URL ?? OLLAMA_API_BASE_URL}/chat`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
|
|
Loading…
Reference in a new issue