Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Throw more informative error when local model envs are/are not set #418

Merged
merged 1 commit into from
Nov 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions memgpt/cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,16 @@ def run(
if config.model_endpoint == "azure":
configure_azure_support()

# TODO: remove once model calling logic is cleaner
if memgpt_agent.model != "local":
assert (
os.getenv("OPENAI_API_BASE") is None and os.getenv("BACKEND_TYPE") is None
), f"Please make sure your enviornment variables OPENAI_API_BASE and BACKEND_TYPE are unset"
else:
assert os.getenv("OPENAI_API_BASE") and os.getenv(
"BACKEND_TYPE"
), f"Please make sure your enviornment variables OPENAI_API_BASE and BACKEND_TYPE are set to run a model with a local endpoint"

run_agent_loop(memgpt_agent, first, no_verify, config) # TODO: add back no_verify


Expand Down
Loading