Repository navigation
feat(provider): add Custom API provider with console form #672
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+3,248
−85
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
2fdd292
feat(provider): add Custom API provider with console form
guyu233 f066217
Merge branch 'main' into feat/custom-api-provider
caigee-cmd 0377eb2
Merge branch 'main' into feat/custom-api-provider
caigee-cmd 428fdeb
fix(provider): address review feedback on custom API provider
guyu233 2f33948
Merge branch 'main' into feat/custom-api-provider
caigee-cmd f10338b
Merge branch 'main' into feat/custom-api-provider
caigee-cmd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| ### English | ||
|
|
||
| - Add a Custom API provider: one account is one endpoint (base URL + key), with OpenAI Chat Completions, Anthropic Messages, or Responses as the upstream wire and no reverse proxy. | ||
| - Custom endpoints get their catalog from `/models` or a manual model list, and their models are routed as `custom/<model>`. | ||
| - Console: "Add account" offers a Custom API form — base URL, key, the upstream protocol (OpenAI, Anthropic, or Responses), and an optional model list. | ||
|
|
||
| ### 中文 | ||
|
|
||
| - 新增「自定义 API」供应商:一个账号就是一个端点(Base URL + 密钥),上游协议可选 OpenAI Chat Completions、Anthropic Messages 或 Responses,直连不走反代。 | ||
| - 自定义端点按 `/models` 或手填列表生成 catalog,模型按 `custom/<model>` 路由。 | ||
| - 控制台:「添加账号」新增「自定义 API」表单 —— Base URL、密钥、上游协议(OpenAI、Anthropic、Responses)以及可选的模型列表。 |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| type Props = { | ||
| size?: number | ||
| className?: string | ||
| } | ||
|
|
||
| // Socket-and-plug mark for the custom endpoint tiles: one endpoint, any | ||
| // upstream. Decorative; the provider name sits next to it. | ||
| export function CustomMark({ size = 16, className = '' }: Props) { | ||
| return ( | ||
| <svg | ||
| width={size} | ||
| height={size} | ||
| viewBox="0 0 24 24" | ||
| className={`block shrink-0 text-foreground ${className}`.trim()} | ||
| aria-hidden="true" | ||
| > | ||
| <g | ||
| fill="none" | ||
| stroke="currentColor" | ||
| strokeWidth="1.8" | ||
| strokeLinecap="round" | ||
| strokeLinejoin="round" | ||
| > | ||
| <path d="M9 3.2v3.4M15 3.2v3.4M7.4 6.6h9.2a2.2 2.2 0 0 1 2.2 2.2v2.6a2.2 2.2 0 0 1-2.2 2.2H7.4a2.2 2.2 0 0 1-2.2-2.2V8.8a2.2 2.2 0 0 1 2.2-2.2Z" /> | ||
| <path d="M12 13.6v7.2" /> | ||
| </g> | ||
| </svg> | ||
| ) | ||
| } |
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.