Enhanced AI Provider URL Configuration and Cross-Platform Support#15
Open
morler wants to merge 6 commits intodavelet:mainfrom
Open
Enhanced AI Provider URL Configuration and Cross-Platform Support#15morler wants to merge 6 commits intodavelet:mainfrom
morler wants to merge 6 commits intodavelet:mainfrom
Conversation
{.cargo/config.toml: Add Windows target rustflags to cargo config (4)}
{Cargo.toml: Remove Windows-specific rustflags entry from Cargo.toml (2)}
README.md: Document base AI provider URL configuration and automatic path append (18) src/cli/http.rs: Introduce construct_full_url to assemble full chat completions URLs from a user-supplied base URL, update URL resolution to use base + per-provider path, and add tests (71) src/constants.rs: Define base URLs for providers and default/partial chat completions paths, replacing previous full URL constants (23)
README.md: Add AI Provider URL Configuration documentation (11) src/cli/http.rs: Add construct_full_url helper, integrate it into chat URL handling, switch to base URL constants with provider-specific paths, and add tests for URL construction (69) src/constants.rs: Introduce base URL constants and per-provider chat completion path constants; remove old URL constants (14)
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.
Support Custom AI Provider URLs and Enhanced Cross-Platform Compatibility
Overview
This PR introduces several important features:
--show-locationflag to show the configuration file locationMajor Changes
1. AI Provider URL Configuration Enhancement
https://api.openai.com→https://api.openai.com/v1/chat/completionshttps://dashscope.aliyuncs.com→https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions/v1path will also be handled correctly2. Windows Support Enhancement
3. Configuration Management Improvement
--show-locationflag to theconfigsubcommandTechnical Implementation Details
URL Builder Implementation
src/constants.rsconstruct_full_urlfunction insrc/cli/http.rsto handle URL building logicWindows Compatibility
src/cli/entry.rscfg!(target_os = "windows")conditional compilation to handle platform-specific codesrc/cli/windows_test.rsfile containing test cases for the Windows platformConfiguration Location Display
open_config_directoryfunction insrc/cli/entry.rs--show-locationflag insrc/cli/command.rsDocumentation Updates
README.mdto explain the new URL configuration methodGEMINI.mdto reflect the project's new featuresTesting
This PR improves the application's usability and cross-platform compatibility, allowing users to configure AI providers more flexibly and have a better experience on the Windows platform.