modify FLAGS

This commit is contained in:
cpacker
2023-10-20 13:47:23 -07:00
parent 797b4b9d53
commit c8287b0c5d
2 changed files with 11 additions and 4 deletions

13
main.py
View File

@@ -19,8 +19,8 @@ import memgpt.humans.humans as humans
from memgpt.persistence_manager import InMemoryStateManager as persistence_manager
FLAGS = flags.FLAGS
flags.DEFINE_string("persona", default=personas.DEFAULT, required=False, help="Specify persona")
flags.DEFINE_string("human", default=humans.DEFAULT, required=False, help="Specify human")
flags.DEFINE_string("persona", default=None, required=False, help="Specify persona")
flags.DEFINE_string("human", default=None, required=False, help="Specify human")
flags.DEFINE_string("model", default=constants.DEFAULT_MEMGPT_MODEL, required=False, help="Specify the LLM model")
flags.DEFINE_boolean("first", default=False, required=False, help="Use -first to send the first message in the sequence")
flags.DEFINE_boolean("debug", default=False, required=False, help="Use -debug to enable debugging output")
@@ -43,7 +43,14 @@ async def main():
logging.getLogger().setLevel(logging.DEBUG)
print("Running... [exit by typing 'exit']")
memgpt_agent = presets.use_preset(presets.DEFAULT, FLAGS.model, personas.get_persona_text(FLAGS.persona), humans.get_human_text(), interface, persistence_manager())
if FLAGS.model != constants.DEFAULT_MEMGPT_MODEL:
print(f"Warning - you are running MemGPT with {FLAGS.model}, which is not officially supported (yet). Expect bugs!")
# Moved defaults out of FLAGS so that we can dynamically select the default persona based on model
chosen_human = FLAGS.human if FLAGS.human is not None else humans.DEFAULT
chosen_persona = FLAGS.persona if FLAGS.persona is not None else (personas.GPT35_DEFAULT if 'gpt-3.5' in flags.MODEL else personas.DEFAULT)
memgpt_agent = presets.use_preset(presets.DEFAULT, FLAGS.model, personas.get_persona_text(chosen_persona), humans.get_human_text(chosen_human), interface, persistence_manager())
print_messages = interface.print_messages
await print_messages(memgpt_agent.messages)

View File

@@ -1,7 +1,7 @@
import os
DEFAULT = 'sam'
GPT35_DEFAULT = 'sam'
GPT35_DEFAULT = 'sam_simple_pov_gpt35'
def get_persona_text(key=DEFAULT):