aws-samples / aws-samples/amazon-bedrock-samples

Inline Agents fails with Sonnet 3.5

Open
#449 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
1.5k
Forks
734
Avg merge
1d 6h
Merged PRs (30d)
4

Description

`agents-and-function-calling/bedrock-agents/features-examples/15-invoke-inline-agents/inline-agent-api-usage.ipynb` fails with when attempting to use Sonnet 3.5 instead of Sonnet 3.0:

```
{
"name": "EventStreamError",
"message": "An error occurred (validationException) when calling the InvokeInlineAgent operation: Validation failed for inline agent: messages.2.content.0.tool_result.tool_use_id: Field required
It can be due to following reasons
1. The tools/functions have changed.
2. Model is changed across turns and this action is not supported.
",
"stack": "---------------------------------------------------------------------------
EventStreamError Traceback (most recent call last)
Cell In[2], line 21
4 response = client.invoke_inline_agent(
5 actionGroups=[
6 {
(...)
16 sessionId='session-1'
17 )
19 eventstream = response.get('completion')
---> 21 for event in eventstream:
22 print(event)

File ~/.pyenv/versions/3.11.8/lib/python3.11/site-packages/botocore/eventstream.py:592, in EventStream.__iter__(self)
590 def __iter__(self):
591 for event in self._event_generator:
--> 592 parsed_event = self._parse_event(event)
593 if parsed_event:
594 yield parsed_event

File ~/.pyenv/versions/3.11.8/lib/python3.11/site-packages/botocore/eventstream.py:608, in EventStream._parse_event(self, event)
606 return parsed_response
607 else:
--> 608 raise EventStreamError(parsed_response, self._operation_name)

EventStreamError: An error occurred (validationException) when calling the InvokeInlineAgent operation: Validation failed for inline agent: messages.2.content.0.tool_result.tool_use_id: Field required
It can be due to following reasons
1. The tools/functions have changed.
2. Model is changed across turns and this action is not supported.
"
}
```

Contributor guide

Open the contributing guide

Research direction

Open agents-and-function-calling/bedrock-agents/features-examples/15-invoke-inline-agents/inline-agent-api-usage.ipynb and reproduce the InvokeInlineAgent call with Sonnet 3.5, comparing it with Sonnet 3.0. Investigate the reported messages.2.content.0.tool_result.tool_use_id validation error; done means the notebook runs successfully with Sonnet 3.5.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, jupyter-notebook, python
Domain
ai, cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.