test_stepfun_history_compat.py 541 B

1234567891011121314151617
  1. from hello_agents import Message
  2. from app.agent.agent import normalize_framework_history
  3. def test_summary_history_is_mapped_to_stepfun_supported_role():
  4. class TestAgent:
  5. _history = [
  6. Message(content="archived context", role="summary"),
  7. Message(content="recent reply", role="assistant"),
  8. ]
  9. agent = TestAgent()
  10. normalize_framework_history(agent)
  11. assert [message.role for message in agent._history] == ["user", "assistant"]
  12. assert agent._history[0].content == "archived context"