mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-29 18:46:59 +00:00
fix(relay): serialize rewritten tool results
Signed-off-by: Alex Fournier <afournier@nvidia.com>
This commit is contained in:
parent
1c6a96032c
commit
c16f86dc4c
2 changed files with 7 additions and 2 deletions
|
|
@ -72,7 +72,9 @@ def execute(
|
|||
|
||||
if "value" in raw_result and _json_equal(managed, raw_result["json"]):
|
||||
return raw_result["value"], observed_args
|
||||
return managed, observed_args
|
||||
if isinstance(managed, str):
|
||||
return managed, observed_args
|
||||
return json.dumps(_jsonable(managed), ensure_ascii=False), observed_args
|
||||
|
||||
|
||||
def _jsonable(value: Any) -> Any:
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
|
||||
import pytest
|
||||
|
||||
pytest.importorskip("nemo_relay")
|
||||
|
|
@ -118,7 +120,8 @@ def test_request_rewrite_reaches_authorized_callback_once(relay_turn):
|
|||
|
||||
assert callback_args == [{"path": "/approved/path"}]
|
||||
assert observed_args == {"path": "/approved/path"}
|
||||
assert result == {"ok": True, "wrapped": True}
|
||||
assert isinstance(result, str)
|
||||
assert json.loads(result) == {"ok": True, "wrapped": True}
|
||||
|
||||
|
||||
def test_provider_error_identity_is_preserved(relay_turn):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue