diff --git a/.github/workflows/auto-merge.yml b/.github/workflows/auto-merge.yml index 17a043b..8d4b2aa 100644 --- a/.github/workflows/auto-merge.yml +++ b/.github/workflows/auto-merge.yml @@ -11,7 +11,7 @@ permissions: jobs: auto-merge: runs-on: ubuntu-latest - if: ${{ (github.actor == 'dependabot[bot]' || github.actor == 'HavenDV') && github.repository_owner == 'tryAGI' }} + if: ${{ github.event.pull_request.draft == false && (github.actor == 'dependabot[bot]' || github.actor == 'HavenDV') && github.repository_owner == 'tryAGI' }} steps: - name: Dependabot metadata if: ${{ github.actor == 'dependabot[bot]' }} diff --git a/.github/workflows/auto-update.yml b/.github/workflows/auto-update.yml index 89154d6..902f315 100644 --- a/.github/workflows/auto-update.yml +++ b/.github/workflows/auto-update.yml @@ -29,6 +29,11 @@ jobs: git checkout -b ${{ steps.branch.outputs.branch_name }} origin/main git rebase main + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 9.0.x + - name: Generate code run: | cd src/libs/Anthropic diff --git a/.github/workflows/mkdocs.yml b/.github/workflows/mkdocs.yml index 6740aef..8a8592e 100644 --- a/.github/workflows/mkdocs.yml +++ b/.github/workflows/mkdocs.yml @@ -32,6 +32,11 @@ jobs: - name: Setup Pages uses: actions/configure-pages@v5 + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 9.0.x + - name: Generate docs run: dotnet run --project src/helpers/GenerateDocs/GenerateDocs.csproj . diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index ae5a1e4..a9f41c3 100755 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -7,6 +7,7 @@ on: jobs: test: name: Test + if: github.event.pull_request.draft == false uses: HavenDV/workflows/.github/workflows/dotnet_build-test-publish.yml@main with: generate-build-number: false diff --git a/src/helpers/FixOpenApiSpec/FixOpenApiSpec.csproj b/src/helpers/FixOpenApiSpec/FixOpenApiSpec.csproj index d417cec..fbfc94e 100644 --- a/src/helpers/FixOpenApiSpec/FixOpenApiSpec.csproj +++ b/src/helpers/FixOpenApiSpec/FixOpenApiSpec.csproj @@ -1,7 +1,7 @@ - net8.0 + net9.0 Exe preview enable diff --git a/src/helpers/GenerateDocs/GenerateDocs.csproj b/src/helpers/GenerateDocs/GenerateDocs.csproj index f67f521..a47cf75 100644 --- a/src/helpers/GenerateDocs/GenerateDocs.csproj +++ b/src/helpers/GenerateDocs/GenerateDocs.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net9.0 enable diff --git a/src/helpers/TrimmingHelper/TrimmingHelper.csproj b/src/helpers/TrimmingHelper/TrimmingHelper.csproj index c75e68b..ce6367e 100644 --- a/src/helpers/TrimmingHelper/TrimmingHelper.csproj +++ b/src/helpers/TrimmingHelper/TrimmingHelper.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net9.0 enable true diff --git a/src/libs/Anthropic/Anthropic.csproj b/src/libs/Anthropic/Anthropic.csproj index 84cb06a..bb8f778 100644 --- a/src/libs/Anthropic/Anthropic.csproj +++ b/src/libs/Anthropic/Anthropic.csproj @@ -1,7 +1,7 @@ - netstandard2.0;net4.6.2;net8.0 + netstandard2.0;net4.6.2;net8.0;net9.0 $(NoWarn);CA1307;CA1724;CA1822 true @@ -16,7 +16,7 @@ - + diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.CreateMessageRequest.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.CreateMessageRequest.g.cs index e8de91f..5d09759 100644 --- a/src/libs/Anthropic/Generated/Anthropic.Models.CreateMessageRequest.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.Models.CreateMessageRequest.g.cs @@ -18,7 +18,7 @@ public sealed partial class CreateMessageRequest /// /// claude-3-5-sonnet-20241022 [global::System.Text.Json.Serialization.JsonPropertyName("model")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.AnyOfJsonConverterFactory2))] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.AnyOfJsonConverter))] [global::System.Text.Json.Serialization.JsonRequired] public required global::Anthropic.AnyOf Model { get; set; } @@ -134,7 +134,7 @@ public sealed partial class CreateMessageRequest /// [guide to system prompts](https://docs.anthropic.com/en/docs/system-prompts). /// [global::System.Text.Json.Serialization.JsonPropertyName("system")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.OneOfJsonConverterFactory2))] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.OneOfJsonConverter>))] public global::Anthropic.OneOf>? System { get; set; } /// diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.Message.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.Message.g.cs index 381d856..c0e07c3 100644 --- a/src/libs/Anthropic/Generated/Anthropic.Models.Message.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.Models.Message.g.cs @@ -21,7 +21,7 @@ public sealed partial class Message /// The content of the message. /// [global::System.Text.Json.Serialization.JsonPropertyName("content")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.OneOfJsonConverterFactory2))] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.OneOfJsonConverter>))] [global::System.Text.Json.Serialization.JsonRequired] public required global::Anthropic.OneOf> Content { get; set; } diff --git a/src/libs/Anthropic/Generated/Anthropic.Models.ToolResultBlock.g.cs b/src/libs/Anthropic/Generated/Anthropic.Models.ToolResultBlock.g.cs index 7c83464..b8e5c81 100644 --- a/src/libs/Anthropic/Generated/Anthropic.Models.ToolResultBlock.g.cs +++ b/src/libs/Anthropic/Generated/Anthropic.Models.ToolResultBlock.g.cs @@ -23,7 +23,7 @@ public sealed partial class ToolResultBlock /// These content blocks can use the text or image types. /// [global::System.Text.Json.Serialization.JsonPropertyName("content")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.OneOfJsonConverterFactory2))] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Anthropic.JsonConverters.OneOfJsonConverter>))] [global::System.Text.Json.Serialization.JsonRequired] public required global::Anthropic.OneOf> Content { get; set; } diff --git a/src/libs/Anthropic/Generated/JsonConverters.AnyOfFactory2.g.cs b/src/libs/Anthropic/Generated/JsonConverters.AnyOfFactory2.g.cs deleted file mode 100644 index a970efc..0000000 --- a/src/libs/Anthropic/Generated/JsonConverters.AnyOfFactory2.g.cs +++ /dev/null @@ -1,25 +0,0 @@ -#nullable enable - -namespace Anthropic.JsonConverters -{ - /// - public sealed class AnyOfJsonConverterFactory2 : global::System.Text.Json.Serialization.JsonConverterFactory - { - /// - public override bool CanConvert(global::System.Type? typeToConvert) - { - return typeToConvert is { IsGenericType: true } && typeToConvert.GetGenericTypeDefinition() == typeof(global::Anthropic.AnyOf<,>); - } - - /// - public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - typeToConvert = typeToConvert ?? throw new global::System.ArgumentNullException(nameof(typeToConvert)); - - return (global::System.Text.Json.Serialization.JsonConverter)global::System.Activator.CreateInstance( - typeof(AnyOfJsonConverter<,>).MakeGenericType(typeToConvert.GenericTypeArguments))!; - } - } -} diff --git a/src/libs/Anthropic/Generated/JsonConverters.OneOfFactory2.g.cs b/src/libs/Anthropic/Generated/JsonConverters.OneOfFactory2.g.cs deleted file mode 100644 index 6b8bd95..0000000 --- a/src/libs/Anthropic/Generated/JsonConverters.OneOfFactory2.g.cs +++ /dev/null @@ -1,25 +0,0 @@ -#nullable enable - -namespace Anthropic.JsonConverters -{ - /// - public sealed class OneOfJsonConverterFactory2 : global::System.Text.Json.Serialization.JsonConverterFactory - { - /// - public override bool CanConvert(global::System.Type? typeToConvert) - { - return typeToConvert is { IsGenericType: true } && typeToConvert.GetGenericTypeDefinition() == typeof(global::Anthropic.OneOf<,>); - } - - /// - public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - typeToConvert = typeToConvert ?? throw new global::System.ArgumentNullException(nameof(typeToConvert)); - - return (global::System.Text.Json.Serialization.JsonConverter)global::System.Activator.CreateInstance( - typeof(OneOfJsonConverter<,>).MakeGenericType(typeToConvert.GenericTypeArguments))!; - } - } -} diff --git a/src/libs/Anthropic/Generated/JsonSerializerContext.g.cs b/src/libs/Anthropic/Generated/JsonSerializerContext.g.cs index 4914905..77f9ce4 100644 --- a/src/libs/Anthropic/Generated/JsonSerializerContext.g.cs +++ b/src/libs/Anthropic/Generated/JsonSerializerContext.g.cs @@ -47,12 +47,14 @@ namespace Anthropic typeof(global::Anthropic.JsonConverters.BlockDeltaDiscriminatorTypeNullableJsonConverter), typeof(global::Anthropic.JsonConverters.MessageStreamEventDiscriminatorTypeJsonConverter), typeof(global::Anthropic.JsonConverters.MessageStreamEventDiscriminatorTypeNullableJsonConverter), - typeof(global::Anthropic.JsonConverters.AnyOfJsonConverterFactory2), - typeof(global::Anthropic.JsonConverters.OneOfJsonConverterFactory2), typeof(global::Anthropic.JsonConverters.BlockJsonConverter), typeof(global::Anthropic.JsonConverters.ToolJsonConverter), typeof(global::Anthropic.JsonConverters.MessageStreamEventJsonConverter), typeof(global::Anthropic.JsonConverters.BlockDeltaJsonConverter), + typeof(global::Anthropic.JsonConverters.AnyOfJsonConverter), + typeof(global::Anthropic.JsonConverters.OneOfJsonConverter>), + typeof(global::Anthropic.JsonConverters.OneOfJsonConverter>), + typeof(global::Anthropic.JsonConverters.OneOfJsonConverter>), })] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Anthropic.JsonSerializerContextTypes))] diff --git a/src/tests/Anthropic.IntegrationTests/Anthropic.IntegrationTests.csproj b/src/tests/Anthropic.IntegrationTests/Anthropic.IntegrationTests.csproj index 62ab75f..0c712f2 100644 --- a/src/tests/Anthropic.IntegrationTests/Anthropic.IntegrationTests.csproj +++ b/src/tests/Anthropic.IntegrationTests/Anthropic.IntegrationTests.csproj @@ -1,11 +1,11 @@ - net8.0 + net9.0 - + all runtime; build; native; contentfiles; analyzers; buildtransitive