-
-
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.
Merge pull request #182 from tryAGI/bot/update-openapi_202502140125
feat:@coderabbitai
- Loading branch information
Showing
4 changed files
with
231 additions
and
35 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
155 changes: 155 additions & 0 deletions
155
src/libs/LangSmith/Generated/LangSmith.ExamplesClient.ValidateExamples.g.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,155 @@ | ||
|
||
#nullable enable | ||
|
||
namespace LangSmith | ||
{ | ||
public partial class ExamplesClient | ||
{ | ||
partial void PrepareValidateExamplesArguments( | ||
global::System.Net.Http.HttpClient httpClient); | ||
partial void PrepareValidateExamplesRequest( | ||
global::System.Net.Http.HttpClient httpClient, | ||
global::System.Net.Http.HttpRequestMessage httpRequestMessage); | ||
partial void ProcessValidateExamplesResponse( | ||
global::System.Net.Http.HttpClient httpClient, | ||
global::System.Net.Http.HttpResponseMessage httpResponseMessage); | ||
|
||
partial void ProcessValidateExamplesResponseContent( | ||
global::System.Net.Http.HttpClient httpClient, | ||
global::System.Net.Http.HttpResponseMessage httpResponseMessage, | ||
ref string content); | ||
|
||
/// <summary> | ||
/// Validate Examples<br/> | ||
/// Validate an example. | ||
/// </summary> | ||
/// <param name="cancellationToken">The token to cancel the operation with</param> | ||
/// <exception cref="global::LangSmith.ApiException"></exception> | ||
public async global::System.Threading.Tasks.Task<global::System.Collections.Generic.IList<global::LangSmith.ExampleValidationResult>> ValidateExamplesAsync( | ||
global::System.Threading.CancellationToken cancellationToken = default) | ||
{ | ||
PrepareArguments( | ||
client: HttpClient); | ||
PrepareValidateExamplesArguments( | ||
httpClient: HttpClient); | ||
|
||
var __pathBuilder = new PathBuilder( | ||
path: "/api/v1/examples/validate/bulk", | ||
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)); | ||
#if NET6_0_OR_GREATER | ||
__httpRequest.Version = global::System.Net.HttpVersion.Version11; | ||
__httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; | ||
#endif | ||
|
||
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); | ||
} | ||
} | ||
|
||
PrepareRequest( | ||
client: HttpClient, | ||
request: __httpRequest); | ||
PrepareValidateExamplesRequest( | ||
httpClient: HttpClient, | ||
httpRequestMessage: __httpRequest); | ||
|
||
using var __response = await HttpClient.SendAsync( | ||
request: __httpRequest, | ||
completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, | ||
cancellationToken: cancellationToken).ConfigureAwait(false); | ||
|
||
ProcessResponse( | ||
client: HttpClient, | ||
response: __response); | ||
ProcessValidateExamplesResponse( | ||
httpClient: HttpClient, | ||
httpResponseMessage: __response); | ||
|
||
if (ReadResponseAsString) | ||
{ | ||
var __content = await __response.Content.ReadAsStringAsync( | ||
#if NET5_0_OR_GREATER | ||
cancellationToken | ||
#endif | ||
).ConfigureAwait(false); | ||
|
||
ProcessResponseContent( | ||
client: HttpClient, | ||
response: __response, | ||
content: ref __content); | ||
ProcessValidateExamplesResponseContent( | ||
httpClient: HttpClient, | ||
httpResponseMessage: __response, | ||
content: ref __content); | ||
|
||
try | ||
{ | ||
__response.EnsureSuccessStatusCode(); | ||
} | ||
catch (global::System.Net.Http.HttpRequestException __ex) | ||
{ | ||
throw new global::LangSmith.ApiException( | ||
message: __content ?? __response.ReasonPhrase ?? string.Empty, | ||
innerException: __ex, | ||
statusCode: __response.StatusCode) | ||
{ | ||
ResponseBody = __content, | ||
ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( | ||
__response.Headers, | ||
h => h.Key, | ||
h => h.Value), | ||
}; | ||
} | ||
|
||
return | ||
global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList<global::LangSmith.ExampleValidationResult>), JsonSerializerContext) as global::System.Collections.Generic.IList<global::LangSmith.ExampleValidationResult> ?? | ||
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); | ||
} | ||
else | ||
{ | ||
try | ||
{ | ||
__response.EnsureSuccessStatusCode(); | ||
} | ||
catch (global::System.Net.Http.HttpRequestException __ex) | ||
{ | ||
throw new global::LangSmith.ApiException( | ||
message: __response.ReasonPhrase ?? string.Empty, | ||
innerException: __ex, | ||
statusCode: __response.StatusCode) | ||
{ | ||
ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( | ||
__response.Headers, | ||
h => h.Key, | ||
h => h.Value), | ||
}; | ||
} | ||
|
||
using var __content = await __response.Content.ReadAsStreamAsync( | ||
#if NET5_0_OR_GREATER | ||
cancellationToken | ||
#endif | ||
).ConfigureAwait(false); | ||
|
||
return | ||
await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList<global::LangSmith.ExampleValidationResult>), JsonSerializerContext).ConfigureAwait(false) as global::System.Collections.Generic.IList<global::LangSmith.ExampleValidationResult> ?? | ||
throw new global::System.InvalidOperationException("Response deserialization failed."); | ||
} | ||
} | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
src/libs/LangSmith/Generated/LangSmith.IExamplesClient.ValidateExamples.g.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,16 @@ | ||
#nullable enable | ||
|
||
namespace LangSmith | ||
{ | ||
public partial interface IExamplesClient | ||
{ | ||
/// <summary> | ||
/// Validate Examples<br/> | ||
/// Validate an example. | ||
/// </summary> | ||
/// <param name="cancellationToken">The token to cancel the operation with</param> | ||
/// <exception cref="global::LangSmith.ApiException"></exception> | ||
global::System.Threading.Tasks.Task<global::System.Collections.Generic.IList<global::LangSmith.ExampleValidationResult>> ValidateExamplesAsync( | ||
global::System.Threading.CancellationToken cancellationToken = default); | ||
} | ||
} |
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