Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions common/api_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ func ChannelType2APIType(channelType int) (int, bool) {
apiType = constant.APITypeReplicate
case constant.ChannelTypeCodex:
apiType = constant.APITypeCodex
case constant.ChannelTypeAvian:
apiType = constant.APITypeOpenAI
}
if apiType == -1 {
return constant.APITypeOpenAI, false
Expand Down
3 changes: 3 additions & 0 deletions constant/channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ const (
ChannelTypeSora = 55
ChannelTypeReplicate = 56
ChannelTypeCodex = 57
ChannelTypeAvian = 58
ChannelTypeDummy // this one is only for count, do not add any channel after this

)
Expand Down Expand Up @@ -118,6 +119,7 @@ var ChannelBaseURLs = []string{
"https://api.openai.com", //55
"https://api.replicate.com", //56
"https://chatgpt.com", //57
"https://api.avian.io", //58
}

var ChannelTypeNames = map[int]string{
Expand Down Expand Up @@ -175,6 +177,7 @@ var ChannelTypeNames = map[int]string{
ChannelTypeSora: "Sora",
ChannelTypeReplicate: "Replicate",
ChannelTypeCodex: "Codex",
ChannelTypeAvian: "Avian",
}

func GetChannelTypeName(channelType int) string {
Expand Down
1 change: 1 addition & 0 deletions relay/common/relay_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@ var streamSupportedChannels = map[int]bool{
constant.ChannelTypeMoonshot: true,
constant.ChannelTypeMiniMax: true,
constant.ChannelTypeSiliconFlow: true,
constant.ChannelTypeAvian: true,
}

func GenRelayInfoWs(c *gin.Context, ws *websocket.Conn) *RelayInfo {
Expand Down
5 changes: 5 additions & 0 deletions web/src/constants/channel.constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,11 @@ export const CHANNEL_OPTIONS = [
color: 'blue',
label: 'Codex (OpenAI OAuth)',
},
{
value: 58,
color: 'green',
label: 'Avian',
},
Comment on lines +192 to +196

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Complete Avian’s frontend enumeration updates.

Line 192-Line 196 adds the dropdown option, but Avian is still missing from MODEL_FETCHABLE_CHANNEL_TYPES (Line 200-Line 202), and web/src/helpers/render.jsx has no case 58 icon branch. This leads to partial UI support (no model auto-fetch path and no channel icon).

Suggested follow-up changes
// web/src/constants/channel.constants.js
 export const MODEL_FETCHABLE_CHANNEL_TYPES = new Set([
   1, 4, 14, 34, 17, 26, 27, 24, 47, 25, 20, 23, 31, 40, 42, 48, 43,
+  58,
 ]);
// web/src/helpers/render.jsx
   switch (channelType) {
     case 1: // OpenAI
     case 3: // Azure OpenAI
     case 57: // Codex
+    case 58: // Avian
       return <OpenAI size={iconSize} />;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@web/src/constants/channel.constants.js` around lines 192 - 196, Add Avian
(value 58) to the MODEL_FETCHABLE_CHANNEL_TYPES array so the model auto-fetch
path recognizes the new channel, and update the channel-rendering switch in the
render helper by adding a case for 58 that returns the Avian icon component
(import the Avian icon if needed) so the channel shows the correct icon in the
UI; modify MODEL_FETCHABLE_CHANNEL_TYPES and the switch in the render helper
(the function handling channel icon rendering) accordingly.

];

// Channel types that support upstream model list fetching in UI.
Expand Down