Platform for stateful agents: AI with advanced memory that can learn and self-improve over time.
fix: reasoning messages dropped for gpt-4 (#803)
cthomas92965bd69cdf
diff --git a/examples/docs/agent_advanced.py b/examples/docs/agent_advanced.pyindex 34b768b12..a3d4adb4e 100644--- a/examples/docs/agent_advanced.py+++ b/examples/docs/agent_advanced.py@@ -27,7 +27,7 @@ agent_state = client.agents.create(),],# LLM model & endpoint configuration- model="openai/gpt-4",+ model="openai/gpt-4o-mini",context_window_limit=8000,# embedding model & endpoint configuration (cannot be changed)embedding="openai/text-embedding-ada-002",diff --git a/examples/docs/agent_basic.py b/examples/docs/agent_basic.pyindex 978d38329..3d2808101 100644--- a/examples/docs/agent_basic.py+++ b/examples/docs/agent_basic.py@@ -18,7 +18,7 @@ agent_state = client.agents.create(),],# set automatic defaults for LLM/embedding config- model="openai/gpt-4",+ model="openai/gpt-4o-mini",embedding="openai/text-embedding-ada-002",)print(f"Created agent with name {agent_state.name} and unique ID {agent_state.id}")diff --git a/examples/docs/tools.py b/examples/docs/tools.pyindex bc9591336..0f0a3086d 100644--- a/examples/docs/tools.py+++ b/examples/docs/tools.py@@ -45,7 +45,7 @@ agent_state = client.agents.create(),],# set automatic defaults for LLM/embedding config- model="openai/gpt-4",+ model="openai/gpt-4o-mini",embedding="openai/text-embedding-ada-002",# create the agent with an additional tooltool_ids=[tool.id],@@ -88,7 +88,7 @@ agent_state = client.agents.create(value="username: sarah",),],- model="openai/gpt-4",+ model="openai/gpt-4o-mini",embedding="openai/text-embedding-ada-002",include_base_tools=False,tool_ids=[tool.id, send_message_tool],diff --git a/letta/schemas/llm_config.py b/letta/schemas/llm_config.pyindex 70aa86ffc..6e87e629e 100644--- a/letta/schemas/llm_config.py+++ b/letta/schemas/llm_config.py@@ -88,6 +88,7 @@ class LLMConfig(BaseModel):model_endpoint="https://api.openai.com/v1",model_wrapper=None,context_window=8192,+ put_inner_thoughts_in_kwargs=True,)elif model_name == "gpt-4o-mini":return cls(diff --git a/tests/test_sdk_client.py b/tests/test_sdk_client.pyindex c38d16459..520d71d4a 100644--- a/tests/test_sdk_client.py+++ b/tests/test_sdk_client.py@@ -48,7 +48,7 @@ def agent(client: LettaSDKClient):value="username: sarah",),],- model="openai/gpt-4",+ model="openai/gpt-4o-mini",embedding="openai/text-embedding-ada-002",)yield agent_state@@ -74,7 +74,7 @@ def test_shared_blocks(client: LettaSDKClient):),],block_ids=[block.id],- model="openai/gpt-4",+ model="openai/gpt-4o-mini",embedding="openai/text-embedding-ada-002",)agent_state2 = client.agents.create(@@ -86,7 +86,7 @@ def test_shared_blocks(client: LettaSDKClient):),],block_ids=[block.id],- model="openai/gpt-4",+ model="openai/gpt-4o-mini",embedding="openai/text-embedding-ada-002",)@@ -138,7 +138,7 @@ def test_add_and_manage_tags_for_agent(client: LettaSDKClient):value="username: sarah",),],- model="openai/gpt-4",+ model="openai/gpt-4o-mini",embedding="openai/text-embedding-ada-002",)assert len(agent.tags) == 0@@ -190,7 +190,7 @@ def test_agent_tags(client: LettaSDKClient):value="username: sarah",),],- model="openai/gpt-4",+ model="openai/gpt-4o-mini",embedding="openai/text-embedding-ada-002",tags=["test", "agent1", "production"],)@@ -202,7 +202,7 @@ def test_agent_tags(client: LettaSDKClient):value="username: sarah",),],- model="openai/gpt-4",+ model="openai/gpt-4o-mini",embedding="openai/text-embedding-ada-002",tags=["test", "agent2", "development"],)@@ -214,7 +214,7 @@ def test_agent_tags(client: LettaSDKClient):value="username: sarah",),],- model="openai/gpt-4",+ model="openai/gpt-4o-mini",embedding="openai/text-embedding-ada-002",tags=["test", "agent3", "production"],)@@ -569,7 +569,7 @@ def test_agent_creation(client: LettaSDKClient):agent = client.agents.create(name=f"test_agent_{str(uuid.uuid4())}",memory_blocks=[offline_persona_block, mindy_block],- model="openai/gpt-4",+ model="openai/gpt-4o-mini",embedding="openai/text-embedding-ada-002",tool_ids=[tool1.id, tool2.id],include_base_tools=False,diff --git a/tests/test_server.py b/tests/test_server.pyindex 8f7e1e3c8..7e8c30839 100644--- a/tests/test_server.py+++ b/tests/test_server.py@@ -332,7 +332,7 @@ def agent_id(server, user_id, base_tools):name="test_agent",tool_ids=[t.id for t in base_tools],memory_blocks=[],- model="openai/gpt-4o",+ model="openai/gpt-4o-mini",embedding="openai/text-embedding-ada-002",),actor=actor,@@ -353,7 +353,7 @@ def other_agent_id(server, user_id, base_tools):name="test_agent_other",tool_ids=[t.id for t in base_tools],memory_blocks=[],- model="openai/gpt-4o",+ model="openai/gpt-4o-mini",embedding="openai/text-embedding-ada-002",),actor=actor,@@ -552,7 +552,7 @@ def test_delete_agent_same_org(server: SyncServer, org_id: str, user: User):request=CreateAgent(name="nonexistent_tools_agent",memory_blocks=[],- model="openai/gpt-4o",+ model="openai/gpt-4o-mini",embedding="openai/text-embedding-ada-002",),actor=user,@@ -920,7 +920,7 @@ def test_memory_rebuild_count(server, user, mock_e2b_api_key_none, base_tools, bCreateBlock(label="human", value="The human's name is Bob."),CreateBlock(label="persona", value="My name is Alice."),],- model="openai/gpt-4o",+ model="openai/gpt-4o-mini",embedding="openai/text-embedding-ada-002",),actor=actor,@@ -1101,7 +1101,7 @@ def test_add_remove_tools_update_agent(server: SyncServer, user_id: str, base_toCreateBlock(label="human", value="The human's name is Bob."),CreateBlock(label="persona", value="My name is Alice."),],- model="openai/gpt-4o",+ model="openai/gpt-4o-mini",embedding="openai/text-embedding-ada-002",include_base_tools=False,),