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
- Legacy checkpoint where a json object had type
tool_message
but didn't havetool_call_id
. These are saved so in the DB because we used to not have correct custom encoding. In such cases, we cannot create aToolMessage
so we just decode the object using default json decoder. - Checkpoints where a json object has type
tool_message
and hastool_call_id
. This information is used to generate aToolMessage
object.
Closes #72 (closed)
Edited by Halil Coban