-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Fixed some issues with langsmith json OpenAPI 3.1 spec.
- Loading branch information
Showing
603 changed files
with
19,756 additions
and
2,482 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
153 changes: 0 additions & 153 deletions
153
src/tests/AutoSDK.SnapshotTests/Snapshots/LangSmith/NewtonsoftJson/_#AllOf.1.g.verified.cs
This file was deleted.
Oops, something went wrong.
143 changes: 143 additions & 0 deletions
143
...oSDK.SnapshotTests/Snapshots/LangSmith/NewtonsoftJson/_#G.AceClient.Execute.g.verified.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,143 @@ | ||
//HintName: G.AceClient.Execute.g.cs | ||
|
||
#nullable enable | ||
|
||
namespace G | ||
{ | ||
public partial class AceClient | ||
{ | ||
partial void PrepareExecuteArguments( | ||
global::System.Net.Http.HttpClient httpClient, | ||
global::G.BodyExecuteApiV1AceExecutePost request); | ||
partial void PrepareExecuteRequest( | ||
global::System.Net.Http.HttpClient httpClient, | ||
global::System.Net.Http.HttpRequestMessage httpRequestMessage, | ||
global::G.BodyExecuteApiV1AceExecutePost request); | ||
partial void ProcessExecuteResponse( | ||
global::System.Net.Http.HttpClient httpClient, | ||
global::System.Net.Http.HttpResponseMessage httpResponseMessage); | ||
|
||
partial void ProcessExecuteResponseContent( | ||
global::System.Net.Http.HttpClient httpClient, | ||
global::System.Net.Http.HttpResponseMessage httpResponseMessage, | ||
ref string content); | ||
|
||
/// <summary> | ||
/// Execute<br/> | ||
/// Execute some custom code for testing purposes. | ||
/// </summary> | ||
/// <param name="request"></param> | ||
/// <param name="cancellationToken">The token to cancel the operation with</param> | ||
/// <exception cref="global::System.InvalidOperationException"></exception> | ||
public async global::System.Threading.Tasks.Task<object> ExecuteAsync( | ||
global::G.BodyExecuteApiV1AceExecutePost request, | ||
global::System.Threading.CancellationToken cancellationToken = default) | ||
{ | ||
request = request ?? throw new global::System.ArgumentNullException(nameof(request)); | ||
|
||
PrepareArguments( | ||
client: _httpClient); | ||
PrepareExecuteArguments( | ||
httpClient: _httpClient, | ||
request: request); | ||
|
||
var __pathBuilder = new PathBuilder( | ||
path: "/api/v1/ace/execute", | ||
baseUri: _httpClient.BaseAddress); | ||
var __path = __pathBuilder.ToString(); | ||
using var httpRequest = new global::System.Net.Http.HttpRequestMessage( | ||
method: global::System.Net.Http.HttpMethod.Post, | ||
requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); | ||
|
||
foreach (var _authorization in _authorizations) | ||
{ | ||
if (_authorization.Type == "Http" || | ||
_authorization.Type == "OAuth2") | ||
{ | ||
httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( | ||
scheme: _authorization.Name, | ||
parameter: _authorization.Value); | ||
} | ||
else if (_authorization.Type == "ApiKey" && | ||
_authorization.Location == "Header") | ||
{ | ||
httpRequest.Headers.Add(_authorization.Name, _authorization.Value); | ||
} | ||
} | ||
var __httpRequestContentBody = global::Newtonsoft.Json.JsonConvert.SerializeObject(request, JsonSerializerOptions); | ||
var __httpRequestContent = new global::System.Net.Http.StringContent( | ||
content: __httpRequestContentBody, | ||
encoding: global::System.Text.Encoding.UTF8, | ||
mediaType: "application/json"); | ||
httpRequest.Content = __httpRequestContent; | ||
|
||
PrepareRequest( | ||
client: _httpClient, | ||
request: httpRequest); | ||
PrepareExecuteRequest( | ||
httpClient: _httpClient, | ||
httpRequestMessage: httpRequest, | ||
request: request); | ||
|
||
using var response = await _httpClient.SendAsync( | ||
request: httpRequest, | ||
completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, | ||
cancellationToken: cancellationToken).ConfigureAwait(false); | ||
|
||
ProcessResponse( | ||
client: _httpClient, | ||
response: response); | ||
ProcessExecuteResponse( | ||
httpClient: _httpClient, | ||
httpResponseMessage: response); | ||
|
||
var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); | ||
|
||
ProcessResponseContent( | ||
client: _httpClient, | ||
response: response, | ||
content: ref __content); | ||
ProcessExecuteResponseContent( | ||
httpClient: _httpClient, | ||
httpResponseMessage: response, | ||
content: ref __content); | ||
|
||
try | ||
{ | ||
response.EnsureSuccessStatusCode(); | ||
} | ||
catch (global::System.Net.Http.HttpRequestException ex) | ||
{ | ||
throw new global::System.InvalidOperationException(__content, ex); | ||
} | ||
|
||
return | ||
global::Newtonsoft.Json.JsonConvert.DeserializeObject<object?>(__content, JsonSerializerOptions) ?? | ||
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); | ||
} | ||
|
||
/// <summary> | ||
/// Execute<br/> | ||
/// Execute some custom code for testing purposes. | ||
/// </summary> | ||
/// <param name="args"></param> | ||
/// <param name="code"></param> | ||
/// <param name="cancellationToken">The token to cancel the operation with</param> | ||
/// <exception cref="global::System.InvalidOperationException"></exception> | ||
public async global::System.Threading.Tasks.Task<object> ExecuteAsync( | ||
global::System.Collections.Generic.IList<global::G.BodyExecuteApiV1AceExecutePostArg> args, | ||
string code, | ||
global::System.Threading.CancellationToken cancellationToken = default) | ||
{ | ||
var request = new global::G.BodyExecuteApiV1AceExecutePost | ||
{ | ||
Args = args, | ||
Code = code, | ||
}; | ||
|
||
return await ExecuteAsync( | ||
request: request, | ||
cancellationToken: cancellationToken).ConfigureAwait(false); | ||
} | ||
} | ||
} |
Oops, something went wrong.