Skip to content

Commit

Permalink
Fix config tests (#343)
Browse files Browse the repository at this point in the history
Co-authored-by: Vivian Fang <hi@vivi.sh>
  • Loading branch information
sarahwooders and vivi authored Nov 7, 2023
1 parent 143b4de commit 4c34b3d
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 54 deletions.
40 changes: 0 additions & 40 deletions .github/workflows/sarah-test.yml

This file was deleted.

7 changes: 3 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,13 @@ jobs:
steps:
- uses: actions/checkout@v1

- name: Install poetry
run: pipx install poetry

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: "poetry"

- name: Install poetry
run: pip install poetry

- name: Set Poetry config
run: |
Expand Down
11 changes: 2 additions & 9 deletions memgpt/cli/cli_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,18 +76,11 @@ def configure():
endpoint_options += ["openai"]

assert len(endpoint_options) > 0, "No endpoints found. Please enable OpenAI, Azure, or set OPENAI_API_BASE."
if len(endpoint_options) == 1:
default_endpoint = endpoint_options[0]
else:
default_endpoint = questionary.select("Select default inference endpoint:", endpoint_options).ask()
default_endpoint = questionary.select("Select default inference endpoint:", endpoint_options).ask()

# configure embedding provider
endpoint_options.append("local") # can compute embeddings locally
if len(endpoint_options) == 1:
default_embedding_endpoint = endpoint_options[0]
print(f"Using embedding endpoint {default_embedding_endpoint}")
else:
default_embedding_endpoint = questionary.select("Select default embedding endpoint:", endpoint_options).ask()
default_embedding_endpoint = questionary.select("Select default embedding endpoint:", endpoint_options).ask()

# configure embedding dimentions
default_embedding_dim = 1536
Expand Down
1 change: 0 additions & 1 deletion tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ def test_save_load():
child.expect("Empty input received. Try again!", timeout=TIMEOUT)
child.sendline("/save")

child.expect("Saved local", timeout=TIMEOUT)
child.expect("Enter your message:", timeout=TIMEOUT)
child.sendline("/exit")

Expand Down
6 changes: 6 additions & 0 deletions tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ def configure_memgpt(enable_openai=True, enable_azure=False):
else:
child.sendline("n")

child.expect("Select default inference endpoint:", timeout=TIMEOUT)
child.sendline()

child.expect("Select default embedding endpoint:", timeout=TIMEOUT)
child.sendline()

child.expect("Select default preset:", timeout=TIMEOUT)
child.sendline()

Expand Down

0 comments on commit 4c34b3d

Please sign in to comment.