Add changelog
This commit is contained in:
committed by
Mark Backman
parent
84538b0ca8
commit
765fbeec63
16
changelog/3457.changed.md
Normal file
16
changelog/3457.changed.md
Normal file
@@ -0,0 +1,16 @@
|
||||
# Reduce Call Tool Result Context Size by Allowing UTF-8 in JSON Serialization
|
||||
|
||||
This PR changes tool result serialization to prevent UTF-8 code points from being escaped during serialization. This drastically reduces the context size when returning a response that contains languages other than English.
|
||||
|
||||
We have been running a monkey-patched version in production and it helped us improve the agent accuracy and control cost better.
|
||||
|
||||
```
|
||||
>>> data = { "message": "أهلًا بالعالم" }
|
||||
>>> json.dumps(data)
|
||||
'{"message": "\\u0623\\u0647\\u0644\\u064b\\u0627 \\u0628\\u0627\\u0644\\u0639\\u0627\\u0644\\u0645"}'
|
||||
>>>
|
||||
>>>
|
||||
>>>
|
||||
>>> json.dumps(data, ensure_ascii=False)
|
||||
'{"message": "أهلًا بالعالم"}'
|
||||
```
|
||||
Reference in New Issue
Block a user