Repository navigation
Alpha -> main #1920
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
Merged
Alpha -> main #1920
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
511489d
add submodel.ai
danding5 23e4249
merge
danding5 42d2975
Merge branches 'main' and 'main' of github.com:danding5/new-api
danding5 78b0f89
merge
danding5 a12ed57
merge
danding5 cab5622
Merge branch 'main' of github.com:danding5/new-api
danding5 274872b
add submodel icon
danding5 4c2979b
Merge branch 'QuantumNous:main' into main
danding5 5840de1
Update relay_adaptor.go
danding5 d0a8504
Update render.jsx
danding5 8c5b665
Merge branch 'QuantumNous:main' into main
danding5 fc2d992
Update constant/api_type.go
danding5 83b2b07
Merge pull request #1915 from danding5/main
seefs001 76180b1
fix: submodel adapter
seefs001 25a3896
Merge pull request #1919 from seefs001/fix/submodel
seefs001 fa45cb5
fix: Optimize sidebar refresh to avoid redundant loading states
RedwindA d7db30a
feat: support claude-sonnet-4-5-20250929
prnake 30cb3b8
feat: claude context editing
seefs001 3154440
Merge pull request #1924 from prnake/claude-4-5
seefs001 7d7ffc0
Merge pull request #1921 from RedwindA/refactor/improve-sidebar-perf
seefs001 8118424
fix: claude beta=true
seefs001 3b306bb
Merge pull request #1926 from seefs001/fix/claude-beta
seefs001 933ab43
Merge pull request #1925 from seefs001/feature/claude-context-editing
seefs001 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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
| package submodel | ||
|
|
||
| import ( | ||
| "errors" | ||
| "io" | ||
| "net/http" | ||
| "one-api/dto" | ||
| "one-api/relay/channel" | ||
| "one-api/relay/channel/openai" | ||
| relaycommon "one-api/relay/common" | ||
| "one-api/types" | ||
|
|
||
| "github.com/gin-gonic/gin" | ||
| ) | ||
|
|
||
| type Adaptor struct { | ||
| } | ||
|
|
||
| func (a *Adaptor) ConvertGeminiRequest(c *gin.Context, info *relaycommon.RelayInfo, request *dto.GeminiChatRequest) (any, error) { | ||
| return nil, errors.New("submodel channel: endpoint not supported") | ||
| } | ||
|
|
||
| func (a *Adaptor) ConvertClaudeRequest(*gin.Context, *relaycommon.RelayInfo, *dto.ClaudeRequest) (any, error) { | ||
| return nil, errors.New("submodel channel: endpoint not supported") | ||
| } | ||
|
|
||
| func (a *Adaptor) ConvertAudioRequest(c *gin.Context, info *relaycommon.RelayInfo, request dto.AudioRequest) (io.Reader, error) { | ||
| return nil, errors.New("submodel channel: endpoint not supported") | ||
| } | ||
|
|
||
| func (a *Adaptor) ConvertImageRequest(c *gin.Context, info *relaycommon.RelayInfo, request dto.ImageRequest) (any, error) { | ||
| return nil, errors.New("submodel channel: endpoint not supported") | ||
| } | ||
|
|
||
| func (a *Adaptor) Init(info *relaycommon.RelayInfo) { | ||
| } | ||
|
|
||
| func (a *Adaptor) GetRequestURL(info *relaycommon.RelayInfo) (string, error) { | ||
| return relaycommon.GetFullRequestURL(info.ChannelBaseUrl, info.RequestURLPath, info.ChannelType), nil | ||
| } | ||
|
|
||
| func (a *Adaptor) SetupRequestHeader(c *gin.Context, req *http.Header, info *relaycommon.RelayInfo) error { | ||
| channel.SetupApiRequestHeader(info, c, req) | ||
| req.Set("Authorization", "Bearer "+info.ApiKey) | ||
| return nil | ||
| } | ||
|
|
||
| func (a *Adaptor) ConvertOpenAIRequest(c *gin.Context, info *relaycommon.RelayInfo, request *dto.GeneralOpenAIRequest) (any, error) { | ||
| if request == nil { | ||
| return nil, errors.New("request is nil") | ||
| } | ||
| return request, nil | ||
| } | ||
|
|
||
| func (a *Adaptor) ConvertRerankRequest(c *gin.Context, relayMode int, request dto.RerankRequest) (any, error) { | ||
| return nil, errors.New("submodel channel: endpoint not supported") | ||
| } | ||
|
|
||
| func (a *Adaptor) ConvertEmbeddingRequest(c *gin.Context, info *relaycommon.RelayInfo, request dto.EmbeddingRequest) (any, error) { | ||
| return nil, errors.New("submodel channel: endpoint not supported") | ||
| } | ||
|
|
||
| func (a *Adaptor) ConvertOpenAIResponsesRequest(c *gin.Context, info *relaycommon.RelayInfo, request dto.OpenAIResponsesRequest) (any, error) { | ||
| return nil, errors.New("submodel channel: endpoint not supported") | ||
| } | ||
|
|
||
| func (a *Adaptor) DoRequest(c *gin.Context, info *relaycommon.RelayInfo, requestBody io.Reader) (any, error) { | ||
| return channel.DoApiRequest(a, c, info, requestBody) | ||
| } | ||
|
|
||
| func (a *Adaptor) DoResponse(c *gin.Context, resp *http.Response, info *relaycommon.RelayInfo) (usage any, err *types.NewAPIError) { | ||
| if info.IsStream { | ||
| usage, err = openai.OaiStreamHandler(c, info, resp) | ||
| } else { | ||
| usage, err = openai.OpenaiHandler(c, info, resp) | ||
| } | ||
| return | ||
| } | ||
|
|
||
| func (a *Adaptor) GetModelList() []string { | ||
| return ModelList | ||
| } | ||
|
|
||
| func (a *Adaptor) GetChannelName() string { | ||
| return ChannelName | ||
| } |
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,16 @@ | ||
| package submodel | ||
|
|
||
| var ModelList = []string{ | ||
| "NousResearch/Hermes-4-405B-FP8", | ||
| "Qwen/Qwen3-235B-A22B-Thinking-2507", | ||
| "Qwen/Qwen3-Coder-480B-A35B-Instruct-FP8", | ||
| "Qwen/Qwen3-235B-A22B-Instruct-2507", | ||
| "zai-org/GLM-4.5-FP8", | ||
| "openai/gpt-oss-120b", | ||
| "deepseek-ai/DeepSeek-R1-0528", | ||
| "deepseek-ai/DeepSeek-R1", | ||
| "deepseek-ai/DeepSeek-V3-0324", | ||
| "deepseek-ai/DeepSeek-V3.1", | ||
| } | ||
|
|
||
| const ChannelName = "submodel" |
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
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.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion | 🟠 Major
🧩 Analysis chain
Likely unreachable preset + risk of model-name drift
Two options:
🏁 Script executed:
Length of output: 407
Remove or wire unreachable
case 53preset in EditTagModal.jsxswitchbranch forcase 53underhandleInputChange('type', …)never executes because this modal doesn’t expose a'type'field.getChannelModelshelper (including case 53), or add a proper'type'input to this component.ModelListinrelay/channel/submodel/constants.goinstead of duplicating the list.🤖 Prompt for AI Agents