Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
7b1e40ed
authored
Feb 11, 2026
by
Seefs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix streamSupportedChannels
parent
c86cd86c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
15 deletions
+36
-15
.cursor/rules/project.mdc
+6
-0
AGENTS.md
+6
-0
CLAUDE.md
+6
-0
relay/common/relay_info.go
+18
-15
No files found.
.cursor/rules/project.mdc
View file @
7b1e40ed
...
@@ -103,3 +103,9 @@ Use `bun` as the preferred package manager and script runner for the frontend (`
...
@@ -103,3 +103,9 @@ Use `bun` as the preferred package manager and script runner for the frontend (`
- `bun run dev` for development server
- `bun run dev` for development server
- `bun run build` for production build
- `bun run build` for production build
- `bun run i18n:*` for i18n tooling
- `bun run i18n:*` for i18n tooling
### Rule 4: New Channel StreamOptions Support
When implementing a new channel:
- Confirm whether the provider supports `StreamOptions`.
- If supported, add the channel to `streamSupportedChannels`.
AGENTS.md
View file @
7b1e40ed
...
@@ -98,3 +98,9 @@ Use `bun` as the preferred package manager and script runner for the frontend (`
...
@@ -98,3 +98,9 @@ Use `bun` as the preferred package manager and script runner for the frontend (`
-
`bun run dev`
for development server
-
`bun run dev`
for development server
-
`bun run build`
for production build
-
`bun run build`
for production build
-
`bun run i18n:*`
for i18n tooling
-
`bun run i18n:*`
for i18n tooling
### Rule 4: New Channel StreamOptions Support
When implementing a new channel:
-
Confirm whether the provider supports
`StreamOptions`
.
-
If supported, add the channel to
`streamSupportedChannels`
.
CLAUDE.md
View file @
7b1e40ed
...
@@ -98,3 +98,9 @@ Use `bun` as the preferred package manager and script runner for the frontend (`
...
@@ -98,3 +98,9 @@ Use `bun` as the preferred package manager and script runner for the frontend (`
-
`bun run dev`
for development server
-
`bun run dev`
for development server
-
`bun run build`
for production build
-
`bun run build`
for production build
-
`bun run i18n:*`
for i18n tooling
-
`bun run i18n:*`
for i18n tooling
### Rule 4: New Channel StreamOptions Support
When implementing a new channel:
-
Confirm whether the provider supports
`StreamOptions`
.
-
If supported, add the channel to
`streamSupportedChannels`
.
relay/common/relay_info.go
View file @
7b1e40ed
...
@@ -290,21 +290,24 @@ func (info *RelayInfo) ToString() string {
...
@@ -290,21 +290,24 @@ func (info *RelayInfo) ToString() string {
// 定义支持流式选项的通道类型
// 定义支持流式选项的通道类型
var
streamSupportedChannels
=
map
[
int
]
bool
{
var
streamSupportedChannels
=
map
[
int
]
bool
{
constant
.
ChannelTypeOpenAI
:
true
,
constant
.
ChannelTypeOpenAI
:
true
,
constant
.
ChannelTypeAnthropic
:
true
,
constant
.
ChannelTypeAnthropic
:
true
,
constant
.
ChannelTypeAws
:
true
,
constant
.
ChannelTypeAws
:
true
,
constant
.
ChannelTypeGemini
:
true
,
constant
.
ChannelTypeGemini
:
true
,
constant
.
ChannelCloudflare
:
true
,
constant
.
ChannelCloudflare
:
true
,
constant
.
ChannelTypeAzure
:
true
,
constant
.
ChannelTypeAzure
:
true
,
constant
.
ChannelTypeVolcEngine
:
true
,
constant
.
ChannelTypeVolcEngine
:
true
,
constant
.
ChannelTypeOllama
:
true
,
constant
.
ChannelTypeOllama
:
true
,
constant
.
ChannelTypeXai
:
true
,
constant
.
ChannelTypeXai
:
true
,
constant
.
ChannelTypeDeepSeek
:
true
,
constant
.
ChannelTypeDeepSeek
:
true
,
constant
.
ChannelTypeBaiduV2
:
true
,
constant
.
ChannelTypeBaiduV2
:
true
,
constant
.
ChannelTypeZhipu_v4
:
true
,
constant
.
ChannelTypeZhipu_v4
:
true
,
constant
.
ChannelTypeAli
:
true
,
constant
.
ChannelTypeAli
:
true
,
constant
.
ChannelTypeSubmodel
:
true
,
constant
.
ChannelTypeSubmodel
:
true
,
constant
.
ChannelTypeCodex
:
true
,
constant
.
ChannelTypeCodex
:
true
,
constant
.
ChannelTypeMoonshot
:
true
,
constant
.
ChannelTypeMiniMax
:
true
,
constant
.
ChannelTypeSiliconFlow
:
true
,
}
}
func
GenRelayInfoWs
(
c
*
gin
.
Context
,
ws
*
websocket
.
Conn
)
*
RelayInfo
{
func
GenRelayInfoWs
(
c
*
gin
.
Context
,
ws
*
websocket
.
Conn
)
*
RelayInfo
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment