diff --git a/internal/controller/copilot/code_completions.go b/internal/controller/copilot/code_completions.go index 43caa47..e1a6740 100644 --- a/internal/controller/copilot/code_completions.go +++ b/internal/controller/copilot/code_completions.go @@ -18,6 +18,11 @@ import ( "time" ) +// abortCodex is a helper function to abort requests with a specific message. +func abortCodex(c *gin.Context, message string) { + c.AbortWithStatusJSON(http.StatusInternalServerError, gin.H{"error": message}) +} + // GetEngine returns information about a specific engine. func GetEngine(c *gin.Context) { modelName := os.Getenv("CODEX_API_MODEL_NAME") @@ -31,7 +36,6 @@ func GetEngine(c *gin.Context) { }) } - // CodeCompletions code代码补全接口 func CodeCompletions(c *gin.Context) { ctx := c.Request.Context()