let it choose

This commit is contained in:
Ettore Di Giacinto
2024-03-31 00:26:48 +01:00
parent 9926674c38
commit 658681f344
2 changed files with 47 additions and 4 deletions

View File

@@ -30,6 +30,7 @@ func GenerateJSON(ctx context.Context, client *openai.Client, model, text string
return fmt.Errorf("no response from OpenAI API")
}
fmt.Println(resp.Choices[0].Message.Content)
err = json.Unmarshal([]byte(resp.Choices[0].Message.Content), i)
if err != nil {
return err