From 1fd3697732cedc91fd928726e7e458760c744ac0 Mon Sep 17 00:00:00 2001 From: Aleksandr Tarasov Date: Thu, 23 May 2024 09:12:58 +0500 Subject: [PATCH 1/2] fixed createdAt type --- .../BatchResponseModel/BatchResponse.cs | 2 +- .../ChatCompletionCreateResponse.cs | 6 +----- .../ResponseModels/CompletionCreateResponse.cs | 3 +-- .../ResponseModels/EditCreateResponse.cs | 3 +-- .../FileResponseModels/FileUploadResponse.cs | 3 +-- .../FineTuneResponseModels/FineTuneResponse.cs | 4 ++-- .../FineTuningJobResponse.cs | 2 +- .../ImageResponseModel/ImageCreateResponse.cs | 3 +-- .../ResponseModels/RunStepListResponse.cs | 2 +- .../VectorStoreFileBatchObject.cs | 2 +- .../VectorStoreFileObject.cs | 2 +- .../VectorStoreObjectResponse.cs | 2 +- .../SharedModels/AssistantFileResponse.cs | 2 +- .../SharedModels/AssistantResponse.cs | 2 +- .../ObjectModels/SharedModels/FileResponse.cs | 16 ++++------------ .../ObjectModels/SharedModels/IOpenAiModels.cs | 2 +- .../ObjectModels/SharedModels/MessageResponse.cs | 2 +- .../ObjectModels/SharedModels/RunResponse.cs | 2 +- .../ObjectModels/SharedModels/ThreadResponse.cs | 2 +- 19 files changed, 23 insertions(+), 39 deletions(-) diff --git a/OpenAI.SDK/ObjectModels/ResponseModels/BatchResponseModel/BatchResponse.cs b/OpenAI.SDK/ObjectModels/ResponseModels/BatchResponseModel/BatchResponse.cs index 8d2512e3..d4ad26a2 100644 --- a/OpenAI.SDK/ObjectModels/ResponseModels/BatchResponseModel/BatchResponse.cs +++ b/OpenAI.SDK/ObjectModels/ResponseModels/BatchResponseModel/BatchResponse.cs @@ -53,7 +53,7 @@ public record BatchResponse : BaseResponse, IOpenAIModels.IMetaData /// The Unix timestamp (in seconds) for when the batch was created. /// [JsonPropertyName("created_at")] - public int CreatedAt { get; set; } + public long CreatedAt { get; set; } /// /// The Unix timestamp (in seconds) for when the batch started processing. diff --git a/OpenAI.SDK/ObjectModels/ResponseModels/ChatCompletionCreateResponse.cs b/OpenAI.SDK/ObjectModels/ResponseModels/ChatCompletionCreateResponse.cs index c4207770..ec670c97 100644 --- a/OpenAI.SDK/ObjectModels/ResponseModels/ChatCompletionCreateResponse.cs +++ b/OpenAI.SDK/ObjectModels/ResponseModels/ChatCompletionCreateResponse.cs @@ -38,11 +38,7 @@ public record ChatCompletionCreateResponse : BaseResponse, IOpenAIModels.IId, IO [JsonPropertyName("service_tier")] public string? ServiceTier { get; set; } - /// - /// The Unix timestamp (in seconds) of when the chat completion was created. - /// - [JsonPropertyName("created")] - public int CreatedAt { get; set; } + [JsonPropertyName("created")] public long CreatedAt { get; set; } /// /// A unique identifier for the chat completion. diff --git a/OpenAI.SDK/ObjectModels/ResponseModels/CompletionCreateResponse.cs b/OpenAI.SDK/ObjectModels/ResponseModels/CompletionCreateResponse.cs index c4165a1a..fce10672 100644 --- a/OpenAI.SDK/ObjectModels/ResponseModels/CompletionCreateResponse.cs +++ b/OpenAI.SDK/ObjectModels/ResponseModels/CompletionCreateResponse.cs @@ -14,8 +14,7 @@ public record CompletionCreateResponse : BaseResponse, IOpenAIModels.IId, IOpenA [JsonPropertyName("usage")] public UsageResponse Usage { get; set; } - [JsonPropertyName("created")] - public int CreatedAt { get; set; } + [JsonPropertyName("created")] public long CreatedAt { get; set; } [JsonPropertyName("id")] public string Id { get; set; } diff --git a/OpenAI.SDK/ObjectModels/ResponseModels/EditCreateResponse.cs b/OpenAI.SDK/ObjectModels/ResponseModels/EditCreateResponse.cs index 8e933fca..87e7afd2 100644 --- a/OpenAI.SDK/ObjectModels/ResponseModels/EditCreateResponse.cs +++ b/OpenAI.SDK/ObjectModels/ResponseModels/EditCreateResponse.cs @@ -14,6 +14,5 @@ public record EditCreateResponse : BaseResponse, IOpenAIModels.ICreatedAt [JsonPropertyName("usage")] public UsageResponse Usage { get; set; } - [JsonPropertyName("created")] - public int CreatedAt { get; set; } + [JsonPropertyName("created")] public long CreatedAt { get; set; } } \ No newline at end of file diff --git a/OpenAI.SDK/ObjectModels/ResponseModels/FileResponseModels/FileUploadResponse.cs b/OpenAI.SDK/ObjectModels/ResponseModels/FileResponseModels/FileUploadResponse.cs index 652c0615..4f4ce65a 100644 --- a/OpenAI.SDK/ObjectModels/ResponseModels/FileResponseModels/FileUploadResponse.cs +++ b/OpenAI.SDK/ObjectModels/ResponseModels/FileResponseModels/FileUploadResponse.cs @@ -17,6 +17,5 @@ public record FileUploadResponse : BaseResponse, IOpenAIModels.ICreatedAt [JsonPropertyName("purpose")] public string Purpose { get; set; } - [JsonPropertyName("created_at")] - public int CreatedAt { get; set; } + [JsonPropertyName("created_at")] public long CreatedAt { get; set; } } \ No newline at end of file diff --git a/OpenAI.SDK/ObjectModels/ResponseModels/FineTuneResponseModels/FineTuneResponse.cs b/OpenAI.SDK/ObjectModels/ResponseModels/FineTuneResponseModels/FineTuneResponse.cs index f75e5305..1e85699d 100644 --- a/OpenAI.SDK/ObjectModels/ResponseModels/FineTuneResponseModels/FineTuneResponse.cs +++ b/OpenAI.SDK/ObjectModels/ResponseModels/FineTuneResponseModels/FineTuneResponse.cs @@ -35,8 +35,8 @@ public record FineTuneResponse : BaseResponse, IOpenAIModels.IId, IOpenAIModels. [JsonPropertyName("created_at")] public int CreatedAt { get; set; } - [JsonPropertyName("id")] - public string Id { get; set; } + [JsonPropertyName("created_at")] public long CreatedAt { get; set; } + [JsonPropertyName("id")] public string Id { get; set; } [JsonPropertyName("model")] public string Model { get; set; } diff --git a/OpenAI.SDK/ObjectModels/ResponseModels/FineTuningJobResponseModels/FineTuningJobResponse.cs b/OpenAI.SDK/ObjectModels/ResponseModels/FineTuningJobResponseModels/FineTuningJobResponse.cs index c7aa4c78..2172e7a2 100644 --- a/OpenAI.SDK/ObjectModels/ResponseModels/FineTuningJobResponseModels/FineTuningJobResponse.cs +++ b/OpenAI.SDK/ObjectModels/ResponseModels/FineTuningJobResponseModels/FineTuningJobResponse.cs @@ -67,7 +67,7 @@ public record FineTuningJobResponse : BaseResponse, IOpenAIModels.IId, IOpenAIMo /// The Unix timestamp (in seconds) for when the fine-tuning job was created. /// [JsonPropertyName("created_at")] - public int CreatedAt { get; set; } + public long CreatedAt { get; set; } /// /// The object identifier, which can be referenced in the API endpoints. diff --git a/OpenAI.SDK/ObjectModels/ResponseModels/ImageResponseModel/ImageCreateResponse.cs b/OpenAI.SDK/ObjectModels/ResponseModels/ImageResponseModel/ImageCreateResponse.cs index db02d838..de888183 100644 --- a/OpenAI.SDK/ObjectModels/ResponseModels/ImageResponseModel/ImageCreateResponse.cs +++ b/OpenAI.SDK/ObjectModels/ResponseModels/ImageResponseModel/ImageCreateResponse.cs @@ -8,8 +8,7 @@ public record ImageCreateResponse : BaseResponse, IOpenAIModels.ICreatedAt [JsonPropertyName("data")] public List Results { get; set; } - [JsonPropertyName("created")] - public int CreatedAt { get; set; } + [JsonPropertyName("created")] public long CreatedAt { get; set; } public record ImageDataResult { diff --git a/OpenAI.SDK/ObjectModels/ResponseModels/RunStepListResponse.cs b/OpenAI.SDK/ObjectModels/ResponseModels/RunStepListResponse.cs index 41be6e64..361e6597 100644 --- a/OpenAI.SDK/ObjectModels/ResponseModels/RunStepListResponse.cs +++ b/OpenAI.SDK/ObjectModels/ResponseModels/RunStepListResponse.cs @@ -93,7 +93,7 @@ public record RunStepResponse : BaseResponse, IOpenAIModels.IId, IOpenAIModels.I /// The Unix timestamp (in seconds) for when the run step was created. /// [JsonPropertyName("created_at")] - public int CreatedAt { get; set; } + public long CreatedAt { get; set; } /// /// The identifier of the run step, which can be referenced in API endpoints. diff --git a/OpenAI.SDK/ObjectModels/ResponseModels/VectorStoreResponseModels/VectorStoreFileBatchObject.cs b/OpenAI.SDK/ObjectModels/ResponseModels/VectorStoreResponseModels/VectorStoreFileBatchObject.cs index 60229ad4..fd5c205d 100644 --- a/OpenAI.SDK/ObjectModels/ResponseModels/VectorStoreResponseModels/VectorStoreFileBatchObject.cs +++ b/OpenAI.SDK/ObjectModels/ResponseModels/VectorStoreResponseModels/VectorStoreFileBatchObject.cs @@ -15,7 +15,7 @@ public record VectorStoreFileBatchObject : BaseResponse /// The Unix timestamp (in seconds) for when the vector store files batch was created. /// [JsonPropertyName("created_at")] - public int CreatedAt { get; set; } + public long CreatedAt { get; set; } /// /// The ID of the [vector store](/docs/api-reference/vector-stores/object) that the [File](/docs/api-reference/files) diff --git a/OpenAI.SDK/ObjectModels/ResponseModels/VectorStoreResponseModels/VectorStoreFileObject.cs b/OpenAI.SDK/ObjectModels/ResponseModels/VectorStoreResponseModels/VectorStoreFileObject.cs index d26dcb60..39742d59 100644 --- a/OpenAI.SDK/ObjectModels/ResponseModels/VectorStoreResponseModels/VectorStoreFileObject.cs +++ b/OpenAI.SDK/ObjectModels/ResponseModels/VectorStoreResponseModels/VectorStoreFileObject.cs @@ -26,7 +26,7 @@ public record VectorStoreFileObject : BaseResponse /// The Unix timestamp (in seconds) for when the vector store file was created. /// [JsonPropertyName("created_at")] - public int CreatedAt { get; set; } + public long CreatedAt { get; set; } /// /// The ID of the [vector store](/docs/api-reference/vector-stores/object) that the [File](/docs/api-reference/files) diff --git a/OpenAI.SDK/ObjectModels/ResponseModels/VectorStoreResponseModels/VectorStoreObjectResponse.cs b/OpenAI.SDK/ObjectModels/ResponseModels/VectorStoreResponseModels/VectorStoreObjectResponse.cs index b56b9ed6..ca5eed11 100644 --- a/OpenAI.SDK/ObjectModels/ResponseModels/VectorStoreResponseModels/VectorStoreObjectResponse.cs +++ b/OpenAI.SDK/ObjectModels/ResponseModels/VectorStoreResponseModels/VectorStoreObjectResponse.cs @@ -15,7 +15,7 @@ public record VectorStoreObjectResponse : BaseResponse /// The Unix timestamp (in seconds) for when the vector store was created. /// [JsonPropertyName("created_at")] - public int CreatedAt { get; set; } + public long CreatedAt { get; set; } /// /// The name of the vector store. diff --git a/OpenAI.SDK/ObjectModels/SharedModels/AssistantFileResponse.cs b/OpenAI.SDK/ObjectModels/SharedModels/AssistantFileResponse.cs index 98ad7930..e081d1d4 100644 --- a/OpenAI.SDK/ObjectModels/SharedModels/AssistantFileResponse.cs +++ b/OpenAI.SDK/ObjectModels/SharedModels/AssistantFileResponse.cs @@ -15,7 +15,7 @@ public record AssistantFileResponse : BaseResponse, IOpenAIModels.IId, IOpenAIMo /// The Unix timestamp (in seconds) for when the assistant file was created. /// [JsonPropertyName("created_at")] - public int CreatedAt { get; set; } + public long CreatedAt { get; set; } /// /// The identifier, which can be referenced in API endpoints. diff --git a/OpenAI.SDK/ObjectModels/SharedModels/AssistantResponse.cs b/OpenAI.SDK/ObjectModels/SharedModels/AssistantResponse.cs index fb0b8c9d..10fb29c0 100644 --- a/OpenAI.SDK/ObjectModels/SharedModels/AssistantResponse.cs +++ b/OpenAI.SDK/ObjectModels/SharedModels/AssistantResponse.cs @@ -62,7 +62,7 @@ public record AssistantResponse : BaseResponse, IOpenAIModels.IId, IOpenAIModels /// The Unix timestamp (in seconds) for when the assistant was created. /// [JsonPropertyName("created_at")] - public int CreatedAt { get; set; } + public long CreatedAt { get; set; } /// /// The identifier, which can be referenced in API endpoints. diff --git a/OpenAI.SDK/ObjectModels/SharedModels/FileResponse.cs b/OpenAI.SDK/ObjectModels/SharedModels/FileResponse.cs index 3c8f9ccb..2f6eceac 100644 --- a/OpenAI.SDK/ObjectModels/SharedModels/FileResponse.cs +++ b/OpenAI.SDK/ObjectModels/SharedModels/FileResponse.cs @@ -12,16 +12,8 @@ public record FileResponse : BaseResponse, IOpenAIModels.IId, IOpenAIModels.ICre public string FileName { get; set; } public UploadFilePurposes.UploadFilePurpose PurposeEnum => UploadFilePurposes.ToEnum(Purpose); - - [JsonPropertyName("purpose")] - public string Purpose { get; set; } - - [JsonPropertyName("status")] - public string Status { get; set; } - - [JsonPropertyName("created_at")] - public int CreatedAt { get; set; } - - [JsonPropertyName("id")] - public string Id { get; set; } + [JsonPropertyName("purpose")] public string Purpose { get; set; } + [JsonPropertyName("status")] public string Status { get; set; } + [JsonPropertyName("created_at")] public long CreatedAt { get; set; } + [JsonPropertyName("id")] public string Id { get; set; } } \ No newline at end of file diff --git a/OpenAI.SDK/ObjectModels/SharedModels/IOpenAiModels.cs b/OpenAI.SDK/ObjectModels/SharedModels/IOpenAiModels.cs index ad402598..778d88cf 100644 --- a/OpenAI.SDK/ObjectModels/SharedModels/IOpenAiModels.cs +++ b/OpenAI.SDK/ObjectModels/SharedModels/IOpenAiModels.cs @@ -36,7 +36,7 @@ public interface IAssistantId public interface ICreatedAt { - public int CreatedAt { get; set; } + public long CreatedAt { get; set; } } public interface ICompletedAt diff --git a/OpenAI.SDK/ObjectModels/SharedModels/MessageResponse.cs b/OpenAI.SDK/ObjectModels/SharedModels/MessageResponse.cs index 1a6ac767..8295cea4 100644 --- a/OpenAI.SDK/ObjectModels/SharedModels/MessageResponse.cs +++ b/OpenAI.SDK/ObjectModels/SharedModels/MessageResponse.cs @@ -82,7 +82,7 @@ public MessageResponse Delta /// The Unix timestamp (in seconds) for when the message was created. /// [JsonPropertyName("created_at")] - public int CreatedAt { get; set; } + public long CreatedAt { get; set; } /// /// The identifier, which can be referenced in API endpoints. diff --git a/OpenAI.SDK/ObjectModels/SharedModels/RunResponse.cs b/OpenAI.SDK/ObjectModels/SharedModels/RunResponse.cs index 93205b0f..07bbd276 100644 --- a/OpenAI.SDK/ObjectModels/SharedModels/RunResponse.cs +++ b/OpenAI.SDK/ObjectModels/SharedModels/RunResponse.cs @@ -143,7 +143,7 @@ public record RunResponse : BaseResponse, IOpenAIModels.IId, IOpenAIModels.IMode /// The Unix timestamp (in seconds) for when the run was created. /// [JsonPropertyName("created_at")] - public int CreatedAt { get; set; } + public long CreatedAt { get; set; } /// /// The list of File IDs the assistant used for this run. diff --git a/OpenAI.SDK/ObjectModels/SharedModels/ThreadResponse.cs b/OpenAI.SDK/ObjectModels/SharedModels/ThreadResponse.cs index cb97217d..bb6b2b9f 100644 --- a/OpenAI.SDK/ObjectModels/SharedModels/ThreadResponse.cs +++ b/OpenAI.SDK/ObjectModels/SharedModels/ThreadResponse.cs @@ -18,7 +18,7 @@ public record ThreadResponse : BaseResponse, IOpenAIModels.IId, IOpenAIModels.IC /// The Unix timestamp (in seconds) for when the assistant was created. /// [JsonPropertyName("created_at")] - public int CreatedAt { get; set; } + public long CreatedAt { get; set; } /// /// The identifier, which can be referenced in API endpoints. From a5be7f18e4f4715a39b99a4ee8e7122f1729c114 Mon Sep 17 00:00:00 2001 From: Tolga Kayhan Date: Wed, 13 Nov 2024 13:16:24 +0000 Subject: [PATCH 2/2] Added support for DateTimeOffest for CreatedAt --- .../BatchResponseModel/BatchResponse.cs | 7 +++- .../ChatCompletionCreateResponse.cs | 5 ++- .../CompletionCreateResponse.cs | 5 ++- .../ResponseModels/EditCreateResponse.cs | 5 ++- .../FileResponseModels/FileUploadResponse.cs | 5 ++- .../FineTuneResponse.cs | 8 +++-- .../FineTuningJobResponse.cs | 7 +++- .../ImageResponseModel/ImageCreateResponse.cs | 4 ++- .../ResponseModels/RunStepListResponse.cs | 4 ++- .../VectorStoreFileBatchObject.cs | 6 +++- .../VectorStoreFileObject.cs | 7 +++- .../VectorStoreObjectResponse.cs | 7 +++- .../SharedModels/AssistantFileResponse.cs | 4 ++- .../SharedModels/AssistantResponse.cs | 36 ++++++++++--------- .../SharedModels/EventResponse.cs | 6 ++-- .../ObjectModels/SharedModels/FileResponse.cs | 18 +++++++--- .../SharedModels/IOpenAiModels.cs | 3 +- .../SharedModels/MessageResponse.cs | 7 +++- .../ObjectModels/SharedModels/RunResponse.cs | 7 +++- .../SharedModels/ThreadResponse.cs | 7 +++- 20 files changed, 116 insertions(+), 42 deletions(-) diff --git a/OpenAI.SDK/ObjectModels/ResponseModels/BatchResponseModel/BatchResponse.cs b/OpenAI.SDK/ObjectModels/ResponseModels/BatchResponseModel/BatchResponse.cs index d4ad26a2..714fb9ff 100644 --- a/OpenAI.SDK/ObjectModels/ResponseModels/BatchResponseModel/BatchResponse.cs +++ b/OpenAI.SDK/ObjectModels/ResponseModels/BatchResponseModel/BatchResponse.cs @@ -53,7 +53,12 @@ public record BatchResponse : BaseResponse, IOpenAIModels.IMetaData /// The Unix timestamp (in seconds) for when the batch was created. /// [JsonPropertyName("created_at")] - public long CreatedAt { get; set; } + public long CreatedAtUnix { get; set; } + + /// + /// DateTimeOffset for when the batch was created. + /// + public DateTimeOffset CreatedAt => DateTimeOffset.FromUnixTimeSeconds(CreatedAtUnix); /// /// The Unix timestamp (in seconds) for when the batch started processing. diff --git a/OpenAI.SDK/ObjectModels/ResponseModels/ChatCompletionCreateResponse.cs b/OpenAI.SDK/ObjectModels/ResponseModels/ChatCompletionCreateResponse.cs index ec670c97..8bd01d3a 100644 --- a/OpenAI.SDK/ObjectModels/ResponseModels/ChatCompletionCreateResponse.cs +++ b/OpenAI.SDK/ObjectModels/ResponseModels/ChatCompletionCreateResponse.cs @@ -38,7 +38,10 @@ public record ChatCompletionCreateResponse : BaseResponse, IOpenAIModels.IId, IO [JsonPropertyName("service_tier")] public string? ServiceTier { get; set; } - [JsonPropertyName("created")] public long CreatedAt { get; set; } + [JsonPropertyName("created")] + public long CreatedAtUnix { get; set; } + + public DateTimeOffset CreatedAt => DateTimeOffset.FromUnixTimeSeconds(CreatedAtUnix); /// /// A unique identifier for the chat completion. diff --git a/OpenAI.SDK/ObjectModels/ResponseModels/CompletionCreateResponse.cs b/OpenAI.SDK/ObjectModels/ResponseModels/CompletionCreateResponse.cs index fce10672..05a94c83 100644 --- a/OpenAI.SDK/ObjectModels/ResponseModels/CompletionCreateResponse.cs +++ b/OpenAI.SDK/ObjectModels/ResponseModels/CompletionCreateResponse.cs @@ -14,7 +14,10 @@ public record CompletionCreateResponse : BaseResponse, IOpenAIModels.IId, IOpenA [JsonPropertyName("usage")] public UsageResponse Usage { get; set; } - [JsonPropertyName("created")] public long CreatedAt { get; set; } + [JsonPropertyName("created")] + public long CreatedAtUnix { get; set; } + + public DateTimeOffset CreatedAt => DateTimeOffset.FromUnixTimeSeconds(CreatedAtUnix); [JsonPropertyName("id")] public string Id { get; set; } diff --git a/OpenAI.SDK/ObjectModels/ResponseModels/EditCreateResponse.cs b/OpenAI.SDK/ObjectModels/ResponseModels/EditCreateResponse.cs index 87e7afd2..2064d42a 100644 --- a/OpenAI.SDK/ObjectModels/ResponseModels/EditCreateResponse.cs +++ b/OpenAI.SDK/ObjectModels/ResponseModels/EditCreateResponse.cs @@ -14,5 +14,8 @@ public record EditCreateResponse : BaseResponse, IOpenAIModels.ICreatedAt [JsonPropertyName("usage")] public UsageResponse Usage { get; set; } - [JsonPropertyName("created")] public long CreatedAt { get; set; } + [JsonPropertyName("created")] + public long CreatedAtUnix { get; set; } + + public DateTimeOffset CreatedAt => DateTimeOffset.FromUnixTimeSeconds(CreatedAtUnix); } \ No newline at end of file diff --git a/OpenAI.SDK/ObjectModels/ResponseModels/FileResponseModels/FileUploadResponse.cs b/OpenAI.SDK/ObjectModels/ResponseModels/FileResponseModels/FileUploadResponse.cs index 4f4ce65a..585be3f3 100644 --- a/OpenAI.SDK/ObjectModels/ResponseModels/FileResponseModels/FileUploadResponse.cs +++ b/OpenAI.SDK/ObjectModels/ResponseModels/FileResponseModels/FileUploadResponse.cs @@ -17,5 +17,8 @@ public record FileUploadResponse : BaseResponse, IOpenAIModels.ICreatedAt [JsonPropertyName("purpose")] public string Purpose { get; set; } - [JsonPropertyName("created_at")] public long CreatedAt { get; set; } + [JsonPropertyName("created_at")] + public long CreatedAtUnix { get; set; } + + public DateTimeOffset CreatedAt => DateTimeOffset.FromUnixTimeSeconds(CreatedAtUnix); } \ No newline at end of file diff --git a/OpenAI.SDK/ObjectModels/ResponseModels/FineTuneResponseModels/FineTuneResponse.cs b/OpenAI.SDK/ObjectModels/ResponseModels/FineTuneResponseModels/FineTuneResponse.cs index 1e85699d..8f3eca59 100644 --- a/OpenAI.SDK/ObjectModels/ResponseModels/FineTuneResponseModels/FineTuneResponse.cs +++ b/OpenAI.SDK/ObjectModels/ResponseModels/FineTuneResponseModels/FineTuneResponse.cs @@ -33,10 +33,12 @@ public record FineTuneResponse : BaseResponse, IOpenAIModels.IId, IOpenAIModels. public int? UpdatedAt { get; set; } [JsonPropertyName("created_at")] - public int CreatedAt { get; set; } + public long CreatedAtUnix { get; set; } - [JsonPropertyName("created_at")] public long CreatedAt { get; set; } - [JsonPropertyName("id")] public string Id { get; set; } + public DateTimeOffset CreatedAt => DateTimeOffset.FromUnixTimeSeconds(CreatedAtUnix); + + [JsonPropertyName("id")] + public string Id { get; set; } [JsonPropertyName("model")] public string Model { get; set; } diff --git a/OpenAI.SDK/ObjectModels/ResponseModels/FineTuningJobResponseModels/FineTuningJobResponse.cs b/OpenAI.SDK/ObjectModels/ResponseModels/FineTuningJobResponseModels/FineTuningJobResponse.cs index 2172e7a2..b3f940a8 100644 --- a/OpenAI.SDK/ObjectModels/ResponseModels/FineTuningJobResponseModels/FineTuningJobResponse.cs +++ b/OpenAI.SDK/ObjectModels/ResponseModels/FineTuningJobResponseModels/FineTuningJobResponse.cs @@ -67,7 +67,12 @@ public record FineTuningJobResponse : BaseResponse, IOpenAIModels.IId, IOpenAIMo /// The Unix timestamp (in seconds) for when the fine-tuning job was created. /// [JsonPropertyName("created_at")] - public long CreatedAt { get; set; } + public long CreatedAtUnix { get; set; } + + /// + /// for when the fine-tuning job was created. + /// + public DateTimeOffset CreatedAt => DateTimeOffset.FromUnixTimeSeconds(CreatedAtUnix); /// /// The object identifier, which can be referenced in the API endpoints. diff --git a/OpenAI.SDK/ObjectModels/ResponseModels/ImageResponseModel/ImageCreateResponse.cs b/OpenAI.SDK/ObjectModels/ResponseModels/ImageResponseModel/ImageCreateResponse.cs index de888183..4542c5b3 100644 --- a/OpenAI.SDK/ObjectModels/ResponseModels/ImageResponseModel/ImageCreateResponse.cs +++ b/OpenAI.SDK/ObjectModels/ResponseModels/ImageResponseModel/ImageCreateResponse.cs @@ -8,7 +8,9 @@ public record ImageCreateResponse : BaseResponse, IOpenAIModels.ICreatedAt [JsonPropertyName("data")] public List Results { get; set; } - [JsonPropertyName("created")] public long CreatedAt { get; set; } + [JsonPropertyName("created")] + public long CreatedAtUnix { get; set; } + public DateTimeOffset CreatedAt => DateTimeOffset.FromUnixTimeSeconds(CreatedAtUnix); public record ImageDataResult { diff --git a/OpenAI.SDK/ObjectModels/ResponseModels/RunStepListResponse.cs b/OpenAI.SDK/ObjectModels/ResponseModels/RunStepListResponse.cs index 361e6597..5b9946a4 100644 --- a/OpenAI.SDK/ObjectModels/ResponseModels/RunStepListResponse.cs +++ b/OpenAI.SDK/ObjectModels/ResponseModels/RunStepListResponse.cs @@ -93,7 +93,9 @@ public record RunStepResponse : BaseResponse, IOpenAIModels.IId, IOpenAIModels.I /// The Unix timestamp (in seconds) for when the run step was created. /// [JsonPropertyName("created_at")] - public long CreatedAt { get; set; } + public long CreatedAtUnix { get; set; } + + public DateTimeOffset CreatedAt => DateTimeOffset.FromUnixTimeSeconds(CreatedAtUnix); /// /// The identifier of the run step, which can be referenced in API endpoints. diff --git a/OpenAI.SDK/ObjectModels/ResponseModels/VectorStoreResponseModels/VectorStoreFileBatchObject.cs b/OpenAI.SDK/ObjectModels/ResponseModels/VectorStoreResponseModels/VectorStoreFileBatchObject.cs index fd5c205d..e3643682 100644 --- a/OpenAI.SDK/ObjectModels/ResponseModels/VectorStoreResponseModels/VectorStoreFileBatchObject.cs +++ b/OpenAI.SDK/ObjectModels/ResponseModels/VectorStoreResponseModels/VectorStoreFileBatchObject.cs @@ -15,7 +15,11 @@ public record VectorStoreFileBatchObject : BaseResponse /// The Unix timestamp (in seconds) for when the vector store files batch was created. /// [JsonPropertyName("created_at")] - public long CreatedAt { get; set; } + public long CreatedAtUnix { get; set; } + /// + /// for when the vector store files batch was created. + /// + public DateTimeOffset CreatedAt => DateTimeOffset.FromUnixTimeSeconds(CreatedAtUnix); /// /// The ID of the [vector store](/docs/api-reference/vector-stores/object) that the [File](/docs/api-reference/files) diff --git a/OpenAI.SDK/ObjectModels/ResponseModels/VectorStoreResponseModels/VectorStoreFileObject.cs b/OpenAI.SDK/ObjectModels/ResponseModels/VectorStoreResponseModels/VectorStoreFileObject.cs index 39742d59..e0d77be1 100644 --- a/OpenAI.SDK/ObjectModels/ResponseModels/VectorStoreResponseModels/VectorStoreFileObject.cs +++ b/OpenAI.SDK/ObjectModels/ResponseModels/VectorStoreResponseModels/VectorStoreFileObject.cs @@ -26,7 +26,12 @@ public record VectorStoreFileObject : BaseResponse /// The Unix timestamp (in seconds) for when the vector store file was created. /// [JsonPropertyName("created_at")] - public long CreatedAt { get; set; } + public long CreatedAtUnix { get; set; } + + /// + /// for when the vector store file was created. + /// + public DateTimeOffset CreatedAt => DateTimeOffset.FromUnixTimeSeconds(CreatedAtUnix); /// /// The ID of the [vector store](/docs/api-reference/vector-stores/object) that the [File](/docs/api-reference/files) diff --git a/OpenAI.SDK/ObjectModels/ResponseModels/VectorStoreResponseModels/VectorStoreObjectResponse.cs b/OpenAI.SDK/ObjectModels/ResponseModels/VectorStoreResponseModels/VectorStoreObjectResponse.cs index ca5eed11..46e79bc3 100644 --- a/OpenAI.SDK/ObjectModels/ResponseModels/VectorStoreResponseModels/VectorStoreObjectResponse.cs +++ b/OpenAI.SDK/ObjectModels/ResponseModels/VectorStoreResponseModels/VectorStoreObjectResponse.cs @@ -15,7 +15,12 @@ public record VectorStoreObjectResponse : BaseResponse /// The Unix timestamp (in seconds) for when the vector store was created. /// [JsonPropertyName("created_at")] - public long CreatedAt { get; set; } + public long CreatedAtUnix { get; set; } + + /// + /// for when the vector store was created. + /// + public DateTimeOffset CreatedAt => DateTimeOffset.FromUnixTimeSeconds(CreatedAtUnix); /// /// The name of the vector store. diff --git a/OpenAI.SDK/ObjectModels/SharedModels/AssistantFileResponse.cs b/OpenAI.SDK/ObjectModels/SharedModels/AssistantFileResponse.cs index e081d1d4..9fe7166c 100644 --- a/OpenAI.SDK/ObjectModels/SharedModels/AssistantFileResponse.cs +++ b/OpenAI.SDK/ObjectModels/SharedModels/AssistantFileResponse.cs @@ -15,7 +15,9 @@ public record AssistantFileResponse : BaseResponse, IOpenAIModels.IId, IOpenAIMo /// The Unix timestamp (in seconds) for when the assistant file was created. /// [JsonPropertyName("created_at")] - public long CreatedAt { get; set; } + public long CreatedAtUnix { get; set; } + + public DateTimeOffset CreatedAt => DateTimeOffset.FromUnixTimeSeconds(CreatedAtUnix); /// /// The identifier, which can be referenced in API endpoints. diff --git a/OpenAI.SDK/ObjectModels/SharedModels/AssistantResponse.cs b/OpenAI.SDK/ObjectModels/SharedModels/AssistantResponse.cs index 10fb29c0..268e4947 100644 --- a/OpenAI.SDK/ObjectModels/SharedModels/AssistantResponse.cs +++ b/OpenAI.SDK/ObjectModels/SharedModels/AssistantResponse.cs @@ -58,11 +58,29 @@ public record AssistantResponse : BaseResponse, IOpenAIModels.IId, IOpenAIModels [JsonPropertyName("response_format")] public ResponseFormatOneOfType ResponseFormatOneOfType { get; set; } + /// + /// 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. + /// + [JsonPropertyName("temperature")] + public float? Temperature { get; set; } + + /// + /// An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the + /// tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are + /// considered. + /// We generally recommend altering this or temperature but not both. + /// + [JsonPropertyName("top_p")] + public double? TopP { get; set; } + /// /// The Unix timestamp (in seconds) for when the assistant was created. /// [JsonPropertyName("created_at")] - public long CreatedAt { get; set; } + public long CreatedAtUnix { get; set; } + + public DateTimeOffset CreatedAt => DateTimeOffset.FromUnixTimeSeconds(CreatedAtUnix); /// /// The identifier, which can be referenced in API endpoints. @@ -88,20 +106,4 @@ public record AssistantResponse : BaseResponse, IOpenAIModels.IId, IOpenAIModels /// [JsonPropertyName("tools")] public List Tools { get; set; } - - /// - /// 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. - /// - [JsonPropertyName("temperature")] - public float? Temperature { get; set; } - - /// - /// An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the - /// tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are - /// considered. - /// We generally recommend altering this or temperature but not both. - /// - [JsonPropertyName("top_p")] - public double? TopP { get; set; } } \ No newline at end of file diff --git a/OpenAI.SDK/ObjectModels/SharedModels/EventResponse.cs b/OpenAI.SDK/ObjectModels/SharedModels/EventResponse.cs index ae0d6766..35b6f06f 100644 --- a/OpenAI.SDK/ObjectModels/SharedModels/EventResponse.cs +++ b/OpenAI.SDK/ObjectModels/SharedModels/EventResponse.cs @@ -2,7 +2,7 @@ namespace Betalgo.Ranul.OpenAI.ObjectModels.SharedModels; -public record EventResponse +public record EventResponse:IOpenAIModels.ICreatedAt { [JsonPropertyName("object")] public string? ObjectTypeName { get; set; } @@ -11,7 +11,9 @@ public record EventResponse public string? Id { get; set; } [JsonPropertyName("created_at")] - public int? CreatedAt { get; set; } + public long CreatedAtUnix { get; set; } + public DateTimeOffset CreatedAt => DateTimeOffset.FromUnixTimeSeconds(CreatedAtUnix); + [JsonPropertyName("level")] public string Level { get; set; } diff --git a/OpenAI.SDK/ObjectModels/SharedModels/FileResponse.cs b/OpenAI.SDK/ObjectModels/SharedModels/FileResponse.cs index 2f6eceac..97f90049 100644 --- a/OpenAI.SDK/ObjectModels/SharedModels/FileResponse.cs +++ b/OpenAI.SDK/ObjectModels/SharedModels/FileResponse.cs @@ -12,8 +12,18 @@ public record FileResponse : BaseResponse, IOpenAIModels.IId, IOpenAIModels.ICre public string FileName { get; set; } public UploadFilePurposes.UploadFilePurpose PurposeEnum => UploadFilePurposes.ToEnum(Purpose); - [JsonPropertyName("purpose")] public string Purpose { get; set; } - [JsonPropertyName("status")] public string Status { get; set; } - [JsonPropertyName("created_at")] public long CreatedAt { get; set; } - [JsonPropertyName("id")] public string Id { get; set; } + + [JsonPropertyName("purpose")] + public string Purpose { get; set; } + + [JsonPropertyName("status")] + public string Status { get; set; } + + [JsonPropertyName("created_at")] + public long CreatedAtUnix { get; set; } + + public DateTimeOffset CreatedAt => DateTimeOffset.FromUnixTimeSeconds(CreatedAtUnix); + + [JsonPropertyName("id")] + public string Id { get; set; } } \ No newline at end of file diff --git a/OpenAI.SDK/ObjectModels/SharedModels/IOpenAiModels.cs b/OpenAI.SDK/ObjectModels/SharedModels/IOpenAiModels.cs index 778d88cf..10aaba7c 100644 --- a/OpenAI.SDK/ObjectModels/SharedModels/IOpenAiModels.cs +++ b/OpenAI.SDK/ObjectModels/SharedModels/IOpenAiModels.cs @@ -36,7 +36,8 @@ public interface IAssistantId public interface ICreatedAt { - public long CreatedAt { get; set; } + public long CreatedAtUnix { get; set; } + public DateTimeOffset CreatedAt { get; } } public interface ICompletedAt diff --git a/OpenAI.SDK/ObjectModels/SharedModels/MessageResponse.cs b/OpenAI.SDK/ObjectModels/SharedModels/MessageResponse.cs index 8295cea4..1d2c5cc5 100644 --- a/OpenAI.SDK/ObjectModels/SharedModels/MessageResponse.cs +++ b/OpenAI.SDK/ObjectModels/SharedModels/MessageResponse.cs @@ -14,6 +14,7 @@ public MessageResponse Delta { set => Content = value.Content; } + /// /// The thread ID that this message belongs to. /// @@ -82,7 +83,11 @@ public MessageResponse Delta /// The Unix timestamp (in seconds) for when the message was created. /// [JsonPropertyName("created_at")] - public long CreatedAt { get; set; } + public long CreatedAtUnix { get; set; } + /// + /// for when the message was created. + /// + public DateTimeOffset CreatedAt => DateTimeOffset.FromUnixTimeSeconds(CreatedAtUnix); /// /// The identifier, which can be referenced in API endpoints. diff --git a/OpenAI.SDK/ObjectModels/SharedModels/RunResponse.cs b/OpenAI.SDK/ObjectModels/SharedModels/RunResponse.cs index 07bbd276..19568ed5 100644 --- a/OpenAI.SDK/ObjectModels/SharedModels/RunResponse.cs +++ b/OpenAI.SDK/ObjectModels/SharedModels/RunResponse.cs @@ -143,7 +143,12 @@ public record RunResponse : BaseResponse, IOpenAIModels.IId, IOpenAIModels.IMode /// The Unix timestamp (in seconds) for when the run was created. /// [JsonPropertyName("created_at")] - public long CreatedAt { get; set; } + public long CreatedAtUnix { get; set; } + + /// + /// for when the run was created. + /// + public DateTimeOffset CreatedAt => DateTimeOffset.FromUnixTimeSeconds(CreatedAtUnix); /// /// The list of File IDs the assistant used for this run. diff --git a/OpenAI.SDK/ObjectModels/SharedModels/ThreadResponse.cs b/OpenAI.SDK/ObjectModels/SharedModels/ThreadResponse.cs index bb6b2b9f..c8c7e209 100644 --- a/OpenAI.SDK/ObjectModels/SharedModels/ThreadResponse.cs +++ b/OpenAI.SDK/ObjectModels/SharedModels/ThreadResponse.cs @@ -18,7 +18,12 @@ public record ThreadResponse : BaseResponse, IOpenAIModels.IId, IOpenAIModels.IC /// The Unix timestamp (in seconds) for when the assistant was created. /// [JsonPropertyName("created_at")] - public long CreatedAt { get; set; } + public long CreatedAtUnix { get; set; } + + /// + /// for when the assistant was created. + /// + public DateTimeOffset CreatedAt => DateTimeOffset.FromUnixTimeSeconds(CreatedAtUnix); /// /// The identifier, which can be referenced in API endpoints.