gateway icon indicating copy to clipboard operation
gateway copied to clipboard

delete unsupported $schema param from vertex and google

Open narengogi opened this issue 7 months ago โ€ข 0 comments

Code Quality bug fix

Description

Summary By MatterAI

๐Ÿ”„ What Changed

This PR removes the unsupported $schema parameter from requests sent to Google Vertex AI by adding it to the list of parameters that are recursively deleted in the utility function.

๐Ÿ” Impact of the Change

This change prevents potential errors or rejections from the Google Vertex AI API when requests contain the $schema parameter, which is not supported by the API.

๐Ÿ“ Total Files Changed

1 file changed with 1 line added and 0 lines deleted.

๐Ÿงช Test Added

N/A

๐Ÿ”’ Security Vulnerabilities

No security vulnerabilities identified.

Motivation

The $schema parameter is not supported by Google Vertex AI API and needs to be removed from requests to prevent potential errors.

Type of Change

  • [x] 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
  • [x] Manual Testing

Screenshots (if applicable)

N/A

Checklist

  • [x] My code follows the style guidelines of this project
  • [x] 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
  • [x] 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

N/A

Quality Recommendations

  1. Consider adding a unit test to verify the '$schema' parameter is properly removed

Sequence Diagram

sequenceDiagram
    participant Client as Client
    participant Gateway as Portkey Gateway
    participant Utils as recursivelyDeleteUnsupportedParameters
    participant GoogleVertexAI as Google Vertex AI API

    Client->>Gateway: Send request with parameters
    Gateway->>Utils: Process request parameters
    Utils->>Utils: Delete unsupported parameters
    Note over Utils: Now also deletes '$schema' parameter
    Utils-->>Gateway: Return cleaned parameters
    Gateway->>GoogleVertexAI: Forward request with cleaned parameters
    GoogleVertexAI-->>Gateway: Return response
    Gateway-->>Client: Return processed response

narengogi avatar Apr 29 '25 13:04 narengogi