Conversation
- handle different hosts and extract real base path from it - small fixes of host name placeholder
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the OpenAI provider to properly handle custom API endpoints and improve URL construction. The changes standardize the host configuration to use a base URL (/v1) instead of full endpoint paths, introduce helper methods for URL construction, and add API model syncing support.
Key changes:
- Introduced URL parsing logic to derive base API URL and construct endpoint-specific URLs
- Changed default host configuration from full endpoint path to base URL
- Added constants for API paths and default origin
- Removed fallback return in error handling for
listModels()method
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/services/providers/OpenAIProvider.ts | Refactored URL construction with new helper methods, added constants, typed API response, removed error fallback |
| src/pages/Settings/Models/ProviderOpenAI.tsx | Updated placeholder to reflect new base URL format, enabled sync button for model fetching |
| settings.default.json | Changed default host from full endpoint path to base URL |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Template
Description
Support sync OpenAI models to the app.
Related Issue
#11
Type of Change
Checklist