Skip to content

Commit b52f622

Browse files
committed
feat: force Stream to be true id async method is used
1 parent c652d2a commit b52f622

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Runtime/OpenAIApi.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ public async Task<CreateCompletionResponse> CreateCompletion(CreateCompletionReq
234234
/// <param name="token">Cancellation token to cancel the request.</param>
235235
public void CreateCompletionAsync(CreateCompletionRequest request, Action<List<CreateCompletionResponse>> onResponse, Action onComplete, CancellationTokenSource token)
236236
{
237+
request.Stream = true;
237238
var path = $"{BASE_PATH}/completions";
238239
var payload = CreatePayload(request);
239240

@@ -262,6 +263,7 @@ public async Task<CreateChatCompletionResponse> CreateChatCompletion(CreateChatC
262263
/// <param name="token">Cancellation token to cancel the request.</param>
263264
public void CreateChatCompletionAsync(CreateChatCompletionRequest request, Action<List<CreateChatCompletionResponse>> onResponse, Action onComplete, CancellationTokenSource token)
264265
{
266+
request.Stream = true;
265267
var path = $"{BASE_PATH}/chat/completions";
266268
var payload = CreatePayload(request);
267269

0 commit comments

Comments
 (0)