Skip to content

Commit

Permalink
fix: Fixed generation issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
HavenDV committed Jul 6, 2024
1 parent ddc72fa commit fbe24a4
Show file tree
Hide file tree
Showing 13 changed files with 23 additions and 27 deletions.
1 change: 1 addition & 0 deletions src/helpers/FixOpenApiSpec/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
text = text.Replace("description: &run_top_p_description ", "description: ");

var openApiDocument = new OpenApiStringReader().Read(text, out var diagnostics);
openApiDocument.Components.Schemas["ParallelToolCalls"]!.Default = null;
openApiDocument.Components.Schemas["ParallelToolCalls"]!.Nullable = true;

text = openApiDocument.SerializeAsYaml(OpenApiSpecVersion.OpenApi3_0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public partial class AssistantsClient
int? maxCompletionTokens = default,
global::OpenAI.TruncationObject? truncationStrategy = default,
global::System.OneOf<global::OpenAI.CreateRunRequestToolChoice?, global::OpenAI.AssistantsNamedToolChoice?>? toolChoice = default,
bool? parallelToolCalls = true,
bool? parallelToolCalls = default,
global::System.OneOf<global::OpenAI.CreateRunRequestResponseFormat?, global::OpenAI.AssistantsApiResponseFormat?>? responseFormat = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public partial class AssistantsClient
int? maxCompletionTokens = default,
global::OpenAI.TruncationObject? truncationStrategy = default,
global::System.OneOf<global::OpenAI.CreateThreadAndRunRequestToolChoice?, global::OpenAI.AssistantsNamedToolChoice?>? toolChoice = default,
bool? parallelToolCalls = true,
bool? parallelToolCalls = default,
global::System.OneOf<global::OpenAI.CreateThreadAndRunRequestResponseFormat?, global::OpenAI.AssistantsApiResponseFormat?>? responseFormat = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,15 @@ public partial class ChatClient
double? presencePenalty = 0,
global::OpenAI.CreateChatCompletionRequestResponseFormat? responseFormat = default,
int? seed = default,
global::OpenAI.CreateChatCompletionRequestServiceTier? serviceTier = null,
global::OpenAI.CreateChatCompletionRequestServiceTier? serviceTier = default,
global::System.OneOf<string?, global::System.Collections.Generic.IList<string?>?>? stop = default,
bool? stream = false,
global::OpenAI.ChatCompletionStreamOptions? streamOptions = null,
global::OpenAI.ChatCompletionStreamOptions? streamOptions = default,
double? temperature = 1,
double? topP = 1,
global::System.Collections.Generic.IList<global::OpenAI.ChatCompletionTool>? tools = default,
global::System.OneOf<global::OpenAI.CreateChatCompletionRequestToolChoice?, global::OpenAI.ChatCompletionNamedToolChoice?>? toolChoice = default,
bool? parallelToolCalls = null,
bool? parallelToolCalls = default,
string? user = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,15 @@ public partial class CompletionsClient
bool? echo = false,
double? frequencyPenalty = 0,
object? logitBias = default,
int? logprobs = null,
int? logprobs = default,
int? maxTokens = 16,
int? n = 1,
double? presencePenalty = 0,
int? seed = default,
global::System.OneOf<string?, global::System.Collections.Generic.IList<string?>?>? stop = default,
bool? stream = false,
global::OpenAI.ChatCompletionStreamOptions? streamOptions = null,
string? suffix = "",
global::OpenAI.ChatCompletionStreamOptions? streamOptions = default,
string? suffix = default,
double? temperature = 1,
double? topP = 1,
string? user = default,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public partial class FineTuningClient
global::System.AnyOf<string, global::OpenAI.CreateFineTuningJobRequestModel> model,
string trainingFile,
global::OpenAI.CreateFineTuningJobRequestHyperparameters? hyperparameters = default,
string? suffix = "",
string? suffix = default,
string? validationFile = default,
global::System.Collections.Generic.IList<global::OpenAI.CreateFineTuningJobRequestIntegrations?>? integrations = default,
int? seed = default,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public sealed partial class CreateChatCompletionRequest
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("stop")]
[global::System.Text.Json.Serialization.JsonConverter(typeof(global::OpenApiGenerator.JsonConverters.OneOfJsonConverterFactory2))]
public global::System.OneOf<string?, global::System.Collections.Generic.IList<string?>?>? Stop { get; set; } = "";
public global::System.OneOf<string?, global::System.Collections.Generic.IList<string?>?>? Stop { get; set; }

/// <summary>
/// If set, partial message deltas will be sent, like in ChatGPT. Tokens will be sent as data-only [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format) as they become available, with the stream terminated by a `data: [DONE]` message. [Example Python code](https://cookbook.openai.com/examples/how_to_stream_completions).<br/>
Expand Down Expand Up @@ -160,11 +160,10 @@ public sealed partial class CreateChatCompletionRequest
public global::System.OneOf<global::OpenAI.CreateChatCompletionRequestToolChoice?, global::OpenAI.ChatCompletionNamedToolChoice?>? ToolChoice { get; set; }

/// <summary>
/// Whether to enable [parallel function calling](/docs/guides/function-calling/parallel-function-calling) during tool use.<br/>
/// Default Value: true
/// Whether to enable [parallel function calling](/docs/guides/function-calling/parallel-function-calling) during tool use.
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("parallel_tool_calls")]
public bool? ParallelToolCalls { get; set; } = true;
public bool? ParallelToolCalls { get; set; }

/// <summary>
/// A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices/end-user-ids).<br/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public sealed partial class CreateCompletionRequest
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("stop")]
[global::System.Text.Json.Serialization.JsonConverter(typeof(global::OpenApiGenerator.JsonConverters.OneOfJsonConverterFactory2))]
public global::System.OneOf<string?, global::System.Collections.Generic.IList<string?>?>? Stop { get; set; } = "";
public global::System.OneOf<string?, global::System.Collections.Generic.IList<string?>?>? Stop { get; set; }

/// <summary>
/// Whether to stream back partial progress. If set, tokens will be sent as data-only [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format) as they become available, with the stream terminated by a `data: [DONE]` message. [Example Python code](https://cookbook.openai.com/examples/how_to_stream_completions).<br/>
Expand All @@ -126,7 +126,7 @@ public sealed partial class CreateCompletionRequest
/// Example: test.
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("suffix")]
public string? Suffix { get; set; } = "";
public string? Suffix { get; set; }

/// <summary>
/// What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.<br/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public sealed partial class CreateFineTuningJobRequest
/// For example, a `suffix` of "custom-model-name" would produce a model name like `ft:gpt-3.5-turbo:openai:custom-model-name:7p4lURel`.
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("suffix")]
public string? Suffix { get; set; } = "";
public string? Suffix { get; set; }

/// <summary>
/// The ID of an uploaded file that contains validation data.<br/>
Expand Down
5 changes: 2 additions & 3 deletions src/libs/OpenAI/Generated/OpenAI.Models.CreateRunRequest.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,10 @@ public sealed partial class CreateRunRequest
public global::System.OneOf<global::OpenAI.CreateRunRequestToolChoice?, global::OpenAI.AssistantsNamedToolChoice?>? ToolChoice { get; set; }

/// <summary>
/// Whether to enable [parallel function calling](/docs/guides/function-calling/parallel-function-calling) during tool use.<br/>
/// Default Value: true
/// Whether to enable [parallel function calling](/docs/guides/function-calling/parallel-function-calling) during tool use.
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("parallel_tool_calls")]
public bool? ParallelToolCalls { get; set; } = true;
public bool? ParallelToolCalls { get; set; }

/// <summary>
/// Specifies the format that the model must output. Compatible with [GPT-4o](/docs/models/gpt-4o), [GPT-4 Turbo](/docs/models/gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.<br/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,10 @@ public sealed partial class CreateThreadAndRunRequest
public global::System.OneOf<global::OpenAI.CreateThreadAndRunRequestToolChoice?, global::OpenAI.AssistantsNamedToolChoice?>? ToolChoice { get; set; }

/// <summary>
/// Whether to enable [parallel function calling](/docs/guides/function-calling/parallel-function-calling) during tool use.<br/>
/// Default Value: true
/// Whether to enable [parallel function calling](/docs/guides/function-calling/parallel-function-calling) during tool use.
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("parallel_tool_calls")]
public bool? ParallelToolCalls { get; set; } = true;
public bool? ParallelToolCalls { get; set; }

/// <summary>
/// Specifies the format that the model must output. Compatible with [GPT-4o](/docs/models/gpt-4o), [GPT-4 Turbo](/docs/models/gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.<br/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,10 @@ public sealed partial class FinetuneChatRequestInput
public global::System.Collections.Generic.IList<global::OpenAI.ChatCompletionTool>? Tools { get; set; }

/// <summary>
/// Whether to enable [parallel function calling](/docs/guides/function-calling/parallel-function-calling) during tool use.<br/>
/// Default Value: true
/// Whether to enable [parallel function calling](/docs/guides/function-calling/parallel-function-calling) during tool use.
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("parallel_tool_calls")]
public bool? ParallelToolCalls { get; set; } = true;
public bool? ParallelToolCalls { get; set; }

/// <summary>
/// A list of functions the model may generate JSON inputs for.
Expand Down
3 changes: 1 addition & 2 deletions src/libs/OpenAI/Generated/OpenAI.Models.RunObject.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,7 @@ public sealed partial class RunObject
public required global::System.OneOf<global::OpenAI.RunObjectToolChoice, global::OpenAI.AssistantsNamedToolChoice?> ToolChoice { get; set; }

/// <summary>
/// Whether to enable [parallel function calling](/docs/guides/function-calling/parallel-function-calling) during tool use.<br/>
/// Default Value: true
/// Whether to enable [parallel function calling](/docs/guides/function-calling/parallel-function-calling) during tool use.
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("parallel_tool_calls")]
[global::System.Text.Json.Serialization.JsonRequired]
Expand Down

0 comments on commit fbe24a4

Please sign in to comment.