Skip to content

delete unsupported $schema param from vertex and google#1071

Merged
VisargD merged 2 commits into
Portkey-AI:mainfrom
narengogi:chore/remove-unsupported-schema-parma-gemini
May 5, 2025
Merged

delete unsupported $schema param from vertex and google#1071
VisargD merged 2 commits into
Portkey-AI:mainfrom
narengogi:chore/remove-unsupported-schema-parma-gemini

Conversation

@narengogi

@narengogi narengogi commented Apr 29, 2025

Copy link
Copy Markdown
Member

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

  • 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)

N/A

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

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
Loading

@narengogi narengogi requested a review from VisargD April 29, 2025 13:42
@matterai-app

matterai-app Bot commented May 5, 2025

Copy link
Copy Markdown
Contributor

Code Quality bug fix

Summary By MatterAI MatterAI logo

🔄 What Changed

Removed unsupported $schema parameter from Google Vertex AI and Google API requests by adding a delete operation in the recursivelyDeleteUnsupportedParameters utility function.

🔍 Impact of the Change

This change ensures that requests to Google Vertex AI and Google APIs don't include the unsupported $schema parameter, which could potentially cause request failures or unexpected behavior.

📁 Total Files Changed

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

🧪 Test Added

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

🔒Security Vulnerabilities

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

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

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

Sequence Diagram

sequenceDiagram
    participant Client
    participant Gateway
    participant Utils
    participant GoogleVertexAI
    
    Client->>Gateway: Send request with parameters
    Gateway->>Utils: Process request parameters
    Utils->>Utils: recursivelyDeleteUnsupportedParameters(obj)
    Note over Utils: Delete unsupported parameters:
    Note over Utils: - additional_properties
    Note over Utils: - additionalProperties
    Note over Utils: - $schema (newly added)
    Utils->>GoogleVertexAI: Forward cleaned parameters
    GoogleVertexAI->>Client: Return response
Loading

@VisargD VisargD merged commit 9075db7 into Portkey-AI:main May 5, 2025
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