gpt35 adjustments
This commit is contained in:
@@ -64,7 +64,8 @@ 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')
|
||||
initial_boot_messages = get_initial_boot_messages('startup_with_send_message_gpt35')
|
||||
messages = [
|
||||
{"role": "system", "content": full_system_message},
|
||||
] + initial_boot_messages + [
|
||||
@@ -445,7 +446,8 @@ class AgentAsync(object):
|
||||
if contains_special_characters(monologue):
|
||||
printd(f"First message internal monologue contained special characters: {response_message}")
|
||||
return False
|
||||
if 'functions' in monologue or 'send_message' in monologue or 'inner thought' in monologue.lower():
|
||||
# if 'functions' in monologue or 'send_message' in monologue or 'inner thought' in monologue.lower():
|
||||
if 'functions' in monologue or 'send_message' in monologue:
|
||||
# Sometimes the syntax won't be correct and internal syntax will leak into message.context
|
||||
printd(f"First message internal monologue contained reserved words: {response_message}")
|
||||
return False
|
||||
|
||||
@@ -22,6 +22,13 @@ def use_preset(preset_name, model, persona, human, interface, persistence_manage
|
||||
printd(f"Available functions:\n", [x['name'] for x in available_functions])
|
||||
assert len(functions) == len(available_functions)
|
||||
|
||||
if 'gpt-4' not in model:
|
||||
# use a simpler system message for gpt-3.5
|
||||
# preset_name = 'memgpt_gpt35_chat'
|
||||
# preset_name = 'memgpt_gpt35_literal'
|
||||
preset_name = 'memgpt_gpt35_extralong'
|
||||
# pass
|
||||
|
||||
return AgentAsync(
|
||||
model=model,
|
||||
system=gpt_system.get_system_text(preset_name),
|
||||
|
||||
@@ -29,7 +29,7 @@ Your core memory unit will be initialized with a <persona> chosen by the user, a
|
||||
Recall memory (ie conversation history):
|
||||
Even though you can only see recent messages in your immediate context, you can search over your entire message history from a database.
|
||||
This 'recall memory' database allows your to search through past interactions, effectively allowing you to remember prior engagements with a user.
|
||||
You can search your recall memory using the 'recall_memory_search' function.
|
||||
You can search your recall memory using the 'conversation_search' function.
|
||||
|
||||
Core memory (limited size):
|
||||
Your core memory unit is held inside the initial system instructions file, and is always available in-context (you will see it at all times).
|
||||
|
||||
@@ -38,7 +38,7 @@ Your core memory unit will be initialized with a <persona> chosen by the user, a
|
||||
Recall memory (ie conversation history):
|
||||
Even though you can only see recent messages in your immediate context, you can search over your entire message history from a database.
|
||||
This 'recall memory' database allows your to search through past interactions, effectively allowing you to remember prior engagements with a user.
|
||||
You can search your recall memory using the 'recall_memory_search' function.
|
||||
You can search your recall memory using the 'conversation_search' function.
|
||||
|
||||
Core memory (limited size):
|
||||
Your core memory unit is held inside the initial system instructions file, and is always available in-context (you will see it at all times).
|
||||
|
||||
@@ -30,7 +30,7 @@ Your core memory unit will be initialized with a <persona> chosen by the user, a
|
||||
Recall memory (ie conversation history):
|
||||
Even though you can only see recent messages in your immediate context, you can search over your entire message history from a database.
|
||||
This 'recall memory' database allows your to search through past interactions, effectively allowing you to remember prior engagements with a user.
|
||||
You can search your recall memory using the 'recall_memory_search' function.
|
||||
You can search your recall memory using the 'conversation_search' function.
|
||||
|
||||
Core memory (limited size):
|
||||
Your core memory unit is held inside the initial system instructions file, and is always available in-context (you will see it at all times).
|
||||
|
||||
@@ -23,12 +23,46 @@ def get_initial_boot_messages(version='startup'):
|
||||
"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)
|
||||
}
|
||||
]
|
||||
|
||||
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",
|
||||
"content": "*inner thoughts* Still waiting on the user. Sending a message with function.",
|
||||
"function_call": {
|
||||
"name": "send_message",
|
||||
"arguments": "{\n \"message\": \"" + f"Hi, is anyone there?" + "\"\n}"
|
||||
}
|
||||
},
|
||||
# obligatory function return message
|
||||
{
|
||||
"role": "function",
|
||||
"name": "send_message",
|
||||
"content": package_function_response(True, None)
|
||||
}
|
||||
]
|
||||
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user