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

Add warning if no data sources loaded on /attach command #513

Merged
merged 3 commits into from
Nov 27, 2023
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion memgpt/cli/cli_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def configure_llm_endpoint(config: MemGPTConfig):
if config.model_endpoint_type in backend_options:
# set from previous config
default_model_endpoint_type = config.model_endpoint_type
else:
if os.getenv("BACKEND_TYPE") and os.getenv("BACKEND_TYPE") in backend_options:
# set form env variable (ok if none)
default_model_endpoint_type = os.getenv("BACKEND_TYPE")
model_endpoint_type = questionary.select(
Expand Down
7 changes: 7 additions & 0 deletions memgpt/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,13 @@ def run_agent_loop(memgpt_agent, first, no_verify=False, cfg=None, strip_ui=Fals

# TODO: check if agent already has it
data_source_options = StorageConnector.list_loaded_data()
if len(data_source_options) == 0:
typer.secho(
'No sources available. You must load a souce with "memgpt load ..." before running /attach.',
fg=typer.colors.RED,
bold=True,
)
continue
data_source = questionary.select("Select data source", choices=data_source_options).ask()

# attach new data
Expand Down
Loading