From f131069d7b766b54015a7042da25470ec47e85f6 Mon Sep 17 00:00:00 2001 From: n4ze3m Date: Wed, 12 Jun 2024 00:48:46 +0530 Subject: [PATCH] refactor: Update font-weight and border width for consistent styling --- src/assets/tailwind.css | 4 ++-- src/services/ollama.ts | 39 +++++++++++++++++++++++++++++++++++---- 2 files changed, 37 insertions(+), 6 deletions(-) diff --git a/src/assets/tailwind.css b/src/assets/tailwind.css index ccc97b5..e6703c6 100644 --- a/src/assets/tailwind.css +++ b/src/assets/tailwind.css @@ -6,7 +6,7 @@ .arimo { font-family: "Arimo", sans-serif; - font-weight: 400; + font-weight: 500; font-style: normal; } @@ -60,7 +60,7 @@ } .animated-gradient-border { - border: 4px solid; + border: 3px solid; border-image-slice: 1; animation: gradient-border 3s infinite; border-radius: 10px; diff --git a/src/services/ollama.ts b/src/services/ollama.ts index e1ce53b..be1da4f 100644 --- a/src/services/ollama.ts +++ b/src/services/ollama.ts @@ -13,11 +13,42 @@ const DEFAULT_RAG_QUESTION_PROMPT = const DEFAUTL_RAG_SYSTEM_PROMPT = `You are a helpful AI assistant. Use the following pieces of context to answer the question at the end. If you don't know the answer, just say you don't know. DO NOT try to make up an answer. If the question is not related to the context, politely respond that you are tuned to only answer questions that are related to the context. {context} Question: {question} Helpful answer:` -const DEFAULT_WEBSEARCH_PROMP = `You are a helpful assistant that can answer any questions. You can use the following search results in case you want to answer questions about anything in real-time. The current date and time are {current_date_time}. +const DEFAULT_WEBSEARCH_PROMP = `You are an AI model who is expert at searching the web and answering user's queries. -Search results: +Generate a response that is informative and relevant to the user's query based on provided search results. the current date and time are {current_date_time}. -{search_results}` +\`search-results\` block provides knowledge from the web search results. You can use this information to generate a meaningful response. + + + {search_results} + +` + +const DEFAULT_WEBSEARCH_FOLLOWUP_PROMPT = `You will give a follow-up question. You need to rephrase the follow-up question if needed so it is a standalone question that can be used by the AI model to search the internet. + +Example: + +Follow-up question: What are the symptoms of a heart attack? + +Rephrased question: Symptoms of a heart attack. + +Follow-up question: Where is the upcoming Olympics being held? + +Rephrased question: Location of the upcoming Olympics. + +Follow-up question: Taylor Swift's latest album? + +Rephrased question: Name of Taylor Swift's latest album. + + +Previous Conversation: + +{chat_history} + +Follow-up question: {question} + +Rephrased question: +` export const getOllamaURL = async () => { const ollamaURL = await storage.get("ollamaURL") @@ -289,7 +320,7 @@ export const setWebSearchPrompt = async (prompt: string) => { export const geWebSearchFollowUpPrompt = async () => { const prompt = await storage.get("webSearchFollowUpPrompt") if (!prompt || prompt.length === 0) { - return DEFAULT_RAG_QUESTION_PROMPT + return DEFAULT_WEBSEARCH_FOLLOWUP_PROMPT } return prompt }