Platform for stateful agents: AI with advanced memory that can learn and self-improve over time.
Better error message printing for function call failing (#291)
Vivian Fang87fc69baaee3
diff --git a/memgpt/agent.py b/memgpt/agent.pyindex 048134dc4..ecf13e86e 100644--- a/memgpt/agent.py+++ b/memgpt/agent.py@@ -8,6 +8,7 @@ import osimport requestsimport jsonimport threading+import tracebackimport openaifrom memgpt.persistence_manager import LocalStateManager@@ -568,7 +569,8 @@ class Agent(object):function_failed = Falseexcept Exception as e:error_msg = f"Error calling function {function_name} with args {function_args}: {str(e)}"- printd(error_msg)+ error_msg_user = f"{error_msg}\n{traceback.format_exc()}"+ printd(error_msg_user)function_response = package_function_response(False, error_msg)messages.append({@@ -996,7 +998,8 @@ class AgentAsync(Agent):function_failed = Falseexcept Exception as e:error_msg = f"Error calling function {function_name} with args {function_args}: {str(e)}"- printd(error_msg)+ error_msg_user = f"{error_msg}\n{traceback.format_exc()}"+ printd(error_msg_user)function_response = package_function_response(False, error_msg)messages.append({