Skip to content

Commit 14726d1

Browse files
feat: add AI spreadsheet processor (box/box-openapi#533) (#484)
1 parent e21415b commit 14726d1

File tree

4 files changed

+97
-2
lines changed

4 files changed

+97
-2
lines changed

.codegen.json

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

BoxSdkGen.xcodeproj/project.pbxproj

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1281,6 +1281,7 @@
12811281
28C69EB54EECCF8F967872D3 /* GetGroupCollaborationsHeaders.swift in Sources */ = {isa = PBXBuildFile; fileRef = BE3D76FE20335F679C5387E6 /* GetGroupCollaborationsHeaders.swift */; };
12821282
28E086985192A44FE2706181 /* KeywordSkillCardSkillField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 062C9C8EE4D53E245B5D976B /* KeywordSkillCardSkillField.swift */; };
12831283
28E26CD09F3958B863D28F2C /* IntegrationMappingBoxItemSlackTypeField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 82709A38151AF0B216C2B455 /* IntegrationMappingBoxItemSlackTypeField.swift */; };
1284+
28EA5C5163278E9375E7900C /* AiAgentSpreadsheetTool.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D35E050930AF741A7523EF8 /* AiAgentSpreadsheetTool.swift */; };
12841285
28F9D4466A48B6C3075380AF /* StreamSequence.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52BE60FD7506E74895E56B81 /* StreamSequence.swift */; };
12851286
28FCCBB048CA4B8AEB67F4FE /* ClientErrorV2025R0CodeField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 650C382B671F24A3BD163E71 /* ClientErrorV2025R0CodeField.swift */; };
12861287
290B3F3B9C8033C67ADA75E8 /* UploadsManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA73D96C5EF80BFF97DB0FA1 /* UploadsManager.swift */; };
@@ -5854,6 +5855,7 @@
58545855
B7A276B6BB9280481AF61D32 /* GetFolderWatermarkHeaders.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F97856AD69902D36E91F7D0 /* GetFolderWatermarkHeaders.swift */; };
58555856
B7ADA3DDC6546F98AFA965EF /* TermsOfServiceEnterpriseField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02D70CAA844D9B1804815153 /* TermsOfServiceEnterpriseField.swift */; };
58565857
B7B00429DE447DC806632FF1 /* ZipDownloadNameConflictsTypeField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53DDDA84B846395841CD4659 /* ZipDownloadNameConflictsTypeField.swift */; };
5858+
B7B3E465BE4FB6F06AD31EAF /* AiAgentSpreadsheetTool.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D35E050930AF741A7523EF8 /* AiAgentSpreadsheetTool.swift */; };
58575859
B7C075F7EE23B377E81A7E2F /* BaseUrls.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA7B9D4A224BC9F55EF6B331 /* BaseUrls.swift */; };
58585860
B7CA4DAFE021DE1C4C3DE9D3 /* StatusSkillCardStatusField.swift in Sources */ = {isa = PBXBuildFile; fileRef = F74C31C0B47BB85517C1074D /* StatusSkillCardStatusField.swift */; };
58595861
B7D17B02601A3BAD8C3492A1 /* CreateClassificationTemplateRequestBodyFieldsTypeField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B5B76CF772C47DA06FF2DCB /* CreateClassificationTemplateRequestBodyFieldsTypeField.swift */; };
@@ -6365,6 +6367,7 @@
63656367
C8DEE5C2BA82046FBDDF04D9 /* SearchForContentQueryParams.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAFB3DE7DAECB8D4DA5D8327 /* SearchForContentQueryParams.swift */; };
63666368
C8E18343F45B714332A61B73 /* DocGenTagsV2025R0.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63EE947CBE48DB0D08CF6DB5 /* DocGenTagsV2025R0.swift */; };
63676369
C8EA3C6F3F4ABE78A07685C7 /* TerminateUsersSessionsRequestBody.swift in Sources */ = {isa = PBXBuildFile; fileRef = B2457B189FAE42ED9399247C /* TerminateUsersSessionsRequestBody.swift */; };
6370+
C8F3B01D6A0A57EF3FEA6F3B /* AiAgentSpreadsheetTool.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D35E050930AF741A7523EF8 /* AiAgentSpreadsheetTool.swift */; };
63686371
C8F4325C3C5F3DAF56D6E558 /* TrashWebLinkRestoredItemStatusField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 201C440328BCD6411ACAFAEB /* TrashWebLinkRestoredItemStatusField.swift */; };
63696372
C9035FFA72B83477F1E90E45 /* FileVersionBaseTypeField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8E89ED74EFBCA80C6D8DA9C3 /* FileVersionBaseTypeField.swift */; };
63706373
C91093A3400E72BAAB2ED54E /* RetentionPolicyAssignments.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0C9BF4AEEF47CDEC68970C78 /* RetentionPolicyAssignments.swift */; };
@@ -7027,6 +7030,7 @@
70277030
DD8BE214357840A56654F755 /* AiTextGenItemsField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 622D1B0F8EFF56FA23F47695 /* AiTextGenItemsField.swift */; };
70287031
DDA414600F0EAEEB89359C07 /* GetFileUploadSessionByUrlHeaders.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6633BEFA0F6D6683253445DB /* GetFileUploadSessionByUrlHeaders.swift */; };
70297032
DDB0B64DA9B6F34B62220529 /* GetTrashedWebLinkByIdHeaders.swift in Sources */ = {isa = PBXBuildFile; fileRef = 563D7728661CC60FC0563CDE /* GetTrashedWebLinkByIdHeaders.swift */; };
7033+
DDB58C01C8C34DED3E2AA789 /* AiAgentSpreadsheetTool.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D35E050930AF741A7523EF8 /* AiAgentSpreadsheetTool.swift */; };
70307034
DDB6A917EEB7965A81F5E9F5 /* WorkflowFlowsOutcomesField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0FE8F284A82383FAAAA52EBA /* WorkflowFlowsOutcomesField.swift */; };
70317035
DDC1769B1AEF0A382979B4C9 /* TaskAssignmentTypeField.swift in Sources */ = {isa = PBXBuildFile; fileRef = EBF1B249B4D874918440E531 /* TaskAssignmentTypeField.swift */; };
70327036
DDDBA0D1EE5EE3E9DC2AD034 /* GetUserByIdQueryParams.swift in Sources */ = {isa = PBXBuildFile; fileRef = A80EFC08DE4A387597840C18 /* GetUserByIdQueryParams.swift */; };
@@ -7593,6 +7597,7 @@
75937597
EF049E4137AA92CAC1E239E1 /* CreateFileMetadataByIdRequestBody.swift in Sources */ = {isa = PBXBuildFile; fileRef = A59F584392E20E63401A1A81 /* CreateFileMetadataByIdRequestBody.swift */; };
75947598
EF0C209D0DC565E67B9C27A5 /* FileOrFolderOrWebLink.swift in Sources */ = {isa = PBXBuildFile; fileRef = 626E5E70285B12886AD5A617 /* FileOrFolderOrWebLink.swift */; };
75957599
EF433D112A7B28FC951A20A8 /* WorkflowFlowsTypeField.swift in Sources */ = {isa = PBXBuildFile; fileRef = C23851994F06C7939A781A63 /* WorkflowFlowsTypeField.swift */; };
7600+
EF457E0078BA63642222F898 /* AiAgentSpreadsheetTool.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D35E050930AF741A7523EF8 /* AiAgentSpreadsheetTool.swift */; };
75967601
EF483B760FBB24772DA37D34 /* FileRequestCopyRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 05BFE80F589B0CF50E6FF0C0 /* FileRequestCopyRequest.swift */; };
75977602
EF484F3A738C4B36B660ABDF /* GetFolderByIdQueryParams.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46C39375BE5EA904BE5D302D /* GetFolderByIdQueryParams.swift */; };
75987603
EF49443F346545455F305EDC /* AddClassificationToFileHeaders.swift in Sources */ = {isa = PBXBuildFile; fileRef = B6D81F3124D703E064B46652 /* AddClassificationToFileHeaders.swift */; };
@@ -9055,6 +9060,7 @@
90559060
8D1B7AC998D51230919E5136 /* FileVersionRetentionTypeField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileVersionRetentionTypeField.swift; sourceTree = "<group>"; };
90569061
8D28082F753E3ADEC9594ACC /* UpdateLegalHoldPolicyByIdRequestBody.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UpdateLegalHoldPolicyByIdRequestBody.swift; sourceTree = "<group>"; };
90579062
8D2F5DE14F7155913CBAC542 /* FileVersionBaseV2025R0TypeField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileVersionBaseV2025R0TypeField.swift; sourceTree = "<group>"; };
9063+
8D35E050930AF741A7523EF8 /* AiAgentSpreadsheetTool.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AiAgentSpreadsheetTool.swift; sourceTree = "<group>"; };
90589064
8D6699FA07552CB803CFE3BD /* ClassificationTemplate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ClassificationTemplate.swift; sourceTree = "<group>"; };
90599065
8DB42B9DA23E1FA488E36F94 /* FileRequestsManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileRequestsManager.swift; sourceTree = "<group>"; };
90609066
8DB5B3AA019129C1F58853EA /* CreateAiAgentTypeField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CreateAiAgentTypeField.swift; sourceTree = "<group>"; };
@@ -12831,6 +12837,14 @@
1283112837
path = AiAgentAsk;
1283212838
sourceTree = "<group>";
1283312839
};
12840+
AD5204D8DA76EF4D4627263E /* AiAgentSpreadsheetTool */ = {
12841+
isa = PBXGroup;
12842+
children = (
12843+
8D35E050930AF741A7523EF8 /* AiAgentSpreadsheetTool.swift */,
12844+
);
12845+
path = AiAgentSpreadsheetTool;
12846+
sourceTree = "<group>";
12847+
};
1283412848
ADC4DD0A9E10F7F59C0FAB69 /* FileFullOrFolderFull */ = {
1283512849
isa = PBXGroup;
1283612850
children = (
@@ -14462,6 +14476,7 @@
1446214476
841336FAACFC4804D3E1976F /* AiAgentLongTextToolTextGen */,
1446314477
BED3837C39545CA8FA0C2D48 /* AiAgentReference */,
1446414478
F75D4201EA7511F66667D1F5 /* AiAgentReferenceOrAiAgentTextGen */,
14479+
AD5204D8DA76EF4D4627263E /* AiAgentSpreadsheetTool */,
1446514480
0DE45EDCFE803D2D7A7A59C6 /* AiAgentTextGen */,
1446614481
8A688BFDFDE47AD6DFA57DD8 /* AiAsk */,
1446714482
138AACA3460F7F04357F353D /* AiCitation */,
@@ -15008,6 +15023,7 @@
1500815023
40D69F4F9C335A62C118A59D /* AiAgentReference.swift in Sources */,
1500915024
B5A32C4BAE6FEDB9FB80ACB9 /* AiAgentReferenceOrAiAgentTextGen.swift in Sources */,
1501015025
9578EA588B7C36C7318F3746 /* AiAgentReferenceTypeField.swift in Sources */,
15026+
EF457E0078BA63642222F898 /* AiAgentSpreadsheetTool.swift in Sources */,
1501115027
A034F95BDA3171889A2AB4AE /* AiAgentTextGen.swift in Sources */,
1501215028
2563E7A8E83C3B39D8800575 /* AiAgentTextGenTypeField.swift in Sources */,
1501315029
66B37D78D1F0B98B8BEA0509 /* AiAsk.swift in Sources */,
@@ -16638,6 +16654,7 @@
1663816654
7A7B2340147656A4B453D55A /* AiAgentReference.swift in Sources */,
1663916655
4EBF2AB39B8984DCFDC1760D /* AiAgentReferenceOrAiAgentTextGen.swift in Sources */,
1664016656
7793B6475F2040826ABDA067 /* AiAgentReferenceTypeField.swift in Sources */,
16657+
DDB58C01C8C34DED3E2AA789 /* AiAgentSpreadsheetTool.swift in Sources */,
1664116658
0ED6D6E3E7C00A7F9E1A31ED /* AiAgentTextGen.swift in Sources */,
1664216659
0444B13EE68076881A2922C0 /* AiAgentTextGenTypeField.swift in Sources */,
1664316660
12C145919A401115F75E9DA6 /* AiAsk.swift in Sources */,
@@ -18268,6 +18285,7 @@
1826818285
FED3BB0692376FB0D20AAE1F /* AiAgentReference.swift in Sources */,
1826918286
DBB1F9044190C244D55F424F /* AiAgentReferenceOrAiAgentTextGen.swift in Sources */,
1827018287
2F117004E579EC5891E332F2 /* AiAgentReferenceTypeField.swift in Sources */,
18288+
28EA5C5163278E9375E7900C /* AiAgentSpreadsheetTool.swift in Sources */,
1827118289
2811D5818F0A20795F5B94A1 /* AiAgentTextGen.swift in Sources */,
1827218290
0149E92F7D93D235178B77EF /* AiAgentTextGenTypeField.swift in Sources */,
1827318291
3EE0B41C0855A25842A7BDBB /* AiAsk.swift in Sources */,
@@ -19898,6 +19916,7 @@
1989819916
9B03790141AE54153F871C92 /* AiAgentReference.swift in Sources */,
1989919917
DEEDA57192C726890EF0841B /* AiAgentReferenceOrAiAgentTextGen.swift in Sources */,
1990019918
7D72276C2B31A4BD81F05352 /* AiAgentReferenceTypeField.swift in Sources */,
19919+
C8F3B01D6A0A57EF3FEA6F3B /* AiAgentSpreadsheetTool.swift in Sources */,
1990119920
8E14DAAC8377735AB8540423 /* AiAgentTextGen.swift in Sources */,
1990219921
FBE9741246532AA135FC4E14 /* AiAgentTextGenTypeField.swift in Sources */,
1990319922
A1F9F918F85723078C069353 /* AiAsk.swift in Sources */,
@@ -21528,6 +21547,7 @@
2152821547
BA770807FC9834CF5BA2BE8F /* AiAgentReference.swift in Sources */,
2152921548
1A967F1C99B2ADDD8E1F9517 /* AiAgentReferenceOrAiAgentTextGen.swift in Sources */,
2153021549
1AE60F0B742A7289D7F0F7E0 /* AiAgentReferenceTypeField.swift in Sources */,
21550+
B7B3E465BE4FB6F06AD31EAF /* AiAgentSpreadsheetTool.swift in Sources */,
2153121551
1B0BC78BF7FA33EB97D0447E /* AiAgentTextGen.swift in Sources */,
2153221552
A04BB879506AD592858125B2 /* AiAgentTextGenTypeField.swift in Sources */,
2153321553
F3AF2E0EB51F1BBEFA752DFB /* AiAsk.swift in Sources */,

Sources/Schemas/AiAgentAsk/AiAgentAsk.swift

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ public class AiAgentAsk: Codable, RawJSONReadable {
66
case type
77
case longText = "long_text"
88
case basicText = "basic_text"
9+
case spreadsheet
910
case longTextMulti = "long_text_multi"
1011
case basicTextMulti = "basic_text_multi"
1112
case basicImage = "basic_image"
@@ -28,6 +29,8 @@ public class AiAgentAsk: Codable, RawJSONReadable {
2829

2930
public let basicText: AiAgentBasicTextTool?
3031

32+
public let spreadsheet: AiAgentSpreadsheetTool?
33+
3134
public let longTextMulti: AiAgentLongTextTool?
3235

3336
public let basicTextMulti: AiAgentBasicTextTool?
@@ -42,14 +45,16 @@ public class AiAgentAsk: Codable, RawJSONReadable {
4245
/// - type: The type of AI agent used to handle queries.
4346
/// - longText:
4447
/// - basicText:
48+
/// - spreadsheet:
4549
/// - longTextMulti:
4650
/// - basicTextMulti:
4751
/// - basicImage:
4852
/// - basicImageMulti:
49-
public init(type: AiAgentAskTypeField = AiAgentAskTypeField.aiAgentAsk, longText: AiAgentLongTextTool? = nil, basicText: AiAgentBasicTextTool? = nil, longTextMulti: AiAgentLongTextTool? = nil, basicTextMulti: AiAgentBasicTextTool? = nil, basicImage: AiAgentBasicTextTool? = nil, basicImageMulti: AiAgentBasicTextTool? = nil) {
53+
public init(type: AiAgentAskTypeField = AiAgentAskTypeField.aiAgentAsk, longText: AiAgentLongTextTool? = nil, basicText: AiAgentBasicTextTool? = nil, spreadsheet: AiAgentSpreadsheetTool? = nil, longTextMulti: AiAgentLongTextTool? = nil, basicTextMulti: AiAgentBasicTextTool? = nil, basicImage: AiAgentBasicTextTool? = nil, basicImageMulti: AiAgentBasicTextTool? = nil) {
5054
self.type = type
5155
self.longText = longText
5256
self.basicText = basicText
57+
self.spreadsheet = spreadsheet
5358
self.longTextMulti = longTextMulti
5459
self.basicTextMulti = basicTextMulti
5560
self.basicImage = basicImage
@@ -61,6 +66,7 @@ public class AiAgentAsk: Codable, RawJSONReadable {
6166
type = try container.decode(AiAgentAskTypeField.self, forKey: .type)
6267
longText = try container.decodeIfPresent(AiAgentLongTextTool.self, forKey: .longText)
6368
basicText = try container.decodeIfPresent(AiAgentBasicTextTool.self, forKey: .basicText)
69+
spreadsheet = try container.decodeIfPresent(AiAgentSpreadsheetTool.self, forKey: .spreadsheet)
6470
longTextMulti = try container.decodeIfPresent(AiAgentLongTextTool.self, forKey: .longTextMulti)
6571
basicTextMulti = try container.decodeIfPresent(AiAgentBasicTextTool.self, forKey: .basicTextMulti)
6672
basicImage = try container.decodeIfPresent(AiAgentBasicTextTool.self, forKey: .basicImage)
@@ -72,6 +78,7 @@ public class AiAgentAsk: Codable, RawJSONReadable {
7278
try container.encode(type, forKey: .type)
7379
try container.encodeIfPresent(longText, forKey: .longText)
7480
try container.encodeIfPresent(basicText, forKey: .basicText)
81+
try container.encodeIfPresent(spreadsheet, forKey: .spreadsheet)
7582
try container.encodeIfPresent(longTextMulti, forKey: .longTextMulti)
7683
try container.encodeIfPresent(basicTextMulti, forKey: .basicTextMulti)
7784
try container.encodeIfPresent(basicImage, forKey: .basicImage)
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
import Foundation
2+
3+
/// AI agent processor used to handle spreadsheets and tabular data.
4+
public class AiAgentSpreadsheetTool: Codable, RawJSONReadable {
5+
private enum CodingKeys: String, CodingKey {
6+
case model
7+
case numTokensForCompletion = "num_tokens_for_completion"
8+
case llmEndpointParams = "llm_endpoint_params"
9+
}
10+
11+
/// Internal backing store for rawData. Used to store raw dictionary data associated with the instance.
12+
private var _rawData: [String: Any]?
13+
14+
/// Returns the raw dictionary data associated with the instance. This is a read-only property.
15+
public var rawData: [String: Any]? {
16+
return _rawData
17+
}
18+
19+
20+
/// The model used for the AI agent for spreadsheets. For specific model values, see the [available models list](g://box-ai/supported-models).
21+
public let model: String?
22+
23+
/// The number of tokens for completion.
24+
public let numTokensForCompletion: Int64?
25+
26+
public let llmEndpointParams: AiLlmEndpointParams?
27+
28+
/// Initializer for a AiAgentSpreadsheetTool.
29+
///
30+
/// - Parameters:
31+
/// - model: The model used for the AI agent for spreadsheets. For specific model values, see the [available models list](g://box-ai/supported-models).
32+
/// - numTokensForCompletion: The number of tokens for completion.
33+
/// - llmEndpointParams:
34+
public init(model: String? = nil, numTokensForCompletion: Int64? = nil, llmEndpointParams: AiLlmEndpointParams? = nil) {
35+
self.model = model
36+
self.numTokensForCompletion = numTokensForCompletion
37+
self.llmEndpointParams = llmEndpointParams
38+
}
39+
40+
required public init(from decoder: Decoder) throws {
41+
let container = try decoder.container(keyedBy: CodingKeys.self)
42+
model = try container.decodeIfPresent(String.self, forKey: .model)
43+
numTokensForCompletion = try container.decodeIfPresent(Int64.self, forKey: .numTokensForCompletion)
44+
llmEndpointParams = try container.decodeIfPresent(AiLlmEndpointParams.self, forKey: .llmEndpointParams)
45+
}
46+
47+
public func encode(to encoder: Encoder) throws {
48+
var container = encoder.container(keyedBy: CodingKeys.self)
49+
try container.encodeIfPresent(model, forKey: .model)
50+
try container.encodeIfPresent(numTokensForCompletion, forKey: .numTokensForCompletion)
51+
try container.encodeIfPresent(llmEndpointParams, forKey: .llmEndpointParams)
52+
}
53+
54+
/// Sets the raw JSON data.
55+
///
56+
/// - Parameters:
57+
/// - rawData: A dictionary containing the raw JSON data
58+
func setRawData(rawData: [String: Any]?) {
59+
self._rawData = rawData
60+
}
61+
62+
/// Gets the raw JSON data
63+
/// - Returns: The `[String: Any]?`.
64+
func getRawData() -> [String: Any]? {
65+
return self._rawData
66+
}
67+
68+
}

0 commit comments

Comments
 (0)