Skip to content

Commit e793d7b

Browse files
feat: Support new tools in AI Studio (box/box-openapi#534) (#485)
1 parent 14726d1 commit e793d7b

File tree

11 files changed

+283
-44
lines changed

11 files changed

+283
-44
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": "0.6.1" }
1+
{ "engineHash": "fc1155c", "specHash": "8402463", "version": "0.6.1" }

BoxSdkGen.xcodeproj/project.pbxproj

Lines changed: 40 additions & 0 deletions
Large diffs are not rendered by default.

Sources/Schemas/AiAgentSpreadsheetTool/AiAgentSpreadsheetTool.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Foundation
22

3-
/// AI agent processor used to handle spreadsheets and tabular data.
3+
/// The AI agent tool used to handle spreadsheets and tabular data.
44
public class AiAgentSpreadsheetTool: Codable, RawJSONReadable {
55
private enum CodingKeys: String, CodingKey {
66
case model

Sources/Schemas/AiStudioAgentAsk/AiStudioAgentAsk.swift

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
import Foundation
22

3-
/// The AI Agent to be used for ask.
3+
/// The AI agent to be used to handle queries.
44
public class AiStudioAgentAsk: Codable, RawJSONReadable {
55
private enum CodingKeys: String, CodingKey {
66
case accessState = "access_state"
77
case description
88
case type
99
case customInstructions = "custom_instructions"
10+
case suggestedQuestions = "suggested_questions"
1011
case longText = "long_text"
1112
case basicText = "basic_text"
13+
case basicImage = "basic_image"
14+
case spreadsheet
1215
case longTextMulti = "long_text_multi"
1316
case basicTextMulti = "basic_text_multi"
17+
case basicImageMulti = "basic_image_multi"
1418
}
1519

1620
/// Internal backing store for rawData. Used to store raw dictionary data associated with the instance.
@@ -25,43 +29,60 @@ public class AiStudioAgentAsk: Codable, RawJSONReadable {
2529
/// The state of the AI Agent capability. Possible values are: `enabled` and `disabled`.
2630
public let accessState: String
2731

28-
/// The description of the AI Agent.
32+
/// The description of the AI agent.
2933
public let description: String
3034

3135
/// The type of AI agent used to handle queries.
3236
public let type: AiStudioAgentAskTypeField
3337

34-
/// Custom instructions for the agent.
38+
/// Custom instructions for the AI agent.
3539
@CodableTriState public private(set) var customInstructions: String?
3640

41+
/// Suggested questions for the AI agent. If null, suggested question will be generated. If empty, no suggested questions will be displayed.
42+
public let suggestedQuestions: [String]?
43+
3744
public let longText: AiStudioAgentLongTextTool?
3845

3946
public let basicText: AiStudioAgentBasicTextTool?
4047

48+
public let basicImage: AiStudioAgentBasicTextTool?
49+
50+
public let spreadsheet: AiStudioAgentSpreadsheetTool?
51+
4152
public let longTextMulti: AiStudioAgentLongTextTool?
4253

4354
public let basicTextMulti: AiStudioAgentBasicTextTool?
4455

56+
public let basicImageMulti: AiStudioAgentBasicTextTool?
57+
4558
/// Initializer for a AiStudioAgentAsk.
4659
///
4760
/// - Parameters:
4861
/// - accessState: The state of the AI Agent capability. Possible values are: `enabled` and `disabled`.
49-
/// - description: The description of the AI Agent.
62+
/// - description: The description of the AI agent.
5063
/// - type: The type of AI agent used to handle queries.
51-
/// - customInstructions: Custom instructions for the agent.
64+
/// - customInstructions: Custom instructions for the AI agent.
65+
/// - suggestedQuestions: Suggested questions for the AI agent. If null, suggested question will be generated. If empty, no suggested questions will be displayed.
5266
/// - longText:
5367
/// - basicText:
68+
/// - basicImage:
69+
/// - spreadsheet:
5470
/// - longTextMulti:
5571
/// - basicTextMulti:
56-
public init(accessState: String, description: String, type: AiStudioAgentAskTypeField = AiStudioAgentAskTypeField.aiAgentAsk, customInstructions: TriStateField<String> = nil, longText: AiStudioAgentLongTextTool? = nil, basicText: AiStudioAgentBasicTextTool? = nil, longTextMulti: AiStudioAgentLongTextTool? = nil, basicTextMulti: AiStudioAgentBasicTextTool? = nil) {
72+
/// - basicImageMulti:
73+
public init(accessState: String, description: String, type: AiStudioAgentAskTypeField = AiStudioAgentAskTypeField.aiAgentAsk, customInstructions: TriStateField<String> = nil, suggestedQuestions: [String]? = nil, longText: AiStudioAgentLongTextTool? = nil, basicText: AiStudioAgentBasicTextTool? = nil, basicImage: AiStudioAgentBasicTextTool? = nil, spreadsheet: AiStudioAgentSpreadsheetTool? = nil, longTextMulti: AiStudioAgentLongTextTool? = nil, basicTextMulti: AiStudioAgentBasicTextTool? = nil, basicImageMulti: AiStudioAgentBasicTextTool? = nil) {
5774
self.accessState = accessState
5875
self.description = description
5976
self.type = type
6077
self._customInstructions = CodableTriState(state: customInstructions)
78+
self.suggestedQuestions = suggestedQuestions
6179
self.longText = longText
6280
self.basicText = basicText
81+
self.basicImage = basicImage
82+
self.spreadsheet = spreadsheet
6383
self.longTextMulti = longTextMulti
6484
self.basicTextMulti = basicTextMulti
85+
self.basicImageMulti = basicImageMulti
6586
}
6687

6788
required public init(from decoder: Decoder) throws {
@@ -70,10 +91,14 @@ public class AiStudioAgentAsk: Codable, RawJSONReadable {
7091
description = try container.decode(String.self, forKey: .description)
7192
type = try container.decode(AiStudioAgentAskTypeField.self, forKey: .type)
7293
customInstructions = try container.decodeIfPresent(String.self, forKey: .customInstructions)
94+
suggestedQuestions = try container.decodeIfPresent([String].self, forKey: .suggestedQuestions)
7395
longText = try container.decodeIfPresent(AiStudioAgentLongTextTool.self, forKey: .longText)
7496
basicText = try container.decodeIfPresent(AiStudioAgentBasicTextTool.self, forKey: .basicText)
97+
basicImage = try container.decodeIfPresent(AiStudioAgentBasicTextTool.self, forKey: .basicImage)
98+
spreadsheet = try container.decodeIfPresent(AiStudioAgentSpreadsheetTool.self, forKey: .spreadsheet)
7599
longTextMulti = try container.decodeIfPresent(AiStudioAgentLongTextTool.self, forKey: .longTextMulti)
76100
basicTextMulti = try container.decodeIfPresent(AiStudioAgentBasicTextTool.self, forKey: .basicTextMulti)
101+
basicImageMulti = try container.decodeIfPresent(AiStudioAgentBasicTextTool.self, forKey: .basicImageMulti)
77102
}
78103

79104
public func encode(to encoder: Encoder) throws {
@@ -82,10 +107,14 @@ public class AiStudioAgentAsk: Codable, RawJSONReadable {
82107
try container.encode(description, forKey: .description)
83108
try container.encode(type, forKey: .type)
84109
try container.encode(field: _customInstructions.state, forKey: .customInstructions)
110+
try container.encodeIfPresent(suggestedQuestions, forKey: .suggestedQuestions)
85111
try container.encodeIfPresent(longText, forKey: .longText)
86112
try container.encodeIfPresent(basicText, forKey: .basicText)
113+
try container.encodeIfPresent(basicImage, forKey: .basicImage)
114+
try container.encodeIfPresent(spreadsheet, forKey: .spreadsheet)
87115
try container.encodeIfPresent(longTextMulti, forKey: .longTextMulti)
88116
try container.encodeIfPresent(basicTextMulti, forKey: .basicTextMulti)
117+
try container.encodeIfPresent(basicImageMulti, forKey: .basicImageMulti)
89118
}
90119

91120
/// Sets the raw JSON data.

Sources/Schemas/AiStudioAgentAskResponse/AiStudioAgentAskResponse.swift

Lines changed: 37 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
import Foundation
22

3-
/// The AI Agent to be used for ask.
3+
/// The AI agent to be used to ask questions.
44
public class AiStudioAgentAskResponse: Codable, RawJSONReadable {
55
private enum CodingKeys: String, CodingKey {
66
case accessState = "access_state"
77
case description
88
case type
99
case customInstructions = "custom_instructions"
10+
case suggestedQuestions = "suggested_questions"
1011
case longText = "long_text"
1112
case basicText = "basic_text"
13+
case basicImage = "basic_image"
14+
case spreadsheet
1215
case longTextMulti = "long_text_multi"
1316
case basicTextMulti = "basic_text_multi"
17+
case basicImageMulti = "basic_image_multi"
1418
}
1519

1620
/// Internal backing store for rawData. Used to store raw dictionary data associated with the instance.
@@ -25,43 +29,60 @@ public class AiStudioAgentAskResponse: Codable, RawJSONReadable {
2529
/// The state of the AI Agent capability. Possible values are: `enabled` and `disabled`.
2630
public let accessState: String
2731

28-
/// The description of the AI Agent.
32+
/// The description of the AI agent.
2933
public let description: String
3034

31-
/// The type of AI agent used to handle queries.
35+
/// The type of AI agent used to ask questions.
3236
public let type: AiStudioAgentAskResponseTypeField
3337

34-
/// Custom instructions for the agent.
38+
/// Custom instructions for the AI agent.
3539
@CodableTriState public private(set) var customInstructions: String?
3640

41+
/// Suggested questions for the AI agent. If null, suggested question will be generated. If empty, no suggested questions will be displayed.
42+
public let suggestedQuestions: [String]?
43+
3744
public let longText: AiStudioAgentLongTextToolResponse?
3845

3946
public let basicText: AiStudioAgentBasicTextToolResponse?
4047

48+
public let basicImage: AiStudioAgentBasicTextToolResponse?
49+
50+
public let spreadsheet: AiStudioAgentSpreadsheetToolResponse?
51+
4152
public let longTextMulti: AiStudioAgentLongTextToolResponse?
4253

4354
public let basicTextMulti: AiStudioAgentBasicTextToolResponse?
4455

56+
public let basicImageMulti: AiStudioAgentBasicTextToolResponse?
57+
4558
/// Initializer for a AiStudioAgentAskResponse.
4659
///
4760
/// - Parameters:
4861
/// - accessState: The state of the AI Agent capability. Possible values are: `enabled` and `disabled`.
49-
/// - description: The description of the AI Agent.
50-
/// - type: The type of AI agent used to handle queries.
51-
/// - customInstructions: Custom instructions for the agent.
62+
/// - description: The description of the AI agent.
63+
/// - type: The type of AI agent used to ask questions.
64+
/// - customInstructions: Custom instructions for the AI agent.
65+
/// - suggestedQuestions: Suggested questions for the AI agent. If null, suggested question will be generated. If empty, no suggested questions will be displayed.
5266
/// - longText:
5367
/// - basicText:
68+
/// - basicImage:
69+
/// - spreadsheet:
5470
/// - longTextMulti:
5571
/// - basicTextMulti:
56-
public init(accessState: String, description: String, type: AiStudioAgentAskResponseTypeField = AiStudioAgentAskResponseTypeField.aiAgentAsk, customInstructions: TriStateField<String> = nil, longText: AiStudioAgentLongTextToolResponse? = nil, basicText: AiStudioAgentBasicTextToolResponse? = nil, longTextMulti: AiStudioAgentLongTextToolResponse? = nil, basicTextMulti: AiStudioAgentBasicTextToolResponse? = nil) {
72+
/// - basicImageMulti:
73+
public init(accessState: String, description: String, type: AiStudioAgentAskResponseTypeField = AiStudioAgentAskResponseTypeField.aiAgentAsk, customInstructions: TriStateField<String> = nil, suggestedQuestions: [String]? = nil, longText: AiStudioAgentLongTextToolResponse? = nil, basicText: AiStudioAgentBasicTextToolResponse? = nil, basicImage: AiStudioAgentBasicTextToolResponse? = nil, spreadsheet: AiStudioAgentSpreadsheetToolResponse? = nil, longTextMulti: AiStudioAgentLongTextToolResponse? = nil, basicTextMulti: AiStudioAgentBasicTextToolResponse? = nil, basicImageMulti: AiStudioAgentBasicTextToolResponse? = nil) {
5774
self.accessState = accessState
5875
self.description = description
5976
self.type = type
6077
self._customInstructions = CodableTriState(state: customInstructions)
78+
self.suggestedQuestions = suggestedQuestions
6179
self.longText = longText
6280
self.basicText = basicText
81+
self.basicImage = basicImage
82+
self.spreadsheet = spreadsheet
6383
self.longTextMulti = longTextMulti
6484
self.basicTextMulti = basicTextMulti
85+
self.basicImageMulti = basicImageMulti
6586
}
6687

6788
required public init(from decoder: Decoder) throws {
@@ -70,10 +91,14 @@ public class AiStudioAgentAskResponse: Codable, RawJSONReadable {
7091
description = try container.decode(String.self, forKey: .description)
7192
type = try container.decode(AiStudioAgentAskResponseTypeField.self, forKey: .type)
7293
customInstructions = try container.decodeIfPresent(String.self, forKey: .customInstructions)
94+
suggestedQuestions = try container.decodeIfPresent([String].self, forKey: .suggestedQuestions)
7395
longText = try container.decodeIfPresent(AiStudioAgentLongTextToolResponse.self, forKey: .longText)
7496
basicText = try container.decodeIfPresent(AiStudioAgentBasicTextToolResponse.self, forKey: .basicText)
97+
basicImage = try container.decodeIfPresent(AiStudioAgentBasicTextToolResponse.self, forKey: .basicImage)
98+
spreadsheet = try container.decodeIfPresent(AiStudioAgentSpreadsheetToolResponse.self, forKey: .spreadsheet)
7599
longTextMulti = try container.decodeIfPresent(AiStudioAgentLongTextToolResponse.self, forKey: .longTextMulti)
76100
basicTextMulti = try container.decodeIfPresent(AiStudioAgentBasicTextToolResponse.self, forKey: .basicTextMulti)
101+
basicImageMulti = try container.decodeIfPresent(AiStudioAgentBasicTextToolResponse.self, forKey: .basicImageMulti)
77102
}
78103

79104
public func encode(to encoder: Encoder) throws {
@@ -82,10 +107,14 @@ public class AiStudioAgentAskResponse: Codable, RawJSONReadable {
82107
try container.encode(description, forKey: .description)
83108
try container.encode(type, forKey: .type)
84109
try container.encode(field: _customInstructions.state, forKey: .customInstructions)
110+
try container.encodeIfPresent(suggestedQuestions, forKey: .suggestedQuestions)
85111
try container.encodeIfPresent(longText, forKey: .longText)
86112
try container.encodeIfPresent(basicText, forKey: .basicText)
113+
try container.encodeIfPresent(basicImage, forKey: .basicImage)
114+
try container.encodeIfPresent(spreadsheet, forKey: .spreadsheet)
87115
try container.encodeIfPresent(longTextMulti, forKey: .longTextMulti)
88116
try container.encodeIfPresent(basicTextMulti, forKey: .basicTextMulti)
117+
try container.encodeIfPresent(basicImageMulti, forKey: .basicImageMulti)
89118
}
90119

91120
/// Sets the raw JSON data.

Sources/Schemas/AiStudioAgentExtract/AiStudioAgentExtract.swift

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Foundation
22

3-
/// The AI Agent to be used for extraction.
3+
/// The AI agent to be used for metadata extraction.
44
public class AiStudioAgentExtract: Codable, RawJSONReadable {
55
private enum CodingKeys: String, CodingKey {
66
case accessState = "access_state"
@@ -9,6 +9,7 @@ public class AiStudioAgentExtract: Codable, RawJSONReadable {
99
case customInstructions = "custom_instructions"
1010
case longText = "long_text"
1111
case basicText = "basic_text"
12+
case basicImage = "basic_image"
1213
}
1314

1415
/// Internal backing store for rawData. Used to store raw dictionary data associated with the instance.
@@ -23,35 +24,39 @@ public class AiStudioAgentExtract: Codable, RawJSONReadable {
2324
/// The state of the AI Agent capability. Possible values are: `enabled` and `disabled`.
2425
public let accessState: String
2526

26-
/// The description of the AI Agent.
27+
/// The description of the AI agent.
2728
public let description: String
2829

29-
/// The type of AI agent to be used for extraction.
30+
/// The type of AI agent to be used for metadata extraction.
3031
public let type: AiStudioAgentExtractTypeField
3132

32-
/// Custom instructions for the agent.
33+
/// Custom instructions for the AI agent.
3334
@CodableTriState public private(set) var customInstructions: String?
3435

3536
public let longText: AiStudioAgentLongTextTool?
3637

3738
public let basicText: AiStudioAgentBasicTextTool?
3839

40+
public let basicImage: AiStudioAgentBasicTextTool?
41+
3942
/// Initializer for a AiStudioAgentExtract.
4043
///
4144
/// - Parameters:
4245
/// - accessState: The state of the AI Agent capability. Possible values are: `enabled` and `disabled`.
43-
/// - description: The description of the AI Agent.
44-
/// - type: The type of AI agent to be used for extraction.
45-
/// - customInstructions: Custom instructions for the agent.
46+
/// - description: The description of the AI agent.
47+
/// - type: The type of AI agent to be used for metadata extraction.
48+
/// - customInstructions: Custom instructions for the AI agent.
4649
/// - longText:
4750
/// - basicText:
48-
public init(accessState: String, description: String, type: AiStudioAgentExtractTypeField = AiStudioAgentExtractTypeField.aiAgentExtract, customInstructions: TriStateField<String> = nil, longText: AiStudioAgentLongTextTool? = nil, basicText: AiStudioAgentBasicTextTool? = nil) {
51+
/// - basicImage:
52+
public init(accessState: String, description: String, type: AiStudioAgentExtractTypeField = AiStudioAgentExtractTypeField.aiAgentExtract, customInstructions: TriStateField<String> = nil, longText: AiStudioAgentLongTextTool? = nil, basicText: AiStudioAgentBasicTextTool? = nil, basicImage: AiStudioAgentBasicTextTool? = nil) {
4953
self.accessState = accessState
5054
self.description = description
5155
self.type = type
5256
self._customInstructions = CodableTriState(state: customInstructions)
5357
self.longText = longText
5458
self.basicText = basicText
59+
self.basicImage = basicImage
5560
}
5661

5762
required public init(from decoder: Decoder) throws {
@@ -62,6 +67,7 @@ public class AiStudioAgentExtract: Codable, RawJSONReadable {
6267
customInstructions = try container.decodeIfPresent(String.self, forKey: .customInstructions)
6368
longText = try container.decodeIfPresent(AiStudioAgentLongTextTool.self, forKey: .longText)
6469
basicText = try container.decodeIfPresent(AiStudioAgentBasicTextTool.self, forKey: .basicText)
70+
basicImage = try container.decodeIfPresent(AiStudioAgentBasicTextTool.self, forKey: .basicImage)
6571
}
6672

6773
public func encode(to encoder: Encoder) throws {
@@ -72,6 +78,7 @@ public class AiStudioAgentExtract: Codable, RawJSONReadable {
7278
try container.encode(field: _customInstructions.state, forKey: .customInstructions)
7379
try container.encodeIfPresent(longText, forKey: .longText)
7480
try container.encodeIfPresent(basicText, forKey: .basicText)
81+
try container.encodeIfPresent(basicImage, forKey: .basicImage)
7582
}
7683

7784
/// Sets the raw JSON data.

0 commit comments

Comments
 (0)