Seefs 1 день назад
Родитель
Сommit
34a5323f14
4 измененных файлов с 36 добавлено и 15 удалено
  1. 6 0
      .cursor/rules/project.mdc
  2. 6 0
      AGENTS.md
  3. 6 0
      CLAUDE.md
  4. 18 15
      relay/common/relay_info.go

+ 6 - 0
.cursor/rules/project.mdc

@@ -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 build` for production build
 - `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`.

+ 6 - 0
AGENTS.md

@@ -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 build` for production build
 - `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`.

+ 6 - 0
CLAUDE.md

@@ -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 build` for production build
 - `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`.

+ 18 - 15
relay/common/relay_info.go

@@ -290,21 +290,24 @@ func (info *RelayInfo) ToString() string {
 
 // 定义支持流式选项的通道类型
 var streamSupportedChannels = map[int]bool{
-	constant.ChannelTypeOpenAI:     true,
-	constant.ChannelTypeAnthropic:  true,
-	constant.ChannelTypeAws:        true,
-	constant.ChannelTypeGemini:     true,
-	constant.ChannelCloudflare:     true,
-	constant.ChannelTypeAzure:      true,
-	constant.ChannelTypeVolcEngine: true,
-	constant.ChannelTypeOllama:     true,
-	constant.ChannelTypeXai:        true,
-	constant.ChannelTypeDeepSeek:   true,
-	constant.ChannelTypeBaiduV2:    true,
-	constant.ChannelTypeZhipu_v4:   true,
-	constant.ChannelTypeAli:        true,
-	constant.ChannelTypeSubmodel:   true,
-	constant.ChannelTypeCodex:      true,
+	constant.ChannelTypeOpenAI:      true,
+	constant.ChannelTypeAnthropic:   true,
+	constant.ChannelTypeAws:         true,
+	constant.ChannelTypeGemini:      true,
+	constant.ChannelCloudflare:      true,
+	constant.ChannelTypeAzure:       true,
+	constant.ChannelTypeVolcEngine:  true,
+	constant.ChannelTypeOllama:      true,
+	constant.ChannelTypeXai:         true,
+	constant.ChannelTypeDeepSeek:    true,
+	constant.ChannelTypeBaiduV2:     true,
+	constant.ChannelTypeZhipu_v4:    true,
+	constant.ChannelTypeAli:         true,
+	constant.ChannelTypeSubmodel:    true,
+	constant.ChannelTypeCodex:       true,
+	constant.ChannelTypeMoonshot:    true,
+	constant.ChannelTypeMiniMax:     true,
+	constant.ChannelTypeSiliconFlow: true,
 }
 
 func GenRelayInfoWs(c *gin.Context, ws *websocket.Conn) *RelayInfo {