Skip to content

update null check in provider config for bedrock #1038

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

Merged

Conversation

narengogi
Copy link
Collaborator

@narengogi narengogi commented Apr 14, 2025

Code Quality bug fix

Author Description

Tested with existing providers on bedrock and newer ones

Title: update null check in provider config for bedrock

🔄 What Changed

  • Fixed potential null reference errors in Bedrock provider configuration
  • Updated how response transforms are assigned to properly handle undefined objects
  • Implemented proper object spreading to preserve existing configuration

🔍 Impact of the Change

  • Prevents runtime errors when accessing properties on undefined objects
  • Makes the code more robust and resilient
  • Maintains backward compatibility with existing implementations

📁 Total Files Changed

  • 1 file modified (src/providers/bedrock/index.ts)
  • 8 lines added, 4 lines removed

🧪 Test Added

  • Manually tested with existing providers on bedrock and newer ones

🔒 Security Vulnerabilities

  • N/A

  • Code follows project style guidelines

  • Changes are well documented

  • Appropriate error handling is implemented

  • No new security vulnerabilities introduced

Quality Recommendations

  1. Consider adding unit tests to verify the null check behavior

  2. Add more detailed comments explaining why this change was necessary

@narengogi narengogi requested a review from VisargD April 14, 2025 08:34
@VisargD VisargD merged commit e5acb27 into Portkey-AI:main Apr 15, 2025
1 check passed
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