Private
Public Access
1
0

Use the streamed response API

This commit is contained in:
2023-10-30 21:45:21 +00:00
parent c35967f797
commit 68f986dc06
2 changed files with 47 additions and 3 deletions

View File

@@ -107,13 +107,13 @@ var newCmd = &cobra.Command{
},
}
response, err := CreateChatCompletion("You are a helpful assistant.", messages)
err = CreateChatCompletionStream("You are a helpful assistant.", messages, os.Stdout)
if err != nil {
fmt.Fprintf(os.Stderr, "Error getting chat response: %v\n", err)
fmt.Fprintf(os.Stderr, "An error occured: %v\n", err)
os.Exit(1)
}
fmt.Println(response);
fmt.Println()
},
}