Skip to content

Commit d3cf6db

Browse files
committed
Fix for null RequestOptions
1 parent 9d3a798 commit d3cf6db

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Custom/Chat/ChatClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ protected internal ChatClient(ClientPipeline pipeline, string model, OpenAIClien
138138
/// <exception cref="ArgumentException"> <paramref name="messages"/> is an empty collection, and was expected to be non-empty. </exception>
139139
public virtual Task<ClientResult<ChatCompletion>> CompleteChatAsync(IEnumerable<ChatMessage> messages, ChatCompletionOptions options = null, CancellationToken cancellationToken = default)
140140
{
141-
return CompleteChatAsync(messages, options, cancellationToken.ToRequestOptions());
141+
return CompleteChatAsync(messages, options, cancellationToken.ToRequestOptions() ?? new RequestOptions());
142142
}
143143

144144
internal async Task<ClientResult<ChatCompletion>> CompleteChatAsync(IEnumerable<ChatMessage> messages, ChatCompletionOptions options, RequestOptions requestOptions)

src/Custom/Responses/OpenAIResponseClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ protected internal OpenAIResponseClient(ClientPipeline pipeline, string model, O
121121

122122
public virtual Task<ClientResult<OpenAIResponse>> CreateResponseAsync(IEnumerable<ResponseItem> inputItems, ResponseCreationOptions options = null, CancellationToken cancellationToken = default)
123123
{
124-
return CreateResponseAsync(inputItems, options, cancellationToken.ToRequestOptions());
124+
return CreateResponseAsync(inputItems, options, cancellationToken.ToRequestOptions() ?? new RequestOptions());
125125
}
126126

127127
internal async Task<ClientResult<OpenAIResponse>> CreateResponseAsync(IEnumerable<ResponseItem> inputItems, ResponseCreationOptions options, RequestOptions requestOptions)

0 commit comments

Comments
 (0)