mirror of
https://github.com/ollama/ollama.git
synced 2025-03-26 17:51:48 +01:00
update generate response
This commit is contained in:
parent
2c80eddd71
commit
dd960d1d5e
@ -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"`
|
||||
}
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user