-
-
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 #168 from tryAGI/bot/update-openapi_202501090337
feat:@coderabbitai
- Loading branch information
Showing
4 changed files
with
295 additions
and
18 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
200 changes: 200 additions & 0 deletions
200
...libs/LangSmith/Generated/LangSmith.AnnotationQueuesClient.GetRunsFromAnnotationQueue.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,200 @@ | ||
|
||
#nullable enable | ||
|
||
namespace LangSmith | ||
{ | ||
public partial class AnnotationQueuesClient | ||
{ | ||
partial void PrepareGetRunsFromAnnotationQueueArguments( | ||
global::System.Net.Http.HttpClient httpClient, | ||
ref global::System.Guid queueId, | ||
ref int? offset, | ||
ref int? limit); | ||
partial void PrepareGetRunsFromAnnotationQueueRequest( | ||
global::System.Net.Http.HttpClient httpClient, | ||
global::System.Net.Http.HttpRequestMessage httpRequestMessage, | ||
global::System.Guid queueId, | ||
int? offset, | ||
int? limit); | ||
partial void ProcessGetRunsFromAnnotationQueueResponse( | ||
global::System.Net.Http.HttpClient httpClient, | ||
global::System.Net.Http.HttpResponseMessage httpResponseMessage); | ||
|
||
partial void ProcessGetRunsFromAnnotationQueueResponseContent( | ||
global::System.Net.Http.HttpClient httpClient, | ||
global::System.Net.Http.HttpResponseMessage httpResponseMessage, | ||
ref string content); | ||
|
||
/// <summary> | ||
/// Get Runs From Annotation Queue | ||
/// </summary> | ||
/// <param name="queueId"></param> | ||
/// <param name="offset"> | ||
/// Default Value: 0 | ||
/// </param> | ||
/// <param name="limit"> | ||
/// Default Value: 100 | ||
/// </param> | ||
/// <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.RunSchemaWithAnnotationQueueInfo>> GetRunsFromAnnotationQueueAsync( | ||
global::System.Guid queueId, | ||
int? offset = default, | ||
int? limit = default, | ||
global::System.Threading.CancellationToken cancellationToken = default) | ||
{ | ||
PrepareArguments( | ||
client: HttpClient); | ||
PrepareGetRunsFromAnnotationQueueArguments( | ||
httpClient: HttpClient, | ||
queueId: ref queueId, | ||
offset: ref offset, | ||
limit: ref limit); | ||
|
||
var __pathBuilder = new PathBuilder( | ||
path: $"/api/v1/annotation-queues/{queueId}/runs", | ||
baseUri: HttpClient.BaseAddress); | ||
__pathBuilder | ||
.AddOptionalParameter("offset", offset?.ToString()) | ||
.AddOptionalParameter("limit", limit?.ToString()) | ||
; | ||
var __path = __pathBuilder.ToString(); | ||
using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( | ||
method: global::System.Net.Http.HttpMethod.Get, | ||
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); | ||
PrepareGetRunsFromAnnotationQueueRequest( | ||
httpClient: HttpClient, | ||
httpRequestMessage: __httpRequest, | ||
queueId: queueId, | ||
offset: offset, | ||
limit: limit); | ||
|
||
using var __response = await HttpClient.SendAsync( | ||
request: __httpRequest, | ||
completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, | ||
cancellationToken: cancellationToken).ConfigureAwait(false); | ||
|
||
ProcessResponse( | ||
client: HttpClient, | ||
response: __response); | ||
ProcessGetRunsFromAnnotationQueueResponse( | ||
httpClient: HttpClient, | ||
httpResponseMessage: __response); | ||
// Validation Error | ||
if ((int)__response.StatusCode == 422) | ||
{ | ||
string? __content_422 = null; | ||
global::LangSmith.HTTPValidationError? __value_422 = null; | ||
if (ReadResponseAsString) | ||
{ | ||
__content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); | ||
__value_422 = global::LangSmith.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); | ||
} | ||
else | ||
{ | ||
var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); | ||
__value_422 = await global::LangSmith.HTTPValidationError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false); | ||
} | ||
|
||
throw new global::LangSmith.ApiException<global::LangSmith.HTTPValidationError>( | ||
message: __response.ReasonPhrase ?? string.Empty, | ||
statusCode: __response.StatusCode) | ||
{ | ||
ResponseBody = __content_422, | ||
ResponseObject = __value_422, | ||
ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( | ||
__response.Headers, | ||
h => h.Key, | ||
h => h.Value), | ||
}; | ||
} | ||
|
||
if (ReadResponseAsString) | ||
{ | ||
var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); | ||
|
||
ProcessResponseContent( | ||
client: HttpClient, | ||
response: __response, | ||
content: ref __content); | ||
ProcessGetRunsFromAnnotationQueueResponseContent( | ||
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.RunSchemaWithAnnotationQueueInfo>), JsonSerializerContext) as global::System.Collections.Generic.IList<global::LangSmith.RunSchemaWithAnnotationQueueInfo> ?? | ||
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(cancellationToken).ConfigureAwait(false); | ||
|
||
return | ||
await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList<global::LangSmith.RunSchemaWithAnnotationQueueInfo>), JsonSerializerContext).ConfigureAwait(false) as global::System.Collections.Generic.IList<global::LangSmith.RunSchemaWithAnnotationQueueInfo> ?? | ||
throw new global::System.InvalidOperationException("Response deserialization failed."); | ||
} | ||
} | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
...ibs/LangSmith/Generated/LangSmith.IAnnotationQueuesClient.GetRunsFromAnnotationQueue.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,25 @@ | ||
#nullable enable | ||
|
||
namespace LangSmith | ||
{ | ||
public partial interface IAnnotationQueuesClient | ||
{ | ||
/// <summary> | ||
/// Get Runs From Annotation Queue | ||
/// </summary> | ||
/// <param name="queueId"></param> | ||
/// <param name="offset"> | ||
/// Default Value: 0 | ||
/// </param> | ||
/// <param name="limit"> | ||
/// Default Value: 100 | ||
/// </param> | ||
/// <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.RunSchemaWithAnnotationQueueInfo>> GetRunsFromAnnotationQueueAsync( | ||
global::System.Guid queueId, | ||
int? offset = default, | ||
int? limit = default, | ||
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