From 54c8b4700cd39cab88a9cbc45ce0b7651038b369 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 1 Oct 2024 01:57:26 +0000 Subject: [PATCH] feat: Updated OpenAPI spec --- src/libs/Ollama/Generated/AnyOf.2.g.cs | 48 +++++++++++++++++++ .../Ollama/Generated/Ollama.ChatClient.g.cs | 8 +++- .../Generated/Ollama.CompletionsClient.g.cs | 8 +++- .../Generated/Ollama.EmbeddingsClient.g.cs | 8 +++- .../Ollama.Models.CreateModelStatus.g.cs | 48 +++++++++++++++++++ .../Generated/Ollama.Models.DoneReason.g.cs | 48 +++++++++++++++++++ .../Ollama.Models.PullModelStatus.g.cs | 48 +++++++++++++++++++ .../Ollama/Generated/Ollama.ModelsClient.g.cs | 8 +++- .../Generated/Ollama.OllamaApiClient.g.cs | 16 ++++--- .../Ollama/Generated/Ollama.PathBuilder.g.cs | 16 +++++++ 10 files changed, 242 insertions(+), 14 deletions(-) diff --git a/src/libs/Ollama/Generated/AnyOf.2.g.cs b/src/libs/Ollama/Generated/AnyOf.2.g.cs index e7ed8f2..1d0231f 100644 --- a/src/libs/Ollama/Generated/AnyOf.2.g.cs +++ b/src/libs/Ollama/Generated/AnyOf.2.g.cs @@ -107,6 +107,54 @@ public bool Validate() return IsValue1 || IsValue2; } + /// + /// + /// + public TResult? Match( + global::System.Func? value1 = null, + global::System.Func? value2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsValue1 && value1 != null) + { + return value1(Value1!); + } + else if (IsValue2 && value2 != null) + { + return value2(Value2!); + } + + return default(TResult); + } + + /// + /// + /// + public void Match( + global::System.Action? value1 = null, + global::System.Action? value2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsValue1) + { + value1?.Invoke(Value1!); + } + else if (IsValue2) + { + value2?.Invoke(Value2!); + } + } + /// /// /// diff --git a/src/libs/Ollama/Generated/Ollama.ChatClient.g.cs b/src/libs/Ollama/Generated/Ollama.ChatClient.g.cs index 7c88096..eb27933 100644 --- a/src/libs/Ollama/Generated/Ollama.ChatClient.g.cs +++ b/src/libs/Ollama/Generated/Ollama.ChatClient.g.cs @@ -16,6 +16,7 @@ public sealed partial class ChatClient : global::Ollama.IChatClient, global::Sys public const string BaseUrl = "http://localhost:11434/api"; private readonly global::System.Net.Http.HttpClient _httpClient; + private global::Ollama.EndPointAuthorization? _authorization; /// /// @@ -29,13 +30,16 @@ public sealed partial class ChatClient : global::Ollama.IChatClient, global::Sys /// 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) + global::System.Uri? baseUri = null, + global::Ollama.EndPointAuthorization? authorization = null) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri(BaseUrl); + _authorization = authorization; Initialized(_httpClient); } diff --git a/src/libs/Ollama/Generated/Ollama.CompletionsClient.g.cs b/src/libs/Ollama/Generated/Ollama.CompletionsClient.g.cs index fcb791e..921f95a 100644 --- a/src/libs/Ollama/Generated/Ollama.CompletionsClient.g.cs +++ b/src/libs/Ollama/Generated/Ollama.CompletionsClient.g.cs @@ -16,6 +16,7 @@ public sealed partial class CompletionsClient : global::Ollama.ICompletionsClien public const string BaseUrl = "http://localhost:11434/api"; private readonly global::System.Net.Http.HttpClient _httpClient; + private global::Ollama.EndPointAuthorization? _authorization; /// /// @@ -29,13 +30,16 @@ public sealed partial class CompletionsClient : global::Ollama.ICompletionsClien /// 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) + global::System.Uri? baseUri = null, + global::Ollama.EndPointAuthorization? authorization = null) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri(BaseUrl); + _authorization = authorization; Initialized(_httpClient); } diff --git a/src/libs/Ollama/Generated/Ollama.EmbeddingsClient.g.cs b/src/libs/Ollama/Generated/Ollama.EmbeddingsClient.g.cs index f12daf7..a197907 100644 --- a/src/libs/Ollama/Generated/Ollama.EmbeddingsClient.g.cs +++ b/src/libs/Ollama/Generated/Ollama.EmbeddingsClient.g.cs @@ -16,6 +16,7 @@ public sealed partial class EmbeddingsClient : global::Ollama.IEmbeddingsClient, public const string BaseUrl = "http://localhost:11434/api"; private readonly global::System.Net.Http.HttpClient _httpClient; + private global::Ollama.EndPointAuthorization? _authorization; /// /// @@ -29,13 +30,16 @@ public sealed partial class EmbeddingsClient : global::Ollama.IEmbeddingsClient, /// 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) + global::System.Uri? baseUri = null, + global::Ollama.EndPointAuthorization? authorization = null) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri(BaseUrl); + _authorization = authorization; Initialized(_httpClient); } diff --git a/src/libs/Ollama/Generated/Ollama.Models.CreateModelStatus.g.cs b/src/libs/Ollama/Generated/Ollama.Models.CreateModelStatus.g.cs index e7f81a2..a9b9a29 100644 --- a/src/libs/Ollama/Generated/Ollama.Models.CreateModelStatus.g.cs +++ b/src/libs/Ollama/Generated/Ollama.Models.CreateModelStatus.g.cs @@ -108,6 +108,54 @@ public bool Validate() return IsValue1 || IsValue2; } + /// + /// + /// + public TResult? Match( + global::System.Func? value1 = null, + global::System.Func? value2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsValue1 && value1 != null) + { + return value1(Value1!); + } + else if (IsValue2 && value2 != null) + { + return value2(Value2!); + } + + return default(TResult); + } + + /// + /// + /// + public void Match( + global::System.Action? value1 = null, + global::System.Action? value2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsValue1) + { + value1?.Invoke(Value1!); + } + else if (IsValue2) + { + value2?.Invoke(Value2!); + } + } + /// /// /// diff --git a/src/libs/Ollama/Generated/Ollama.Models.DoneReason.g.cs b/src/libs/Ollama/Generated/Ollama.Models.DoneReason.g.cs index f62b237..c6becb5 100644 --- a/src/libs/Ollama/Generated/Ollama.Models.DoneReason.g.cs +++ b/src/libs/Ollama/Generated/Ollama.Models.DoneReason.g.cs @@ -108,6 +108,54 @@ public bool Validate() return IsValue1 || IsValue2; } + /// + /// + /// + public TResult? Match( + global::System.Func? value1 = null, + global::System.Func? value2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsValue1 && value1 != null) + { + return value1(Value1!); + } + else if (IsValue2 && value2 != null) + { + return value2(Value2!); + } + + return default(TResult); + } + + /// + /// + /// + public void Match( + global::System.Action? value1 = null, + global::System.Action? value2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsValue1) + { + value1?.Invoke(Value1!); + } + else if (IsValue2) + { + value2?.Invoke(Value2!); + } + } + /// /// /// diff --git a/src/libs/Ollama/Generated/Ollama.Models.PullModelStatus.g.cs b/src/libs/Ollama/Generated/Ollama.Models.PullModelStatus.g.cs index 2af0972..76cad41 100644 --- a/src/libs/Ollama/Generated/Ollama.Models.PullModelStatus.g.cs +++ b/src/libs/Ollama/Generated/Ollama.Models.PullModelStatus.g.cs @@ -109,6 +109,54 @@ public bool Validate() return IsValue1 || IsValue2; } + /// + /// + /// + public TResult? Match( + global::System.Func? value1 = null, + global::System.Func? value2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsValue1 && value1 != null) + { + return value1(Value1!); + } + else if (IsValue2 && value2 != null) + { + return value2(Value2!); + } + + return default(TResult); + } + + /// + /// + /// + public void Match( + global::System.Action? value1 = null, + global::System.Action? value2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsValue1) + { + value1?.Invoke(Value1!); + } + else if (IsValue2) + { + value2?.Invoke(Value2!); + } + } + /// /// /// diff --git a/src/libs/Ollama/Generated/Ollama.ModelsClient.g.cs b/src/libs/Ollama/Generated/Ollama.ModelsClient.g.cs index ec1b184..9cd1ac9 100644 --- a/src/libs/Ollama/Generated/Ollama.ModelsClient.g.cs +++ b/src/libs/Ollama/Generated/Ollama.ModelsClient.g.cs @@ -16,6 +16,7 @@ public sealed partial class ModelsClient : global::Ollama.IModelsClient, global: public const string BaseUrl = "http://localhost:11434/api"; private readonly global::System.Net.Http.HttpClient _httpClient; + private global::Ollama.EndPointAuthorization? _authorization; /// /// @@ -29,13 +30,16 @@ public sealed partial class ModelsClient : global::Ollama.IModelsClient, global: /// 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) + global::System.Uri? baseUri = null, + global::Ollama.EndPointAuthorization? authorization = null) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri(BaseUrl); + _authorization = authorization; Initialized(_httpClient); } diff --git a/src/libs/Ollama/Generated/Ollama.OllamaApiClient.g.cs b/src/libs/Ollama/Generated/Ollama.OllamaApiClient.g.cs index 88e8a2b..5800ac6 100644 --- a/src/libs/Ollama/Generated/Ollama.OllamaApiClient.g.cs +++ b/src/libs/Ollama/Generated/Ollama.OllamaApiClient.g.cs @@ -16,6 +16,7 @@ public sealed partial class OllamaApiClient : global::Ollama.IOllamaApiClient, g public const string BaseUrl = "http://localhost:11434/api"; private readonly global::System.Net.Http.HttpClient _httpClient; + private global::Ollama.EndPointAuthorization? _authorization; /// /// @@ -26,7 +27,7 @@ public sealed partial class OllamaApiClient : global::Ollama.IOllamaApiClient, g /// /// Given a prompt, the model will generate a completion. /// - public CompletionsClient Completions => new CompletionsClient(_httpClient) + public CompletionsClient Completions => new CompletionsClient(_httpClient, authorization: _authorization) { JsonSerializerContext = JsonSerializerContext, }; @@ -34,7 +35,7 @@ public sealed partial class OllamaApiClient : global::Ollama.IOllamaApiClient, g /// /// Given a list of messages comprising a conversation, the model will return a response. /// - public ChatClient Chat => new ChatClient(_httpClient) + public ChatClient Chat => new ChatClient(_httpClient, authorization: _authorization) { JsonSerializerContext = JsonSerializerContext, }; @@ -42,7 +43,7 @@ public sealed partial class OllamaApiClient : global::Ollama.IOllamaApiClient, g /// /// Get a vector representation of a given input. /// - public EmbeddingsClient Embeddings => new EmbeddingsClient(_httpClient) + public EmbeddingsClient Embeddings => new EmbeddingsClient(_httpClient, authorization: _authorization) { JsonSerializerContext = JsonSerializerContext, }; @@ -50,7 +51,7 @@ public sealed partial class OllamaApiClient : global::Ollama.IOllamaApiClient, g /// /// List and describe the various models available. /// - public ModelsClient Models => new ModelsClient(_httpClient) + public ModelsClient Models => new ModelsClient(_httpClient, authorization: _authorization) { JsonSerializerContext = JsonSerializerContext, }; @@ -61,13 +62,16 @@ public sealed partial class OllamaApiClient : global::Ollama.IOllamaApiClient, g /// 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) + global::System.Uri? baseUri = null, + global::Ollama.EndPointAuthorization? authorization = null) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri(BaseUrl); + _authorization = authorization; Initialized(_httpClient); } diff --git a/src/libs/Ollama/Generated/Ollama.PathBuilder.g.cs b/src/libs/Ollama/Generated/Ollama.PathBuilder.g.cs index 45fd3fc..2a6ac5a 100644 --- a/src/libs/Ollama/Generated/Ollama.PathBuilder.g.cs +++ b/src/libs/Ollama/Generated/Ollama.PathBuilder.g.cs @@ -224,4 +224,20 @@ public PathBuilder AddOptionalParameter( /// The constructed URL. public override string ToString() => _stringBuilder.ToString(); } + + /// + /// + /// + public class EndPointAuthorization + { + /// + /// + /// + public string Name { get; set; } = string.Empty; + + /// + /// + /// + public string Value { get; set; } = string.Empty; + } } \ No newline at end of file