🔌 feat(api): extend endpoint type support & expose in pricing UI

* backend
  - constant/endpoint_type.go
    • Add EndpointTypeMidjourney, EndpointTypeSuno, EndpointTypeKling, EndpointTypeJimeng.
  - common/endpoint_type.go
    • Map Midjourney / MidjourneyPlus, SunoAPI, Kling, Jimeng channel types to the new endpoint types.

* frontend
  - ModelPricing.js
    • Add “Supported Endpoint Type” column.
    • Implement renderSupportedEndpoints with `stringToColor` for consistent tag colors.

These changes allow `/api/pricing` and model lists to return accurate
`supported_endpoint_types` covering all non-OpenAI providers and display
them clearly in the UI.

No breaking changes.
This commit is contained in:
t0ng7u
2025-07-04 03:15:34 +08:00
parent 819290c9b8
commit bf577b8937
4 changed files with 44 additions and 3 deletions

View File

@@ -8,6 +8,14 @@ func GetEndpointTypesByChannelType(channelType int, modelName string) []constant
switch channelType {
case constant.ChannelTypeJina:
endpointTypes = []constant.EndpointType{constant.EndpointTypeJinaRerank}
case constant.ChannelTypeMidjourney, constant.ChannelTypeMidjourneyPlus:
endpointTypes = []constant.EndpointType{constant.EndpointTypeMidjourney}
case constant.ChannelTypeSunoAPI:
endpointTypes = []constant.EndpointType{constant.EndpointTypeSuno}
case constant.ChannelTypeKling:
endpointTypes = []constant.EndpointType{constant.EndpointTypeKling}
case constant.ChannelTypeJimeng:
endpointTypes = []constant.EndpointType{constant.EndpointTypeJimeng}
case constant.ChannelTypeAws:
fallthrough
case constant.ChannelTypeAnthropic: