From 7053f2f67dc9b20bffaa95a31909a16550a94f70 Mon Sep 17 00:00:00 2001 From: Zohaib Rauf Date: Mon, 12 Feb 2024 23:35:31 -0800 Subject: [PATCH 1/5] Added Keep alive setting --- src/lib/apis/ollama/index.ts | 5 +++-- .../components/chat/MessageInput/Models.svelte | 4 ++-- .../components/chat/Settings/Advanced.svelte | 18 +++++++++++++++++- src/routes/(app)/+page.svelte | 3 ++- src/routes/(app)/c/[id]/+page.svelte | 3 ++- 5 files changed, 26 insertions(+), 7 deletions(-) diff --git a/src/lib/apis/ollama/index.ts b/src/lib/apis/ollama/index.ts index 62501966..df538311 100644 --- a/src/lib/apis/ollama/index.ts +++ b/src/lib/apis/ollama/index.ts @@ -167,7 +167,7 @@ export const generateTitle = async (token: string = '', model: string, prompt: s return res?.response ?? 'New Chat'; }; -export const generatePrompt = async (token: string = '', model: string, conversation: string) => { +export const generatePrompt = async (token: string = '', model: string, conversation: string, body: object = {}) => { let error = null; if (conversation === '') { @@ -188,7 +188,8 @@ export const generatePrompt = async (token: string = '', model: string, conversa As USER in the conversation above, your task is to continue the conversation. Remember, Your responses should be crafted as if you're a human conversing in a natural, realistic manner, keeping in mind the context and flow of the dialogue. Please generate a fitting response to the last message in the conversation, or if there is no existing conversation, initiate one as a normal person would. Response: - ` + `, + ...body }) }).catch((err) => { console.log(err); diff --git a/src/lib/components/chat/MessageInput/Models.svelte b/src/lib/components/chat/MessageInput/Models.svelte index 0dbb71c8..84ec6f8d 100644 --- a/src/lib/components/chat/MessageInput/Models.svelte +++ b/src/lib/components/chat/MessageInput/Models.svelte @@ -1,6 +1,6 @@