Skip to content

Conversation

VisargD
Copy link
Collaborator

@VisargD VisargD commented Aug 6, 2025

Description

Updating couple of references after the #1265 refactoring. These are not actively used but just want to streamline the method invocations

Motivation

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)

How Has This Been Tested?

  • Unit Tests
  • Integration Tests
  • Manual Testing

Screenshots (if applicable)

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Related Issues

Copy link
Contributor

Code Quality bug fix

Summary By MatterAI MatterAI logo

🔄 What Changed

This PR adds a missing parameter for Bedrock and Vertex transformer calls. The transformUsingProviderConfig function was being called without the required providerOptions parameter in both the Bedrock and Google Vertex AI upload file implementations.

🔍 Impact of the Change

This fix ensures that the transformer functions receive all necessary parameters to properly transform requests according to provider-specific configurations. Without this parameter, the transformations might not apply provider-specific options correctly, potentially causing incorrect request formatting.

📁 Total Files Changed

  • src/providers/bedrock/uploadFile.ts: Added missing modelType and providerOptions parameters to transformer function calls
  • src/providers/google-vertex-ai/uploadFile.ts: Added missing providerOptions parameter to transformer function call

🧪 Test Added

N/A - No new tests were added in this PR.

🔒 Security Vulnerabilities

N/A - No security vulnerabilities were identified in this PR.

Tip

Quality Recommendations

  1. Add unit tests to verify the transformer functions receive and correctly use the providerOptions parameter

  2. Add error handling to validate that required parameters are present before calling transformUsingProviderConfig

  3. Consider adding TypeScript type annotations for the function parameters to prevent similar issues in the future

Tanka Poem ♫

Parameters missing,
Transformers incomplete without,
Options to guide them.
Bedrock and Vertex now fixed,
✨ Data flows correctly! ✨

Sequence Diagram

sequenceDiagram
    participant Client
    participant UploadHandler
    participant BedrockUploadFile
    participant VertexAIUploadFile
    participant TransformService
    
    Client->>UploadHandler: Upload file request
    alt Bedrock Provider
        UploadHandler->>BedrockUploadFile: Process file upload
        BedrockUploadFile->>BedrockUploadFile: Process chunks
        BedrockUploadFile->>TransformService: transformUsingProviderConfig(providerConfig, json.body, providerOptions)
        Note over BedrockUploadFile,TransformService: Added missing providerOptions parameter
        TransformService-->>BedrockUploadFile: Return transformed data
        BedrockUploadFile-->>UploadHandler: Return upload result
    else Google Vertex AI Provider
        UploadHandler->>VertexAIUploadFile: Process file upload
        VertexAIUploadFile->>VertexAIUploadFile: Process data
        VertexAIUploadFile->>TransformService: transformUsingProviderConfig(providerConfig, toTranspose, providerOptions)
        Note over VertexAIUploadFile,TransformService: Added missing providerOptions parameter
        TransformService-->>VertexAIUploadFile: Return transformed data
        VertexAIUploadFile-->>UploadHandler: Return upload result
    end
    UploadHandler-->>Client: Upload complete response
Loading

Copy link
Contributor

This PR correctly adds the missing parameters to the transformer function calls in both Bedrock and Vertex AI providers, which should fix the issue with provider-specific configurations not being applied.

@VisargD VisargD merged commit 0c6d2ff into main Aug 6, 2025
1 check passed
@VisargD VisargD deleted the chore/pass-missing-arguments-to-transformer-service branch August 6, 2025 13:11
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.

1 participant