Skip to content

test: add case for tool message decoding

We use custom decoder for decoding checkpoints with SystemMessage, HumanMessage, AIMessage and ToolMessage

In http client tests, we have a test case for SystemMessage only. Since HumanMessage and AIMessage is decoded the same way, we don't necessarily have separate tests for them. However, it would be good to have test cases for ToolMessage because it's decoded differently, as the ToolMessage requires tool_call_id

This MR adds two cases

  1. Legacy checkpoint where a json object had type tool_message but didn't have tool_call_id. These are saved so in the DB because we used to not have correct custom encoding. In such cases, we cannot create a ToolMessage so we just decode the object using default json decoder.
  2. Checkpoints where a json object has type tool_message and has tool_call_id. This information is used to generate a ToolMessage object.

Closes #72 (closed)

Edited by Halil Coban

Merge request reports

Loading