From e93dae02e769561738f0ae9e4e097085aa1c8b32 Mon Sep 17 00:00:00 2001 From: Sarah Wooders Date: Tue, 2 Jan 2024 16:14:22 -0800 Subject: [PATCH] Update CLI tests to use OpenAI pre-configured config --- tests/test_cli.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/test_cli.py b/tests/test_cli.py index 0fbb5c56..8a045e2e 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -1,4 +1,5 @@ import subprocess +import os import sys subprocess.check_call([sys.executable, "-m", "pip", "install", "pexpect"]) @@ -6,6 +7,7 @@ import pexpect from .constants import TIMEOUT from .utils import configure_memgpt +from memgpt.config import MemGPTConfig # def test_configure_memgpt(): @@ -14,6 +16,15 @@ from .utils import configure_memgpt def test_save_load(): # configure_memgpt() # rely on configure running first^ + config = MemGPTConfig( + model="gpt-4", + model_endpoint="https://api.openai.com/v1", + model_endpoint_type="openai", + context_window=8192, + openai_key=os.getenv("OPENAI_API_KEY"), + ) + config.save() + child = pexpect.spawn("memgpt run --agent test_save_load --first --strip-ui") child.expect("Enter your message:", timeout=TIMEOUT)