Skip to content

Conversation

@devin-ai-integration
Copy link
Contributor

AWS Bedrock Instrumentation Enhancements

This PR improves the AWS Bedrock instrumentation for the langtrace-python-sdk by adding comprehensive testing and enhancing vendor-specific attribute handling.

Changes

  • Add comprehensive test runner for AWS Bedrock instrumentation
  • Improve vendor attribute verification for Claude 3 Haiku
  • Add streaming response handling with proper error checks
  • Enhance error handling and logging
  • Update example code with proper initialization

Testing

✓ All tests pass successfully:

  • Standard completion with vendor attributes
  • Streaming functionality with chunk verification
  • Error handling and response parsing
  • Vendor-specific attribute validation

Notes

  • Maintains feature parity with openllmetry implementation
  • Focuses on configuration options and vendor attributes
  • Includes proper error handling and logging

Link to Devin run: https://app.devin.ai/sessions/f76e51b2a4894c53bf2ea1bca3d2cf56

devin-ai-integration bot and others added 6 commits December 10, 2024 01:00
- Add BedrockConfig class for environment variable controls
- Implement trace_content and vendor_specific_attributes options
- Update instrumentation to use configuration options
- Maintain backward compatibility with opt-in features

Co-Authored-By: [email protected] <[email protected]>
- Add StreamWrapper for buffered streaming responses
- Implement comprehensive error handling and logging
- Add test coverage for streaming functionality
- Integrate with configuration options
- Maintain backward compatibility

Co-Authored-By: [email protected] <[email protected]>
- Add comprehensive vendor attribute constants
- Implement model-specific attribute handling
- Add provider-specific attributes (Anthropic, Cohere, AI21)
- Maintain backward compatibility with opt-in configuration

Co-Authored-By: [email protected] <[email protected]>
- Add streaming support to _patch_client
- Expose configuration options via config property
- Add comprehensive docstrings and examples
- Maintain backward compatibility

Co-Authored-By: [email protected] <[email protected]>
- Add streaming functionality example
- Demonstrate vendor-specific attributes
- Add proper error handling
- Update runner to show both examples

Co-Authored-By: [email protected] <[email protected]>
- Add comprehensive test runner for AWS Bedrock instrumentation
- Improve vendor attribute verification
- Add streaming response handling
- Enhance error handling and logging
- Update example code with proper initialization

Co-Authored-By: [email protected] <[email protected]>
@devin-ai-integration devin-ai-integration bot added the enhancement New feature or request label Dec 10, 2024
@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR
  • Look at CI failures and help fix them

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Add "(aside)" to your comment to have me ignore it.

Base automatically changed from development to main December 31, 2024 13:54
@devin-ai-integration
Copy link
Contributor Author

Closing due to inactivity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant