From 3bf1912ee904d4f8edd9f6953c3cbc4c1f893d59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8F=B2=E6=82=A6?= Date: Wed, 13 Aug 2025 19:58:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/controller/copilot/code_completions.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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()