Skip to content
Discussion options

You must be logged in to vote

Almost certainly a history problem, not a model problem — and the fix is one line.

The cause. You are appending the tool result but not the assistant message that requested it. From the model's side, its request was never recorded. It receives a result that has nothing to attach to, so the only sensible move is to ask again.

The round trip is four messages, not two:

user       "Is XY7Q2M refundable?"
assistant  [toolUse: get_booking]     ← ① the step that gets skipped
user       [toolResult: {...}]        ← ② the one people do append
assistant  "Yes — cancelled by carrier."

The fix:

resp = brt.converse(modelId=MID, messages=messages, toolConfig=tools)

while resp["stopReason"] == "tool_use"

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by akash-coded
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
track: agent-loop The loop, dispatch, termination level: foundational Start here — no prior lab needed type: reference Look-up material
1 participant