mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-08 03:01:47 +00:00
fix(bedrock): preserve reasoningContent across converse normalization
This commit is contained in:
parent
f0dd5b9c10
commit
8d363f8d54
3 changed files with 33 additions and 2 deletions
|
|
@ -994,6 +994,7 @@ class TestStreamConverseWithCallbacks:
|
|||
events, on_reasoning_delta=lambda t: reasoning.append(t),
|
||||
)
|
||||
assert reasoning == ["Let me think..."]
|
||||
assert result.choices[0].message.reasoning_content == "Let me think..."
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -142,6 +142,24 @@ class TestBedrockNormalize:
|
|||
assert len(nr.tool_calls) == 1
|
||||
assert nr.tool_calls[0].name == "terminal"
|
||||
|
||||
def test_raw_reasoning_content_response(self, transport):
|
||||
raw = {
|
||||
"output": {
|
||||
"message": {
|
||||
"role": "assistant",
|
||||
"content": [
|
||||
{"reasoningContent": {"text": "Let me think..."}},
|
||||
{"text": "Answer."},
|
||||
],
|
||||
}
|
||||
},
|
||||
"stopReason": "end_turn",
|
||||
"usage": {"inputTokens": 10, "outputTokens": 5, "totalTokens": 15},
|
||||
}
|
||||
nr = transport.normalize_response(raw)
|
||||
assert nr.reasoning == "Let me think..."
|
||||
assert nr.content == "Answer."
|
||||
|
||||
def test_already_normalized_response(self, transport):
|
||||
"""Test normalize_response handles already-normalized SimpleNamespace (from dispatch site)."""
|
||||
pre_normalized = SimpleNamespace(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue