Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .codegen.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "engineHash": "a17cbb6", "specHash": "e7ce024", "version": "10.1.0" }
{ "engineHash": "35c5d34", "specHash": "e7ce024", "version": "10.1.0" }
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ public async System.Threading.Tasks.Task TestUseAiAgentReferenceInAiAsk() {
string agentName = Utils.GetUUID();
AiSingleAgentResponseFull createdAgent = await client.AiStudio.CreateAiAgentAsync(requestBody: new CreateAiAgent(name: agentName, accessState: "enabled") { Ask = new AiStudioAgentAsk(accessState: "enabled", description: "desc1") });
FileFull fileToAsk = await new CommonsManager().UploadNewFileAsync();
AiResponseFull response = await client.Ai.CreateAiAskAsync(requestBody: new AiAsk(mode: AiAskModeField.SingleItemQa, prompt: "which direction sun rises", items: Array.AsReadOnly(new [] {new AiItemAsk(id: fileToAsk.Id, type: AiItemAskTypeField.File) { Content = "Sun rises in the East" }})) { AiAgent = new AiAgentReference() { Id = createdAgent.Id } });
Assert.IsTrue(NullableUtils.Unwrap(response).Answer.Contains("East"));
AiResponseFull response = await client.Ai.CreateAiAskAsync(requestBody: new AiAsk(mode: AiAskModeField.SingleItemQa, prompt: "Which direction does the Sun rise?", items: Array.AsReadOnly(new [] {new AiItemAsk(id: fileToAsk.Id, type: AiItemAskTypeField.File) { Content = "The Sun rises in the east." }})) { AiAgent = new AiAgentReference() { Id = createdAgent.Id } });
Assert.IsTrue(NullableUtils.Unwrap(response).Answer.Contains("east"));
Assert.IsTrue(NullableUtils.Unwrap(response).CompletionReason == "done");
Assert.IsTrue(NullableUtils.Unwrap(NullableUtils.Unwrap(NullableUtils.Unwrap(response).AiAgentInfo).Models).Count > 0);
await client.Files.DeleteFileByIdAsync(fileId: fileToAsk.Id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
string agentName = Utils.GetUUID();
AiSingleAgentResponseFull createdAgent = await client.AiStudio.CreateAiAgentAsync(requestBody: new CreateAiAgent(name: agentName, accessState: "enabled") { Ask = new AiStudioAgentAsk(accessState: "enabled", description: "desc1") });
FileFull fileToAsk = await new CommonsManager().UploadNewFileAsync();
AiResponseFull? response = await client.Ai.CreateAiAskAsync(requestBody: new AiAsk(mode: AiAskModeField.SingleItemQa, prompt: "which direction sun rises", items: Array.AsReadOnly(new [] {new AiItemAsk(id: fileToAsk.Id, type: AiItemAskTypeField.File) { Content = "Sun rises in the East" }})) { AiAgent = new AiAgentReference() { Id = createdAgent.Id } });
Assert.IsTrue(NullableUtils.Unwrap(response).Answer.Contains("East"));
AiResponseFull? response = await client.Ai.CreateAiAskAsync(requestBody: new AiAsk(mode: AiAskModeField.SingleItemQa, prompt: "Which direction does the Sun rise?", items: Array.AsReadOnly(new [] {new AiItemAsk(id: fileToAsk.Id, type: AiItemAskTypeField.File) { Content = "The Sun rises in the east." }})) { AiAgent = new AiAgentReference() { Id = createdAgent.Id } });

Check warning on line 45 in Box.Sdk.Gen.Tests.Integration.Net/Test/AiStudio/AiStudioManagerTests.cs

View workflow job for this annotation

GitHub Actions / Box.V2.Core (.NET 8)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
Assert.IsTrue(NullableUtils.Unwrap(response).Answer.Contains("east"));
Assert.IsTrue(NullableUtils.Unwrap(response).CompletionReason == "done");
Assert.IsTrue(NullableUtils.Unwrap(NullableUtils.Unwrap(NullableUtils.Unwrap(response).AiAgentInfo).Models).Count > 0);
await client.Files.DeleteFileByIdAsync(fileId: fileToAsk.Id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ public async System.Threading.Tasks.Task TestUseAiAgentReferenceInAiAsk() {
string agentName = Utils.GetUUID();
AiSingleAgentResponseFull createdAgent = await client.AiStudio.CreateAiAgentAsync(requestBody: new CreateAiAgent(name: agentName, accessState: "enabled") { Ask = new AiStudioAgentAsk(accessState: "enabled", description: "desc1") });
FileFull fileToAsk = await new CommonsManager().UploadNewFileAsync();
AiResponseFull response = await client.Ai.CreateAiAskAsync(requestBody: new AiAsk(mode: AiAskModeField.SingleItemQa, prompt: "which direction sun rises", items: Array.AsReadOnly(new [] {new AiItemAsk(id: fileToAsk.Id, type: AiItemAskTypeField.File) { Content = "Sun rises in the East" }})) { AiAgent = new AiAgentReference() { Id = createdAgent.Id } });
Assert.IsTrue(NullableUtils.Unwrap(response).Answer.Contains("East"));
AiResponseFull response = await client.Ai.CreateAiAskAsync(requestBody: new AiAsk(mode: AiAskModeField.SingleItemQa, prompt: "Which direction does the Sun rise?", items: Array.AsReadOnly(new [] {new AiItemAsk(id: fileToAsk.Id, type: AiItemAskTypeField.File) { Content = "The Sun rises in the east." }})) { AiAgent = new AiAgentReference() { Id = createdAgent.Id } });
Assert.IsTrue(NullableUtils.Unwrap(response).Answer.Contains("east"));
Assert.IsTrue(NullableUtils.Unwrap(response).CompletionReason == "done");
Assert.IsTrue(NullableUtils.Unwrap(NullableUtils.Unwrap(NullableUtils.Unwrap(response).AiAgentInfo).Models).Count > 0);
await client.Files.DeleteFileByIdAsync(fileId: fileToAsk.Id);
Expand Down
Loading