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

Method handleHomeCodexClientModels

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

Source from the content-addressed store, hash-verified

1018}
1019
1020func (s *Server) handleHomeCodexClientModels(c *gin.Context) {
1021 entries, ok := s.loadHomeModelEntries(c)
1022 if !ok {
1023 return
1024 }
1025
1026 models := make([]map[string]any, 0, len(entries))
1027 for _, entry := range entries {
1028 model := map[string]any{
1029 "id": entry.id,
1030 "object": "model",
1031 }
1032 if entry.created > 0 {
1033 model["created"] = entry.created
1034 }
1035 if entry.ownedBy != "" {
1036 model["owned_by"] = entry.ownedBy
1037 }
1038 if entry.displayName != "" {
1039 model["display_name"] = entry.displayName
1040 model["description"] = entry.displayName
1041 }
1042 models = append(models, model)
1043 }
1044
1045 c.JSON(http.StatusOK, openai.CodexClientModelsResponse(models))
1046}
1047
1048func (s *Server) geminiModelsHandler(geminiHandler *gemini.GeminiAPIHandler) gin.HandlerFunc {
1049 return func(c *gin.Context) {

Callers 1

unifiedModelsHandlerMethod · 0.95

Calls 2

loadHomeModelEntriesMethod · 0.95

Tested by

no test coverage detected