diff --git a/src/libs/Cohere/Generated/Cohere..JsonSerializerContext.g.cs b/src/libs/Cohere/Generated/Cohere..JsonSerializerContext.g.cs index dd64f4f6..5fc62027 100644 --- a/src/libs/Cohere/Generated/Cohere..JsonSerializerContext.g.cs +++ b/src/libs/Cohere/Generated/Cohere..JsonSerializerContext.g.cs @@ -15,8 +15,8 @@ namespace Cohere { typeof(global::Cohere.JsonConverters.CitationTypeJsonConverter), typeof(global::Cohere.JsonConverters.CitationTypeNullableJsonConverter), - typeof(global::Cohere.JsonConverters.ChatTextContentTypeJsonConverter), - typeof(global::Cohere.JsonConverters.ChatTextContentTypeNullableJsonConverter), + typeof(global::Cohere.JsonConverters.TextContentTypeJsonConverter), + typeof(global::Cohere.JsonConverters.TextContentTypeNullableJsonConverter), typeof(global::Cohere.JsonConverters.AssistantMessageContentVariant2ItemDiscriminatorTypeJsonConverter), typeof(global::Cohere.JsonConverters.AssistantMessageContentVariant2ItemDiscriminatorTypeNullableJsonConverter), typeof(global::Cohere.JsonConverters.AssistantMessageRoleJsonConverter), @@ -51,14 +51,14 @@ namespace Cohere typeof(global::Cohere.JsonConverters.ImageUrlDetailNullableJsonConverter), typeof(global::Cohere.JsonConverters.ContentTypeJsonConverter), typeof(global::Cohere.JsonConverters.ContentTypeNullableJsonConverter), - typeof(global::Cohere.JsonConverters.MessageContentDiscriminatorTypeJsonConverter), - typeof(global::Cohere.JsonConverters.MessageContentDiscriminatorTypeNullableJsonConverter), - typeof(global::Cohere.JsonConverters.UserMessageV2RoleJsonConverter), - typeof(global::Cohere.JsonConverters.UserMessageV2RoleNullableJsonConverter), - typeof(global::Cohere.JsonConverters.SystemMessageV2ContentVariant2ItemDiscriminatorTypeJsonConverter), - typeof(global::Cohere.JsonConverters.SystemMessageV2ContentVariant2ItemDiscriminatorTypeNullableJsonConverter), - typeof(global::Cohere.JsonConverters.SystemMessageV2RoleJsonConverter), - typeof(global::Cohere.JsonConverters.SystemMessageV2RoleNullableJsonConverter), + typeof(global::Cohere.JsonConverters.ContentDiscriminatorTypeJsonConverter), + typeof(global::Cohere.JsonConverters.ContentDiscriminatorTypeNullableJsonConverter), + typeof(global::Cohere.JsonConverters.UserMessageRoleJsonConverter), + typeof(global::Cohere.JsonConverters.UserMessageRoleNullableJsonConverter), + typeof(global::Cohere.JsonConverters.SystemMessageContentVariant2ItemDiscriminatorTypeJsonConverter), + typeof(global::Cohere.JsonConverters.SystemMessageContentVariant2ItemDiscriminatorTypeNullableJsonConverter), + typeof(global::Cohere.JsonConverters.SystemMessageRoleJsonConverter), + typeof(global::Cohere.JsonConverters.SystemMessageRoleNullableJsonConverter), typeof(global::Cohere.JsonConverters.DocumentContentTypeJsonConverter), typeof(global::Cohere.JsonConverters.DocumentContentTypeNullableJsonConverter), typeof(global::Cohere.JsonConverters.ToolContentDiscriminatorTypeJsonConverter), @@ -73,10 +73,6 @@ namespace Cohere typeof(global::Cohere.JsonConverters.MessageDiscriminatorRoleNullableJsonConverter), typeof(global::Cohere.JsonConverters.FinishReasonJsonConverter), typeof(global::Cohere.JsonConverters.FinishReasonNullableJsonConverter), - typeof(global::Cohere.JsonConverters.ResponseFormatTypeJsonConverter), - typeof(global::Cohere.JsonConverters.ResponseFormatTypeNullableJsonConverter), - typeof(global::Cohere.JsonConverters.ResponseFormatTypeV2JsonConverter), - typeof(global::Cohere.JsonConverters.ResponseFormatTypeV2NullableJsonConverter), typeof(global::Cohere.JsonConverters.CitationOptionsModeJsonConverter), typeof(global::Cohere.JsonConverters.CitationOptionsModeNullableJsonConverter), typeof(global::Cohere.JsonConverters.CompatibleEndpointJsonConverter), @@ -115,6 +111,10 @@ namespace Cohere typeof(global::Cohere.JsonConverters.GenerateStreamedResponseDiscriminatorEventTypeNullableJsonConverter), typeof(global::Cohere.JsonConverters.GetClusterJobResponseStatusJsonConverter), typeof(global::Cohere.JsonConverters.GetClusterJobResponseStatusNullableJsonConverter), + typeof(global::Cohere.JsonConverters.ResponseFormatTypeJsonConverter), + typeof(global::Cohere.JsonConverters.ResponseFormatTypeNullableJsonConverter), + typeof(global::Cohere.JsonConverters.ResponseFormatTypeV2JsonConverter), + typeof(global::Cohere.JsonConverters.ResponseFormatTypeV2NullableJsonConverter), typeof(global::Cohere.JsonConverters.ReasoningEffortJsonConverter), typeof(global::Cohere.JsonConverters.ReasoningEffortNullableJsonConverter), typeof(global::Cohere.JsonConverters.ResponseFormatDiscriminatorTypeJsonConverter), @@ -172,7 +172,7 @@ namespace Cohere typeof(global::Cohere.JsonConverters.ChatMessageEndEventJsonConverter), typeof(global::Cohere.JsonConverters.ChatMessageStartEventJsonConverter), typeof(global::Cohere.JsonConverters.ChatMessageV2JsonConverter), - typeof(global::Cohere.JsonConverters.MessageContentJsonConverter), + typeof(global::Cohere.JsonConverters.Content2JsonConverter), typeof(global::Cohere.JsonConverters.ContentVariant2Item2JsonConverter), typeof(global::Cohere.JsonConverters.ToolContentJsonConverter), typeof(global::Cohere.JsonConverters.ChatSearchQueriesGenerationEventJsonConverter), @@ -200,7 +200,7 @@ namespace Cohere typeof(global::Cohere.JsonConverters.StreamedChatResponseV2JsonConverter), typeof(global::Cohere.JsonConverters.EmbedResponseJsonConverter), typeof(global::Cohere.JsonConverters.OneOfJsonConverter>), - typeof(global::Cohere.JsonConverters.OneOfJsonConverter>), + typeof(global::Cohere.JsonConverters.OneOfJsonConverter>), typeof(global::Cohere.JsonConverters.OneOfJsonConverter>), typeof(global::Cohere.JsonConverters.OneOfJsonConverter>), typeof(global::Cohere.JsonConverters.OneOfJsonConverter), diff --git a/src/libs/Cohere/Generated/Cohere.CohereClient.Chat.g.cs b/src/libs/Cohere/Generated/Cohere.CohereClient.Chat.g.cs index b43741ef..b7e5b4fe 100644 --- a/src/libs/Cohere/Generated/Cohere.CohereClient.Chat.g.cs +++ b/src/libs/Cohere/Generated/Cohere.CohereClient.Chat.g.cs @@ -26,7 +26,7 @@ partial void ProcessChatResponseContent( ref string content); /// - /// Chat
+ /// Chat V1 API
/// Generates a text response to a user message.
/// To learn how to use the Chat API and RAG follow our [Text Generation guides](https://docs.cohere.com/docs/chat-api). ///
@@ -526,7 +526,7 @@ partial void ProcessChatResponseContent( } /// - /// Chat
+ /// Chat V1 API
/// Generates a text response to a user message.
/// To learn how to use the Chat API and RAG follow our [Text Generation guides](https://docs.cohere.com/docs/chat-api). ///
diff --git a/src/libs/Cohere/Generated/Cohere.CohereClient.Chatv2.g.cs b/src/libs/Cohere/Generated/Cohere.CohereClient.Chatv2.g.cs index 7041e783..a01fc381 100644 --- a/src/libs/Cohere/Generated/Cohere.CohereClient.Chatv2.g.cs +++ b/src/libs/Cohere/Generated/Cohere.CohereClient.Chatv2.g.cs @@ -24,7 +24,7 @@ partial void ProcessChatv2ResponseContent( ref string content); /// - /// Chat with the model
+ /// Chat V2 API
/// Generates a text response to a user message and streams it down, token by token. To learn how to use the Chat API with streaming follow our [Text Generation guides](https://docs.cohere.com/v2/docs/chat-api).
/// Follow the [Migration Guide](https://docs.cohere.com/v2/docs/migrating-v1-to-v2) for instructions on moving from API v1 to API v2. ///
@@ -516,7 +516,7 @@ partial void ProcessChatv2ResponseContent( } /// - /// Chat with the model
+ /// Chat V2 API
/// Generates a text response to a user message and streams it down, token by token. To learn how to use the Chat API with streaming follow our [Text Generation guides](https://docs.cohere.com/v2/docs/chat-api).
/// Follow the [Migration Guide](https://docs.cohere.com/v2/docs/migrating-v1-to-v2) for instructions on moving from API v1 to API v2. ///
diff --git a/src/libs/Cohere/Generated/Cohere.CohereClient.Embed.g.cs b/src/libs/Cohere/Generated/Cohere.CohereClient.Embed.g.cs index 7a9c98ed..13800414 100644 --- a/src/libs/Cohere/Generated/Cohere.CohereClient.Embed.g.cs +++ b/src/libs/Cohere/Generated/Cohere.CohereClient.Embed.g.cs @@ -24,7 +24,7 @@ partial void ProcessEmbedResponseContent( ref string content); /// - /// Embed
+ /// Embed V1 API
/// This endpoint returns text and image embeddings. An embedding is a list of floating point numbers that captures semantic information about the content that it represents.
/// Embeddings can be used to create classifiers as well as empower semantic search. To learn more about embeddings, see the embedding page.
/// If you want to learn more how to use the embedding model, have a look at the [Semantic Search Guide](https://docs.cohere.com/docs/semantic-search). @@ -517,7 +517,7 @@ partial void ProcessEmbedResponseContent( } /// - /// Embed
+ /// Embed V1 API
/// This endpoint returns text and image embeddings. An embedding is a list of floating point numbers that captures semantic information about the content that it represents.
/// Embeddings can be used to create classifiers as well as empower semantic search. To learn more about embeddings, see the embedding page.
/// If you want to learn more how to use the embedding model, have a look at the [Semantic Search Guide](https://docs.cohere.com/docs/semantic-search). diff --git a/src/libs/Cohere/Generated/Cohere.CohereClient.Embedv2.g.cs b/src/libs/Cohere/Generated/Cohere.CohereClient.Embedv2.g.cs index 22333536..938a0239 100644 --- a/src/libs/Cohere/Generated/Cohere.CohereClient.Embedv2.g.cs +++ b/src/libs/Cohere/Generated/Cohere.CohereClient.Embedv2.g.cs @@ -24,7 +24,7 @@ partial void ProcessEmbedv2ResponseContent( ref string content); /// - /// Embed
+ /// Embed V2 API
/// This endpoint returns text embeddings. An embedding is a list of floating point numbers that captures semantic information about the text that it represents.
/// Embeddings can be used to create text classifiers as well as empower semantic search. To learn more about embeddings, see the embedding page.
/// If you want to learn more how to use the embedding model, have a look at the [Semantic Search Guide](https://docs.cohere.com/docs/semantic-search). @@ -517,7 +517,7 @@ partial void ProcessEmbedv2ResponseContent( } /// - /// Embed
+ /// Embed V2 API
/// This endpoint returns text embeddings. An embedding is a list of floating point numbers that captures semantic information about the text that it represents.
/// Embeddings can be used to create text classifiers as well as empower semantic search. To learn more about embeddings, see the embedding page.
/// If you want to learn more how to use the embedding model, have a look at the [Semantic Search Guide](https://docs.cohere.com/docs/semantic-search). diff --git a/src/libs/Cohere/Generated/Cohere.CohereClient.Rerank.g.cs b/src/libs/Cohere/Generated/Cohere.CohereClient.Rerank.g.cs index 19a81273..109c2029 100644 --- a/src/libs/Cohere/Generated/Cohere.CohereClient.Rerank.g.cs +++ b/src/libs/Cohere/Generated/Cohere.CohereClient.Rerank.g.cs @@ -24,7 +24,7 @@ partial void ProcessRerankResponseContent( ref string content); /// - /// Rerank
+ /// Rerank V1 API
/// This endpoint takes in a query and a list of texts and produces an ordered array with each text assigned a relevance score. ///
/// @@ -515,7 +515,7 @@ partial void ProcessRerankResponseContent( } /// - /// Rerank
+ /// Rerank V1 API
/// This endpoint takes in a query and a list of texts and produces an ordered array with each text assigned a relevance score. ///
/// diff --git a/src/libs/Cohere/Generated/Cohere.CohereClient.Rerankv2.g.cs b/src/libs/Cohere/Generated/Cohere.CohereClient.Rerankv2.g.cs index af066c7d..33b549fd 100644 --- a/src/libs/Cohere/Generated/Cohere.CohereClient.Rerankv2.g.cs +++ b/src/libs/Cohere/Generated/Cohere.CohereClient.Rerankv2.g.cs @@ -24,7 +24,7 @@ partial void ProcessRerankv2ResponseContent( ref string content); /// - /// Rerank
+ /// Rerank V2 API
/// This endpoint takes in a query and a list of texts and produces an ordered array with each text assigned a relevance score. ///
/// @@ -515,7 +515,7 @@ partial void ProcessRerankv2ResponseContent( } /// - /// Rerank
+ /// Rerank V2 API
/// This endpoint takes in a query and a list of texts and produces an ordered array with each text assigned a relevance score. ///
/// diff --git a/src/libs/Cohere/Generated/Cohere.ICohereClient.Chat.g.cs b/src/libs/Cohere/Generated/Cohere.ICohereClient.Chat.g.cs index 0050dbf2..61eecad1 100644 --- a/src/libs/Cohere/Generated/Cohere.ICohereClient.Chat.g.cs +++ b/src/libs/Cohere/Generated/Cohere.ICohereClient.Chat.g.cs @@ -5,7 +5,7 @@ namespace Cohere public partial interface ICohereClient { /// - /// Chat
+ /// Chat V1 API
/// Generates a text response to a user message.
/// To learn how to use the Chat API and RAG follow our [Text Generation guides](https://docs.cohere.com/docs/chat-api). ///
@@ -21,7 +21,7 @@ public partial interface ICohereClient global::System.Threading.CancellationToken cancellationToken = default); /// - /// Chat
+ /// Chat V1 API
/// Generates a text response to a user message.
/// To learn how to use the Chat API and RAG follow our [Text Generation guides](https://docs.cohere.com/docs/chat-api). ///
diff --git a/src/libs/Cohere/Generated/Cohere.ICohereClient.Chatv2.g.cs b/src/libs/Cohere/Generated/Cohere.ICohereClient.Chatv2.g.cs index 84a86b76..0818b885 100644 --- a/src/libs/Cohere/Generated/Cohere.ICohereClient.Chatv2.g.cs +++ b/src/libs/Cohere/Generated/Cohere.ICohereClient.Chatv2.g.cs @@ -5,7 +5,7 @@ namespace Cohere public partial interface ICohereClient { /// - /// Chat with the model
+ /// Chat V2 API
/// Generates a text response to a user message and streams it down, token by token. To learn how to use the Chat API with streaming follow our [Text Generation guides](https://docs.cohere.com/v2/docs/chat-api).
/// Follow the [Migration Guide](https://docs.cohere.com/v2/docs/migrating-v1-to-v2) for instructions on moving from API v1 to API v2. ///
@@ -19,7 +19,7 @@ public partial interface ICohereClient global::System.Threading.CancellationToken cancellationToken = default); /// - /// Chat with the model
+ /// Chat V2 API
/// Generates a text response to a user message and streams it down, token by token. To learn how to use the Chat API with streaming follow our [Text Generation guides](https://docs.cohere.com/v2/docs/chat-api).
/// Follow the [Migration Guide](https://docs.cohere.com/v2/docs/migrating-v1-to-v2) for instructions on moving from API v1 to API v2. ///
diff --git a/src/libs/Cohere/Generated/Cohere.ICohereClient.Embed.g.cs b/src/libs/Cohere/Generated/Cohere.ICohereClient.Embed.g.cs index 55d756da..b7eb8a51 100644 --- a/src/libs/Cohere/Generated/Cohere.ICohereClient.Embed.g.cs +++ b/src/libs/Cohere/Generated/Cohere.ICohereClient.Embed.g.cs @@ -5,7 +5,7 @@ namespace Cohere public partial interface ICohereClient { /// - /// Embed
+ /// Embed V1 API
/// This endpoint returns text and image embeddings. An embedding is a list of floating point numbers that captures semantic information about the content that it represents.
/// Embeddings can be used to create classifiers as well as empower semantic search. To learn more about embeddings, see the embedding page.
/// If you want to learn more how to use the embedding model, have a look at the [Semantic Search Guide](https://docs.cohere.com/docs/semantic-search). @@ -20,7 +20,7 @@ public partial interface ICohereClient global::System.Threading.CancellationToken cancellationToken = default); /// - /// Embed
+ /// Embed V1 API
/// This endpoint returns text and image embeddings. An embedding is a list of floating point numbers that captures semantic information about the content that it represents.
/// Embeddings can be used to create classifiers as well as empower semantic search. To learn more about embeddings, see the embedding page.
/// If you want to learn more how to use the embedding model, have a look at the [Semantic Search Guide](https://docs.cohere.com/docs/semantic-search). diff --git a/src/libs/Cohere/Generated/Cohere.ICohereClient.Embedv2.g.cs b/src/libs/Cohere/Generated/Cohere.ICohereClient.Embedv2.g.cs index d4e5f2f4..0cb3d769 100644 --- a/src/libs/Cohere/Generated/Cohere.ICohereClient.Embedv2.g.cs +++ b/src/libs/Cohere/Generated/Cohere.ICohereClient.Embedv2.g.cs @@ -5,7 +5,7 @@ namespace Cohere public partial interface ICohereClient { /// - /// Embed
+ /// Embed V2 API
/// This endpoint returns text embeddings. An embedding is a list of floating point numbers that captures semantic information about the text that it represents.
/// Embeddings can be used to create text classifiers as well as empower semantic search. To learn more about embeddings, see the embedding page.
/// If you want to learn more how to use the embedding model, have a look at the [Semantic Search Guide](https://docs.cohere.com/docs/semantic-search). @@ -20,7 +20,7 @@ public partial interface ICohereClient global::System.Threading.CancellationToken cancellationToken = default); /// - /// Embed
+ /// Embed V2 API
/// This endpoint returns text embeddings. An embedding is a list of floating point numbers that captures semantic information about the text that it represents.
/// Embeddings can be used to create text classifiers as well as empower semantic search. To learn more about embeddings, see the embedding page.
/// If you want to learn more how to use the embedding model, have a look at the [Semantic Search Guide](https://docs.cohere.com/docs/semantic-search). diff --git a/src/libs/Cohere/Generated/Cohere.ICohereClient.Rerank.g.cs b/src/libs/Cohere/Generated/Cohere.ICohereClient.Rerank.g.cs index bc7d6e83..58bdc2bb 100644 --- a/src/libs/Cohere/Generated/Cohere.ICohereClient.Rerank.g.cs +++ b/src/libs/Cohere/Generated/Cohere.ICohereClient.Rerank.g.cs @@ -5,7 +5,7 @@ namespace Cohere public partial interface ICohereClient { /// - /// Rerank
+ /// Rerank V1 API
/// This endpoint takes in a query and a list of texts and produces an ordered array with each text assigned a relevance score. ///
/// @@ -18,7 +18,7 @@ public partial interface ICohereClient global::System.Threading.CancellationToken cancellationToken = default); /// - /// Rerank
+ /// Rerank V1 API
/// This endpoint takes in a query and a list of texts and produces an ordered array with each text assigned a relevance score. ///
/// diff --git a/src/libs/Cohere/Generated/Cohere.ICohereClient.Rerankv2.g.cs b/src/libs/Cohere/Generated/Cohere.ICohereClient.Rerankv2.g.cs index 5bd9355c..85955e85 100644 --- a/src/libs/Cohere/Generated/Cohere.ICohereClient.Rerankv2.g.cs +++ b/src/libs/Cohere/Generated/Cohere.ICohereClient.Rerankv2.g.cs @@ -5,7 +5,7 @@ namespace Cohere public partial interface ICohereClient { /// - /// Rerank
+ /// Rerank V2 API
/// This endpoint takes in a query and a list of texts and produces an ordered array with each text assigned a relevance score. ///
/// @@ -18,7 +18,7 @@ public partial interface ICohereClient global::System.Threading.CancellationToken cancellationToken = default); /// - /// Rerank
+ /// Rerank V2 API
/// This endpoint takes in a query and a list of texts and produces an ordered array with each text assigned a relevance score. ///
/// diff --git a/src/libs/Cohere/Generated/Cohere.JsonConverters.ChatMessageV2.g.cs b/src/libs/Cohere/Generated/Cohere.JsonConverters.ChatMessageV2.g.cs index d75b3c26..2ca95a27 100644 --- a/src/libs/Cohere/Generated/Cohere.JsonConverters.ChatMessageV2.g.cs +++ b/src/libs/Cohere/Generated/Cohere.JsonConverters.ChatMessageV2.g.cs @@ -21,11 +21,11 @@ public class ChatMessageV2JsonConverter : global::System.Text.Json.Serialization throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Cohere.ChatMessageV2Discriminator)}"); var discriminator = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, discriminatorTypeInfo); - global::Cohere.UserMessageV2? user = default; + global::Cohere.UserMessage? user = default; if (discriminator?.Role == global::Cohere.ChatMessageV2DiscriminatorRole.User) { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Cohere.UserMessageV2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Cohere.UserMessageV2)}"); + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Cohere.UserMessage), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Cohere.UserMessage)}"); user = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); } global::Cohere.AssistantMessage? assistant = default; @@ -35,11 +35,11 @@ public class ChatMessageV2JsonConverter : global::System.Text.Json.Serialization throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Cohere.AssistantMessage)}"); assistant = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); } - global::Cohere.SystemMessageV2? system = default; + global::Cohere.SystemMessage? system = default; if (discriminator?.Role == global::Cohere.ChatMessageV2DiscriminatorRole.System) { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Cohere.SystemMessageV2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Cohere.SystemMessageV2)}"); + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Cohere.SystemMessage), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Cohere.SystemMessage)}"); system = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); } global::Cohere.ToolMessageV2? tool = default; @@ -72,8 +72,8 @@ public override void Write( if (value.IsUser) { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Cohere.UserMessageV2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Cohere.UserMessageV2).Name}"); + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Cohere.UserMessage), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Cohere.UserMessage).Name}"); global::System.Text.Json.JsonSerializer.Serialize(writer, value.User, typeInfo); } else if (value.IsAssistant) @@ -84,8 +84,8 @@ public override void Write( } else if (value.IsSystem) { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Cohere.SystemMessageV2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Cohere.SystemMessageV2).Name}"); + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Cohere.SystemMessage), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Cohere.SystemMessage).Name}"); global::System.Text.Json.JsonSerializer.Serialize(writer, value.System, typeInfo); } else if (value.IsTool) diff --git a/src/libs/Cohere/Generated/Cohere.JsonConverters.MessageContent.g.cs b/src/libs/Cohere/Generated/Cohere.JsonConverters.Content2.g.cs similarity index 74% rename from src/libs/Cohere/Generated/Cohere.JsonConverters.MessageContent.g.cs rename to src/libs/Cohere/Generated/Cohere.JsonConverters.Content2.g.cs index 92b6860c..9c96a2df 100644 --- a/src/libs/Cohere/Generated/Cohere.JsonConverters.MessageContent.g.cs +++ b/src/libs/Cohere/Generated/Cohere.JsonConverters.Content2.g.cs @@ -4,10 +4,10 @@ namespace Cohere.JsonConverters { /// - public class MessageContentJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public class Content2JsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::Cohere.MessageContent Read( + public override global::Cohere.Content2 Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -17,26 +17,26 @@ public class MessageContentJsonConverter : global::System.Text.Json.Serializatio var readerCopy = reader; - var discriminatorTypeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Cohere.MessageContentDiscriminator), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Cohere.MessageContentDiscriminator)}"); + var discriminatorTypeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Cohere.ContentDiscriminator), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Cohere.ContentDiscriminator)}"); var discriminator = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, discriminatorTypeInfo); - global::Cohere.ChatTextContent? text = default; - if (discriminator?.Type == global::Cohere.MessageContentDiscriminatorType.Text) + global::Cohere.TextContent? text = default; + if (discriminator?.Type == global::Cohere.ContentDiscriminatorType.Text) { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Cohere.ChatTextContent), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Cohere.ChatTextContent)}"); + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Cohere.TextContent), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Cohere.TextContent)}"); text = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); } global::Cohere.ImageContent? imageUrl = default; - if (discriminator?.Type == global::Cohere.MessageContentDiscriminatorType.ImageUrl) + if (discriminator?.Type == global::Cohere.ContentDiscriminatorType.ImageUrl) { var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Cohere.ImageContent), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Cohere.ImageContent)}"); imageUrl = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); } - var result = new global::Cohere.MessageContent( + var result = new global::Cohere.Content2( discriminator?.Type, text, imageUrl @@ -48,7 +48,7 @@ public class MessageContentJsonConverter : global::System.Text.Json.Serializatio /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::Cohere.MessageContent value, + global::Cohere.Content2 value, global::System.Text.Json.JsonSerializerOptions options) { options = options ?? throw new global::System.ArgumentNullException(nameof(options)); @@ -56,8 +56,8 @@ public override void Write( if (value.IsText) { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Cohere.ChatTextContent), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Cohere.ChatTextContent).Name}"); + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Cohere.TextContent), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Cohere.TextContent).Name}"); global::System.Text.Json.JsonSerializer.Serialize(writer, value.Text, typeInfo); } else if (value.IsImageUrl) diff --git a/src/libs/Cohere/Generated/Cohere.JsonConverters.MessageContentDiscriminatorType.g.cs b/src/libs/Cohere/Generated/Cohere.JsonConverters.ContentDiscriminatorType.g.cs similarity index 65% rename from src/libs/Cohere/Generated/Cohere.JsonConverters.MessageContentDiscriminatorType.g.cs rename to src/libs/Cohere/Generated/Cohere.JsonConverters.ContentDiscriminatorType.g.cs index 795389cb..b1cc22c6 100644 --- a/src/libs/Cohere/Generated/Cohere.JsonConverters.MessageContentDiscriminatorType.g.cs +++ b/src/libs/Cohere/Generated/Cohere.JsonConverters.ContentDiscriminatorType.g.cs @@ -3,10 +3,10 @@ namespace Cohere.JsonConverters { /// - public sealed class MessageContentDiscriminatorTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class ContentDiscriminatorTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::Cohere.MessageContentDiscriminatorType Read( + public override global::Cohere.ContentDiscriminatorType Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class MessageContentDiscriminatorTypeJsonConverter : global::Syste var stringValue = reader.GetString(); if (stringValue != null) { - return global::Cohere.MessageContentDiscriminatorTypeExtensions.ToEnum(stringValue) ?? default; + return global::Cohere.ContentDiscriminatorTypeExtensions.ToEnum(stringValue) ?? default; } break; @@ -26,11 +26,11 @@ public sealed class MessageContentDiscriminatorTypeJsonConverter : global::Syste case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::Cohere.MessageContentDiscriminatorType)numValue; + return (global::Cohere.ContentDiscriminatorType)numValue; } case global::System.Text.Json.JsonTokenType.Null: { - return default(global::Cohere.MessageContentDiscriminatorType); + return default(global::Cohere.ContentDiscriminatorType); } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -42,12 +42,12 @@ public sealed class MessageContentDiscriminatorTypeJsonConverter : global::Syste /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::Cohere.MessageContentDiscriminatorType value, + global::Cohere.ContentDiscriminatorType value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - writer.WriteStringValue(global::Cohere.MessageContentDiscriminatorTypeExtensions.ToValueString(value)); + writer.WriteStringValue(global::Cohere.ContentDiscriminatorTypeExtensions.ToValueString(value)); } } } diff --git a/src/libs/Cohere/Generated/Cohere.JsonConverters.MessageContentDiscriminatorTypeNullable.g.cs b/src/libs/Cohere/Generated/Cohere.JsonConverters.ContentDiscriminatorTypeNullable.g.cs similarity index 67% rename from src/libs/Cohere/Generated/Cohere.JsonConverters.MessageContentDiscriminatorTypeNullable.g.cs rename to src/libs/Cohere/Generated/Cohere.JsonConverters.ContentDiscriminatorTypeNullable.g.cs index 5ee59a47..7bc5ee03 100644 --- a/src/libs/Cohere/Generated/Cohere.JsonConverters.MessageContentDiscriminatorTypeNullable.g.cs +++ b/src/libs/Cohere/Generated/Cohere.JsonConverters.ContentDiscriminatorTypeNullable.g.cs @@ -3,10 +3,10 @@ namespace Cohere.JsonConverters { /// - public sealed class MessageContentDiscriminatorTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class ContentDiscriminatorTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::Cohere.MessageContentDiscriminatorType? Read( + public override global::Cohere.ContentDiscriminatorType? Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class MessageContentDiscriminatorTypeNullableJsonConverter : globa var stringValue = reader.GetString(); if (stringValue != null) { - return global::Cohere.MessageContentDiscriminatorTypeExtensions.ToEnum(stringValue); + return global::Cohere.ContentDiscriminatorTypeExtensions.ToEnum(stringValue); } break; @@ -26,11 +26,11 @@ public sealed class MessageContentDiscriminatorTypeNullableJsonConverter : globa case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::Cohere.MessageContentDiscriminatorType)numValue; + return (global::Cohere.ContentDiscriminatorType)numValue; } case global::System.Text.Json.JsonTokenType.Null: { - return default(global::Cohere.MessageContentDiscriminatorType?); + return default(global::Cohere.ContentDiscriminatorType?); } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -42,7 +42,7 @@ public sealed class MessageContentDiscriminatorTypeNullableJsonConverter : globa /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::Cohere.MessageContentDiscriminatorType? value, + global::Cohere.ContentDiscriminatorType? value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); @@ -53,7 +53,7 @@ public override void Write( } else { - writer.WriteStringValue(global::Cohere.MessageContentDiscriminatorTypeExtensions.ToValueString(value.Value)); + writer.WriteStringValue(global::Cohere.ContentDiscriminatorTypeExtensions.ToValueString(value.Value)); } } } diff --git a/src/libs/Cohere/Generated/Cohere.JsonConverters.ContentItem.g.cs b/src/libs/Cohere/Generated/Cohere.JsonConverters.ContentItem.g.cs index f502267c..291ccfd4 100644 --- a/src/libs/Cohere/Generated/Cohere.JsonConverters.ContentItem.g.cs +++ b/src/libs/Cohere/Generated/Cohere.JsonConverters.ContentItem.g.cs @@ -21,11 +21,11 @@ public class ContentItemJsonConverter : global::System.Text.Json.Serialization.J throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Cohere.AssistantMessageResponseContentItemDiscriminator)}"); var discriminator = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, discriminatorTypeInfo); - global::Cohere.ChatTextContent? text = default; + global::Cohere.TextContent? text = default; if (discriminator?.Type == global::Cohere.AssistantMessageResponseContentItemDiscriminatorType.Text) { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Cohere.ChatTextContent), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Cohere.ChatTextContent)}"); + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Cohere.TextContent), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Cohere.TextContent)}"); text = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); } @@ -48,8 +48,8 @@ public override void Write( if (value.IsText) { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Cohere.ChatTextContent), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Cohere.ChatTextContent).Name}"); + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Cohere.TextContent), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Cohere.TextContent).Name}"); global::System.Text.Json.JsonSerializer.Serialize(writer, value.Text, typeInfo); } } diff --git a/src/libs/Cohere/Generated/Cohere.JsonConverters.ContentVariant2Item.g.cs b/src/libs/Cohere/Generated/Cohere.JsonConverters.ContentVariant2Item.g.cs index 9566a27c..49e2d30b 100644 --- a/src/libs/Cohere/Generated/Cohere.JsonConverters.ContentVariant2Item.g.cs +++ b/src/libs/Cohere/Generated/Cohere.JsonConverters.ContentVariant2Item.g.cs @@ -21,11 +21,11 @@ public class ContentVariant2ItemJsonConverter : global::System.Text.Json.Seriali throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Cohere.AssistantMessageContentVariant2ItemDiscriminator)}"); var discriminator = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, discriminatorTypeInfo); - global::Cohere.ChatTextContent? text = default; + global::Cohere.TextContent? text = default; if (discriminator?.Type == global::Cohere.AssistantMessageContentVariant2ItemDiscriminatorType.Text) { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Cohere.ChatTextContent), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Cohere.ChatTextContent)}"); + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Cohere.TextContent), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Cohere.TextContent)}"); text = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); } @@ -48,8 +48,8 @@ public override void Write( if (value.IsText) { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Cohere.ChatTextContent), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Cohere.ChatTextContent).Name}"); + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Cohere.TextContent), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Cohere.TextContent).Name}"); global::System.Text.Json.JsonSerializer.Serialize(writer, value.Text, typeInfo); } } diff --git a/src/libs/Cohere/Generated/Cohere.JsonConverters.ContentVariant2Item2.g.cs b/src/libs/Cohere/Generated/Cohere.JsonConverters.ContentVariant2Item2.g.cs index 40c8c1fa..9d922416 100644 --- a/src/libs/Cohere/Generated/Cohere.JsonConverters.ContentVariant2Item2.g.cs +++ b/src/libs/Cohere/Generated/Cohere.JsonConverters.ContentVariant2Item2.g.cs @@ -17,15 +17,15 @@ public class ContentVariant2Item2JsonConverter : global::System.Text.Json.Serial var readerCopy = reader; - var discriminatorTypeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Cohere.SystemMessageV2ContentVariant2ItemDiscriminator), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Cohere.SystemMessageV2ContentVariant2ItemDiscriminator)}"); + var discriminatorTypeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Cohere.SystemMessageContentVariant2ItemDiscriminator), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Cohere.SystemMessageContentVariant2ItemDiscriminator)}"); var discriminator = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, discriminatorTypeInfo); - global::Cohere.ChatTextContent? text = default; - if (discriminator?.Type == global::Cohere.SystemMessageV2ContentVariant2ItemDiscriminatorType.Text) + global::Cohere.TextContent? text = default; + if (discriminator?.Type == global::Cohere.SystemMessageContentVariant2ItemDiscriminatorType.Text) { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Cohere.ChatTextContent), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Cohere.ChatTextContent)}"); + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Cohere.TextContent), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Cohere.TextContent)}"); text = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); } @@ -48,8 +48,8 @@ public override void Write( if (value.IsText) { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Cohere.ChatTextContent), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Cohere.ChatTextContent).Name}"); + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Cohere.TextContent), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Cohere.TextContent).Name}"); global::System.Text.Json.JsonSerializer.Serialize(writer, value.Text, typeInfo); } } diff --git a/src/libs/Cohere/Generated/Cohere.JsonConverters.Message.g.cs b/src/libs/Cohere/Generated/Cohere.JsonConverters.Message.g.cs index 4d17d2d7..b044d578 100644 --- a/src/libs/Cohere/Generated/Cohere.JsonConverters.Message.g.cs +++ b/src/libs/Cohere/Generated/Cohere.JsonConverters.Message.g.cs @@ -28,11 +28,11 @@ public class MessageJsonConverter : global::System.Text.Json.Serialization.JsonC throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Cohere.ChatMessage)}"); cHATBOT = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); } - global::Cohere.ChatToolMessage? tOOL = default; + global::Cohere.ToolMessage? tOOL = default; if (discriminator?.Role == global::Cohere.MessageDiscriminatorRole.TOOL) { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Cohere.ChatToolMessage), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Cohere.ChatToolMessage)}"); + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Cohere.ToolMessage), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Cohere.ToolMessage)}"); tOOL = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); } @@ -62,8 +62,8 @@ public override void Write( } else if (value.IsTOOL) { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Cohere.ChatToolMessage), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Cohere.ChatToolMessage).Name}"); + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Cohere.ToolMessage), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Cohere.ToolMessage).Name}"); global::System.Text.Json.JsonSerializer.Serialize(writer, value.TOOL, typeInfo); } } diff --git a/src/libs/Cohere/Generated/Cohere.JsonConverters.ResponseFormat.g.cs b/src/libs/Cohere/Generated/Cohere.JsonConverters.ResponseFormat.g.cs index 8782db98..d1cae405 100644 --- a/src/libs/Cohere/Generated/Cohere.JsonConverters.ResponseFormat.g.cs +++ b/src/libs/Cohere/Generated/Cohere.JsonConverters.ResponseFormat.g.cs @@ -21,11 +21,11 @@ public class ResponseFormatJsonConverter : global::System.Text.Json.Serializatio throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Cohere.ResponseFormatDiscriminator)}"); var discriminator = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, discriminatorTypeInfo); - global::Cohere.ChatTextResponseFormat? text = default; + global::Cohere.TextResponseFormat? text = default; if (discriminator?.Type == global::Cohere.ResponseFormatDiscriminatorType.Text) { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Cohere.ChatTextResponseFormat), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Cohere.ChatTextResponseFormat)}"); + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Cohere.TextResponseFormat), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Cohere.TextResponseFormat)}"); text = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); } global::Cohere.JSONResponseFormat? jsonObject = default; @@ -56,8 +56,8 @@ public override void Write( if (value.IsText) { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Cohere.ChatTextResponseFormat), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Cohere.ChatTextResponseFormat).Name}"); + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Cohere.TextResponseFormat), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Cohere.TextResponseFormat).Name}"); global::System.Text.Json.JsonSerializer.Serialize(writer, value.Text, typeInfo); } else if (value.IsJsonObject) diff --git a/src/libs/Cohere/Generated/Cohere.JsonConverters.ResponseFormatV2.g.cs b/src/libs/Cohere/Generated/Cohere.JsonConverters.ResponseFormatV2.g.cs index 5ecf3d20..ac8fa408 100644 --- a/src/libs/Cohere/Generated/Cohere.JsonConverters.ResponseFormatV2.g.cs +++ b/src/libs/Cohere/Generated/Cohere.JsonConverters.ResponseFormatV2.g.cs @@ -21,11 +21,11 @@ public class ResponseFormatV2JsonConverter : global::System.Text.Json.Serializat throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Cohere.ResponseFormatV2Discriminator)}"); var discriminator = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, discriminatorTypeInfo); - global::Cohere.ChatTextResponseFormatV2? text = default; + global::Cohere.TextResponseFormatV2? text = default; if (discriminator?.Type == global::Cohere.ResponseFormatV2DiscriminatorType.Text) { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Cohere.ChatTextResponseFormatV2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Cohere.ChatTextResponseFormatV2)}"); + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Cohere.TextResponseFormatV2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Cohere.TextResponseFormatV2)}"); text = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); } global::Cohere.JsonResponseFormatV2? jsonObject = default; @@ -56,8 +56,8 @@ public override void Write( if (value.IsText) { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Cohere.ChatTextResponseFormatV2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Cohere.ChatTextResponseFormatV2).Name}"); + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Cohere.TextResponseFormatV2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Cohere.TextResponseFormatV2).Name}"); global::System.Text.Json.JsonSerializer.Serialize(writer, value.Text, typeInfo); } else if (value.IsJsonObject) diff --git a/src/libs/Cohere/Generated/Cohere.JsonConverters.Source.g.cs b/src/libs/Cohere/Generated/Cohere.JsonConverters.Source.g.cs index 77e83fad..68b35754 100644 --- a/src/libs/Cohere/Generated/Cohere.JsonConverters.Source.g.cs +++ b/src/libs/Cohere/Generated/Cohere.JsonConverters.Source.g.cs @@ -17,44 +17,44 @@ public class SourceJsonConverter : global::System.Text.Json.Serialization.JsonCo var readerCopy = reader; - global::Cohere.ChatToolSource? chatTool = default; + global::Cohere.ToolSource? tool = default; try { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Cohere.ChatToolSource), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Cohere.ChatToolSource).Name}"); - chatTool = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, typeInfo); + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Cohere.ToolSource), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Cohere.ToolSource).Name}"); + tool = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, typeInfo); } catch (global::System.Text.Json.JsonException) { } readerCopy = reader; - global::Cohere.ChatDocumentSource? chatDocument = default; + global::Cohere.DocumentSource? document = default; try { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Cohere.ChatDocumentSource), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Cohere.ChatDocumentSource).Name}"); - chatDocument = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, typeInfo); + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Cohere.DocumentSource), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Cohere.DocumentSource).Name}"); + document = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, typeInfo); } catch (global::System.Text.Json.JsonException) { } var result = new global::Cohere.Source( - chatTool, - chatDocument + tool, + document ); - if (chatTool != null) + if (tool != null) { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Cohere.ChatToolSource), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Cohere.ChatToolSource).Name}"); + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Cohere.ToolSource), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Cohere.ToolSource).Name}"); _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); } - else if (chatDocument != null) + else if (document != null) { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Cohere.ChatDocumentSource), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Cohere.ChatDocumentSource).Name}"); + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Cohere.DocumentSource), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Cohere.DocumentSource).Name}"); _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); } @@ -70,17 +70,17 @@ public override void Write( options = options ?? throw new global::System.ArgumentNullException(nameof(options)); var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); - if (value.IsChatTool) + if (value.IsTool) { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Cohere.ChatToolSource), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Cohere.ChatToolSource).Name}"); - global::System.Text.Json.JsonSerializer.Serialize(writer, value.ChatTool, typeInfo); + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Cohere.ToolSource), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Cohere.ToolSource).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.Tool, typeInfo); } - else if (value.IsChatDocument) + else if (value.IsDocument) { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Cohere.ChatDocumentSource), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Cohere.ChatDocumentSource).Name}"); - global::System.Text.Json.JsonSerializer.Serialize(writer, value.ChatDocument, typeInfo); + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Cohere.DocumentSource), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Cohere.DocumentSource).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.Document, typeInfo); } } } diff --git a/src/libs/Cohere/Generated/Cohere.JsonConverters.SystemMessageV2ContentVariant2ItemDiscriminatorType.g.cs b/src/libs/Cohere/Generated/Cohere.JsonConverters.SystemMessageContentVariant2ItemDiscriminatorType.g.cs similarity index 64% rename from src/libs/Cohere/Generated/Cohere.JsonConverters.SystemMessageV2ContentVariant2ItemDiscriminatorType.g.cs rename to src/libs/Cohere/Generated/Cohere.JsonConverters.SystemMessageContentVariant2ItemDiscriminatorType.g.cs index c3591cec..1c6c13da 100644 --- a/src/libs/Cohere/Generated/Cohere.JsonConverters.SystemMessageV2ContentVariant2ItemDiscriminatorType.g.cs +++ b/src/libs/Cohere/Generated/Cohere.JsonConverters.SystemMessageContentVariant2ItemDiscriminatorType.g.cs @@ -3,10 +3,10 @@ namespace Cohere.JsonConverters { /// - public sealed class SystemMessageV2ContentVariant2ItemDiscriminatorTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class SystemMessageContentVariant2ItemDiscriminatorTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::Cohere.SystemMessageV2ContentVariant2ItemDiscriminatorType Read( + public override global::Cohere.SystemMessageContentVariant2ItemDiscriminatorType Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class SystemMessageV2ContentVariant2ItemDiscriminatorTypeJsonConve var stringValue = reader.GetString(); if (stringValue != null) { - return global::Cohere.SystemMessageV2ContentVariant2ItemDiscriminatorTypeExtensions.ToEnum(stringValue) ?? default; + return global::Cohere.SystemMessageContentVariant2ItemDiscriminatorTypeExtensions.ToEnum(stringValue) ?? default; } break; @@ -26,11 +26,11 @@ public sealed class SystemMessageV2ContentVariant2ItemDiscriminatorTypeJsonConve case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::Cohere.SystemMessageV2ContentVariant2ItemDiscriminatorType)numValue; + return (global::Cohere.SystemMessageContentVariant2ItemDiscriminatorType)numValue; } case global::System.Text.Json.JsonTokenType.Null: { - return default(global::Cohere.SystemMessageV2ContentVariant2ItemDiscriminatorType); + return default(global::Cohere.SystemMessageContentVariant2ItemDiscriminatorType); } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -42,12 +42,12 @@ public sealed class SystemMessageV2ContentVariant2ItemDiscriminatorTypeJsonConve /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::Cohere.SystemMessageV2ContentVariant2ItemDiscriminatorType value, + global::Cohere.SystemMessageContentVariant2ItemDiscriminatorType value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - writer.WriteStringValue(global::Cohere.SystemMessageV2ContentVariant2ItemDiscriminatorTypeExtensions.ToValueString(value)); + writer.WriteStringValue(global::Cohere.SystemMessageContentVariant2ItemDiscriminatorTypeExtensions.ToValueString(value)); } } } diff --git a/src/libs/Cohere/Generated/Cohere.JsonConverters.SystemMessageV2ContentVariant2ItemDiscriminatorTypeNullable.g.cs b/src/libs/Cohere/Generated/Cohere.JsonConverters.SystemMessageContentVariant2ItemDiscriminatorTypeNullable.g.cs similarity index 65% rename from src/libs/Cohere/Generated/Cohere.JsonConverters.SystemMessageV2ContentVariant2ItemDiscriminatorTypeNullable.g.cs rename to src/libs/Cohere/Generated/Cohere.JsonConverters.SystemMessageContentVariant2ItemDiscriminatorTypeNullable.g.cs index 755f5c3f..9e1ab35c 100644 --- a/src/libs/Cohere/Generated/Cohere.JsonConverters.SystemMessageV2ContentVariant2ItemDiscriminatorTypeNullable.g.cs +++ b/src/libs/Cohere/Generated/Cohere.JsonConverters.SystemMessageContentVariant2ItemDiscriminatorTypeNullable.g.cs @@ -3,10 +3,10 @@ namespace Cohere.JsonConverters { /// - public sealed class SystemMessageV2ContentVariant2ItemDiscriminatorTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class SystemMessageContentVariant2ItemDiscriminatorTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::Cohere.SystemMessageV2ContentVariant2ItemDiscriminatorType? Read( + public override global::Cohere.SystemMessageContentVariant2ItemDiscriminatorType? Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class SystemMessageV2ContentVariant2ItemDiscriminatorTypeNullableJ var stringValue = reader.GetString(); if (stringValue != null) { - return global::Cohere.SystemMessageV2ContentVariant2ItemDiscriminatorTypeExtensions.ToEnum(stringValue); + return global::Cohere.SystemMessageContentVariant2ItemDiscriminatorTypeExtensions.ToEnum(stringValue); } break; @@ -26,11 +26,11 @@ public sealed class SystemMessageV2ContentVariant2ItemDiscriminatorTypeNullableJ case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::Cohere.SystemMessageV2ContentVariant2ItemDiscriminatorType)numValue; + return (global::Cohere.SystemMessageContentVariant2ItemDiscriminatorType)numValue; } case global::System.Text.Json.JsonTokenType.Null: { - return default(global::Cohere.SystemMessageV2ContentVariant2ItemDiscriminatorType?); + return default(global::Cohere.SystemMessageContentVariant2ItemDiscriminatorType?); } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -42,7 +42,7 @@ public sealed class SystemMessageV2ContentVariant2ItemDiscriminatorTypeNullableJ /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::Cohere.SystemMessageV2ContentVariant2ItemDiscriminatorType? value, + global::Cohere.SystemMessageContentVariant2ItemDiscriminatorType? value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); @@ -53,7 +53,7 @@ public override void Write( } else { - writer.WriteStringValue(global::Cohere.SystemMessageV2ContentVariant2ItemDiscriminatorTypeExtensions.ToValueString(value.Value)); + writer.WriteStringValue(global::Cohere.SystemMessageContentVariant2ItemDiscriminatorTypeExtensions.ToValueString(value.Value)); } } } diff --git a/src/libs/Cohere/Generated/Cohere.JsonConverters.UserMessageV2Role.g.cs b/src/libs/Cohere/Generated/Cohere.JsonConverters.SystemMessageRole.g.cs similarity index 74% rename from src/libs/Cohere/Generated/Cohere.JsonConverters.UserMessageV2Role.g.cs rename to src/libs/Cohere/Generated/Cohere.JsonConverters.SystemMessageRole.g.cs index fa770e30..80e96afd 100644 --- a/src/libs/Cohere/Generated/Cohere.JsonConverters.UserMessageV2Role.g.cs +++ b/src/libs/Cohere/Generated/Cohere.JsonConverters.SystemMessageRole.g.cs @@ -3,10 +3,10 @@ namespace Cohere.JsonConverters { /// - public sealed class UserMessageV2RoleJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class SystemMessageRoleJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::Cohere.UserMessageV2Role Read( + public override global::Cohere.SystemMessageRole Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class UserMessageV2RoleJsonConverter : global::System.Text.Json.Se var stringValue = reader.GetString(); if (stringValue != null) { - return global::Cohere.UserMessageV2RoleExtensions.ToEnum(stringValue) ?? default; + return global::Cohere.SystemMessageRoleExtensions.ToEnum(stringValue) ?? default; } break; @@ -26,11 +26,11 @@ public sealed class UserMessageV2RoleJsonConverter : global::System.Text.Json.Se case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::Cohere.UserMessageV2Role)numValue; + return (global::Cohere.SystemMessageRole)numValue; } case global::System.Text.Json.JsonTokenType.Null: { - return default(global::Cohere.UserMessageV2Role); + return default(global::Cohere.SystemMessageRole); } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -42,12 +42,12 @@ public sealed class UserMessageV2RoleJsonConverter : global::System.Text.Json.Se /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::Cohere.UserMessageV2Role value, + global::Cohere.SystemMessageRole value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - writer.WriteStringValue(global::Cohere.UserMessageV2RoleExtensions.ToValueString(value)); + writer.WriteStringValue(global::Cohere.SystemMessageRoleExtensions.ToValueString(value)); } } } diff --git a/src/libs/Cohere/Generated/Cohere.JsonConverters.UserMessageV2RoleNullable.g.cs b/src/libs/Cohere/Generated/Cohere.JsonConverters.SystemMessageRoleNullable.g.cs similarity index 76% rename from src/libs/Cohere/Generated/Cohere.JsonConverters.UserMessageV2RoleNullable.g.cs rename to src/libs/Cohere/Generated/Cohere.JsonConverters.SystemMessageRoleNullable.g.cs index c293cb43..886edde4 100644 --- a/src/libs/Cohere/Generated/Cohere.JsonConverters.UserMessageV2RoleNullable.g.cs +++ b/src/libs/Cohere/Generated/Cohere.JsonConverters.SystemMessageRoleNullable.g.cs @@ -3,10 +3,10 @@ namespace Cohere.JsonConverters { /// - public sealed class UserMessageV2RoleNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class SystemMessageRoleNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::Cohere.UserMessageV2Role? Read( + public override global::Cohere.SystemMessageRole? Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class UserMessageV2RoleNullableJsonConverter : global::System.Text var stringValue = reader.GetString(); if (stringValue != null) { - return global::Cohere.UserMessageV2RoleExtensions.ToEnum(stringValue); + return global::Cohere.SystemMessageRoleExtensions.ToEnum(stringValue); } break; @@ -26,11 +26,11 @@ public sealed class UserMessageV2RoleNullableJsonConverter : global::System.Text case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::Cohere.UserMessageV2Role)numValue; + return (global::Cohere.SystemMessageRole)numValue; } case global::System.Text.Json.JsonTokenType.Null: { - return default(global::Cohere.UserMessageV2Role?); + return default(global::Cohere.SystemMessageRole?); } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -42,7 +42,7 @@ public sealed class UserMessageV2RoleNullableJsonConverter : global::System.Text /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::Cohere.UserMessageV2Role? value, + global::Cohere.SystemMessageRole? value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); @@ -53,7 +53,7 @@ public override void Write( } else { - writer.WriteStringValue(global::Cohere.UserMessageV2RoleExtensions.ToValueString(value.Value)); + writer.WriteStringValue(global::Cohere.SystemMessageRoleExtensions.ToValueString(value.Value)); } } } diff --git a/src/libs/Cohere/Generated/Cohere.JsonConverters.ChatTextContentType.g.cs b/src/libs/Cohere/Generated/Cohere.JsonConverters.TextContentType.g.cs similarity index 69% rename from src/libs/Cohere/Generated/Cohere.JsonConverters.ChatTextContentType.g.cs rename to src/libs/Cohere/Generated/Cohere.JsonConverters.TextContentType.g.cs index 5bb4a137..6000fb51 100644 --- a/src/libs/Cohere/Generated/Cohere.JsonConverters.ChatTextContentType.g.cs +++ b/src/libs/Cohere/Generated/Cohere.JsonConverters.TextContentType.g.cs @@ -3,10 +3,10 @@ namespace Cohere.JsonConverters { /// - public sealed class ChatTextContentTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class TextContentTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::Cohere.ChatTextContentType Read( + public override global::Cohere.TextContentType Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class ChatTextContentTypeJsonConverter : global::System.Text.Json. var stringValue = reader.GetString(); if (stringValue != null) { - return global::Cohere.ChatTextContentTypeExtensions.ToEnum(stringValue) ?? default; + return global::Cohere.TextContentTypeExtensions.ToEnum(stringValue) ?? default; } break; @@ -26,11 +26,11 @@ public sealed class ChatTextContentTypeJsonConverter : global::System.Text.Json. case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::Cohere.ChatTextContentType)numValue; + return (global::Cohere.TextContentType)numValue; } case global::System.Text.Json.JsonTokenType.Null: { - return default(global::Cohere.ChatTextContentType); + return default(global::Cohere.TextContentType); } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -42,12 +42,12 @@ public sealed class ChatTextContentTypeJsonConverter : global::System.Text.Json. /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::Cohere.ChatTextContentType value, + global::Cohere.TextContentType value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - writer.WriteStringValue(global::Cohere.ChatTextContentTypeExtensions.ToValueString(value)); + writer.WriteStringValue(global::Cohere.TextContentTypeExtensions.ToValueString(value)); } } } diff --git a/src/libs/Cohere/Generated/Cohere.JsonConverters.SystemMessageV2RoleNullable.g.cs b/src/libs/Cohere/Generated/Cohere.JsonConverters.TextContentTypeNullable.g.cs similarity index 70% rename from src/libs/Cohere/Generated/Cohere.JsonConverters.SystemMessageV2RoleNullable.g.cs rename to src/libs/Cohere/Generated/Cohere.JsonConverters.TextContentTypeNullable.g.cs index fc86433f..65f29d09 100644 --- a/src/libs/Cohere/Generated/Cohere.JsonConverters.SystemMessageV2RoleNullable.g.cs +++ b/src/libs/Cohere/Generated/Cohere.JsonConverters.TextContentTypeNullable.g.cs @@ -3,10 +3,10 @@ namespace Cohere.JsonConverters { /// - public sealed class SystemMessageV2RoleNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class TextContentTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::Cohere.SystemMessageV2Role? Read( + public override global::Cohere.TextContentType? Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class SystemMessageV2RoleNullableJsonConverter : global::System.Te var stringValue = reader.GetString(); if (stringValue != null) { - return global::Cohere.SystemMessageV2RoleExtensions.ToEnum(stringValue); + return global::Cohere.TextContentTypeExtensions.ToEnum(stringValue); } break; @@ -26,11 +26,11 @@ public sealed class SystemMessageV2RoleNullableJsonConverter : global::System.Te case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::Cohere.SystemMessageV2Role)numValue; + return (global::Cohere.TextContentType)numValue; } case global::System.Text.Json.JsonTokenType.Null: { - return default(global::Cohere.SystemMessageV2Role?); + return default(global::Cohere.TextContentType?); } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -42,7 +42,7 @@ public sealed class SystemMessageV2RoleNullableJsonConverter : global::System.Te /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::Cohere.SystemMessageV2Role? value, + global::Cohere.TextContentType? value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); @@ -53,7 +53,7 @@ public override void Write( } else { - writer.WriteStringValue(global::Cohere.SystemMessageV2RoleExtensions.ToValueString(value.Value)); + writer.WriteStringValue(global::Cohere.TextContentTypeExtensions.ToValueString(value.Value)); } } } diff --git a/src/libs/Cohere/Generated/Cohere.JsonConverters.ToolContent.g.cs b/src/libs/Cohere/Generated/Cohere.JsonConverters.ToolContent.g.cs index 1ea81caa..f29a8063 100644 --- a/src/libs/Cohere/Generated/Cohere.JsonConverters.ToolContent.g.cs +++ b/src/libs/Cohere/Generated/Cohere.JsonConverters.ToolContent.g.cs @@ -21,11 +21,11 @@ public class ToolContentJsonConverter : global::System.Text.Json.Serialization.J throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Cohere.ToolContentDiscriminator)}"); var discriminator = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, discriminatorTypeInfo); - global::Cohere.ChatTextContent? text = default; + global::Cohere.TextContent? text = default; if (discriminator?.Type == global::Cohere.ToolContentDiscriminatorType.Text) { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Cohere.ChatTextContent), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Cohere.ChatTextContent)}"); + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Cohere.TextContent), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Cohere.TextContent)}"); text = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); } global::Cohere.DocumentContent? document = default; @@ -56,8 +56,8 @@ public override void Write( if (value.IsText) { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Cohere.ChatTextContent), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Cohere.ChatTextContent).Name}"); + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Cohere.TextContent), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Cohere.TextContent).Name}"); global::System.Text.Json.JsonSerializer.Serialize(writer, value.Text, typeInfo); } else if (value.IsDocument) diff --git a/src/libs/Cohere/Generated/Cohere.JsonConverters.SystemMessageV2Role.g.cs b/src/libs/Cohere/Generated/Cohere.JsonConverters.UserMessageRole.g.cs similarity index 69% rename from src/libs/Cohere/Generated/Cohere.JsonConverters.SystemMessageV2Role.g.cs rename to src/libs/Cohere/Generated/Cohere.JsonConverters.UserMessageRole.g.cs index 25e390e5..a5db2fbe 100644 --- a/src/libs/Cohere/Generated/Cohere.JsonConverters.SystemMessageV2Role.g.cs +++ b/src/libs/Cohere/Generated/Cohere.JsonConverters.UserMessageRole.g.cs @@ -3,10 +3,10 @@ namespace Cohere.JsonConverters { /// - public sealed class SystemMessageV2RoleJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class UserMessageRoleJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::Cohere.SystemMessageV2Role Read( + public override global::Cohere.UserMessageRole Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class SystemMessageV2RoleJsonConverter : global::System.Text.Json. var stringValue = reader.GetString(); if (stringValue != null) { - return global::Cohere.SystemMessageV2RoleExtensions.ToEnum(stringValue) ?? default; + return global::Cohere.UserMessageRoleExtensions.ToEnum(stringValue) ?? default; } break; @@ -26,11 +26,11 @@ public sealed class SystemMessageV2RoleJsonConverter : global::System.Text.Json. case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::Cohere.SystemMessageV2Role)numValue; + return (global::Cohere.UserMessageRole)numValue; } case global::System.Text.Json.JsonTokenType.Null: { - return default(global::Cohere.SystemMessageV2Role); + return default(global::Cohere.UserMessageRole); } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -42,12 +42,12 @@ public sealed class SystemMessageV2RoleJsonConverter : global::System.Text.Json. /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::Cohere.SystemMessageV2Role value, + global::Cohere.UserMessageRole value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - writer.WriteStringValue(global::Cohere.SystemMessageV2RoleExtensions.ToValueString(value)); + writer.WriteStringValue(global::Cohere.UserMessageRoleExtensions.ToValueString(value)); } } } diff --git a/src/libs/Cohere/Generated/Cohere.JsonConverters.ChatTextContentTypeNullable.g.cs b/src/libs/Cohere/Generated/Cohere.JsonConverters.UserMessageRoleNullable.g.cs similarity index 70% rename from src/libs/Cohere/Generated/Cohere.JsonConverters.ChatTextContentTypeNullable.g.cs rename to src/libs/Cohere/Generated/Cohere.JsonConverters.UserMessageRoleNullable.g.cs index b57d11d1..f6a6adeb 100644 --- a/src/libs/Cohere/Generated/Cohere.JsonConverters.ChatTextContentTypeNullable.g.cs +++ b/src/libs/Cohere/Generated/Cohere.JsonConverters.UserMessageRoleNullable.g.cs @@ -3,10 +3,10 @@ namespace Cohere.JsonConverters { /// - public sealed class ChatTextContentTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class UserMessageRoleNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::Cohere.ChatTextContentType? Read( + public override global::Cohere.UserMessageRole? Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class ChatTextContentTypeNullableJsonConverter : global::System.Te var stringValue = reader.GetString(); if (stringValue != null) { - return global::Cohere.ChatTextContentTypeExtensions.ToEnum(stringValue); + return global::Cohere.UserMessageRoleExtensions.ToEnum(stringValue); } break; @@ -26,11 +26,11 @@ public sealed class ChatTextContentTypeNullableJsonConverter : global::System.Te case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::Cohere.ChatTextContentType)numValue; + return (global::Cohere.UserMessageRole)numValue; } case global::System.Text.Json.JsonTokenType.Null: { - return default(global::Cohere.ChatTextContentType?); + return default(global::Cohere.UserMessageRole?); } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -42,7 +42,7 @@ public sealed class ChatTextContentTypeNullableJsonConverter : global::System.Te /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::Cohere.ChatTextContentType? value, + global::Cohere.UserMessageRole? value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); @@ -53,7 +53,7 @@ public override void Write( } else { - writer.WriteStringValue(global::Cohere.ChatTextContentTypeExtensions.ToValueString(value.Value)); + writer.WriteStringValue(global::Cohere.UserMessageRoleExtensions.ToValueString(value.Value)); } } } diff --git a/src/libs/Cohere/Generated/Cohere.JsonSerializerContextTypes.g.cs b/src/libs/Cohere/Generated/Cohere.JsonSerializerContextTypes.g.cs index 113be3fa..97dec1d9 100644 --- a/src/libs/Cohere/Generated/Cohere.JsonSerializerContextTypes.g.cs +++ b/src/libs/Cohere/Generated/Cohere.JsonSerializerContextTypes.g.cs @@ -82,7 +82,7 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::Cohere.ChatToolSource? Type14 { get; set; } + public global::Cohere.ToolSource? Type14 { get; set; } /// /// /// @@ -90,7 +90,7 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::Cohere.ChatDocumentSource? Type16 { get; set; } + public global::Cohere.DocumentSource? Type16 { get; set; } /// /// /// @@ -110,11 +110,11 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::Cohere.ChatTextContent? Type21 { get; set; } + public global::Cohere.TextContent? Type21 { get; set; } /// /// /// - public global::Cohere.ChatTextContentType? Type22 { get; set; } + public global::Cohere.TextContentType? Type22 { get; set; } /// /// /// @@ -378,19 +378,19 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::Cohere.UserMessageV2? Type88 { get; set; } + public global::Cohere.UserMessage? Type88 { get; set; } /// /// /// - public global::Cohere.OneOf>? Type89 { get; set; } + public global::Cohere.OneOf>? Type89 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type90 { get; set; } + public global::System.Collections.Generic.IList? Type90 { get; set; } /// /// /// - public global::Cohere.MessageContent? Type91 { get; set; } + public global::Cohere.Content2? Type91 { get; set; } /// /// /// @@ -410,19 +410,19 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::Cohere.MessageContentDiscriminator? Type96 { get; set; } + public global::Cohere.ContentDiscriminator? Type96 { get; set; } /// /// /// - public global::Cohere.MessageContentDiscriminatorType? Type97 { get; set; } + public global::Cohere.ContentDiscriminatorType? Type97 { get; set; } /// /// /// - public global::Cohere.UserMessageV2Role? Type98 { get; set; } + public global::Cohere.UserMessageRole? Type98 { get; set; } /// /// /// - public global::Cohere.SystemMessageV2? Type99 { get; set; } + public global::Cohere.SystemMessage? Type99 { get; set; } /// /// /// @@ -438,15 +438,15 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::Cohere.SystemMessageV2ContentVariant2ItemDiscriminator? Type103 { get; set; } + public global::Cohere.SystemMessageContentVariant2ItemDiscriminator? Type103 { get; set; } /// /// /// - public global::Cohere.SystemMessageV2ContentVariant2ItemDiscriminatorType? Type104 { get; set; } + public global::Cohere.SystemMessageContentVariant2ItemDiscriminatorType? Type104 { get; set; } /// /// /// - public global::Cohere.SystemMessageV2Role? Type105 { get; set; } + public global::Cohere.SystemMessageRole? Type105 { get; set; } /// /// /// @@ -578,7 +578,7 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::Cohere.ChatToolMessage? Type138 { get; set; } + public global::Cohere.ToolMessage? Type138 { get; set; } /// /// /// @@ -622,611 +622,611 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::Cohere.ChatTextResponseFormat? Type149 { get; set; } + public global::Cohere.ChatToolCallDeltaEvent? Type149 { get; set; } /// /// /// - public global::Cohere.ResponseFormatType? Type150 { get; set; } + public global::Cohere.ChatToolCallDeltaEventVariant2? Type150 { get; set; } /// /// /// - public global::Cohere.ChatTextResponseFormatV2? Type151 { get; set; } + public global::Cohere.ChatToolCallDeltaEventVariant2Delta? Type151 { get; set; } /// /// /// - public global::Cohere.ResponseFormatTypeV2? Type152 { get; set; } + public global::Cohere.ChatToolCallDeltaEventVariant2DeltaMessage? Type152 { get; set; } /// /// /// - public global::Cohere.ChatToolCallDeltaEvent? Type153 { get; set; } + public global::Cohere.ChatToolCallDeltaEventVariant2DeltaMessageToolCalls? Type153 { get; set; } /// /// /// - public global::Cohere.ChatToolCallDeltaEventVariant2? Type154 { get; set; } + public global::Cohere.ChatToolCallDeltaEventVariant2DeltaMessageToolCallsFunction? Type154 { get; set; } /// /// /// - public global::Cohere.ChatToolCallDeltaEventVariant2Delta? Type155 { get; set; } + public global::Cohere.ChatToolCallEndEvent? Type155 { get; set; } /// /// /// - public global::Cohere.ChatToolCallDeltaEventVariant2DeltaMessage? Type156 { get; set; } + public global::Cohere.ChatToolCallEndEventVariant2? Type156 { get; set; } /// /// /// - public global::Cohere.ChatToolCallDeltaEventVariant2DeltaMessageToolCalls? Type157 { get; set; } + public global::Cohere.ChatToolCallStartEvent? Type157 { get; set; } /// /// /// - public global::Cohere.ChatToolCallDeltaEventVariant2DeltaMessageToolCallsFunction? Type158 { get; set; } + public global::Cohere.ChatToolCallStartEventVariant2? Type158 { get; set; } /// /// /// - public global::Cohere.ChatToolCallEndEvent? Type159 { get; set; } + public global::Cohere.ChatToolCallStartEventVariant2Delta? Type159 { get; set; } /// /// /// - public global::Cohere.ChatToolCallEndEventVariant2? Type160 { get; set; } + public global::Cohere.ChatToolCallStartEventVariant2DeltaMessage? Type160 { get; set; } /// /// /// - public global::Cohere.ChatToolCallStartEvent? Type161 { get; set; } + public global::Cohere.ChatToolCallsChunkEvent? Type161 { get; set; } /// /// /// - public global::Cohere.ChatToolCallStartEventVariant2? Type162 { get; set; } + public global::Cohere.ChatToolCallsChunkEventVariant2? Type162 { get; set; } /// /// /// - public global::Cohere.ChatToolCallStartEventVariant2Delta? Type163 { get; set; } + public global::Cohere.ToolCallDelta? Type163 { get; set; } /// /// /// - public global::Cohere.ChatToolCallStartEventVariant2DeltaMessage? Type164 { get; set; } + public global::Cohere.ChatToolCallsGenerationEvent? Type164 { get; set; } /// /// /// - public global::Cohere.ChatToolCallsChunkEvent? Type165 { get; set; } + public global::Cohere.ChatToolCallsGenerationEventVariant2? Type165 { get; set; } /// /// /// - public global::Cohere.ChatToolCallsChunkEventVariant2? Type166 { get; set; } + public global::Cohere.ChatToolPlanDeltaEvent? Type166 { get; set; } /// /// /// - public global::Cohere.ToolCallDelta? Type167 { get; set; } + public global::Cohere.ChatToolPlanDeltaEventVariant2? Type167 { get; set; } /// /// /// - public global::Cohere.ChatToolCallsGenerationEvent? Type168 { get; set; } + public global::Cohere.ChatToolPlanDeltaEventVariant2Delta? Type168 { get; set; } /// /// /// - public global::Cohere.ChatToolCallsGenerationEventVariant2? Type169 { get; set; } + public global::Cohere.ChatToolPlanDeltaEventVariant2DeltaMessage? Type169 { get; set; } /// /// /// - public global::Cohere.ChatToolPlanDeltaEvent? Type170 { get; set; } + public global::Cohere.CitationEndEvent? Type170 { get; set; } /// /// /// - public global::Cohere.ChatToolPlanDeltaEventVariant2? Type171 { get; set; } + public global::Cohere.CitationEndEventVariant2? Type171 { get; set; } /// /// /// - public global::Cohere.ChatToolPlanDeltaEventVariant2Delta? Type172 { get; set; } + public global::Cohere.CitationOptions? Type172 { get; set; } /// /// /// - public global::Cohere.ChatToolPlanDeltaEventVariant2DeltaMessage? Type173 { get; set; } + public global::Cohere.CitationOptionsMode? Type173 { get; set; } /// /// /// - public global::Cohere.CitationEndEvent? Type174 { get; set; } + public global::Cohere.CitationStartEvent? Type174 { get; set; } /// /// /// - public global::Cohere.CitationEndEventVariant2? Type175 { get; set; } + public global::Cohere.CitationStartEventVariant2? Type175 { get; set; } /// /// /// - public global::Cohere.CitationOptions? Type176 { get; set; } + public global::Cohere.CitationStartEventVariant2Delta? Type176 { get; set; } /// /// /// - public global::Cohere.CitationOptionsMode? Type177 { get; set; } + public global::Cohere.CitationStartEventVariant2DeltaMessage? Type177 { get; set; } /// /// /// - public global::Cohere.CitationStartEvent? Type178 { get; set; } + public global::Cohere.ClassifyDataMetrics? Type178 { get; set; } /// /// /// - public global::Cohere.CitationStartEventVariant2? Type179 { get; set; } + public global::System.Collections.Generic.IList? Type179 { get; set; } /// /// /// - public global::Cohere.CitationStartEventVariant2Delta? Type180 { get; set; } + public global::Cohere.LabelMetric? Type180 { get; set; } /// /// /// - public global::Cohere.CitationStartEventVariant2DeltaMessage? Type181 { get; set; } + public global::Cohere.ClassifyExample? Type181 { get; set; } /// /// /// - public global::Cohere.ClassifyDataMetrics? Type182 { get; set; } + public global::Cohere.Cluster? Type182 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type183 { get; set; } + public global::Cohere.CompatibleEndpoint? Type183 { get; set; } /// /// /// - public global::Cohere.LabelMetric? Type184 { get; set; } + public global::Cohere.Connector? Type184 { get; set; } /// /// /// - public global::Cohere.ClassifyExample? Type185 { get; set; } + public global::Cohere.ConnectorAuthStatus? Type185 { get; set; } /// /// /// - public global::Cohere.Cluster? Type186 { get; set; } + public global::System.DateTime? Type186 { get; set; } /// /// /// - public global::Cohere.CompatibleEndpoint? Type187 { get; set; } + public global::Cohere.ConnectorOAuth? Type187 { get; set; } /// /// /// - public global::Cohere.Connector? Type188 { get; set; } + public global::Cohere.ConnectorLog? Type188 { get; set; } /// /// /// - public global::Cohere.ConnectorAuthStatus? Type189 { get; set; } + public global::Cohere.CreateClusterJobRequest? Type189 { get; set; } /// /// /// - public global::System.DateTime? Type190 { get; set; } + public global::Cohere.CreateClusterJobResponse? Type190 { get; set; } /// /// /// - public global::Cohere.ConnectorOAuth? Type191 { get; set; } + public global::Cohere.CreateConnectorOAuth? Type191 { get; set; } /// /// /// - public global::Cohere.ConnectorLog? Type192 { get; set; } + public global::Cohere.CreateConnectorRequest? Type192 { get; set; } /// /// /// - public global::Cohere.CreateClusterJobRequest? Type193 { get; set; } + public global::Cohere.CreateConnectorServiceAuth? Type193 { get; set; } /// /// /// - public global::Cohere.CreateClusterJobResponse? Type194 { get; set; } + public global::Cohere.CreateConnectorResponse? Type194 { get; set; } /// /// /// - public global::Cohere.CreateConnectorOAuth? Type195 { get; set; } + public global::Cohere.CreateEmbedJobRequest? Type195 { get; set; } /// /// /// - public global::Cohere.CreateConnectorRequest? Type196 { get; set; } + public global::System.Collections.Generic.IList? Type196 { get; set; } /// /// /// - public global::Cohere.CreateConnectorServiceAuth? Type197 { get; set; } + public global::Cohere.EmbeddingType? Type197 { get; set; } /// /// /// - public global::Cohere.CreateConnectorResponse? Type198 { get; set; } + public global::Cohere.EmbedInputType? Type198 { get; set; } /// /// /// - public global::Cohere.CreateEmbedJobRequest? Type199 { get; set; } + public global::Cohere.CreateEmbedJobRequestTruncate? Type199 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type200 { get; set; } + public global::Cohere.CreateEmbedJobResponse? Type200 { get; set; } /// /// /// - public global::Cohere.EmbeddingType? Type201 { get; set; } + public global::Cohere.CreateFinetunedModelResponse? Type201 { get; set; } /// /// /// - public global::Cohere.EmbedInputType? Type202 { get; set; } + public global::Cohere.FinetunedModel? Type202 { get; set; } /// /// /// - public global::Cohere.CreateEmbedJobRequestTruncate? Type203 { get; set; } + public global::Cohere.Settings? Type203 { get; set; } /// /// /// - public global::Cohere.CreateEmbedJobResponse? Type204 { get; set; } + public global::Cohere.Hyperparameters? Type204 { get; set; } /// /// /// - public global::Cohere.CreateFinetunedModelResponse? Type205 { get; set; } + public global::Cohere.LoraTargetModules? Type205 { get; set; } /// /// /// - public global::Cohere.FinetunedModel? Type206 { get; set; } + public global::Cohere.WandbConfig? Type206 { get; set; } /// /// /// - public global::Cohere.Settings? Type207 { get; set; } + public global::Cohere.Status? Type207 { get; set; } /// /// /// - public global::Cohere.Hyperparameters? Type208 { get; set; } + public global::Cohere.Dataset? Type208 { get; set; } /// /// /// - public global::Cohere.LoraTargetModules? Type209 { get; set; } + public global::System.Collections.Generic.IList? Type209 { get; set; } /// /// /// - public global::Cohere.WandbConfig? Type210 { get; set; } + public global::Cohere.DatasetPart? Type210 { get; set; } /// /// /// - public global::Cohere.Status? Type211 { get; set; } + public global::Cohere.DatasetType? Type211 { get; set; } /// /// /// - public global::Cohere.Dataset? Type212 { get; set; } + public global::Cohere.Metrics? Type212 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type213 { get; set; } + public global::Cohere.FinetuneDatasetMetrics? Type213 { get; set; } /// /// /// - public global::Cohere.DatasetPart? Type214 { get; set; } + public global::Cohere.RerankerDataMetrics? Type214 { get; set; } /// /// /// - public global::Cohere.DatasetType? Type215 { get; set; } + public global::Cohere.ParseInfo? Type215 { get; set; } /// /// /// - public global::Cohere.Metrics? Type216 { get; set; } + public global::Cohere.DatasetValidationStatus? Type216 { get; set; } /// /// /// - public global::Cohere.FinetuneDatasetMetrics? Type217 { get; set; } + public global::Cohere.EmbedByTypeResponse? Type217 { get; set; } /// /// /// - public global::Cohere.RerankerDataMetrics? Type218 { get; set; } + public global::Cohere.EmbedByTypeResponseEmbeddings? Type218 { get; set; } /// /// /// - public global::Cohere.ParseInfo? Type219 { get; set; } + public global::System.Collections.Generic.IList? Type219 { get; set; } /// /// /// - public global::Cohere.DatasetValidationStatus? Type220 { get; set; } + public global::System.Collections.Generic.IList>? Type220 { get; set; } /// /// /// - public global::Cohere.EmbedByTypeResponse? Type221 { get; set; } + public global::System.Collections.Generic.IList>? Type221 { get; set; } /// /// /// - public global::Cohere.EmbedByTypeResponseEmbeddings? Type222 { get; set; } + public global::System.Collections.Generic.IList? Type222 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type223 { get; set; } + public global::Cohere.Image? Type223 { get; set; } /// /// /// - public global::System.Collections.Generic.IList>? Type224 { get; set; } + public global::Cohere.EmbedByTypeResponseResponseType? Type224 { get; set; } /// /// /// - public global::System.Collections.Generic.IList>? Type225 { get; set; } + public global::Cohere.EmbedContent? Type225 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type226 { get; set; } + public global::Cohere.EmbedImage? Type226 { get; set; } /// /// /// - public global::Cohere.Image? Type227 { get; set; } + public global::Cohere.EmbedImageUrl? Type227 { get; set; } /// /// /// - public global::Cohere.EmbedByTypeResponseResponseType? Type228 { get; set; } + public global::Cohere.EmbedContentType? Type228 { get; set; } /// /// /// - public global::Cohere.EmbedContent? Type229 { get; set; } + public global::Cohere.EmbedText? Type229 { get; set; } /// /// /// - public global::Cohere.EmbedImage? Type230 { get; set; } + public global::Cohere.EmbedContentDiscriminator? Type230 { get; set; } /// /// /// - public global::Cohere.EmbedImageUrl? Type231 { get; set; } + public global::Cohere.EmbedContentDiscriminatorType? Type231 { get; set; } /// /// /// - public global::Cohere.EmbedContentType? Type232 { get; set; } + public global::Cohere.EmbedFloatsResponse? Type232 { get; set; } /// /// /// - public global::Cohere.EmbedText? Type233 { get; set; } + public global::Cohere.EmbedFloatsResponseResponseType? Type233 { get; set; } /// /// /// - public global::Cohere.EmbedContentDiscriminator? Type234 { get; set; } + public global::Cohere.EmbedInput? Type234 { get; set; } /// /// /// - public global::Cohere.EmbedContentDiscriminatorType? Type235 { get; set; } + public global::System.Collections.Generic.IList? Type235 { get; set; } /// /// /// - public global::Cohere.EmbedFloatsResponse? Type236 { get; set; } + public global::Cohere.EmbedJob? Type236 { get; set; } /// /// /// - public global::Cohere.EmbedFloatsResponseResponseType? Type237 { get; set; } + public global::Cohere.EmbedJobStatus? Type237 { get; set; } /// /// /// - public global::Cohere.EmbedInput? Type238 { get; set; } + public global::Cohere.EmbedJobTruncate? Type238 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type239 { get; set; } + public global::Cohere.Error? Type239 { get; set; } /// /// /// - public global::Cohere.EmbedJob? Type240 { get; set; } + public global::Cohere.Event? Type240 { get; set; } /// /// /// - public global::Cohere.EmbedJobStatus? Type241 { get; set; } + public global::Cohere.GenerateStreamEnd? Type241 { get; set; } /// /// /// - public global::Cohere.EmbedJobTruncate? Type242 { get; set; } + public global::Cohere.GenerateStreamEvent? Type242 { get; set; } /// /// /// - public global::Cohere.Error? Type243 { get; set; } + public global::Cohere.GenerateStreamEventEventType? Type243 { get; set; } /// /// /// - public global::Cohere.Event? Type244 { get; set; } + public global::Cohere.GenerateStreamEndVariant2? Type244 { get; set; } /// /// /// - public global::Cohere.GenerateStreamEnd? Type245 { get; set; } + public global::Cohere.GenerateStreamEndVariant2Response? Type245 { get; set; } /// /// /// - public global::Cohere.GenerateStreamEvent? Type246 { get; set; } + public global::System.Collections.Generic.IList? Type246 { get; set; } /// /// /// - public global::Cohere.GenerateStreamEventEventType? Type247 { get; set; } + public global::Cohere.SingleGenerationInStream? Type247 { get; set; } /// /// /// - public global::Cohere.GenerateStreamEndVariant2? Type248 { get; set; } + public global::Cohere.GenerateStreamError? Type248 { get; set; } /// /// /// - public global::Cohere.GenerateStreamEndVariant2Response? Type249 { get; set; } + public global::Cohere.GenerateStreamErrorVariant2? Type249 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type250 { get; set; } + public global::Cohere.GenerateStreamText? Type250 { get; set; } /// /// /// - public global::Cohere.SingleGenerationInStream? Type251 { get; set; } + public global::Cohere.GenerateStreamTextVariant2? Type251 { get; set; } /// /// /// - public global::Cohere.GenerateStreamError? Type252 { get; set; } + public global::Cohere.GenerateStreamedResponse? Type252 { get; set; } /// /// /// - public global::Cohere.GenerateStreamErrorVariant2? Type253 { get; set; } + public global::Cohere.GenerateStreamedResponseDiscriminator? Type253 { get; set; } /// /// /// - public global::Cohere.GenerateStreamText? Type254 { get; set; } + public global::Cohere.GenerateStreamedResponseDiscriminatorEventType? Type254 { get; set; } /// /// /// - public global::Cohere.GenerateStreamTextVariant2? Type255 { get; set; } + public global::Cohere.Generation? Type255 { get; set; } /// /// /// - public global::Cohere.GenerateStreamedResponse? Type256 { get; set; } + public global::System.Collections.Generic.IList? Type256 { get; set; } /// /// /// - public global::Cohere.GenerateStreamedResponseDiscriminator? Type257 { get; set; } + public global::Cohere.SingleGeneration? Type257 { get; set; } /// /// /// - public global::Cohere.GenerateStreamedResponseDiscriminatorEventType? Type258 { get; set; } + public global::System.Collections.Generic.IList? Type258 { get; set; } /// /// /// - public global::Cohere.Generation? Type259 { get; set; } + public global::Cohere.SingleGenerationTokenLikelihood? Type259 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type260 { get; set; } + public global::Cohere.GetClusterJobResponse? Type260 { get; set; } /// /// /// - public global::Cohere.SingleGeneration? Type261 { get; set; } + public global::System.Collections.Generic.IList? Type261 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type262 { get; set; } + public global::Cohere.GetClusterJobResponseStatus? Type262 { get; set; } /// /// /// - public global::Cohere.SingleGenerationTokenLikelihood? Type263 { get; set; } + public global::Cohere.GetConnectorResponse? Type263 { get; set; } /// /// /// - public global::Cohere.GetClusterJobResponse? Type264 { get; set; } + public global::Cohere.GetConnectorsLogsResponse? Type264 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type265 { get; set; } + public global::System.Collections.Generic.IList? Type265 { get; set; } /// /// /// - public global::Cohere.GetClusterJobResponseStatus? Type266 { get; set; } + public global::Cohere.GetFinetunedModelResponse? Type266 { get; set; } /// /// /// - public global::Cohere.GetConnectorResponse? Type267 { get; set; } + public global::Cohere.GetModelResponse? Type267 { get; set; } /// /// /// - public global::Cohere.GetConnectorsLogsResponse? Type268 { get; set; } + public global::System.Collections.Generic.IList? Type268 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type269 { get; set; } + public global::Cohere.JSONResponseFormat? Type269 { get; set; } /// /// /// - public global::Cohere.GetFinetunedModelResponse? Type270 { get; set; } + public global::Cohere.ResponseFormatType? Type270 { get; set; } /// /// /// - public global::Cohere.GetModelResponse? Type271 { get; set; } + public global::Cohere.JsonResponseFormatV2? Type271 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type272 { get; set; } + public global::Cohere.ResponseFormatTypeV2? Type272 { get; set; } /// /// /// - public global::Cohere.JSONResponseFormat? Type273 { get; set; } + public global::Cohere.ListClusterJobsResponse? Type273 { get; set; } /// /// /// - public global::Cohere.JsonResponseFormatV2? Type274 { get; set; } + public global::System.Collections.Generic.IList? Type274 { get; set; } /// /// /// - public global::Cohere.ListClusterJobsResponse? Type275 { get; set; } + public global::Cohere.ListConnectorsResponse? Type275 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type276 { get; set; } + public global::System.Collections.Generic.IList? Type276 { get; set; } /// /// /// - public global::Cohere.ListConnectorsResponse? Type277 { get; set; } + public global::Cohere.ListEmbedJobResponse? Type277 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type278 { get; set; } + public global::System.Collections.Generic.IList? Type278 { get; set; } /// /// /// - public global::Cohere.ListEmbedJobResponse? Type279 { get; set; } + public global::Cohere.ListEventsResponse? Type279 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type280 { get; set; } + public global::System.Collections.Generic.IList? Type280 { get; set; } /// /// /// - public global::Cohere.ListEventsResponse? Type281 { get; set; } + public global::Cohere.ListFinetunedModelsResponse? Type281 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type282 { get; set; } + public global::System.Collections.Generic.IList? Type282 { get; set; } /// /// /// - public global::Cohere.ListFinetunedModelsResponse? Type283 { get; set; } + public global::Cohere.ListModelsResponse? Type283 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type284 { get; set; } + public global::System.Collections.Generic.IList? Type284 { get; set; } /// /// /// - public global::Cohere.ListModelsResponse? Type285 { get; set; } + public global::Cohere.ListTrainingStepMetricsResponse? Type285 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type286 { get; set; } + public global::System.Collections.Generic.IList? Type286 { get; set; } /// /// /// - public global::Cohere.ListTrainingStepMetricsResponse? Type287 { get; set; } + public global::Cohere.TrainingStepMetrics? Type287 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type288 { get; set; } + public global::System.Collections.Generic.Dictionary? Type288 { get; set; } /// /// /// - public global::Cohere.TrainingStepMetrics? Type289 { get; set; } + public global::Cohere.LogLikelihoodResponse? Type289 { get; set; } /// /// /// - public global::System.Collections.Generic.Dictionary? Type290 { get; set; } + public global::System.Collections.Generic.IList? Type290 { get; set; } /// /// /// - public global::Cohere.LogLikelihoodResponse? Type291 { get; set; } + public global::Cohere.TokenLikelihood? Type291 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type292 { get; set; } + public global::Cohere.OAuthAuthorizeResponse? Type292 { get; set; } /// /// /// - public global::Cohere.TokenLikelihood? Type293 { get; set; } + public global::Cohere.ReasoningEffort? Type293 { get; set; } /// /// /// - public global::Cohere.OAuthAuthorizeResponse? Type294 { get; set; } + public global::Cohere.RerankDocument? Type294 { get; set; } /// /// /// - public global::Cohere.ReasoningEffort? Type295 { get; set; } + public global::Cohere.ResponseFormat? Type295 { get; set; } /// /// /// - public global::Cohere.RerankDocument? Type296 { get; set; } + public global::Cohere.TextResponseFormat? Type296 { get; set; } /// /// /// - public global::Cohere.ResponseFormat? Type297 { get; set; } + public global::Cohere.ResponseFormatDiscriminator? Type297 { get; set; } /// /// /// - public global::Cohere.ResponseFormatDiscriminator? Type298 { get; set; } + public global::Cohere.ResponseFormatDiscriminatorType? Type298 { get; set; } /// /// /// - public global::Cohere.ResponseFormatDiscriminatorType? Type299 { get; set; } + public global::Cohere.ResponseFormatV2? Type299 { get; set; } /// /// /// - public global::Cohere.ResponseFormatV2? Type300 { get; set; } + public global::Cohere.TextResponseFormatV2? Type300 { get; set; } /// /// /// diff --git a/src/libs/Cohere/Generated/Cohere.Models.ChatDocumentSourceDocument.Json.g.cs b/src/libs/Cohere/Generated/Cohere.Models.ChatDocumentSourceDocument.Json.g.cs deleted file mode 100644 index ce962902..00000000 --- a/src/libs/Cohere/Generated/Cohere.Models.ChatDocumentSourceDocument.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace Cohere -{ - public sealed partial class ChatDocumentSourceDocument - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Cohere.ChatDocumentSourceDocument? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Cohere.ChatDocumentSourceDocument), - jsonSerializerContext) as global::Cohere.ChatDocumentSourceDocument; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Cohere.ChatDocumentSourceDocument? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Cohere.ChatDocumentSourceDocument), - jsonSerializerContext).ConfigureAwait(false)) as global::Cohere.ChatDocumentSourceDocument; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Cohere/Generated/Cohere.Models.ChatMessageV2.g.cs b/src/libs/Cohere/Generated/Cohere.Models.ChatMessageV2.g.cs index a6bfc9ed..c90420dc 100644 --- a/src/libs/Cohere/Generated/Cohere.Models.ChatMessageV2.g.cs +++ b/src/libs/Cohere/Generated/Cohere.Models.ChatMessageV2.g.cs @@ -18,9 +18,9 @@ namespace Cohere /// A message from the user. ///
#if NET6_0_OR_GREATER - public global::Cohere.UserMessageV2? User { get; init; } + public global::Cohere.UserMessage? User { get; init; } #else - public global::Cohere.UserMessageV2? User { get; } + public global::Cohere.UserMessage? User { get; } #endif /// @@ -34,17 +34,17 @@ namespace Cohere /// /// /// - public static implicit operator ChatMessageV2(global::Cohere.UserMessageV2 value) => new ChatMessageV2((global::Cohere.UserMessageV2?)value); + public static implicit operator ChatMessageV2(global::Cohere.UserMessage value) => new ChatMessageV2((global::Cohere.UserMessage?)value); /// /// /// - public static implicit operator global::Cohere.UserMessageV2?(ChatMessageV2 @this) => @this.User; + public static implicit operator global::Cohere.UserMessage?(ChatMessageV2 @this) => @this.User; /// /// /// - public ChatMessageV2(global::Cohere.UserMessageV2? value) + public ChatMessageV2(global::Cohere.UserMessage? value) { User = value; } @@ -88,9 +88,9 @@ public ChatMessageV2(global::Cohere.AssistantMessage? value) /// A message from the system. /// #if NET6_0_OR_GREATER - public global::Cohere.SystemMessageV2? System { get; init; } + public global::Cohere.SystemMessage? System { get; init; } #else - public global::Cohere.SystemMessageV2? System { get; } + public global::Cohere.SystemMessage? System { get; } #endif /// @@ -104,17 +104,17 @@ public ChatMessageV2(global::Cohere.AssistantMessage? value) /// /// /// - public static implicit operator ChatMessageV2(global::Cohere.SystemMessageV2 value) => new ChatMessageV2((global::Cohere.SystemMessageV2?)value); + public static implicit operator ChatMessageV2(global::Cohere.SystemMessage value) => new ChatMessageV2((global::Cohere.SystemMessage?)value); /// /// /// - public static implicit operator global::Cohere.SystemMessageV2?(ChatMessageV2 @this) => @this.System; + public static implicit operator global::Cohere.SystemMessage?(ChatMessageV2 @this) => @this.System; /// /// /// - public ChatMessageV2(global::Cohere.SystemMessageV2? value) + public ChatMessageV2(global::Cohere.SystemMessage? value) { System = value; } @@ -159,9 +159,9 @@ public ChatMessageV2(global::Cohere.ToolMessageV2? value) /// public ChatMessageV2( global::Cohere.ChatMessageV2DiscriminatorRole? role, - global::Cohere.UserMessageV2? user, + global::Cohere.UserMessage? user, global::Cohere.AssistantMessage? assistant, - global::Cohere.SystemMessageV2? system, + global::Cohere.SystemMessage? system, global::Cohere.ToolMessageV2? tool ) { @@ -205,9 +205,9 @@ public bool Validate() /// ///
public TResult? Match( - global::System.Func? user = null, + global::System.Func? user = null, global::System.Func? assistant = null, - global::System.Func? system = null, + global::System.Func? system = null, global::System.Func? tool = null, bool validate = true) { @@ -240,9 +240,9 @@ public bool Validate() /// ///
public void Match( - global::System.Action? user = null, + global::System.Action? user = null, global::System.Action? assistant = null, - global::System.Action? system = null, + global::System.Action? system = null, global::System.Action? tool = null, bool validate = true) { @@ -277,11 +277,11 @@ public override int GetHashCode() var fields = new object?[] { User, - typeof(global::Cohere.UserMessageV2), + typeof(global::Cohere.UserMessage), Assistant, typeof(global::Cohere.AssistantMessage), System, - typeof(global::Cohere.SystemMessageV2), + typeof(global::Cohere.SystemMessage), Tool, typeof(global::Cohere.ToolMessageV2), }; @@ -300,9 +300,9 @@ static int HashCodeAggregator(int hashCode, object? value) => value == null public bool Equals(ChatMessageV2 other) { return - global::System.Collections.Generic.EqualityComparer.Default.Equals(User, other.User) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(User, other.User) && global::System.Collections.Generic.EqualityComparer.Default.Equals(Assistant, other.Assistant) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(System, other.System) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(System, other.System) && global::System.Collections.Generic.EqualityComparer.Default.Equals(Tool, other.Tool) ; } diff --git a/src/libs/Cohere/Generated/Cohere.Models.ChatTextResponseFormatV2.Json.g.cs b/src/libs/Cohere/Generated/Cohere.Models.ChatTextResponseFormatV2.Json.g.cs deleted file mode 100644 index 23d01de5..00000000 --- a/src/libs/Cohere/Generated/Cohere.Models.ChatTextResponseFormatV2.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace Cohere -{ - public sealed partial class ChatTextResponseFormatV2 - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Cohere.ChatTextResponseFormatV2? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Cohere.ChatTextResponseFormatV2), - jsonSerializerContext) as global::Cohere.ChatTextResponseFormatV2; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Cohere.ChatTextResponseFormatV2? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Cohere.ChatTextResponseFormatV2), - jsonSerializerContext).ConfigureAwait(false)) as global::Cohere.ChatTextResponseFormatV2; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Cohere/Generated/Cohere.Models.ChatToolSourceToolOutput.Json.g.cs b/src/libs/Cohere/Generated/Cohere.Models.ChatToolSourceToolOutput.Json.g.cs deleted file mode 100644 index abfd78dc..00000000 --- a/src/libs/Cohere/Generated/Cohere.Models.ChatToolSourceToolOutput.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace Cohere -{ - public sealed partial class ChatToolSourceToolOutput - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Cohere.ChatToolSourceToolOutput? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Cohere.ChatToolSourceToolOutput), - jsonSerializerContext) as global::Cohere.ChatToolSourceToolOutput; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Cohere.ChatToolSourceToolOutput? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Cohere.ChatToolSourceToolOutput), - jsonSerializerContext).ConfigureAwait(false)) as global::Cohere.ChatToolSourceToolOutput; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Cohere/Generated/Cohere.Models.ChatToolSource.Json.g.cs b/src/libs/Cohere/Generated/Cohere.Models.Content2.Json.g.cs similarity index 88% rename from src/libs/Cohere/Generated/Cohere.Models.ChatToolSource.Json.g.cs rename to src/libs/Cohere/Generated/Cohere.Models.Content2.Json.g.cs index 2eda1a59..97ed1ffa 100644 --- a/src/libs/Cohere/Generated/Cohere.Models.ChatToolSource.Json.g.cs +++ b/src/libs/Cohere/Generated/Cohere.Models.Content2.Json.g.cs @@ -2,7 +2,7 @@ namespace Cohere { - public sealed partial class ChatToolSource + public readonly partial struct Content2 { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -34,14 +34,14 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::Cohere.ChatToolSource? FromJson( + public static global::Cohere.Content2? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::Cohere.ChatToolSource), - jsonSerializerContext) as global::Cohere.ChatToolSource; + typeof(global::Cohere.Content2), + jsonSerializerContext) as global::Cohere.Content2?; } /// @@ -51,11 +51,11 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::Cohere.ChatToolSource? FromJson( + public static global::Cohere.Content2? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -63,14 +63,14 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, - typeof(global::Cohere.ChatToolSource), - jsonSerializerContext).ConfigureAwait(false)) as global::Cohere.ChatToolSource; + typeof(global::Cohere.Content2), + jsonSerializerContext).ConfigureAwait(false)) as global::Cohere.Content2?; } /// @@ -80,11 +80,11 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/Cohere/Generated/Cohere.Models.MessageContent.g.cs b/src/libs/Cohere/Generated/Cohere.Models.Content2.g.cs similarity index 74% rename from src/libs/Cohere/Generated/Cohere.Models.MessageContent.g.cs rename to src/libs/Cohere/Generated/Cohere.Models.Content2.g.cs index 70154a76..607ebf28 100644 --- a/src/libs/Cohere/Generated/Cohere.Models.MessageContent.g.cs +++ b/src/libs/Cohere/Generated/Cohere.Models.Content2.g.cs @@ -7,20 +7,20 @@ namespace Cohere /// /// A Content block which contains information about the content type and the content itself. /// - public readonly partial struct MessageContent : global::System.IEquatable + public readonly partial struct Content2 : global::System.IEquatable { /// /// /// - public global::Cohere.MessageContentDiscriminatorType? Type { get; } + public global::Cohere.ContentDiscriminatorType? Type { get; } /// /// Text content of the message. /// #if NET6_0_OR_GREATER - public global::Cohere.ChatTextContent? Text { get; init; } + public global::Cohere.TextContent? Text { get; init; } #else - public global::Cohere.ChatTextContent? Text { get; } + public global::Cohere.TextContent? Text { get; } #endif /// @@ -34,17 +34,17 @@ namespace Cohere /// /// /// - public static implicit operator MessageContent(global::Cohere.ChatTextContent value) => new MessageContent((global::Cohere.ChatTextContent?)value); + public static implicit operator Content2(global::Cohere.TextContent value) => new Content2((global::Cohere.TextContent?)value); /// /// /// - public static implicit operator global::Cohere.ChatTextContent?(MessageContent @this) => @this.Text; + public static implicit operator global::Cohere.TextContent?(Content2 @this) => @this.Text; /// /// /// - public MessageContent(global::Cohere.ChatTextContent? value) + public Content2(global::Cohere.TextContent? value) { Text = value; } @@ -69,17 +69,17 @@ public MessageContent(global::Cohere.ChatTextContent? value) /// /// /// - public static implicit operator MessageContent(global::Cohere.ImageContent value) => new MessageContent((global::Cohere.ImageContent?)value); + public static implicit operator Content2(global::Cohere.ImageContent value) => new Content2((global::Cohere.ImageContent?)value); /// /// /// - public static implicit operator global::Cohere.ImageContent?(MessageContent @this) => @this.ImageUrl; + public static implicit operator global::Cohere.ImageContent?(Content2 @this) => @this.ImageUrl; /// /// /// - public MessageContent(global::Cohere.ImageContent? value) + public Content2(global::Cohere.ImageContent? value) { ImageUrl = value; } @@ -87,9 +87,9 @@ public MessageContent(global::Cohere.ImageContent? value) /// /// /// - public MessageContent( - global::Cohere.MessageContentDiscriminatorType? type, - global::Cohere.ChatTextContent? text, + public Content2( + global::Cohere.ContentDiscriminatorType? type, + global::Cohere.TextContent? text, global::Cohere.ImageContent? imageUrl ) { @@ -127,7 +127,7 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? text = null, + global::System.Func? text = null, global::System.Func? imageUrl = null, bool validate = true) { @@ -152,7 +152,7 @@ public bool Validate() /// /// public void Match( - global::System.Action? text = null, + global::System.Action? text = null, global::System.Action? imageUrl = null, bool validate = true) { @@ -179,7 +179,7 @@ public override int GetHashCode() var fields = new object?[] { Text, - typeof(global::Cohere.ChatTextContent), + typeof(global::Cohere.TextContent), ImageUrl, typeof(global::Cohere.ImageContent), }; @@ -195,10 +195,10 @@ static int HashCodeAggregator(int hashCode, object? value) => value == null /// /// /// - public bool Equals(MessageContent other) + public bool Equals(Content2 other) { return - global::System.Collections.Generic.EqualityComparer.Default.Equals(Text, other.Text) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Text, other.Text) && global::System.Collections.Generic.EqualityComparer.Default.Equals(ImageUrl, other.ImageUrl) ; } @@ -206,15 +206,15 @@ public bool Equals(MessageContent other) /// /// /// - public static bool operator ==(MessageContent obj1, MessageContent obj2) + public static bool operator ==(Content2 obj1, Content2 obj2) { - return global::System.Collections.Generic.EqualityComparer.Default.Equals(obj1, obj2); + return global::System.Collections.Generic.EqualityComparer.Default.Equals(obj1, obj2); } /// /// /// - public static bool operator !=(MessageContent obj1, MessageContent obj2) + public static bool operator !=(Content2 obj1, Content2 obj2) { return !(obj1 == obj2); } @@ -224,7 +224,7 @@ public bool Equals(MessageContent other) /// public override bool Equals(object? obj) { - return obj is MessageContent o && Equals(o); + return obj is Content2 o && Equals(o); } } } diff --git a/src/libs/Cohere/Generated/Cohere.Models.ChatToolMessage.Json.g.cs b/src/libs/Cohere/Generated/Cohere.Models.ContentDiscriminator.Json.g.cs similarity index 87% rename from src/libs/Cohere/Generated/Cohere.Models.ChatToolMessage.Json.g.cs rename to src/libs/Cohere/Generated/Cohere.Models.ContentDiscriminator.Json.g.cs index bd5bbe1d..05114b71 100644 --- a/src/libs/Cohere/Generated/Cohere.Models.ChatToolMessage.Json.g.cs +++ b/src/libs/Cohere/Generated/Cohere.Models.ContentDiscriminator.Json.g.cs @@ -2,7 +2,7 @@ namespace Cohere { - public sealed partial class ChatToolMessage + public sealed partial class ContentDiscriminator { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -34,14 +34,14 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::Cohere.ChatToolMessage? FromJson( + public static global::Cohere.ContentDiscriminator? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::Cohere.ChatToolMessage), - jsonSerializerContext) as global::Cohere.ChatToolMessage; + typeof(global::Cohere.ContentDiscriminator), + jsonSerializerContext) as global::Cohere.ContentDiscriminator; } /// @@ -51,11 +51,11 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::Cohere.ChatToolMessage? FromJson( + public static global::Cohere.ContentDiscriminator? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -63,14 +63,14 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, - typeof(global::Cohere.ChatToolMessage), - jsonSerializerContext).ConfigureAwait(false)) as global::Cohere.ChatToolMessage; + typeof(global::Cohere.ContentDiscriminator), + jsonSerializerContext).ConfigureAwait(false)) as global::Cohere.ContentDiscriminator; } /// @@ -80,11 +80,11 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/Cohere/Generated/Cohere.Models.MessageContentDiscriminator.g.cs b/src/libs/Cohere/Generated/Cohere.Models.ContentDiscriminator.g.cs similarity index 62% rename from src/libs/Cohere/Generated/Cohere.Models.MessageContentDiscriminator.g.cs rename to src/libs/Cohere/Generated/Cohere.Models.ContentDiscriminator.g.cs index 937d9b56..16a63b76 100644 --- a/src/libs/Cohere/Generated/Cohere.Models.MessageContentDiscriminator.g.cs +++ b/src/libs/Cohere/Generated/Cohere.Models.ContentDiscriminator.g.cs @@ -6,14 +6,14 @@ namespace Cohere /// /// /// - public sealed partial class MessageContentDiscriminator + public sealed partial class ContentDiscriminator { /// /// /// [global::System.Text.Json.Serialization.JsonPropertyName("type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Cohere.JsonConverters.MessageContentDiscriminatorTypeJsonConverter))] - public global::Cohere.MessageContentDiscriminatorType? Type { get; set; } + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Cohere.JsonConverters.ContentDiscriminatorTypeJsonConverter))] + public global::Cohere.ContentDiscriminatorType? Type { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -22,22 +22,22 @@ public sealed partial class MessageContentDiscriminator public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif - public MessageContentDiscriminator( - global::Cohere.MessageContentDiscriminatorType? type) + public ContentDiscriminator( + global::Cohere.ContentDiscriminatorType? type) { this.Type = type; } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public MessageContentDiscriminator() + public ContentDiscriminator() { } } diff --git a/src/libs/Cohere/Generated/Cohere.Models.MessageContentDiscriminatorType.g.cs b/src/libs/Cohere/Generated/Cohere.Models.ContentDiscriminatorType.g.cs similarity index 60% rename from src/libs/Cohere/Generated/Cohere.Models.MessageContentDiscriminatorType.g.cs rename to src/libs/Cohere/Generated/Cohere.Models.ContentDiscriminatorType.g.cs index afe68e50..2899e1cb 100644 --- a/src/libs/Cohere/Generated/Cohere.Models.MessageContentDiscriminatorType.g.cs +++ b/src/libs/Cohere/Generated/Cohere.Models.ContentDiscriminatorType.g.cs @@ -6,7 +6,7 @@ namespace Cohere /// /// /// - public enum MessageContentDiscriminatorType + public enum ContentDiscriminatorType { /// /// @@ -21,29 +21,29 @@ public enum MessageContentDiscriminatorType /// /// Enum extensions to do fast conversions without the reflection. /// - public static class MessageContentDiscriminatorTypeExtensions + public static class ContentDiscriminatorTypeExtensions { /// /// Converts an enum to a string. /// - public static string ToValueString(this MessageContentDiscriminatorType value) + public static string ToValueString(this ContentDiscriminatorType value) { return value switch { - MessageContentDiscriminatorType.ImageUrl => "image_url", - MessageContentDiscriminatorType.Text => "text", + ContentDiscriminatorType.ImageUrl => "image_url", + ContentDiscriminatorType.Text => "text", _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), }; } /// /// Converts an string to a enum. /// - public static MessageContentDiscriminatorType? ToEnum(string value) + public static ContentDiscriminatorType? ToEnum(string value) { return value switch { - "image_url" => MessageContentDiscriminatorType.ImageUrl, - "text" => MessageContentDiscriminatorType.Text, + "image_url" => ContentDiscriminatorType.ImageUrl, + "text" => ContentDiscriminatorType.Text, _ => null, }; } diff --git a/src/libs/Cohere/Generated/Cohere.Models.ContentItem.g.cs b/src/libs/Cohere/Generated/Cohere.Models.ContentItem.g.cs index b16450f2..a1ea4610 100644 --- a/src/libs/Cohere/Generated/Cohere.Models.ContentItem.g.cs +++ b/src/libs/Cohere/Generated/Cohere.Models.ContentItem.g.cs @@ -18,9 +18,9 @@ namespace Cohere /// Text content of the message. /// #if NET6_0_OR_GREATER - public global::Cohere.ChatTextContent? Text { get; init; } + public global::Cohere.TextContent? Text { get; init; } #else - public global::Cohere.ChatTextContent? Text { get; } + public global::Cohere.TextContent? Text { get; } #endif /// @@ -34,17 +34,17 @@ namespace Cohere /// /// /// - public static implicit operator ContentItem(global::Cohere.ChatTextContent value) => new ContentItem((global::Cohere.ChatTextContent?)value); + public static implicit operator ContentItem(global::Cohere.TextContent value) => new ContentItem((global::Cohere.TextContent?)value); /// /// /// - public static implicit operator global::Cohere.ChatTextContent?(ContentItem @this) => @this.Text; + public static implicit operator global::Cohere.TextContent?(ContentItem @this) => @this.Text; /// /// /// - public ContentItem(global::Cohere.ChatTextContent? value) + public ContentItem(global::Cohere.TextContent? value) { Text = value; } @@ -54,7 +54,7 @@ public ContentItem(global::Cohere.ChatTextContent? value) /// public ContentItem( global::Cohere.AssistantMessageResponseContentItemDiscriminatorType? type, - global::Cohere.ChatTextContent? text + global::Cohere.TextContent? text ) { Type = type; @@ -88,7 +88,7 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? text = null, + global::System.Func? text = null, bool validate = true) { if (validate) @@ -108,7 +108,7 @@ public bool Validate() /// /// public void Match( - global::System.Action? text = null, + global::System.Action? text = null, bool validate = true) { if (validate) @@ -130,7 +130,7 @@ public override int GetHashCode() var fields = new object?[] { Text, - typeof(global::Cohere.ChatTextContent), + typeof(global::Cohere.TextContent), }; const int offset = unchecked((int)2166136261); const int prime = 16777619; @@ -147,7 +147,7 @@ static int HashCodeAggregator(int hashCode, object? value) => value == null public bool Equals(ContentItem other) { return - global::System.Collections.Generic.EqualityComparer.Default.Equals(Text, other.Text) + global::System.Collections.Generic.EqualityComparer.Default.Equals(Text, other.Text) ; } diff --git a/src/libs/Cohere/Generated/Cohere.Models.ContentVariant2Item.g.cs b/src/libs/Cohere/Generated/Cohere.Models.ContentVariant2Item.g.cs index 40574ae6..98f5c6b4 100644 --- a/src/libs/Cohere/Generated/Cohere.Models.ContentVariant2Item.g.cs +++ b/src/libs/Cohere/Generated/Cohere.Models.ContentVariant2Item.g.cs @@ -18,9 +18,9 @@ namespace Cohere /// Text content of the message. /// #if NET6_0_OR_GREATER - public global::Cohere.ChatTextContent? Text { get; init; } + public global::Cohere.TextContent? Text { get; init; } #else - public global::Cohere.ChatTextContent? Text { get; } + public global::Cohere.TextContent? Text { get; } #endif /// @@ -34,17 +34,17 @@ namespace Cohere /// /// /// - public static implicit operator ContentVariant2Item(global::Cohere.ChatTextContent value) => new ContentVariant2Item((global::Cohere.ChatTextContent?)value); + public static implicit operator ContentVariant2Item(global::Cohere.TextContent value) => new ContentVariant2Item((global::Cohere.TextContent?)value); /// /// /// - public static implicit operator global::Cohere.ChatTextContent?(ContentVariant2Item @this) => @this.Text; + public static implicit operator global::Cohere.TextContent?(ContentVariant2Item @this) => @this.Text; /// /// /// - public ContentVariant2Item(global::Cohere.ChatTextContent? value) + public ContentVariant2Item(global::Cohere.TextContent? value) { Text = value; } @@ -54,7 +54,7 @@ public ContentVariant2Item(global::Cohere.ChatTextContent? value) /// public ContentVariant2Item( global::Cohere.AssistantMessageContentVariant2ItemDiscriminatorType? type, - global::Cohere.ChatTextContent? text + global::Cohere.TextContent? text ) { Type = type; @@ -88,7 +88,7 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? text = null, + global::System.Func? text = null, bool validate = true) { if (validate) @@ -108,7 +108,7 @@ public bool Validate() /// /// public void Match( - global::System.Action? text = null, + global::System.Action? text = null, bool validate = true) { if (validate) @@ -130,7 +130,7 @@ public override int GetHashCode() var fields = new object?[] { Text, - typeof(global::Cohere.ChatTextContent), + typeof(global::Cohere.TextContent), }; const int offset = unchecked((int)2166136261); const int prime = 16777619; @@ -147,7 +147,7 @@ static int HashCodeAggregator(int hashCode, object? value) => value == null public bool Equals(ContentVariant2Item other) { return - global::System.Collections.Generic.EqualityComparer.Default.Equals(Text, other.Text) + global::System.Collections.Generic.EqualityComparer.Default.Equals(Text, other.Text) ; } diff --git a/src/libs/Cohere/Generated/Cohere.Models.ContentVariant2Item2.g.cs b/src/libs/Cohere/Generated/Cohere.Models.ContentVariant2Item2.g.cs index 99077d0b..f8ad7860 100644 --- a/src/libs/Cohere/Generated/Cohere.Models.ContentVariant2Item2.g.cs +++ b/src/libs/Cohere/Generated/Cohere.Models.ContentVariant2Item2.g.cs @@ -12,15 +12,15 @@ namespace Cohere /// /// /// - public global::Cohere.SystemMessageV2ContentVariant2ItemDiscriminatorType? Type { get; } + public global::Cohere.SystemMessageContentVariant2ItemDiscriminatorType? Type { get; } /// /// Text content of the message. /// #if NET6_0_OR_GREATER - public global::Cohere.ChatTextContent? Text { get; init; } + public global::Cohere.TextContent? Text { get; init; } #else - public global::Cohere.ChatTextContent? Text { get; } + public global::Cohere.TextContent? Text { get; } #endif /// @@ -34,17 +34,17 @@ namespace Cohere /// /// /// - public static implicit operator ContentVariant2Item2(global::Cohere.ChatTextContent value) => new ContentVariant2Item2((global::Cohere.ChatTextContent?)value); + public static implicit operator ContentVariant2Item2(global::Cohere.TextContent value) => new ContentVariant2Item2((global::Cohere.TextContent?)value); /// /// /// - public static implicit operator global::Cohere.ChatTextContent?(ContentVariant2Item2 @this) => @this.Text; + public static implicit operator global::Cohere.TextContent?(ContentVariant2Item2 @this) => @this.Text; /// /// /// - public ContentVariant2Item2(global::Cohere.ChatTextContent? value) + public ContentVariant2Item2(global::Cohere.TextContent? value) { Text = value; } @@ -53,8 +53,8 @@ public ContentVariant2Item2(global::Cohere.ChatTextContent? value) /// /// public ContentVariant2Item2( - global::Cohere.SystemMessageV2ContentVariant2ItemDiscriminatorType? type, - global::Cohere.ChatTextContent? text + global::Cohere.SystemMessageContentVariant2ItemDiscriminatorType? type, + global::Cohere.TextContent? text ) { Type = type; @@ -88,7 +88,7 @@ public bool Validate() /// ///
public TResult? Match( - global::System.Func? text = null, + global::System.Func? text = null, bool validate = true) { if (validate) @@ -108,7 +108,7 @@ public bool Validate() /// ///
public void Match( - global::System.Action? text = null, + global::System.Action? text = null, bool validate = true) { if (validate) @@ -130,7 +130,7 @@ public override int GetHashCode() var fields = new object?[] { Text, - typeof(global::Cohere.ChatTextContent), + typeof(global::Cohere.TextContent), }; const int offset = unchecked((int)2166136261); const int prime = 16777619; @@ -147,7 +147,7 @@ static int HashCodeAggregator(int hashCode, object? value) => value == null public bool Equals(ContentVariant2Item2 other) { return - global::System.Collections.Generic.EqualityComparer.Default.Equals(Text, other.Text) + global::System.Collections.Generic.EqualityComparer.Default.Equals(Text, other.Text) ; } diff --git a/src/libs/Cohere/Generated/Cohere.Models.MessageContent.Json.g.cs b/src/libs/Cohere/Generated/Cohere.Models.DocumentSource.Json.g.cs similarity index 88% rename from src/libs/Cohere/Generated/Cohere.Models.MessageContent.Json.g.cs rename to src/libs/Cohere/Generated/Cohere.Models.DocumentSource.Json.g.cs index 40667670..943b58e6 100644 --- a/src/libs/Cohere/Generated/Cohere.Models.MessageContent.Json.g.cs +++ b/src/libs/Cohere/Generated/Cohere.Models.DocumentSource.Json.g.cs @@ -2,7 +2,7 @@ namespace Cohere { - public readonly partial struct MessageContent + public sealed partial class DocumentSource { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -34,14 +34,14 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::Cohere.MessageContent? FromJson( + public static global::Cohere.DocumentSource? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::Cohere.MessageContent), - jsonSerializerContext) as global::Cohere.MessageContent?; + typeof(global::Cohere.DocumentSource), + jsonSerializerContext) as global::Cohere.DocumentSource; } /// @@ -51,11 +51,11 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::Cohere.MessageContent? FromJson( + public static global::Cohere.DocumentSource? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -63,14 +63,14 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, - typeof(global::Cohere.MessageContent), - jsonSerializerContext).ConfigureAwait(false)) as global::Cohere.MessageContent?; + typeof(global::Cohere.DocumentSource), + jsonSerializerContext).ConfigureAwait(false)) as global::Cohere.DocumentSource; } /// @@ -80,11 +80,11 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/Cohere/Generated/Cohere.Models.ChatDocumentSource.g.cs b/src/libs/Cohere/Generated/Cohere.Models.DocumentSource.g.cs similarity index 83% rename from src/libs/Cohere/Generated/Cohere.Models.ChatDocumentSource.g.cs rename to src/libs/Cohere/Generated/Cohere.Models.DocumentSource.g.cs index 5d76bd92..1f6b00f8 100644 --- a/src/libs/Cohere/Generated/Cohere.Models.ChatDocumentSource.g.cs +++ b/src/libs/Cohere/Generated/Cohere.Models.DocumentSource.g.cs @@ -6,7 +6,7 @@ namespace Cohere /// /// A document source object containing the unique identifier of the document and the document itself. /// - public sealed partial class ChatDocumentSource + public sealed partial class DocumentSource { /// /// @@ -27,7 +27,7 @@ public sealed partial class ChatDocumentSource public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// /// @@ -36,7 +36,7 @@ public sealed partial class ChatDocumentSource #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif - public ChatDocumentSource( + public DocumentSource( object? document, string? id) { @@ -45,9 +45,9 @@ public ChatDocumentSource( } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public ChatDocumentSource() + public DocumentSource() { } } diff --git a/src/libs/Cohere/Generated/Cohere.Models.ChatTextResponseFormat.Json.g.cs b/src/libs/Cohere/Generated/Cohere.Models.DocumentSourceDocument.Json.g.cs similarity index 87% rename from src/libs/Cohere/Generated/Cohere.Models.ChatTextResponseFormat.Json.g.cs rename to src/libs/Cohere/Generated/Cohere.Models.DocumentSourceDocument.Json.g.cs index 1f93b024..c3f49bc9 100644 --- a/src/libs/Cohere/Generated/Cohere.Models.ChatTextResponseFormat.Json.g.cs +++ b/src/libs/Cohere/Generated/Cohere.Models.DocumentSourceDocument.Json.g.cs @@ -2,7 +2,7 @@ namespace Cohere { - public sealed partial class ChatTextResponseFormat + public sealed partial class DocumentSourceDocument { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -34,14 +34,14 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::Cohere.ChatTextResponseFormat? FromJson( + public static global::Cohere.DocumentSourceDocument? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::Cohere.ChatTextResponseFormat), - jsonSerializerContext) as global::Cohere.ChatTextResponseFormat; + typeof(global::Cohere.DocumentSourceDocument), + jsonSerializerContext) as global::Cohere.DocumentSourceDocument; } /// @@ -51,11 +51,11 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::Cohere.ChatTextResponseFormat? FromJson( + public static global::Cohere.DocumentSourceDocument? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -63,14 +63,14 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, - typeof(global::Cohere.ChatTextResponseFormat), - jsonSerializerContext).ConfigureAwait(false)) as global::Cohere.ChatTextResponseFormat; + typeof(global::Cohere.DocumentSourceDocument), + jsonSerializerContext).ConfigureAwait(false)) as global::Cohere.DocumentSourceDocument; } /// @@ -80,11 +80,11 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/Cohere/Generated/Cohere.Models.ChatToolSourceToolOutput.g.cs b/src/libs/Cohere/Generated/Cohere.Models.DocumentSourceDocument.g.cs similarity index 89% rename from src/libs/Cohere/Generated/Cohere.Models.ChatToolSourceToolOutput.g.cs rename to src/libs/Cohere/Generated/Cohere.Models.DocumentSourceDocument.g.cs index a0d3e876..bcc2c20e 100644 --- a/src/libs/Cohere/Generated/Cohere.Models.ChatToolSourceToolOutput.g.cs +++ b/src/libs/Cohere/Generated/Cohere.Models.DocumentSourceDocument.g.cs @@ -6,7 +6,7 @@ namespace Cohere /// /// /// - public sealed partial class ChatToolSourceToolOutput + public sealed partial class DocumentSourceDocument { /// diff --git a/src/libs/Cohere/Generated/Cohere.Models.EmbedByTypeResponse.g.cs b/src/libs/Cohere/Generated/Cohere.Models.EmbedByTypeResponse.g.cs index a6a7e437..1a6a9a18 100644 --- a/src/libs/Cohere/Generated/Cohere.Models.EmbedByTypeResponse.g.cs +++ b/src/libs/Cohere/Generated/Cohere.Models.EmbedByTypeResponse.g.cs @@ -46,8 +46,7 @@ public sealed partial class EmbedByTypeResponse /// The text entries for which embeddings were returned. /// [global::System.Text.Json.Serialization.JsonPropertyName("texts")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList Texts { get; set; } + public global::System.Collections.Generic.IList? Texts { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -76,18 +75,18 @@ public sealed partial class EmbedByTypeResponse #endif public EmbedByTypeResponse( string id, - global::System.Collections.Generic.IList texts, global::System.Collections.Generic.IList? images, global::Cohere.ApiMeta? meta, global::Cohere.EmbedByTypeResponseResponseType? responseType, + global::System.Collections.Generic.IList? texts, global::Cohere.EmbedByTypeResponseEmbeddings embeddings = default!) { this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); - this.Texts = texts ?? throw new global::System.ArgumentNullException(nameof(texts)); this.Embeddings = embeddings; this.Images = images; this.Meta = meta; this.ResponseType = responseType; + this.Texts = texts; } /// diff --git a/src/libs/Cohere/Generated/Cohere.Models.Message.g.cs b/src/libs/Cohere/Generated/Cohere.Models.Message.g.cs index c9bcd20d..848ed205 100644 --- a/src/libs/Cohere/Generated/Cohere.Models.Message.g.cs +++ b/src/libs/Cohere/Generated/Cohere.Models.Message.g.cs @@ -54,9 +54,9 @@ public Message(global::Cohere.ChatMessage? value) /// Represents tool result in the chat history. /// #if NET6_0_OR_GREATER - public global::Cohere.ChatToolMessage? TOOL { get; init; } + public global::Cohere.ToolMessage? TOOL { get; init; } #else - public global::Cohere.ChatToolMessage? TOOL { get; } + public global::Cohere.ToolMessage? TOOL { get; } #endif /// @@ -70,17 +70,17 @@ public Message(global::Cohere.ChatMessage? value) /// /// /// - public static implicit operator Message(global::Cohere.ChatToolMessage value) => new Message((global::Cohere.ChatToolMessage?)value); + public static implicit operator Message(global::Cohere.ToolMessage value) => new Message((global::Cohere.ToolMessage?)value); /// /// /// - public static implicit operator global::Cohere.ChatToolMessage?(Message @this) => @this.TOOL; + public static implicit operator global::Cohere.ToolMessage?(Message @this) => @this.TOOL; /// /// /// - public Message(global::Cohere.ChatToolMessage? value) + public Message(global::Cohere.ToolMessage? value) { TOOL = value; } @@ -91,7 +91,7 @@ public Message(global::Cohere.ChatToolMessage? value) public Message( global::Cohere.MessageDiscriminatorRole? role, global::Cohere.ChatMessage? cHATBOT, - global::Cohere.ChatToolMessage? tOOL + global::Cohere.ToolMessage? tOOL ) { Role = role; @@ -129,7 +129,7 @@ public bool Validate() /// public TResult? Match( global::System.Func? cHATBOT = null, - global::System.Func? tOOL = null, + global::System.Func? tOOL = null, bool validate = true) { if (validate) @@ -154,7 +154,7 @@ public bool Validate() /// public void Match( global::System.Action? cHATBOT = null, - global::System.Action? tOOL = null, + global::System.Action? tOOL = null, bool validate = true) { if (validate) @@ -182,7 +182,7 @@ public override int GetHashCode() CHATBOT, typeof(global::Cohere.ChatMessage), TOOL, - typeof(global::Cohere.ChatToolMessage), + typeof(global::Cohere.ToolMessage), }; const int offset = unchecked((int)2166136261); const int prime = 16777619; @@ -200,7 +200,7 @@ public bool Equals(Message other) { return global::System.Collections.Generic.EqualityComparer.Default.Equals(CHATBOT, other.CHATBOT) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(TOOL, other.TOOL) + global::System.Collections.Generic.EqualityComparer.Default.Equals(TOOL, other.TOOL) ; } diff --git a/src/libs/Cohere/Generated/Cohere.Models.MessageContentDiscriminator.Json.g.cs b/src/libs/Cohere/Generated/Cohere.Models.MessageContentDiscriminator.Json.g.cs deleted file mode 100644 index d5c02a7a..00000000 --- a/src/libs/Cohere/Generated/Cohere.Models.MessageContentDiscriminator.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace Cohere -{ - public sealed partial class MessageContentDiscriminator - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Cohere.MessageContentDiscriminator? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Cohere.MessageContentDiscriminator), - jsonSerializerContext) as global::Cohere.MessageContentDiscriminator; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Cohere.MessageContentDiscriminator? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Cohere.MessageContentDiscriminator), - jsonSerializerContext).ConfigureAwait(false)) as global::Cohere.MessageContentDiscriminator; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/Cohere/Generated/Cohere.Models.ResponseFormat.g.cs b/src/libs/Cohere/Generated/Cohere.Models.ResponseFormat.g.cs index 57c17c3f..bfd0e846 100644 --- a/src/libs/Cohere/Generated/Cohere.Models.ResponseFormat.g.cs +++ b/src/libs/Cohere/Generated/Cohere.Models.ResponseFormat.g.cs @@ -22,9 +22,9 @@ namespace Cohere /// /// #if NET6_0_OR_GREATER - public global::Cohere.ChatTextResponseFormat? Text { get; init; } + public global::Cohere.TextResponseFormat? Text { get; init; } #else - public global::Cohere.ChatTextResponseFormat? Text { get; } + public global::Cohere.TextResponseFormat? Text { get; } #endif /// @@ -38,17 +38,17 @@ namespace Cohere /// /// /// - public static implicit operator ResponseFormat(global::Cohere.ChatTextResponseFormat value) => new ResponseFormat((global::Cohere.ChatTextResponseFormat?)value); + public static implicit operator ResponseFormat(global::Cohere.TextResponseFormat value) => new ResponseFormat((global::Cohere.TextResponseFormat?)value); /// /// /// - public static implicit operator global::Cohere.ChatTextResponseFormat?(ResponseFormat @this) => @this.Text; + public static implicit operator global::Cohere.TextResponseFormat?(ResponseFormat @this) => @this.Text; /// /// /// - public ResponseFormat(global::Cohere.ChatTextResponseFormat? value) + public ResponseFormat(global::Cohere.TextResponseFormat? value) { Text = value; } @@ -93,7 +93,7 @@ public ResponseFormat(global::Cohere.JSONResponseFormat? value) /// public ResponseFormat( global::Cohere.ResponseFormatDiscriminatorType? type, - global::Cohere.ChatTextResponseFormat? text, + global::Cohere.TextResponseFormat? text, global::Cohere.JSONResponseFormat? jsonObject ) { @@ -131,7 +131,7 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? text = null, + global::System.Func? text = null, global::System.Func? jsonObject = null, bool validate = true) { @@ -156,7 +156,7 @@ public bool Validate() /// /// public void Match( - global::System.Action? text = null, + global::System.Action? text = null, global::System.Action? jsonObject = null, bool validate = true) { @@ -183,7 +183,7 @@ public override int GetHashCode() var fields = new object?[] { Text, - typeof(global::Cohere.ChatTextResponseFormat), + typeof(global::Cohere.TextResponseFormat), JsonObject, typeof(global::Cohere.JSONResponseFormat), }; @@ -202,7 +202,7 @@ static int HashCodeAggregator(int hashCode, object? value) => value == null public bool Equals(ResponseFormat other) { return - global::System.Collections.Generic.EqualityComparer.Default.Equals(Text, other.Text) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Text, other.Text) && global::System.Collections.Generic.EqualityComparer.Default.Equals(JsonObject, other.JsonObject) ; } diff --git a/src/libs/Cohere/Generated/Cohere.Models.ResponseFormatV2.g.cs b/src/libs/Cohere/Generated/Cohere.Models.ResponseFormatV2.g.cs index d5adca2c..d6b592d7 100644 --- a/src/libs/Cohere/Generated/Cohere.Models.ResponseFormatV2.g.cs +++ b/src/libs/Cohere/Generated/Cohere.Models.ResponseFormatV2.g.cs @@ -23,9 +23,9 @@ namespace Cohere /// /// #if NET6_0_OR_GREATER - public global::Cohere.ChatTextResponseFormatV2? Text { get; init; } + public global::Cohere.TextResponseFormatV2? Text { get; init; } #else - public global::Cohere.ChatTextResponseFormatV2? Text { get; } + public global::Cohere.TextResponseFormatV2? Text { get; } #endif /// @@ -39,17 +39,17 @@ namespace Cohere /// /// /// - public static implicit operator ResponseFormatV2(global::Cohere.ChatTextResponseFormatV2 value) => new ResponseFormatV2((global::Cohere.ChatTextResponseFormatV2?)value); + public static implicit operator ResponseFormatV2(global::Cohere.TextResponseFormatV2 value) => new ResponseFormatV2((global::Cohere.TextResponseFormatV2?)value); /// /// /// - public static implicit operator global::Cohere.ChatTextResponseFormatV2?(ResponseFormatV2 @this) => @this.Text; + public static implicit operator global::Cohere.TextResponseFormatV2?(ResponseFormatV2 @this) => @this.Text; /// /// /// - public ResponseFormatV2(global::Cohere.ChatTextResponseFormatV2? value) + public ResponseFormatV2(global::Cohere.TextResponseFormatV2? value) { Text = value; } @@ -94,7 +94,7 @@ public ResponseFormatV2(global::Cohere.JsonResponseFormatV2? value) /// public ResponseFormatV2( global::Cohere.ResponseFormatV2DiscriminatorType? type, - global::Cohere.ChatTextResponseFormatV2? text, + global::Cohere.TextResponseFormatV2? text, global::Cohere.JsonResponseFormatV2? jsonObject ) { @@ -132,7 +132,7 @@ public bool Validate() /// /// public TResult? Match( - global::System.Func? text = null, + global::System.Func? text = null, global::System.Func? jsonObject = null, bool validate = true) { @@ -157,7 +157,7 @@ public bool Validate() /// /// public void Match( - global::System.Action? text = null, + global::System.Action? text = null, global::System.Action? jsonObject = null, bool validate = true) { @@ -184,7 +184,7 @@ public override int GetHashCode() var fields = new object?[] { Text, - typeof(global::Cohere.ChatTextResponseFormatV2), + typeof(global::Cohere.TextResponseFormatV2), JsonObject, typeof(global::Cohere.JsonResponseFormatV2), }; @@ -203,7 +203,7 @@ static int HashCodeAggregator(int hashCode, object? value) => value == null public bool Equals(ResponseFormatV2 other) { return - global::System.Collections.Generic.EqualityComparer.Default.Equals(Text, other.Text) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Text, other.Text) && global::System.Collections.Generic.EqualityComparer.Default.Equals(JsonObject, other.JsonObject) ; } diff --git a/src/libs/Cohere/Generated/Cohere.Models.Source.g.cs b/src/libs/Cohere/Generated/Cohere.Models.Source.g.cs index 6920536b..157e3c3a 100644 --- a/src/libs/Cohere/Generated/Cohere.Models.Source.g.cs +++ b/src/libs/Cohere/Generated/Cohere.Models.Source.g.cs @@ -13,98 +13,98 @@ namespace Cohere /// /// #if NET6_0_OR_GREATER - public global::Cohere.ChatToolSource? ChatTool { get; init; } + public global::Cohere.ToolSource? Tool { get; init; } #else - public global::Cohere.ChatToolSource? ChatTool { get; } + public global::Cohere.ToolSource? Tool { get; } #endif /// /// /// #if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(ChatTool))] + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Tool))] #endif - public bool IsChatTool => ChatTool != null; + public bool IsTool => Tool != null; /// /// /// - public static implicit operator Source(global::Cohere.ChatToolSource value) => new Source((global::Cohere.ChatToolSource?)value); + public static implicit operator Source(global::Cohere.ToolSource value) => new Source((global::Cohere.ToolSource?)value); /// /// /// - public static implicit operator global::Cohere.ChatToolSource?(Source @this) => @this.ChatTool; + public static implicit operator global::Cohere.ToolSource?(Source @this) => @this.Tool; /// /// /// - public Source(global::Cohere.ChatToolSource? value) + public Source(global::Cohere.ToolSource? value) { - ChatTool = value; + Tool = value; } /// /// A document source object containing the unique identifier of the document and the document itself. /// #if NET6_0_OR_GREATER - public global::Cohere.ChatDocumentSource? ChatDocument { get; init; } + public global::Cohere.DocumentSource? Document { get; init; } #else - public global::Cohere.ChatDocumentSource? ChatDocument { get; } + public global::Cohere.DocumentSource? Document { get; } #endif /// /// /// #if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(ChatDocument))] + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Document))] #endif - public bool IsChatDocument => ChatDocument != null; + public bool IsDocument => Document != null; /// /// /// - public static implicit operator Source(global::Cohere.ChatDocumentSource value) => new Source((global::Cohere.ChatDocumentSource?)value); + public static implicit operator Source(global::Cohere.DocumentSource value) => new Source((global::Cohere.DocumentSource?)value); /// /// /// - public static implicit operator global::Cohere.ChatDocumentSource?(Source @this) => @this.ChatDocument; + public static implicit operator global::Cohere.DocumentSource?(Source @this) => @this.Document; /// /// /// - public Source(global::Cohere.ChatDocumentSource? value) + public Source(global::Cohere.DocumentSource? value) { - ChatDocument = value; + Document = value; } /// /// /// public Source( - global::Cohere.ChatToolSource? chatTool, - global::Cohere.ChatDocumentSource? chatDocument + global::Cohere.ToolSource? tool, + global::Cohere.DocumentSource? document ) { - ChatTool = chatTool; - ChatDocument = chatDocument; + Tool = tool; + Document = document; } /// /// /// public object? Object => - ChatDocument as object ?? - ChatTool as object + Document as object ?? + Tool as object ; /// /// /// public override string? ToString() => - ChatTool?.ToString() ?? - ChatDocument?.ToString() + Tool?.ToString() ?? + Document?.ToString() ; /// @@ -112,15 +112,15 @@ ChatTool as object /// public bool Validate() { - return IsChatTool && !IsChatDocument || !IsChatTool && IsChatDocument; + return IsTool && !IsDocument || !IsTool && IsDocument; } /// /// /// public TResult? Match( - global::System.Func? chatTool = null, - global::System.Func? chatDocument = null, + global::System.Func? tool = null, + global::System.Func? document = null, bool validate = true) { if (validate) @@ -128,13 +128,13 @@ public bool Validate() Validate(); } - if (IsChatTool && chatTool != null) + if (IsTool && tool != null) { - return chatTool(ChatTool!); + return tool(Tool!); } - else if (IsChatDocument && chatDocument != null) + else if (IsDocument && document != null) { - return chatDocument(ChatDocument!); + return document(Document!); } return default(TResult); @@ -144,8 +144,8 @@ public bool Validate() /// ///
public void Match( - global::System.Action? chatTool = null, - global::System.Action? chatDocument = null, + global::System.Action? tool = null, + global::System.Action? document = null, bool validate = true) { if (validate) @@ -153,13 +153,13 @@ public void Match( Validate(); } - if (IsChatTool) + if (IsTool) { - chatTool?.Invoke(ChatTool!); + tool?.Invoke(Tool!); } - else if (IsChatDocument) + else if (IsDocument) { - chatDocument?.Invoke(ChatDocument!); + document?.Invoke(Document!); } } @@ -170,10 +170,10 @@ public override int GetHashCode() { var fields = new object?[] { - ChatTool, - typeof(global::Cohere.ChatToolSource), - ChatDocument, - typeof(global::Cohere.ChatDocumentSource), + Tool, + typeof(global::Cohere.ToolSource), + Document, + typeof(global::Cohere.DocumentSource), }; const int offset = unchecked((int)2166136261); const int prime = 16777619; @@ -190,8 +190,8 @@ static int HashCodeAggregator(int hashCode, object? value) => value == null public bool Equals(Source other) { return - global::System.Collections.Generic.EqualityComparer.Default.Equals(ChatTool, other.ChatTool) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(ChatDocument, other.ChatDocument) + global::System.Collections.Generic.EqualityComparer.Default.Equals(Tool, other.Tool) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Document, other.Document) ; } diff --git a/src/libs/Cohere/Generated/Cohere.Models.SystemMessageV2.Json.g.cs b/src/libs/Cohere/Generated/Cohere.Models.SystemMessage.Json.g.cs similarity index 89% rename from src/libs/Cohere/Generated/Cohere.Models.SystemMessageV2.Json.g.cs rename to src/libs/Cohere/Generated/Cohere.Models.SystemMessage.Json.g.cs index 161addfa..d4dc8ae9 100644 --- a/src/libs/Cohere/Generated/Cohere.Models.SystemMessageV2.Json.g.cs +++ b/src/libs/Cohere/Generated/Cohere.Models.SystemMessage.Json.g.cs @@ -2,7 +2,7 @@ namespace Cohere { - public sealed partial class SystemMessageV2 + public sealed partial class SystemMessage { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -34,14 +34,14 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::Cohere.SystemMessageV2? FromJson( + public static global::Cohere.SystemMessage? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::Cohere.SystemMessageV2), - jsonSerializerContext) as global::Cohere.SystemMessageV2; + typeof(global::Cohere.SystemMessage), + jsonSerializerContext) as global::Cohere.SystemMessage; } /// @@ -51,11 +51,11 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::Cohere.SystemMessageV2? FromJson( + public static global::Cohere.SystemMessage? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -63,14 +63,14 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, - typeof(global::Cohere.SystemMessageV2), - jsonSerializerContext).ConfigureAwait(false)) as global::Cohere.SystemMessageV2; + typeof(global::Cohere.SystemMessage), + jsonSerializerContext).ConfigureAwait(false)) as global::Cohere.SystemMessage; } /// @@ -80,11 +80,11 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/Cohere/Generated/Cohere.Models.SystemMessageV2.g.cs b/src/libs/Cohere/Generated/Cohere.Models.SystemMessage.g.cs similarity index 84% rename from src/libs/Cohere/Generated/Cohere.Models.SystemMessageV2.g.cs rename to src/libs/Cohere/Generated/Cohere.Models.SystemMessage.g.cs index 2be9727c..c469bb5d 100644 --- a/src/libs/Cohere/Generated/Cohere.Models.SystemMessageV2.g.cs +++ b/src/libs/Cohere/Generated/Cohere.Models.SystemMessage.g.cs @@ -8,7 +8,7 @@ namespace Cohere /// /// A message from the system. /// - public sealed partial class SystemMessageV2 + public sealed partial class SystemMessage { /// /// @@ -22,8 +22,8 @@ public sealed partial class SystemMessageV2 /// /// [global::System.Text.Json.Serialization.JsonPropertyName("role")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Cohere.JsonConverters.SystemMessageV2RoleJsonConverter))] - public global::Cohere.SystemMessageV2Role Role { get; set; } + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Cohere.JsonConverters.SystemMessageRoleJsonConverter))] + public global::Cohere.SystemMessageRole Role { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -32,25 +32,25 @@ public sealed partial class SystemMessageV2 public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif - public SystemMessageV2( + public SystemMessage( global::Cohere.OneOf> content, - global::Cohere.SystemMessageV2Role role) + global::Cohere.SystemMessageRole role) { this.Content = content; this.Role = role; } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public SystemMessageV2() + public SystemMessage() { } } diff --git a/src/libs/Cohere/Generated/Cohere.Models.SystemMessageV2ContentVariant2ItemDiscriminator.Json.g.cs b/src/libs/Cohere/Generated/Cohere.Models.SystemMessageContentVariant2ItemDiscriminator.Json.g.cs similarity index 83% rename from src/libs/Cohere/Generated/Cohere.Models.SystemMessageV2ContentVariant2ItemDiscriminator.Json.g.cs rename to src/libs/Cohere/Generated/Cohere.Models.SystemMessageContentVariant2ItemDiscriminator.Json.g.cs index 910a8d49..09f9d372 100644 --- a/src/libs/Cohere/Generated/Cohere.Models.SystemMessageV2ContentVariant2ItemDiscriminator.Json.g.cs +++ b/src/libs/Cohere/Generated/Cohere.Models.SystemMessageContentVariant2ItemDiscriminator.Json.g.cs @@ -2,7 +2,7 @@ namespace Cohere { - public sealed partial class SystemMessageV2ContentVariant2ItemDiscriminator + public sealed partial class SystemMessageContentVariant2ItemDiscriminator { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -34,14 +34,14 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::Cohere.SystemMessageV2ContentVariant2ItemDiscriminator? FromJson( + public static global::Cohere.SystemMessageContentVariant2ItemDiscriminator? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::Cohere.SystemMessageV2ContentVariant2ItemDiscriminator), - jsonSerializerContext) as global::Cohere.SystemMessageV2ContentVariant2ItemDiscriminator; + typeof(global::Cohere.SystemMessageContentVariant2ItemDiscriminator), + jsonSerializerContext) as global::Cohere.SystemMessageContentVariant2ItemDiscriminator; } /// @@ -51,11 +51,11 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::Cohere.SystemMessageV2ContentVariant2ItemDiscriminator? FromJson( + public static global::Cohere.SystemMessageContentVariant2ItemDiscriminator? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -63,14 +63,14 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, - typeof(global::Cohere.SystemMessageV2ContentVariant2ItemDiscriminator), - jsonSerializerContext).ConfigureAwait(false)) as global::Cohere.SystemMessageV2ContentVariant2ItemDiscriminator; + typeof(global::Cohere.SystemMessageContentVariant2ItemDiscriminator), + jsonSerializerContext).ConfigureAwait(false)) as global::Cohere.SystemMessageContentVariant2ItemDiscriminator; } /// @@ -80,11 +80,11 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/Cohere/Generated/Cohere.Models.SystemMessageV2ContentVariant2ItemDiscriminator.g.cs b/src/libs/Cohere/Generated/Cohere.Models.SystemMessageContentVariant2ItemDiscriminator.g.cs similarity index 64% rename from src/libs/Cohere/Generated/Cohere.Models.SystemMessageV2ContentVariant2ItemDiscriminator.g.cs rename to src/libs/Cohere/Generated/Cohere.Models.SystemMessageContentVariant2ItemDiscriminator.g.cs index 1097a579..23c545b7 100644 --- a/src/libs/Cohere/Generated/Cohere.Models.SystemMessageV2ContentVariant2ItemDiscriminator.g.cs +++ b/src/libs/Cohere/Generated/Cohere.Models.SystemMessageContentVariant2ItemDiscriminator.g.cs @@ -6,14 +6,14 @@ namespace Cohere /// /// /// - public sealed partial class SystemMessageV2ContentVariant2ItemDiscriminator + public sealed partial class SystemMessageContentVariant2ItemDiscriminator { /// /// /// [global::System.Text.Json.Serialization.JsonPropertyName("type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Cohere.JsonConverters.SystemMessageV2ContentVariant2ItemDiscriminatorTypeJsonConverter))] - public global::Cohere.SystemMessageV2ContentVariant2ItemDiscriminatorType? Type { get; set; } + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Cohere.JsonConverters.SystemMessageContentVariant2ItemDiscriminatorTypeJsonConverter))] + public global::Cohere.SystemMessageContentVariant2ItemDiscriminatorType? Type { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -22,22 +22,22 @@ public sealed partial class SystemMessageV2ContentVariant2ItemDiscriminator public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif - public SystemMessageV2ContentVariant2ItemDiscriminator( - global::Cohere.SystemMessageV2ContentVariant2ItemDiscriminatorType? type) + public SystemMessageContentVariant2ItemDiscriminator( + global::Cohere.SystemMessageContentVariant2ItemDiscriminatorType? type) { this.Type = type; } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public SystemMessageV2ContentVariant2ItemDiscriminator() + public SystemMessageContentVariant2ItemDiscriminator() { } } diff --git a/src/libs/Cohere/Generated/Cohere.Models.SystemMessageV2ContentVariant2ItemDiscriminatorType.g.cs b/src/libs/Cohere/Generated/Cohere.Models.SystemMessageContentVariant2ItemDiscriminatorType.g.cs similarity index 59% rename from src/libs/Cohere/Generated/Cohere.Models.SystemMessageV2ContentVariant2ItemDiscriminatorType.g.cs rename to src/libs/Cohere/Generated/Cohere.Models.SystemMessageContentVariant2ItemDiscriminatorType.g.cs index 317dba77..c0274da8 100644 --- a/src/libs/Cohere/Generated/Cohere.Models.SystemMessageV2ContentVariant2ItemDiscriminatorType.g.cs +++ b/src/libs/Cohere/Generated/Cohere.Models.SystemMessageContentVariant2ItemDiscriminatorType.g.cs @@ -6,7 +6,7 @@ namespace Cohere /// /// /// - public enum SystemMessageV2ContentVariant2ItemDiscriminatorType + public enum SystemMessageContentVariant2ItemDiscriminatorType { /// /// @@ -17,27 +17,27 @@ public enum SystemMessageV2ContentVariant2ItemDiscriminatorType /// /// Enum extensions to do fast conversions without the reflection. /// - public static class SystemMessageV2ContentVariant2ItemDiscriminatorTypeExtensions + public static class SystemMessageContentVariant2ItemDiscriminatorTypeExtensions { /// /// Converts an enum to a string. /// - public static string ToValueString(this SystemMessageV2ContentVariant2ItemDiscriminatorType value) + public static string ToValueString(this SystemMessageContentVariant2ItemDiscriminatorType value) { return value switch { - SystemMessageV2ContentVariant2ItemDiscriminatorType.Text => "text", + SystemMessageContentVariant2ItemDiscriminatorType.Text => "text", _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), }; } /// /// Converts an string to a enum. /// - public static SystemMessageV2ContentVariant2ItemDiscriminatorType? ToEnum(string value) + public static SystemMessageContentVariant2ItemDiscriminatorType? ToEnum(string value) { return value switch { - "text" => SystemMessageV2ContentVariant2ItemDiscriminatorType.Text, + "text" => SystemMessageContentVariant2ItemDiscriminatorType.Text, _ => null, }; } diff --git a/src/libs/Cohere/Generated/Cohere.Models.SystemMessageV2Role.g.cs b/src/libs/Cohere/Generated/Cohere.Models.SystemMessageRole.g.cs similarity index 68% rename from src/libs/Cohere/Generated/Cohere.Models.SystemMessageV2Role.g.cs rename to src/libs/Cohere/Generated/Cohere.Models.SystemMessageRole.g.cs index b47b1886..749130df 100644 --- a/src/libs/Cohere/Generated/Cohere.Models.SystemMessageV2Role.g.cs +++ b/src/libs/Cohere/Generated/Cohere.Models.SystemMessageRole.g.cs @@ -6,7 +6,7 @@ namespace Cohere /// /// /// - public enum SystemMessageV2Role + public enum SystemMessageRole { /// /// @@ -17,27 +17,27 @@ public enum SystemMessageV2Role /// /// Enum extensions to do fast conversions without the reflection. /// - public static class SystemMessageV2RoleExtensions + public static class SystemMessageRoleExtensions { /// /// Converts an enum to a string. /// - public static string ToValueString(this SystemMessageV2Role value) + public static string ToValueString(this SystemMessageRole value) { return value switch { - SystemMessageV2Role.System => "system", + SystemMessageRole.System => "system", _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), }; } /// /// Converts an string to a enum. /// - public static SystemMessageV2Role? ToEnum(string value) + public static SystemMessageRole? ToEnum(string value) { return value switch { - "system" => SystemMessageV2Role.System, + "system" => SystemMessageRole.System, _ => null, }; } diff --git a/src/libs/Cohere/Generated/Cohere.Models.ChatTextContent.Json.g.cs b/src/libs/Cohere/Generated/Cohere.Models.TextContent.Json.g.cs similarity index 88% rename from src/libs/Cohere/Generated/Cohere.Models.ChatTextContent.Json.g.cs rename to src/libs/Cohere/Generated/Cohere.Models.TextContent.Json.g.cs index ce985240..22597dae 100644 --- a/src/libs/Cohere/Generated/Cohere.Models.ChatTextContent.Json.g.cs +++ b/src/libs/Cohere/Generated/Cohere.Models.TextContent.Json.g.cs @@ -2,7 +2,7 @@ namespace Cohere { - public sealed partial class ChatTextContent + public sealed partial class TextContent { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -34,14 +34,14 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::Cohere.ChatTextContent? FromJson( + public static global::Cohere.TextContent? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::Cohere.ChatTextContent), - jsonSerializerContext) as global::Cohere.ChatTextContent; + typeof(global::Cohere.TextContent), + jsonSerializerContext) as global::Cohere.TextContent; } /// @@ -51,11 +51,11 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::Cohere.ChatTextContent? FromJson( + public static global::Cohere.TextContent? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -63,14 +63,14 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, - typeof(global::Cohere.ChatTextContent), - jsonSerializerContext).ConfigureAwait(false)) as global::Cohere.ChatTextContent; + typeof(global::Cohere.TextContent), + jsonSerializerContext).ConfigureAwait(false)) as global::Cohere.TextContent; } /// @@ -80,11 +80,11 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/Cohere/Generated/Cohere.Models.ChatTextContent.g.cs b/src/libs/Cohere/Generated/Cohere.Models.TextContent.g.cs similarity index 74% rename from src/libs/Cohere/Generated/Cohere.Models.ChatTextContent.g.cs rename to src/libs/Cohere/Generated/Cohere.Models.TextContent.g.cs index 2e2e9ecb..1b5772f1 100644 --- a/src/libs/Cohere/Generated/Cohere.Models.ChatTextContent.g.cs +++ b/src/libs/Cohere/Generated/Cohere.Models.TextContent.g.cs @@ -6,7 +6,7 @@ namespace Cohere /// /// Text content of the message. /// - public sealed partial class ChatTextContent + public sealed partial class TextContent { /// /// @@ -19,8 +19,8 @@ public sealed partial class ChatTextContent /// /// [global::System.Text.Json.Serialization.JsonPropertyName("type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Cohere.JsonConverters.ChatTextContentTypeJsonConverter))] - public global::Cohere.ChatTextContentType Type { get; set; } + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Cohere.JsonConverters.TextContentTypeJsonConverter))] + public global::Cohere.TextContentType Type { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -29,25 +29,25 @@ public sealed partial class ChatTextContent public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif - public ChatTextContent( + public TextContent( string text, - global::Cohere.ChatTextContentType type) + global::Cohere.TextContentType type) { this.Text = text ?? throw new global::System.ArgumentNullException(nameof(text)); this.Type = type; } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public ChatTextContent() + public TextContent() { } } diff --git a/src/libs/Cohere/Generated/Cohere.Models.ChatTextContentType.g.cs b/src/libs/Cohere/Generated/Cohere.Models.TextContentType.g.cs similarity index 69% rename from src/libs/Cohere/Generated/Cohere.Models.ChatTextContentType.g.cs rename to src/libs/Cohere/Generated/Cohere.Models.TextContentType.g.cs index f78c5a49..b8c92a31 100644 --- a/src/libs/Cohere/Generated/Cohere.Models.ChatTextContentType.g.cs +++ b/src/libs/Cohere/Generated/Cohere.Models.TextContentType.g.cs @@ -6,7 +6,7 @@ namespace Cohere /// /// /// - public enum ChatTextContentType + public enum TextContentType { /// /// @@ -17,27 +17,27 @@ public enum ChatTextContentType /// /// Enum extensions to do fast conversions without the reflection. /// - public static class ChatTextContentTypeExtensions + public static class TextContentTypeExtensions { /// /// Converts an enum to a string. /// - public static string ToValueString(this ChatTextContentType value) + public static string ToValueString(this TextContentType value) { return value switch { - ChatTextContentType.Text => "text", + TextContentType.Text => "text", _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), }; } /// /// Converts an string to a enum. /// - public static ChatTextContentType? ToEnum(string value) + public static TextContentType? ToEnum(string value) { return value switch { - "text" => ChatTextContentType.Text, + "text" => TextContentType.Text, _ => null, }; } diff --git a/src/libs/Cohere/Generated/Cohere.Models.ChatDocumentSource.Json.g.cs b/src/libs/Cohere/Generated/Cohere.Models.TextResponseFormat.Json.g.cs similarity index 87% rename from src/libs/Cohere/Generated/Cohere.Models.ChatDocumentSource.Json.g.cs rename to src/libs/Cohere/Generated/Cohere.Models.TextResponseFormat.Json.g.cs index 26e9129a..ebb629be 100644 --- a/src/libs/Cohere/Generated/Cohere.Models.ChatDocumentSource.Json.g.cs +++ b/src/libs/Cohere/Generated/Cohere.Models.TextResponseFormat.Json.g.cs @@ -2,7 +2,7 @@ namespace Cohere { - public sealed partial class ChatDocumentSource + public sealed partial class TextResponseFormat { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -34,14 +34,14 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::Cohere.ChatDocumentSource? FromJson( + public static global::Cohere.TextResponseFormat? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::Cohere.ChatDocumentSource), - jsonSerializerContext) as global::Cohere.ChatDocumentSource; + typeof(global::Cohere.TextResponseFormat), + jsonSerializerContext) as global::Cohere.TextResponseFormat; } /// @@ -51,11 +51,11 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::Cohere.ChatDocumentSource? FromJson( + public static global::Cohere.TextResponseFormat? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -63,14 +63,14 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, - typeof(global::Cohere.ChatDocumentSource), - jsonSerializerContext).ConfigureAwait(false)) as global::Cohere.ChatDocumentSource; + typeof(global::Cohere.TextResponseFormat), + jsonSerializerContext).ConfigureAwait(false)) as global::Cohere.TextResponseFormat; } /// @@ -80,11 +80,11 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/Cohere/Generated/Cohere.Models.ChatTextResponseFormat.g.cs b/src/libs/Cohere/Generated/Cohere.Models.TextResponseFormat.g.cs similarity index 82% rename from src/libs/Cohere/Generated/Cohere.Models.ChatTextResponseFormat.g.cs rename to src/libs/Cohere/Generated/Cohere.Models.TextResponseFormat.g.cs index 7e8a025a..f5f44438 100644 --- a/src/libs/Cohere/Generated/Cohere.Models.ChatTextResponseFormat.g.cs +++ b/src/libs/Cohere/Generated/Cohere.Models.TextResponseFormat.g.cs @@ -6,7 +6,7 @@ namespace Cohere /// /// /// - public sealed partial class ChatTextResponseFormat + public sealed partial class TextResponseFormat { /// /// Defaults to `"text"`.
@@ -24,7 +24,7 @@ public sealed partial class ChatTextResponseFormat public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// /// Defaults to `"text"`.
@@ -33,16 +33,16 @@ public sealed partial class ChatTextResponseFormat #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif - public ChatTextResponseFormat( + public TextResponseFormat( global::Cohere.ResponseFormatType type) { this.Type = type; } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public ChatTextResponseFormat() + public TextResponseFormat() { } } diff --git a/src/libs/Cohere/Generated/Cohere.Models.TextResponseFormatV2.Json.g.cs b/src/libs/Cohere/Generated/Cohere.Models.TextResponseFormatV2.Json.g.cs new file mode 100644 index 00000000..b91d9900 --- /dev/null +++ b/src/libs/Cohere/Generated/Cohere.Models.TextResponseFormatV2.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Cohere +{ + public sealed partial class TextResponseFormatV2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Cohere.TextResponseFormatV2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Cohere.TextResponseFormatV2), + jsonSerializerContext) as global::Cohere.TextResponseFormatV2; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Cohere.TextResponseFormatV2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Cohere.TextResponseFormatV2), + jsonSerializerContext).ConfigureAwait(false)) as global::Cohere.TextResponseFormatV2; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Cohere/Generated/Cohere.Models.ChatTextResponseFormatV2.g.cs b/src/libs/Cohere/Generated/Cohere.Models.TextResponseFormatV2.g.cs similarity index 82% rename from src/libs/Cohere/Generated/Cohere.Models.ChatTextResponseFormatV2.g.cs rename to src/libs/Cohere/Generated/Cohere.Models.TextResponseFormatV2.g.cs index f28e4a8b..a48df62e 100644 --- a/src/libs/Cohere/Generated/Cohere.Models.ChatTextResponseFormatV2.g.cs +++ b/src/libs/Cohere/Generated/Cohere.Models.TextResponseFormatV2.g.cs @@ -6,7 +6,7 @@ namespace Cohere /// /// /// - public sealed partial class ChatTextResponseFormatV2 + public sealed partial class TextResponseFormatV2 { /// /// Defaults to `"text"`.
@@ -24,7 +24,7 @@ public sealed partial class ChatTextResponseFormatV2 public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// /// Defaults to `"text"`.
@@ -33,16 +33,16 @@ public sealed partial class ChatTextResponseFormatV2 #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif - public ChatTextResponseFormatV2( + public TextResponseFormatV2( global::Cohere.ResponseFormatTypeV2 type) { this.Type = type; } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public ChatTextResponseFormatV2() + public TextResponseFormatV2() { } } diff --git a/src/libs/Cohere/Generated/Cohere.Models.ToolContent.g.cs b/src/libs/Cohere/Generated/Cohere.Models.ToolContent.g.cs index e8baeb9d..8517df17 100644 --- a/src/libs/Cohere/Generated/Cohere.Models.ToolContent.g.cs +++ b/src/libs/Cohere/Generated/Cohere.Models.ToolContent.g.cs @@ -18,9 +18,9 @@ namespace Cohere /// Text content of the message. ///
#if NET6_0_OR_GREATER - public global::Cohere.ChatTextContent? Text { get; init; } + public global::Cohere.TextContent? Text { get; init; } #else - public global::Cohere.ChatTextContent? Text { get; } + public global::Cohere.TextContent? Text { get; } #endif /// @@ -34,17 +34,17 @@ namespace Cohere /// /// /// - public static implicit operator ToolContent(global::Cohere.ChatTextContent value) => new ToolContent((global::Cohere.ChatTextContent?)value); + public static implicit operator ToolContent(global::Cohere.TextContent value) => new ToolContent((global::Cohere.TextContent?)value); /// /// /// - public static implicit operator global::Cohere.ChatTextContent?(ToolContent @this) => @this.Text; + public static implicit operator global::Cohere.TextContent?(ToolContent @this) => @this.Text; /// /// /// - public ToolContent(global::Cohere.ChatTextContent? value) + public ToolContent(global::Cohere.TextContent? value) { Text = value; } @@ -89,7 +89,7 @@ public ToolContent(global::Cohere.DocumentContent? value) /// public ToolContent( global::Cohere.ToolContentDiscriminatorType? type, - global::Cohere.ChatTextContent? text, + global::Cohere.TextContent? text, global::Cohere.DocumentContent? document ) { @@ -127,7 +127,7 @@ public bool Validate() /// ///
public TResult? Match( - global::System.Func? text = null, + global::System.Func? text = null, global::System.Func? document = null, bool validate = true) { @@ -152,7 +152,7 @@ public bool Validate() /// ///
public void Match( - global::System.Action? text = null, + global::System.Action? text = null, global::System.Action? document = null, bool validate = true) { @@ -179,7 +179,7 @@ public override int GetHashCode() var fields = new object?[] { Text, - typeof(global::Cohere.ChatTextContent), + typeof(global::Cohere.TextContent), Document, typeof(global::Cohere.DocumentContent), }; @@ -198,7 +198,7 @@ static int HashCodeAggregator(int hashCode, object? value) => value == null public bool Equals(ToolContent other) { return - global::System.Collections.Generic.EqualityComparer.Default.Equals(Text, other.Text) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Text, other.Text) && global::System.Collections.Generic.EqualityComparer.Default.Equals(Document, other.Document) ; } diff --git a/src/libs/Cohere/Generated/Cohere.Models.ToolMessage.Json.g.cs b/src/libs/Cohere/Generated/Cohere.Models.ToolMessage.Json.g.cs new file mode 100644 index 00000000..7cb10e77 --- /dev/null +++ b/src/libs/Cohere/Generated/Cohere.Models.ToolMessage.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Cohere +{ + public sealed partial class ToolMessage + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Cohere.ToolMessage? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Cohere.ToolMessage), + jsonSerializerContext) as global::Cohere.ToolMessage; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Cohere.ToolMessage? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Cohere.ToolMessage), + jsonSerializerContext).ConfigureAwait(false)) as global::Cohere.ToolMessage; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Cohere/Generated/Cohere.Models.ChatToolMessage.g.cs b/src/libs/Cohere/Generated/Cohere.Models.ToolMessage.g.cs similarity index 87% rename from src/libs/Cohere/Generated/Cohere.Models.ChatToolMessage.g.cs rename to src/libs/Cohere/Generated/Cohere.Models.ToolMessage.g.cs index 0314f60e..7d5533ff 100644 --- a/src/libs/Cohere/Generated/Cohere.Models.ChatToolMessage.g.cs +++ b/src/libs/Cohere/Generated/Cohere.Models.ToolMessage.g.cs @@ -6,7 +6,7 @@ namespace Cohere /// /// Represents tool result in the chat history. /// - public sealed partial class ChatToolMessage + public sealed partial class ToolMessage { /// /// One of `CHATBOT`, `SYSTEM`, `TOOL` or `USER` to identify who the message is coming from. @@ -29,7 +29,7 @@ public sealed partial class ChatToolMessage public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// /// One of `CHATBOT`, `SYSTEM`, `TOOL` or `USER` to identify who the message is coming from. @@ -38,7 +38,7 @@ public sealed partial class ChatToolMessage #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif - public ChatToolMessage( + public ToolMessage( global::Cohere.ChatRole role, global::System.Collections.Generic.IList? toolResults) { @@ -47,9 +47,9 @@ public ChatToolMessage( } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public ChatToolMessage() + public ToolMessage() { } } diff --git a/src/libs/Cohere/Generated/Cohere.Models.ToolSource.Json.g.cs b/src/libs/Cohere/Generated/Cohere.Models.ToolSource.Json.g.cs new file mode 100644 index 00000000..5d14641f --- /dev/null +++ b/src/libs/Cohere/Generated/Cohere.Models.ToolSource.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Cohere +{ + public sealed partial class ToolSource + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Cohere.ToolSource? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Cohere.ToolSource), + jsonSerializerContext) as global::Cohere.ToolSource; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Cohere.ToolSource? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Cohere.ToolSource), + jsonSerializerContext).ConfigureAwait(false)) as global::Cohere.ToolSource; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Cohere/Generated/Cohere.Models.ChatToolSource.g.cs b/src/libs/Cohere/Generated/Cohere.Models.ToolSource.g.cs similarity index 83% rename from src/libs/Cohere/Generated/Cohere.Models.ChatToolSource.g.cs rename to src/libs/Cohere/Generated/Cohere.Models.ToolSource.g.cs index 898e5168..c2ef2f51 100644 --- a/src/libs/Cohere/Generated/Cohere.Models.ChatToolSource.g.cs +++ b/src/libs/Cohere/Generated/Cohere.Models.ToolSource.g.cs @@ -6,7 +6,7 @@ namespace Cohere /// /// /// - public sealed partial class ChatToolSource + public sealed partial class ToolSource { /// /// The unique identifier of the document @@ -27,7 +27,7 @@ public sealed partial class ChatToolSource public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// /// The unique identifier of the document @@ -36,7 +36,7 @@ public sealed partial class ChatToolSource #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif - public ChatToolSource( + public ToolSource( string? id, object? toolOutput) { @@ -45,9 +45,9 @@ public ChatToolSource( } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public ChatToolSource() + public ToolSource() { } } diff --git a/src/libs/Cohere/Generated/Cohere.Models.ToolSourceToolOutput.Json.g.cs b/src/libs/Cohere/Generated/Cohere.Models.ToolSourceToolOutput.Json.g.cs new file mode 100644 index 00000000..95154529 --- /dev/null +++ b/src/libs/Cohere/Generated/Cohere.Models.ToolSourceToolOutput.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Cohere +{ + public sealed partial class ToolSourceToolOutput + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Cohere.ToolSourceToolOutput? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Cohere.ToolSourceToolOutput), + jsonSerializerContext) as global::Cohere.ToolSourceToolOutput; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Cohere.ToolSourceToolOutput? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Cohere.ToolSourceToolOutput), + jsonSerializerContext).ConfigureAwait(false)) as global::Cohere.ToolSourceToolOutput; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Cohere/Generated/Cohere.Models.ChatDocumentSourceDocument.g.cs b/src/libs/Cohere/Generated/Cohere.Models.ToolSourceToolOutput.g.cs similarity index 88% rename from src/libs/Cohere/Generated/Cohere.Models.ChatDocumentSourceDocument.g.cs rename to src/libs/Cohere/Generated/Cohere.Models.ToolSourceToolOutput.g.cs index ae8ad305..fb5602a0 100644 --- a/src/libs/Cohere/Generated/Cohere.Models.ChatDocumentSourceDocument.g.cs +++ b/src/libs/Cohere/Generated/Cohere.Models.ToolSourceToolOutput.g.cs @@ -6,7 +6,7 @@ namespace Cohere /// /// /// - public sealed partial class ChatDocumentSourceDocument + public sealed partial class ToolSourceToolOutput { /// diff --git a/src/libs/Cohere/Generated/Cohere.Models.UserMessageV2.Json.g.cs b/src/libs/Cohere/Generated/Cohere.Models.UserMessage.Json.g.cs similarity index 89% rename from src/libs/Cohere/Generated/Cohere.Models.UserMessageV2.Json.g.cs rename to src/libs/Cohere/Generated/Cohere.Models.UserMessage.Json.g.cs index 25b42ee5..4ca949a8 100644 --- a/src/libs/Cohere/Generated/Cohere.Models.UserMessageV2.Json.g.cs +++ b/src/libs/Cohere/Generated/Cohere.Models.UserMessage.Json.g.cs @@ -2,7 +2,7 @@ namespace Cohere { - public sealed partial class UserMessageV2 + public sealed partial class UserMessage { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -34,14 +34,14 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::Cohere.UserMessageV2? FromJson( + public static global::Cohere.UserMessage? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::Cohere.UserMessageV2), - jsonSerializerContext) as global::Cohere.UserMessageV2; + typeof(global::Cohere.UserMessage), + jsonSerializerContext) as global::Cohere.UserMessage; } /// @@ -51,11 +51,11 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::Cohere.UserMessageV2? FromJson( + public static global::Cohere.UserMessage? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -63,14 +63,14 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, - typeof(global::Cohere.UserMessageV2), - jsonSerializerContext).ConfigureAwait(false)) as global::Cohere.UserMessageV2; + typeof(global::Cohere.UserMessage), + jsonSerializerContext).ConfigureAwait(false)) as global::Cohere.UserMessage; } /// @@ -80,11 +80,11 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/Cohere/Generated/Cohere.Models.UserMessageV2.g.cs b/src/libs/Cohere/Generated/Cohere.Models.UserMessage.g.cs similarity index 79% rename from src/libs/Cohere/Generated/Cohere.Models.UserMessageV2.g.cs rename to src/libs/Cohere/Generated/Cohere.Models.UserMessage.g.cs index ac9f22c5..7b56c169 100644 --- a/src/libs/Cohere/Generated/Cohere.Models.UserMessageV2.g.cs +++ b/src/libs/Cohere/Generated/Cohere.Models.UserMessage.g.cs @@ -8,23 +8,23 @@ namespace Cohere /// /// A message from the user. /// - public sealed partial class UserMessageV2 + public sealed partial class UserMessage { /// /// The content of the message. This can be a string or a list of content blocks.
/// If a string is provided, it will be treated as a text content block. ///
[global::System.Text.Json.Serialization.JsonPropertyName("content")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Cohere.JsonConverters.OneOfJsonConverter>))] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Cohere.JsonConverters.OneOfJsonConverter>))] [global::System.Text.Json.Serialization.JsonRequired] - public required global::Cohere.OneOf> Content { get; set; } + public required global::Cohere.OneOf> Content { get; set; } /// /// /// [global::System.Text.Json.Serialization.JsonPropertyName("role")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Cohere.JsonConverters.UserMessageV2RoleJsonConverter))] - public global::Cohere.UserMessageV2Role Role { get; set; } + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Cohere.JsonConverters.UserMessageRoleJsonConverter))] + public global::Cohere.UserMessageRole Role { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -33,7 +33,7 @@ public sealed partial class UserMessageV2 public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// /// The content of the message. This can be a string or a list of content blocks.
@@ -43,18 +43,18 @@ public sealed partial class UserMessageV2 #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif - public UserMessageV2( - global::Cohere.OneOf> content, - global::Cohere.UserMessageV2Role role) + public UserMessage( + global::Cohere.OneOf> content, + global::Cohere.UserMessageRole role) { this.Content = content; this.Role = role; } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public UserMessageV2() + public UserMessage() { } } diff --git a/src/libs/Cohere/Generated/Cohere.Models.UserMessageV2Role.g.cs b/src/libs/Cohere/Generated/Cohere.Models.UserMessageRole.g.cs similarity index 70% rename from src/libs/Cohere/Generated/Cohere.Models.UserMessageV2Role.g.cs rename to src/libs/Cohere/Generated/Cohere.Models.UserMessageRole.g.cs index 3b39b5f9..0999a544 100644 --- a/src/libs/Cohere/Generated/Cohere.Models.UserMessageV2Role.g.cs +++ b/src/libs/Cohere/Generated/Cohere.Models.UserMessageRole.g.cs @@ -6,7 +6,7 @@ namespace Cohere /// /// /// - public enum UserMessageV2Role + public enum UserMessageRole { /// /// @@ -17,27 +17,27 @@ public enum UserMessageV2Role /// /// Enum extensions to do fast conversions without the reflection. /// - public static class UserMessageV2RoleExtensions + public static class UserMessageRoleExtensions { /// /// Converts an enum to a string. /// - public static string ToValueString(this UserMessageV2Role value) + public static string ToValueString(this UserMessageRole value) { return value switch { - UserMessageV2Role.User => "user", + UserMessageRole.User => "user", _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), }; } /// /// Converts an string to a enum. /// - public static UserMessageV2Role? ToEnum(string value) + public static UserMessageRole? ToEnum(string value) { return value switch { - "user" => UserMessageV2Role.User, + "user" => UserMessageRole.User, _ => null, }; } diff --git a/src/libs/Cohere/openapi.yaml b/src/libs/Cohere/openapi.yaml index 5872732c..a789ca2d 100644 --- a/src/libs/Cohere/openapi.yaml +++ b/src/libs/Cohere/openapi.yaml @@ -17,7 +17,7 @@ servers: paths: /v1/chat: post: - summary: Chat + summary: Chat V1 API description: "Generates a text response to a user message.\nTo learn how to use the Chat API and RAG follow our [Text Generation guides](https://docs.cohere.com/docs/chat-api).\n" operationId: chat parameters: @@ -2145,7 +2145,7 @@ paths: text: tokenize me! :D /v1/embed: post: - summary: Embed + summary: Embed V1 API description: "This endpoint returns text and image embeddings. An embedding is a list of floating point numbers that captures semantic information about the content that it represents.\n\nEmbeddings can be used to create classifiers as well as empower semantic search. To learn more about embeddings, see the embedding page.\n\nIf you want to learn more how to use the embedding model, have a look at the [Semantic Search Guide](https://docs.cohere.com/docs/semantic-search)." operationId: embed parameters: @@ -6853,7 +6853,7 @@ paths: x-fern-sdk-method-name: get /v1/rerank: post: - summary: Rerank + summary: Rerank V1 API description: This endpoint takes in a query and a list of texts and produces an ordered array with each text assigned a relevance score. operationId: rerank parameters: @@ -7379,7 +7379,7 @@ paths: - 43 /v2/chat: post: - summary: Chat with the model + summary: Chat V2 API description: "Generates a text response to a user message and streams it down, token by token. To learn how to use the Chat API with streaming follow our [Text Generation guides](https://docs.cohere.com/v2/docs/chat-api).\n\nFollow the [Migration Guide](https://docs.cohere.com/v2/docs/migrating-v1-to-v2) for instructions on moving from API v1 to API v2.\n" operationId: chatv2 parameters: @@ -7555,10 +7555,10 @@ paths: - code: "import cohere\nimport asyncio\n\nco = cohere.AsyncClientV2()\n\n\nasync def main():\n response = await co.chat(\n model=\"command-a-03-2025\",\n messages=[cohere.UserChatMessageV2(content=\"hello world!\")],\n )\n\n print(response)\n\n\nasyncio.run(main())\n" name: Async sdk: python - - code: "package main\n\nimport (\n\t\"context\"\n\t\"log\"\n\t\"os\"\n\n\tcohere \"github.com/cohere-ai/cohere-go/v2\"\n\tclient \"github.com/cohere-ai/cohere-go/v2/client\"\n)\n\nfunc main() {\n\tco := client.NewClient(client.WithToken(os.Getenv(\"CO_API_KEY\")))\n\n\tresp, err := co.V2.Chat(\n\t\tcontext.TODO(),\n\t\t&cohere.V2ChatRequest{\n\t\t\tModel: \"command-a-03-2025\",\n\t\t\tMessages: cohere.ChatMessages{\n\t\t\t\t{\n\t\t\t\t\tRole: \"user\",\n\t\t\t\t\tUser: &cohere.UserMessageV2{Content: &cohere.UserMessageV2Content{\n\t\t\t\t\t\tString: \"Hello world!\",\n\t\t\t\t\t}},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t)\n\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tlog.Printf(\"%+v\", resp)\n}\n" + - code: "package main\n\nimport (\n\t\"context\"\n\t\"log\"\n\t\"os\"\n\n\tcohere \"github.com/cohere-ai/cohere-go/v2\"\n\tclient \"github.com/cohere-ai/cohere-go/v2/client\"\n)\n\nfunc main() {\n\tco := client.NewClient(client.WithToken(os.Getenv(\"CO_API_KEY\")))\n\n\tresp, err := co.V2.Chat(\n\t\tcontext.TODO(),\n\t\t&cohere.V2ChatRequest{\n\t\t\tModel: \"command-a-03-2025\",\n\t\t\tMessages: cohere.ChatMessages{\n\t\t\t\t{\n\t\t\t\t\tRole: \"user\",\n\t\t\t\t\tUser: &cohere.UserMessage{Content: &cohere.UserMessageContent{\n\t\t\t\t\t\tString: \"Hello world!\",\n\t\t\t\t\t}},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t)\n\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tlog.Printf(\"%+v\", resp)\n}\n" name: Default sdk: go - - code: "/* (C)2024 */\npackage chatv2post;\n\nimport com.cohere.api.Cohere;\nimport com.cohere.api.resources.v2.requests.V2ChatRequest;\nimport com.cohere.api.types.*;\nimport java.util.List;\n\npublic class Default {\n public static void main(String[] args) {\n Cohere cohere = Cohere.builder().clientName(\"snippet\").build();\n\n ChatResponse response =\n cohere\n .v2()\n .chat(\n V2ChatRequest.builder()\n .model(\"command-a-03-2025\")\n .messages(\n List.of(\n ChatMessageV2.user(\n UserMessageV2.builder()\n .content(UserMessageV2Content.of(\"Who discovered\" + \" gravity?\"))\n .build()),\n ChatMessageV2.assistant(\n AssistantMessage.builder()\n .content(\n AssistantMessageContent.of(\n \"The man\"\n + \" who is\"\n + \" widely\"\n + \" credited\"\n + \" with\"\n + \" discovering\"\n + \" gravity\"\n + \" is Sir\"\n + \" Isaac\"\n + \" Newton\"))\n .build())))\n .build());\n\n System.out.println(response);\n }\n}\n" + - code: "/* (C)2024 */\npackage chatv2post;\n\nimport com.cohere.api.Cohere;\nimport com.cohere.api.resources.v2.requests.V2ChatRequest;\nimport com.cohere.api.types.*;\nimport java.util.List;\n\npublic class Default {\n public static void main(String[] args) {\n Cohere cohere = Cohere.builder().clientName(\"snippet\").build();\n\n ChatResponse response =\n cohere\n .v2()\n .chat(\n V2ChatRequest.builder()\n .model(\"command-a-03-2025\")\n .messages(\n List.of(\n ChatMessageV2.user(\n UserMessage.builder()\n .content(UserMessageContent.of(\"Who discovered\" + \" gravity?\"))\n .build()),\n ChatMessageV2.assistant(\n AssistantMessage.builder()\n .content(\n AssistantMessageContent.of(\n \"The man\"\n + \" who is\"\n + \" widely\"\n + \" credited\"\n + \" with\"\n + \" discovering\"\n + \" gravity\"\n + \" is Sir\"\n + \" Isaac\"\n + \" Newton\"))\n .build())))\n .build());\n\n System.out.println(response);\n }\n}\n" name: Default sdk: java - code: "curl --request POST \\\n --url https://api.cohere.com/v2/chat \\\n --header 'accept: application/json' \\\n --header 'content-type: application/json' \\\n --header \"Authorization: bearer $CO_API_KEY\" \\\n --data '{\n \"model\": \"command-a-03-2025\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Hello world!\"\n }\n ]\n }'\n" @@ -7593,10 +7593,10 @@ paths: - code: "import cohere\n\nco = cohere.ClientV2()\n\nresponse = co.chat(\n model=\"command-a-03-2025\",\n documents=[\n {\"id\": \"1\", \"data\": {\"text\": \"Cohere is the best!\", \"title\": \"The best\"}}\n ],\n messages=[{\"role\": \"user\", \"content\": \"Who's the best?\"}],\n)\n\nprint(response)\n" name: Documents sdk: python - - code: "/* (C)2024 */\npackage chatv2post;\n\nimport com.cohere.api.Cohere;\nimport com.cohere.api.resources.v2.requests.V2ChatRequest;\nimport com.cohere.api.resources.v2.types.V2ChatRequestDocumentsItem;\nimport com.cohere.api.types.*;\nimport java.util.List;\n\npublic class Documents {\n public static void main(String[] args) {\n Cohere cohere = Cohere.builder().clientName(\"snippet\").build();\n\n ChatResponse response =\n cohere\n .v2()\n .chat(\n V2ChatRequest.builder()\n .model(\"command-a-03-2025\")\n .messages(\n List.of(\n ChatMessageV2.user(\n UserMessageV2.builder()\n .content(\n UserMessageV2Content.of(\"Who is\" + \" the most\" + \" popular?\"))\n .build())))\n .documents(\n List.of(\n V2ChatRequestDocumentsItem.of(\n \"↓ Skip to Main Content\\n\\n\"\n + \"Music industry – One step\"\n + \" closer to being\"\n + \" accurate\\n\\n\"\n + \"CSPC: Backstreet Boys\"\n + \" Popularity Analysis\\n\\n\"\n + \"Hernán Lopez Posted on\"\n + \" February 9, 2017 Posted in\"\n + \" CSPC 72 Comments Tagged\"\n + \" with Backstreet Boys, Boy\"\n + \" band\\n\\n\"\n + \"At one point, Backstreet\"\n + \" Boys defined success:\"\n + \" massive albums sales across\"\n + \" the globe, great singles\"\n + \" sales, plenty of chart\"\n + \" topping releases, hugely\"\n + \" hyped tours and tremendous\"\n + \" media coverage.\\n\\n\"\n + \"It is true that they\"\n + \" benefited from\"\n + \" extraordinarily good market\"\n + \" conditions in all markets.\"\n + \" After all, the all-time\"\n + \" record year for the music\"\n + \" business, as far as\"\n + \" revenues in billion dollars\"\n + \" are concerned, was actually\"\n + \" 1999. That is, back when\"\n + \" this five men group was at\"\n + \" its peak.\"),\n V2ChatRequestDocumentsItem.of(\n \"↓ Skip to Main Content\\n\\n\"\n + \"Music industry – One step\"\n + \" closer to being\"\n + \" accurate\\n\\n\"\n + \"CSPC: NSYNC Popularity\"\n + \" Analysis\\n\\n\"\n + \"MJD Posted on February 9,\"\n + \" 2018 Posted in CSPC 27\"\n + \" Comments Tagged with Boy\"\n + \" band, N'Sync\\n\\n\"\n + \"At the turn of the\"\n + \" millennium three teen acts\"\n + \" were huge in the US, the\"\n + \" Backstreet Boys, Britney\"\n + \" Spears and NSYNC. The\"\n + \" latter is the only one we\"\n + \" haven’t study so far. It\"\n + \" took 15 years and Adele to\"\n + \" break their record of 2,4\"\n + \" million units sold of No\"\n + \" Strings Attached in its\"\n + \" first week alone.\\n\\n\"\n + \"It wasn’t a fluke, as the\"\n + \" second fastest selling\"\n + \" album of the Soundscan era\"\n + \" prior 2015, was also theirs\"\n + \" since Celebrity debuted\"\n + \" with 1,88 million units\"\n + \" sold.\"),\n V2ChatRequestDocumentsItem.of(\n \" 1997, 1998, 2000 and 2001 also\"\n + \" rank amongst some of the\"\n + \" very best years.\\n\\n\"\n + \"Yet the way many music\"\n + \" consumers – especially\"\n + \" teenagers and young women’s\"\n + \" – embraced their output\"\n + \" deserves its own chapter.\"\n + \" If Jonas Brothers and more\"\n + \" recently One Direction\"\n + \" reached a great level of\"\n + \" popularity during the past\"\n + \" decade, the type of success\"\n + \" achieved by Backstreet Boys\"\n + \" is in a completely\"\n + \" different level as they\"\n + \" really dominated the\"\n + \" business for a few years\"\n + \" all over the world,\"\n + \" including in some countries\"\n + \" that were traditionally\"\n + \" hard to penetrate for\"\n + \" Western artists.\\n\\n\"\n + \"We will try to analyze the\"\n + \" extent of that hegemony\"\n + \" with this new article with\"\n + \" final results which will\"\n + \" more than surprise many\"\n + \" readers.\"),\n V2ChatRequestDocumentsItem.of(\n \" Was the teen group led by Justin\"\n + \" Timberlake really that big?\"\n + \" Was it only in the US where\"\n + \" they found success? Or were\"\n + \" they a global\"\n + \" phenomenon?\\n\\n\"\n + \"As usual, I’ll be using the\"\n + \" Commensurate Sales to\"\n + \" Popularity Concept in order\"\n + \" to relevantly gauge their\"\n + \" results. This concept will\"\n + \" not only bring you sales\"\n + \" information for all NSYNC‘s\"\n + \" albums, physical and\"\n + \" download singles, as well\"\n + \" as audio and video\"\n + \" streaming, but it will also\"\n + \" determine their true\"\n + \" popularity. If you are not\"\n + \" yet familiar with the CSPC\"\n + \" method, the next page\"\n + \" explains it with a short\"\n + \" video. I fully recommend\"\n + \" watching the video before\"\n + \" getting into the sales\"\n + \" figures.\")))\n .build());\n System.out.println(response);\n }\n}\n" + - code: "/* (C)2024 */\npackage chatv2post;\n\nimport com.cohere.api.Cohere;\nimport com.cohere.api.resources.v2.requests.V2ChatRequest;\nimport com.cohere.api.resources.v2.types.V2ChatRequestDocumentsItem;\nimport com.cohere.api.types.*;\nimport java.util.List;\n\npublic class Documents {\n public static void main(String[] args) {\n Cohere cohere = Cohere.builder().clientName(\"snippet\").build();\n\n ChatResponse response =\n cohere\n .v2()\n .chat(\n V2ChatRequest.builder()\n .model(\"command-a-03-2025\")\n .messages(\n List.of(\n ChatMessageV2.user(\n UserMessage.builder()\n .content(\n UserMessageContent.of(\"Who is\" + \" the most\" + \" popular?\"))\n .build())))\n .documents(\n List.of(\n V2ChatRequestDocumentsItem.of(\n \"↓ Skip to Main Content\\n\\n\"\n + \"Music industry – One step\"\n + \" closer to being\"\n + \" accurate\\n\\n\"\n + \"CSPC: Backstreet Boys\"\n + \" Popularity Analysis\\n\\n\"\n + \"Hernán Lopez Posted on\"\n + \" February 9, 2017 Posted in\"\n + \" CSPC 72 Comments Tagged\"\n + \" with Backstreet Boys, Boy\"\n + \" band\\n\\n\"\n + \"At one point, Backstreet\"\n + \" Boys defined success:\"\n + \" massive albums sales across\"\n + \" the globe, great singles\"\n + \" sales, plenty of chart\"\n + \" topping releases, hugely\"\n + \" hyped tours and tremendous\"\n + \" media coverage.\\n\\n\"\n + \"It is true that they\"\n + \" benefited from\"\n + \" extraordinarily good market\"\n + \" conditions in all markets.\"\n + \" After all, the all-time\"\n + \" record year for the music\"\n + \" business, as far as\"\n + \" revenues in billion dollars\"\n + \" are concerned, was actually\"\n + \" 1999. That is, back when\"\n + \" this five men group was at\"\n + \" its peak.\"),\n V2ChatRequestDocumentsItem.of(\n \"↓ Skip to Main Content\\n\\n\"\n + \"Music industry – One step\"\n + \" closer to being\"\n + \" accurate\\n\\n\"\n + \"CSPC: NSYNC Popularity\"\n + \" Analysis\\n\\n\"\n + \"MJD Posted on February 9,\"\n + \" 2018 Posted in CSPC 27\"\n + \" Comments Tagged with Boy\"\n + \" band, N'Sync\\n\\n\"\n + \"At the turn of the\"\n + \" millennium three teen acts\"\n + \" were huge in the US, the\"\n + \" Backstreet Boys, Britney\"\n + \" Spears and NSYNC. The\"\n + \" latter is the only one we\"\n + \" haven’t study so far. It\"\n + \" took 15 years and Adele to\"\n + \" break their record of 2,4\"\n + \" million units sold of No\"\n + \" Strings Attached in its\"\n + \" first week alone.\\n\\n\"\n + \"It wasn’t a fluke, as the\"\n + \" second fastest selling\"\n + \" album of the Soundscan era\"\n + \" prior 2015, was also theirs\"\n + \" since Celebrity debuted\"\n + \" with 1,88 million units\"\n + \" sold.\"),\n V2ChatRequestDocumentsItem.of(\n \" 1997, 1998, 2000 and 2001 also\"\n + \" rank amongst some of the\"\n + \" very best years.\\n\\n\"\n + \"Yet the way many music\"\n + \" consumers – especially\"\n + \" teenagers and young women’s\"\n + \" – embraced their output\"\n + \" deserves its own chapter.\"\n + \" If Jonas Brothers and more\"\n + \" recently One Direction\"\n + \" reached a great level of\"\n + \" popularity during the past\"\n + \" decade, the type of success\"\n + \" achieved by Backstreet Boys\"\n + \" is in a completely\"\n + \" different level as they\"\n + \" really dominated the\"\n + \" business for a few years\"\n + \" all over the world,\"\n + \" including in some countries\"\n + \" that were traditionally\"\n + \" hard to penetrate for\"\n + \" Western artists.\\n\\n\"\n + \"We will try to analyze the\"\n + \" extent of that hegemony\"\n + \" with this new article with\"\n + \" final results which will\"\n + \" more than surprise many\"\n + \" readers.\"),\n V2ChatRequestDocumentsItem.of(\n \" Was the teen group led by Justin\"\n + \" Timberlake really that big?\"\n + \" Was it only in the US where\"\n + \" they found success? Or were\"\n + \" they a global\"\n + \" phenomenon?\\n\\n\"\n + \"As usual, I’ll be using the\"\n + \" Commensurate Sales to\"\n + \" Popularity Concept in order\"\n + \" to relevantly gauge their\"\n + \" results. This concept will\"\n + \" not only bring you sales\"\n + \" information for all NSYNC‘s\"\n + \" albums, physical and\"\n + \" download singles, as well\"\n + \" as audio and video\"\n + \" streaming, but it will also\"\n + \" determine their true\"\n + \" popularity. If you are not\"\n + \" yet familiar with the CSPC\"\n + \" method, the next page\"\n + \" explains it with a short\"\n + \" video. I fully recommend\"\n + \" watching the video before\"\n + \" getting into the sales\"\n + \" figures.\")))\n .build());\n System.out.println(response);\n }\n}\n" name: Documents sdk: java - - code: "package main\n\nimport (\n\t\"context\"\n\t\"log\"\n\t\"os\"\n\n\tcohere \"github.com/cohere-ai/cohere-go/v2\"\n\tclient \"github.com/cohere-ai/cohere-go/v2/client\"\n)\n\nfunc main() {\n\tco := client.NewClient(client.WithToken(os.Getenv(\"CO_API_KEY\")))\n\n\tresp, err := co.V2.Chat(\n\t\tcontext.TODO(),\n\t\t&cohere.V2ChatRequest{\n\t\t\tModel: \"command-a-03-2025\",\n\t\t\tDocuments: []*cohere.V2ChatRequestDocumentsItem{\n\t\t\t\t{\n\t\t\t\t\tString: \"Cohere is the best!\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tMessages: cohere.ChatMessages{\n\t\t\t\t{\n\t\t\t\t\tRole: \"user\",\n\t\t\t\t\tUser: &cohere.UserMessageV2{Content: &cohere.UserMessageV2Content{\n\t\t\t\t\t\tString: \"Who's the best?\",\n\t\t\t\t\t}},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t)\n\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tlog.Printf(\"%+v\", resp)\n}\n" + - code: "package main\n\nimport (\n\t\"context\"\n\t\"log\"\n\t\"os\"\n\n\tcohere \"github.com/cohere-ai/cohere-go/v2\"\n\tclient \"github.com/cohere-ai/cohere-go/v2/client\"\n)\n\nfunc main() {\n\tco := client.NewClient(client.WithToken(os.Getenv(\"CO_API_KEY\")))\n\n\tresp, err := co.V2.Chat(\n\t\tcontext.TODO(),\n\t\t&cohere.V2ChatRequest{\n\t\t\tModel: \"command-a-03-2025\",\n\t\t\tDocuments: []*cohere.V2ChatRequestDocumentsItem{\n\t\t\t\t{\n\t\t\t\t\tString: \"Cohere is the best!\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tMessages: cohere.ChatMessages{\n\t\t\t\t{\n\t\t\t\t\tRole: \"user\",\n\t\t\t\t\tUser: &cohere.UserMessage{Content: &cohere.UserMessageContent{\n\t\t\t\t\t\tString: \"Who's the best?\",\n\t\t\t\t\t}},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t)\n\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tlog.Printf(\"%+v\", resp)\n}\n" name: Documents sdk: go - code: "curl --request POST \\\n --url https://api.cohere.com/v2/chat \\\n --header 'accept: application/json' \\\n --header 'content-type: application/json' \\\n --header \"Authorization: bearer $CO_API_KEY\" \\\n --data '{\n \"model\": \"command-a-03-2025\",\n \"documents\": [\n {\n \"id\": \"1\",\n \"data\": \"Cohere is the best!\"\n }\n ],\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Who's the best?\"\n }\n ]\n }'" @@ -7735,10 +7735,10 @@ paths: - code: "import cohere\n\nco = cohere.ClientV2()\n\nresponse = co.chat_stream(\n model=\"command-a-03-2025\",\n messages=[{\"role\": \"user\", \"content\": \"hello world!\"}],\n)\n\nfor event in response:\n if event.type == \"content-delta\":\n print(event.delta.message.content.text, end=\"\")\n" name: Streaming sdk: python - - code: "/* (C)2024 */\npackage chatv2post;\n\nimport com.cohere.api.Cohere;\nimport com.cohere.api.resources.v2.requests.V2ChatStreamRequest;\nimport com.cohere.api.types.*;\nimport java.util.List;\n\npublic class Stream {\n public static void main(String[] args) {\n Cohere cohere = Cohere.builder().clientName(\"snippet\").build();\n\n Iterable response =\n cohere\n .v2()\n .chatStream(\n V2ChatStreamRequest.builder()\n .model(\"command-a-03-2025\")\n .messages(\n List.of(\n ChatMessageV2.user(\n UserMessageV2.builder()\n .content(UserMessageV2Content.of(\"Who discovered\" + \" gravity?\"))\n .build()),\n ChatMessageV2.assistant(\n AssistantMessage.builder()\n .content(\n AssistantMessageContent.of(\n \"The man\"\n + \" who is\"\n + \" widely\"\n + \" credited\"\n + \" with\"\n + \" discovering\"\n + \" gravity\"\n + \" is Sir\"\n + \" Isaac\"\n + \" Newton\"))\n .build())))\n .build());\n\n for (StreamedChatResponseV2 chatResponse : response) {\n if (chatResponse.isContentDelta()) {\n System.out.println(\n chatResponse\n .getContentDelta()\n .flatMap(ChatContentDeltaEvent::getDelta)\n .flatMap(ChatContentDeltaEventDelta::getMessage)\n .flatMap(ChatContentDeltaEventDeltaMessage::getContent)\n .flatMap(ChatContentDeltaEventDeltaMessageContent::getText)\n .orElse(\"\"));\n }\n }\n\n System.out.println(response);\n }\n}\n" + - code: "/* (C)2024 */\npackage chatv2post;\n\nimport com.cohere.api.Cohere;\nimport com.cohere.api.resources.v2.requests.V2ChatStreamRequest;\nimport com.cohere.api.types.*;\nimport java.util.List;\n\npublic class Stream {\n public static void main(String[] args) {\n Cohere cohere = Cohere.builder().clientName(\"snippet\").build();\n\n Iterable response =\n cohere\n .v2()\n .chatStream(\n V2ChatStreamRequest.builder()\n .model(\"command-a-03-2025\")\n .messages(\n List.of(\n ChatMessageV2.user(\n UserMessage.builder()\n .content(UserMessageContent.of(\"Who discovered\" + \" gravity?\"))\n .build()),\n ChatMessageV2.assistant(\n AssistantMessage.builder()\n .content(\n AssistantMessageContent.of(\n \"The man\"\n + \" who is\"\n + \" widely\"\n + \" credited\"\n + \" with\"\n + \" discovering\"\n + \" gravity\"\n + \" is Sir\"\n + \" Isaac\"\n + \" Newton\"))\n .build())))\n .build());\n\n for (StreamedChatResponseV2 chatResponse : response) {\n if (chatResponse.isContentDelta()) {\n System.out.println(\n chatResponse\n .getContentDelta()\n .flatMap(ChatContentDeltaEvent::getDelta)\n .flatMap(ChatContentDeltaEventDelta::getMessage)\n .flatMap(ChatContentDeltaEventDeltaMessage::getContent)\n .flatMap(ChatContentDeltaEventDeltaMessageContent::getText)\n .orElse(\"\"));\n }\n }\n\n System.out.println(response);\n }\n}\n" name: Streaming sdk: java - - code: "package main\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"io\"\n\t\"log\"\n\t\"os\"\n\n\tcohere \"github.com/cohere-ai/cohere-go/v2\"\n\tclient \"github.com/cohere-ai/cohere-go/v2/client\"\n)\n\nfunc main() {\n\tco := client.NewClient(client.WithToken(os.Getenv(\"CO_API_KEY\")))\n\n\tresp, err := co.V2.ChatStream(\n\t\tcontext.TODO(),\n\t\t&cohere.V2ChatStreamRequest{\n\t\t\tModel: \"command-a-03-2025\",\n\t\t\tMessages: cohere.ChatMessages{\n\t\t\t\t{\n\t\t\t\t\tRole: \"user\",\n\t\t\t\t\tUser: &cohere.UserMessageV2{Content: &cohere.UserMessageV2Content{\n\t\t\t\t\t\tString: \"Hello world!\",\n\t\t\t\t\t}},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t)\n\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\t// Make sure to close the stream when you're done reading.\n\t// This is easily handled with defer.\n\tdefer resp.Close()\n\n\tfor {\n\t\tmessage, err := resp.Recv()\n\n\t\tif errors.Is(err, io.EOF) {\n\t\t\t// An io.EOF error means the server is done sending messages\n\t\t\t// and should be treated as a success.\n\t\t\tbreak\n\t\t}\n\n\t\tif message.ContentDelta != nil {\n\t\t\tlog.Printf(\"%+v\", resp)\n\t\t}\n\t}\n}\n" + - code: "package main\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"io\"\n\t\"log\"\n\t\"os\"\n\n\tcohere \"github.com/cohere-ai/cohere-go/v2\"\n\tclient \"github.com/cohere-ai/cohere-go/v2/client\"\n)\n\nfunc main() {\n\tco := client.NewClient(client.WithToken(os.Getenv(\"CO_API_KEY\")))\n\n\tresp, err := co.V2.ChatStream(\n\t\tcontext.TODO(),\n\t\t&cohere.V2ChatStreamRequest{\n\t\t\tModel: \"command-a-03-2025\",\n\t\t\tMessages: cohere.ChatMessages{\n\t\t\t\t{\n\t\t\t\t\tRole: \"user\",\n\t\t\t\t\tUser: &cohere.UserMessage{Content: &cohere.UserMessageContent{\n\t\t\t\t\t\tString: \"Hello world!\",\n\t\t\t\t\t}},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t)\n\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\t// Make sure to close the stream when you're done reading.\n\t// This is easily handled with defer.\n\tdefer resp.Close()\n\n\tfor {\n\t\tmessage, err := resp.Recv()\n\n\t\tif errors.Is(err, io.EOF) {\n\t\t\t// An io.EOF error means the server is done sending messages\n\t\t\t// and should be treated as a success.\n\t\t\tbreak\n\t\t}\n\n\t\tif message.ContentDelta != nil {\n\t\t\tlog.Printf(\"%+v\", resp)\n\t\t}\n\t}\n}\n" name: Streaming sdk: go - code: "curl --request POST \\\n --url https://api.cohere.com/v2/chat \\\n --header 'accept: application/json' \\\n --header 'content-type: application/json' \\\n --header \"Authorization: bearer $CO_API_KEY\" \\\n --data '{\n \"stream\": true,\n \"model\": \"command-a-03-2025\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Hello world!\"\n }\n ]\n }'\n" @@ -7866,7 +7866,7 @@ paths: - code: "/* (C)2024 */\npackage chatv2post;\n\nimport com.cohere.api.Cohere;\nimport com.cohere.api.resources.v2.requests.V2ChatRequest;\nimport com.cohere.api.types.*;\nimport java.util.List;\nimport java.util.Map;\n\npublic class Tools {\n public static void main(String[] args) {\n Cohere cohere = Cohere.builder().clientName(\"snippet\").build();\n\n ChatResponse response =\n cohere\n .v2()\n .chat(\n V2ChatRequest.builder()\n .model(\"command-a-03-2025\")\n .tools(\n List.of(\n ToolV2.builder()\n .function(\n ToolV2Function.builder()\n .name(\"query_daily_sales_report\")\n .description(\n \"Connects\"\n + \" to a\"\n + \" database\"\n + \" to retrieve\"\n + \" overall\"\n + \" sales\"\n + \" volumes\"\n + \" and sales\"\n + \" information\"\n + \" for a\"\n + \" given\"\n + \" day.\")\n .parameters(\n Map.of(\n \"day\",\n ToolParameterDefinitionsValue.builder()\n .type(\"str\")\n .description(\n \"Retrieves\"\n + \" sales\"\n + \" data\"\n + \" for this\"\n + \" day,\"\n + \" formatted\"\n + \" as YYYY-MM-DD.\")\n .required(true)\n .build()))\n .build())\n .build(),\n ToolV2.builder()\n .function(\n ToolV2Function.builder()\n .name(\"query_product_catalog\")\n .description(\n \"Connects\"\n + \" to a\"\n + \" a product\"\n + \" catalog\"\n + \" with\"\n + \" information\"\n + \" about\"\n + \" all the\"\n + \" products\"\n + \" being\"\n + \" sold,\"\n + \" including\"\n + \" categories,\"\n + \" prices,\"\n + \" and stock\"\n + \" levels.\")\n .parameters(\n Map.of(\n \"category\",\n ToolParameterDefinitionsValue.builder()\n .type(\"str\")\n .description(\n \"Retrieves\"\n + \" product\"\n + \" information\"\n + \" data\"\n + \" for all\"\n + \" products\"\n + \" in this\"\n + \" category.\")\n .required(true)\n .build()))\n .build())\n .build()))\n .build());\n\n System.out.println(response);\n }\n}\n" name: Tools sdk: java - - code: "package main\n\nimport (\n\t\"context\"\n\t\"log\"\n\t\"os\"\n\n\tcohere \"github.com/cohere-ai/cohere-go/v2\"\n\tclient \"github.com/cohere-ai/cohere-go/v2/client\"\n)\n\nfunc main() {\n\tco := client.NewClient(client.WithToken(os.Getenv(\"CO_API_KEY\")))\n\n\tresp, err := co.V2.Chat(\n\t\tcontext.TODO(),\n\t\t&cohere.V2ChatRequest{\n\t\t\tModel: \"command-a-03-2025\",\n\t\t\tTools: []*cohere.ToolV2{\n\t\t\t\t{\n\t\t\t\t\tType: cohere.String(\"function\"),\n\t\t\t\t\tFunction: &cohere.ToolV2Function{\n\t\t\t\t\t\tName: \"query_daily_sales_report\",\n\t\t\t\t\t\tDescription: cohere.String(\"Connects to a database to retrieve overall sales volumes and sales information for a given day.\"),\n\t\t\t\t\t\tParameters: map[string]interface{}{\n\t\t\t\t\t\t\t\"type\": \"object\",\n\t\t\t\t\t\t\t\"properties\": map[string]interface{}{\n\t\t\t\t\t\t\t\t\"date\": map[string]interface{}{\n\t\t\t\t\t\t\t\t\t\"type\": \"string\",\n\t\t\t\t\t\t\t\t\t\"description\": \"Retrieves sales data from this day, formatted as YYYY-MM-DD\",\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"required\": []string{\"date\"},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tType: cohere.String(\"function\"),\n\t\t\t\t\tFunction: &cohere.ToolV2Function{\n\t\t\t\t\t\tName: \"query_product_catalog\",\n\t\t\t\t\t\tDescription: cohere.String(\"Connects to a a product catalog with information about all the products being sold, including categories, prices, and stock levels.\"),\n\t\t\t\t\t\tParameters: map[string]interface{}{\n\t\t\t\t\t\t\t\"type\": \"object\",\n\t\t\t\t\t\t\t\"properties\": map[string]interface{}{\n\t\t\t\t\t\t\t\t\"category\": map[string]interface{}{\n\t\t\t\t\t\t\t\t\t\"type\": \"string\",\n\t\t\t\t\t\t\t\t\t\"description\": \"Retrieves product information data for all products in this category.\",\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"required\": []string{\"category\"},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tMessages: cohere.ChatMessages{\n\t\t\t\t{\n\t\t\t\t\tRole: \"user\",\n\t\t\t\t\tUser: &cohere.UserMessageV2{Content: &cohere.UserMessageV2Content{\n\t\t\t\t\t\tString: \"Can you provide a sales summary for 29th September 2023, and also give me some details about the products in the 'Electronics' category, for example their prices and stock levels?\",\n\t\t\t\t\t}},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t)\n\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tlog.Printf(\"%+v\", resp)\n}\n" + - code: "package main\n\nimport (\n\t\"context\"\n\t\"log\"\n\t\"os\"\n\n\tcohere \"github.com/cohere-ai/cohere-go/v2\"\n\tclient \"github.com/cohere-ai/cohere-go/v2/client\"\n)\n\nfunc main() {\n\tco := client.NewClient(client.WithToken(os.Getenv(\"CO_API_KEY\")))\n\n\tresp, err := co.V2.Chat(\n\t\tcontext.TODO(),\n\t\t&cohere.V2ChatRequest{\n\t\t\tModel: \"command-a-03-2025\",\n\t\t\tTools: []*cohere.ToolV2{\n\t\t\t\t{\n\t\t\t\t\tType: cohere.String(\"function\"),\n\t\t\t\t\tFunction: &cohere.ToolV2Function{\n\t\t\t\t\t\tName: \"query_daily_sales_report\",\n\t\t\t\t\t\tDescription: cohere.String(\"Connects to a database to retrieve overall sales volumes and sales information for a given day.\"),\n\t\t\t\t\t\tParameters: map[string]interface{}{\n\t\t\t\t\t\t\t\"type\": \"object\",\n\t\t\t\t\t\t\t\"properties\": map[string]interface{}{\n\t\t\t\t\t\t\t\t\"date\": map[string]interface{}{\n\t\t\t\t\t\t\t\t\t\"type\": \"string\",\n\t\t\t\t\t\t\t\t\t\"description\": \"Retrieves sales data from this day, formatted as YYYY-MM-DD\",\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"required\": []string{\"date\"},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tType: cohere.String(\"function\"),\n\t\t\t\t\tFunction: &cohere.ToolV2Function{\n\t\t\t\t\t\tName: \"query_product_catalog\",\n\t\t\t\t\t\tDescription: cohere.String(\"Connects to a a product catalog with information about all the products being sold, including categories, prices, and stock levels.\"),\n\t\t\t\t\t\tParameters: map[string]interface{}{\n\t\t\t\t\t\t\t\"type\": \"object\",\n\t\t\t\t\t\t\t\"properties\": map[string]interface{}{\n\t\t\t\t\t\t\t\t\"category\": map[string]interface{}{\n\t\t\t\t\t\t\t\t\t\"type\": \"string\",\n\t\t\t\t\t\t\t\t\t\"description\": \"Retrieves product information data for all products in this category.\",\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"required\": []string{\"category\"},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tMessages: cohere.ChatMessages{\n\t\t\t\t{\n\t\t\t\t\tRole: \"user\",\n\t\t\t\t\tUser: &cohere.UserMessage{Content: &cohere.UserMessageContent{\n\t\t\t\t\t\tString: \"Can you provide a sales summary for 29th September 2023, and also give me some details about the products in the 'Electronics' category, for example their prices and stock levels?\",\n\t\t\t\t\t}},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t)\n\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tlog.Printf(\"%+v\", resp)\n}\n" name: Tools sdk: go - code: "curl --request POST \\\n --url https://api.cohere.com/v2/chat \\\n --header 'accept: application/json' \\\n --header 'content-type: application/json' \\\n --header \"Authorization: bearer $CO_API_KEY\" \\\n --data '{\n \"model\": \"command-a-03-2025\",\n \"tools\": [\n {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"query_daily_sales_report\",\n \"description\": \"Connects to a database to retrieve overall sales volumes and sales information for a given day.\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"day\": {\n \"description\": \"Retrieves sales data for this day, formatted as YYYY-MM-DD.\",\n \"type\": \"string\"\n }\n }\n }\n }\n },\n {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"query_product_catalog\",\n \"description\": \"Connects to a a product catalog with information about all the products being sold, including categories, prices, and stock levels.\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"category\": {\n \"description\": \"Retrieves product information data for all products in this category.\",\n \"type\": \"string\"\n }\n }\n }\n }\n }\n ],\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Can you provide a sales summary for 29th September 2023, and also give me some details about the products in the 'Electronics' category, for example their prices and stock levels?\"\n }\n ]\n }'\n" @@ -7935,14 +7935,57 @@ paths: x-fern-streaming: format: sse response: - $ref: '#/components/schemas/ChatResponse' + properties: + finish_reason: + $ref: '#/components/schemas/ChatFinishReason' + id: + description: Unique identifier for the generated reply. Useful for submitting feedback. + type: string + logprobs: + items: + $ref: '#/components/schemas/LogprobItem' + type: array + message: + $ref: '#/components/schemas/AssistantMessageResponse' + usage: + $ref: '#/components/schemas/Usage' + required: + - id + - finish_reason + - message response-stream: - $ref: '#/components/schemas/StreamedChatResponseV2' + description: StreamedChatResponse is returned in streaming mode (specified with `stream=True` in the request). + discriminator: + mapping: + citation-end: '#/components/schemas/CitationEndEvent' + citation-start: '#/components/schemas/CitationStartEvent' + content-delta: '#/components/schemas/ChatContentDeltaEvent' + content-end: '#/components/schemas/ChatContentEndEvent' + content-start: '#/components/schemas/ChatContentStartEvent' + debug: '#/components/schemas/ChatDebugEvent' + message-end: '#/components/schemas/ChatMessageEndEvent' + message-start: '#/components/schemas/ChatMessageStartEvent' + tool-call-delta: '#/components/schemas/ChatToolCallDeltaEvent' + tool-call-end: '#/components/schemas/ChatToolCallEndEvent' + tool-call-start: '#/components/schemas/ChatToolCallStartEvent' + tool-plan-delta: '#/components/schemas/ChatToolPlanDeltaEvent' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ChatMessageStartEvent' + - $ref: '#/components/schemas/ChatContentStartEvent' + - $ref: '#/components/schemas/ChatContentDeltaEvent' + - $ref: '#/components/schemas/ChatContentEndEvent' + - $ref: '#/components/schemas/ChatToolPlanDeltaEvent' + - $ref: '#/components/schemas/ChatToolCallStartEvent' + - $ref: '#/components/schemas/ChatToolCallDeltaEvent' + - $ref: '#/components/schemas/ChatToolCallEndEvent' + - $ref: '#/components/schemas/ChatMessageEndEvent' + - $ref: '#/components/schemas/ChatDebugEvent' stream-condition: $request.stream stream-description: "Generates a text response to a user message. To learn how to use the Chat API and RAG follow our [Text Generation guides](https://docs.cohere.com/v2/docs/chat-api).\n\nFollow the [Migration Guide](https://docs.cohere.com/v2/docs/migrating-v1-to-v2) for instructions on moving from API v1 to API v2.\n" /v2/embed: post: - summary: Embed + summary: Embed V2 API description: "This endpoint returns text embeddings. An embedding is a list of floating point numbers that captures semantic information about the text that it represents.\n\nEmbeddings can be used to create text classifiers as well as empower semantic search. To learn more about embeddings, see the embedding page.\n\nIf you want to learn more how to use the embedding model, have a look at the [Semantic Search Guide](https://docs.cohere.com/docs/semantic-search)." operationId: embedv2 parameters: @@ -11229,7 +11272,7 @@ paths: x-fern-sdk-method-name: embed /v2/rerank: post: - summary: Rerank + summary: Rerank V2 API description: This endpoint takes in a query and a list of texts and produces an ordered array with each text assigned a relevance score. operationId: rerankv2 parameters: @@ -11489,11 +11532,11 @@ components: - type: array items: oneOf: - - $ref: '#/components/schemas/ChatTextContent' + - $ref: '#/components/schemas/TextContent' discriminator: propertyName: type mapping: - text: '#/components/schemas/ChatTextContent' + text: '#/components/schemas/TextContent' role: enum: - assistant @@ -11520,11 +11563,11 @@ components: type: array items: oneOf: - - $ref: '#/components/schemas/ChatTextContent' + - $ref: '#/components/schemas/TextContent' discriminator: propertyName: type mapping: - text: '#/components/schemas/ChatTextContent' + text: '#/components/schemas/TextContent' role: enum: - assistant @@ -11779,17 +11822,6 @@ components: description: "Relevant information that could be used by the model to generate a more accurate reply.\nThe contents of each document are generally short (under 300 words), and are passed in the form of a\ndictionary of strings. Some suggested keys are \"text\", \"author\", \"date\". Both the key name and the value will be\npassed to the model.\n" x-fern-type: 'map' x-fern-type-name: ChatDocument - ChatDocumentSource: - type: object - properties: - document: - type: object - x-fern-type-name: ChatDocumentSource-w70a62 - id: - type: string - description: The unique identifier of the document - description: A document source object containing the unique identifier of the document and the document itself. - x-fern-type-name: ChatDocumentSource ChatFinishReason: enum: - COMPLETE @@ -11870,18 +11902,18 @@ components: x-fern-type-name: ChatMessageStartEvent ChatMessageV2: oneOf: - - $ref: '#/components/schemas/UserMessageV2' + - $ref: '#/components/schemas/UserMessage' - $ref: '#/components/schemas/AssistantMessage' - - $ref: '#/components/schemas/SystemMessageV2' + - $ref: '#/components/schemas/SystemMessage' - $ref: '#/components/schemas/ToolMessageV2' description: Represents a single message in the chat history from a given role. discriminator: propertyName: role mapping: assistant: '#/components/schemas/AssistantMessage' - system: '#/components/schemas/SystemMessageV2' + system: '#/components/schemas/SystemMessage' tool: '#/components/schemas/ToolMessageV2' - user: '#/components/schemas/UserMessageV2' + user: '#/components/schemas/UserMessage' x-fern-type-name: ChatMessageV2 ChatMessages: type: array @@ -12096,20 +12128,6 @@ components: - public x-fern-type-name: ChatStreamStartEvent-5v9jyv x-fern-type-name: ChatStreamStartEvent - ChatTextContent: - required: - - type - - text - type: object - properties: - text: - type: string - type: - enum: - - text - type: string - description: Text content of the message. - x-fern-type-name: ChatTextContent ChatTextGenerationEvent: allOf: - $ref: '#/components/schemas/ChatStreamEvent' @@ -12125,27 +12143,6 @@ components: - public x-fern-type-name: ChatTextGenerationEvent-8yyj22 x-fern-type-name: ChatTextGenerationEvent - ChatTextResponseFormat: - title: Text Response - required: - - type - type: object - properties: - type: - $ref: '#/components/schemas/ResponseFormatType' - x-fern-audiences: - - public - x-fern-type-name: ChatTextResponseFormat - ChatTextResponseFormatV2: - required: - - type - type: object - properties: - type: - $ref: '#/components/schemas/ResponseFormatTypeV2' - x-fern-audiences: - - public - x-fern-type-name: ChatTextResponseFormatV2 ChatToolCallDeltaEvent: allOf: - $ref: '#/components/schemas/ChatStreamEventType' @@ -12239,18 +12236,6 @@ components: - public x-fern-type-name: ChatToolCallsGenerationEvent-nykiww x-fern-type-name: ChatToolCallsGenerationEvent - ChatToolMessage: - required: - - role - properties: - role: - $ref: '#/components/schemas/ChatRole' - tool_results: - type: array - items: - $ref: '#/components/schemas/ToolResult' - description: "Represents tool result in the chat history.\n" - x-fern-type-name: ChatToolMessage ChatToolPlanDeltaEvent: allOf: - $ref: '#/components/schemas/ChatStreamEventType' @@ -12269,17 +12254,6 @@ components: x-fern-type-name: ChatToolPlanDeltaEvent-2obfex description: A streamed event which contains a delta of tool plan text. x-fern-type-name: ChatToolPlanDeltaEvent - ChatToolSource: - title: Tool Output - type: object - properties: - id: - type: string - description: The unique identifier of the document - tool_output: - type: object - x-fern-type-name: ChatToolSource-z53ra6 - x-fern-type-name: ChatToolSource Citation: type: object properties: @@ -12572,6 +12546,17 @@ components: x-fern-audiences: - public x-fern-type-name: ConnectorOAuth + Content: + oneOf: + - $ref: '#/components/schemas/TextContent' + - $ref: '#/components/schemas/ImageContent' + description: A Content block which contains information about the content type and the content itself. + discriminator: + propertyName: type + mapping: + image_url: '#/components/schemas/ImageContent' + text: '#/components/schemas/TextContent' + x-fern-type-name: Content ContentType: enum: - text @@ -13000,11 +12985,21 @@ components: type: string description: Document content. x-fern-type-name: DocumentContent + DocumentSource: + type: object + properties: + document: + type: object + x-fern-type-name: DocumentSource-w70a62 + id: + type: string + description: The unique identifier of the document + description: A document source object containing the unique identifier of the document and the document itself. + x-fern-type-name: DocumentSource EmbedByTypeResponse: required: - id - embeddings - - texts - api_version type: object properties: @@ -16316,26 +16311,15 @@ components: Message: oneOf: - $ref: '#/components/schemas/ChatMessage' - - $ref: '#/components/schemas/ChatToolMessage' + - $ref: '#/components/schemas/ToolMessage' discriminator: propertyName: role mapping: CHATBOT: '#/components/schemas/ChatMessage' SYSTEM: '#/components/schemas/ChatMessage' - TOOL: '#/components/schemas/ChatToolMessage' + TOOL: '#/components/schemas/ToolMessage' USER: '#/components/schemas/ChatMessage' x-fern-type-name: Message - MessageContent: - oneOf: - - $ref: '#/components/schemas/ChatTextContent' - - $ref: '#/components/schemas/ImageContent' - description: A Content block which contains information about the content type and the content itself. - discriminator: - propertyName: type - mapping: - image_url: '#/components/schemas/ImageContent' - text: '#/components/schemas/ChatTextContent' - x-fern-type-name: Content Metrics: type: object properties: @@ -16505,14 +16489,14 @@ components: x-fern-type-name: RerankerDataMetrics ResponseFormat: oneOf: - - $ref: '#/components/schemas/ChatTextResponseFormat' + - $ref: '#/components/schemas/TextResponseFormat' - $ref: '#/components/schemas/JSONResponseFormat' description: "Configuration for forcing the model output to adhere to the specified format. Supported on [Command R 03-2024](https://docs.cohere.com/docs/command-r), [Command R+ 04-2024](https://docs.cohere.com/docs/command-r-plus) and newer models.\n\nThe model can be forced into outputting JSON objects (with up to 5 levels of nesting) by setting `{ \"type\": \"json_object\" }`.\n\nA [JSON Schema](https://json-schema.org/) can optionally be provided, to ensure a specific structure.\n\n**Note**: When using `{ \"type\": \"json_object\" }` your `message` should always explicitly instruct the model to generate a JSON (eg: _\"Generate a JSON ...\"_) . Otherwise the model may end up getting stuck generating an infinite stream of characters and eventually run out of context length.\n**Limitation**: The parameter is not supported in RAG mode (when any of `connectors`, `documents`, `tools`, `tool_results` are provided).\n" discriminator: propertyName: type mapping: json_object: '#/components/schemas/JSONResponseFormat' - text: '#/components/schemas/ChatTextResponseFormat' + text: '#/components/schemas/TextResponseFormat' x-fern-type-name: ResponseFormat ResponseFormatType: enum: @@ -16534,14 +16518,14 @@ components: x-fern-type-name: ResponseFormatTypeV2 ResponseFormatV2: oneOf: - - $ref: '#/components/schemas/ChatTextResponseFormatV2' + - $ref: '#/components/schemas/TextResponseFormatV2' - $ref: '#/components/schemas/JsonResponseFormatV2' description: "Configuration for forcing the model output to adhere to the specified format. Supported on [Command R](https://docs.cohere.com/v2/docs/command-r), [Command R+](https://docs.cohere.com/v2/docs/command-r-plus) and newer models.\n\nThe model can be forced into outputting JSON objects by setting `{ \"type\": \"json_object\" }`.\n\nA [JSON Schema](https://json-schema.org/) can optionally be provided, to ensure a specific structure.\n\n**Note**: When using `{ \"type\": \"json_object\" }` your `message` should always explicitly instruct the model to generate a JSON (eg: _\"Generate a JSON ...\"_) . Otherwise the model may end up getting stuck generating an infinite stream of characters and eventually run out of context length.\n\n**Note**: When `json_schema` is not specified, the generated object can have up to 5 layers of nesting.\n\n**Limitation**: The parameter is not supported when used in combinations with the `documents` or `tools` parameters.\n" discriminator: propertyName: type mapping: json_object: '#/components/schemas/JsonResponseFormatV2' - text: '#/components/schemas/ChatTextResponseFormatV2' + text: '#/components/schemas/TextResponseFormatV2' x-fern-type-name: ResponseFormatV2 Settings: required: @@ -16639,8 +16623,8 @@ components: x-fern-type-name: SingleGenerationInStream Source: oneOf: - - $ref: '#/components/schemas/ChatToolSource' - - $ref: '#/components/schemas/ChatDocumentSource' + - $ref: '#/components/schemas/ToolSource' + - $ref: '#/components/schemas/DocumentSource' description: A source object containing information about the source of the data cited. x-fern-type-name: Source Status: @@ -16724,7 +16708,7 @@ components: tool-call-end: '#/components/schemas/ChatToolCallEndEvent' tool-call-start: '#/components/schemas/ChatToolCallStartEvent' tool-plan-delta: '#/components/schemas/ChatToolPlanDeltaEvent' - SystemMessageV2: + SystemMessage: title: System Message required: - role @@ -16737,17 +16721,52 @@ components: - type: array items: oneOf: - - $ref: '#/components/schemas/ChatTextContent' + - $ref: '#/components/schemas/TextContent' discriminator: propertyName: type mapping: - text: '#/components/schemas/ChatTextContent' + text: '#/components/schemas/TextContent' role: enum: - system type: string description: A message from the system. - x-fern-type-name: SystemMessageV2 + x-fern-type-name: SystemMessage + TextContent: + required: + - type + - text + type: object + properties: + text: + type: string + type: + enum: + - text + type: string + description: Text content of the message. + x-fern-type-name: TextContent + TextResponseFormat: + title: Text Response + required: + - type + type: object + properties: + type: + $ref: '#/components/schemas/ResponseFormatType' + x-fern-audiences: + - public + x-fern-type-name: TextResponseFormat + TextResponseFormatV2: + required: + - type + type: object + properties: + type: + $ref: '#/components/schemas/ResponseFormatTypeV2' + x-fern-audiences: + - public + x-fern-type-name: TextResponseFormatV2 TokenLikelihood: type: object properties: @@ -16865,15 +16884,27 @@ components: x-fern-type-name: ToolCallV2 ToolContent: oneOf: - - $ref: '#/components/schemas/ChatTextContent' + - $ref: '#/components/schemas/TextContent' - $ref: '#/components/schemas/DocumentContent' description: A content block which contains information about the content of a tool result discriminator: propertyName: type mapping: document: '#/components/schemas/DocumentContent' - text: '#/components/schemas/ChatTextContent' + text: '#/components/schemas/TextContent' x-fern-type-name: ToolContent + ToolMessage: + required: + - role + properties: + role: + $ref: '#/components/schemas/ChatRole' + tool_results: + type: array + items: + $ref: '#/components/schemas/ToolResult' + description: "Represents tool result in the chat history.\n" + x-fern-type-name: ToolMessage ToolMessageV2: title: Tool Message required: @@ -16913,6 +16944,17 @@ components: type: object x-fern-type-name: ToolResult-68w0tx x-fern-type-name: ToolResult + ToolSource: + title: Tool Output + type: object + properties: + id: + type: string + description: The unique identifier of the document + tool_output: + type: object + x-fern-type-name: ToolSource-z53ra6 + x-fern-type-name: ToolSource ToolV2: type: object properties: @@ -17100,7 +17142,7 @@ components: description: "The number of tokens produced by the model.\n" x-fern-type-name: UsageTokens x-fern-type-name: Usage - UserMessageV2: + UserMessage: title: User Message required: - role @@ -17112,14 +17154,14 @@ components: - type: string - type: array items: - $ref: '#/components/schemas/MessageContent' + $ref: '#/components/schemas/Content' description: "The content of the message. This can be a string or a list of content blocks.\nIf a string is provided, it will be treated as a text content block.\n" role: enum: - user type: string description: A message from the user. - x-fern-type-name: UserMessageV2 + x-fern-type-name: UserMessage WandbConfig: required: - project