Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,23 @@ partial void ProcessCreateAndEscalateThreadResponseContent(
public async global::System.Threading.Tasks.Task<global::Helicone.ResultInAppThreadString> CreateAndEscalateThreadAsync(
global::Helicone.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
var __response = await CreateAndEscalateThreadAsResponseAsync(
requestOptions: requestOptions,
cancellationToken: cancellationToken
).ConfigureAwait(false);

return __response.Body;
}
/// <summary>
///
/// </summary>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::Helicone.ApiException"></exception>
public async global::System.Threading.Tasks.Task<global::Helicone.AutoSDKHttpResponse<global::Helicone.ResultInAppThreadString>> CreateAndEscalateThreadAsResponseAsync(
global::Helicone.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
Expand Down Expand Up @@ -89,6 +106,7 @@ partial void ProcessCreateAndEscalateThreadResponseContent(

global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{

var __pathBuilder = new global::Helicone.PathBuilder(
path: "/v1/agent/thread/create-and-escalate",
baseUri: ResolveBaseUri(
Expand Down Expand Up @@ -163,6 +181,8 @@ partial void ProcessCreateAndEscalateThreadResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
retryDelay: null,
retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
Expand All @@ -173,6 +193,11 @@ partial void ProcessCreateAndEscalateThreadResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
var __retryDelay = global::Helicone.AutoSDKRequestOptionsSupport.GetRetryDelay(
clientOptions: Options,
requestOptions: requestOptions,
response: null,
attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Helicone.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
Expand All @@ -190,6 +215,8 @@ partial void ProcessCreateAndEscalateThreadResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
Expand All @@ -199,8 +226,7 @@ partial void ProcessCreateAndEscalateThreadResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Helicone.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
clientOptions: Options,
requestOptions: requestOptions,
retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
Expand All @@ -209,6 +235,11 @@ partial void ProcessCreateAndEscalateThreadResponseContent(
__attempt < __maxAttempts &&
global::Helicone.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
var __retryDelay = global::Helicone.AutoSDKRequestOptionsSupport.GetRetryDelay(
clientOptions: Options,
requestOptions: requestOptions,
response: __response,
attempt: __attempt);
await global::Helicone.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Helicone.AutoSDKRequestOptionsSupport.CreateHookContext(
Expand All @@ -225,14 +256,15 @@ partial void ProcessCreateAndEscalateThreadResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
retryDelay: __retryDelay,
retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Helicone.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
clientOptions: Options,
requestOptions: requestOptions,
retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
Expand Down Expand Up @@ -272,6 +304,8 @@ partial void ProcessCreateAndEscalateThreadResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
retryDelay: null,
retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
Expand All @@ -292,6 +326,8 @@ partial void ProcessCreateAndEscalateThreadResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
retryDelay: null,
retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}

Expand All @@ -316,9 +352,13 @@ partial void ProcessCreateAndEscalateThreadResponseContent(
{
__response.EnsureSuccessStatusCode();

return
global::Helicone.ResultInAppThreadString.FromJson(__content, JsonSerializerContext) ??
var __value = global::Helicone.ResultInAppThreadString.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
return new global::Helicone.AutoSDKHttpResponse<global::Helicone.ResultInAppThreadString>(
statusCode: __response.StatusCode,
headers: global::Helicone.AutoSDKHttpResponse.CreateHeaders(__response),
requestUri: __response.RequestMessage?.RequestUri,
body: __value);
}
catch (global::System.Exception __ex)
{
Expand Down Expand Up @@ -346,9 +386,13 @@ partial void ProcessCreateAndEscalateThreadResponseContent(
#endif
).ConfigureAwait(false);

return
await global::Helicone.ResultInAppThreadString.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
var __value = await global::Helicone.ResultInAppThreadString.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
return new global::Helicone.AutoSDKHttpResponse<global::Helicone.ResultInAppThreadString>(
statusCode: __response.StatusCode,
headers: global::Helicone.AutoSDKHttpResponse.CreateHeaders(__response),
requestUri: __response.RequestMessage?.RequestUri,
body: __value);
}
catch (global::System.Exception __ex)
{
Expand Down
63 changes: 55 additions & 8 deletions src/libs/Helicone/Generated/Helicone.AgentClient.DeleteThread.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,26 @@ partial void ProcessDeleteThreadResponseContent(
string sessionId,
global::Helicone.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
var __response = await DeleteThreadAsResponseAsync(
sessionId: sessionId,
requestOptions: requestOptions,
cancellationToken: cancellationToken
).ConfigureAwait(false);

return __response.Body;
}
/// <summary>
///
/// </summary>
/// <param name="sessionId"></param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::Helicone.ApiException"></exception>
public async global::System.Threading.Tasks.Task<global::Helicone.AutoSDKHttpResponse<global::Helicone.ResultSuccessBooleanString>> DeleteThreadAsResponseAsync(
string sessionId,
global::Helicone.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
Expand Down Expand Up @@ -94,6 +114,7 @@ partial void ProcessDeleteThreadResponseContent(

global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{

var __pathBuilder = new global::Helicone.PathBuilder(
path: $"/v1/agent/thread/{sessionId}",
baseUri: ResolveBaseUri(
Expand Down Expand Up @@ -169,6 +190,8 @@ partial void ProcessDeleteThreadResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
retryDelay: null,
retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
Expand All @@ -179,6 +202,11 @@ partial void ProcessDeleteThreadResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
var __retryDelay = global::Helicone.AutoSDKRequestOptionsSupport.GetRetryDelay(
clientOptions: Options,
requestOptions: requestOptions,
response: null,
attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Helicone.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
Expand All @@ -196,6 +224,8 @@ partial void ProcessDeleteThreadResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
Expand All @@ -205,8 +235,7 @@ partial void ProcessDeleteThreadResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Helicone.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
clientOptions: Options,
requestOptions: requestOptions,
retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
Expand All @@ -215,6 +244,11 @@ partial void ProcessDeleteThreadResponseContent(
__attempt < __maxAttempts &&
global::Helicone.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
var __retryDelay = global::Helicone.AutoSDKRequestOptionsSupport.GetRetryDelay(
clientOptions: Options,
requestOptions: requestOptions,
response: __response,
attempt: __attempt);
await global::Helicone.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Helicone.AutoSDKRequestOptionsSupport.CreateHookContext(
Expand All @@ -231,14 +265,15 @@ partial void ProcessDeleteThreadResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
retryDelay: __retryDelay,
retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Helicone.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
clientOptions: Options,
requestOptions: requestOptions,
retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
Expand Down Expand Up @@ -278,6 +313,8 @@ partial void ProcessDeleteThreadResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
retryDelay: null,
retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
Expand All @@ -298,6 +335,8 @@ partial void ProcessDeleteThreadResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
retryDelay: null,
retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}

Expand All @@ -322,9 +361,13 @@ partial void ProcessDeleteThreadResponseContent(
{
__response.EnsureSuccessStatusCode();

return
global::Helicone.ResultSuccessBooleanString.FromJson(__content, JsonSerializerContext) ??
var __value = global::Helicone.ResultSuccessBooleanString.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
return new global::Helicone.AutoSDKHttpResponse<global::Helicone.ResultSuccessBooleanString>(
statusCode: __response.StatusCode,
headers: global::Helicone.AutoSDKHttpResponse.CreateHeaders(__response),
requestUri: __response.RequestMessage?.RequestUri,
body: __value);
}
catch (global::System.Exception __ex)
{
Expand Down Expand Up @@ -352,9 +395,13 @@ partial void ProcessDeleteThreadResponseContent(
#endif
).ConfigureAwait(false);

return
await global::Helicone.ResultSuccessBooleanString.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
var __value = await global::Helicone.ResultSuccessBooleanString.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
return new global::Helicone.AutoSDKHttpResponse<global::Helicone.ResultSuccessBooleanString>(
statusCode: __response.StatusCode,
headers: global::Helicone.AutoSDKHttpResponse.CreateHeaders(__response),
requestUri: __response.RequestMessage?.RequestUri,
body: __value);
}
catch (global::System.Exception __ex)
{
Expand Down
Loading