Skip to content

Commit

Permalink
fix: Fixed some docs warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
HavenDV committed May 19, 2024
1 parent b224749 commit 6df028a
Show file tree
Hide file tree
Showing 219 changed files with 497 additions and 25 deletions.
2 changes: 1 addition & 1 deletion src/libs/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
</ItemGroup>

<PropertyGroup Label="Versioning">
<Version>0.6.2</Version>
<Version>0.6.3</Version>
<MinVerMinimumMajorMinor>0.1</MinVerMinimumMajorMinor>
<MinVerTagPrefix>v</MinVerTagPrefix>
<MinVerDefaultPreReleaseIdentifiers>dev</MinVerDefaultPreReleaseIdentifiers>
Expand Down
12 changes: 8 additions & 4 deletions src/libs/OpenApiGenerator.Core/Generation/Sources.Methods.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System.Net.Http;
using Microsoft.OpenApi.Models;
using OpenApiGenerator.Core.Extensions;
using OpenApiGenerator.Core.Json;
using OpenApiGenerator.Core.Models;
Expand Down Expand Up @@ -38,6 +36,10 @@ public static string GenerateConstructors(
namespace {endPoint.Namespace}
{{
/// <summary>
/// If no httpClient is provided, a new one will be created.
/// If no baseUri is provided, the default baseUri from OpenAPI spec will be used.
/// </summary>
public sealed partial class {endPoint.ClassName} : global::System.IDisposable
{{
private readonly global::System.Net.Http.HttpClient _httpClient;
Expand All @@ -47,9 +49,8 @@ public sealed partial class {endPoint.ClassName} : global::System.IDisposable
/// If no httpClient is provided, a new one will be created.
/// If no baseUri is provided, the default baseUri from OpenAPI spec will be used.
/// </summary>
/// <param name=""client""></param>
/// <param name=""httpClient""></param>
/// <param name=""baseUri""></param>
/// <exception cref=""global::System.ArgumentNullException""></exception>
public {endPoint.ClassName}(
global::System.Net.Http.HttpClient? httpClient = null,
global::System.Uri? baseUri = null)
Expand Down Expand Up @@ -89,6 +90,9 @@ public static string GenerateMethod(
/// <summary>
/// {endPoint.Summary}
/// </summary>
{endPoint.Properties.Where(x => x.ParameterLocation != null).Select(x => $@"
/// <param name=""{x.Name.ToParameterName()}""></param>").Inject()}
/// <param name=""request""></param>
/// <param name=""cancellationToken"">The token to cancel the operation with</param>
/// <exception cref=""global::System.InvalidOperationException""></exception>
public async {taskType} {endPoint.MethodName}(
Expand Down
4 changes: 4 additions & 0 deletions src/libs/OpenApiGenerator.Core/OpenApiGenerator.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
<NoWarn>$(NoWarn);CA1031;CA1307;CA1724;CA1056;CA1054;CA1865;CA1847</NoWarn>
</PropertyGroup>

<ItemGroup Label="Global Usings">
<Using Include="System.Net.Http" />
</ItemGroup>

<PropertyGroup Label="NuGet">
<Description>Allows you to partially (for example, only models) or completely generate a native (without dependencies) C# client sdk according to the OpenAPI specification. Inspired by NSwag. Uses IncrementalGenerators for efficient generation and caching.</Description>
<PackageTags>openapi;sdk;generator;source generator;dotnet;netstandard;netframework;native;nswag;incremental</PackageTags>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

namespace G
{
/// <summary>
/// If no httpClient is provided, a new one will be created.
/// If no baseUri is provided, the default baseUri from OpenAPI spec will be used.
/// </summary>
public sealed partial class Api : global::System.IDisposable
{
private readonly global::System.Net.Http.HttpClient _httpClient;
Expand All @@ -13,9 +17,8 @@ public sealed partial class Api : global::System.IDisposable
/// If no httpClient is provided, a new one will be created.
/// If no baseUri is provided, the default baseUri from OpenAPI spec will be used.
/// </summary>
/// <param name="client"></param>
/// <param name="httpClient"></param>
/// <param name="baseUri"></param>
/// <exception cref="global::System.ArgumentNullException"></exception>
public Api(
global::System.Net.Http.HttpClient? httpClient = null,
global::System.Uri? baseUri = null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public partial class Api
/// <summary>
/// Create Run
/// </summary>
/// <param name="request"></param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
public async global::System.Threading.Tasks.Task Create_run_runs_postAsync(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ public partial class Api
/// <summary>
/// Update Run
/// </summary>
/// <param name="runId"></param>
/// <param name="request"></param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
public async global::System.Threading.Tasks.Task Update_run_runs__run_id__patchAsync(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

namespace G
{
/// <summary>
/// If no httpClient is provided, a new one will be created.
/// If no baseUri is provided, the default baseUri from OpenAPI spec will be used.
/// </summary>
public sealed partial class Api : global::System.IDisposable
{
private readonly global::System.Net.Http.HttpClient _httpClient;
Expand All @@ -13,9 +17,8 @@ public sealed partial class Api : global::System.IDisposable
/// If no httpClient is provided, a new one will be created.
/// If no baseUri is provided, the default baseUri from OpenAPI spec will be used.
/// </summary>
/// <param name="client"></param>
/// <param name="httpClient"></param>
/// <param name="baseUri"></param>
/// <exception cref="global::System.ArgumentNullException"></exception>
public Api(
global::System.Net.Http.HttpClient? httpClient = null,
global::System.Uri? baseUri = null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public partial class Api
/// <summary>
/// Create Run
/// </summary>
/// <param name="request"></param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
public async global::System.Threading.Tasks.Task Create_run_runs_postAsync(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ public partial class Api
/// <summary>
/// Update Run
/// </summary>
/// <param name="runId"></param>
/// <param name="request"></param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
public async global::System.Threading.Tasks.Task Update_run_runs__run_id__patchAsync(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

namespace G
{
/// <summary>
/// If no httpClient is provided, a new one will be created.
/// If no baseUri is provided, the default baseUri from OpenAPI spec will be used.
/// </summary>
public sealed partial class Api : global::System.IDisposable
{
private readonly global::System.Net.Http.HttpClient _httpClient;
Expand All @@ -13,9 +17,8 @@ public sealed partial class Api : global::System.IDisposable
/// If no httpClient is provided, a new one will be created.
/// If no baseUri is provided, the default baseUri from OpenAPI spec will be used.
/// </summary>
/// <param name="client"></param>
/// <param name="httpClient"></param>
/// <param name="baseUri"></param>
/// <exception cref="global::System.ArgumentNullException"></exception>
public Api(
global::System.Net.Http.HttpClient? httpClient = null,
global::System.Uri? baseUri = null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public partial class Api
/// <summary>
/// Creates a model with another name from an existing model.
/// </summary>
/// <param name="request"></param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
public async global::System.Threading.Tasks.Task CopyModelAsync(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public partial class Api
/// <summary>
/// Create a model from a Modelfile.
/// </summary>
/// <param name="request"></param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
public async global::System.Collections.Generic.IAsyncEnumerable<CreateModelResponse> CreateModelAsync(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public partial class Api
/// <summary>
/// Delete a model and its data.
/// </summary>
/// <param name="request"></param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
public async global::System.Threading.Tasks.Task DeleteModelAsync(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public partial class Api
/// <summary>
/// Generate the next message in a chat with a provided model.
/// </summary>
/// <param name="request"></param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
public async global::System.Collections.Generic.IAsyncEnumerable<GenerateChatCompletionResponse> GenerateChatCompletionAsync(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public partial class Api
/// <summary>
/// Generate a response for a given prompt with a provided model.
/// </summary>
/// <param name="request"></param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
public async global::System.Collections.Generic.IAsyncEnumerable<GenerateCompletionResponse> GenerateCompletionAsync(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public partial class Api
/// <summary>
/// Generate embeddings from a model.
/// </summary>
/// <param name="request"></param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
public async global::System.Threading.Tasks.Task<GenerateEmbeddingResponse> GenerateEmbeddingAsync(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public partial class Api
/// <summary>
/// List models that are available locally.
/// </summary>
/// <param name="request"></param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
public async global::System.Threading.Tasks.Task<ModelsResponse> ListModelsAsync(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public partial class Api
/// <summary>
/// Download a model from the ollama library.
/// </summary>
/// <param name="request"></param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
public async global::System.Threading.Tasks.Task<PullModelResponse> PullModelAsync(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public partial class Api
/// <summary>
/// Upload a model to a model library.
/// </summary>
/// <param name="request"></param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
public async global::System.Threading.Tasks.Task<PushModelResponse> PushModelAsync(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public partial class Api
/// <summary>
/// Show details about a model including modelfile, template, parameters, license, and system prompt.
/// </summary>
/// <param name="request"></param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
public async global::System.Threading.Tasks.Task<ModelInfo> ShowModelInfoAsync(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

namespace G
{
/// <summary>
/// If no httpClient is provided, a new one will be created.
/// If no baseUri is provided, the default baseUri from OpenAPI spec will be used.
/// </summary>
public sealed partial class Api : global::System.IDisposable
{
private readonly global::System.Net.Http.HttpClient _httpClient;
Expand All @@ -13,9 +17,8 @@ public sealed partial class Api : global::System.IDisposable
/// If no httpClient is provided, a new one will be created.
/// If no baseUri is provided, the default baseUri from OpenAPI spec will be used.
/// </summary>
/// <param name="client"></param>
/// <param name="httpClient"></param>
/// <param name="baseUri"></param>
/// <exception cref="global::System.ArgumentNullException"></exception>
public Api(
global::System.Net.Http.HttpClient? httpClient = null,
global::System.Uri? baseUri = null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public partial class Api
/// <summary>
/// Creates a model with another name from an existing model.
/// </summary>
/// <param name="request"></param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
public async global::System.Threading.Tasks.Task CopyModelAsync(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public partial class Api
/// <summary>
/// Create a model from a Modelfile.
/// </summary>
/// <param name="request"></param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
public async global::System.Collections.Generic.IAsyncEnumerable<CreateModelResponse> CreateModelAsync(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public partial class Api
/// <summary>
/// Delete a model and its data.
/// </summary>
/// <param name="request"></param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
public async global::System.Threading.Tasks.Task DeleteModelAsync(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public partial class Api
/// <summary>
/// Generate the next message in a chat with a provided model.
/// </summary>
/// <param name="request"></param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
public async global::System.Collections.Generic.IAsyncEnumerable<GenerateChatCompletionResponse> GenerateChatCompletionAsync(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public partial class Api
/// <summary>
/// Generate a response for a given prompt with a provided model.
/// </summary>
/// <param name="request"></param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
public async global::System.Collections.Generic.IAsyncEnumerable<GenerateCompletionResponse> GenerateCompletionAsync(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public partial class Api
/// <summary>
/// Generate embeddings from a model.
/// </summary>
/// <param name="request"></param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
public async global::System.Threading.Tasks.Task<GenerateEmbeddingResponse> GenerateEmbeddingAsync(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public partial class Api
/// <summary>
/// List models that are available locally.
/// </summary>
/// <param name="request"></param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
public async global::System.Threading.Tasks.Task<ModelsResponse> ListModelsAsync(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public partial class Api
/// <summary>
/// Download a model from the ollama library.
/// </summary>
/// <param name="request"></param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
public async global::System.Threading.Tasks.Task<PullModelResponse> PullModelAsync(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public partial class Api
/// <summary>
/// Upload a model to a model library.
/// </summary>
/// <param name="request"></param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
public async global::System.Threading.Tasks.Task<PushModelResponse> PushModelAsync(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public partial class Api
/// <summary>
/// Show details about a model including modelfile, template, parameters, license, and system prompt.
/// </summary>
/// <param name="request"></param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
public async global::System.Threading.Tasks.Task<ModelInfo> ShowModelInfoAsync(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ public partial class Api
/// <summary>
/// Cancels an in-progress batch.
/// </summary>
/// <param name="batchId"></param>
/// <param name="request"></param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
public async global::System.Threading.Tasks.Task<Batch> CancelBatchAsync(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ public partial class Api
/// <summary>
/// Immediately cancel a fine-tune job.
/// </summary>
/// <param name="fineTuningJobId"></param>
/// <param name="request"></param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
public async global::System.Threading.Tasks.Task<FineTuningJob> CancelFineTuningJobAsync(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ public partial class Api
/// <summary>
/// Cancels a run that is `in_progress`.
/// </summary>
/// <param name="threadId"></param>
/// <param name="runId"></param>
/// <param name="request"></param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
public async global::System.Threading.Tasks.Task<RunObject> CancelRunAsync(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ public partial class Api
/// <summary>
/// Cancel a vector store file batch. This attempts to cancel the processing of files in this batch as soon as possible.
/// </summary>
/// <param name="vectorStoreId"></param>
/// <param name="batchId"></param>
/// <param name="request"></param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
public async global::System.Threading.Tasks.Task<VectorStoreFileBatchObject> CancelVectorStoreFileBatchAsync(
Expand Down
Loading

0 comments on commit 6df028a

Please sign in to comment.