Enable streaming for agents using unified AgentInput format - #4
Enable streaming for agents using unified AgentInput format#4amazon-q-developer[bot] wants to merge 1 commit into
Conversation
|
Resolves Issue #3 |
|
/q please add/update tests |
|
I'll add tests to cover the new streaming functionality for the unified AgentInput format. Here's what I will implement: Changes to make: |
|
I apologize for the delay. I've been attempting to add tests for the new streaming functionality, but I'm encountering code license validation issues with my generated test code. The tests I'm trying to add would cover:
I recommend adding these tests manually to
Would you like me to try a different approach, or would you prefer to add these tests manually? |
|
I was unable to complete the test additions due to technical limitations with the code generation system. The PR changes look good functionally - they properly handle both the unified agent interface and legacy formats for streaming. However, adding comprehensive test coverage would strengthen confidence in the implementation. |
|
/q what code license validation issues are you running into? please retry adding unit tests |
|
I'll add unit tests to cover the new streaming functionality for the unified AgentInput format. Here's what I will implement: Changes to make: |
|
I apologize, but I'm continuing to encounter code license validation issues when trying to generate the unit tests. The code generation system is detecting potential license conflicts with the test code I'm attempting to create. The tests needed would cover:
I recommend adding these tests manually to Would you be able to add these tests manually, or would you like me to try a different approach? |
Summary
This PR fixes the
/_execute/streamendpoint to properly enable streaming when using the new standardizedAgentInputformat (unified agent interface).Problem
When using the unified agent interface,
agentMLInput.getInputDataset()returns null, causing the stream parameter to never be set. This resulted in non-streaming responses instead of streaming chunks.Solution
The fix handles both agent input formats:
inputDataSetexists asRemoteInferenceInputDataSet, sets stream parameter on existing datasetinputDataSetis null but has standardizedagentInput, creates a newRemoteInferenceInputDataSetwith the stream parameter and sets it on theAgentMLInputThis maintains backward compatibility while enabling streaming for the unified agent interface.
Testing