Skip to content

Commit 0b47597

Browse files
feat: Support new tools in AI Studio (box/box-openapi#534) (#520)
1 parent c344023 commit 0b47597

File tree

9 files changed

+143
-20
lines changed

9 files changed

+143
-20
lines changed

.codegen.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{ "engineHash": "fc1155c", "specHash": "b5422f4", "version": "1.10.0" }
1+
{ "engineHash": "fc1155c", "specHash": "8402463", "version": "1.10.0" }

Box.Sdk.Gen/Schemas/AiStudioAgentAsk/AiStudioAgentAsk.cs

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
using Box.Sdk.Gen;
2+
using System;
3+
using System.Collections.ObjectModel;
4+
using System.Collections.Generic;
25
using System.Text.Json.Serialization;
36
using Box.Sdk.Gen.Internal;
4-
using System.Collections.Generic;
57
using Box.Sdk.Gen.Schemas;
68

79
namespace Box.Sdk.Gen.Schemas {
@@ -26,29 +28,44 @@ public class AiStudioAgentAsk : ISerializable {
2628
public string AccessState { get; }
2729

2830
/// <summary>
29-
/// The description of the AI Agent.
31+
/// The description of the AI agent.
3032
/// </summary>
3133
[JsonPropertyName("description")]
3234
public string Description { get; }
3335

3436
/// <summary>
35-
/// Custom instructions for the agent.
37+
/// Custom instructions for the AI agent.
3638
/// </summary>
3739
[JsonPropertyName("custom_instructions")]
3840
public string? CustomInstructions { get => _customInstructions; init { _customInstructions = value; _isCustomInstructionsSet = true; } }
3941

42+
/// <summary>
43+
/// Suggested questions for the AI agent. If null, suggested question will be generated. If empty, no suggested questions will be displayed.
44+
/// </summary>
45+
[JsonPropertyName("suggested_questions")]
46+
public IReadOnlyList<string>? SuggestedQuestions { get; init; }
47+
4048
[JsonPropertyName("long_text")]
4149
public AiStudioAgentLongTextTool? LongText { get; init; }
4250

4351
[JsonPropertyName("basic_text")]
4452
public AiStudioAgentBasicTextTool? BasicText { get; init; }
4553

54+
[JsonPropertyName("basic_image")]
55+
public AiStudioAgentBasicTextTool? BasicImage { get; init; }
56+
57+
[JsonPropertyName("spreadsheet")]
58+
public AiStudioAgentSpreadsheetTool? Spreadsheet { get; init; }
59+
4660
[JsonPropertyName("long_text_multi")]
4761
public AiStudioAgentLongTextTool? LongTextMulti { get; init; }
4862

4963
[JsonPropertyName("basic_text_multi")]
5064
public AiStudioAgentBasicTextTool? BasicTextMulti { get; init; }
5165

66+
[JsonPropertyName("basic_image_multi")]
67+
public AiStudioAgentBasicTextTool? BasicImageMulti { get; init; }
68+
5269
public AiStudioAgentAsk(string accessState, string description, AiStudioAgentAskTypeField type = AiStudioAgentAskTypeField.AiAgentAsk) {
5370
Type = type;
5471
AccessState = accessState;

Box.Sdk.Gen/Schemas/AiStudioAgentAskResponse/AiStudioAgentAskResponse.cs

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
using Box.Sdk.Gen;
2+
using System;
3+
using System.Collections.ObjectModel;
4+
using System.Collections.Generic;
25
using System.Text.Json.Serialization;
36
using Box.Sdk.Gen.Internal;
4-
using System.Collections.Generic;
57
using Box.Sdk.Gen.Schemas;
68

79
namespace Box.Sdk.Gen.Schemas {
@@ -13,7 +15,7 @@ public class AiStudioAgentAskResponse : ISerializable {
1315
protected string? _customInstructions { get; set; }
1416

1517
/// <summary>
16-
/// The type of AI agent used to handle queries.
18+
/// The type of AI agent used to ask questions.
1719
/// </summary>
1820
[JsonPropertyName("type")]
1921
[JsonConverter(typeof(StringEnumConverter<AiStudioAgentAskResponseTypeField>))]
@@ -26,29 +28,44 @@ public class AiStudioAgentAskResponse : ISerializable {
2628
public string AccessState { get; }
2729

2830
/// <summary>
29-
/// The description of the AI Agent.
31+
/// The description of the AI agent.
3032
/// </summary>
3133
[JsonPropertyName("description")]
3234
public string Description { get; }
3335

3436
/// <summary>
35-
/// Custom instructions for the agent.
37+
/// Custom instructions for the AI agent.
3638
/// </summary>
3739
[JsonPropertyName("custom_instructions")]
3840
public string? CustomInstructions { get => _customInstructions; init { _customInstructions = value; _isCustomInstructionsSet = true; } }
3941

42+
/// <summary>
43+
/// Suggested questions for the AI agent. If null, suggested question will be generated. If empty, no suggested questions will be displayed.
44+
/// </summary>
45+
[JsonPropertyName("suggested_questions")]
46+
public IReadOnlyList<string>? SuggestedQuestions { get; init; }
47+
4048
[JsonPropertyName("long_text")]
4149
public AiStudioAgentLongTextToolResponse? LongText { get; init; }
4250

4351
[JsonPropertyName("basic_text")]
4452
public AiStudioAgentBasicTextToolResponse? BasicText { get; init; }
4553

54+
[JsonPropertyName("basic_image")]
55+
public AiStudioAgentBasicTextToolResponse? BasicImage { get; init; }
56+
57+
[JsonPropertyName("spreadsheet")]
58+
public AiStudioAgentSpreadsheetToolResponse? Spreadsheet { get; init; }
59+
4660
[JsonPropertyName("long_text_multi")]
4761
public AiStudioAgentLongTextToolResponse? LongTextMulti { get; init; }
4862

4963
[JsonPropertyName("basic_text_multi")]
5064
public AiStudioAgentBasicTextToolResponse? BasicTextMulti { get; init; }
5165

66+
[JsonPropertyName("basic_image_multi")]
67+
public AiStudioAgentBasicTextToolResponse? BasicImageMulti { get; init; }
68+
5269
public AiStudioAgentAskResponse(string accessState, string description, AiStudioAgentAskResponseTypeField type = AiStudioAgentAskResponseTypeField.AiAgentAsk) {
5370
Type = type;
5471
AccessState = accessState;

Box.Sdk.Gen/Schemas/AiStudioAgentExtract/AiStudioAgentExtract.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public class AiStudioAgentExtract : ISerializable {
1313
protected string? _customInstructions { get; set; }
1414

1515
/// <summary>
16-
/// The type of AI agent to be used for extraction.
16+
/// The type of AI agent to be used for metadata extraction.
1717
/// </summary>
1818
[JsonPropertyName("type")]
1919
[JsonConverter(typeof(StringEnumConverter<AiStudioAgentExtractTypeField>))]
@@ -26,13 +26,13 @@ public class AiStudioAgentExtract : ISerializable {
2626
public string AccessState { get; }
2727

2828
/// <summary>
29-
/// The description of the AI Agent.
29+
/// The description of the AI agent.
3030
/// </summary>
3131
[JsonPropertyName("description")]
3232
public string Description { get; }
3333

3434
/// <summary>
35-
/// Custom instructions for the agent.
35+
/// Custom instructions for the AI agent.
3636
/// </summary>
3737
[JsonPropertyName("custom_instructions")]
3838
public string? CustomInstructions { get => _customInstructions; init { _customInstructions = value; _isCustomInstructionsSet = true; } }
@@ -43,6 +43,9 @@ public class AiStudioAgentExtract : ISerializable {
4343
[JsonPropertyName("basic_text")]
4444
public AiStudioAgentBasicTextTool? BasicText { get; init; }
4545

46+
[JsonPropertyName("basic_image")]
47+
public AiStudioAgentBasicTextTool? BasicImage { get; init; }
48+
4649
public AiStudioAgentExtract(string accessState, string description, AiStudioAgentExtractTypeField type = AiStudioAgentExtractTypeField.AiAgentExtract) {
4750
Type = type;
4851
AccessState = accessState;

Box.Sdk.Gen/Schemas/AiStudioAgentExtractResponse/AiStudioAgentExtractResponse.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public class AiStudioAgentExtractResponse : ISerializable {
1313
protected string? _customInstructions { get; set; }
1414

1515
/// <summary>
16-
/// The type of AI agent to be used for extraction.
16+
/// The type of AI agent to be used for metadata extraction.
1717
/// </summary>
1818
[JsonPropertyName("type")]
1919
[JsonConverter(typeof(StringEnumConverter<AiStudioAgentExtractResponseTypeField>))]
@@ -26,13 +26,13 @@ public class AiStudioAgentExtractResponse : ISerializable {
2626
public string AccessState { get; }
2727

2828
/// <summary>
29-
/// The description of the AI Agent.
29+
/// The description of the AI agent.
3030
/// </summary>
3131
[JsonPropertyName("description")]
3232
public string Description { get; }
3333

3434
/// <summary>
35-
/// Custom instructions for the agent.
35+
/// Custom instructions for the AI agent.
3636
/// </summary>
3737
[JsonPropertyName("custom_instructions")]
3838
public string? CustomInstructions { get => _customInstructions; init { _customInstructions = value; _isCustomInstructionsSet = true; } }
@@ -43,6 +43,9 @@ public class AiStudioAgentExtractResponse : ISerializable {
4343
[JsonPropertyName("basic_text")]
4444
public AiStudioAgentBasicTextToolResponse? BasicText { get; init; }
4545

46+
[JsonPropertyName("basic_image")]
47+
public AiStudioAgentBasicTextToolResponse? BasicImage { get; init; }
48+
4649
public AiStudioAgentExtractResponse(string accessState, string description, AiStudioAgentExtractResponseTypeField type = AiStudioAgentExtractResponseTypeField.AiAgentExtract) {
4750
Type = type;
4851
AccessState = accessState;
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
using System.Text.Json.Serialization;
2+
using System.Collections.Generic;
3+
using Box.Sdk.Gen.Internal;
4+
using Box.Sdk.Gen.Schemas;
5+
6+
namespace Box.Sdk.Gen.Schemas {
7+
public class AiStudioAgentSpreadsheetTool : AiAgentSpreadsheetTool, ISerializable {
8+
public AiStudioAgentSpreadsheetTool() {
9+
10+
}
11+
internal new string? RawJson { get; set; } = default;
12+
13+
void ISerializable.SetJson(string json) {
14+
RawJson = json;
15+
}
16+
17+
string? ISerializable.GetJson() {
18+
return RawJson;
19+
}
20+
21+
/// <summary>
22+
/// Returns raw json response returned from the API.
23+
/// </summary>
24+
public new Dictionary<string, object?>? GetRawData() {
25+
return SimpleJsonSerializer.GetAllFields(this);
26+
}
27+
28+
}
29+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
using Box.Sdk.Gen;
2+
using System;
3+
using System.Collections.ObjectModel;
4+
using System.Collections.Generic;
5+
using System.Text.Json.Serialization;
6+
using Box.Sdk.Gen.Internal;
7+
using Box.Sdk.Gen.Schemas;
8+
9+
namespace Box.Sdk.Gen.Schemas {
10+
public class AiStudioAgentSpreadsheetToolResponse : AiStudioAgentSpreadsheetTool, ISerializable {
11+
/// <summary>
12+
/// Warnings concerning tool.
13+
/// </summary>
14+
[JsonPropertyName("warnings")]
15+
public IReadOnlyList<string>? Warnings { get; init; }
16+
17+
public AiStudioAgentSpreadsheetToolResponse() {
18+
19+
}
20+
internal new string? RawJson { get; set; } = default;
21+
22+
void ISerializable.SetJson(string json) {
23+
RawJson = json;
24+
}
25+
26+
string? ISerializable.GetJson() {
27+
return RawJson;
28+
}
29+
30+
/// <summary>
31+
/// Returns raw json response returned from the API.
32+
/// </summary>
33+
public new Dictionary<string, object?>? GetRawData() {
34+
return SimpleJsonSerializer.GetAllFields(this);
35+
}
36+
37+
}
38+
}

Box.Sdk.Gen/Schemas/AiStudioAgentTextGen/AiStudioAgentTextGen.cs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
using Box.Sdk.Gen;
2+
using System;
3+
using System.Collections.ObjectModel;
4+
using System.Collections.Generic;
25
using System.Text.Json.Serialization;
36
using Box.Sdk.Gen.Internal;
4-
using System.Collections.Generic;
57
using Box.Sdk.Gen.Schemas;
68

79
namespace Box.Sdk.Gen.Schemas {
@@ -26,17 +28,23 @@ public class AiStudioAgentTextGen : ISerializable {
2628
public string AccessState { get; }
2729

2830
/// <summary>
29-
/// The description of the AI Agent.
31+
/// The description of the AI agent.
3032
/// </summary>
3133
[JsonPropertyName("description")]
3234
public string Description { get; }
3335

3436
/// <summary>
35-
/// Custom instructions for the agent.
37+
/// Custom instructions for the AI agent.
3638
/// </summary>
3739
[JsonPropertyName("custom_instructions")]
3840
public string? CustomInstructions { get => _customInstructions; init { _customInstructions = value; _isCustomInstructionsSet = true; } }
3941

42+
/// <summary>
43+
/// Suggested questions for the AI agent. If null, suggested question will be generated. If empty, no suggested questions will be displayed.
44+
/// </summary>
45+
[JsonPropertyName("suggested_questions")]
46+
public IReadOnlyList<string>? SuggestedQuestions { get; init; }
47+
4048
[JsonPropertyName("basic_gen")]
4149
public AiStudioAgentBasicGenTool? BasicGen { get; init; }
4250

Box.Sdk.Gen/Schemas/AiStudioAgentTextGenResponse/AiStudioAgentTextGenResponse.cs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
using Box.Sdk.Gen;
2+
using System;
3+
using System.Collections.ObjectModel;
4+
using System.Collections.Generic;
25
using System.Text.Json.Serialization;
36
using Box.Sdk.Gen.Internal;
4-
using System.Collections.Generic;
57
using Box.Sdk.Gen.Schemas;
68

79
namespace Box.Sdk.Gen.Schemas {
@@ -26,17 +28,23 @@ public class AiStudioAgentTextGenResponse : ISerializable {
2628
public string AccessState { get; }
2729

2830
/// <summary>
29-
/// The description of the AI Agent.
31+
/// The description of the AI agent.
3032
/// </summary>
3133
[JsonPropertyName("description")]
3234
public string Description { get; }
3335

3436
/// <summary>
35-
/// Custom instructions for the agent.
37+
/// Custom instructions for the AI agent.
3638
/// </summary>
3739
[JsonPropertyName("custom_instructions")]
3840
public string? CustomInstructions { get => _customInstructions; init { _customInstructions = value; _isCustomInstructionsSet = true; } }
3941

42+
/// <summary>
43+
/// Suggested questions for the AI agent. If null, suggested question will be generated. If empty, no suggested questions will be displayed.
44+
/// </summary>
45+
[JsonPropertyName("suggested_questions")]
46+
public IReadOnlyList<string>? SuggestedQuestions { get; init; }
47+
4048
[JsonPropertyName("basic_gen")]
4149
public AiStudioAgentBasicGenToolResponse? BasicGen { get; init; }
4250

0 commit comments

Comments
 (0)