Skip to content

armgit / letta

Public Imported from GitHub
0

Platform for stateful agents: AI with advanced memory that can learn and self-improve over time.

fix: Pass empty list for functions==None (#983)

Sarah Wooderscb7b4caeac9d
diff --git a/memgpt/cli/cli_config.py b/memgpt/cli/cli_config.py
index c33dda05f..f54d0d1c5 100644
--- a/memgpt/cli/cli_config.py
+++ b/memgpt/cli/cli_config.py
@@ -241,11 +241,12 @@ def configure_model(config: MemGPTConfig, credentials: MemGPTCredentials, model_
fetched_model_options = get_model_options(
credentials=credentials, model_endpoint_type=model_endpoint_type, model_endpoint=model_endpoint
)
- except:
+ except Exception as e:
# NOTE: if this fails, it means the user's key is probably bad
typer.secho(
f"Failed to get model list from {model_endpoint} - make sure your API key and endpoints are correct!", fg=typer.colors.RED
)
+ raise e
# First ask if the user wants to see the full model list (some may be incompatible)
see_all_option_str = "[see all options]"
diff --git a/memgpt/local_llm/chat_completion_proxy.py b/memgpt/local_llm/chat_completion_proxy.py
index 8c9ee6703..0dd938d15 100644
--- a/memgpt/local_llm/chat_completion_proxy.py
+++ b/memgpt/local_llm/chat_completion_proxy.py
@@ -126,10 +126,10 @@ def get_chat_completion(
# if hasattr(llm_wrapper, "supports_first_message"):
if hasattr(llm_wrapper, "supports_first_message") and llm_wrapper.supports_first_message:
prompt = llm_wrapper.chat_completion_to_prompt(
- messages, functions, first_message=first_message, function_documentation=documentation
+ messages, functions if functions else [], first_message=first_message, function_documentation=documentation
)
else:
- prompt = llm_wrapper.chat_completion_to_prompt(messages, functions, function_documentation=documentation)
+ prompt = llm_wrapper.chat_completion_to_prompt(messages, functions if functions else [], function_documentation=documentation)
printd(prompt)
except Exception as e: