address review

This commit is contained in:
cpacker
2023-10-20 14:17:18 -07:00
parent aaafabccfc
commit f9c689db2a
2 changed files with 7 additions and 17 deletions

View File

@@ -50,6 +50,7 @@ def construct_system_with_memory(
def initialize_message_sequence(
model,
system,
memory,
archival_memory=None,
@@ -64,8 +65,10 @@ def initialize_message_sequence(
first_user_message = get_login_event() # event letting MemGPT know the user just logged in
if include_initial_boot_message:
# initial_boot_messages = get_initial_boot_messages('startup_with_send_message')
initial_boot_messages = get_initial_boot_messages('startup_with_send_message_gpt35')
if 'gpt-3.5' in model:
initial_boot_messages = get_initial_boot_messages('startup_with_send_message_gpt35')
else:
initial_boot_messages = get_initial_boot_messages('startup_with_send_message')
messages = [
{"role": "system", "content": full_system_message},
] + initial_boot_messages + [
@@ -126,6 +129,7 @@ class AgentAsync(object):
self.memory = initialize_memory(persona_notes, human_notes)
# Once the memory object is initialize, use it to "bake" the system message
self._messages = initialize_message_sequence(
self.model,
self.system,
self.memory,
)
@@ -212,6 +216,7 @@ class AgentAsync(object):
"""Rebuilds the system message with the latest memory object"""
curr_system_message = self.messages[0] # this is the system + memory bank, not just the system prompt
new_system_message = initialize_message_sequence(
self.model,
self.system,
self.memory,
archival_memory=self.persistence_manager.archival_memory,

View File

@@ -33,21 +33,6 @@ def get_initial_boot_messages(version='startup'):
elif version == 'startup_with_send_message_gpt35':
messages = [
# first message includes both inner monologue and function call to send_message
# {
# "role": "assistant",
# "content": INITIAL_BOOT_MESSAGE_SEND_MESSAGE_THOUGHT,
# "function_call": {
# "name": "send_message",
# "arguments": "{\n \"message\": \"" + f"{INITIAL_BOOT_MESSAGE_SEND_MESSAGE_FIRST_MSG}" + "\"\n}"
# }
# },
# # obligatory function return message
# {
# "role": "function",
# "name": "send_message",
# "content": package_function_response(True, None)
# },
# first message includes both inner monologue and function call to send_message
{
"role": "assistant",