add AWS AgentCore zero code example#131
Conversation
|
Imports work. OTel setup follows the same pattern as the existing Strands example. roll_die and check_prime tool logic is correct. |
|
Tested the OTel pipeline locally (agentevals serve --dev) using a separate script with Strands and a Nebius Cloud endpoint in place of BedrockModel. The actual run.py was not executed end to end. What was verified:
What still needs AWS to verify:
I think, it will work. |
7790773 to
e79db6f
Compare
6f8a84d to
18b69d7
Compare
|
Hi, thanks for the PR! Apologies for not being clearer in #93, but this PR seems to be adding another Strands example via Bedrock models, but not really an AgentCore example. We are looking for an example running on/using AgentCore runtime/SDK, e.g. via https://github.com/aws/bedrock-agentcore-sdk-python. If I understand correctly, you can use |
|
@krisztianfekete thanks. Rewrote the example to use The handler is now an async generator decorated with You were right about AWS not being a hard requirement for tracing. Strands still exports OTLP spans even when |
466d35a to
acb22d9
Compare
3139267 to
3831ec7
Compare
|
@krisztianfekete rebased on main and addressed all your feedback. ready for another look when you have time. |
krisztianfekete
left a comment
There was a problem hiding this comment.
Can you share a screenshot or log excerpt from agentevals serve --dev showing the session/invocation produced by this script when Bedrock is actually reachable (or substitute a non-Bedrock model via the CLI flow you used originally)? I want to confirm that gen_ai.request.model, gen_ai.input.messages, and AgentCore runtime spans all land at the receiver, not just an empty error span.
| @@ -0,0 +1,49 @@ | |||
| """AWS AgentCore zero-code OTLP example.""" | |||
There was a problem hiding this comment.
Please provide more details on the approach like other examples.
| main_port, otlp_http_port, mgr = live_servers | ||
| session_name = "e2e-agentcore" | ||
| with _agentcore_server(otlp_http_port, session_name, extra_env=_AGENTCORE_ENV): | ||
| httpx.post("http://127.0.0.1:8080/invocations", json={"prompt": "Roll a 20-sided die"}, timeout=60) |
There was a problem hiding this comment.
Please assert 200 response codes here and below.
| main_port, otlp_http_port, mgr = live_servers | ||
| session_name = "e2e-agentcore" | ||
| with _agentcore_server(otlp_http_port, session_name, extra_env=_AGENTCORE_ENV): | ||
| httpx.post("http://127.0.0.1:8080/invocations", json={"prompt": "Roll a 20-sided die"}, timeout=60) |
There was a problem hiding this comment.
Please do not hardcode the port.
|
@krisztianfekete Tested locally now again with meta-llama/Llama-3.3-70B-Instruct via a Nebius endpoint (OpenAI-compatible) in place of Bedrock, like I said I use just Nebius for everything, using the same BedrockAgentCoreApp structure. gen_ai.request.model, gen_ai.input.messages, tool calls, and AgentCore runtime spans all landed at the receiver. Screenshots attached.
|
fb26b2a to
62bd782
Compare


Closes #93
Adds an AWS AgentCore zero-code OTLP example.
Uses BedrockAgentCoreApp from bedrock-agentcore and StrandsTelemetry for OTLP export.