Skip to content

Commit

Permalink
fix: Fixed RunStepObject deserialization issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
HavenDV committed Sep 2, 2024
1 parent e62dc1e commit e8099fe
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
3 changes: 3 additions & 0 deletions src/helpers/FixOpenApiSpec/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
openApiDocument.Components.Schemas["MessageObject"]!.Required.Remove("completed_at");
openApiDocument.Components.Schemas["MessageObject"]!.Required.Remove("incomplete_at");

openApiDocument.Components.Schemas["RunStepObject"]!.Required.Remove("expired_at");
openApiDocument.Components.Schemas["RunStepObject"]!.Required.Remove("metadata");

openApiDocument.Paths["/files/{file_id}/content"]!.Operations[OperationType.Get].Responses["200"]!.Content.Remove("application/json");
openApiDocument.Paths["/files/{file_id}/content"]!.Operations[OperationType.Get].Responses["200"]!.Content.Add(
"application/octet-stream",
Expand Down
6 changes: 2 additions & 4 deletions src/libs/OpenAI/Generated/OpenAI.Models.RunStepObject.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,7 @@ public sealed partial class RunStepObject
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("expired_at")]
[global::System.Text.Json.Serialization.JsonConverter(typeof(global::OpenApiGenerator.JsonConverters.UnixTimestampJsonConverter))]
[global::System.Text.Json.Serialization.JsonRequired]
public required global::System.DateTimeOffset? ExpiredAt { get; set; }
public global::System.DateTimeOffset? ExpiredAt { get; set; }

/// <summary>
/// The Unix timestamp (in seconds) for when the run step was cancelled.
Expand Down Expand Up @@ -120,8 +119,7 @@ public sealed partial class RunStepObject
/// Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long.
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("metadata")]
[global::System.Text.Json.Serialization.JsonRequired]
public required global::OpenAI.RunStepObjectMetadata? Metadata { get; set; }
public global::OpenAI.RunStepObjectMetadata? Metadata { get; set; }

/// <summary>
/// Usage statistics related to the run step. This value will be `null` while the run step's status is `in_progress`.
Expand Down
2 changes: 0 additions & 2 deletions src/libs/OpenAI/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8299,11 +8299,9 @@ components:
- status
- step_details
- last_error
- expired_at
- cancelled_at
- failed_at
- completed_at
- metadata
- usage
type: object
properties:
Expand Down

0 comments on commit e8099fe

Please sign in to comment.