Skip to content

Commit

Permalink
Merge pull request #48 from tryAGI/bot/update-openapi_202410180141
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored Oct 18, 2024
2 parents 3d1ab00 + 31a15ad commit 7907028
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 8 additions & 0 deletions src/libs/AI21/Generated/AI21.Models.MessagesItem.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ namespace AI21
/// <summary>
///
/// </summary>
public global::AI21.LanguageStudioApiServerDataTypesChatChatRequestMessageDiscriminatorRole? Role { get; }

/// <summary>
///
/// </summary>
#if NET6_0_OR_GREATER
public global::AI21.UserMessage? UserMessage { get; init; }
#else
Expand Down Expand Up @@ -154,12 +159,15 @@ public MessagesItem(global::AI21.SystemMessage? value)
///
/// </summary>
public MessagesItem(
global::AI21.LanguageStudioApiServerDataTypesChatChatRequestMessageDiscriminatorRole? role,
global::AI21.UserMessage? userMessage,
global::AI21.AssistantMessage? assistantMessage,
global::AI21.ToolMessage? toolMessage,
global::AI21.SystemMessage? systemMessage
)
{
Role = role;

UserMessage = userMessage;
AssistantMessage = assistantMessage;
ToolMessage = toolMessage;
Expand Down
4 changes: 2 additions & 2 deletions src/libs/AI21/Generated/JsonConverters.MessagesItem.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,10 @@ public class MessagesItemJsonConverter : global::System.Text.Json.Serialization.
var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set.");


global::AI21.LanguageStudioApiServerDataTypesChatChatRequestMessageDiscriminator? discriminator = default;
var readerCopy = reader;
var discriminatorTypeInfo = typeInfoResolver.GetTypeInfo(typeof(global::AI21.LanguageStudioApiServerDataTypesChatChatRequestMessageDiscriminator), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::AI21.LanguageStudioApiServerDataTypesChatChatRequestMessageDiscriminator> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::AI21.LanguageStudioApiServerDataTypesChatChatRequestMessageDiscriminator)}");
discriminator = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, discriminatorTypeInfo);
var discriminator = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, discriminatorTypeInfo);

global::AI21.UserMessage? userMessage = default;
if (discriminator?.Role == global::AI21.LanguageStudioApiServerDataTypesChatChatRequestMessageDiscriminatorRole.User)
Expand Down Expand Up @@ -52,6 +51,7 @@ public class MessagesItemJsonConverter : global::System.Text.Json.Serialization.
}

var result = new global::AI21.MessagesItem(
discriminator?.Role,
userMessage,
assistantMessage,
toolMessage,
Expand Down

0 comments on commit 7907028

Please sign in to comment.