Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OPIK-686] [SDK] [FR]: Add Support for Bedrock Invoke_Agent API #1166

Merged
merged 5 commits into from
Jan 30, 2025

Conversation

japdubengsub
Copy link
Contributor

@japdubengsub japdubengsub commented Jan 29, 2025

Details

Added logging of BedrockClient.invoke_agent() calls.

image

Resolves #
#975

Testing

manually tested with AWS Bedrock

@japdubengsub japdubengsub changed the title OPIK-686 [OPIK-686] [SDK] [FR]: Add Support for Bedrock Invoke_Agent API Jan 29, 2025
@japdubengsub japdubengsub marked this pull request as ready for review January 29, 2025 12:26
@japdubengsub japdubengsub requested a review from a team as a code owner January 29, 2025 12:26
if "chunk" in item:
merged_chunks += item["chunk"]["bytes"]

result: Dict[str, Any] = {"output": merged_chunks.decode("utf-8")}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to track not only the output.
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/bedrock-agent-runtime/client/invoke_agent.html take a look at response format

I can see that there is also usage information. Pay attention that the agent has multiple steps of foundation model invocation - preprocessing, postprocessing, orchestration, each of them has their own usage.

@alexkuzmik alexkuzmik merged commit 52a9f91 into main Jan 30, 2025
41 checks passed
@alexkuzmik alexkuzmik deleted the OPIK-686 branch January 30, 2025 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants