Skip to content

Commit

Permalink
feat: Updated OpenAPI spec
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Aug 13, 2024
1 parent 3713d77 commit a1cd722
Show file tree
Hide file tree
Showing 15 changed files with 152 additions and 471 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -306,11 +306,11 @@ partial void ProcessCreateMessageResponseContent(
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
public async global::System.Threading.Tasks.Task<global::Anthropic.Message> CreateMessageAsync(
global::System.AnyOf<string, global::Anthropic.CreateMessageRequestModel> model,
global::System.AnyOf<string?, global::Anthropic.CreateMessageRequestModel?> model,
global::System.Collections.Generic.IList<global::Anthropic.Message> messages,
int maxTokens,
global::Anthropic.CreateMessageRequestMetadata? metadata = default,
global::System.Collections.Generic.IList<string?>? stopSequences = default,
global::System.Collections.Generic.IList<string>? stopSequences = default,
string? system = default,
double temperature = default,
global::Anthropic.ToolChoice? toolChoice = default,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@

#pragma warning disable CS0618 // Type or member is obsolete

#nullable enable

namespace Anthropic
Expand All @@ -14,9 +12,9 @@ public sealed partial class ContentBlockDeltaEvent
/// A delta in a streaming message.
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("delta")]
[global::System.Text.Json.Serialization.JsonConverter(typeof(global::OpenApiGenerator.JsonConverters.OneOfJsonConverterFactory2))]
[global::System.Text.Json.Serialization.JsonConverter(typeof(global::OpenApiGenerator.JsonConverters.BlockDeltaJsonConverter))]
[global::System.Text.Json.Serialization.JsonRequired]
public required global::System.OneOf<global::Anthropic.TextBlockDelta?, global::Anthropic.InputJsonBlockDelta?> Delta { get; set; }
public required global::Anthropic.BlockDelta Delta { get; set; }

/// <summary>
/// The index of the content block.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@

#pragma warning disable CS0618 // Type or member is obsolete

#nullable enable

namespace Anthropic
Expand All @@ -14,9 +12,9 @@ public sealed partial class ContentBlockStartEvent
/// A block of content in a message.
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("content_block")]
[global::System.Text.Json.Serialization.JsonConverter(typeof(global::OpenApiGenerator.JsonConverters.OneOfJsonConverterFactory4))]
[global::System.Text.Json.Serialization.JsonConverter(typeof(global::OpenApiGenerator.JsonConverters.BlockJsonConverter))]
[global::System.Text.Json.Serialization.JsonRequired]
public required global::System.OneOf<global::Anthropic.TextBlock?, global::Anthropic.ImageBlock?, global::Anthropic.ToolUseBlock?, global::Anthropic.ToolResultBlock?> ContentBlock { get; set; }
public required global::Anthropic.Block ContentBlock { get; set; }

/// <summary>
/// The index of the content block.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public sealed partial class CreateMessageRequest
[global::System.Text.Json.Serialization.JsonPropertyName("model")]
[global::System.Text.Json.Serialization.JsonConverter(typeof(global::OpenApiGenerator.JsonConverters.AnyOfJsonConverterFactory2))]
[global::System.Text.Json.Serialization.JsonRequired]
public required global::System.AnyOf<string, global::Anthropic.CreateMessageRequestModel> Model { get; set; }
public required global::System.AnyOf<string?, global::Anthropic.CreateMessageRequestModel?> Model { get; set; }

/// <summary>
/// Input messages.<br/>
Expand Down Expand Up @@ -124,7 +124,7 @@ public sealed partial class CreateMessageRequest
/// and the response `stop_sequence` value will contain the matched stop sequence.
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("stop_sequences")]
public global::System.Collections.Generic.IList<string?>? StopSequences { get; set; }
public global::System.Collections.Generic.IList<string>? StopSequences { get; set; }

/// <summary>
/// System prompt.<br/>
Expand Down
2 changes: 1 addition & 1 deletion src/libs/Anthropic/Generated/Anthropic.Models.Message.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public sealed partial class Message
[global::System.Text.Json.Serialization.JsonPropertyName("content")]
[global::System.Text.Json.Serialization.JsonConverter(typeof(global::OpenApiGenerator.JsonConverters.OneOfJsonConverterFactory2))]
[global::System.Text.Json.Serialization.JsonRequired]
public required global::System.OneOf<string, global::System.Collections.Generic.IList<global::Anthropic.Block>> Content { get; set; }
public required global::System.OneOf<string?, global::System.Collections.Generic.IList<global::Anthropic.Block>> Content { get; set; }

/// <summary>
/// The role of the messages author.
Expand Down
2 changes: 1 addition & 1 deletion src/libs/Anthropic/Generated/Anthropic.Models.Tool.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public sealed partial class Tool
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("input_schema")]
[global::System.Text.Json.Serialization.JsonRequired]
public required object InputSchema { get; set; }
public required global::Anthropic.ToolInputSchema InputSchema { get; set; }

/// <summary>
/// Additional properties that are not explicitly defined in the schema
Expand Down
20 changes: 20 additions & 0 deletions src/libs/Anthropic/Generated/Anthropic.Models.ToolInputSchema.g.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

#nullable enable

namespace Anthropic
{
/// <summary>
/// [JSON schema](https://json-schema.org/) for this tool's input.<br/>
/// This defines the shape of the `input` that your tool accepts and that the model<br/>
/// will produce.
/// </summary>
public sealed partial class ToolInputSchema
{

/// <summary>
/// Additional properties that are not explicitly defined in the schema
/// </summary>
[global::System.Text.Json.Serialization.JsonExtensionData]
public global::System.Collections.Generic.IDictionary<string, object> AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary<string, object>();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public sealed partial class ToolResultBlock
[global::System.Text.Json.Serialization.JsonPropertyName("content")]
[global::System.Text.Json.Serialization.JsonConverter(typeof(global::OpenApiGenerator.JsonConverters.OneOfJsonConverterFactory2))]
[global::System.Text.Json.Serialization.JsonRequired]
public required global::System.OneOf<string, global::System.Collections.Generic.IList<global::Anthropic.Block>> Content { get; set; }
public required global::System.OneOf<string?, global::System.Collections.Generic.IList<global::Anthropic.Block>> Content { get; set; }

/// <summary>
/// Set to `true` if the tool execution resulted in an error.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public sealed partial class ToolUseBlock
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("input")]
[global::System.Text.Json.Serialization.JsonRequired]
public required object Input { get; set; }
public required global::Anthropic.ToolUseBlockInput Input { get; set; }

/// <summary>
/// The type of content block.<br/>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

#nullable enable

namespace Anthropic
{
/// <summary>
/// An object containing the input being passed to the tool, conforming to the tool’s `input_schema`.
/// </summary>
public sealed partial class ToolUseBlockInput
{

/// <summary>
/// Additional properties that are not explicitly defined in the schema
/// </summary>
[global::System.Text.Json.Serialization.JsonExtensionData]
public global::System.Collections.Generic.IDictionary<string, object> AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary<string, object>();
}
}
152 changes: 0 additions & 152 deletions src/libs/Anthropic/Generated/JsonConverters.OneOf4.g.cs

This file was deleted.

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

This file was deleted.

9 changes: 4 additions & 5 deletions src/libs/Anthropic/Generated/JsonSerializerContext.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,20 @@ namespace Anthropic
{
typeof(global::OpenApiGenerator.JsonConverters.CreateMessageRequestModelJsonConverter),
typeof(global::OpenApiGenerator.JsonConverters.CreateMessageRequestModelNullableJsonConverter),
typeof(global::OpenApiGenerator.JsonConverters.ToolChoiceTypeJsonConverter),
typeof(global::OpenApiGenerator.JsonConverters.ToolChoiceTypeNullableJsonConverter),
typeof(global::OpenApiGenerator.JsonConverters.MessageRoleJsonConverter),
typeof(global::OpenApiGenerator.JsonConverters.MessageRoleNullableJsonConverter),
typeof(global::OpenApiGenerator.JsonConverters.ImageBlockSourceMediaTypeJsonConverter),
typeof(global::OpenApiGenerator.JsonConverters.ImageBlockSourceMediaTypeNullableJsonConverter),
typeof(global::OpenApiGenerator.JsonConverters.ImageBlockSourceTypeJsonConverter),
typeof(global::OpenApiGenerator.JsonConverters.ImageBlockSourceTypeNullableJsonConverter),
typeof(global::OpenApiGenerator.JsonConverters.MessageRoleJsonConverter),
typeof(global::OpenApiGenerator.JsonConverters.MessageRoleNullableJsonConverter),
typeof(global::OpenApiGenerator.JsonConverters.StopReasonJsonConverter),
typeof(global::OpenApiGenerator.JsonConverters.StopReasonNullableJsonConverter),
typeof(global::OpenApiGenerator.JsonConverters.ToolChoiceTypeJsonConverter),
typeof(global::OpenApiGenerator.JsonConverters.ToolChoiceTypeNullableJsonConverter),
typeof(global::OpenApiGenerator.JsonConverters.MessageStreamEventTypeJsonConverter),
typeof(global::OpenApiGenerator.JsonConverters.MessageStreamEventTypeNullableJsonConverter),
typeof(global::OpenApiGenerator.JsonConverters.AnyOfJsonConverterFactory2),
typeof(global::OpenApiGenerator.JsonConverters.OneOfJsonConverterFactory2),
typeof(global::OpenApiGenerator.JsonConverters.OneOfJsonConverterFactory4),
typeof(global::OpenApiGenerator.JsonConverters.BlockJsonConverter),
typeof(global::OpenApiGenerator.JsonConverters.MessageStreamEventJsonConverter),
typeof(global::OpenApiGenerator.JsonConverters.BlockDeltaJsonConverter),
Expand Down
Loading

0 comments on commit a1cd722

Please sign in to comment.