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: convert `Message` objects to dicts for local LLMs (#1251)

Sarah Wooders2f0c6296c83c
diff --git a/memgpt/local_llm/chat_completion_proxy.py b/memgpt/local_llm/chat_completion_proxy.py
index b6fa2a758..47b8c9d56 100644
--- a/memgpt/local_llm/chat_completion_proxy.py
+++ b/memgpt/local_llm/chat_completion_proxy.py
@@ -58,6 +58,10 @@ def get_chat_completion(
global has_shown_warning
grammar = None
+ # TODO: eventually just process Message object
+ if not isinstance(messages[0], dict):
+ messages = [m.to_openai_dict() for m in messages]
+
if function_call is not None and function_call != "auto":
raise ValueError(f"function_call == {function_call} not supported (auto or None only)")