Skip to content

Commit

Permalink
fix: Fix Box AI endpoints (box/box-openapi#418) (#92)
Browse files Browse the repository at this point in the history
  • Loading branch information
box-sdk-build authored May 6, 2024
1 parent 7664392 commit 450a46d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .codegen.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "engineHash": "afd7974", "specHash": "63d1af0", "version": "0.3.0" }
{ "engineHash": "afd7974", "specHash": "a8c36df", "version": "0.3.0" }
4 changes: 2 additions & 2 deletions Box.Sdk.Gen/Managers/Ai/AiManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public AiManager(NetworkSession networkSession = default) {
public async System.Threading.Tasks.Task<AiResponse> CreateAiAskAsync(AiAsk requestBody, CreateAiAskHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) {
headers = headers ?? new CreateAiAskHeaders();
Dictionary<string, string> headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary<string, string?>() { }, 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<AiResponse>(response.Data);
}

Expand All @@ -50,7 +50,7 @@ public async System.Threading.Tasks.Task<AiResponse> CreateAiAskAsync(AiAsk requ
public async System.Threading.Tasks.Task<AiResponse> CreateAiTextGenAsync(AiTextGen requestBody, CreateAiTextGenHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) {
headers = headers ?? new CreateAiTextGenHeaders();
Dictionary<string, string> headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary<string, string?>() { }, 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<AiResponse>(response.Data);
}

Expand Down

0 comments on commit 450a46d

Please sign in to comment.