diff --git a/.github/workflows/auto-merge.yml b/.github/workflows/auto-merge.yml index 14fd894..17a043b 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 == 'allcontributors[bot]' || github.actor == 'HavenDV') && github.repository_owner == 'tryAGI' }} + if: ${{ (github.actor == 'dependabot[bot]' || github.actor == 'HavenDV') && github.repository_owner == 'tryAGI' }} steps: - name: Dependabot metadata if: ${{ github.actor == 'dependabot[bot]' }} diff --git a/Ollama.sln b/Ollama.sln index 422e45c..3e072fa 100755 --- a/Ollama.sln +++ b/Ollama.sln @@ -25,8 +25,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ollama", "src\libs\Ollama\O EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ollama.IntegrationTests", "src\tests\Ollama.IntegrationTests\Ollama.IntegrationTests.csproj", "{2C15EAC0-08E6-447A-84E2-1398DDE358AC}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ollama.Models", "src\libs\Ollama.Models\Ollama.Models.csproj", "{479EC8DA-1364-474B-9FBC-DF30E439E888}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "helpers", "helpers", "{C612F166-61F7-4552-A52B-2494F45DB431}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TrimmingHelper", "src\helpers\TrimmingHelper\TrimmingHelper.csproj", "{7F5D3C78-1AEE-4835-BFC8-4AB75CFCE2D5}" @@ -45,10 +43,6 @@ Global {2C15EAC0-08E6-447A-84E2-1398DDE358AC}.Debug|Any CPU.Build.0 = Debug|Any CPU {2C15EAC0-08E6-447A-84E2-1398DDE358AC}.Release|Any CPU.ActiveCfg = Release|Any CPU {2C15EAC0-08E6-447A-84E2-1398DDE358AC}.Release|Any CPU.Build.0 = Release|Any CPU - {479EC8DA-1364-474B-9FBC-DF30E439E888}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {479EC8DA-1364-474B-9FBC-DF30E439E888}.Debug|Any CPU.Build.0 = Debug|Any CPU - {479EC8DA-1364-474B-9FBC-DF30E439E888}.Release|Any CPU.ActiveCfg = Release|Any CPU - {479EC8DA-1364-474B-9FBC-DF30E439E888}.Release|Any CPU.Build.0 = Release|Any CPU {7F5D3C78-1AEE-4835-BFC8-4AB75CFCE2D5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {7F5D3C78-1AEE-4835-BFC8-4AB75CFCE2D5}.Debug|Any CPU.Build.0 = Debug|Any CPU {7F5D3C78-1AEE-4835-BFC8-4AB75CFCE2D5}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -60,7 +54,6 @@ Global GlobalSection(NestedProjects) = preSolution {0028BC85-0064-4CE8-A21A-C1F5E922BD59} = {61E7E11E-4558-434C-ACE8-06316A3097B3} {2C15EAC0-08E6-447A-84E2-1398DDE358AC} = {AAA11B78-2764-4520-A97E-46AA7089A588} - {479EC8DA-1364-474B-9FBC-DF30E439E888} = {61E7E11E-4558-434C-ACE8-06316A3097B3} {7F5D3C78-1AEE-4835-BFC8-4AB75CFCE2D5} = {C612F166-61F7-4552-A52B-2494F45DB431} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution diff --git a/docs/openapi.yaml b/docs/openapi.yaml index ddad5b8..56f2b9d 100644 --- a/docs/openapi.yaml +++ b/docs/openapi.yaml @@ -20,6 +20,18 @@ tags: description: List and describe the various models available. paths: + /version: + get: + operationId: getVersion + summary: Returns the version of the Ollama server. + description: This endpoint returns the version of the Ollama server. + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/VersionResponse' /generate: post: operationId: generateCompletion @@ -482,6 +494,12 @@ components: Note: it's important to instruct the model to use JSON in the prompt. Otherwise, the model may generate large amounts whitespace. enum: - json + VersionResponse: + type: object + description: The response class for the version endpoint. + properties: + version: + type: string GenerateCompletionResponse: type: object description: The response class for the generate endpoint. @@ -777,6 +795,27 @@ components: quantization_level: type: string description: The quantization level of the model. + ModelInformation: + type: object + description: Details about a model. + properties: + general.architecture: + type: string + description: The architecture of the model. + general.file_type: + type: integer + nullable: true + description: The file type of the model. + general.parameter_count: + type: integer + format: int64 + nullable: true + description: The number of parameters in the model. + general.quantization_version: + type: integer + nullable: true + description: The number of parameters in the model. + ProcessResponse: type: object description: Response class for the list running models endpoint. @@ -854,6 +893,8 @@ components: description: The system prompt for the model. details: $ref: '#/components/schemas/ModelDetails' + model_info: + $ref: '#/components/schemas/ModelInformation' messages: type: array nullable: true diff --git a/global.json b/global.json new file mode 100644 index 0000000..eafb435 --- /dev/null +++ b/global.json @@ -0,0 +1,6 @@ +{ + "sdk": { + "rollForward": "latestMajor", + "allowPrerelease": false + } +} \ No newline at end of file diff --git a/src/helpers/TrimmingHelper/TrimmingHelper.csproj b/src/helpers/TrimmingHelper/TrimmingHelper.csproj index f8fe07e..46badc0 100644 --- a/src/helpers/TrimmingHelper/TrimmingHelper.csproj +++ b/src/helpers/TrimmingHelper/TrimmingHelper.csproj @@ -9,7 +9,6 @@ - diff --git a/src/libs/Directory.Build.props b/src/libs/Directory.Build.props index 14fe63e..ff8b61a 100644 --- a/src/libs/Directory.Build.props +++ b/src/libs/Directory.Build.props @@ -14,7 +14,7 @@ - 1.4.0 + 1.4.1 true true tryAGI and contributors @@ -42,7 +42,7 @@ - true + true true true false diff --git a/src/libs/Ollama.Models/Ollama.Models.csproj b/src/libs/Ollama.Models/Ollama.Models.csproj deleted file mode 100644 index 9bfd80b..0000000 --- a/src/libs/Ollama.Models/Ollama.Models.csproj +++ /dev/null @@ -1,50 +0,0 @@ - - - - netstandard2.0;net4.6.2;net6.0;net8.0 - $(NoWarn);CA2016 - - - - Generated C# SDK based on Ollama OpenAPI specification. - api;client;sdk;dotnet;swagger;openapi;specification;ollama;generated - - - - Ollama - false - true - true - - - - true - Generated\$(TargetFramework) - - - - - - - - - - - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - diff --git a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/AnyOf.2.g.cs b/src/libs/Ollama/Generated/AnyOf.2.g.cs similarity index 99% rename from src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/AnyOf.2.g.cs rename to src/libs/Ollama/Generated/AnyOf.2.g.cs index b592586..4ef6eee 100644 --- a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/AnyOf.2.g.cs +++ b/src/libs/Ollama/Generated/AnyOf.2.g.cs @@ -1,4 +1,4 @@ -using System.Linq; +using System.Linq; #nullable enable diff --git a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonConverters.AnyOf2.g.cs b/src/libs/Ollama/Generated/JsonConverters.AnyOf2.g.cs similarity index 99% rename from src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonConverters.AnyOf2.g.cs rename to src/libs/Ollama/Generated/JsonConverters.AnyOf2.g.cs index ae7dbe2..e97e327 100644 --- a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonConverters.AnyOf2.g.cs +++ b/src/libs/Ollama/Generated/JsonConverters.AnyOf2.g.cs @@ -1,4 +1,4 @@ -#nullable enable +#nullable enable namespace OpenApiGenerator.JsonConverters { diff --git a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonConverters.AnyOfFactory2.g.cs b/src/libs/Ollama/Generated/JsonConverters.AnyOfFactory2.g.cs similarity index 98% rename from src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonConverters.AnyOfFactory2.g.cs rename to src/libs/Ollama/Generated/JsonConverters.AnyOfFactory2.g.cs index 7b0c1c6..e3a7b3f 100644 --- a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonConverters.AnyOfFactory2.g.cs +++ b/src/libs/Ollama/Generated/JsonConverters.AnyOfFactory2.g.cs @@ -1,4 +1,4 @@ -#nullable enable +#nullable enable namespace OpenApiGenerator.JsonConverters { diff --git a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonConverters.CreateModelResponseStatus.g.cs b/src/libs/Ollama/Generated/JsonConverters.CreateModelResponseStatus.g.cs similarity index 98% rename from src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonConverters.CreateModelResponseStatus.g.cs rename to src/libs/Ollama/Generated/JsonConverters.CreateModelResponseStatus.g.cs index 8e4ce11..dee3a84 100644 --- a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonConverters.CreateModelResponseStatus.g.cs +++ b/src/libs/Ollama/Generated/JsonConverters.CreateModelResponseStatus.g.cs @@ -1,4 +1,4 @@ -#nullable enable +#nullable enable namespace OpenApiGenerator.JsonConverters { diff --git a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonConverters.CreateModelResponseStatusNullable.g.cs b/src/libs/Ollama/Generated/JsonConverters.CreateModelResponseStatusNullable.g.cs similarity index 99% rename from src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonConverters.CreateModelResponseStatusNullable.g.cs rename to src/libs/Ollama/Generated/JsonConverters.CreateModelResponseStatusNullable.g.cs index 59e0b90..bea588a 100644 --- a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonConverters.CreateModelResponseStatusNullable.g.cs +++ b/src/libs/Ollama/Generated/JsonConverters.CreateModelResponseStatusNullable.g.cs @@ -1,4 +1,4 @@ -#nullable enable +#nullable enable namespace OpenApiGenerator.JsonConverters { diff --git a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonConverters.CreateModelStatus.g.cs b/src/libs/Ollama/Generated/JsonConverters.CreateModelStatus.g.cs similarity index 99% rename from src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonConverters.CreateModelStatus.g.cs rename to src/libs/Ollama/Generated/JsonConverters.CreateModelStatus.g.cs index e27ff76..fd2184c 100644 --- a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonConverters.CreateModelStatus.g.cs +++ b/src/libs/Ollama/Generated/JsonConverters.CreateModelStatus.g.cs @@ -1,4 +1,4 @@ -#nullable enable +#nullable enable #pragma warning disable CS0618 // Type or member is obsolete namespace OpenApiGenerator.JsonConverters diff --git a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonConverters.CreateModelStatusVariant2.g.cs b/src/libs/Ollama/Generated/JsonConverters.CreateModelStatusVariant2.g.cs similarity index 98% rename from src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonConverters.CreateModelStatusVariant2.g.cs rename to src/libs/Ollama/Generated/JsonConverters.CreateModelStatusVariant2.g.cs index 9b7507b..31f1cb0 100644 --- a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonConverters.CreateModelStatusVariant2.g.cs +++ b/src/libs/Ollama/Generated/JsonConverters.CreateModelStatusVariant2.g.cs @@ -1,4 +1,4 @@ -#nullable enable +#nullable enable namespace OpenApiGenerator.JsonConverters { diff --git a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonConverters.CreateModelStatusVariant2Nullable.g.cs b/src/libs/Ollama/Generated/JsonConverters.CreateModelStatusVariant2Nullable.g.cs similarity index 99% rename from src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonConverters.CreateModelStatusVariant2Nullable.g.cs rename to src/libs/Ollama/Generated/JsonConverters.CreateModelStatusVariant2Nullable.g.cs index c134d61..468d3d6 100644 --- a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonConverters.CreateModelStatusVariant2Nullable.g.cs +++ b/src/libs/Ollama/Generated/JsonConverters.CreateModelStatusVariant2Nullable.g.cs @@ -1,4 +1,4 @@ -#nullable enable +#nullable enable namespace OpenApiGenerator.JsonConverters { diff --git a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonConverters.DoneReason.g.cs b/src/libs/Ollama/Generated/JsonConverters.DoneReason.g.cs similarity index 99% rename from src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonConverters.DoneReason.g.cs rename to src/libs/Ollama/Generated/JsonConverters.DoneReason.g.cs index d8b22b0..2321fac 100644 --- a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonConverters.DoneReason.g.cs +++ b/src/libs/Ollama/Generated/JsonConverters.DoneReason.g.cs @@ -1,4 +1,4 @@ -#nullable enable +#nullable enable #pragma warning disable CS0618 // Type or member is obsolete namespace OpenApiGenerator.JsonConverters diff --git a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonConverters.DoneReasonVariant2.g.cs b/src/libs/Ollama/Generated/JsonConverters.DoneReasonVariant2.g.cs similarity index 98% rename from src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonConverters.DoneReasonVariant2.g.cs rename to src/libs/Ollama/Generated/JsonConverters.DoneReasonVariant2.g.cs index f20b012..5fc6e94 100644 --- a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonConverters.DoneReasonVariant2.g.cs +++ b/src/libs/Ollama/Generated/JsonConverters.DoneReasonVariant2.g.cs @@ -1,4 +1,4 @@ -#nullable enable +#nullable enable namespace OpenApiGenerator.JsonConverters { diff --git a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonConverters.DoneReasonVariant2Nullable.g.cs b/src/libs/Ollama/Generated/JsonConverters.DoneReasonVariant2Nullable.g.cs similarity index 99% rename from src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonConverters.DoneReasonVariant2Nullable.g.cs rename to src/libs/Ollama/Generated/JsonConverters.DoneReasonVariant2Nullable.g.cs index 69a588d..0f4009e 100644 --- a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonConverters.DoneReasonVariant2Nullable.g.cs +++ b/src/libs/Ollama/Generated/JsonConverters.DoneReasonVariant2Nullable.g.cs @@ -1,4 +1,4 @@ -#nullable enable +#nullable enable namespace OpenApiGenerator.JsonConverters { diff --git a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonConverters.GenerateChatCompletionResponseDoneReason.g.cs b/src/libs/Ollama/Generated/JsonConverters.GenerateChatCompletionResponseDoneReason.g.cs similarity index 99% rename from src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonConverters.GenerateChatCompletionResponseDoneReason.g.cs rename to src/libs/Ollama/Generated/JsonConverters.GenerateChatCompletionResponseDoneReason.g.cs index 993d768..51fe9e5 100644 --- a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonConverters.GenerateChatCompletionResponseDoneReason.g.cs +++ b/src/libs/Ollama/Generated/JsonConverters.GenerateChatCompletionResponseDoneReason.g.cs @@ -1,4 +1,4 @@ -#nullable enable +#nullable enable namespace OpenApiGenerator.JsonConverters { diff --git a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonConverters.GenerateChatCompletionResponseDoneReasonNullable.g.cs b/src/libs/Ollama/Generated/JsonConverters.GenerateChatCompletionResponseDoneReasonNullable.g.cs similarity index 99% rename from src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonConverters.GenerateChatCompletionResponseDoneReasonNullable.g.cs rename to src/libs/Ollama/Generated/JsonConverters.GenerateChatCompletionResponseDoneReasonNullable.g.cs index 6466953..389acf8 100644 --- a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonConverters.GenerateChatCompletionResponseDoneReasonNullable.g.cs +++ b/src/libs/Ollama/Generated/JsonConverters.GenerateChatCompletionResponseDoneReasonNullable.g.cs @@ -1,4 +1,4 @@ -#nullable enable +#nullable enable namespace OpenApiGenerator.JsonConverters { diff --git a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonConverters.MessageRole.g.cs b/src/libs/Ollama/Generated/JsonConverters.MessageRole.g.cs similarity index 98% rename from src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonConverters.MessageRole.g.cs rename to src/libs/Ollama/Generated/JsonConverters.MessageRole.g.cs index ab04f3a..01ffac3 100644 --- a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonConverters.MessageRole.g.cs +++ b/src/libs/Ollama/Generated/JsonConverters.MessageRole.g.cs @@ -1,4 +1,4 @@ -#nullable enable +#nullable enable namespace OpenApiGenerator.JsonConverters { diff --git a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonConverters.MessageRoleNullable.g.cs b/src/libs/Ollama/Generated/JsonConverters.MessageRoleNullable.g.cs similarity index 98% rename from src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonConverters.MessageRoleNullable.g.cs rename to src/libs/Ollama/Generated/JsonConverters.MessageRoleNullable.g.cs index 501d002..858f09d 100644 --- a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonConverters.MessageRoleNullable.g.cs +++ b/src/libs/Ollama/Generated/JsonConverters.MessageRoleNullable.g.cs @@ -1,4 +1,4 @@ -#nullable enable +#nullable enable namespace OpenApiGenerator.JsonConverters { diff --git a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonConverters.PullModelResponseStatus.g.cs b/src/libs/Ollama/Generated/JsonConverters.PullModelResponseStatus.g.cs similarity index 98% rename from src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonConverters.PullModelResponseStatus.g.cs rename to src/libs/Ollama/Generated/JsonConverters.PullModelResponseStatus.g.cs index da79602..e88bd8e 100644 --- a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonConverters.PullModelResponseStatus.g.cs +++ b/src/libs/Ollama/Generated/JsonConverters.PullModelResponseStatus.g.cs @@ -1,4 +1,4 @@ -#nullable enable +#nullable enable namespace OpenApiGenerator.JsonConverters { diff --git a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonConverters.PullModelResponseStatusNullable.g.cs b/src/libs/Ollama/Generated/JsonConverters.PullModelResponseStatusNullable.g.cs similarity index 99% rename from src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonConverters.PullModelResponseStatusNullable.g.cs rename to src/libs/Ollama/Generated/JsonConverters.PullModelResponseStatusNullable.g.cs index 7b49945..6aadcc5 100644 --- a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonConverters.PullModelResponseStatusNullable.g.cs +++ b/src/libs/Ollama/Generated/JsonConverters.PullModelResponseStatusNullable.g.cs @@ -1,4 +1,4 @@ -#nullable enable +#nullable enable namespace OpenApiGenerator.JsonConverters { diff --git a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonConverters.PullModelStatus.g.cs b/src/libs/Ollama/Generated/JsonConverters.PullModelStatus.g.cs similarity index 99% rename from src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonConverters.PullModelStatus.g.cs rename to src/libs/Ollama/Generated/JsonConverters.PullModelStatus.g.cs index 1e5a065..e1175bd 100644 --- a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonConverters.PullModelStatus.g.cs +++ b/src/libs/Ollama/Generated/JsonConverters.PullModelStatus.g.cs @@ -1,4 +1,4 @@ -#nullable enable +#nullable enable #pragma warning disable CS0618 // Type or member is obsolete namespace OpenApiGenerator.JsonConverters diff --git a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonConverters.PullModelStatusVariant2.g.cs b/src/libs/Ollama/Generated/JsonConverters.PullModelStatusVariant2.g.cs similarity index 98% rename from src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonConverters.PullModelStatusVariant2.g.cs rename to src/libs/Ollama/Generated/JsonConverters.PullModelStatusVariant2.g.cs index ae651c4..bc19bf4 100644 --- a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonConverters.PullModelStatusVariant2.g.cs +++ b/src/libs/Ollama/Generated/JsonConverters.PullModelStatusVariant2.g.cs @@ -1,4 +1,4 @@ -#nullable enable +#nullable enable namespace OpenApiGenerator.JsonConverters { diff --git a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonConverters.PullModelStatusVariant2Nullable.g.cs b/src/libs/Ollama/Generated/JsonConverters.PullModelStatusVariant2Nullable.g.cs similarity index 99% rename from src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonConverters.PullModelStatusVariant2Nullable.g.cs rename to src/libs/Ollama/Generated/JsonConverters.PullModelStatusVariant2Nullable.g.cs index accaaf6..8887155 100644 --- a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonConverters.PullModelStatusVariant2Nullable.g.cs +++ b/src/libs/Ollama/Generated/JsonConverters.PullModelStatusVariant2Nullable.g.cs @@ -1,4 +1,4 @@ -#nullable enable +#nullable enable namespace OpenApiGenerator.JsonConverters { diff --git a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonConverters.PushModelResponseStatus.g.cs b/src/libs/Ollama/Generated/JsonConverters.PushModelResponseStatus.g.cs similarity index 98% rename from src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonConverters.PushModelResponseStatus.g.cs rename to src/libs/Ollama/Generated/JsonConverters.PushModelResponseStatus.g.cs index e490a76..e013bd0 100644 --- a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonConverters.PushModelResponseStatus.g.cs +++ b/src/libs/Ollama/Generated/JsonConverters.PushModelResponseStatus.g.cs @@ -1,4 +1,4 @@ -#nullable enable +#nullable enable namespace OpenApiGenerator.JsonConverters { diff --git a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonConverters.PushModelResponseStatusNullable.g.cs b/src/libs/Ollama/Generated/JsonConverters.PushModelResponseStatusNullable.g.cs similarity index 99% rename from src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonConverters.PushModelResponseStatusNullable.g.cs rename to src/libs/Ollama/Generated/JsonConverters.PushModelResponseStatusNullable.g.cs index b4e63ba..e78a306 100644 --- a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonConverters.PushModelResponseStatusNullable.g.cs +++ b/src/libs/Ollama/Generated/JsonConverters.PushModelResponseStatusNullable.g.cs @@ -1,4 +1,4 @@ -#nullable enable +#nullable enable namespace OpenApiGenerator.JsonConverters { diff --git a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonConverters.PushModelStatus.g.cs b/src/libs/Ollama/Generated/JsonConverters.PushModelStatus.g.cs similarity index 99% rename from src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonConverters.PushModelStatus.g.cs rename to src/libs/Ollama/Generated/JsonConverters.PushModelStatus.g.cs index 7d844bb..9932709 100644 --- a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonConverters.PushModelStatus.g.cs +++ b/src/libs/Ollama/Generated/JsonConverters.PushModelStatus.g.cs @@ -1,4 +1,4 @@ -#nullable enable +#nullable enable #pragma warning disable CS0618 // Type or member is obsolete namespace OpenApiGenerator.JsonConverters diff --git a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonConverters.PushModelStatusVariant2.g.cs b/src/libs/Ollama/Generated/JsonConverters.PushModelStatusVariant2.g.cs similarity index 98% rename from src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonConverters.PushModelStatusVariant2.g.cs rename to src/libs/Ollama/Generated/JsonConverters.PushModelStatusVariant2.g.cs index 25666bd..d833f8c 100644 --- a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonConverters.PushModelStatusVariant2.g.cs +++ b/src/libs/Ollama/Generated/JsonConverters.PushModelStatusVariant2.g.cs @@ -1,4 +1,4 @@ -#nullable enable +#nullable enable namespace OpenApiGenerator.JsonConverters { diff --git a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonConverters.PushModelStatusVariant2Nullable.g.cs b/src/libs/Ollama/Generated/JsonConverters.PushModelStatusVariant2Nullable.g.cs similarity index 99% rename from src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonConverters.PushModelStatusVariant2Nullable.g.cs rename to src/libs/Ollama/Generated/JsonConverters.PushModelStatusVariant2Nullable.g.cs index ab68820..d8f654d 100644 --- a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonConverters.PushModelStatusVariant2Nullable.g.cs +++ b/src/libs/Ollama/Generated/JsonConverters.PushModelStatusVariant2Nullable.g.cs @@ -1,4 +1,4 @@ -#nullable enable +#nullable enable namespace OpenApiGenerator.JsonConverters { diff --git a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonConverters.ResponseFormat.g.cs b/src/libs/Ollama/Generated/JsonConverters.ResponseFormat.g.cs similarity index 98% rename from src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonConverters.ResponseFormat.g.cs rename to src/libs/Ollama/Generated/JsonConverters.ResponseFormat.g.cs index 1e21b1e..5033db8 100644 --- a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonConverters.ResponseFormat.g.cs +++ b/src/libs/Ollama/Generated/JsonConverters.ResponseFormat.g.cs @@ -1,4 +1,4 @@ -#nullable enable +#nullable enable namespace OpenApiGenerator.JsonConverters { diff --git a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonConverters.ResponseFormatNullable.g.cs b/src/libs/Ollama/Generated/JsonConverters.ResponseFormatNullable.g.cs similarity index 98% rename from src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonConverters.ResponseFormatNullable.g.cs rename to src/libs/Ollama/Generated/JsonConverters.ResponseFormatNullable.g.cs index 481a3e7..7d81e55 100644 --- a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonConverters.ResponseFormatNullable.g.cs +++ b/src/libs/Ollama/Generated/JsonConverters.ResponseFormatNullable.g.cs @@ -1,4 +1,4 @@ -#nullable enable +#nullable enable namespace OpenApiGenerator.JsonConverters { diff --git a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonSerializerContextConverters.g.cs b/src/libs/Ollama/Generated/JsonSerializerContext.g.cs similarity index 67% rename from src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonSerializerContextConverters.g.cs rename to src/libs/Ollama/Generated/JsonSerializerContext.g.cs index 27a8df1..b5116b9 100644 --- a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonSerializerContextConverters.g.cs +++ b/src/libs/Ollama/Generated/JsonSerializerContext.g.cs @@ -1,15 +1,14 @@ - + #nullable enable +#pragma warning disable CS0618 // Type or member is obsolete + namespace Ollama { - /// - /// - /// - internal sealed partial class JsonSerializerContextConverters - { - private readonly global::System.Type[] _types = new[] - { + [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + Converters = new global::System.Type[] + { typeof(global::OpenApiGenerator.JsonConverters.ResponseFormatJsonConverter), typeof(global::OpenApiGenerator.JsonConverters.ResponseFormatNullableJsonConverter), typeof(global::OpenApiGenerator.JsonConverters.GenerateChatCompletionResponseDoneReasonJsonConverter), @@ -30,6 +29,15 @@ internal sealed partial class JsonSerializerContextConverters typeof(global::OpenApiGenerator.JsonConverters.PushModelResponseStatusNullableJsonConverter), typeof(global::OpenApiGenerator.JsonConverters.PushModelStatusVariant2JsonConverter), typeof(global::OpenApiGenerator.JsonConverters.PushModelStatusVariant2NullableJsonConverter), - }; + typeof(global::OpenApiGenerator.JsonConverters.AnyOfJsonConverterFactory2), + typeof(global::OpenApiGenerator.JsonConverters.DoneReasonJsonConverter), + typeof(global::OpenApiGenerator.JsonConverters.CreateModelStatusJsonConverter), + typeof(global::OpenApiGenerator.JsonConverters.PullModelStatusJsonConverter), + typeof(global::OpenApiGenerator.JsonConverters.PushModelStatusJsonConverter), + })] + + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ollama.JsonSerializerContextTypes))] + internal sealed partial class SourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext + { } } \ No newline at end of file diff --git a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonSerializerContextTypes.g.cs b/src/libs/Ollama/Generated/JsonSerializerContextTypes.g.cs similarity index 75% rename from src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonSerializerContextTypes.g.cs rename to src/libs/Ollama/Generated/JsonSerializerContextTypes.g.cs index ef8b453..bf9628e 100644 --- a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/JsonSerializerContextTypes.g.cs +++ b/src/libs/Ollama/Generated/JsonSerializerContextTypes.g.cs @@ -1,4 +1,4 @@ - + #nullable enable #pragma warning disable CS0618 // Type or member is obsolete @@ -89,86 +89,94 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::System.AnyOf? Type19 { get; set; } + public global::Ollama.ModelInformation? Type19 { get; set; } + /// + /// + /// + public global::System.AnyOf? Type20 { get; set; } + /// + /// + /// + public global::System.AnyOf? Type21 { get; set; } /// /// /// - public global::System.AnyOf? Type20 { get; set; } + public global::Ollama.VersionResponse? Type22 { get; set; } /// /// /// - public global::Ollama.GenerateCompletionRequest? Type21 { get; set; } + public global::Ollama.GenerateCompletionRequest? Type23 { get; set; } /// /// /// - public global::Ollama.GenerateCompletionResponse? Type22 { get; set; } + public global::Ollama.GenerateCompletionResponse? Type24 { get; set; } /// /// /// - public global::Ollama.GenerateChatCompletionRequest? Type23 { get; set; } + public global::Ollama.GenerateChatCompletionRequest? Type25 { get; set; } /// /// /// - public global::Ollama.GenerateChatCompletionResponse? Type24 { get; set; } + public global::Ollama.GenerateChatCompletionResponse? Type26 { get; set; } /// /// /// - public global::Ollama.GenerateEmbeddingRequest? Type25 { get; set; } + public global::Ollama.GenerateEmbeddingRequest? Type27 { get; set; } /// /// /// - public global::Ollama.GenerateEmbeddingResponse? Type26 { get; set; } + public global::Ollama.GenerateEmbeddingResponse? Type28 { get; set; } /// /// /// - public global::Ollama.CreateModelRequest? Type27 { get; set; } + public global::Ollama.CreateModelRequest? Type29 { get; set; } /// /// /// - public global::Ollama.CreateModelResponse? Type28 { get; set; } + public global::Ollama.CreateModelResponse? Type30 { get; set; } /// /// /// - public global::Ollama.ModelsResponse? Type29 { get; set; } + public global::Ollama.ModelsResponse? Type31 { get; set; } /// /// /// - public global::Ollama.ProcessResponse? Type30 { get; set; } + public global::Ollama.ProcessResponse? Type32 { get; set; } /// /// /// - public global::Ollama.ModelInfoRequest? Type31 { get; set; } + public global::Ollama.ModelInfoRequest? Type33 { get; set; } /// /// /// - public global::Ollama.ModelInfo? Type32 { get; set; } + public global::Ollama.ModelInfo? Type34 { get; set; } /// /// /// - public global::Ollama.CopyModelRequest? Type33 { get; set; } + public global::Ollama.CopyModelRequest? Type35 { get; set; } /// /// /// - public global::Ollama.DeleteModelRequest? Type34 { get; set; } + public global::Ollama.DeleteModelRequest? Type36 { get; set; } /// /// /// - public global::Ollama.PullModelRequest? Type35 { get; set; } + public global::Ollama.PullModelRequest? Type37 { get; set; } /// /// /// - public global::Ollama.PullModelResponse? Type36 { get; set; } + public global::Ollama.PullModelResponse? Type38 { get; set; } /// /// /// - public global::Ollama.PushModelRequest? Type37 { get; set; } + public global::Ollama.PushModelRequest? Type39 { get; set; } /// /// /// - public global::Ollama.PushModelResponse? Type38 { get; set; } + public global::Ollama.PushModelResponse? Type40 { get; set; } /// /// /// - public byte[]? Type39 { get; set; } + public byte[]? Type41 { get; set; } } } \ No newline at end of file diff --git a/src/libs/Ollama/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.ChatClient.GenerateChatCompletion.g.cs b/src/libs/Ollama/Generated/Ollama.ChatClient.GenerateChatCompletion.g.cs similarity index 94% rename from src/libs/Ollama/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.ChatClient.GenerateChatCompletion.g.cs rename to src/libs/Ollama/Generated/Ollama.ChatClient.GenerateChatCompletion.g.cs index 30241ad..027b393 100644 --- a/src/libs/Ollama/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.ChatClient.GenerateChatCompletion.g.cs +++ b/src/libs/Ollama/Generated/Ollama.ChatClient.GenerateChatCompletion.g.cs @@ -1,4 +1,4 @@ - + #nullable enable namespace Ollama @@ -20,9 +20,10 @@ public partial class ChatClient using var httpRequest = new global::System.Net.Http.HttpRequestMessage( method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/chat", global::System.UriKind.RelativeOrAbsolute)); + requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri.TrimEnd('/') + "/chat", global::System.UriKind.RelativeOrAbsolute)); + var __json = global::System.Text.Json.JsonSerializer.Serialize(request, global::Ollama.SourceGenerationContext.Default.GenerateChatCompletionRequest); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request, global::Ollama.SourceGenerationContext.Default.GenerateChatCompletionRequest), + content: __json, encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -32,7 +33,7 @@ public partial class ChatClient cancellationToken: cancellationToken).ConfigureAwait(false); response.EnsureSuccessStatusCode(); - using var stream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false); + using var stream = await response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); using var reader = new global::System.IO.StreamReader(stream); while (!reader.EndOfStream && !cancellationToken.IsCancellationRequested) diff --git a/src/libs/Ollama/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.ChatClient.g.cs b/src/libs/Ollama/Generated/Ollama.ChatClient.g.cs similarity index 96% rename from src/libs/Ollama/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.ChatClient.g.cs rename to src/libs/Ollama/Generated/Ollama.ChatClient.g.cs index 1682466..db65488 100644 --- a/src/libs/Ollama/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.ChatClient.g.cs +++ b/src/libs/Ollama/Generated/Ollama.ChatClient.g.cs @@ -1,4 +1,4 @@ - + #nullable enable namespace Ollama @@ -24,7 +24,7 @@ public sealed partial class ChatClient : global::System.IDisposable /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. /// /// - /// + /// public ChatClient( global::System.Net.Http.HttpClient? httpClient = null, global::System.Uri? baseUri = null diff --git a/src/libs/Ollama/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.CompletionsClient.GenerateCompletion.g.cs b/src/libs/Ollama/Generated/Ollama.CompletionsClient.GenerateCompletion.g.cs similarity index 94% rename from src/libs/Ollama/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.CompletionsClient.GenerateCompletion.g.cs rename to src/libs/Ollama/Generated/Ollama.CompletionsClient.GenerateCompletion.g.cs index 3af3791..2f94d92 100644 --- a/src/libs/Ollama/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.CompletionsClient.GenerateCompletion.g.cs +++ b/src/libs/Ollama/Generated/Ollama.CompletionsClient.GenerateCompletion.g.cs @@ -1,4 +1,4 @@ - + #nullable enable namespace Ollama @@ -20,9 +20,10 @@ public partial class CompletionsClient using var httpRequest = new global::System.Net.Http.HttpRequestMessage( method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/generate", global::System.UriKind.RelativeOrAbsolute)); + requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri.TrimEnd('/') + "/generate", global::System.UriKind.RelativeOrAbsolute)); + var __json = global::System.Text.Json.JsonSerializer.Serialize(request, global::Ollama.SourceGenerationContext.Default.GenerateCompletionRequest); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request, global::Ollama.SourceGenerationContext.Default.GenerateCompletionRequest), + content: __json, encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -32,7 +33,7 @@ public partial class CompletionsClient cancellationToken: cancellationToken).ConfigureAwait(false); response.EnsureSuccessStatusCode(); - using var stream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false); + using var stream = await response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); using var reader = new global::System.IO.StreamReader(stream); while (!reader.EndOfStream && !cancellationToken.IsCancellationRequested) diff --git a/src/libs/Ollama/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.CompletionsClient.g.cs b/src/libs/Ollama/Generated/Ollama.CompletionsClient.g.cs similarity index 96% rename from src/libs/Ollama/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.CompletionsClient.g.cs rename to src/libs/Ollama/Generated/Ollama.CompletionsClient.g.cs index ea1eaf0..c016186 100644 --- a/src/libs/Ollama/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.CompletionsClient.g.cs +++ b/src/libs/Ollama/Generated/Ollama.CompletionsClient.g.cs @@ -1,4 +1,4 @@ - + #nullable enable namespace Ollama @@ -24,7 +24,7 @@ public sealed partial class CompletionsClient : global::System.IDisposable /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. /// /// - /// + /// public CompletionsClient( global::System.Net.Http.HttpClient? httpClient = null, global::System.Uri? baseUri = null diff --git a/src/libs/Ollama/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.EmbeddingsClient.GenerateEmbedding.g.cs b/src/libs/Ollama/Generated/Ollama.EmbeddingsClient.GenerateEmbedding.g.cs similarity index 84% rename from src/libs/Ollama/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.EmbeddingsClient.GenerateEmbedding.g.cs rename to src/libs/Ollama/Generated/Ollama.EmbeddingsClient.GenerateEmbedding.g.cs index bbf3f2f..8b46f20 100644 --- a/src/libs/Ollama/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.EmbeddingsClient.GenerateEmbedding.g.cs +++ b/src/libs/Ollama/Generated/Ollama.EmbeddingsClient.GenerateEmbedding.g.cs @@ -1,4 +1,4 @@ - + #nullable enable namespace Ollama @@ -19,9 +19,10 @@ public partial class EmbeddingsClient using var httpRequest = new global::System.Net.Http.HttpRequestMessage( method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/embeddings", global::System.UriKind.RelativeOrAbsolute)); + requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri.TrimEnd('/') + "/embeddings", global::System.UriKind.RelativeOrAbsolute)); + var __json = global::System.Text.Json.JsonSerializer.Serialize(request, global::Ollama.SourceGenerationContext.Default.GenerateEmbeddingRequest); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request, global::Ollama.SourceGenerationContext.Default.GenerateEmbeddingRequest), + content: __json, encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -29,9 +30,17 @@ public partial class EmbeddingsClient request: httpRequest, completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, cancellationToken: cancellationToken).ConfigureAwait(false); - response.EnsureSuccessStatusCode(); - var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); + var __content = await response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + + try + { + response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException ex) + { + throw new global::System.InvalidOperationException(__content, ex); + } return global::System.Text.Json.JsonSerializer.Deserialize(__content, global::Ollama.SourceGenerationContext.Default.GenerateEmbeddingResponse) ?? diff --git a/src/libs/Ollama/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.EmbeddingsClient.g.cs b/src/libs/Ollama/Generated/Ollama.EmbeddingsClient.g.cs similarity index 96% rename from src/libs/Ollama/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.EmbeddingsClient.g.cs rename to src/libs/Ollama/Generated/Ollama.EmbeddingsClient.g.cs index 04d0ac8..5148e23 100644 --- a/src/libs/Ollama/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.EmbeddingsClient.g.cs +++ b/src/libs/Ollama/Generated/Ollama.EmbeddingsClient.g.cs @@ -1,4 +1,4 @@ - + #nullable enable namespace Ollama @@ -24,7 +24,7 @@ public sealed partial class EmbeddingsClient : global::System.IDisposable /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. /// /// - /// + /// public EmbeddingsClient( global::System.Net.Http.HttpClient? httpClient = null, global::System.Uri? baseUri = null diff --git a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.CopyModelRequest.g.cs b/src/libs/Ollama/Generated/Ollama.Models.CopyModelRequest.g.cs similarity index 99% rename from src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.CopyModelRequest.g.cs rename to src/libs/Ollama/Generated/Ollama.Models.CopyModelRequest.g.cs index 9cbdae4..2a6338a 100644 --- a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.CopyModelRequest.g.cs +++ b/src/libs/Ollama/Generated/Ollama.Models.CopyModelRequest.g.cs @@ -1,4 +1,4 @@ - + #nullable enable namespace Ollama diff --git a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.CreateModelRequest.g.cs b/src/libs/Ollama/Generated/Ollama.Models.CreateModelRequest.g.cs similarity index 99% rename from src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.CreateModelRequest.g.cs rename to src/libs/Ollama/Generated/Ollama.Models.CreateModelRequest.g.cs index 31237dd..34d533e 100644 --- a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.CreateModelRequest.g.cs +++ b/src/libs/Ollama/Generated/Ollama.Models.CreateModelRequest.g.cs @@ -1,4 +1,4 @@ - + #nullable enable namespace Ollama diff --git a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.CreateModelResponse.g.cs b/src/libs/Ollama/Generated/Ollama.Models.CreateModelResponse.g.cs similarity index 89% rename from src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.CreateModelResponse.g.cs rename to src/libs/Ollama/Generated/Ollama.Models.CreateModelResponse.g.cs index 1ac3cf3..5275393 100644 --- a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.CreateModelResponse.g.cs +++ b/src/libs/Ollama/Generated/Ollama.Models.CreateModelResponse.g.cs @@ -1,4 +1,6 @@ - + +#pragma warning disable CS0618 // Type or member is obsolete + #nullable enable namespace Ollama @@ -13,7 +15,7 @@ public sealed partial class CreateModelResponse /// [global::System.Text.Json.Serialization.JsonPropertyName("status")] [global::System.Text.Json.Serialization.JsonConverter(typeof(global::OpenApiGenerator.JsonConverters.AnyOfJsonConverterFactory2))] - public global::System.AnyOf Status { get; set; } + public global::System.AnyOf? Status { get; set; } /// /// Additional properties that are not explicitly defined in the schema diff --git a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.CreateModelResponseStatus.g.cs b/src/libs/Ollama/Generated/Ollama.Models.CreateModelResponseStatus.g.cs similarity index 99% rename from src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.CreateModelResponseStatus.g.cs rename to src/libs/Ollama/Generated/Ollama.Models.CreateModelResponseStatus.g.cs index 283a03f..e5dbc4c 100644 --- a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.CreateModelResponseStatus.g.cs +++ b/src/libs/Ollama/Generated/Ollama.Models.CreateModelResponseStatus.g.cs @@ -1,4 +1,4 @@ - + #nullable enable namespace Ollama diff --git a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.CreateModelStatus.g.cs b/src/libs/Ollama/Generated/Ollama.Models.CreateModelStatus.g.cs similarity index 99% rename from src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.CreateModelStatus.g.cs rename to src/libs/Ollama/Generated/Ollama.Models.CreateModelStatus.g.cs index 9e8d662..7f05390 100644 --- a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.CreateModelStatus.g.cs +++ b/src/libs/Ollama/Generated/Ollama.Models.CreateModelStatus.g.cs @@ -1,4 +1,4 @@ -using System.Linq; +using System.Linq; #pragma warning disable CS0618 // Type or member is obsolete #nullable enable diff --git a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.CreateModelStatusVariant2.g.cs b/src/libs/Ollama/Generated/Ollama.Models.CreateModelStatusVariant2.g.cs similarity index 99% rename from src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.CreateModelStatusVariant2.g.cs rename to src/libs/Ollama/Generated/Ollama.Models.CreateModelStatusVariant2.g.cs index 50ea96c..9187dec 100644 --- a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.CreateModelStatusVariant2.g.cs +++ b/src/libs/Ollama/Generated/Ollama.Models.CreateModelStatusVariant2.g.cs @@ -1,4 +1,4 @@ - + #nullable enable namespace Ollama diff --git a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.DeleteModelRequest.g.cs b/src/libs/Ollama/Generated/Ollama.Models.DeleteModelRequest.g.cs similarity index 99% rename from src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.DeleteModelRequest.g.cs rename to src/libs/Ollama/Generated/Ollama.Models.DeleteModelRequest.g.cs index 6b7b233..d84ae33 100644 --- a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.DeleteModelRequest.g.cs +++ b/src/libs/Ollama/Generated/Ollama.Models.DeleteModelRequest.g.cs @@ -1,4 +1,4 @@ - + #nullable enable namespace Ollama diff --git a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.DoneReason.g.cs b/src/libs/Ollama/Generated/Ollama.Models.DoneReason.g.cs similarity index 99% rename from src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.DoneReason.g.cs rename to src/libs/Ollama/Generated/Ollama.Models.DoneReason.g.cs index efd966f..7b83f30 100644 --- a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.DoneReason.g.cs +++ b/src/libs/Ollama/Generated/Ollama.Models.DoneReason.g.cs @@ -1,4 +1,4 @@ -using System.Linq; +using System.Linq; #pragma warning disable CS0618 // Type or member is obsolete #nullable enable diff --git a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.DoneReasonVariant2.g.cs b/src/libs/Ollama/Generated/Ollama.Models.DoneReasonVariant2.g.cs similarity index 99% rename from src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.DoneReasonVariant2.g.cs rename to src/libs/Ollama/Generated/Ollama.Models.DoneReasonVariant2.g.cs index 81d0192..9964da2 100644 --- a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.DoneReasonVariant2.g.cs +++ b/src/libs/Ollama/Generated/Ollama.Models.DoneReasonVariant2.g.cs @@ -1,4 +1,4 @@ - + #nullable enable namespace Ollama diff --git a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.GenerateChatCompletionRequest.g.cs b/src/libs/Ollama/Generated/Ollama.Models.GenerateChatCompletionRequest.g.cs similarity index 99% rename from src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.GenerateChatCompletionRequest.g.cs rename to src/libs/Ollama/Generated/Ollama.Models.GenerateChatCompletionRequest.g.cs index 267bfcf..09ea889 100644 --- a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.GenerateChatCompletionRequest.g.cs +++ b/src/libs/Ollama/Generated/Ollama.Models.GenerateChatCompletionRequest.g.cs @@ -1,4 +1,4 @@ - + #nullable enable namespace Ollama diff --git a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.GenerateChatCompletionResponse.g.cs b/src/libs/Ollama/Generated/Ollama.Models.GenerateChatCompletionResponse.g.cs similarity index 96% rename from src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.GenerateChatCompletionResponse.g.cs rename to src/libs/Ollama/Generated/Ollama.Models.GenerateChatCompletionResponse.g.cs index 560a16a..f53e8eb 100644 --- a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.GenerateChatCompletionResponse.g.cs +++ b/src/libs/Ollama/Generated/Ollama.Models.GenerateChatCompletionResponse.g.cs @@ -1,4 +1,6 @@ - + +#pragma warning disable CS0618 // Type or member is obsolete + #nullable enable namespace Ollama @@ -40,7 +42,7 @@ public sealed partial class GenerateChatCompletionResponse /// [global::System.Text.Json.Serialization.JsonPropertyName("done_reason")] [global::System.Text.Json.Serialization.JsonConverter(typeof(global::OpenApiGenerator.JsonConverters.AnyOfJsonConverterFactory2))] - public global::System.AnyOf DoneReason { get; set; } + public global::System.AnyOf? DoneReason { get; set; } /// /// Time spent generating the response.
diff --git a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.GenerateChatCompletionResponseDoneReason.g.cs b/src/libs/Ollama/Generated/Ollama.Models.GenerateChatCompletionResponseDoneReason.g.cs similarity index 99% rename from src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.GenerateChatCompletionResponseDoneReason.g.cs rename to src/libs/Ollama/Generated/Ollama.Models.GenerateChatCompletionResponseDoneReason.g.cs index 11d41db..97b8af0 100644 --- a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.GenerateChatCompletionResponseDoneReason.g.cs +++ b/src/libs/Ollama/Generated/Ollama.Models.GenerateChatCompletionResponseDoneReason.g.cs @@ -1,4 +1,4 @@ - + #nullable enable namespace Ollama diff --git a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.GenerateCompletionRequest.g.cs b/src/libs/Ollama/Generated/Ollama.Models.GenerateCompletionRequest.g.cs similarity index 99% rename from src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.GenerateCompletionRequest.g.cs rename to src/libs/Ollama/Generated/Ollama.Models.GenerateCompletionRequest.g.cs index e4e66ea..556f16a 100644 --- a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.GenerateCompletionRequest.g.cs +++ b/src/libs/Ollama/Generated/Ollama.Models.GenerateCompletionRequest.g.cs @@ -1,4 +1,4 @@ - + #nullable enable namespace Ollama diff --git a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.GenerateCompletionResponse.g.cs b/src/libs/Ollama/Generated/Ollama.Models.GenerateCompletionResponse.g.cs similarity index 99% rename from src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.GenerateCompletionResponse.g.cs rename to src/libs/Ollama/Generated/Ollama.Models.GenerateCompletionResponse.g.cs index d5d7258..9bb46f3 100644 --- a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.GenerateCompletionResponse.g.cs +++ b/src/libs/Ollama/Generated/Ollama.Models.GenerateCompletionResponse.g.cs @@ -1,4 +1,4 @@ - + #nullable enable namespace Ollama diff --git a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.GenerateEmbeddingRequest.g.cs b/src/libs/Ollama/Generated/Ollama.Models.GenerateEmbeddingRequest.g.cs similarity index 99% rename from src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.GenerateEmbeddingRequest.g.cs rename to src/libs/Ollama/Generated/Ollama.Models.GenerateEmbeddingRequest.g.cs index ce6a7b5..634a559 100644 --- a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.GenerateEmbeddingRequest.g.cs +++ b/src/libs/Ollama/Generated/Ollama.Models.GenerateEmbeddingRequest.g.cs @@ -1,4 +1,4 @@ - + #nullable enable namespace Ollama diff --git a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.GenerateEmbeddingResponse.g.cs b/src/libs/Ollama/Generated/Ollama.Models.GenerateEmbeddingResponse.g.cs similarity index 99% rename from src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.GenerateEmbeddingResponse.g.cs rename to src/libs/Ollama/Generated/Ollama.Models.GenerateEmbeddingResponse.g.cs index 4805311..4eaa362 100644 --- a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.GenerateEmbeddingResponse.g.cs +++ b/src/libs/Ollama/Generated/Ollama.Models.GenerateEmbeddingResponse.g.cs @@ -1,4 +1,4 @@ - + #nullable enable namespace Ollama diff --git a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.Message.g.cs b/src/libs/Ollama/Generated/Ollama.Models.Message.g.cs similarity index 99% rename from src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.Message.g.cs rename to src/libs/Ollama/Generated/Ollama.Models.Message.g.cs index a470e67..fc6b623 100644 --- a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.Message.g.cs +++ b/src/libs/Ollama/Generated/Ollama.Models.Message.g.cs @@ -1,4 +1,4 @@ - + #nullable enable namespace Ollama diff --git a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.MessageRole.g.cs b/src/libs/Ollama/Generated/Ollama.Models.MessageRole.g.cs similarity index 99% rename from src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.MessageRole.g.cs rename to src/libs/Ollama/Generated/Ollama.Models.MessageRole.g.cs index af76fc6..c82aacf 100644 --- a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.MessageRole.g.cs +++ b/src/libs/Ollama/Generated/Ollama.Models.MessageRole.g.cs @@ -1,4 +1,4 @@ - + #nullable enable namespace Ollama diff --git a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.Model.g.cs b/src/libs/Ollama/Generated/Ollama.Models.Model.g.cs similarity index 99% rename from src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.Model.g.cs rename to src/libs/Ollama/Generated/Ollama.Models.Model.g.cs index 94f0fe5..4839df4 100644 --- a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.Model.g.cs +++ b/src/libs/Ollama/Generated/Ollama.Models.Model.g.cs @@ -1,4 +1,4 @@ - + #nullable enable namespace Ollama diff --git a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.ModelDetails.g.cs b/src/libs/Ollama/Generated/Ollama.Models.ModelDetails.g.cs similarity index 99% rename from src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.ModelDetails.g.cs rename to src/libs/Ollama/Generated/Ollama.Models.ModelDetails.g.cs index 360c03f..9eabc20 100644 --- a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.ModelDetails.g.cs +++ b/src/libs/Ollama/Generated/Ollama.Models.ModelDetails.g.cs @@ -1,4 +1,4 @@ - + #nullable enable namespace Ollama diff --git a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.ModelInfo.g.cs b/src/libs/Ollama/Generated/Ollama.Models.ModelInfo.g.cs similarity index 92% rename from src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.ModelInfo.g.cs rename to src/libs/Ollama/Generated/Ollama.Models.ModelInfo.g.cs index 9373be8..5b53d6c 100644 --- a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.ModelInfo.g.cs +++ b/src/libs/Ollama/Generated/Ollama.Models.ModelInfo.g.cs @@ -1,4 +1,4 @@ - + #nullable enable namespace Ollama @@ -48,6 +48,12 @@ public sealed partial class ModelInfo [global::System.Text.Json.Serialization.JsonPropertyName("details")] public global::Ollama.ModelDetails? Details { get; set; } + /// + /// Details about a model. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("model_info")] + public global::Ollama.ModelInformation? ModelInfo1 { get; set; } + /// /// The default messages for the model. /// diff --git a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.ModelInfoRequest.g.cs b/src/libs/Ollama/Generated/Ollama.Models.ModelInfoRequest.g.cs similarity index 99% rename from src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.ModelInfoRequest.g.cs rename to src/libs/Ollama/Generated/Ollama.Models.ModelInfoRequest.g.cs index ac67b90..b9eeeed 100644 --- a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.ModelInfoRequest.g.cs +++ b/src/libs/Ollama/Generated/Ollama.Models.ModelInfoRequest.g.cs @@ -1,4 +1,4 @@ - + #nullable enable namespace Ollama diff --git a/src/libs/Ollama/Generated/Ollama.Models.ModelInformation.g.cs b/src/libs/Ollama/Generated/Ollama.Models.ModelInformation.g.cs new file mode 100644 index 0000000..891daf4 --- /dev/null +++ b/src/libs/Ollama/Generated/Ollama.Models.ModelInformation.g.cs @@ -0,0 +1,41 @@ + +#nullable enable + +namespace Ollama +{ + /// + /// Details about a model. + /// + public sealed partial class ModelInformation + { + /// + /// The architecture of the model. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("general.architecture")] + public string? General_architecture { get; set; } + + /// + /// The file type of the model. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("general.file_type")] + public int? General_fileType { get; set; } + + /// + /// The number of parameters in the model. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("general.parameter_count")] + public long? General_parameterCount { get; set; } + + /// + /// The number of parameters in the model. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("general.quantization_version")] + public int? General_quantizationVersion { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } +} \ No newline at end of file diff --git a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.ModelsResponse.g.cs b/src/libs/Ollama/Generated/Ollama.Models.ModelsResponse.g.cs similarity index 99% rename from src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.ModelsResponse.g.cs rename to src/libs/Ollama/Generated/Ollama.Models.ModelsResponse.g.cs index 8dfaac1..ad68e6d 100644 --- a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.ModelsResponse.g.cs +++ b/src/libs/Ollama/Generated/Ollama.Models.ModelsResponse.g.cs @@ -1,4 +1,4 @@ - + #nullable enable namespace Ollama diff --git a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.ProcessModel.g.cs b/src/libs/Ollama/Generated/Ollama.Models.ProcessModel.g.cs similarity index 99% rename from src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.ProcessModel.g.cs rename to src/libs/Ollama/Generated/Ollama.Models.ProcessModel.g.cs index 7397204..8e5834f 100644 --- a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.ProcessModel.g.cs +++ b/src/libs/Ollama/Generated/Ollama.Models.ProcessModel.g.cs @@ -1,4 +1,4 @@ - + #nullable enable namespace Ollama diff --git a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.ProcessResponse.g.cs b/src/libs/Ollama/Generated/Ollama.Models.ProcessResponse.g.cs similarity index 99% rename from src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.ProcessResponse.g.cs rename to src/libs/Ollama/Generated/Ollama.Models.ProcessResponse.g.cs index 265065b..0079e8d 100644 --- a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.ProcessResponse.g.cs +++ b/src/libs/Ollama/Generated/Ollama.Models.ProcessResponse.g.cs @@ -1,4 +1,4 @@ - + #nullable enable namespace Ollama diff --git a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.PullModelRequest.g.cs b/src/libs/Ollama/Generated/Ollama.Models.PullModelRequest.g.cs similarity index 99% rename from src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.PullModelRequest.g.cs rename to src/libs/Ollama/Generated/Ollama.Models.PullModelRequest.g.cs index 5e541d7..6625681 100644 --- a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.PullModelRequest.g.cs +++ b/src/libs/Ollama/Generated/Ollama.Models.PullModelRequest.g.cs @@ -1,4 +1,4 @@ - + #nullable enable namespace Ollama diff --git a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.PullModelResponse.g.cs b/src/libs/Ollama/Generated/Ollama.Models.PullModelResponse.g.cs similarity index 94% rename from src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.PullModelResponse.g.cs rename to src/libs/Ollama/Generated/Ollama.Models.PullModelResponse.g.cs index 769db2b..11f4cfe 100644 --- a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.PullModelResponse.g.cs +++ b/src/libs/Ollama/Generated/Ollama.Models.PullModelResponse.g.cs @@ -1,4 +1,6 @@ - + +#pragma warning disable CS0618 // Type or member is obsolete + #nullable enable namespace Ollama @@ -16,7 +18,7 @@ public sealed partial class PullModelResponse ///
[global::System.Text.Json.Serialization.JsonPropertyName("status")] [global::System.Text.Json.Serialization.JsonConverter(typeof(global::OpenApiGenerator.JsonConverters.AnyOfJsonConverterFactory2))] - public global::System.AnyOf Status { get; set; } + public global::System.AnyOf? Status { get; set; } /// /// The model's digest.
diff --git a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.PullModelResponseStatus.g.cs b/src/libs/Ollama/Generated/Ollama.Models.PullModelResponseStatus.g.cs similarity index 99% rename from src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.PullModelResponseStatus.g.cs rename to src/libs/Ollama/Generated/Ollama.Models.PullModelResponseStatus.g.cs index 848867b..e816d02 100644 --- a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.PullModelResponseStatus.g.cs +++ b/src/libs/Ollama/Generated/Ollama.Models.PullModelResponseStatus.g.cs @@ -1,4 +1,4 @@ - + #nullable enable namespace Ollama diff --git a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.PullModelStatus.g.cs b/src/libs/Ollama/Generated/Ollama.Models.PullModelStatus.g.cs similarity index 99% rename from src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.PullModelStatus.g.cs rename to src/libs/Ollama/Generated/Ollama.Models.PullModelStatus.g.cs index 9999a63..d1836c5 100644 --- a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.PullModelStatus.g.cs +++ b/src/libs/Ollama/Generated/Ollama.Models.PullModelStatus.g.cs @@ -1,4 +1,4 @@ -using System.Linq; +using System.Linq; #pragma warning disable CS0618 // Type or member is obsolete #nullable enable diff --git a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.PullModelStatusVariant2.g.cs b/src/libs/Ollama/Generated/Ollama.Models.PullModelStatusVariant2.g.cs similarity index 99% rename from src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.PullModelStatusVariant2.g.cs rename to src/libs/Ollama/Generated/Ollama.Models.PullModelStatusVariant2.g.cs index a9d4958..2d6dfb6 100644 --- a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.PullModelStatusVariant2.g.cs +++ b/src/libs/Ollama/Generated/Ollama.Models.PullModelStatusVariant2.g.cs @@ -1,4 +1,4 @@ - + #nullable enable namespace Ollama diff --git a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.PushModelRequest.g.cs b/src/libs/Ollama/Generated/Ollama.Models.PushModelRequest.g.cs similarity index 99% rename from src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.PushModelRequest.g.cs rename to src/libs/Ollama/Generated/Ollama.Models.PushModelRequest.g.cs index bc420b0..a457da3 100644 --- a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.PushModelRequest.g.cs +++ b/src/libs/Ollama/Generated/Ollama.Models.PushModelRequest.g.cs @@ -1,4 +1,4 @@ - + #nullable enable namespace Ollama diff --git a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.PushModelResponse.g.cs b/src/libs/Ollama/Generated/Ollama.Models.PushModelResponse.g.cs similarity index 94% rename from src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.PushModelResponse.g.cs rename to src/libs/Ollama/Generated/Ollama.Models.PushModelResponse.g.cs index 941c7b5..e7f8161 100644 --- a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.PushModelResponse.g.cs +++ b/src/libs/Ollama/Generated/Ollama.Models.PushModelResponse.g.cs @@ -1,4 +1,6 @@ - + +#pragma warning disable CS0618 // Type or member is obsolete + #nullable enable namespace Ollama @@ -13,7 +15,7 @@ public sealed partial class PushModelResponse ///
[global::System.Text.Json.Serialization.JsonPropertyName("status")] [global::System.Text.Json.Serialization.JsonConverter(typeof(global::OpenApiGenerator.JsonConverters.AnyOfJsonConverterFactory2))] - public global::System.AnyOf Status { get; set; } + public global::System.AnyOf? Status { get; set; } /// /// the model's digest
diff --git a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.PushModelResponseStatus.g.cs b/src/libs/Ollama/Generated/Ollama.Models.PushModelResponseStatus.g.cs similarity index 99% rename from src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.PushModelResponseStatus.g.cs rename to src/libs/Ollama/Generated/Ollama.Models.PushModelResponseStatus.g.cs index 5f18f17..abc31d0 100644 --- a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.PushModelResponseStatus.g.cs +++ b/src/libs/Ollama/Generated/Ollama.Models.PushModelResponseStatus.g.cs @@ -1,4 +1,4 @@ - + #nullable enable namespace Ollama diff --git a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.PushModelStatus.g.cs b/src/libs/Ollama/Generated/Ollama.Models.PushModelStatus.g.cs similarity index 99% rename from src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.PushModelStatus.g.cs rename to src/libs/Ollama/Generated/Ollama.Models.PushModelStatus.g.cs index 506c7b3..0496b5c 100644 --- a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.PushModelStatus.g.cs +++ b/src/libs/Ollama/Generated/Ollama.Models.PushModelStatus.g.cs @@ -1,4 +1,4 @@ -using System.Linq; +using System.Linq; #pragma warning disable CS0618 // Type or member is obsolete #nullable enable diff --git a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.PushModelStatusVariant2.g.cs b/src/libs/Ollama/Generated/Ollama.Models.PushModelStatusVariant2.g.cs similarity index 99% rename from src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.PushModelStatusVariant2.g.cs rename to src/libs/Ollama/Generated/Ollama.Models.PushModelStatusVariant2.g.cs index d146a9e..78a18b5 100644 --- a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.PushModelStatusVariant2.g.cs +++ b/src/libs/Ollama/Generated/Ollama.Models.PushModelStatusVariant2.g.cs @@ -1,4 +1,4 @@ - + #nullable enable namespace Ollama diff --git a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.RequestOptions.g.cs b/src/libs/Ollama/Generated/Ollama.Models.RequestOptions.g.cs similarity index 99% rename from src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.RequestOptions.g.cs rename to src/libs/Ollama/Generated/Ollama.Models.RequestOptions.g.cs index 9e0c63c..a11326b 100644 --- a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.RequestOptions.g.cs +++ b/src/libs/Ollama/Generated/Ollama.Models.RequestOptions.g.cs @@ -1,4 +1,4 @@ - + #nullable enable namespace Ollama diff --git a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.ResponseFormat.g.cs b/src/libs/Ollama/Generated/Ollama.Models.ResponseFormat.g.cs similarity index 99% rename from src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.ResponseFormat.g.cs rename to src/libs/Ollama/Generated/Ollama.Models.ResponseFormat.g.cs index fbb28b1..1449d64 100644 --- a/src/libs/Ollama.Models/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.Models.ResponseFormat.g.cs +++ b/src/libs/Ollama/Generated/Ollama.Models.ResponseFormat.g.cs @@ -1,4 +1,4 @@ - + #nullable enable namespace Ollama diff --git a/src/libs/Ollama/Generated/Ollama.Models.VersionResponse.g.cs b/src/libs/Ollama/Generated/Ollama.Models.VersionResponse.g.cs new file mode 100644 index 0000000..4a2c768 --- /dev/null +++ b/src/libs/Ollama/Generated/Ollama.Models.VersionResponse.g.cs @@ -0,0 +1,23 @@ + +#nullable enable + +namespace Ollama +{ + /// + /// The response class for the version endpoint. + /// + public sealed partial class VersionResponse + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("version")] + public string? Version { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } +} \ No newline at end of file diff --git a/src/libs/Ollama/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.ModelsClient.CheckBlob.g.cs b/src/libs/Ollama/Generated/Ollama.ModelsClient.CheckBlob.g.cs similarity index 92% rename from src/libs/Ollama/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.ModelsClient.CheckBlob.g.cs rename to src/libs/Ollama/Generated/Ollama.ModelsClient.CheckBlob.g.cs index 8e60439..4bd65d4 100644 --- a/src/libs/Ollama/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.ModelsClient.CheckBlob.g.cs +++ b/src/libs/Ollama/Generated/Ollama.ModelsClient.CheckBlob.g.cs @@ -1,4 +1,4 @@ - + #nullable enable namespace Ollama @@ -18,7 +18,7 @@ public partial class ModelsClient { using var httpRequest = new global::System.Net.Http.HttpRequestMessage( method: global::System.Net.Http.HttpMethod.Head, - requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + $"/blobs/{digest}", global::System.UriKind.RelativeOrAbsolute)); + requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri.TrimEnd('/') + $"/blobs/{digest}", global::System.UriKind.RelativeOrAbsolute)); using var response = await _httpClient.SendAsync( request: httpRequest, diff --git a/src/libs/Ollama/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.ModelsClient.CopyModel.g.cs b/src/libs/Ollama/Generated/Ollama.ModelsClient.CopyModel.g.cs similarity index 92% rename from src/libs/Ollama/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.ModelsClient.CopyModel.g.cs rename to src/libs/Ollama/Generated/Ollama.ModelsClient.CopyModel.g.cs index 9481dbf..444cb4d 100644 --- a/src/libs/Ollama/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.ModelsClient.CopyModel.g.cs +++ b/src/libs/Ollama/Generated/Ollama.ModelsClient.CopyModel.g.cs @@ -1,4 +1,4 @@ - + #nullable enable namespace Ollama @@ -19,9 +19,10 @@ public partial class ModelsClient using var httpRequest = new global::System.Net.Http.HttpRequestMessage( method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/copy", global::System.UriKind.RelativeOrAbsolute)); + requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri.TrimEnd('/') + "/copy", global::System.UriKind.RelativeOrAbsolute)); + var __json = global::System.Text.Json.JsonSerializer.Serialize(request, global::Ollama.SourceGenerationContext.Default.CopyModelRequest); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request, global::Ollama.SourceGenerationContext.Default.CopyModelRequest), + content: __json, encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); diff --git a/src/libs/Ollama/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.ModelsClient.CreateBlob.g.cs b/src/libs/Ollama/Generated/Ollama.ModelsClient.CreateBlob.g.cs similarity index 91% rename from src/libs/Ollama/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.ModelsClient.CreateBlob.g.cs rename to src/libs/Ollama/Generated/Ollama.ModelsClient.CreateBlob.g.cs index 4ec57c9..17fee15 100644 --- a/src/libs/Ollama/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.ModelsClient.CreateBlob.g.cs +++ b/src/libs/Ollama/Generated/Ollama.ModelsClient.CreateBlob.g.cs @@ -1,4 +1,4 @@ - + #nullable enable namespace Ollama @@ -21,9 +21,10 @@ public partial class ModelsClient using var httpRequest = new global::System.Net.Http.HttpRequestMessage( method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + $"/blobs/{digest}", global::System.UriKind.RelativeOrAbsolute)); + requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri.TrimEnd('/') + $"/blobs/{digest}", global::System.UriKind.RelativeOrAbsolute)); + var __json = global::System.Text.Json.JsonSerializer.Serialize(request, global::Ollama.SourceGenerationContext.Default.ByteArray); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request, global::Ollama.SourceGenerationContext.Default.ByteArray), + content: __json, encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); diff --git a/src/libs/Ollama/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.ModelsClient.CreateModel.g.cs b/src/libs/Ollama/Generated/Ollama.ModelsClient.CreateModel.g.cs similarity index 94% rename from src/libs/Ollama/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.ModelsClient.CreateModel.g.cs rename to src/libs/Ollama/Generated/Ollama.ModelsClient.CreateModel.g.cs index 4bdb8a7..09a4df6 100644 --- a/src/libs/Ollama/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.ModelsClient.CreateModel.g.cs +++ b/src/libs/Ollama/Generated/Ollama.ModelsClient.CreateModel.g.cs @@ -1,4 +1,4 @@ - + #nullable enable namespace Ollama @@ -20,9 +20,10 @@ public partial class ModelsClient using var httpRequest = new global::System.Net.Http.HttpRequestMessage( method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/create", global::System.UriKind.RelativeOrAbsolute)); + requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri.TrimEnd('/') + "/create", global::System.UriKind.RelativeOrAbsolute)); + var __json = global::System.Text.Json.JsonSerializer.Serialize(request, global::Ollama.SourceGenerationContext.Default.CreateModelRequest); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request, global::Ollama.SourceGenerationContext.Default.CreateModelRequest), + content: __json, encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -32,7 +33,7 @@ public partial class ModelsClient cancellationToken: cancellationToken).ConfigureAwait(false); response.EnsureSuccessStatusCode(); - using var stream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false); + using var stream = await response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); using var reader = new global::System.IO.StreamReader(stream); while (!reader.EndOfStream && !cancellationToken.IsCancellationRequested) diff --git a/src/libs/Ollama/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.ModelsClient.DeleteModel.g.cs b/src/libs/Ollama/Generated/Ollama.ModelsClient.DeleteModel.g.cs similarity index 91% rename from src/libs/Ollama/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.ModelsClient.DeleteModel.g.cs rename to src/libs/Ollama/Generated/Ollama.ModelsClient.DeleteModel.g.cs index 011745c..3449074 100644 --- a/src/libs/Ollama/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.ModelsClient.DeleteModel.g.cs +++ b/src/libs/Ollama/Generated/Ollama.ModelsClient.DeleteModel.g.cs @@ -1,4 +1,4 @@ - + #nullable enable namespace Ollama @@ -19,9 +19,10 @@ public partial class ModelsClient using var httpRequest = new global::System.Net.Http.HttpRequestMessage( method: global::System.Net.Http.HttpMethod.Delete, - requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/delete", global::System.UriKind.RelativeOrAbsolute)); + requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri.TrimEnd('/') + "/delete", global::System.UriKind.RelativeOrAbsolute)); + var __json = global::System.Text.Json.JsonSerializer.Serialize(request, global::Ollama.SourceGenerationContext.Default.DeleteModelRequest); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request, global::Ollama.SourceGenerationContext.Default.DeleteModelRequest), + content: __json, encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); diff --git a/src/libs/Ollama/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.ModelsClient.ListModels.g.cs b/src/libs/Ollama/Generated/Ollama.ModelsClient.ListModels.g.cs similarity index 77% rename from src/libs/Ollama/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.ModelsClient.ListModels.g.cs rename to src/libs/Ollama/Generated/Ollama.ModelsClient.ListModels.g.cs index 888bcf4..f7bfde9 100644 --- a/src/libs/Ollama/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.ModelsClient.ListModels.g.cs +++ b/src/libs/Ollama/Generated/Ollama.ModelsClient.ListModels.g.cs @@ -1,4 +1,4 @@ - + #nullable enable namespace Ollama @@ -15,15 +15,23 @@ public partial class ModelsClient { using var httpRequest = new global::System.Net.Http.HttpRequestMessage( method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/tags", global::System.UriKind.RelativeOrAbsolute)); + requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri.TrimEnd('/') + "/tags", global::System.UriKind.RelativeOrAbsolute)); using var response = await _httpClient.SendAsync( request: httpRequest, completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, cancellationToken: cancellationToken).ConfigureAwait(false); - response.EnsureSuccessStatusCode(); - var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); + var __content = await response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + + try + { + response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException ex) + { + throw new global::System.InvalidOperationException(__content, ex); + } return global::System.Text.Json.JsonSerializer.Deserialize(__content, global::Ollama.SourceGenerationContext.Default.ModelsResponse) ?? diff --git a/src/libs/Ollama/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.ModelsClient.ListRunningModels.g.cs b/src/libs/Ollama/Generated/Ollama.ModelsClient.ListRunningModels.g.cs similarity index 77% rename from src/libs/Ollama/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.ModelsClient.ListRunningModels.g.cs rename to src/libs/Ollama/Generated/Ollama.ModelsClient.ListRunningModels.g.cs index 473a31f..df252eb 100644 --- a/src/libs/Ollama/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.ModelsClient.ListRunningModels.g.cs +++ b/src/libs/Ollama/Generated/Ollama.ModelsClient.ListRunningModels.g.cs @@ -1,4 +1,4 @@ - + #nullable enable namespace Ollama @@ -15,15 +15,23 @@ public partial class ModelsClient { using var httpRequest = new global::System.Net.Http.HttpRequestMessage( method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/ps", global::System.UriKind.RelativeOrAbsolute)); + requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri.TrimEnd('/') + "/ps", global::System.UriKind.RelativeOrAbsolute)); using var response = await _httpClient.SendAsync( request: httpRequest, completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, cancellationToken: cancellationToken).ConfigureAwait(false); - response.EnsureSuccessStatusCode(); - var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); + var __content = await response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + + try + { + response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException ex) + { + throw new global::System.InvalidOperationException(__content, ex); + } return global::System.Text.Json.JsonSerializer.Deserialize(__content, global::Ollama.SourceGenerationContext.Default.ProcessResponse) ?? diff --git a/src/libs/Ollama/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.ModelsClient.PullModel.g.cs b/src/libs/Ollama/Generated/Ollama.ModelsClient.PullModel.g.cs similarity index 93% rename from src/libs/Ollama/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.ModelsClient.PullModel.g.cs rename to src/libs/Ollama/Generated/Ollama.ModelsClient.PullModel.g.cs index 7f690a8..520a1cb 100644 --- a/src/libs/Ollama/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.ModelsClient.PullModel.g.cs +++ b/src/libs/Ollama/Generated/Ollama.ModelsClient.PullModel.g.cs @@ -1,4 +1,4 @@ - + #nullable enable namespace Ollama @@ -20,9 +20,10 @@ public partial class ModelsClient using var httpRequest = new global::System.Net.Http.HttpRequestMessage( method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/pull", global::System.UriKind.RelativeOrAbsolute)); + requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri.TrimEnd('/') + "/pull", global::System.UriKind.RelativeOrAbsolute)); + var __json = global::System.Text.Json.JsonSerializer.Serialize(request, global::Ollama.SourceGenerationContext.Default.PullModelRequest); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request, global::Ollama.SourceGenerationContext.Default.PullModelRequest), + content: __json, encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -32,7 +33,7 @@ public partial class ModelsClient cancellationToken: cancellationToken).ConfigureAwait(false); response.EnsureSuccessStatusCode(); - using var stream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false); + using var stream = await response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); using var reader = new global::System.IO.StreamReader(stream); while (!reader.EndOfStream && !cancellationToken.IsCancellationRequested) diff --git a/src/libs/Ollama/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.ModelsClient.PushModel.g.cs b/src/libs/Ollama/Generated/Ollama.ModelsClient.PushModel.g.cs similarity index 93% rename from src/libs/Ollama/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.ModelsClient.PushModel.g.cs rename to src/libs/Ollama/Generated/Ollama.ModelsClient.PushModel.g.cs index e61d58a..912ac8a 100644 --- a/src/libs/Ollama/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.ModelsClient.PushModel.g.cs +++ b/src/libs/Ollama/Generated/Ollama.ModelsClient.PushModel.g.cs @@ -1,4 +1,4 @@ - + #nullable enable namespace Ollama @@ -20,9 +20,10 @@ public partial class ModelsClient using var httpRequest = new global::System.Net.Http.HttpRequestMessage( method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/push", global::System.UriKind.RelativeOrAbsolute)); + requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri.TrimEnd('/') + "/push", global::System.UriKind.RelativeOrAbsolute)); + var __json = global::System.Text.Json.JsonSerializer.Serialize(request, global::Ollama.SourceGenerationContext.Default.PushModelRequest); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request, global::Ollama.SourceGenerationContext.Default.PushModelRequest), + content: __json, encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -32,7 +33,7 @@ public partial class ModelsClient cancellationToken: cancellationToken).ConfigureAwait(false); response.EnsureSuccessStatusCode(); - using var stream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false); + using var stream = await response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); using var reader = new global::System.IO.StreamReader(stream); while (!reader.EndOfStream && !cancellationToken.IsCancellationRequested) diff --git a/src/libs/Ollama/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.ModelsClient.ShowModelInfo.g.cs b/src/libs/Ollama/Generated/Ollama.ModelsClient.ShowModelInfo.g.cs similarity index 83% rename from src/libs/Ollama/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.ModelsClient.ShowModelInfo.g.cs rename to src/libs/Ollama/Generated/Ollama.ModelsClient.ShowModelInfo.g.cs index e2223e8..d0482aa 100644 --- a/src/libs/Ollama/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.ModelsClient.ShowModelInfo.g.cs +++ b/src/libs/Ollama/Generated/Ollama.ModelsClient.ShowModelInfo.g.cs @@ -1,4 +1,4 @@ - + #nullable enable namespace Ollama @@ -19,9 +19,10 @@ public partial class ModelsClient using var httpRequest = new global::System.Net.Http.HttpRequestMessage( method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/show", global::System.UriKind.RelativeOrAbsolute)); + requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri.TrimEnd('/') + "/show", global::System.UriKind.RelativeOrAbsolute)); + var __json = global::System.Text.Json.JsonSerializer.Serialize(request, global::Ollama.SourceGenerationContext.Default.ModelInfoRequest); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request, global::Ollama.SourceGenerationContext.Default.ModelInfoRequest), + content: __json, encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -29,9 +30,17 @@ public partial class ModelsClient request: httpRequest, completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, cancellationToken: cancellationToken).ConfigureAwait(false); - response.EnsureSuccessStatusCode(); - var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); + var __content = await response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + + try + { + response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException ex) + { + throw new global::System.InvalidOperationException(__content, ex); + } return global::System.Text.Json.JsonSerializer.Deserialize(__content, global::Ollama.SourceGenerationContext.Default.ModelInfo) ?? diff --git a/src/libs/Ollama/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.ModelsClient.g.cs b/src/libs/Ollama/Generated/Ollama.ModelsClient.g.cs similarity index 96% rename from src/libs/Ollama/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.ModelsClient.g.cs rename to src/libs/Ollama/Generated/Ollama.ModelsClient.g.cs index 79dc56a..9fd1387 100644 --- a/src/libs/Ollama/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.ModelsClient.g.cs +++ b/src/libs/Ollama/Generated/Ollama.ModelsClient.g.cs @@ -1,4 +1,4 @@ - + #nullable enable namespace Ollama @@ -24,7 +24,7 @@ public sealed partial class ModelsClient : global::System.IDisposable /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. ///
/// - /// + /// public ModelsClient( global::System.Net.Http.HttpClient? httpClient = null, global::System.Uri? baseUri = null diff --git a/src/libs/Ollama/Generated/Ollama.OllamaApiClient.GetVersion.g.cs b/src/libs/Ollama/Generated/Ollama.OllamaApiClient.GetVersion.g.cs new file mode 100644 index 0000000..c90c4c3 --- /dev/null +++ b/src/libs/Ollama/Generated/Ollama.OllamaApiClient.GetVersion.g.cs @@ -0,0 +1,42 @@ + +#nullable enable + +namespace Ollama +{ + public partial class OllamaApiClient + { + /// + /// Returns the version of the Ollama server.
+ /// This endpoint returns the version of the Ollama server. + ///
+ /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task GetVersionAsync( + global::System.Threading.CancellationToken cancellationToken = default) + { + using var httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri.TrimEnd('/') + "/version", global::System.UriKind.RelativeOrAbsolute)); + + using var response = await _httpClient.SendAsync( + request: httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: cancellationToken).ConfigureAwait(false); + + var __content = await response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + + try + { + response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException ex) + { + throw new global::System.InvalidOperationException(__content, ex); + } + + return + global::System.Text.Json.JsonSerializer.Deserialize(__content, global::Ollama.SourceGenerationContext.Default.VersionResponse) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + } +} \ No newline at end of file diff --git a/src/libs/Ollama/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.OllamaApiClient.g.cs b/src/libs/Ollama/Generated/Ollama.OllamaApiClient.g.cs similarity index 97% rename from src/libs/Ollama/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.OllamaApiClient.g.cs rename to src/libs/Ollama/Generated/Ollama.OllamaApiClient.g.cs index e8be988..4ff41d4 100644 --- a/src/libs/Ollama/Generated/net8.0/OpenApiGenerator/OpenApiGenerator.SdkGenerator/Ollama.OllamaApiClient.g.cs +++ b/src/libs/Ollama/Generated/Ollama.OllamaApiClient.g.cs @@ -1,4 +1,4 @@ - + #nullable enable namespace Ollama @@ -44,7 +44,7 @@ public sealed partial class OllamaApiClient : global::System.IDisposable /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. /// /// - /// + /// public OllamaApiClient( global::System.Net.Http.HttpClient? httpClient = null, global::System.Uri? baseUri = null diff --git a/src/libs/Ollama/Generated/Ollama.Polyfills.g.cs b/src/libs/Ollama/Generated/Ollama.Polyfills.g.cs new file mode 100644 index 0000000..2f07223 --- /dev/null +++ b/src/libs/Ollama/Generated/Ollama.Polyfills.g.cs @@ -0,0 +1,40 @@ + +#if !NET6_0_OR_GREATER +#nullable enable + +namespace Ollama +{ + /// + /// + /// + public static partial class OpenApiGeneratorPolyfills + { + /// + /// + /// + /// + /// + /// + public static global::System.Threading.Tasks.Task ReadAsStringAsync( + this global::System.Net.Http.HttpContent content, + global::System.Threading.CancellationToken cancellationToken) + { + content = content ?? throw new global::System.ArgumentNullException(nameof(content)); + return content.ReadAsStringAsync(); + } + /// + /// + /// + /// + /// + /// + public static global::System.Threading.Tasks.Task ReadAsStreamAsync( + this global::System.Net.Http.HttpContent content, + global::System.Threading.CancellationToken cancellationToken) + { + content = content ?? throw new global::System.ArgumentNullException(nameof(content)); + return content.ReadAsStreamAsync(); + } + } +} +#endif \ No newline at end of file diff --git a/src/libs/Ollama.Models/Message.Constructors.cs b/src/libs/Ollama/Message.Constructors.cs similarity index 100% rename from src/libs/Ollama.Models/Message.Constructors.cs rename to src/libs/Ollama/Message.Constructors.cs diff --git a/src/libs/Ollama/Ollama.csproj b/src/libs/Ollama/Ollama.csproj index 547a9bf..18f82f1 100644 --- a/src/libs/Ollama/Ollama.csproj +++ b/src/libs/Ollama/Ollama.csproj @@ -14,43 +14,12 @@ Generated C# SDK based on Ollama OpenAPI specification. api;client;sdk;dotnet;swagger;openapi;specification;ollama;generated
- - - Ollama - OllamaApiClient - false - true - true - Ollama.SourceGenerationContext - - - - true - Generated\$(TargetFramework) - - - - - - - - - - - - - - all runtime; build; native; contentfiles; analyzers; buildtransitive - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - @@ -58,8 +27,4 @@ - - - - diff --git a/src/libs/Ollama/OllamaApiClientExtensions.cs b/src/libs/Ollama/OllamaApiClientExtensions.cs index b02a672..dec35ad 100644 --- a/src/libs/Ollama/OllamaApiClientExtensions.cs +++ b/src/libs/Ollama/OllamaApiClientExtensions.cs @@ -67,9 +67,9 @@ public static void EnsureSuccess( { response = response ?? throw new ArgumentNullException(nameof(response)); - if (response.Status.Value2 != PullModelResponseStatus.Success) + if (response.Status?.Value2 != PullModelResponseStatus.Success) { - throw new InvalidOperationException($"Failed to pull model with status {response.Status.Object}"); + throw new InvalidOperationException($"Failed to pull model with status {response.Status?.Object}"); } } @@ -85,7 +85,7 @@ public static async Task WaitAsync( var text = string.Empty; var currentResponse = new GenerateCompletionResponse(); - await foreach (var response in enumerable) + await foreach (var response in enumerable.ConfigureAwait(false)) { text += response.Response; currentResponse = response; @@ -110,7 +110,7 @@ public static async Task WaitAsync( var responseContent = new StringBuilder(); var currentResponse = new GenerateChatCompletionResponse(); - await foreach (var response in enumerable) + await foreach (var response in enumerable.ConfigureAwait(false)) { responseRole ??= response.Message?.Role; responseContent.Append(response.Message?.Content); @@ -138,7 +138,7 @@ public static async Task WaitAsync( enumerable = enumerable ?? throw new ArgumentNullException(nameof(enumerable)); var currentResponse = new T(); - await foreach (var response in enumerable) + await foreach (var response in enumerable.ConfigureAwait(false)) { currentResponse = response; } diff --git a/src/libs/Ollama/SourceGenerationContext.cs b/src/libs/Ollama/SourceGenerationContext.cs deleted file mode 100644 index 5046cd4..0000000 --- a/src/libs/Ollama/SourceGenerationContext.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System.Text.Json.Serialization; -using OpenApiGenerator.JsonConverters; - -namespace Ollama; - -[JsonSourceGenerationOptions( - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull, - Converters = - [ - // We need specify explicitly all converters for enums inside AnyOf/OneOf/AllOf to make them work - typeof(ResponseFormatJsonConverter), - typeof(ResponseFormatNullableJsonConverter), - typeof(GenerateChatCompletionResponseDoneReasonJsonConverter), - typeof(GenerateChatCompletionResponseDoneReasonNullableJsonConverter), - typeof(DoneReasonVariant2JsonConverter), - typeof(DoneReasonVariant2NullableJsonConverter), - typeof(MessageRoleJsonConverter), - typeof(MessageRoleNullableJsonConverter), - typeof(CreateModelResponseStatusJsonConverter), - typeof(CreateModelResponseStatusNullableJsonConverter), - typeof(CreateModelStatusVariant2JsonConverter), - typeof(CreateModelStatusVariant2NullableJsonConverter), - typeof(PullModelResponseStatusJsonConverter), - typeof(PullModelResponseStatusNullableJsonConverter), - typeof(PullModelStatusVariant2JsonConverter), - typeof(PullModelStatusVariant2NullableJsonConverter), - typeof(PushModelResponseStatusJsonConverter), - typeof(PushModelResponseStatusNullableJsonConverter), - typeof(PushModelStatusVariant2JsonConverter), - typeof(PushModelStatusVariant2NullableJsonConverter), - ])] -[JsonSerializable(typeof(JsonSerializerContextTypes))] -internal sealed partial class SourceGenerationContext : JsonSerializerContext; \ No newline at end of file diff --git a/src/libs/Ollama/generate.sh b/src/libs/Ollama/generate.sh new file mode 100644 index 0000000..bd3c633 --- /dev/null +++ b/src/libs/Ollama/generate.sh @@ -0,0 +1,13 @@ +dotnet tool install --global openapigenerator.cli --prerelease +rm -rf Generated +# curl -O https://raw.githubusercontent.com/openai/openai-openapi/master/openapi.yaml +# dotnet run --project ../../helpers/FixOpenApiSpec openapi.yaml +# if [ $? -ne 0 ]; then +# echo "Failed, exiting..." +# exit 1 +# fi +oag generate ../../../docs/openapi.yaml \ + --namespace Ollama \ + --clientClassName OllamaApiClient \ + --targetFramework net8.0 \ + --output Generated \ No newline at end of file diff --git a/src/tests/Ollama.IntegrationTests/Tests.Integration.cs b/src/tests/Ollama.IntegrationTests/Tests.Integration.cs index f005cfd..181fec5 100755 --- a/src/tests/Ollama.IntegrationTests/Tests.Integration.cs +++ b/src/tests/Ollama.IntegrationTests/Tests.Integration.cs @@ -10,14 +10,14 @@ private static async Task PrepareEnvironmentAsync(EnvironmentType e { case EnvironmentType.Local: { - // set OLLAMA_HOST=172.16.50.107:11434 + // set OLLAMA_HOST=10.10.0.125:11434 // ollama serve var apiClient = new OllamaApiClient( httpClient: new HttpClient { Timeout = TimeSpan.FromMinutes(10), }, - baseUri: new Uri("http://172.16.50.107:11434/api")); + baseUri: new Uri("http://10.10.0.125:11434/api")); if (!string.IsNullOrEmpty(model)) { @@ -81,7 +81,7 @@ public async Task PullModel() await foreach (var response in container.ApiClient.Models.PullModelAsync("all-minilm", stream: true)) { - Console.WriteLine($"{response.Status.Object}. Progress: {response.Completed}/{response.Total}"); + Console.WriteLine($"{response.Status?.Object}. Progress: {response.Completed}/{response.Total}"); } var response2 = await container.ApiClient.Models.PullModelAsync("all-minilm").WaitAsync();