Skip to content

Conversation

siddharthsambharia-portkey
Copy link
Contributor

Description

This PR adds OpenAI repsonses modalities param

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

Fixes and Closes #1221

Copy link
Contributor

Code Quality bug fix

Description

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

.

Summary By MatterAI MatterAI logo

🔄 What Changed

This Pull Request introduces changes to the createModelResponse.ts file, specifically updating the API parameter mapping for OpenAI responses. It adds new mappings for modalities and parallel_tool_calls parameters.

🔍 Impact of the Change

This change ensures that the modalities and parallel_tool_calls parameters are correctly recognized and mapped when making requests to the OpenAI API. This fixes potential issues where these parameters might have been ignored or incorrectly handled, leading to more accurate and functional API interactions.

📁 Total Files Changed

1 file changed: src/providers/open-ai-base/createModelResponse.ts

🧪 Test Added

No explicit details about new tests were provided in the PR data. It is recommended to add unit or integration tests to verify the correct mapping of the new parameters.

🔒Security Vulnerabilities

No security vulnerabilities were detected in the changes introduced by this Pull Request.

Sequence Diagram

sequenceDiagram
    participant User
    participant ClientApp
    participant OpenAIAPI
    participant ModelResponseCreator

    User->>ClientApp: Initiates API call with parameters
    ClientApp->>ModelResponseCreator: createModelResponse(params)
    activate ModelResponseCreator
    ModelResponseCreator-->>OpenAIAPI: Map and send API request (e.g., /v1/chat/completions)
    Note right of ModelResponseCreator: Parameters like 'modalities' and 'parallel_tool_calls' are mapped.
    OpenAIAPI-->>ModelResponseCreator: Returns API response
    ModelResponseCreator-->>ClientApp: Returns processed model response
    deactivate ModelResponseCreator
    ClientApp->>User: Displays response
Loading

Copy link
Contributor

@matter-code-review matter-code-review bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR addresses an important mapping issue for OpenAI API parameters. I've identified a minor refactoring opportunity for the newly added parallel_tool_calls parameter.

@VisargD VisargD merged commit 09dcc86 into Portkey-AI:main Jul 10, 2025
2 checks 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.

Modalities Param in OpenAI responses is not working

3 participants