Skip to content

feat: supports specific openrouter request parameters#1045

Merged
VisargD merged 2 commits into
Portkey-AI:mainfrom
unsync:feat/openrouter-support
Apr 22, 2025
Merged

feat: supports specific openrouter request parameters#1045
VisargD merged 2 commits into
Portkey-AI:mainfrom
unsync:feat/openrouter-support

Conversation

@unsync
Copy link
Copy Markdown
Contributor

@unsync unsync commented Apr 16, 2025

Code Quality new feature

Author Description

Title:
This PR allows to send some openrouter specific fields to there api.

That brings the full power of portkey combined to the versatility of openrouter 🚀

Title: feat: supports specific openrouter request parameters

🔄 What Changed

  • Added support for OpenRouter-specific parameters: modalities, reasoning, transforms, provider, models, and response_format
  • Updated the stream chunk transform function to properly handle these parameters
  • Enhanced model information in stream responses by using the model from the gateway request

🔍 Impact of the Change

  • Enables full utilization of OpenRouter's API capabilities
  • Allows users to leverage image generation, reasoning control, message transformations, and specific provider/model routing
  • Combines Portkey's gateway capabilities with OpenRouter's versatility

📁 Total Files Changed

  • 1 file modified (src/providers/openrouter/chatComplete.ts) with 31 additions and 3 deletions

🧪 Test Added

N/A - No tests were added in this PR

🔒 Security Vulnerabilities

N/A - No security vulnerabilities identified

Quality Recommendations

  1. Add input validation for the new parameters to ensure they conform to OpenRouter's expected formats

  2. Consider adding type definitions for the new parameters to improve type safety

  3. Add unit tests to verify the correct handling of the new parameters

  4. Update documentation to explain how to use these new parameters in the gateway

@VisargD VisargD merged commit e1a2acb into Portkey-AI:main Apr 22, 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.

3 participants