Skip to content

Commit

Permalink
Add regression test
Browse files Browse the repository at this point in the history
  • Loading branch information
albertvillanova committed Mar 3, 2025
1 parent d4ca3d9 commit e5808bf
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/test_memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,28 @@ def test_action_step_to_messages():
assert "image" in image_content


def test_action_step_to_messages_no_tool_calls_with_observations():
action_step = ActionStep(
model_input_messages=None,
tool_calls=None,
start_time=None,
end_time=None,
step_number=None,
error=None,
duration=None,
model_output_message=None,
model_output=None,
observations="This is an observation.",
observations_images=None,
action_output=None,
)
messages = action_step.to_messages()
assert len(messages) == 1
observation_message = messages[0]
assert observation_message["role"] == MessageRole.TOOL_RESPONSE
assert "Observation:\nThis is an observation." in observation_message["content"][0]["text"]


def test_planning_step_to_messages():
planning_step = PlanningStep(
model_input_messages=[Message(role=MessageRole.USER, content="Hello")],
Expand Down

0 comments on commit e5808bf

Please sign in to comment.