Skip to content

feat:Update OpenAPI spec to mark function name and parameters as required #143

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions src/libs/Cohere/Generated/Cohere.Models.ToolV2Function.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ public sealed partial class ToolV2Function
/// The name of the function.
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("name")]
public string? Name { get; set; }
[global::System.Text.Json.Serialization.JsonRequired]
public required string Name { get; set; }

/// <summary>
/// The description of the function.
Expand All @@ -24,7 +25,8 @@ public sealed partial class ToolV2Function
/// The parameters of the function as a JSON schema.
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("parameters")]
public object? Parameters { get; set; }
[global::System.Text.Json.Serialization.JsonRequired]
public required object Parameters { get; set; }

/// <summary>
/// Additional properties that are not explicitly defined in the schema
Expand All @@ -46,13 +48,13 @@ public sealed partial class ToolV2Function
/// </param>
[global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
public ToolV2Function(
string? name,
string? description,
object? parameters)
string name,
object parameters,
string? description)
{
this.Name = name;
this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name));
this.Parameters = parameters ?? throw new global::System.ArgumentNullException(nameof(parameters));
this.Description = description;
this.Parameters = parameters;
}

/// <summary>
Expand Down
3 changes: 3 additions & 0 deletions src/libs/Cohere/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12229,6 +12229,9 @@ components:
- function
type: string
function:
required:
- name
- parameters
type: object
properties:
name:
Expand Down
Loading