Skip to content

Conversation

@Louis-7
Copy link
Contributor

@Louis-7 Louis-7 commented Oct 31, 2025

Pull Request Template

Description

Support sync OpenAI models to the app.

Related Issue

#11

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Refactor
  • Other

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my 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

- handle different hosts and extract real base path from it
- small fixes of host name placeholder
Copilot AI review requested due to automatic review settings October 31, 2025 04:24
@Louis-7 Louis-7 merged commit 1236da0 into main Oct 31, 2025
5 checks passed
@Louis-7 Louis-7 deleted the feature/sync-openai branch October 31, 2025 04:26
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants