File tree Expand file tree Collapse file tree 3 files changed +4
-2
lines changed Expand file tree Collapse file tree 3 files changed +4
-2
lines changed Original file line number Diff line number Diff line change 2
2
3
3
## Unreleased
4
4
5
+ - Fix issue with improper convertion to json of tool call arguments (#737 )
5
6
- Added Google Drive support (#686 )
6
7
- Add LLM Usage to LLMResponseWithMetadata (#700 )
7
8
- Split usage per model type (#715 )
Original file line number Diff line number Diff line change
1
+ import json
1
2
from abc import ABCMeta , abstractmethod
2
3
from typing import Any , Generic
3
4
@@ -99,7 +100,7 @@ def add_tool_use_message(
99
100
"type" : "function" ,
100
101
"function" : {
101
102
"name" : name ,
102
- "arguments" : str (arguments ),
103
+ "arguments" : json . dumps (arguments ),
103
104
},
104
105
}
105
106
],
Original file line number Diff line number Diff line change @@ -675,7 +675,7 @@ def test_base_prompt_with_parser_add_tool_use_message_no_history():
675
675
assert prompt .chat [0 ]["tool_calls" ][0 ]["id" ] == "tool_123"
676
676
assert prompt .chat [0 ]["tool_calls" ][0 ]["type" ] == "function"
677
677
assert prompt .chat [0 ]["tool_calls" ][0 ]["function" ]["name" ] == "test_function"
678
- assert prompt .chat [0 ]["tool_calls" ][0 ]["function" ]["arguments" ] == "{' param': ' value'}"
678
+ assert prompt .chat [0 ]["tool_calls" ][0 ]["function" ]["arguments" ] == '{" param": " value"}'
679
679
680
680
assert prompt .chat [1 ]["role" ] == "tool"
681
681
assert prompt .chat [1 ]["tool_call_id" ] == "tool_123"
You can’t perform that action at this time.
0 commit comments