AWS Generative AI Developer Professional (AIP-C01) · Free practice question 11 of 12
Returning tool results in Converse
A developer at Ainsley Grocers calls the Converse API with a toolConfig. The model responds with stopReason tool_use and a toolUse block for a get_stock tool. After running the function, how should the developer continue the conversation?
- A.Send an assistant message with the function output as plain text and no tool identifier
- B.Send a user message with a toolResult block that has the same toolUseId
- C.Start a new Converse call with only the function output in the system field
- D.Put the function output in inferenceConfig and resend the original user message
Show answer and explanation
Correct answer: B. Send a user message with a toolResult block that has the same toolUseId
Why: In Converse tool use, the application executes the requested tool and returns the output in a toolResult content block within a user message, referencing the toolUseId from the model's request, along with the prior turns. Assistant-role plain text breaks the protocol. A fresh call without history loses context. inferenceConfig holds generation parameters only.
More free AWS Generative AI Developer Professional (AIP-C01) questions
- Semantic chunking breakpoint threshold
- Word filters for competitor names
- AgentCore Code Interpreter sandbox
- AgentCore Browser for portals without APIs
- SCP rules for global inference profiles
- Choosing a 1-hour prompt cache TTL
- Batch job completion events
- Evaluating responses from external models
- Guardrail versions for production
- GraphRAG with Neptune Analytics
- pgvector iterative scans with filters