Skip to content

Commit

Permalink
fix: Fixed small issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
HavenDV committed Nov 13, 2024
1 parent c3a4383 commit 839416a
Show file tree
Hide file tree
Showing 35 changed files with 75 additions and 194 deletions.
2 changes: 1 addition & 1 deletion src/libs/OpenAI/AssistantClient.CreateRun.AsStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ public partial class AssistantsClient
threadId: threadId,
include: include,
request: request,
cancellationToken: cancellationToken))
cancellationToken: cancellationToken).ConfigureAwait(false))
{
yield return response;
}
Expand Down
4 changes: 2 additions & 2 deletions src/libs/OpenAI/ChatClient.CreateChatCompletion.As.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace OpenAI
{
public partial class ChatClient
{
/// <inheritdoc cref="CreateChatCompletionAsync(System.Collections.Generic.IList{ChatCompletionRequestMessage},OpenAI.AnyOf{string?,CreateChatCompletionRequestModel?},bool?,System.Collections.Generic.Dictionary{string, string}?,double?,global::System.Collections.Generic.Dictionary{string, int}?,bool?,int?,int?,int?,System.Collections.Generic.IList{global::OpenAI.ChatCompletionModalitie}?,CreateChatCompletionRequestAudio?,double?,OpenAI.ResponseFormat?,int?,CreateChatCompletionRequestServiceTier?,OpenAI.OneOf{string?,System.Collections.Generic.IList{string}}?,bool?,ChatCompletionStreamOptions?,double?,double?,System.Collections.Generic.IList{ChatCompletionTool}?,ChatCompletionToolChoiceOption?,bool?,string?,System.Threading.CancellationToken)"/>
/// <inheritdoc cref="CreateChatCompletionAsync(System.Collections.Generic.IList{ChatCompletionRequestMessage},OpenAI.AnyOf{string?,CreateChatCompletionRequestModel?},bool?,System.Collections.Generic.Dictionary{string, string}?,double?,global::System.Collections.Generic.Dictionary{string, int}?,bool?,int?,int?,int?,System.Collections.Generic.IList{global::OpenAI.ChatCompletionModalitie}?,global::OpenAI.PredictionContent?,CreateChatCompletionRequestAudio?,double?,OpenAI.ResponseFormat?,int?,CreateChatCompletionRequestServiceTier?,OpenAI.OneOf{string?,System.Collections.Generic.IList{string}}?,bool?,ChatCompletionStreamOptions?,double?,double?,System.Collections.Generic.IList{ChatCompletionTool}?,ChatCompletionToolChoiceOption?,bool?,string?,System.Threading.CancellationToken)"/>
#if NET6_0_OR_GREATER
[RequiresUnreferencedCode(
"This method uses reflection to generate a JSON schema. Use overload with JsonTypeInfo parameter to avoid this.")]
Expand Down Expand Up @@ -87,7 +87,7 @@ public partial class ChatClient
response);
}

/// <inheritdoc cref="CreateChatCompletionAsync(System.Collections.Generic.IList{ChatCompletionRequestMessage},OpenAI.AnyOf{string?,CreateChatCompletionRequestModel?},bool?,System.Collections.Generic.Dictionary{string, string}?,double?,global::System.Collections.Generic.Dictionary{string, int}?,bool?,int?,int?,int?,System.Collections.Generic.IList{global::OpenAI.ChatCompletionModalitie}?,CreateChatCompletionRequestAudio?,double?,OpenAI.ResponseFormat?,int?,CreateChatCompletionRequestServiceTier?,OpenAI.OneOf{string?,System.Collections.Generic.IList{string}}?,bool?,ChatCompletionStreamOptions?,double?,double?,System.Collections.Generic.IList{ChatCompletionTool}?,ChatCompletionToolChoiceOption?,bool?,string?,System.Threading.CancellationToken)"/>
/// <inheritdoc cref="CreateChatCompletionAsync(System.Collections.Generic.IList{ChatCompletionRequestMessage},OpenAI.AnyOf{string?,CreateChatCompletionRequestModel?},bool?,System.Collections.Generic.Dictionary{string, string}?,double?,global::System.Collections.Generic.Dictionary{string, int}?,bool?,int?,int?,int?,System.Collections.Generic.IList{global::OpenAI.ChatCompletionModalitie}?,global::OpenAI.PredictionContent?,CreateChatCompletionRequestAudio?,double?,OpenAI.ResponseFormat?,int?,CreateChatCompletionRequestServiceTier?,OpenAI.OneOf{string?,System.Collections.Generic.IList{string}}?,bool?,ChatCompletionStreamOptions?,double?,double?,System.Collections.Generic.IList{ChatCompletionTool}?,ChatCompletionToolChoiceOption?,bool?,string?,System.Threading.CancellationToken)"/>
public async global::System.Threading.Tasks.Task<OpenAI.AnyOf<T, global::OpenAI.CreateChatCompletionResponse>>
CreateChatCompletionAsAsync<T>(
JsonTypeInfo<T> jsonTypeInfo,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ public partial class ChatClient
User = user,
};

await foreach (var response in CreateChatCompletionAsStreamAsync(request, cancellationToken))
await foreach (var response in CreateChatCompletionAsStreamAsync(request, cancellationToken).ConfigureAwait(false))
{
yield return response;
}
Expand Down
25 changes: 0 additions & 25 deletions src/libs/OpenAI/Generated/JsonConverters.AnyOfFactory2.g.cs

This file was deleted.

25 changes: 0 additions & 25 deletions src/libs/OpenAI/Generated/JsonConverters.OneOfFactory1.g.cs

This file was deleted.

25 changes: 0 additions & 25 deletions src/libs/OpenAI/Generated/JsonConverters.OneOfFactory2.g.cs

This file was deleted.

25 changes: 0 additions & 25 deletions src/libs/OpenAI/Generated/JsonConverters.OneOfFactory3.g.cs

This file was deleted.

25 changes: 0 additions & 25 deletions src/libs/OpenAI/Generated/JsonConverters.OneOfFactory4.g.cs

This file was deleted.

25 changes: 0 additions & 25 deletions src/libs/OpenAI/Generated/JsonConverters.OneOfFactory5.g.cs

This file was deleted.

43 changes: 37 additions & 6 deletions src/libs/OpenAI/Generated/JsonSerializerContext.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -745,33 +745,64 @@ namespace OpenAI
typeof(global::OpenAI.JsonConverters.ToolsItem6JsonConverter),
typeof(global::OpenAI.JsonConverters.ContentItemJsonConverter),
typeof(global::OpenAI.JsonConverters.AnnotationsItem2JsonConverter),
typeof(global::OpenAI.JsonConverters.OneOfJsonConverterFactory2),
typeof(global::OpenAI.JsonConverters.ChatCompletionRequestAssistantMessageContentPartJsonConverter),
typeof(global::OpenAI.JsonConverters.ChatCompletionRequestMessageJsonConverter),
typeof(global::OpenAI.JsonConverters.ChatCompletionRequestSystemMessageContentPartJsonConverter),
typeof(global::OpenAI.JsonConverters.ChatCompletionRequestUserMessageContentPartJsonConverter),
typeof(global::OpenAI.JsonConverters.ChatCompletionRequestToolMessageContentPartJsonConverter),
typeof(global::OpenAI.JsonConverters.ChatCompletionToolChoiceOptionJsonConverter),
typeof(global::OpenAI.JsonConverters.ChunkingStrategyRequestParamJsonConverter),
typeof(global::OpenAI.JsonConverters.AnyOfJsonConverterFactory2),
typeof(global::OpenAI.JsonConverters.ToolsItem2JsonConverter),
typeof(global::OpenAI.JsonConverters.CreateAssistantRequestToolResourcesFileSearchVectorStoreChunkingStrategyJsonConverter),
typeof(global::OpenAI.JsonConverters.ResponseFormatJsonConverter),
typeof(global::OpenAI.JsonConverters.OneOfJsonConverterFactory4),
typeof(global::OpenAI.JsonConverters.ContentVariant2ItemJsonConverter),
typeof(global::OpenAI.JsonConverters.ToolsItem3JsonConverter),
typeof(global::OpenAI.JsonConverters.OneOfJsonConverterFactory3),
typeof(global::OpenAI.JsonConverters.InputVariant3ItemJsonConverter),
typeof(global::OpenAI.JsonConverters.ToolsItem4JsonConverter),
typeof(global::OpenAI.JsonConverters.CreateThreadRequestToolResourcesFileSearchVectorStoreChunkingStrategyJsonConverter),
typeof(global::OpenAI.JsonConverters.ToolsItem5JsonConverter),
typeof(global::OpenAI.JsonConverters.CreateVectorStoreRequestChunkingStrategyJsonConverter),
typeof(global::OpenAI.JsonConverters.FineTuneChatCompletionRequestAssistantMessageJsonConverter),
typeof(global::OpenAI.JsonConverters.OneOfJsonConverterFactory1),
typeof(global::OpenAI.JsonConverters.OneOfJsonConverterFactory5),
typeof(global::OpenAI.JsonConverters.VectorStoreFileObjectChunkingStrategyJsonConverter),
typeof(global::OpenAI.JsonConverters.ToolsItem7JsonConverter),
typeof(global::OpenAI.JsonConverters.RealtimeServerEventJsonConverter),
typeof(global::OpenAI.JsonConverters.OneOfJsonConverter<string, global::System.Collections.Generic.IList<global::OpenAI.ChatCompletionRequestAssistantMessageContentPart>>),
typeof(global::OpenAI.JsonConverters.OneOfJsonConverter<string, global::System.Collections.Generic.IList<global::OpenAI.ChatCompletionRequestSystemMessageContentPart>>),
typeof(global::OpenAI.JsonConverters.OneOfJsonConverter<string, global::System.Collections.Generic.IList<global::OpenAI.ChatCompletionRequestUserMessageContentPart>>),
typeof(global::OpenAI.JsonConverters.OneOfJsonConverter<string, global::System.Collections.Generic.IList<global::OpenAI.ChatCompletionRequestToolMessageContentPart>>),
typeof(global::OpenAI.JsonConverters.AnyOfJsonConverter<string, global::OpenAI.CreateAssistantRequestModel?>),
typeof(global::OpenAI.JsonConverters.AnyOfJsonConverter<string, global::OpenAI.CreateChatCompletionRequestModel?>),
typeof(global::OpenAI.JsonConverters.OneOfJsonConverter<string, global::System.Collections.Generic.IList<global::OpenAI.ChatCompletionRequestMessageContentPartText>>),
typeof(global::OpenAI.JsonConverters.OneOfJsonConverter<string, global::System.Collections.Generic.IList<string>>),
typeof(global::OpenAI.JsonConverters.OneOfJsonConverter<global::OpenAI.CreateChatCompletionRequestFunctionCall?, global::OpenAI.ChatCompletionFunctionCallOption>),
typeof(global::OpenAI.JsonConverters.AnyOfJsonConverter<string, global::OpenAI.CreateCompletionRequestModel?>),
typeof(global::OpenAI.JsonConverters.OneOfJsonConverter<string, global::System.Collections.Generic.IList<string>, global::System.Collections.Generic.IList<int>, global::System.Collections.Generic.IList<global::System.Collections.Generic.IList<int>>>),
typeof(global::OpenAI.JsonConverters.OneOfJsonConverter<string, global::System.Collections.Generic.IList<string>>),
typeof(global::OpenAI.JsonConverters.OneOfJsonConverter<string, global::System.Collections.Generic.IList<string>, global::System.Collections.Generic.IList<int>, global::System.Collections.Generic.IList<global::System.Collections.Generic.IList<int>>>),
typeof(global::OpenAI.JsonConverters.AnyOfJsonConverter<string, global::OpenAI.CreateEmbeddingRequestModel?>),
typeof(global::OpenAI.JsonConverters.AnyOfJsonConverter<string, global::OpenAI.CreateFineTuningJobRequestModel?>),
typeof(global::OpenAI.JsonConverters.OneOfJsonConverter<global::OpenAI.CreateFineTuningJobRequestHyperparametersBatchSize?, int?>),
typeof(global::OpenAI.JsonConverters.OneOfJsonConverter<global::OpenAI.CreateFineTuningJobRequestHyperparametersLearningRateMultiplier?, double?>),
typeof(global::OpenAI.JsonConverters.OneOfJsonConverter<global::OpenAI.CreateFineTuningJobRequestHyperparametersNEpochs?, int?>),
typeof(global::OpenAI.JsonConverters.AnyOfJsonConverter<string, global::OpenAI.CreateImageEditRequestModel?>),
typeof(global::OpenAI.JsonConverters.AnyOfJsonConverter<string, global::OpenAI.CreateImageRequestModel?>),
typeof(global::OpenAI.JsonConverters.AnyOfJsonConverter<string, global::OpenAI.CreateImageVariationRequestModel?>),
typeof(global::OpenAI.JsonConverters.OneOfJsonConverter<string, global::System.Collections.Generic.IList<global::OpenAI.ContentVariant2Item>>),
typeof(global::OpenAI.JsonConverters.OneOfJsonConverter<string, global::System.Collections.Generic.IList<string>, global::System.Collections.Generic.IList<global::OpenAI.InputVariant3Item>>),
typeof(global::OpenAI.JsonConverters.AnyOfJsonConverter<string, global::OpenAI.CreateModerationRequestModel?>),
typeof(global::OpenAI.JsonConverters.AnyOfJsonConverter<string, global::OpenAI.CreateRunRequestModel?>),
typeof(global::OpenAI.JsonConverters.AnyOfJsonConverter<string, global::OpenAI.CreateSpeechRequestModel?>),
typeof(global::OpenAI.JsonConverters.AnyOfJsonConverter<string, global::OpenAI.CreateThreadAndRunRequestModel?>),
typeof(global::OpenAI.JsonConverters.AnyOfJsonConverter<string, global::OpenAI.CreateTranscriptionRequestModel?>),
typeof(global::OpenAI.JsonConverters.AnyOfJsonConverter<string, global::OpenAI.CreateTranslationRequestModel?>),
typeof(global::OpenAI.JsonConverters.OneOfJsonConverter<global::OpenAI.FineTuningJobHyperparametersNEpochs?, int?>),
typeof(global::OpenAI.JsonConverters.OneOfJsonConverter<global::OpenAI.FineTuningIntegration>),
typeof(global::OpenAI.JsonConverters.OneOfJsonConverter<global::OpenAI.ChatCompletionRequestSystemMessage, global::OpenAI.ChatCompletionRequestUserMessage, global::OpenAI.FineTuneChatCompletionRequestAssistantMessage?, global::OpenAI.ChatCompletionRequestToolMessage, global::OpenAI.ChatCompletionRequestFunctionMessage>),
typeof(global::OpenAI.JsonConverters.OneOfJsonConverter<int?, global::OpenAI.RealtimeSessionMaxOutputTokens?>),
typeof(global::OpenAI.JsonConverters.OneOfJsonConverter<global::OpenAI.RealtimeResponseCreateResponseToolChoice?, string>),
typeof(global::OpenAI.JsonConverters.OneOfJsonConverter<int?, global::OpenAI.RealtimeResponseCreateResponseMaxOutputTokens?>),
typeof(global::OpenAI.JsonConverters.OneOfJsonConverter<global::OpenAI.CreateTranscriptionResponseJson, global::OpenAI.CreateTranscriptionResponseVerboseJson>),
typeof(global::OpenAI.JsonConverters.OneOfJsonConverter<global::OpenAI.CreateTranslationResponseJson, global::OpenAI.CreateTranslationResponseVerboseJson>),
})]

[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::OpenAI.JsonSerializerContextTypes))]
Expand Down
Loading

0 comments on commit 839416a

Please sign in to comment.