MCPcopy Create free account
hub / github.com/tbphp/gpt-load / shouldInterceptModelList

Function shouldInterceptModelList

internal/proxy/model_list_handler.go:16–25  ·  view source on GitHub ↗

shouldInterceptModelList checks if this is a model list request that should be intercepted

(path string, method string)

Source from the content-addressed store, hash-verified

14
15// shouldInterceptModelList checks if this is a model list request that should be intercepted
16func shouldInterceptModelList(path string, method string) bool {
17 if method != "GET" {
18 return false
19 }
20
21 // Check various model list endpoints
22 return strings.HasSuffix(path, "/v1/models") ||
23 strings.HasSuffix(path, "/v1beta/models") ||
24 strings.Contains(path, "/v1beta/openai/v1/models")
25}
26
27// handleModelListResponse processes the model list response and applies filtering based on redirect rules
28func (ps *ProxyServer) handleModelListResponse(c *gin.Context, resp *http.Response, group *models.Group, channelHandler channel.ChannelProxy) {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected