Platform for stateful agents: AI with advanced memory that can learn and self-improve over time.
fix: Correct misspelled 'occurred' in printed error messages (#868)
Hamza Kyamanywa030a1c243591
diff --git a/memgpt/llm_api_tools.py b/memgpt/llm_api_tools.pyindex 9230c1454..153c641f0 100644--- a/memgpt/llm_api_tools.py+++ b/memgpt/llm_api_tools.py@@ -29,7 +29,7 @@ def is_context_overflow_error(exception):match_string = "maximum context length"- # Backwards compatability with openai python package/client v0.28 (pre-v1 client migration)+ # Backwards compatibility with openai python package/client v0.28 (pre-v1 client migration)if match_string in str(exception):printd(f"Found '{match_string}' in str(exception)={(str(exception))}")return True@@ -40,21 +40,21 @@ def is_context_overflow_error(exception):try:error_details = exception.response.json()if "error" not in error_details:- printd(f"HTTPError occured, but couldn't find error field: {error_details}")+ printd(f"HTTPError occurred, but couldn't find error field: {error_details}")return Falseelse:error_details = error_details["error"]# Check for the specific error codeif error_details.get("code") == "context_length_exceeded":- printd(f"HTTPError occured, caught error code {error_details.get('code')}")+ printd(f"HTTPError occurred, caught error code {error_details.get('code')}")return True# Soft-check for "maximum context length" inside of the messageelif error_details.get("message") and "maximum context length" in error_details.get("message"):- printd(f"HTTPError occured, found '{match_string}' in error message contents ({error_details})")+ printd(f"HTTPError occurred, found '{match_string}' in error message contents ({error_details})")return Trueelse:- printd(f"HTTPError occured, but unknown error message: {error_details}")+ printd(f"HTTPError occurred, but unknown error message: {error_details}")return Falseexcept ValueError:# JSON decoding faileddiff --git a/memgpt/main.py b/memgpt/main.pyindex aa6558e6e..4f9c6645c 100644--- a/memgpt/main.py+++ b/memgpt/main.py@@ -347,12 +347,12 @@ def run_agent_loop(memgpt_agent, config: MemGPTConfig, first, ms: MetadataStore,new_messages, user_message, skip_next_user_input = process_agent_step(user_message, no_verify)breakexcept KeyboardInterrupt:- print("User interrupt occured.")+ print("User interrupt occurred.")retry = questionary.confirm("Retry agent.step()?").ask()if not retry:breakexcept Exception as e:- print("An exception ocurred when running agent.step(): ")+ print("An exception occurred when running agent.step(): ")traceback.print_exc()retry = questionary.confirm("Retry agent.step()?").ask()if not retry: