New serverless pattern - appsync-events-lambda-agentcore#2990
New serverless pattern - appsync-events-lambda-agentcore#2990pjdavis-aws wants to merge 25 commits intoaws-samples:mainfrom
Conversation
- Wire http_request, calculator, and current_time tools into the agent entrypoint with an updated system prompt - Add strands-agents-tools dependency to requirements - Add integration tests: test_http_request_tool, test_calculator_tool, test_current_time_tool - Print streaming chunks in _collect_response for visibility with -s - Rework session test to use web fetch for more realistic multi-turn
…, and auth section
ellisms
left a comment
There was a problem hiding this comment.
Hi @pjdavis-aws - thanks for the submission. Requesting a few changes. Also, one of the integration tests fails and the console-based test fails to deliver the message to the subscriber. I don't see any errors in the Lambda logs.
| 1. Delete the stack | ||
| ``` | ||
| cdk destroy | ||
| ``` |
There was a problem hiding this comment.
Add instruction to answer 'y' at the confirmation prompt.
| "layers": [powertools_layer], | ||
| "environment": { | ||
| "POWERTOOLS_SERVICE_NAME": construct_id, | ||
| "LOG_LEVEL": "DEBUG", |
There was a problem hiding this comment.
INFO is probably more appropriate here.
|
|
||
| ```bash | ||
| pytest tests/unit -v # unit tests (no deployed stack needed) | ||
| pytest tests/integration -v -s # integration tests with streaming output |
There was a problem hiding this comment.
test_conversation_with_session fails with the following:
> assert complete_2 is not None, "Turn 2 did not complete"
E AssertionError: Turn 2 did not complete
E assert None is not None
tests/integration/test_appsync_events.py:116: AssertionError
========================================================= short test summary info =========================================================
FAILED tests/integration/test_appsync_events.py::test_conversation_with_session - AssertionError: Turn 2 did not complete
There was a problem hiding this comment.
I'll extend the timeout on the tests, this looks to be a latency issue somewhere.
|
|
||
| Figure 3 - AppSync Pub/Sub Editor - Publish panel | ||
|
|
||
| 1. Scroll back down to the bottom of the page to watch the subscription panel — you should see streaming chunk events arrive in real time, followed by a final completion event containing the full response. |
There was a problem hiding this comment.
This did not work for me. I successfully subscribed, but the published messages are not being received.
Co-authored-by: ellisms <114107920+ellisms@users.noreply.github.com>
Co-authored-by: ellisms <114107920+ellisms@users.noreply.github.com>
Co-authored-by: ellisms <114107920+ellisms@users.noreply.github.com>
Co-authored-by: ellisms <114107920+ellisms@users.noreply.github.com>
Co-authored-by: ellisms <114107920+ellisms@users.noreply.github.com>
Co-authored-by: ellisms <114107920+ellisms@users.noreply.github.com>
Issue #, if available:
Description of changes:
Real-time streaming chat using AppSync Events, Lambda, and Bedrock AgentCore Runtime. A Strands agent streams AI responses token-by-token to clients over WebSockets.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.