feat: Add FetchModels endpoint and refactor FetchUpstreamModels
- Introduced a new `FetchModels` endpoint to retrieve model IDs from a specified base URL and API key, enhancing flexibility for different channel types. - Refactored `FetchUpstreamModels` to simplify base URL handling and improve error messages during response parsing. - Updated API routes to include the new endpoint and adjusted the frontend to utilize the new fetch mechanism for model lists. - Removed outdated checks for channel type in the frontend, streamlining the model fetching process.
This commit is contained in:
@@ -98,6 +98,7 @@ func SetApiRouter(router *gin.Engine) {
|
||||
channelRoute.POST("/batch", controller.DeleteChannelBatch)
|
||||
channelRoute.POST("/fix", controller.FixChannelsAbilities)
|
||||
channelRoute.GET("/fetch_models/:id", controller.FetchUpstreamModels)
|
||||
channelRoute.POST("/fetch_models", controller.FetchModels)
|
||||
|
||||
}
|
||||
tokenRoute := apiRouter.Group("/token")
|
||||
|
||||
Reference in New Issue
Block a user