MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / handleHomeGeminiModel

Method handleHomeGeminiModel

internal/api/server.go:1175–1196  ·  view source on GitHub ↗
(c *gin.Context)

Source from the content-addressed store, hash-verified

1173}
1174
1175func (s *Server) handleHomeGeminiModel(c *gin.Context) {
1176 entries, ok := s.loadHomeModelEntries(c)
1177 if !ok {
1178 return
1179 }
1180
1181 action := strings.TrimPrefix(c.Param("action"), "/")
1182 action = strings.TrimSpace(action)
1183 for _, entry := range entries {
1184 if homeGeminiModelMatches(entry, action) {
1185 c.JSON(http.StatusOK, formatHomeGeminiModel(entry))
1186 return
1187 }
1188 }
1189
1190 c.JSON(http.StatusNotFound, handlers.ErrorResponse{
1191 Error: handlers.ErrorDetail{
1192 Message: "Not Found",
1193 Type: "not_found",
1194 },
1195 })
1196}
1197
1198func (s *Server) loadHomeModelEntries(c *gin.Context) ([]homeModelEntry, bool) {
1199 if s == nil || c == nil || c.Request == nil {

Callers 1

geminiGetHandlerMethod · 0.95

Calls 3

loadHomeModelEntriesMethod · 0.95
homeGeminiModelMatchesFunction · 0.85
formatHomeGeminiModelFunction · 0.85

Tested by

no test coverage detected