Skip to content

Commit 6e3ba00

Browse files
committed
hotfix: Tool results encoding
1 parent da4baa2 commit 6e3ba00

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

docs/api/tools.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ async def handle_tool_call( # noqa: PLR0912
264264
else:
265265
with contextlib.suppress(Exception):
266266
if type(result) not in [str, int, float, bool]:
267-
result = TypeAdapter(t.Any).dump_json(result, indent=2)
267+
result = TypeAdapter(t.Any).dump_json(result).decode(errors="replace")
268268
message.content_parts = [ContentText(text=str(result))]
269269

270270
if self.truncate:

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "rigging"
3-
version = "3.3.1"
3+
version = "3.3.2"
44
description = "LLM Interaction Framework"
55
authors = ["Nick Landers <monoxgas@gmail.com>"]
66
license = "MIT"

rigging/tools/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ async def handle_tool_call( # noqa: PLR0912
439439
else:
440440
with contextlib.suppress(Exception):
441441
if type(result) not in [str, int, float, bool]:
442-
result = TypeAdapter(t.Any).dump_json(result, indent=2)
442+
result = TypeAdapter(t.Any).dump_json(result).decode(errors="replace")
443443
message.content_parts = [ContentText(text=str(result))]
444444

445445
if self.truncate:

0 commit comments

Comments
 (0)