update generate response

This commit is contained in:
Michael Yang 2023-07-06 12:27:50 -07:00 committed by Jeffrey Morgan
parent 2c80eddd71
commit dd960d1d5e
2 changed files with 2 additions and 14 deletions

View file

@ -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"`
}

View file

@ -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)