ChatGPTNextWeb / ChatGPT-Next-Web

A cross-platform ChatGPT/Gemini UI (Web / PWA / Linux / Win / MacOS). 一键拥有你自己的跨平台 ChatGPT/Gemini 应用。
https://app.nextchat.dev/
MIT License
76.47k stars 59.13k forks source link

[Feature Request] Allow Customize endpoint #5478

Open H0llyW00dzZ opened 1 month ago

H0llyW00dzZ commented 1 month ago

🥰 Feature Description

Currently, the customizable endpoint feature is not working as expected for external REST APIs, such as https://oneapi.b0zal.io. The issue seems to have arisen after the new developers started maintaining the project. The customizable endpoint keeps forcing the path to api.example.com/v1/message for Anthropic or other AI providers, which is causing compatibility issues.

🧐 Proposed Solution

To address this problem, I propose the following solution:

image

  1. Modify the customizable endpoint feature to allow users to specify the complete API endpoint path, including the domain and any necessary subpaths.
  2. Ensure that the specified endpoint path is used as-is, without any forced modifications or additions.
  3. Implement proper validation and error handling to provide informative feedback to users if the specified endpoint is invalid or unreachable.
  4. Update the documentation and user interface to clearly communicate the expected format and usage of the customizable endpoint feature.

By implementing these changes, users will have the flexibility to integrate with various external REST APIs seamlessly, without being limited to a specific path structure.

📝 Additional Information

H0llyW00dzZ commented 1 month ago

For example, allow customizing the endpoint securely, as shown in the following images:

image image

The first image demonstrates a customizable endpoint configuration where users can specify the API endpoint URL, including the domain and any necessary subpaths. This allows for flexibility in integrating with various external REST APIs.

The second image shows an example of a secure configuration, where the API key is provided as an authentication mechanism. This ensures that only authorized users can access the endpoint and helps protect sensitive data.

By implementing these customization options, users can seamlessly integrate with their preferred AI providers or external APIs while maintaining a secure connection. The ability to specify the complete endpoint URL and provide authentication credentials enhances the versatility and security of the application.

H0llyW00dzZ commented 1 month ago

Also, for anyone who doesn't know about One API:

Information can be found here (English version):

image

Dogtiti commented 1 month ago

我似乎有看到你在该仓库有很多代码贡献,如果可以的话,你愿意为此问题提供pr吗 非常感谢~

Issues-translate-bot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically.


I seem to have seen that you have a lot of code contributions in this repository. If possible, would you be willing to provide a PR for this issue? Thank you very much~

H0llyW00dzZ commented 1 month ago

我似乎有看到你在该仓库有很多代码贡献,如果可以的话,你愿意为此问题提供pr吗 非常感谢~

@Dogtiti I have to figure this out again because this repository has changed a lot from the original version made by @Yidadaa.

Also, I am pretty sure that I have configured it to support a customizable endpoint. The relevant code can be found here:

The next step would be to implement a user interface for the customizable endpoint mechanism.

H0llyW00dzZ commented 1 month ago

Also I think it would be better to implement a provider for One API or a similar external API as a standalone (independently) provider, similar to the other providers. This is because it would be more complex to add the allow customize endpoint feature individually to every AI provider.

H0llyW00dzZ commented 1 month ago

Update Regarding These Issues

The Google provider also doesn't work (tested on the web version).

image image

In v1, it keeps forcing the use of v1beta.