mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-09 21:29:11 +00:00
Improve readability of GPT prompt strings in conversation processor
This commit is contained in:
@@ -19,9 +19,19 @@ def summarize(text, summary_type, user_query=None, api_key=None, temperature=0.5
|
|||||||
|
|
||||||
# Setup Prompt based on Summary Type
|
# Setup Prompt based on Summary Type
|
||||||
if summary_type == "chat":
|
if summary_type == "chat":
|
||||||
prompt = f"You are an AI. Summarize the conversation below from your perspective:\n\n{text}\n\nSummarize the conversation from the AI's first-person perspective:"
|
prompt = f'''
|
||||||
|
You are an AI. Summarize the conversation below from your perspective:
|
||||||
|
|
||||||
|
{text}
|
||||||
|
|
||||||
|
Summarize the conversation from the AI's first-person perspective:'''
|
||||||
elif summary_type == "notes":
|
elif summary_type == "notes":
|
||||||
prompt = f"Summarize the below notes about {user_query}:\n\n{text}\n\nSummarize the notes in second person perspective and use past tense:"
|
prompt = f'''
|
||||||
|
Summarize the below notes about {user_query}:
|
||||||
|
|
||||||
|
{text}
|
||||||
|
|
||||||
|
Summarize the notes in second person perspective and use past tense:'''
|
||||||
|
|
||||||
# Get Response from GPT
|
# Get Response from GPT
|
||||||
response = openai.Completion.create(
|
response = openai.Completion.create(
|
||||||
|
|||||||
Reference in New Issue
Block a user