(c *gin.Context)
| 1018 | } |
| 1019 | |
| 1020 | func (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 | |
| 1048 | func (s *Server) geminiModelsHandler(geminiHandler *gemini.GeminiAPIHandler) gin.HandlerFunc { |
| 1049 | return func(c *gin.Context) { |
no test coverage detected