From dd960d1d5e0eefcb76d73b1942b4d638aea7495f Mon Sep 17 00:00:00 2001 From: Michael Yang Date: Thu, 6 Jul 2023 12:27:50 -0700 Subject: [PATCH] update generate response --- api/types.go | 8 -------- server/routes.go | 8 ++------ 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/api/types.go b/api/types.go index de1dd107..d4eb63ad 100644 --- a/api/types.go +++ b/api/types.go @@ -36,11 +36,3 @@ type GenerateRequest struct { type GenerateResponse struct { Response string `json:"response"` } - -type TokenResponse struct { - Choices []TokenResponseChoice `json:"choices"` -} - -type TokenResponseChoice struct { - Text string `json:"text"` -} diff --git a/server/routes.go b/server/routes.go index 99c589fd..fdfc22ec 100644 --- a/server/routes.go +++ b/server/routes.go @@ -78,12 +78,8 @@ func generate(c *gin.Context) { return false } - resp := api.TokenResponse{ - Choices: []api.TokenResponseChoice{ - { - Text: token, - }, - }, + resp := api.GenerateResponse{ + Response: token, } bts, err := json.Marshal(resp)