-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: update /ai/extract_structured response schema (box/box-openapi#505
- Loading branch information
1 parent
129a53e
commit 87e7e0f
Showing
6 changed files
with
56 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{ "engineHash": "cf82faa", "specHash": "3dc3f1e", "version": "1.6.0" } | ||
{ "engineHash": "cf82faa", "specHash": "1fdcbef", "version": "1.6.0" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
Box.Sdk.Gen/Schemas/AiExtractStructuredResponse/AiExtractStructuredResponse.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
using Box.Sdk.Gen; | ||
using System.Text.Json.Serialization; | ||
using System.Collections.Generic; | ||
using Box.Sdk.Gen.Internal; | ||
using Box.Sdk.Gen.Schemas; | ||
|
||
namespace Box.Sdk.Gen.Schemas { | ||
public class AiExtractStructuredResponse : ISerializable { | ||
[JsonPropertyName("answer")] | ||
public AiExtractResponse Answer { get; } | ||
|
||
/// <summary> | ||
/// The ISO date formatted timestamp of when the answer to the prompt was created. | ||
/// </summary> | ||
[JsonPropertyName("created_at")] | ||
public System.DateTimeOffset CreatedAt { get; } | ||
|
||
/// <summary> | ||
/// The reason the response finishes. | ||
/// </summary> | ||
[JsonPropertyName("completion_reason")] | ||
public string? CompletionReason { get; init; } | ||
|
||
[JsonPropertyName("ai_agent_info")] | ||
public AiAgentInfo? AiAgentInfo { get; init; } | ||
|
||
public AiExtractStructuredResponse(AiExtractResponse answer, System.DateTimeOffset createdAt) { | ||
Answer = answer; | ||
CreatedAt = createdAt; | ||
} | ||
internal string? RawJson { get; set; } = default; | ||
|
||
void ISerializable.SetJson(string json) { | ||
RawJson = json; | ||
} | ||
|
||
string? ISerializable.GetJson() { | ||
return RawJson; | ||
} | ||
|
||
/// <summary> | ||
/// Returns raw json response returned from the API. | ||
/// </summary> | ||
public Dictionary<string, object?>? GetRawData() { | ||
return SimpleJsonSerializer.GetAllFields(this); | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters