botocore: add basic tracing for Bedrock InvokeModelWithStreamResponse#3206
Merged
xrmx merged 3 commits intoopen-telemetry:mainfrom Jan 28, 2025
Merged
botocore: add basic tracing for Bedrock InvokeModelWithStreamResponse#3206xrmx merged 3 commits intoopen-telemetry:mainfrom
xrmx merged 3 commits intoopen-telemetry:mainfrom
Conversation
18 tasks
codefromthecrypt
suggested changes
Jan 27, 2025
Contributor
codefromthecrypt
left a comment
There was a problem hiding this comment.
Can you ad-hoc test langchain? This is the more important PR as it is the default mode.
from langchain_aws import ChatBedrock
def main():
llm = ChatBedrock(
model_id='amazon.titan-text-lite-v1',
streaming=True,
)
response_stream = llm.stream("Write a short poem on OpenTelemetry.")
for chunk in response_stream:
print(chunk.content, end="")
if __name__ == "__main__":
main()
codefromthecrypt
approved these changes
Jan 27, 2025
Contributor
|
sorry about the "requested changes" that was a clicking accident |
3cff0c8 to
1575884
Compare
Contributor
Author
I did test it with Claude : and titan: |
11 tasks
codefromthecrypt
approved these changes
Jan 28, 2025
Contributor
codefromthecrypt
left a comment
There was a problem hiding this comment.
great. langchain uses will be happy, as will others!
aryabharat
pushed a commit
to aryabharat/opentelemetry-python-contrib
that referenced
this pull request
Feb 2, 2025
…open-telemetry#3206) * Add basic tracing for InvokeModelWithResponseStream * Add changelog and please pylint
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This adds to the botocore bedrock extensions ability to trace InvokeModelWithStreamResponse calls for amazon.titan, amazon.nova and anthropic claude models using the completion api for amazon.titan and the messages api for amazon.nova and anthropic.claude.
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Does This PR Require a Core Repo Change?
Checklist:
See contributing.md for styleguide, changelog guidelines, and more.