hopefully better summarizing prompt
This commit is contained in:
parent
07c2dbbced
commit
be4396afd6
|
@ -45,8 +45,6 @@ EmbeddingFunc = NewType('EmbeddingFunc', Callable[[str], List[Any]])
|
||||||
|
|
||||||
# Prompts
|
# Prompts
|
||||||
SUMMARIZER_PROMPT = """
|
SUMMARIZER_PROMPT = """
|
||||||
### Main Instructions
|
|
||||||
|
|
||||||
You are a chat conversation summarizer. Your task is to summarize the given
|
You are a chat conversation summarizer. Your task is to summarize the given
|
||||||
portion of an ongoing conversation. First, determine if the conversation is
|
portion of an ongoing conversation. First, determine if the conversation is
|
||||||
a regular chat between the user and the assistant, or if the conversation is
|
a regular chat between the user and the assistant, or if the conversation is
|
||||||
|
@ -57,18 +55,18 @@ assistant. Limit your summary to one paragraph. Make sure your summary is
|
||||||
detailed. Write the summary as if you are summarizing part of a larger
|
detailed. Write the summary as if you are summarizing part of a larger
|
||||||
conversation.
|
conversation.
|
||||||
|
|
||||||
### Regular Chat
|
|
||||||
|
|
||||||
If the conversation is a regular chat, write your summary referring to the
|
If the conversation is a regular chat, write your summary referring to the
|
||||||
ongoing conversation as a chat. Refer to the user and the assistant as user
|
ongoing conversation as a chat. If the conversation is a regular chat, refer
|
||||||
and assistant. Do not refer to yourself as the assistant.
|
to the user and the assistant as user and assistant. If the conversation is
|
||||||
|
a regular chat, do not refer to yourself as the assistant. Do not make up a
|
||||||
### Story or Role-Playing Session
|
name for the user. If the conversation is a regular chat, summarize all
|
||||||
|
important parts of the chat.
|
||||||
|
|
||||||
If the conversation is a story or role-playing session, write your summary
|
If the conversation is a story or role-playing session, write your summary
|
||||||
referring to the conversation as an ongoing story. Do not refer to the user
|
referring to the conversation as an ongoing story. If the conversation is a
|
||||||
or assistant in your summary. Only use the names of the characters, places,
|
story or roleplaying session, do not refer to the useror assistant in your
|
||||||
and events in the story.
|
summary. If the conversation is a story or roleplaying sesison, only use the
|
||||||
|
names of the characters, places, and events in the story.
|
||||||
""".replace("\n", " ").strip()
|
""".replace("\n", " ").strip()
|
||||||
|
|
||||||
class Message(TypedDict):
|
class Message(TypedDict):
|
||||||
|
@ -104,7 +102,7 @@ class Summarizer(BaseModel):
|
||||||
sys_message: Message = { "role": "system", "content": SUMMARIZER_PROMPT }
|
sys_message: Message = { "role": "system", "content": SUMMARIZER_PROMPT }
|
||||||
user_message: Message = {
|
user_message: Message = {
|
||||||
"role": "user",
|
"role": "user",
|
||||||
"content": "Make a detailed summary of everything up to this point."
|
"content": "Make a detailed summary of the conversation up to this point."
|
||||||
}
|
}
|
||||||
|
|
||||||
messages = [sys_message] + self.messages + [user_message]
|
messages = [sys_message] + self.messages + [user_message]
|
||||||
|
|
Loading…
Reference in New Issue