fix: reasoning messages dropped for gpt-4 (#803)

This commit is contained in:
cthomas
2025-01-28 13:39:18 -08:00
committed by GitHub
parent 530886a9cd
commit 5ef26daf03
6 changed files with 18 additions and 17 deletions

View File

@@ -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",

View File

@@ -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}")

View File

@@ -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 tool
tool_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],

View File

@@ -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(

View File

@@ -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,

View File

@@ -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, b
CreateBlock(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_to
CreateBlock(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,
),