@@ -28,8 +28,8 @@ public AiManager(NetworkSession? networkSession = default) {
28
28
public async System . Threading . Tasks . Task < AiResponseFull > CreateAiAskAsync ( AiAsk requestBody , CreateAiAskHeaders ? headers = default , System . Threading . CancellationToken ? cancellationToken = null ) {
29
29
headers = headers ?? new CreateAiAskHeaders ( ) ;
30
30
Dictionary < string , string > headersMap = Utils . PrepareParams ( map : DictionaryUtils . MergeDictionaries ( new Dictionary < string , string ? > ( ) { } , headers . ExtraHeaders ) ) ;
31
- FetchResponse response = await HttpClientAdapter . FetchAsync ( new FetchOptions ( url : string . Concat ( this . NetworkSession . BaseUrls . BaseUrl , "/2.0/ai/ask" ) , networkSession : this . NetworkSession ) { Method = "POST ", Headers = headersMap , Data = SimpleJsonSerializer . Serialize ( requestBody ) , ContentType = "application/json" , ResponseFormat = "json" , Auth = this . Auth , CancellationToken = cancellationToken } ) . ConfigureAwait ( false ) ;
32
- return SimpleJsonSerializer . Deserialize < AiResponseFull > ( response . Data ) ;
31
+ FetchResponse response = await HttpClientAdapter . FetchAsync ( new FetchOptions ( url : string . Concat ( this . NetworkSession . BaseUrls . BaseUrl , "/2.0/ai/ask" ) , method : "POST" , contentType : "application/json ", responseFormat : Box . Sdk . Gen . ResponseFormat . Json ) { Headers = headersMap , Data = SimpleJsonSerializer . Serialize ( requestBody ) , Auth = this . Auth , NetworkSession = this . NetworkSession , CancellationToken = cancellationToken } ) . ConfigureAwait ( false ) ;
32
+ return SimpleJsonSerializer . Deserialize < AiResponseFull > ( NullableUtils . Unwrap ( response . Data ) ) ;
33
33
}
34
34
35
35
/// <summary>
@@ -47,8 +47,8 @@ public async System.Threading.Tasks.Task<AiResponseFull> CreateAiAskAsync(AiAsk
47
47
public async System . Threading . Tasks . Task < AiResponse > CreateAiTextGenAsync ( AiTextGen requestBody , CreateAiTextGenHeaders ? headers = default , System . Threading . CancellationToken ? cancellationToken = null ) {
48
48
headers = headers ?? new CreateAiTextGenHeaders ( ) ;
49
49
Dictionary < string , string > headersMap = Utils . PrepareParams ( map : DictionaryUtils . MergeDictionaries ( new Dictionary < string , string ? > ( ) { } , headers . ExtraHeaders ) ) ;
50
- FetchResponse response = await HttpClientAdapter . FetchAsync ( new FetchOptions ( url : string . Concat ( this . NetworkSession . BaseUrls . BaseUrl , "/2.0/ai/text_gen" ) , networkSession : this . NetworkSession ) { Method = "POST ", Headers = headersMap , Data = SimpleJsonSerializer . Serialize ( requestBody ) , ContentType = "application/json" , ResponseFormat = "json" , Auth = this . Auth , CancellationToken = cancellationToken } ) . ConfigureAwait ( false ) ;
51
- return SimpleJsonSerializer . Deserialize < AiResponse > ( response . Data ) ;
50
+ FetchResponse response = await HttpClientAdapter . FetchAsync ( new FetchOptions ( url : string . Concat ( this . NetworkSession . BaseUrls . BaseUrl , "/2.0/ai/text_gen" ) , method : "POST" , contentType : "application/json ", responseFormat : Box . Sdk . Gen . ResponseFormat . Json ) { Headers = headersMap , Data = SimpleJsonSerializer . Serialize ( requestBody ) , Auth = this . Auth , NetworkSession = this . NetworkSession , CancellationToken = cancellationToken } ) . ConfigureAwait ( false ) ;
51
+ return SimpleJsonSerializer . Deserialize < AiResponse > ( NullableUtils . Unwrap ( response . Data ) ) ;
52
52
}
53
53
54
54
/// <summary>
@@ -67,8 +67,8 @@ public async System.Threading.Tasks.Task<AiAgentAskOrAiAgentExtractOrAiAgentExtr
67
67
headers = headers ?? new GetAiAgentDefaultConfigHeaders ( ) ;
68
68
Dictionary < string , string > queryParamsMap = Utils . PrepareParams ( map : new Dictionary < string , string ? > ( ) { { "mode" , StringUtils . ToStringRepresentation ( queryParams . Mode ? . Value ) } , { "language" , StringUtils . ToStringRepresentation ( queryParams . Language ) } , { "model" , StringUtils . ToStringRepresentation ( queryParams . Model ) } } ) ;
69
69
Dictionary < string , string > headersMap = Utils . PrepareParams ( map : DictionaryUtils . MergeDictionaries ( new Dictionary < string , string ? > ( ) { } , headers . ExtraHeaders ) ) ;
70
- FetchResponse response = await HttpClientAdapter . FetchAsync ( new FetchOptions ( url : string . Concat ( this . NetworkSession . BaseUrls . BaseUrl , "/2.0/ai_agent_default" ) , networkSession : this . NetworkSession ) { Method = "GET" , Parameters = queryParamsMap , Headers = headersMap , ResponseFormat = "json" , Auth = this . Auth , CancellationToken = cancellationToken } ) . ConfigureAwait ( false ) ;
71
- return SimpleJsonSerializer . DeserializeWithoutRawJson < AiAgentAskOrAiAgentExtractOrAiAgentExtractStructuredOrAiAgentTextGen > ( response . Data ) ;
70
+ FetchResponse response = await HttpClientAdapter . FetchAsync ( new FetchOptions ( url : string . Concat ( this . NetworkSession . BaseUrls . BaseUrl , "/2.0/ai_agent_default" ) , method : "GET" , responseFormat : Box . Sdk . Gen . ResponseFormat . Json ) { Parameters = queryParamsMap , Headers = headersMap , Auth = this . Auth , NetworkSession = this . NetworkSession , CancellationToken = cancellationToken } ) . ConfigureAwait ( false ) ;
71
+ return SimpleJsonSerializer . DeserializeWithoutRawJson < AiAgentAskOrAiAgentExtractOrAiAgentExtractStructuredOrAiAgentTextGen > ( NullableUtils . Unwrap ( response . Data ) ) ;
72
72
}
73
73
74
74
/// <summary>
@@ -87,8 +87,8 @@ public async System.Threading.Tasks.Task<AiAgentAskOrAiAgentExtractOrAiAgentExtr
87
87
public async System . Threading . Tasks . Task < AiResponse > CreateAiExtractAsync ( AiExtract requestBody , CreateAiExtractHeaders ? headers = default , System . Threading . CancellationToken ? cancellationToken = null ) {
88
88
headers = headers ?? new CreateAiExtractHeaders ( ) ;
89
89
Dictionary < string , string > headersMap = Utils . PrepareParams ( map : DictionaryUtils . MergeDictionaries ( new Dictionary < string , string ? > ( ) { } , headers . ExtraHeaders ) ) ;
90
- FetchResponse response = await HttpClientAdapter . FetchAsync ( new FetchOptions ( url : string . Concat ( this . NetworkSession . BaseUrls . BaseUrl , "/2.0/ai/extract" ) , networkSession : this . NetworkSession ) { Method = "POST ", Headers = headersMap , Data = SimpleJsonSerializer . Serialize ( requestBody ) , ContentType = "application/json" , ResponseFormat = "json" , Auth = this . Auth , CancellationToken = cancellationToken } ) . ConfigureAwait ( false ) ;
91
- return SimpleJsonSerializer . Deserialize < AiResponse > ( response . Data ) ;
90
+ FetchResponse response = await HttpClientAdapter . FetchAsync ( new FetchOptions ( url : string . Concat ( this . NetworkSession . BaseUrls . BaseUrl , "/2.0/ai/extract" ) , method : "POST" , contentType : "application/json ", responseFormat : Box . Sdk . Gen . ResponseFormat . Json ) { Headers = headersMap , Data = SimpleJsonSerializer . Serialize ( requestBody ) , Auth = this . Auth , NetworkSession = this . NetworkSession , CancellationToken = cancellationToken } ) . ConfigureAwait ( false ) ;
91
+ return SimpleJsonSerializer . Deserialize < AiResponse > ( NullableUtils . Unwrap ( response . Data ) ) ;
92
92
}
93
93
94
94
/// <summary>
@@ -109,8 +109,8 @@ public async System.Threading.Tasks.Task<AiResponse> CreateAiExtractAsync(AiExtr
109
109
public async System . Threading . Tasks . Task < AiExtractResponse > CreateAiExtractStructuredAsync ( AiExtractStructured requestBody , CreateAiExtractStructuredHeaders ? headers = default , System . Threading . CancellationToken ? cancellationToken = null ) {
110
110
headers = headers ?? new CreateAiExtractStructuredHeaders ( ) ;
111
111
Dictionary < string , string > headersMap = Utils . PrepareParams ( map : DictionaryUtils . MergeDictionaries ( new Dictionary < string , string ? > ( ) { } , headers . ExtraHeaders ) ) ;
112
- FetchResponse response = await HttpClientAdapter . FetchAsync ( new FetchOptions ( url : string . Concat ( this . NetworkSession . BaseUrls . BaseUrl , "/2.0/ai/extract_structured" ) , networkSession : this . NetworkSession ) { Method = "POST ", Headers = headersMap , Data = SimpleJsonSerializer . Serialize ( requestBody ) , ContentType = "application/json" , ResponseFormat = "json" , Auth = this . Auth , CancellationToken = cancellationToken } ) . ConfigureAwait ( false ) ;
113
- return SimpleJsonSerializer . Deserialize < AiExtractResponse > ( response . Data ) ;
112
+ FetchResponse response = await HttpClientAdapter . FetchAsync ( new FetchOptions ( url : string . Concat ( this . NetworkSession . BaseUrls . BaseUrl , "/2.0/ai/extract_structured" ) , method : "POST" , contentType : "application/json ", responseFormat : Box . Sdk . Gen . ResponseFormat . Json ) { Headers = headersMap , Data = SimpleJsonSerializer . Serialize ( requestBody ) , Auth = this . Auth , NetworkSession = this . NetworkSession , CancellationToken = cancellationToken } ) . ConfigureAwait ( false ) ;
113
+ return SimpleJsonSerializer . Deserialize < AiExtractResponse > ( NullableUtils . Unwrap ( response . Data ) ) ;
114
114
}
115
115
116
116
}
0 commit comments