Skip to content

Commit

Permalink
Merge pull request #22 from tryAGI/bot/update-openapi_202411131825
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored Nov 13, 2024
2 parents 670d3bb + e3087b8 commit e1d0eac
Show file tree
Hide file tree
Showing 16 changed files with 34 additions and 90 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -178,12 +178,10 @@ partial void ProcessCreateTranscriptionResponseContent(
};
}

using var __responseStream = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false);

var __responseValue = await global::Groq.CreateTranscriptionResponseJson.FromJsonStreamAsync(__responseStream, JsonSerializerContext).ConfigureAwait(false);
using var __content = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false);

return
__responseValue ??
await global::Groq.CreateTranscriptionResponseJson.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,12 +166,10 @@ partial void ProcessCreateTranslationResponseContent(
};
}

using var __responseStream = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false);

var __responseValue = await global::Groq.CreateTranslationResponseJson.FromJsonStreamAsync(__responseStream, JsonSerializerContext).ConfigureAwait(false);
using var __content = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false);

return
__responseValue ??
await global::Groq.CreateTranslationResponseJson.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,10 @@ partial void ProcessCreateChatCompletionResponseContent(
};
}

using var __responseStream = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false);

var __responseValue = await global::Groq.CreateChatCompletionResponse.FromJsonStreamAsync(__responseStream, JsonSerializerContext).ConfigureAwait(false);
using var __content = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false);

return
__responseValue ??
await global::Groq.CreateChatCompletionResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,10 @@ partial void ProcessCreateEmbeddingResponseContent(
};
}

using var __responseStream = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false);

var __responseValue = await global::Groq.CreateEmbeddingResponse.FromJsonStreamAsync(__responseStream, JsonSerializerContext).ConfigureAwait(false);
using var __content = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false);

return
__responseValue ??
await global::Groq.CreateEmbeddingResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public sealed partial class ChatCompletionRequestUserMessage
/// The contents of the user message.
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("content")]
[global::System.Text.Json.Serialization.JsonConverter(typeof(global::Groq.JsonConverters.OneOfJsonConverterFactory2))]
[global::System.Text.Json.Serialization.JsonConverter(typeof(global::Groq.JsonConverters.OneOfJsonConverter<string, global::System.Collections.Generic.IList<global::Groq.ChatCompletionRequestMessageContentPart>>))]
[global::System.Text.Json.Serialization.JsonRequired]
public required global::Groq.OneOf<string, global::System.Collections.Generic.IList<global::Groq.ChatCompletionRequestMessageContentPart>> Content { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public sealed partial class CreateChatCompletionRequest
/// `none` is the default when no functions are present. `auto` is the default if functions are present.
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("function_call")]
[global::System.Text.Json.Serialization.JsonConverter(typeof(global::Groq.JsonConverters.OneOfJsonConverterFactory2))]
[global::System.Text.Json.Serialization.JsonConverter(typeof(global::Groq.JsonConverters.OneOfJsonConverter<global::Groq.CreateChatCompletionRequestFunctionCall?, global::Groq.ChatCompletionFunctionCallOption>))]
public global::Groq.OneOf<global::Groq.CreateChatCompletionRequestFunctionCall?, global::Groq.ChatCompletionFunctionCallOption>? FunctionCall { get; set; }

/// <summary>
Expand Down Expand Up @@ -69,7 +69,7 @@ public sealed partial class CreateChatCompletionRequest
/// ID of the model to use. For details on which models are compatible with the Chat API, see available [models](/docs/models)
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("model")]
[global::System.Text.Json.Serialization.JsonConverter(typeof(global::Groq.JsonConverters.AnyOfJsonConverterFactory2))]
[global::System.Text.Json.Serialization.JsonConverter(typeof(global::Groq.JsonConverters.AnyOfJsonConverter<string, global::Groq.CreateChatCompletionRequestModel?>))]
[global::System.Text.Json.Serialization.JsonRequired]
public required global::Groq.AnyOf<string, global::Groq.CreateChatCompletionRequestModel?> Model { get; set; }

Expand Down Expand Up @@ -115,7 +115,7 @@ public sealed partial class CreateChatCompletionRequest
/// Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence.
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("stop")]
[global::System.Text.Json.Serialization.JsonConverter(typeof(global::Groq.JsonConverters.OneOfJsonConverterFactory2))]
[global::System.Text.Json.Serialization.JsonConverter(typeof(global::Groq.JsonConverters.OneOfJsonConverter<string, global::System.Collections.Generic.IList<string>>))]
public global::Groq.OneOf<string, global::System.Collections.Generic.IList<string>>? Stop { get; set; }

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public sealed partial class CreateEmbeddingRequest
/// </summary>
/// <example>The quick brown fox jumped over the lazy dog</example>
[global::System.Text.Json.Serialization.JsonPropertyName("input")]
[global::System.Text.Json.Serialization.JsonConverter(typeof(global::Groq.JsonConverters.OneOfJsonConverterFactory2))]
[global::System.Text.Json.Serialization.JsonConverter(typeof(global::Groq.JsonConverters.OneOfJsonConverter<string, global::System.Collections.Generic.IList<string>>))]
[global::System.Text.Json.Serialization.JsonRequired]
public required global::Groq.OneOf<string, global::System.Collections.Generic.IList<string>> Input { get; set; }

Expand All @@ -36,7 +36,7 @@ public sealed partial class CreateEmbeddingRequest
/// </summary>
/// <example>nomic-embed-text-v1_5</example>
[global::System.Text.Json.Serialization.JsonPropertyName("model")]
[global::System.Text.Json.Serialization.JsonConverter(typeof(global::Groq.JsonConverters.AnyOfJsonConverterFactory2))]
[global::System.Text.Json.Serialization.JsonConverter(typeof(global::Groq.JsonConverters.AnyOfJsonConverter<string, global::Groq.CreateEmbeddingRequestModel?>))]
[global::System.Text.Json.Serialization.JsonRequired]
public required global::Groq.AnyOf<string, global::Groq.CreateEmbeddingRequestModel?> Model { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public sealed partial class CreateTranscriptionRequest
/// The language of the input audio. Supplying the input language in [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format will improve accuracy and latency.
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("language")]
[global::System.Text.Json.Serialization.JsonConverter(typeof(global::Groq.JsonConverters.AnyOfJsonConverterFactory2))]
[global::System.Text.Json.Serialization.JsonConverter(typeof(global::Groq.JsonConverters.AnyOfJsonConverter<string, global::Groq.CreateTranscriptionRequestLanguage?>))]
public global::Groq.AnyOf<string, global::Groq.CreateTranscriptionRequestLanguage?>? Language { get; set; }

/// <summary>
Expand All @@ -37,7 +37,7 @@ public sealed partial class CreateTranscriptionRequest
/// </summary>
/// <example>whisper-large-v3</example>
[global::System.Text.Json.Serialization.JsonPropertyName("model")]
[global::System.Text.Json.Serialization.JsonConverter(typeof(global::Groq.JsonConverters.AnyOfJsonConverterFactory2))]
[global::System.Text.Json.Serialization.JsonConverter(typeof(global::Groq.JsonConverters.AnyOfJsonConverter<string, global::Groq.CreateTranscriptionRequestModel?>))]
[global::System.Text.Json.Serialization.JsonRequired]
public required global::Groq.AnyOf<string, global::Groq.CreateTranscriptionRequestModel?> Model { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public sealed partial class CreateTranslationRequest
/// </summary>
/// <example>whisper-1</example>
[global::System.Text.Json.Serialization.JsonPropertyName("model")]
[global::System.Text.Json.Serialization.JsonConverter(typeof(global::Groq.JsonConverters.AnyOfJsonConverterFactory2))]
[global::System.Text.Json.Serialization.JsonConverter(typeof(global::Groq.JsonConverters.AnyOfJsonConverter<string, global::Groq.CreateTranslationRequestModel?>))]
[global::System.Text.Json.Serialization.JsonRequired]
public required global::Groq.AnyOf<string, global::Groq.CreateTranslationRequestModel?> Model { get; set; }

Expand Down
2 changes: 1 addition & 1 deletion src/libs/Groq/Generated/Groq.Models.Embedding.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public sealed partial class Embedding
///
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("embedding")]
[global::System.Text.Json.Serialization.JsonConverter(typeof(global::Groq.JsonConverters.OneOfJsonConverterFactory2))]
[global::System.Text.Json.Serialization.JsonConverter(typeof(global::Groq.JsonConverters.OneOfJsonConverter<global::System.Collections.Generic.IList<double>, string>))]
[global::System.Text.Json.Serialization.JsonRequired]
public required global::Groq.OneOf<global::System.Collections.Generic.IList<double>, string> Embedding1 { get; set; }

Expand Down
6 changes: 2 additions & 4 deletions src/libs/Groq/Generated/Groq.ModelsClient.DeleteModel.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,10 @@ partial void ProcessDeleteModelResponseContent(
};
}

using var __responseStream = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false);

var __responseValue = await global::Groq.DeleteModelResponse.FromJsonStreamAsync(__responseStream, JsonSerializerContext).ConfigureAwait(false);
using var __content = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false);

return
__responseValue ??
await global::Groq.DeleteModelResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
}
}
Expand Down
6 changes: 2 additions & 4 deletions src/libs/Groq/Generated/Groq.ModelsClient.ListModels.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,10 @@ partial void ProcessListModelsResponseContent(
};
}

using var __responseStream = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false);

var __responseValue = await global::Groq.ListModelsResponse.FromJsonStreamAsync(__responseStream, JsonSerializerContext).ConfigureAwait(false);
using var __content = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false);

return
__responseValue ??
await global::Groq.ListModelsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
}
}
Expand Down
6 changes: 2 additions & 4 deletions src/libs/Groq/Generated/Groq.ModelsClient.RetrieveModel.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,10 @@ partial void ProcessRetrieveModelResponseContent(
};
}

using var __responseStream = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false);

var __responseValue = await global::Groq.Model5.FromJsonStreamAsync(__responseStream, JsonSerializerContext).ConfigureAwait(false);
using var __content = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false);

return
__responseValue ??
await global::Groq.Model5.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
}
}
Expand Down
25 changes: 0 additions & 25 deletions src/libs/Groq/Generated/JsonConverters.AnyOfFactory2.g.cs

This file was deleted.

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

This file was deleted.

12 changes: 10 additions & 2 deletions src/libs/Groq/Generated/JsonSerializerContext.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,18 @@ namespace Groq
typeof(global::Groq.JsonConverters.ListModelsResponseObjectJsonConverter),
typeof(global::Groq.JsonConverters.ListModelsResponseObjectNullableJsonConverter),
typeof(global::Groq.JsonConverters.ChatCompletionRequestMessageJsonConverter),
typeof(global::Groq.JsonConverters.OneOfJsonConverterFactory2),
typeof(global::Groq.JsonConverters.ChatCompletionRequestMessageContentPartJsonConverter),
typeof(global::Groq.JsonConverters.ChatCompletionToolChoiceOptionJsonConverter),
typeof(global::Groq.JsonConverters.AnyOfJsonConverterFactory2),
typeof(global::Groq.JsonConverters.OneOfJsonConverter<string, global::System.Collections.Generic.IList<global::Groq.ChatCompletionRequestMessageContentPart>>),
typeof(global::Groq.JsonConverters.OneOfJsonConverter<global::Groq.CreateChatCompletionRequestFunctionCall?, global::Groq.ChatCompletionFunctionCallOption>),
typeof(global::Groq.JsonConverters.AnyOfJsonConverter<string, global::Groq.CreateChatCompletionRequestModel?>),
typeof(global::Groq.JsonConverters.OneOfJsonConverter<string, global::System.Collections.Generic.IList<string>>),
typeof(global::Groq.JsonConverters.OneOfJsonConverter<string, global::System.Collections.Generic.IList<string>>),
typeof(global::Groq.JsonConverters.AnyOfJsonConverter<string, global::Groq.CreateEmbeddingRequestModel?>),
typeof(global::Groq.JsonConverters.OneOfJsonConverter<global::System.Collections.Generic.IList<double>, string>),
typeof(global::Groq.JsonConverters.AnyOfJsonConverter<string, global::Groq.CreateTranscriptionRequestLanguage?>),
typeof(global::Groq.JsonConverters.AnyOfJsonConverter<string, global::Groq.CreateTranscriptionRequestModel?>),
typeof(global::Groq.JsonConverters.AnyOfJsonConverter<string, global::Groq.CreateTranslationRequestModel?>),
})]

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

0 comments on commit e1d0eac

Please sign in to comment.