Skip to content

Commit

Permalink
fix: Add default values to parameters.
Browse files Browse the repository at this point in the history
  • Loading branch information
HavenDV committed May 19, 2024
1 parent 6df028a commit 95372b8
Show file tree
Hide file tree
Showing 64 changed files with 356 additions and 354 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.3</Version>
<Version>0.6.4</Version>
<MinVerMinimumMajorMinor>0.1</MinVerMinimumMajorMinor>
<MinVerTagPrefix>v</MinVerTagPrefix>
<MinVerDefaultPreReleaseIdentifiers>dev</MinVerDefaultPreReleaseIdentifiers>
Expand Down
4 changes: 3 additions & 1 deletion src/libs/OpenApiGenerator.Core/Generation/Sources.Methods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,10 @@ public static string GenerateExtensionMethod(
/// <param name=""cancellationToken"">The token to cancel the operation with</param>
/// <exception cref=""global::System.InvalidOperationException""></exception>
public async {taskType} {endPoint.MethodName}(
{endPoint.Properties.Select(x => $@"
{endPoint.Properties.Where(static x => x.IsRequired).Select(x => $@"
{x.Type.CSharpType} {x.Name.ToParameterName()},").Inject()}
{endPoint.Properties.Where(static x => !x.IsRequired).Select(x => $@"
{x.Type.CSharpType} {x.Name.ToParameterName()} = default,").Inject()}
{cancellationTokenAttribute}global::System.Threading.CancellationToken cancellationToken = default)
{{
var request = new {endPoint.RequestType}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,24 +59,24 @@ public partial class Api
/// <exception cref="global::System.InvalidOperationException"></exception>
public async global::System.Threading.Tasks.Task Create_run_runs_postAsync(
string name,
object? inputs,
RunCreateSchemaExtendedRunType runType,
global::System.DateTime startTime,
global::System.DateTime endTime,
RunCreateSchemaExtendedExtra? extra,
string? error,
int executionOrder,
RunCreateSchemaExtendedSerialized? serialized,
object? outputs,
string? parentRunId,
string? manifestId,
global::System.Collections.Generic.IList<RunCreateSchemaExtendedEvents?>? events,
global::System.Collections.Generic.IList<string?>? tags,
string? id,
string? sessionId,
string? sessionName,
global::System.Collections.Generic.IList<RunCreateSchema>? childRuns,
string? referenceExampleId,
object? inputs = default,
global::System.DateTime startTime = default,
global::System.DateTime endTime = default,
RunCreateSchemaExtendedExtra? extra = default,
string? error = default,
int executionOrder = default,
RunCreateSchemaExtendedSerialized? serialized = default,
object? outputs = default,
string? parentRunId = default,
string? manifestId = default,
global::System.Collections.Generic.IList<RunCreateSchemaExtendedEvents?>? events = default,
global::System.Collections.Generic.IList<string?>? tags = default,
string? id = default,
string? sessionId = default,
string? sessionName = default,
global::System.Collections.Generic.IList<RunCreateSchema>? childRuns = default,
string? referenceExampleId = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
var request = new RunCreateSchemaExtended
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ public partial class Api
/// <exception cref="global::System.InvalidOperationException"></exception>
public async global::System.Threading.Tasks.Task Update_run_runs__run_id__patchAsync(
string runId,
global::System.DateTime endTime,
string? error,
object? inputs,
object? outputs,
global::System.Collections.Generic.IList<RunUpdateSchemaExtendedEvents?>? events,
global::System.DateTime endTime = default,
string? error = default,
object? inputs = default,
object? outputs = default,
global::System.Collections.Generic.IList<RunUpdateSchemaExtendedEvents?>? events = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
var request = new RunUpdateSchemaExtended
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,24 +59,24 @@ public partial class Api
/// <exception cref="global::System.InvalidOperationException"></exception>
public async global::System.Threading.Tasks.Task Create_run_runs_postAsync(
string name,
object? inputs,
string runType,
global::System.DateTime startTime,
global::System.DateTime endTime,
RunCreateSchemaExtendedExtra? extra,
string? error,
int executionOrder,
RunCreateSchemaExtendedSerialized? serialized,
object? outputs,
string? parentRunId,
string? manifestId,
global::System.Collections.Generic.IList<RunCreateSchemaExtendedEvents?>? events,
global::System.Collections.Generic.IList<string?>? tags,
string? id,
string? sessionId,
string? sessionName,
global::System.Collections.Generic.IList<RunCreateSchema>? childRuns,
string? referenceExampleId,
object? inputs = default,
global::System.DateTime startTime = default,
global::System.DateTime endTime = default,
RunCreateSchemaExtendedExtra? extra = default,
string? error = default,
int executionOrder = default,
RunCreateSchemaExtendedSerialized? serialized = default,
object? outputs = default,
string? parentRunId = default,
string? manifestId = default,
global::System.Collections.Generic.IList<RunCreateSchemaExtendedEvents?>? events = default,
global::System.Collections.Generic.IList<string?>? tags = default,
string? id = default,
string? sessionId = default,
string? sessionName = default,
global::System.Collections.Generic.IList<RunCreateSchema>? childRuns = default,
string? referenceExampleId = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
var request = new RunCreateSchemaExtended
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ public partial class Api
/// <exception cref="global::System.InvalidOperationException"></exception>
public async global::System.Threading.Tasks.Task Update_run_runs__run_id__patchAsync(
string runId,
global::System.DateTime endTime,
string? error,
object? inputs,
object? outputs,
global::System.Collections.Generic.IList<RunUpdateSchemaExtendedEvents?>? events,
global::System.DateTime endTime = default,
string? error = default,
object? inputs = default,
object? outputs = default,
global::System.Collections.Generic.IList<RunUpdateSchemaExtendedEvents?>? events = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
var request = new RunUpdateSchemaExtended
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public partial class Api
public async global::System.Collections.Generic.IAsyncEnumerable<CreateModelResponse> CreateModelAsync(
string name,
string modelfile,
bool stream,
bool stream = default,
[global::System.Runtime.CompilerServices.EnumeratorCancellation] global::System.Threading.CancellationToken cancellationToken = default)
{
var request = new CreateModelRequest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ public partial class Api
public async global::System.Collections.Generic.IAsyncEnumerable<GenerateChatCompletionResponse> GenerateChatCompletionAsync(
string model,
global::System.Collections.Generic.IList<Message> messages,
GenerateChatCompletionRequestFormat? format,
RequestOptions? options,
bool stream,
int keepAlive,
GenerateChatCompletionRequestFormat? format = default,
RequestOptions? options = default,
bool stream = default,
int keepAlive = default,
[global::System.Runtime.CompilerServices.EnumeratorCancellation] global::System.Threading.CancellationToken cancellationToken = default)
{
var request = new GenerateChatCompletionRequest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,15 @@ public partial class Api
public async global::System.Collections.Generic.IAsyncEnumerable<GenerateCompletionResponse> GenerateCompletionAsync(
string model,
string prompt,
global::System.Collections.Generic.IList<string?>? images,
string? system,
string? template,
global::System.Collections.Generic.IList<int>? context,
RequestOptions? options,
GenerateCompletionRequestFormat? format,
bool raw,
bool stream,
int keepAlive,
global::System.Collections.Generic.IList<string?>? images = default,
string? system = default,
string? template = default,
global::System.Collections.Generic.IList<int>? context = default,
RequestOptions? options = default,
GenerateCompletionRequestFormat? format = default,
bool raw = default,
bool stream = default,
int keepAlive = default,
[global::System.Runtime.CompilerServices.EnumeratorCancellation] global::System.Threading.CancellationToken cancellationToken = default)
{
var request = new GenerateCompletionRequest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public partial class Api
public async global::System.Threading.Tasks.Task<GenerateEmbeddingResponse> GenerateEmbeddingAsync(
string model,
string prompt,
RequestOptions? options,
RequestOptions? options = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
var request = new GenerateEmbeddingRequest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ public partial class Api
/// <exception cref="global::System.InvalidOperationException"></exception>
public async global::System.Threading.Tasks.Task<PullModelResponse> PullModelAsync(
string name,
bool insecure,
bool stream,
bool insecure = default,
bool stream = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
var request = new PullModelRequest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ public partial class Api
/// <exception cref="global::System.InvalidOperationException"></exception>
public async global::System.Threading.Tasks.Task<PushModelResponse> PushModelAsync(
string name,
bool insecure,
bool stream,
bool insecure = default,
bool stream = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
var request = new PushModelRequest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public partial class Api
public async global::System.Collections.Generic.IAsyncEnumerable<CreateModelResponse> CreateModelAsync(
string name,
string modelfile,
bool stream,
bool stream = default,
[global::System.Runtime.CompilerServices.EnumeratorCancellation] global::System.Threading.CancellationToken cancellationToken = default)
{
var request = new CreateModelRequest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ public partial class Api
public async global::System.Collections.Generic.IAsyncEnumerable<GenerateChatCompletionResponse> GenerateChatCompletionAsync(
string model,
global::System.Collections.Generic.IList<Message> messages,
string? format,
RequestOptions? options,
bool stream,
int keepAlive,
string? format = default,
RequestOptions? options = default,
bool stream = default,
int keepAlive = default,
[global::System.Runtime.CompilerServices.EnumeratorCancellation] global::System.Threading.CancellationToken cancellationToken = default)
{
var request = new GenerateChatCompletionRequest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,15 @@ public partial class Api
public async global::System.Collections.Generic.IAsyncEnumerable<GenerateCompletionResponse> GenerateCompletionAsync(
string model,
string prompt,
global::System.Collections.Generic.IList<string?>? images,
string? system,
string? template,
global::System.Collections.Generic.IList<int>? context,
RequestOptions? options,
string? format,
bool raw,
bool stream,
int keepAlive,
global::System.Collections.Generic.IList<string?>? images = default,
string? system = default,
string? template = default,
global::System.Collections.Generic.IList<int>? context = default,
RequestOptions? options = default,
string? format = default,
bool raw = default,
bool stream = default,
int keepAlive = default,
[global::System.Runtime.CompilerServices.EnumeratorCancellation] global::System.Threading.CancellationToken cancellationToken = default)
{
var request = new GenerateCompletionRequest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public partial class Api
public async global::System.Threading.Tasks.Task<GenerateEmbeddingResponse> GenerateEmbeddingAsync(
string model,
string prompt,
RequestOptions? options,
RequestOptions? options = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
var request = new GenerateEmbeddingRequest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ public partial class Api
/// <exception cref="global::System.InvalidOperationException"></exception>
public async global::System.Threading.Tasks.Task<PullModelResponse> PullModelAsync(
string name,
bool insecure,
bool stream,
bool insecure = default,
bool stream = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
var request = new PullModelRequest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ public partial class Api
/// <exception cref="global::System.InvalidOperationException"></exception>
public async global::System.Threading.Tasks.Task<PushModelResponse> PushModelAsync(
string name,
bool insecure,
bool stream,
bool insecure = default,
bool stream = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
var request = new PushModelRequest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@ public partial class Api
/// <exception cref="global::System.InvalidOperationException"></exception>
public async global::System.Threading.Tasks.Task<AssistantObject> CreateAssistantAsync(
object model,
string? name,
string? description,
string? instructions,
global::System.Collections.Generic.IList<object?>? tools,
CreateAssistantRequestToolResources? toolResources,
CreateAssistantRequestMetadata? metadata,
double? temperature,
double? topP,
AssistantsApiResponseFormatOption? responseFormat,
string? name = default,
string? description = default,
string? instructions = default,
global::System.Collections.Generic.IList<object?>? tools = default,
CreateAssistantRequestToolResources? toolResources = default,
CreateAssistantRequestMetadata? metadata = default,
double? temperature = default,
double? topP = default,
AssistantsApiResponseFormatOption? responseFormat = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
var request = new CreateAssistantRequest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,25 +68,25 @@ public partial class Api
public async global::System.Threading.Tasks.Task<CreateChatCompletionResponse> CreateChatCompletionAsync(
global::System.Collections.Generic.IList<ChatCompletionRequestMessage> messages,
object model,
double? frequencyPenalty,
CreateChatCompletionRequestLogitBias? logitBias,
bool? logprobs,
int? topLogprobs,
int? maxTokens,
int? n,
double? presencePenalty,
CreateChatCompletionRequestResponseFormat? responseFormat,
int? seed,
object? stop,
bool? stream,
ChatCompletionStreamOptions? streamOptions,
double? temperature,
double? topP,
global::System.Collections.Generic.IList<ChatCompletionTool>? tools,
ChatCompletionToolChoiceOption? toolChoice,
string? user,
object? functionCall,
global::System.Collections.Generic.IList<ChatCompletionFunctions>? functions,
double? frequencyPenalty = default,
CreateChatCompletionRequestLogitBias? logitBias = default,
bool? logprobs = default,
int? topLogprobs = default,
int? maxTokens = default,
int? n = default,
double? presencePenalty = default,
CreateChatCompletionRequestResponseFormat? responseFormat = default,
int? seed = default,
object? stop = default,
bool? stream = default,
ChatCompletionStreamOptions? streamOptions = default,
double? temperature = default,
double? topP = default,
global::System.Collections.Generic.IList<ChatCompletionTool>? tools = default,
ChatCompletionToolChoiceOption? toolChoice = default,
string? user = default,
object? functionCall = default,
global::System.Collections.Generic.IList<ChatCompletionFunctions>? functions = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
var request = new CreateChatCompletionRequest
Expand Down
Loading

0 comments on commit 95372b8

Please sign in to comment.