Platform for stateful agents: AI with advanced memory that can learn and self-improve over time.
don't allow bad endpoint addresses during memgpt configure
cpacker3de3fb83153d
diff --git a/memgpt/cli/cli_config.py b/memgpt/cli/cli_config.pyindex 7718a7d36..92dace38f 100644--- a/memgpt/cli/cli_config.py+++ b/memgpt/cli/cli_config.py@@ -123,16 +123,21 @@ def configure_llm_endpoint(config: MemGPTConfig):if model_endpoint_type in DEFAULT_ENDPOINTS:default_model_endpoint = DEFAULT_ENDPOINTS[model_endpoint_type]model_endpoint = questionary.text("Enter default endpoint:", default=default_model_endpoint).ask()+ while not utils.is_valid_url(model_endpoint):+ typer.secho(f"Endpoint must be a valid address", fg=typer.colors.YELLOW)+ model_endpoint = questionary.text("Enter default endpoint:", default=default_model_endpoint).ask()elif config.model_endpoint:model_endpoint = questionary.text("Enter default endpoint:", default=config.model_endpoint).ask()+ while not utils.is_valid_url(model_endpoint):+ typer.secho(f"Endpoint must be a valid address", fg=typer.colors.YELLOW)+ model_endpoint = questionary.text("Enter default endpoint:", default=config.model_endpoint).ask()else:# default_model_endpoint = Nonemodel_endpoint = None- while not model_endpoint:+ model_endpoint = questionary.text("Enter default endpoint:").ask()+ while not utils.is_valid_url(model_endpoint):+ typer.secho(f"Endpoint must be a valid address", fg=typer.colors.YELLOW)model_endpoint = questionary.text("Enter default endpoint:").ask()- if "http://" not in model_endpoint and "https://" not in model_endpoint:- typer.secho(f"Endpoint must be a valid address", fg=typer.colors.YELLOW)- model_endpoint = Noneelse:model_endpoint = default_model_endpointassert model_endpoint, f"Environment variable OPENAI_API_BASE must be set."@@ -330,9 +335,9 @@ def configure_embedding_endpoint(config: MemGPTConfig):# get endpointembedding_endpoint = questionary.text("Enter default endpoint:").ask()- if "http://" not in embedding_endpoint and "https://" not in embedding_endpoint:+ while not utils.is_valid_url(embedding_endpoint):typer.secho(f"Endpoint must be a valid address", fg=typer.colors.YELLOW)- embedding_endpoint = None+ embedding_endpoint = questionary.text("Enter default endpoint:").ask()# get model typedefault_embedding_model = config.embedding_model if config.embedding_model else "BAAI/bge-large-en-v1.5"