"configs/vscode:/vscode.git/clone" did not exist on "6b73a2260bc35364c7662a22ac858e0aa57f91bf"
Commit 737928e8 authored by Timothy J. Baek's avatar Timothy J. Baek
Browse files

feat: better prompt gen template

parent 9087aa0e
...@@ -171,7 +171,7 @@ export const generatePrompt = async (token: string = '', model: string, conversa ...@@ -171,7 +171,7 @@ export const generatePrompt = async (token: string = '', model: string, conversa
let error = null; let error = null;
if (conversation === '') { if (conversation === '') {
conversation = '[You need to start the conversation]'; conversation = '[no existing conversation]';
} }
const res = await fetch(`${OLLAMA_API_BASE_URL}/generate`, { const res = await fetch(`${OLLAMA_API_BASE_URL}/generate`, {
...@@ -182,12 +182,11 @@ export const generatePrompt = async (token: string = '', model: string, conversa ...@@ -182,12 +182,11 @@ export const generatePrompt = async (token: string = '', model: string, conversa
}, },
body: JSON.stringify({ body: JSON.stringify({
model: model, model: model,
prompt: `Based on the following conversation, you are playing the role of 'USER.' Your task is to provide a thoughtful and appropriate response to the last message in the conversation, taking into account the context and tone of the discussion. prompt: `Conversation:
Conversation:
${conversation} ${conversation}
As USER, how would you respond to the latest message? If no previous conversation is provided, start a new conversation with a common, friendly greeting or a relevant question. If there is an existing conversation, continue it by providing a thoughtful, relevant, and engaging response. 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: Response:
` `
}) })
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment