From 450a46d5e76df86d1f23a246094cf098dfafb689 Mon Sep 17 00:00:00 2001 From: box-sdk-build <94016436+box-sdk-build@users.noreply.github.com> Date: Mon, 6 May 2024 16:24:44 +0200 Subject: [PATCH] fix: Fix Box AI endpoints (box/box-openapi#418) (#92) --- .codegen.json | 2 +- Box.Sdk.Gen/Managers/Ai/AiManager.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.codegen.json b/.codegen.json index 01055c76..f16804a8 100644 --- a/.codegen.json +++ b/.codegen.json @@ -1 +1 @@ -{ "engineHash": "afd7974", "specHash": "63d1af0", "version": "0.3.0" } +{ "engineHash": "afd7974", "specHash": "a8c36df", "version": "0.3.0" } diff --git a/Box.Sdk.Gen/Managers/Ai/AiManager.cs b/Box.Sdk.Gen/Managers/Ai/AiManager.cs index 25fd2cc2..f63d8531 100644 --- a/Box.Sdk.Gen/Managers/Ai/AiManager.cs +++ b/Box.Sdk.Gen/Managers/Ai/AiManager.cs @@ -31,7 +31,7 @@ public AiManager(NetworkSession networkSession = default) { public async System.Threading.Tasks.Task CreateAiAskAsync(AiAsk requestBody, CreateAiAskHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new CreateAiAskHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/v2/ai/ask"), new FetchOptions(method: "POST", headers: headersMap, data: SimpleJsonSerializer.Serialize(requestBody), contentType: "application/json", responseFormat: "json", auth: this.Auth, networkSession: this.NetworkSession, cancellationToken: cancellationToken)).ConfigureAwait(false); + FetchResponse response = await HttpClientAdapter.FetchAsync(string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/ai/ask"), new FetchOptions(method: "POST", headers: headersMap, data: SimpleJsonSerializer.Serialize(requestBody), contentType: "application/json", responseFormat: "json", auth: this.Auth, networkSession: this.NetworkSession, cancellationToken: cancellationToken)).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(response.Data); } @@ -50,7 +50,7 @@ public async System.Threading.Tasks.Task CreateAiAskAsync(AiAsk requ public async System.Threading.Tasks.Task CreateAiTextGenAsync(AiTextGen requestBody, CreateAiTextGenHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new CreateAiTextGenHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/v2/ai/text_gen"), new FetchOptions(method: "POST", headers: headersMap, data: SimpleJsonSerializer.Serialize(requestBody), contentType: "application/json", responseFormat: "json", auth: this.Auth, networkSession: this.NetworkSession, cancellationToken: cancellationToken)).ConfigureAwait(false); + FetchResponse response = await HttpClientAdapter.FetchAsync(string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/ai/text_gen"), new FetchOptions(method: "POST", headers: headersMap, data: SimpleJsonSerializer.Serialize(requestBody), contentType: "application/json", responseFormat: "json", auth: this.Auth, networkSession: this.NetworkSession, cancellationToken: cancellationToken)).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(response.Data); }