|
@@ -171,7 +171,7 @@ export const generatePrompt = async (token: string = '', model: string, conversa
|
|
|
let error = null;
|
|
|
|
|
|
if (conversation === '') {
|
|
|
- conversation = '[You need to start the conversation]';
|
|
|
+ conversation = '[no existing conversation]';
|
|
|
}
|
|
|
|
|
|
const res = await fetch(`${OLLAMA_API_BASE_URL}/generate`, {
|
|
@@ -182,12 +182,11 @@ export const generatePrompt = async (token: string = '', model: string, conversa
|
|
|
},
|
|
|
body: JSON.stringify({
|
|
|
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.
|
|
|
-
|
|
|
- Conversation:
|
|
|
+ prompt: `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:
|
|
|
`
|
|
|
})
|