diff --git a/src/libs/Together/Generated/Together.ABExperimentServiceClient.ABExperimentServiceCreateABExperiment.g.cs b/src/libs/Together/Generated/Together.ABExperimentServiceClient.ABExperimentServiceCreateABExperiment.g.cs
new file mode 100644
index 00000000..8fab9032
--- /dev/null
+++ b/src/libs/Together/Generated/Together.ABExperimentServiceClient.ABExperimentServiceCreateABExperiment.g.cs
@@ -0,0 +1,555 @@
+
+#nullable enable
+
+namespace Together
+{
+ public partial class ABExperimentServiceClient
+ {
+
+ private static readonly global::Together.AutoSDKServer[] s_ABExperimentServiceCreateABExperimentServers = new global::Together.AutoSDKServer[]
+ { new global::Together.AutoSDKServer(
+ id: "https-api-together-ai-v2",
+ name: "api.together.ai v2",
+ url: "https://api.together.ai/v2",
+ description: ""),
+ };
+
+
+ private static readonly global::Together.EndPointSecurityRequirement s_ABExperimentServiceCreateABExperimentSecurityRequirement0 =
+ new global::Together.EndPointSecurityRequirement
+ {
+ Authorizations = new global::Together.EndPointAuthorizationRequirement[]
+ { new global::Together.EndPointAuthorizationRequirement
+ {
+ Type = "Http",
+ SchemeId = "BearerAuth",
+ Location = "Header",
+ Name = "Bearer",
+ FriendlyName = "Bearer",
+ },
+ },
+ };
+ private static readonly global::Together.EndPointSecurityRequirement[] s_ABExperimentServiceCreateABExperimentSecurityRequirements =
+ new global::Together.EndPointSecurityRequirement[]
+ { s_ABExperimentServiceCreateABExperimentSecurityRequirement0,
+ };
+ partial void PrepareABExperimentServiceCreateABExperimentArguments(
+ global::System.Net.Http.HttpClient httpClient,
+ ref string projectId,
+ ref string endpointId,
+ global::Together.DeCreateABExperimentRequest request);
+ partial void PrepareABExperimentServiceCreateABExperimentRequest(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpRequestMessage httpRequestMessage,
+ string projectId,
+ string endpointId,
+ global::Together.DeCreateABExperimentRequest request);
+ partial void ProcessABExperimentServiceCreateABExperimentResponse(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpResponseMessage httpResponseMessage);
+
+ partial void ProcessABExperimentServiceCreateABExperimentResponseContent(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpResponseMessage httpResponseMessage,
+ ref string content);
+
+ ///
+ /// Create an A/B experiment
+ /// Creates a managed control/variant split across two to 20 deployments under the same endpoint. Exactly one member is the control, member percentages must add up to 100, and the split applies only to traffic that the endpoint would otherwise send to the control.
+ ///
+ ///
+ /// Project identifier.
+ ///
+ ///
+ /// Endpoint identifier.
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task ABExperimentServiceCreateABExperimentAsync(
+ string projectId,
+ string endpointId,
+
+ global::Together.DeCreateABExperimentRequest request,
+ global::Together.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await ABExperimentServiceCreateABExperimentAsResponseAsync(
+ projectId: projectId,
+ endpointId: endpointId,
+
+ request: request,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Create an A/B experiment
+ /// Creates a managed control/variant split across two to 20 deployments under the same endpoint. Exactly one member is the control, member percentages must add up to 100, and the split applies only to traffic that the endpoint would otherwise send to the control.
+ ///
+ ///
+ /// Project identifier.
+ ///
+ ///
+ /// Endpoint identifier.
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> ABExperimentServiceCreateABExperimentAsResponseAsync(
+ string projectId,
+ string endpointId,
+
+ global::Together.DeCreateABExperimentRequest request,
+ global::Together.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ request = request ?? throw new global::System.ArgumentNullException(nameof(request));
+
+ PrepareArguments(
+ client: HttpClient);
+ PrepareABExperimentServiceCreateABExperimentArguments(
+ httpClient: HttpClient,
+ projectId: ref projectId,
+ endpointId: ref endpointId,
+ request: request);
+
+
+ var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations(
+ availableAuthorizations: Authorizations,
+ securityRequirements: s_ABExperimentServiceCreateABExperimentSecurityRequirements,
+ operationName: "ABExperimentServiceCreateABExperimentAsync");
+
+ using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken);
+ var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken;
+ var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ fallbackValue: ReadResponseAsString);
+ var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ supportsRetry: true);
+
+ global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
+ {
+
+ var __pathBuilder = new global::Together.PathBuilder(
+ path: $"/projects/{projectId}/endpoints/{endpointId}/abExperiments",
+ baseUri: ResolveBaseUri(
+ servers: s_ABExperimentServiceCreateABExperimentServers,
+ defaultBaseUrl: "https://api.together.ai/v2"));
+ var __path = __pathBuilder.ToString();
+ __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters(
+ path: __path,
+ clientParameters: Options.QueryParameters,
+ requestParameters: requestOptions?.QueryParameters);
+ 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" ||
+ __authorization.Type == "OpenIdConnect")
+ {
+ __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 = request.ToJson(JsonSerializerContext);
+ var __httpRequestContent = new global::System.Net.Http.StringContent(
+ content: __httpRequestContentBody,
+ encoding: global::System.Text.Encoding.UTF8,
+ mediaType: "application/json");
+ __httpRequest.Content = __httpRequestContent;
+ global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders(
+ request: __httpRequest,
+ clientHeaders: Options.Headers,
+ requestHeaders: requestOptions?.Headers);
+
+ PrepareRequest(
+ client: HttpClient,
+ request: __httpRequest);
+ PrepareABExperimentServiceCreateABExperimentRequest(
+ httpClient: HttpClient,
+ httpRequestMessage: __httpRequest,
+ projectId: projectId!,
+ endpointId: endpointId!,
+ request: request);
+
+ return __httpRequest;
+ }
+
+ global::System.Net.Http.HttpRequestMessage? __httpRequest = null;
+ global::System.Net.Http.HttpResponseMessage? __response = null;
+ var __attemptNumber = 0;
+ try
+ {
+ for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++)
+ {
+ __attemptNumber = __attempt;
+ __httpRequest = __CreateHttpRequest();
+ await global::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "ABExperimentServiceCreateABExperiment",
+ methodName: "ABExperimentServiceCreateABExperimentAsync",
+ pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/abExperiments\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ try
+ {
+ __response = await HttpClient.SendAsync(
+ request: __httpRequest,
+ completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ }
+ catch (global::System.Net.Http.HttpRequestException __exception)
+ {
+ var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
+ var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
+ await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "ABExperimentServiceCreateABExperiment",
+ methodName: "ABExperimentServiceCreateABExperimentAsync",
+ pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/abExperiments\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: __exception,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ if (!__willRetry)
+ {
+ throw;
+ }
+
+ __httpRequest.Dispose();
+ __httpRequest = null;
+ await global::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ if (__response != null &&
+ __attempt < __maxAttempts &&
+ global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
+ {
+ var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
+ await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "ABExperimentServiceCreateABExperiment",
+ methodName: "ABExperimentServiceCreateABExperimentAsync",
+ pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/abExperiments\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ break;
+ }
+
+ if (__response == null)
+ {
+ throw new global::System.InvalidOperationException("No response received.");
+ }
+
+ using (__response)
+ {
+
+ ProcessResponse(
+ client: HttpClient,
+ response: __response);
+ ProcessABExperimentServiceCreateABExperimentResponse(
+ httpClient: HttpClient,
+ httpResponseMessage: __response);
+ if (__response.IsSuccessStatusCode)
+ {
+ await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "ABExperimentServiceCreateABExperiment",
+ methodName: "ABExperimentServiceCreateABExperimentAsync",
+ pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/abExperiments\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ else
+ {
+ await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "ABExperimentServiceCreateABExperiment",
+ methodName: "ABExperimentServiceCreateABExperimentAsync",
+ pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/abExperiments\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ // Default error response
+ if (!__response.IsSuccessStatusCode)
+ {
+ string? __content_default = null;
+ global::System.Exception? __exception_default = null;
+ global::Together.ErrorData? __value_default = null;
+ try
+ {
+ if (__effectiveReadResponseAsString)
+ {
+ __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+ __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext);
+ }
+ else
+ {
+ __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+
+ __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext);
+ }
+ }
+ catch (global::System.Exception __ex)
+ {
+ __exception_default = __ex;
+ }
+
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content_default ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __exception_default,
+ responseBody: __content_default,
+ responseObject: __value_default,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+
+ if (__effectiveReadResponseAsString)
+ {
+ var __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ ProcessResponseContent(
+ client: HttpClient,
+ response: __response,
+ content: ref __content);
+ ProcessABExperimentServiceCreateABExperimentResponseContent(
+ httpClient: HttpClient,
+ httpResponseMessage: __response,
+ content: ref __content);
+
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+
+ var __value = global::Together.DeABExperiment.FromJson(__content, JsonSerializerContext) ??
+ throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Together.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
+ }
+ catch (global::System.Exception __ex)
+ {
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ }
+ else
+ {
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+ using var __content = await __response.Content.ReadAsStreamAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ var __value = await global::Together.DeABExperiment.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Together.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
+ }
+ catch (global::System.Exception __ex)
+ {
+ string? __content = null;
+ try
+ {
+ __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+ }
+ catch (global::System.Exception)
+ {
+ }
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ }
+
+ }
+ }
+ finally
+ {
+ __httpRequest?.Dispose();
+ }
+ }
+ ///
+ /// Create an A/B experiment
+ /// Creates a managed control/variant split across two to 20 deployments under the same endpoint. Exactly one member is the control, member percentages must add up to 100, and the split applies only to traffic that the endpoint would otherwise send to the control.
+ ///
+ ///
+ /// Project identifier.
+ ///
+ ///
+ /// Endpoint identifier.
+ ///
+ ///
+ /// Human-readable A/B experiment name, unique within the endpoint.
+ ///
+ ///
+ /// Optional free-form description.
+ ///
+ ///
+ /// Two to 20 participating deployments with exactly one control. Integer traffic percentages across all members must add up to 100.
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task ABExperimentServiceCreateABExperimentAsync(
+ string projectId,
+ string endpointId,
+ string name,
+ global::System.Collections.Generic.IList members,
+ string? description = default,
+ global::Together.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __request = new global::Together.DeCreateABExperimentRequest
+ {
+ Name = name,
+ Description = description,
+ Members = members,
+ };
+
+ return await ABExperimentServiceCreateABExperimentAsync(
+ projectId: projectId,
+ endpointId: endpointId,
+ request: __request,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/libs/Together/Generated/Together.ABExperimentServiceClient.ABExperimentServiceDeleteABExperiment.g.cs b/src/libs/Together/Generated/Together.ABExperimentServiceClient.ABExperimentServiceDeleteABExperiment.g.cs
new file mode 100644
index 00000000..9fbfdc77
--- /dev/null
+++ b/src/libs/Together/Generated/Together.ABExperimentServiceClient.ABExperimentServiceDeleteABExperiment.g.cs
@@ -0,0 +1,519 @@
+
+#nullable enable
+
+namespace Together
+{
+ public partial class ABExperimentServiceClient
+ {
+
+ private static readonly global::Together.AutoSDKServer[] s_ABExperimentServiceDeleteABExperimentServers = new global::Together.AutoSDKServer[]
+ { new global::Together.AutoSDKServer(
+ id: "https-api-together-ai-v2",
+ name: "api.together.ai v2",
+ url: "https://api.together.ai/v2",
+ description: ""),
+ };
+
+
+ private static readonly global::Together.EndPointSecurityRequirement s_ABExperimentServiceDeleteABExperimentSecurityRequirement0 =
+ new global::Together.EndPointSecurityRequirement
+ {
+ Authorizations = new global::Together.EndPointAuthorizationRequirement[]
+ { new global::Together.EndPointAuthorizationRequirement
+ {
+ Type = "Http",
+ SchemeId = "BearerAuth",
+ Location = "Header",
+ Name = "Bearer",
+ FriendlyName = "Bearer",
+ },
+ },
+ };
+ private static readonly global::Together.EndPointSecurityRequirement[] s_ABExperimentServiceDeleteABExperimentSecurityRequirements =
+ new global::Together.EndPointSecurityRequirement[]
+ { s_ABExperimentServiceDeleteABExperimentSecurityRequirement0,
+ };
+ partial void PrepareABExperimentServiceDeleteABExperimentArguments(
+ global::System.Net.Http.HttpClient httpClient,
+ ref string projectId,
+ ref string endpointId,
+ ref string id,
+ ref string? etag);
+ partial void PrepareABExperimentServiceDeleteABExperimentRequest(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpRequestMessage httpRequestMessage,
+ string projectId,
+ string endpointId,
+ string id,
+ string? etag);
+ partial void ProcessABExperimentServiceDeleteABExperimentResponse(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpResponseMessage httpResponseMessage);
+
+ partial void ProcessABExperimentServiceDeleteABExperimentResponseContent(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpResponseMessage httpResponseMessage,
+ ref string content);
+
+ ///
+ /// Delete an A/B experiment
+ /// Deletes an A/B experiment and removes its managed traffic split. The deployments themselves are not deleted.
+ ///
+ ///
+ /// Project identifier.
+ ///
+ ///
+ /// Endpoint identifier.
+ ///
+ ///
+ /// A/B experiment identifier.
+ ///
+ ///
+ /// Etag for optimistic concurrency. If set, the delete is rejected if the current etag does not match.
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task ABExperimentServiceDeleteABExperimentAsync(
+ string projectId,
+ string endpointId,
+ string id,
+ string? etag = default,
+ global::Together.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await ABExperimentServiceDeleteABExperimentAsResponseAsync(
+ projectId: projectId,
+ endpointId: endpointId,
+ id: id,
+ etag: etag,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Delete an A/B experiment
+ /// Deletes an A/B experiment and removes its managed traffic split. The deployments themselves are not deleted.
+ ///
+ ///
+ /// Project identifier.
+ ///
+ ///
+ /// Endpoint identifier.
+ ///
+ ///
+ /// A/B experiment identifier.
+ ///
+ ///
+ /// Etag for optimistic concurrency. If set, the delete is rejected if the current etag does not match.
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> ABExperimentServiceDeleteABExperimentAsResponseAsync(
+ string projectId,
+ string endpointId,
+ string id,
+ string? etag = default,
+ global::Together.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ PrepareArguments(
+ client: HttpClient);
+ PrepareABExperimentServiceDeleteABExperimentArguments(
+ httpClient: HttpClient,
+ projectId: ref projectId,
+ endpointId: ref endpointId,
+ id: ref id,
+ etag: ref etag);
+
+
+ var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations(
+ availableAuthorizations: Authorizations,
+ securityRequirements: s_ABExperimentServiceDeleteABExperimentSecurityRequirements,
+ operationName: "ABExperimentServiceDeleteABExperimentAsync");
+
+ using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken);
+ var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken;
+ var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ fallbackValue: ReadResponseAsString);
+ var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ supportsRetry: true);
+
+ global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
+ {
+
+ var __pathBuilder = new global::Together.PathBuilder(
+ path: $"/projects/{projectId}/endpoints/{endpointId}/abExperiments/{id}",
+ baseUri: ResolveBaseUri(
+ servers: s_ABExperimentServiceDeleteABExperimentServers,
+ defaultBaseUrl: "https://api.together.ai/v2"));
+ __pathBuilder
+ .AddOptionalParameter("etag", etag)
+ ;
+ var __path = __pathBuilder.ToString();
+ __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters(
+ path: __path,
+ clientParameters: Options.QueryParameters,
+ requestParameters: requestOptions?.QueryParameters);
+ var __httpRequest = new global::System.Net.Http.HttpRequestMessage(
+ method: global::System.Net.Http.HttpMethod.Delete,
+ 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" ||
+ __authorization.Type == "OpenIdConnect")
+ {
+ __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);
+ }
+ }
+ global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders(
+ request: __httpRequest,
+ clientHeaders: Options.Headers,
+ requestHeaders: requestOptions?.Headers);
+
+ PrepareRequest(
+ client: HttpClient,
+ request: __httpRequest);
+ PrepareABExperimentServiceDeleteABExperimentRequest(
+ httpClient: HttpClient,
+ httpRequestMessage: __httpRequest,
+ projectId: projectId!,
+ endpointId: endpointId!,
+ id: id!,
+ etag: etag);
+
+ return __httpRequest;
+ }
+
+ global::System.Net.Http.HttpRequestMessage? __httpRequest = null;
+ global::System.Net.Http.HttpResponseMessage? __response = null;
+ var __attemptNumber = 0;
+ try
+ {
+ for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++)
+ {
+ __attemptNumber = __attempt;
+ __httpRequest = __CreateHttpRequest();
+ await global::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "ABExperimentServiceDeleteABExperiment",
+ methodName: "ABExperimentServiceDeleteABExperimentAsync",
+ pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/abExperiments/{id}\"",
+ httpMethod: "DELETE",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ try
+ {
+ __response = await HttpClient.SendAsync(
+ request: __httpRequest,
+ completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ }
+ catch (global::System.Net.Http.HttpRequestException __exception)
+ {
+ var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
+ var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
+ await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "ABExperimentServiceDeleteABExperiment",
+ methodName: "ABExperimentServiceDeleteABExperimentAsync",
+ pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/abExperiments/{id}\"",
+ httpMethod: "DELETE",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: __exception,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ if (!__willRetry)
+ {
+ throw;
+ }
+
+ __httpRequest.Dispose();
+ __httpRequest = null;
+ await global::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ if (__response != null &&
+ __attempt < __maxAttempts &&
+ global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
+ {
+ var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
+ await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "ABExperimentServiceDeleteABExperiment",
+ methodName: "ABExperimentServiceDeleteABExperimentAsync",
+ pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/abExperiments/{id}\"",
+ httpMethod: "DELETE",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ break;
+ }
+
+ if (__response == null)
+ {
+ throw new global::System.InvalidOperationException("No response received.");
+ }
+
+ using (__response)
+ {
+
+ ProcessResponse(
+ client: HttpClient,
+ response: __response);
+ ProcessABExperimentServiceDeleteABExperimentResponse(
+ httpClient: HttpClient,
+ httpResponseMessage: __response);
+ if (__response.IsSuccessStatusCode)
+ {
+ await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "ABExperimentServiceDeleteABExperiment",
+ methodName: "ABExperimentServiceDeleteABExperimentAsync",
+ pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/abExperiments/{id}\"",
+ httpMethod: "DELETE",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ else
+ {
+ await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "ABExperimentServiceDeleteABExperiment",
+ methodName: "ABExperimentServiceDeleteABExperimentAsync",
+ pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/abExperiments/{id}\"",
+ httpMethod: "DELETE",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ // Default error response
+ if (!__response.IsSuccessStatusCode)
+ {
+ string? __content_default = null;
+ global::System.Exception? __exception_default = null;
+ global::Together.ErrorData? __value_default = null;
+ try
+ {
+ if (__effectiveReadResponseAsString)
+ {
+ __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+ __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext);
+ }
+ else
+ {
+ __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+
+ __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext);
+ }
+ }
+ catch (global::System.Exception __ex)
+ {
+ __exception_default = __ex;
+ }
+
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content_default ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __exception_default,
+ responseBody: __content_default,
+ responseObject: __value_default,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+
+ if (__effectiveReadResponseAsString)
+ {
+ var __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ ProcessResponseContent(
+ client: HttpClient,
+ response: __response,
+ content: ref __content);
+ ProcessABExperimentServiceDeleteABExperimentResponseContent(
+ httpClient: HttpClient,
+ httpResponseMessage: __response,
+ content: ref __content);
+
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+
+ var __value = global::Together.DeDeleteResponse.FromJson(__content, JsonSerializerContext) ??
+ throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Together.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
+ }
+ catch (global::System.Exception __ex)
+ {
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ }
+ else
+ {
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+ using var __content = await __response.Content.ReadAsStreamAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ var __value = await global::Together.DeDeleteResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Together.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
+ }
+ catch (global::System.Exception __ex)
+ {
+ string? __content = null;
+ try
+ {
+ __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+ }
+ catch (global::System.Exception)
+ {
+ }
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ }
+
+ }
+ }
+ finally
+ {
+ __httpRequest?.Dispose();
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/libs/Together/Generated/Together.ABExperimentServiceClient.ABExperimentServiceGetABExperiment.g.cs b/src/libs/Together/Generated/Together.ABExperimentServiceClient.ABExperimentServiceGetABExperiment.g.cs
new file mode 100644
index 00000000..ceaeaa9b
--- /dev/null
+++ b/src/libs/Together/Generated/Together.ABExperimentServiceClient.ABExperimentServiceGetABExperiment.g.cs
@@ -0,0 +1,503 @@
+
+#nullable enable
+
+namespace Together
+{
+ public partial class ABExperimentServiceClient
+ {
+
+ private static readonly global::Together.AutoSDKServer[] s_ABExperimentServiceGetABExperimentServers = new global::Together.AutoSDKServer[]
+ { new global::Together.AutoSDKServer(
+ id: "https-api-together-ai-v2",
+ name: "api.together.ai v2",
+ url: "https://api.together.ai/v2",
+ description: ""),
+ };
+
+
+ private static readonly global::Together.EndPointSecurityRequirement s_ABExperimentServiceGetABExperimentSecurityRequirement0 =
+ new global::Together.EndPointSecurityRequirement
+ {
+ Authorizations = new global::Together.EndPointAuthorizationRequirement[]
+ { new global::Together.EndPointAuthorizationRequirement
+ {
+ Type = "Http",
+ SchemeId = "BearerAuth",
+ Location = "Header",
+ Name = "Bearer",
+ FriendlyName = "Bearer",
+ },
+ },
+ };
+ private static readonly global::Together.EndPointSecurityRequirement[] s_ABExperimentServiceGetABExperimentSecurityRequirements =
+ new global::Together.EndPointSecurityRequirement[]
+ { s_ABExperimentServiceGetABExperimentSecurityRequirement0,
+ };
+ partial void PrepareABExperimentServiceGetABExperimentArguments(
+ global::System.Net.Http.HttpClient httpClient,
+ ref string projectId,
+ ref string endpointId,
+ ref string id);
+ partial void PrepareABExperimentServiceGetABExperimentRequest(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpRequestMessage httpRequestMessage,
+ string projectId,
+ string endpointId,
+ string id);
+ partial void ProcessABExperimentServiceGetABExperimentResponse(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpResponseMessage httpResponseMessage);
+
+ partial void ProcessABExperimentServiceGetABExperimentResponseContent(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpResponseMessage httpResponseMessage,
+ ref string content);
+
+ ///
+ /// Get an A/B experiment
+ /// Retrieves an A/B experiment and its participating deployments, roles, and traffic percentages.
+ ///
+ ///
+ /// Project identifier.
+ ///
+ ///
+ /// Endpoint identifier.
+ ///
+ ///
+ /// A/B experiment identifier.
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task ABExperimentServiceGetABExperimentAsync(
+ string projectId,
+ string endpointId,
+ string id,
+ global::Together.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await ABExperimentServiceGetABExperimentAsResponseAsync(
+ projectId: projectId,
+ endpointId: endpointId,
+ id: id,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Get an A/B experiment
+ /// Retrieves an A/B experiment and its participating deployments, roles, and traffic percentages.
+ ///
+ ///
+ /// Project identifier.
+ ///
+ ///
+ /// Endpoint identifier.
+ ///
+ ///
+ /// A/B experiment identifier.
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> ABExperimentServiceGetABExperimentAsResponseAsync(
+ string projectId,
+ string endpointId,
+ string id,
+ global::Together.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ PrepareArguments(
+ client: HttpClient);
+ PrepareABExperimentServiceGetABExperimentArguments(
+ httpClient: HttpClient,
+ projectId: ref projectId,
+ endpointId: ref endpointId,
+ id: ref id);
+
+
+ var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations(
+ availableAuthorizations: Authorizations,
+ securityRequirements: s_ABExperimentServiceGetABExperimentSecurityRequirements,
+ operationName: "ABExperimentServiceGetABExperimentAsync");
+
+ using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken);
+ var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken;
+ var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ fallbackValue: ReadResponseAsString);
+ var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ supportsRetry: true);
+
+ global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
+ {
+
+ var __pathBuilder = new global::Together.PathBuilder(
+ path: $"/projects/{projectId}/endpoints/{endpointId}/abExperiments/{id}",
+ baseUri: ResolveBaseUri(
+ servers: s_ABExperimentServiceGetABExperimentServers,
+ defaultBaseUrl: "https://api.together.ai/v2"));
+ var __path = __pathBuilder.ToString();
+ __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters(
+ path: __path,
+ clientParameters: Options.QueryParameters,
+ requestParameters: requestOptions?.QueryParameters);
+ 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" ||
+ __authorization.Type == "OpenIdConnect")
+ {
+ __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);
+ }
+ }
+ global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders(
+ request: __httpRequest,
+ clientHeaders: Options.Headers,
+ requestHeaders: requestOptions?.Headers);
+
+ PrepareRequest(
+ client: HttpClient,
+ request: __httpRequest);
+ PrepareABExperimentServiceGetABExperimentRequest(
+ httpClient: HttpClient,
+ httpRequestMessage: __httpRequest,
+ projectId: projectId!,
+ endpointId: endpointId!,
+ id: id!);
+
+ return __httpRequest;
+ }
+
+ global::System.Net.Http.HttpRequestMessage? __httpRequest = null;
+ global::System.Net.Http.HttpResponseMessage? __response = null;
+ var __attemptNumber = 0;
+ try
+ {
+ for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++)
+ {
+ __attemptNumber = __attempt;
+ __httpRequest = __CreateHttpRequest();
+ await global::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "ABExperimentServiceGetABExperiment",
+ methodName: "ABExperimentServiceGetABExperimentAsync",
+ pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/abExperiments/{id}\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ try
+ {
+ __response = await HttpClient.SendAsync(
+ request: __httpRequest,
+ completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ }
+ catch (global::System.Net.Http.HttpRequestException __exception)
+ {
+ var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
+ var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
+ await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "ABExperimentServiceGetABExperiment",
+ methodName: "ABExperimentServiceGetABExperimentAsync",
+ pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/abExperiments/{id}\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: __exception,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ if (!__willRetry)
+ {
+ throw;
+ }
+
+ __httpRequest.Dispose();
+ __httpRequest = null;
+ await global::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ if (__response != null &&
+ __attempt < __maxAttempts &&
+ global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
+ {
+ var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
+ await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "ABExperimentServiceGetABExperiment",
+ methodName: "ABExperimentServiceGetABExperimentAsync",
+ pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/abExperiments/{id}\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ break;
+ }
+
+ if (__response == null)
+ {
+ throw new global::System.InvalidOperationException("No response received.");
+ }
+
+ using (__response)
+ {
+
+ ProcessResponse(
+ client: HttpClient,
+ response: __response);
+ ProcessABExperimentServiceGetABExperimentResponse(
+ httpClient: HttpClient,
+ httpResponseMessage: __response);
+ if (__response.IsSuccessStatusCode)
+ {
+ await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "ABExperimentServiceGetABExperiment",
+ methodName: "ABExperimentServiceGetABExperimentAsync",
+ pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/abExperiments/{id}\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ else
+ {
+ await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "ABExperimentServiceGetABExperiment",
+ methodName: "ABExperimentServiceGetABExperimentAsync",
+ pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/abExperiments/{id}\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ // Default error response
+ if (!__response.IsSuccessStatusCode)
+ {
+ string? __content_default = null;
+ global::System.Exception? __exception_default = null;
+ global::Together.ErrorData? __value_default = null;
+ try
+ {
+ if (__effectiveReadResponseAsString)
+ {
+ __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+ __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext);
+ }
+ else
+ {
+ __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+
+ __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext);
+ }
+ }
+ catch (global::System.Exception __ex)
+ {
+ __exception_default = __ex;
+ }
+
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content_default ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __exception_default,
+ responseBody: __content_default,
+ responseObject: __value_default,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+
+ if (__effectiveReadResponseAsString)
+ {
+ var __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ ProcessResponseContent(
+ client: HttpClient,
+ response: __response,
+ content: ref __content);
+ ProcessABExperimentServiceGetABExperimentResponseContent(
+ httpClient: HttpClient,
+ httpResponseMessage: __response,
+ content: ref __content);
+
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+
+ var __value = global::Together.DeABExperiment.FromJson(__content, JsonSerializerContext) ??
+ throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Together.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
+ }
+ catch (global::System.Exception __ex)
+ {
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ }
+ else
+ {
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+ using var __content = await __response.Content.ReadAsStreamAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ var __value = await global::Together.DeABExperiment.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Together.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
+ }
+ catch (global::System.Exception __ex)
+ {
+ string? __content = null;
+ try
+ {
+ __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+ }
+ catch (global::System.Exception)
+ {
+ }
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ }
+
+ }
+ }
+ finally
+ {
+ __httpRequest?.Dispose();
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/libs/Together/Generated/Together.ABExperimentServiceClient.ABExperimentServiceListABExperiments.g.cs b/src/libs/Together/Generated/Together.ABExperimentServiceClient.ABExperimentServiceListABExperiments.g.cs
new file mode 100644
index 00000000..af630ab2
--- /dev/null
+++ b/src/libs/Together/Generated/Together.ABExperimentServiceClient.ABExperimentServiceListABExperiments.g.cs
@@ -0,0 +1,520 @@
+
+#nullable enable
+
+namespace Together
+{
+ public partial class ABExperimentServiceClient
+ {
+
+ private static readonly global::Together.AutoSDKServer[] s_ABExperimentServiceListABExperimentsServers = new global::Together.AutoSDKServer[]
+ { new global::Together.AutoSDKServer(
+ id: "https-api-together-ai-v2",
+ name: "api.together.ai v2",
+ url: "https://api.together.ai/v2",
+ description: ""),
+ };
+
+
+ private static readonly global::Together.EndPointSecurityRequirement s_ABExperimentServiceListABExperimentsSecurityRequirement0 =
+ new global::Together.EndPointSecurityRequirement
+ {
+ Authorizations = new global::Together.EndPointAuthorizationRequirement[]
+ { new global::Together.EndPointAuthorizationRequirement
+ {
+ Type = "Http",
+ SchemeId = "BearerAuth",
+ Location = "Header",
+ Name = "Bearer",
+ FriendlyName = "Bearer",
+ },
+ },
+ };
+ private static readonly global::Together.EndPointSecurityRequirement[] s_ABExperimentServiceListABExperimentsSecurityRequirements =
+ new global::Together.EndPointSecurityRequirement[]
+ { s_ABExperimentServiceListABExperimentsSecurityRequirement0,
+ };
+ partial void PrepareABExperimentServiceListABExperimentsArguments(
+ global::System.Net.Http.HttpClient httpClient,
+ ref string projectId,
+ ref string endpointId,
+ ref int? limit,
+ ref string? after);
+ partial void PrepareABExperimentServiceListABExperimentsRequest(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpRequestMessage httpRequestMessage,
+ string projectId,
+ string endpointId,
+ int? limit,
+ string? after);
+ partial void ProcessABExperimentServiceListABExperimentsResponse(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpResponseMessage httpResponseMessage);
+
+ partial void ProcessABExperimentServiceListABExperimentsResponseContent(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpResponseMessage httpResponseMessage,
+ ref string content);
+
+ ///
+ /// List A/B experiments
+ /// Lists the managed live-traffic experiments configured for an endpoint.
+ ///
+ ///
+ /// Project identifier.
+ ///
+ ///
+ /// Endpoint identifier.
+ ///
+ ///
+ /// Maximum number of A/B experiments to return. Max 500, defaults to 50.
+ ///
+ ///
+ /// Cursor from a previous A/B experiment list response.
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task ABExperimentServiceListABExperimentsAsync(
+ string projectId,
+ string endpointId,
+ int? limit = default,
+ string? after = default,
+ global::Together.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await ABExperimentServiceListABExperimentsAsResponseAsync(
+ projectId: projectId,
+ endpointId: endpointId,
+ limit: limit,
+ after: after,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// List A/B experiments
+ /// Lists the managed live-traffic experiments configured for an endpoint.
+ ///
+ ///
+ /// Project identifier.
+ ///
+ ///
+ /// Endpoint identifier.
+ ///
+ ///
+ /// Maximum number of A/B experiments to return. Max 500, defaults to 50.
+ ///
+ ///
+ /// Cursor from a previous A/B experiment list response.
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> ABExperimentServiceListABExperimentsAsResponseAsync(
+ string projectId,
+ string endpointId,
+ int? limit = default,
+ string? after = default,
+ global::Together.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ PrepareArguments(
+ client: HttpClient);
+ PrepareABExperimentServiceListABExperimentsArguments(
+ httpClient: HttpClient,
+ projectId: ref projectId,
+ endpointId: ref endpointId,
+ limit: ref limit,
+ after: ref after);
+
+
+ var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations(
+ availableAuthorizations: Authorizations,
+ securityRequirements: s_ABExperimentServiceListABExperimentsSecurityRequirements,
+ operationName: "ABExperimentServiceListABExperimentsAsync");
+
+ using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken);
+ var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken;
+ var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ fallbackValue: ReadResponseAsString);
+ var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ supportsRetry: true);
+
+ global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
+ {
+
+ var __pathBuilder = new global::Together.PathBuilder(
+ path: $"/projects/{projectId}/endpoints/{endpointId}/abExperiments",
+ baseUri: ResolveBaseUri(
+ servers: s_ABExperimentServiceListABExperimentsServers,
+ defaultBaseUrl: "https://api.together.ai/v2"));
+ __pathBuilder
+ .AddOptionalParameter("limit", limit?.ToString())
+ .AddOptionalParameter("after", after)
+ ;
+ var __path = __pathBuilder.ToString();
+ __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters(
+ path: __path,
+ clientParameters: Options.QueryParameters,
+ requestParameters: requestOptions?.QueryParameters);
+ 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" ||
+ __authorization.Type == "OpenIdConnect")
+ {
+ __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);
+ }
+ }
+ global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders(
+ request: __httpRequest,
+ clientHeaders: Options.Headers,
+ requestHeaders: requestOptions?.Headers);
+
+ PrepareRequest(
+ client: HttpClient,
+ request: __httpRequest);
+ PrepareABExperimentServiceListABExperimentsRequest(
+ httpClient: HttpClient,
+ httpRequestMessage: __httpRequest,
+ projectId: projectId!,
+ endpointId: endpointId!,
+ limit: limit,
+ after: after);
+
+ return __httpRequest;
+ }
+
+ global::System.Net.Http.HttpRequestMessage? __httpRequest = null;
+ global::System.Net.Http.HttpResponseMessage? __response = null;
+ var __attemptNumber = 0;
+ try
+ {
+ for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++)
+ {
+ __attemptNumber = __attempt;
+ __httpRequest = __CreateHttpRequest();
+ await global::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "ABExperimentServiceListABExperiments",
+ methodName: "ABExperimentServiceListABExperimentsAsync",
+ pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/abExperiments\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ try
+ {
+ __response = await HttpClient.SendAsync(
+ request: __httpRequest,
+ completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ }
+ catch (global::System.Net.Http.HttpRequestException __exception)
+ {
+ var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
+ var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
+ await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "ABExperimentServiceListABExperiments",
+ methodName: "ABExperimentServiceListABExperimentsAsync",
+ pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/abExperiments\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: __exception,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ if (!__willRetry)
+ {
+ throw;
+ }
+
+ __httpRequest.Dispose();
+ __httpRequest = null;
+ await global::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ if (__response != null &&
+ __attempt < __maxAttempts &&
+ global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
+ {
+ var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
+ await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "ABExperimentServiceListABExperiments",
+ methodName: "ABExperimentServiceListABExperimentsAsync",
+ pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/abExperiments\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ break;
+ }
+
+ if (__response == null)
+ {
+ throw new global::System.InvalidOperationException("No response received.");
+ }
+
+ using (__response)
+ {
+
+ ProcessResponse(
+ client: HttpClient,
+ response: __response);
+ ProcessABExperimentServiceListABExperimentsResponse(
+ httpClient: HttpClient,
+ httpResponseMessage: __response);
+ if (__response.IsSuccessStatusCode)
+ {
+ await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "ABExperimentServiceListABExperiments",
+ methodName: "ABExperimentServiceListABExperimentsAsync",
+ pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/abExperiments\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ else
+ {
+ await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "ABExperimentServiceListABExperiments",
+ methodName: "ABExperimentServiceListABExperimentsAsync",
+ pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/abExperiments\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ // Default error response
+ if (!__response.IsSuccessStatusCode)
+ {
+ string? __content_default = null;
+ global::System.Exception? __exception_default = null;
+ global::Together.ErrorData? __value_default = null;
+ try
+ {
+ if (__effectiveReadResponseAsString)
+ {
+ __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+ __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext);
+ }
+ else
+ {
+ __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+
+ __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext);
+ }
+ }
+ catch (global::System.Exception __ex)
+ {
+ __exception_default = __ex;
+ }
+
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content_default ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __exception_default,
+ responseBody: __content_default,
+ responseObject: __value_default,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+
+ if (__effectiveReadResponseAsString)
+ {
+ var __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ ProcessResponseContent(
+ client: HttpClient,
+ response: __response,
+ content: ref __content);
+ ProcessABExperimentServiceListABExperimentsResponseContent(
+ httpClient: HttpClient,
+ httpResponseMessage: __response,
+ content: ref __content);
+
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+
+ var __value = global::Together.DeListABExperimentsResponse.FromJson(__content, JsonSerializerContext) ??
+ throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Together.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
+ }
+ catch (global::System.Exception __ex)
+ {
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ }
+ else
+ {
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+ using var __content = await __response.Content.ReadAsStreamAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ var __value = await global::Together.DeListABExperimentsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Together.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
+ }
+ catch (global::System.Exception __ex)
+ {
+ string? __content = null;
+ try
+ {
+ __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+ }
+ catch (global::System.Exception)
+ {
+ }
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ }
+
+ }
+ }
+ finally
+ {
+ __httpRequest?.Dispose();
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/libs/Together/Generated/Together.ABExperimentServiceClient.ABExperimentServiceUpdateABExperiment.g.cs b/src/libs/Together/Generated/Together.ABExperimentServiceClient.ABExperimentServiceUpdateABExperiment.g.cs
new file mode 100644
index 00000000..aec639af
--- /dev/null
+++ b/src/libs/Together/Generated/Together.ABExperimentServiceClient.ABExperimentServiceUpdateABExperiment.g.cs
@@ -0,0 +1,594 @@
+
+#nullable enable
+
+namespace Together
+{
+ public partial class ABExperimentServiceClient
+ {
+
+ private static readonly global::Together.AutoSDKServer[] s_ABExperimentServiceUpdateABExperimentServers = new global::Together.AutoSDKServer[]
+ { new global::Together.AutoSDKServer(
+ id: "https-api-together-ai-v2",
+ name: "api.together.ai v2",
+ url: "https://api.together.ai/v2",
+ description: ""),
+ };
+
+
+ private static readonly global::Together.EndPointSecurityRequirement s_ABExperimentServiceUpdateABExperimentSecurityRequirement0 =
+ new global::Together.EndPointSecurityRequirement
+ {
+ Authorizations = new global::Together.EndPointAuthorizationRequirement[]
+ { new global::Together.EndPointAuthorizationRequirement
+ {
+ Type = "Http",
+ SchemeId = "BearerAuth",
+ Location = "Header",
+ Name = "Bearer",
+ FriendlyName = "Bearer",
+ },
+ },
+ };
+ private static readonly global::Together.EndPointSecurityRequirement[] s_ABExperimentServiceUpdateABExperimentSecurityRequirements =
+ new global::Together.EndPointSecurityRequirement[]
+ { s_ABExperimentServiceUpdateABExperimentSecurityRequirement0,
+ };
+ partial void PrepareABExperimentServiceUpdateABExperimentArguments(
+ global::System.Net.Http.HttpClient httpClient,
+ ref string projectId,
+ ref string endpointId,
+ ref string id,
+ ref string? updateMask,
+ global::Together.DeUpdateABExperimentRequest request);
+ partial void PrepareABExperimentServiceUpdateABExperimentRequest(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpRequestMessage httpRequestMessage,
+ string projectId,
+ string endpointId,
+ string id,
+ string? updateMask,
+ global::Together.DeUpdateABExperimentRequest request);
+ partial void ProcessABExperimentServiceUpdateABExperimentResponse(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpResponseMessage httpResponseMessage);
+
+ partial void ProcessABExperimentServiceUpdateABExperimentResponseContent(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpResponseMessage httpResponseMessage,
+ ref string content);
+
+ ///
+ /// Update an A/B experiment
+ /// Updates an experiment's description or member traffic percentages. Use the experiment etag for optimistic concurrency.
+ ///
+ ///
+ /// Project identifier.
+ ///
+ ///
+ /// Endpoint identifier.
+ ///
+ ///
+ /// A/B experiment identifier.
+ ///
+ ///
+ /// Fields to update. If omitted, all mutable fields are overwritten.
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task ABExperimentServiceUpdateABExperimentAsync(
+ string projectId,
+ string endpointId,
+ string id,
+
+ global::Together.DeUpdateABExperimentRequest request,
+ string? updateMask = default,
+ global::Together.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await ABExperimentServiceUpdateABExperimentAsResponseAsync(
+ projectId: projectId,
+ endpointId: endpointId,
+ id: id,
+
+ request: request,
+ updateMask: updateMask,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Update an A/B experiment
+ /// Updates an experiment's description or member traffic percentages. Use the experiment etag for optimistic concurrency.
+ ///
+ ///
+ /// Project identifier.
+ ///
+ ///
+ /// Endpoint identifier.
+ ///
+ ///
+ /// A/B experiment identifier.
+ ///
+ ///
+ /// Fields to update. If omitted, all mutable fields are overwritten.
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> ABExperimentServiceUpdateABExperimentAsResponseAsync(
+ string projectId,
+ string endpointId,
+ string id,
+
+ global::Together.DeUpdateABExperimentRequest request,
+ string? updateMask = default,
+ global::Together.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ request = request ?? throw new global::System.ArgumentNullException(nameof(request));
+
+ PrepareArguments(
+ client: HttpClient);
+ PrepareABExperimentServiceUpdateABExperimentArguments(
+ httpClient: HttpClient,
+ projectId: ref projectId,
+ endpointId: ref endpointId,
+ id: ref id,
+ updateMask: ref updateMask,
+ request: request);
+
+
+ var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations(
+ availableAuthorizations: Authorizations,
+ securityRequirements: s_ABExperimentServiceUpdateABExperimentSecurityRequirements,
+ operationName: "ABExperimentServiceUpdateABExperimentAsync");
+
+ using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken);
+ var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken;
+ var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ fallbackValue: ReadResponseAsString);
+ var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ supportsRetry: true);
+
+ global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
+ {
+
+ var __pathBuilder = new global::Together.PathBuilder(
+ path: $"/projects/{projectId}/endpoints/{endpointId}/abExperiments/{id}",
+ baseUri: ResolveBaseUri(
+ servers: s_ABExperimentServiceUpdateABExperimentServers,
+ defaultBaseUrl: "https://api.together.ai/v2"));
+ __pathBuilder
+ .AddOptionalParameter("updateMask", updateMask)
+ ;
+ var __path = __pathBuilder.ToString();
+ __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters(
+ path: __path,
+ clientParameters: Options.QueryParameters,
+ requestParameters: requestOptions?.QueryParameters);
+ var __httpRequest = new global::System.Net.Http.HttpRequestMessage(
+ method: new global::System.Net.Http.HttpMethod("PATCH"),
+ 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" ||
+ __authorization.Type == "OpenIdConnect")
+ {
+ __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 = request.ToJson(JsonSerializerContext);
+ var __httpRequestContent = new global::System.Net.Http.StringContent(
+ content: __httpRequestContentBody,
+ encoding: global::System.Text.Encoding.UTF8,
+ mediaType: "application/json");
+ __httpRequest.Content = __httpRequestContent;
+ global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders(
+ request: __httpRequest,
+ clientHeaders: Options.Headers,
+ requestHeaders: requestOptions?.Headers);
+
+ PrepareRequest(
+ client: HttpClient,
+ request: __httpRequest);
+ PrepareABExperimentServiceUpdateABExperimentRequest(
+ httpClient: HttpClient,
+ httpRequestMessage: __httpRequest,
+ projectId: projectId!,
+ endpointId: endpointId!,
+ id: id!,
+ updateMask: updateMask,
+ request: request);
+
+ return __httpRequest;
+ }
+
+ global::System.Net.Http.HttpRequestMessage? __httpRequest = null;
+ global::System.Net.Http.HttpResponseMessage? __response = null;
+ var __attemptNumber = 0;
+ try
+ {
+ for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++)
+ {
+ __attemptNumber = __attempt;
+ __httpRequest = __CreateHttpRequest();
+ await global::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "ABExperimentServiceUpdateABExperiment",
+ methodName: "ABExperimentServiceUpdateABExperimentAsync",
+ pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/abExperiments/{id}\"",
+ httpMethod: "PATCH",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ try
+ {
+ __response = await HttpClient.SendAsync(
+ request: __httpRequest,
+ completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ }
+ catch (global::System.Net.Http.HttpRequestException __exception)
+ {
+ var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
+ var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
+ await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "ABExperimentServiceUpdateABExperiment",
+ methodName: "ABExperimentServiceUpdateABExperimentAsync",
+ pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/abExperiments/{id}\"",
+ httpMethod: "PATCH",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: __exception,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ if (!__willRetry)
+ {
+ throw;
+ }
+
+ __httpRequest.Dispose();
+ __httpRequest = null;
+ await global::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ if (__response != null &&
+ __attempt < __maxAttempts &&
+ global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
+ {
+ var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
+ await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "ABExperimentServiceUpdateABExperiment",
+ methodName: "ABExperimentServiceUpdateABExperimentAsync",
+ pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/abExperiments/{id}\"",
+ httpMethod: "PATCH",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ break;
+ }
+
+ if (__response == null)
+ {
+ throw new global::System.InvalidOperationException("No response received.");
+ }
+
+ using (__response)
+ {
+
+ ProcessResponse(
+ client: HttpClient,
+ response: __response);
+ ProcessABExperimentServiceUpdateABExperimentResponse(
+ httpClient: HttpClient,
+ httpResponseMessage: __response);
+ if (__response.IsSuccessStatusCode)
+ {
+ await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "ABExperimentServiceUpdateABExperiment",
+ methodName: "ABExperimentServiceUpdateABExperimentAsync",
+ pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/abExperiments/{id}\"",
+ httpMethod: "PATCH",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ else
+ {
+ await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "ABExperimentServiceUpdateABExperiment",
+ methodName: "ABExperimentServiceUpdateABExperimentAsync",
+ pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/abExperiments/{id}\"",
+ httpMethod: "PATCH",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ // Default error response
+ if (!__response.IsSuccessStatusCode)
+ {
+ string? __content_default = null;
+ global::System.Exception? __exception_default = null;
+ global::Together.ErrorData? __value_default = null;
+ try
+ {
+ if (__effectiveReadResponseAsString)
+ {
+ __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+ __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext);
+ }
+ else
+ {
+ __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+
+ __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext);
+ }
+ }
+ catch (global::System.Exception __ex)
+ {
+ __exception_default = __ex;
+ }
+
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content_default ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __exception_default,
+ responseBody: __content_default,
+ responseObject: __value_default,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+
+ if (__effectiveReadResponseAsString)
+ {
+ var __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ ProcessResponseContent(
+ client: HttpClient,
+ response: __response,
+ content: ref __content);
+ ProcessABExperimentServiceUpdateABExperimentResponseContent(
+ httpClient: HttpClient,
+ httpResponseMessage: __response,
+ content: ref __content);
+
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+
+ var __value = global::Together.DeABExperiment.FromJson(__content, JsonSerializerContext) ??
+ throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Together.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
+ }
+ catch (global::System.Exception __ex)
+ {
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ }
+ else
+ {
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+ using var __content = await __response.Content.ReadAsStreamAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ var __value = await global::Together.DeABExperiment.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Together.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
+ }
+ catch (global::System.Exception __ex)
+ {
+ string? __content = null;
+ try
+ {
+ __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+ }
+ catch (global::System.Exception)
+ {
+ }
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ }
+
+ }
+ }
+ finally
+ {
+ __httpRequest?.Dispose();
+ }
+ }
+ ///
+ /// Update an A/B experiment
+ /// Updates an experiment's description or member traffic percentages. Use the experiment etag for optimistic concurrency.
+ ///
+ ///
+ /// Project identifier.
+ ///
+ ///
+ /// Endpoint identifier.
+ ///
+ ///
+ /// A/B experiment identifier.
+ ///
+ ///
+ /// Fields to update. If omitted, all mutable fields are overwritten.
+ ///
+ ///
+ /// Updated free-form description.
+ ///
+ ///
+ /// Complete replacement member set. Requires two to 20 deployments, exactly one control, and percentages that add up to 100.
+ ///
+ ///
+ /// Opaque version tag from a prior read for optimistic concurrency.
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task ABExperimentServiceUpdateABExperimentAsync(
+ string projectId,
+ string endpointId,
+ string id,
+ string? updateMask = default,
+ string? description = default,
+ global::System.Collections.Generic.IList? members = default,
+ string? etag = default,
+ global::Together.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __request = new global::Together.DeUpdateABExperimentRequest
+ {
+ Description = description,
+ Members = members,
+ Etag = etag,
+ };
+
+ return await ABExperimentServiceUpdateABExperimentAsync(
+ projectId: projectId,
+ endpointId: endpointId,
+ id: id,
+ updateMask: updateMask,
+ request: __request,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/libs/Together/Generated/Together.ABExperimentServiceClient.g.cs b/src/libs/Together/Generated/Together.ABExperimentServiceClient.g.cs
new file mode 100644
index 00000000..e29ae775
--- /dev/null
+++ b/src/libs/Together/Generated/Together.ABExperimentServiceClient.g.cs
@@ -0,0 +1,175 @@
+
+#nullable enable
+
+namespace Together
+{
+ ///
+ /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used.
+ ///
+ public sealed partial class ABExperimentServiceClient : global::Together.IABExperimentServiceClient, global::System.IDisposable
+ {
+ ///
+ ///
+ ///
+ public const string DefaultBaseUrl = "https://api.together.ai/v2";
+
+ private bool _disposeHttpClient = true;
+
+ ///
+ public global::System.Net.Http.HttpClient HttpClient { get; }
+
+ ///
+ public System.Uri? BaseUri => HttpClient.BaseAddress;
+
+ ///
+ public global::System.Collections.Generic.List Authorizations { get; }
+
+ ///
+ public bool ReadResponseAsString { get; set; }
+#if DEBUG
+ = true;
+#endif
+
+ ///
+ public global::Together.AutoSDKClientOptions Options { get; }
+
+
+ internal global::Together.AutoSDKServerConfiguration AutoSDKServerConfiguration { get; set; } = new global::Together.AutoSDKServerConfiguration();
+ ///
+ ///
+ ///
+ public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::Together.SourceGenerationContext.Default;
+
+
+ ///
+ /// Creates a new instance of the ABExperimentServiceClient.
+ /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used.
+ ///
+ /// The HttpClient instance. If not provided, a new one will be created.
+ /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used.
+ /// The authorizations to use for the requests.
+ /// Dispose the HttpClient when the instance is disposed. True by default.
+ public ABExperimentServiceClient(
+ global::System.Net.Http.HttpClient? httpClient = null,
+ global::System.Uri? baseUri = null,
+ global::System.Collections.Generic.List? authorizations = null,
+ bool disposeHttpClient = true) : this(
+ httpClient,
+ baseUri,
+ authorizations,
+ options: null,
+ disposeHttpClient: disposeHttpClient)
+ {
+ }
+
+ ///
+ /// Creates a new instance of the ABExperimentServiceClient with explicit options but no base URL override.
+ /// Skips passing baseUri so the default base URL from the OpenAPI spec applies.
+ ///
+ /// The HttpClient instance. If not provided, a new one will be created.
+ /// The authorizations to use for the requests.
+ /// Client-wide request defaults such as headers, query parameters, retries, and timeout.
+ /// Dispose the HttpClient when the instance is disposed. True by default.
+ public ABExperimentServiceClient(
+ global::System.Net.Http.HttpClient? httpClient,
+ global::System.Collections.Generic.List? authorizations,
+ global::Together.AutoSDKClientOptions? options,
+ bool disposeHttpClient = true) : this(
+ httpClient,
+ baseUri: null,
+ authorizations,
+ options,
+ disposeHttpClient: disposeHttpClient)
+ {
+ }
+
+ ///
+ /// Creates a new instance of the ABExperimentServiceClient.
+ /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used.
+ ///
+ /// The HttpClient instance. If not provided, a new one will be created.
+ /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used.
+ /// The authorizations to use for the requests.
+ /// Client-wide request defaults such as headers, query parameters, retries, and timeout.
+ /// Dispose the HttpClient when the instance is disposed. True by default.
+ public ABExperimentServiceClient(
+ global::System.Net.Http.HttpClient? httpClient,
+ global::System.Uri? baseUri,
+ global::System.Collections.Generic.List? authorizations,
+ global::Together.AutoSDKClientOptions? options,
+ bool disposeHttpClient = true)
+ {
+
+ HttpClient = httpClient ?? new global::System.Net.Http.HttpClient();
+ if (baseUri is not null)
+ {
+ HttpClient.BaseAddress ??= baseUri;
+ }
+ Authorizations = authorizations ?? new global::System.Collections.Generic.List();
+ Options = options ?? new global::Together.AutoSDKClientOptions();
+ _disposeHttpClient = disposeHttpClient;
+
+ AutoSDKServerConfiguration.ExplicitBaseUri = baseUri ?? httpClient?.BaseAddress;
+
+ Initialized(HttpClient);
+ }
+
+ ///
+ public void Dispose()
+ {
+ if (_disposeHttpClient)
+ {
+ HttpClient.Dispose();
+ }
+ }
+
+ partial void Initialized(
+ global::System.Net.Http.HttpClient client);
+ partial void PrepareArguments(
+ global::System.Net.Http.HttpClient client);
+ partial void PrepareRequest(
+ global::System.Net.Http.HttpClient client,
+ global::System.Net.Http.HttpRequestMessage request);
+ partial void ProcessResponse(
+ global::System.Net.Http.HttpClient client,
+ global::System.Net.Http.HttpResponseMessage response);
+ partial void ProcessResponseContent(
+ global::System.Net.Http.HttpClient client,
+ global::System.Net.Http.HttpResponseMessage response,
+ ref string content);
+
+
+ private global::System.Uri? ResolveBaseUri(
+ global::Together.AutoSDKServer[] servers,
+ string defaultBaseUrl)
+ {
+ if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri)
+ {
+ return explicitBaseUri;
+ }
+
+ if (AutoSDKServerConfiguration.SelectedServer is global::Together.AutoSDKServer selectedServer)
+ {
+ foreach (var server in servers)
+ {
+ if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal))
+ {
+ return server.Uri;
+ }
+ }
+ }
+
+ if (servers.Length > 0)
+ {
+ return servers[0].Uri;
+ }
+
+ return string.IsNullOrWhiteSpace(defaultBaseUrl)
+ ? HttpClient.BaseAddress
+ : new global::System.Uri(defaultBaseUrl, global::System.UriKind.RelativeOrAbsolute);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/libs/Together/Generated/Together.AccountClient.Whoami.g.cs b/src/libs/Together/Generated/Together.AccountClient.Whoami.g.cs
new file mode 100644
index 00000000..8112efec
--- /dev/null
+++ b/src/libs/Together/Generated/Together.AccountClient.Whoami.g.cs
@@ -0,0 +1,520 @@
+
+#nullable enable
+
+namespace Together
+{
+ public partial class AccountClient
+ {
+
+ private static readonly global::Together.AutoSDKServer[] s_WhoamiServers = new global::Together.AutoSDKServer[]
+ { new global::Together.AutoSDKServer(
+ id: "https-api-together-ai-v1",
+ name: "Default environment for APIs",
+ url: "https://api.together.ai/v1",
+ description: "Default environment for APIs"),
+ new global::Together.AutoSDKServer(
+ id: "https-api-inference-together-ai-v2",
+ name: "Optimized environment for inference",
+ url: "https://api-inference.together.ai/v2",
+ description: "Optimized environment for inference"),
+ };
+
+
+ private static readonly global::Together.EndPointSecurityRequirement s_WhoamiSecurityRequirement0 =
+ new global::Together.EndPointSecurityRequirement
+ {
+ Authorizations = new global::Together.EndPointAuthorizationRequirement[]
+ { new global::Together.EndPointAuthorizationRequirement
+ {
+ Type = "Http",
+ SchemeId = "BearerAuth",
+ Location = "Header",
+ Name = "Bearer",
+ FriendlyName = "Bearer",
+ },
+ },
+ };
+ private static readonly global::Together.EndPointSecurityRequirement[] s_WhoamiSecurityRequirements =
+ new global::Together.EndPointSecurityRequirement[]
+ { s_WhoamiSecurityRequirement0,
+ };
+ partial void PrepareWhoamiArguments(
+ global::System.Net.Http.HttpClient httpClient);
+ partial void PrepareWhoamiRequest(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpRequestMessage httpRequestMessage);
+ partial void ProcessWhoamiResponse(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpResponseMessage httpResponseMessage);
+
+ partial void ProcessWhoamiResponseContent(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpResponseMessage httpResponseMessage,
+ ref string content);
+
+ ///
+ /// Get API key identity
+ /// Returns identity information about the authenticated API key. Useful for confirming which project and organization a key is scoped to, and for obtaining the project slug used to compose the `model` value (`<project_slug>/<endpoint_slug>`) in dedicated endpoint inference calls.
+ /// Requires a Bearer API key in the `Authorization` header. Cookie, session, and SLS JWT credentials are not accepted.
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ ///
+ /// from together import Together
+ /// client = Together()
+ /// identity = client.whoami()
+ /// print(identity)
+ ///
+ public async global::System.Threading.Tasks.Task WhoamiAsync(
+ global::Together.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await WhoamiAsResponseAsync(
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Get API key identity
+ /// Returns identity information about the authenticated API key. Useful for confirming which project and organization a key is scoped to, and for obtaining the project slug used to compose the `model` value (`<project_slug>/<endpoint_slug>`) in dedicated endpoint inference calls.
+ /// Requires a Bearer API key in the `Authorization` header. Cookie, session, and SLS JWT credentials are not accepted.
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ ///
+ /// from together import Together
+ /// client = Together()
+ /// identity = client.whoami()
+ /// print(identity)
+ ///
+ public async global::System.Threading.Tasks.Task> WhoamiAsResponseAsync(
+ global::Together.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ PrepareArguments(
+ client: HttpClient);
+ PrepareWhoamiArguments(
+ httpClient: HttpClient);
+
+
+ var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations(
+ availableAuthorizations: Authorizations,
+ securityRequirements: s_WhoamiSecurityRequirements,
+ operationName: "WhoamiAsync");
+
+ using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken);
+ var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken;
+ var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ fallbackValue: ReadResponseAsString);
+ var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ supportsRetry: true);
+
+ global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
+ {
+
+ var __pathBuilder = new global::Together.PathBuilder(
+ path: "/whoami",
+ baseUri: ResolveBaseUri(
+ servers: s_WhoamiServers,
+ defaultBaseUrl: "https://api.together.ai/v1"));
+ var __path = __pathBuilder.ToString();
+ __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters(
+ path: __path,
+ clientParameters: Options.QueryParameters,
+ requestParameters: requestOptions?.QueryParameters);
+ 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" ||
+ __authorization.Type == "OpenIdConnect")
+ {
+ __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);
+ }
+ }
+ global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders(
+ request: __httpRequest,
+ clientHeaders: Options.Headers,
+ requestHeaders: requestOptions?.Headers);
+
+ PrepareRequest(
+ client: HttpClient,
+ request: __httpRequest);
+ PrepareWhoamiRequest(
+ httpClient: HttpClient,
+ httpRequestMessage: __httpRequest);
+
+ return __httpRequest;
+ }
+
+ global::System.Net.Http.HttpRequestMessage? __httpRequest = null;
+ global::System.Net.Http.HttpResponseMessage? __response = null;
+ var __attemptNumber = 0;
+ try
+ {
+ for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++)
+ {
+ __attemptNumber = __attempt;
+ __httpRequest = __CreateHttpRequest();
+ await global::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "Whoami",
+ methodName: "WhoamiAsync",
+ pathTemplate: "\"/whoami\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ try
+ {
+ __response = await HttpClient.SendAsync(
+ request: __httpRequest,
+ completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ }
+ catch (global::System.Net.Http.HttpRequestException __exception)
+ {
+ var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
+ var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
+ await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "Whoami",
+ methodName: "WhoamiAsync",
+ pathTemplate: "\"/whoami\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: __exception,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ if (!__willRetry)
+ {
+ throw;
+ }
+
+ __httpRequest.Dispose();
+ __httpRequest = null;
+ await global::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ if (__response != null &&
+ __attempt < __maxAttempts &&
+ global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
+ {
+ var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
+ await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "Whoami",
+ methodName: "WhoamiAsync",
+ pathTemplate: "\"/whoami\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ break;
+ }
+
+ if (__response == null)
+ {
+ throw new global::System.InvalidOperationException("No response received.");
+ }
+
+ using (__response)
+ {
+
+ ProcessResponse(
+ client: HttpClient,
+ response: __response);
+ ProcessWhoamiResponse(
+ httpClient: HttpClient,
+ httpResponseMessage: __response);
+ if (__response.IsSuccessStatusCode)
+ {
+ await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "Whoami",
+ methodName: "WhoamiAsync",
+ pathTemplate: "\"/whoami\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ else
+ {
+ await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "Whoami",
+ methodName: "WhoamiAsync",
+ pathTemplate: "\"/whoami\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ // Unauthorized — missing or invalid API key
+ if ((int)__response.StatusCode == 401)
+ {
+ string? __content_401 = null;
+ global::System.Exception? __exception_401 = null;
+ global::Together.ErrorData? __value_401 = null;
+ try
+ {
+ if (__effectiveReadResponseAsString)
+ {
+ __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+ __value_401 = global::Together.ErrorData.FromJson(__content_401, JsonSerializerContext);
+ }
+ else
+ {
+ __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+
+ __value_401 = global::Together.ErrorData.FromJson(__content_401, JsonSerializerContext);
+ }
+ }
+ catch (global::System.Exception __ex)
+ {
+ __exception_401 = __ex;
+ }
+
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content_401 ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __exception_401,
+ responseBody: __content_401,
+ responseObject: __value_401,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ // Internal server error
+ if ((int)__response.StatusCode == 500)
+ {
+ string? __content_500 = null;
+ global::System.Exception? __exception_500 = null;
+ global::Together.ErrorData? __value_500 = null;
+ try
+ {
+ if (__effectiveReadResponseAsString)
+ {
+ __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+ __value_500 = global::Together.ErrorData.FromJson(__content_500, JsonSerializerContext);
+ }
+ else
+ {
+ __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+
+ __value_500 = global::Together.ErrorData.FromJson(__content_500, JsonSerializerContext);
+ }
+ }
+ catch (global::System.Exception __ex)
+ {
+ __exception_500 = __ex;
+ }
+
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content_500 ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __exception_500,
+ responseBody: __content_500,
+ responseObject: __value_500,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+
+ if (__effectiveReadResponseAsString)
+ {
+ var __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ ProcessResponseContent(
+ client: HttpClient,
+ response: __response,
+ content: ref __content);
+ ProcessWhoamiResponseContent(
+ httpClient: HttpClient,
+ httpResponseMessage: __response,
+ content: ref __content);
+
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+
+ var __value = global::Together.WhoamiResponse.FromJson(__content, JsonSerializerContext) ??
+ throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Together.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
+ }
+ catch (global::System.Exception __ex)
+ {
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ }
+ else
+ {
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+ using var __content = await __response.Content.ReadAsStreamAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ var __value = await global::Together.WhoamiResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Together.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
+ }
+ catch (global::System.Exception __ex)
+ {
+ string? __content = null;
+ try
+ {
+ __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+ }
+ catch (global::System.Exception)
+ {
+ }
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ }
+
+ }
+ }
+ finally
+ {
+ __httpRequest?.Dispose();
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/libs/Together/Generated/Together.AccountClient.g.cs b/src/libs/Together/Generated/Together.AccountClient.g.cs
new file mode 100644
index 00000000..151fc44e
--- /dev/null
+++ b/src/libs/Together/Generated/Together.AccountClient.g.cs
@@ -0,0 +1,284 @@
+
+#nullable enable
+
+namespace Together
+{
+ ///
+ /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used.
+ ///
+ public sealed partial class AccountClient : global::Together.IAccountClient, global::System.IDisposable
+ {
+ ///
+ /// Default environment for APIs
+ ///
+ public const string DefaultBaseUrl = "https://api.together.ai/v1";
+
+ private bool _disposeHttpClient = true;
+
+ ///
+ public global::System.Net.Http.HttpClient HttpClient { get; }
+
+ ///
+ public System.Uri? BaseUri => ResolveDisplayedBaseUri();
+
+ ///
+ public global::System.Collections.Generic.List Authorizations { get; }
+
+ ///
+ public bool ReadResponseAsString { get; set; }
+#if DEBUG
+ = true;
+#endif
+
+ ///
+ public global::Together.AutoSDKClientOptions Options { get; }
+
+
+ internal global::Together.AutoSDKServerConfiguration AutoSDKServerConfiguration { get; set; } = new global::Together.AutoSDKServerConfiguration();
+ ///
+ ///
+ ///
+ public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::Together.SourceGenerationContext.Default;
+
+
+
+ private static readonly global::Together.AutoSDKServer[] s_availableServers = new global::Together.AutoSDKServer[]
+ { new global::Together.AutoSDKServer(
+ id: "https-api-together-ai-v1",
+ name: "Default environment for APIs",
+ url: "https://api.together.ai/v1",
+ description: "Default environment for APIs"),
+ new global::Together.AutoSDKServer(
+ id: "https-api-inference-together-ai-v2",
+ name: "Optimized environment for inference",
+ url: "https://api-inference.together.ai/v2",
+ description: "Optimized environment for inference"),
+ };
+
+ ///
+ /// The server options available for this client.
+ ///
+ public global::System.Collections.Generic.IReadOnlyList AvailableServers => s_availableServers;
+
+ ///
+ /// The currently selected server for this client, if any.
+ ///
+ public global::Together.AutoSDKServer? SelectedServer
+ {
+ get => ResolveSelectedServer();
+ set => SelectServer(value);
+ }
+
+ ///
+ /// Creates a new instance of the AccountClient.
+ /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used.
+ ///
+ /// The HttpClient instance. If not provided, a new one will be created.
+ /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used.
+ /// The authorizations to use for the requests.
+ /// Dispose the HttpClient when the instance is disposed. True by default.
+ public AccountClient(
+ global::System.Net.Http.HttpClient? httpClient = null,
+ global::System.Uri? baseUri = null,
+ global::System.Collections.Generic.List? authorizations = null,
+ bool disposeHttpClient = true) : this(
+ httpClient,
+ baseUri,
+ authorizations,
+ options: null,
+ disposeHttpClient: disposeHttpClient)
+ {
+ }
+
+ ///
+ /// Creates a new instance of the AccountClient with explicit options but no base URL override.
+ /// Skips passing baseUri so the default base URL from the OpenAPI spec applies.
+ ///
+ /// The HttpClient instance. If not provided, a new one will be created.
+ /// The authorizations to use for the requests.
+ /// Client-wide request defaults such as headers, query parameters, retries, and timeout.
+ /// Dispose the HttpClient when the instance is disposed. True by default.
+ public AccountClient(
+ global::System.Net.Http.HttpClient? httpClient,
+ global::System.Collections.Generic.List? authorizations,
+ global::Together.AutoSDKClientOptions? options,
+ bool disposeHttpClient = true) : this(
+ httpClient,
+ baseUri: null,
+ authorizations,
+ options,
+ disposeHttpClient: disposeHttpClient)
+ {
+ }
+
+ ///
+ /// Creates a new instance of the AccountClient.
+ /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used.
+ ///
+ /// The HttpClient instance. If not provided, a new one will be created.
+ /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used.
+ /// The authorizations to use for the requests.
+ /// Client-wide request defaults such as headers, query parameters, retries, and timeout.
+ /// Dispose the HttpClient when the instance is disposed. True by default.
+ public AccountClient(
+ global::System.Net.Http.HttpClient? httpClient,
+ global::System.Uri? baseUri,
+ global::System.Collections.Generic.List? authorizations,
+ global::Together.AutoSDKClientOptions? options,
+ bool disposeHttpClient = true)
+ {
+
+ HttpClient = httpClient ?? new global::System.Net.Http.HttpClient();
+ if (baseUri is not null)
+ {
+ HttpClient.BaseAddress ??= baseUri;
+ }
+ Authorizations = authorizations ?? new global::System.Collections.Generic.List();
+ Options = options ?? new global::Together.AutoSDKClientOptions();
+ _disposeHttpClient = disposeHttpClient;
+
+ AutoSDKServerConfiguration.ExplicitBaseUri = baseUri ?? httpClient?.BaseAddress;
+
+ Initialized(HttpClient);
+ }
+
+ ///
+ public void Dispose()
+ {
+ if (_disposeHttpClient)
+ {
+ HttpClient.Dispose();
+ }
+ }
+
+ partial void Initialized(
+ global::System.Net.Http.HttpClient client);
+ partial void PrepareArguments(
+ global::System.Net.Http.HttpClient client);
+ partial void PrepareRequest(
+ global::System.Net.Http.HttpClient client,
+ global::System.Net.Http.HttpRequestMessage request);
+ partial void ProcessResponse(
+ global::System.Net.Http.HttpClient client,
+ global::System.Net.Http.HttpResponseMessage response);
+ partial void ProcessResponseContent(
+ global::System.Net.Http.HttpClient client,
+ global::System.Net.Http.HttpResponseMessage response,
+ ref string content);
+
+
+ ///
+ /// Selects one of the generated server options by id.
+ ///
+ public bool TrySelectServer(string serverId)
+ {
+ if (string.IsNullOrWhiteSpace(serverId))
+ {
+ return false;
+ }
+
+ foreach (var server in s_availableServers)
+ {
+ if (string.Equals(server.Id, serverId, global::System.StringComparison.OrdinalIgnoreCase))
+ {
+ AutoSDKServerConfiguration.SelectedServer = server;
+ AutoSDKServerConfiguration.ExplicitBaseUri = null;
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ ///
+ /// Clears the currently selected server.
+ ///
+ public void ClearSelectedServer()
+ {
+ AutoSDKServerConfiguration.SelectedServer = null;
+ }
+
+ private global::Together.AutoSDKServer? ResolveSelectedServer()
+ {
+ var selectedServer = AutoSDKServerConfiguration.SelectedServer;
+ if (selectedServer is null)
+ {
+ return null;
+ }
+
+ foreach (var server in s_availableServers)
+ {
+ if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal))
+ {
+ return server;
+ }
+ }
+
+ return null;
+ }
+
+ private void SelectServer(global::Together.AutoSDKServer? server)
+ {
+ if (server is null)
+ {
+ AutoSDKServerConfiguration.SelectedServer = null;
+ return;
+ }
+
+ foreach (var candidate in s_availableServers)
+ {
+ if (string.Equals(candidate.Id, server.Id, global::System.StringComparison.Ordinal))
+ {
+ AutoSDKServerConfiguration.SelectedServer = candidate;
+ AutoSDKServerConfiguration.ExplicitBaseUri = null;
+ return;
+ }
+ }
+
+ throw new global::System.ArgumentException("The provided server is not available for this client.", nameof(server));
+ }
+
+ private global::System.Uri? ResolveDisplayedBaseUri()
+ {
+ if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri)
+ {
+ return explicitBaseUri;
+ }
+
+ return ResolveSelectedServer()?.Uri ?? (s_availableServers.Length > 0 ? s_availableServers[0].Uri : HttpClient.BaseAddress);
+ }
+
+ private global::System.Uri? ResolveBaseUri(
+ global::Together.AutoSDKServer[] servers,
+ string defaultBaseUrl)
+ {
+ if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri)
+ {
+ return explicitBaseUri;
+ }
+
+ if (AutoSDKServerConfiguration.SelectedServer is global::Together.AutoSDKServer selectedServer)
+ {
+ foreach (var server in servers)
+ {
+ if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal))
+ {
+ return server.Uri;
+ }
+ }
+ }
+
+ if (servers.Length > 0)
+ {
+ return servers[0].Uri;
+ }
+
+ return string.IsNullOrWhiteSpace(defaultBaseUrl)
+ ? HttpClient.BaseAddress
+ : new global::System.Uri(defaultBaseUrl, global::System.UriKind.RelativeOrAbsolute);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/libs/Together/Generated/Together.AllOf.2.Json.g.cs b/src/libs/Together/Generated/Together.AllOf.2.Json.g.cs
index 6748f0a6..a4d6c368 100644
--- a/src/libs/Together/Generated/Together.AllOf.2.Json.g.cs
+++ b/src/libs/Together/Generated/Together.AllOf.2.Json.g.cs
@@ -16,6 +16,14 @@ public string ToJson(
jsonSerializerContext);
}
+ ///
+ /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext.
+ ///
+ public string ToJson()
+ {
+ return ToJson(global::Together.SourceGenerationContext.Default);
+ }
+
///
/// Serializes the current instance to a JSON string using the provided JsonSerializerOptions.
///
@@ -26,6 +34,11 @@ public string ToJson(
public string ToJson(
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null)
{
+ if (jsonSerializerOptions is null)
+ {
+ return ToJson(global::Together.SourceGenerationContext.Default);
+ }
+
return global::System.Text.Json.JsonSerializer.Serialize(
this,
jsonSerializerOptions);
@@ -44,6 +57,17 @@ public string ToJson(
jsonSerializerContext) as global::Together.AllOf?;
}
+ ///
+ /// Deserializes a JSON string using the generated default JsonSerializerContext.
+ ///
+ public static global::Together.AllOf? FromJson(
+ string json)
+ {
+ return FromJson(
+ json,
+ global::Together.SourceGenerationContext.Default);
+ }
+
///
/// Deserializes a JSON string using the provided JsonSerializerOptions.
///
@@ -55,6 +79,13 @@ public string ToJson(
string json,
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null)
{
+ if (jsonSerializerOptions is null)
+ {
+ return FromJson(
+ json,
+ global::Together.SourceGenerationContext.Default);
+ }
+
return global::System.Text.Json.JsonSerializer.Deserialize>(
json,
jsonSerializerOptions);
@@ -73,6 +104,17 @@ public string ToJson(
jsonSerializerContext).ConfigureAwait(false)) as global::Together.AllOf?;
}
+ ///
+ /// Deserializes a JSON stream using the generated default JsonSerializerContext.
+ ///
+ public static global::System.Threading.Tasks.ValueTask?> FromJsonStreamAsync(
+ global::System.IO.Stream jsonStream)
+ {
+ return FromJsonStreamAsync(
+ jsonStream,
+ global::Together.SourceGenerationContext.Default);
+ }
+
///
/// Deserializes a JSON stream using the provided JsonSerializerOptions.
///
@@ -84,6 +126,13 @@ public string ToJson(
global::System.IO.Stream jsonStream,
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null)
{
+ if (jsonSerializerOptions is null)
+ {
+ return FromJsonStreamAsync(
+ jsonStream,
+ global::Together.SourceGenerationContext.Default);
+ }
+
return global::System.Text.Json.JsonSerializer.DeserializeAsync?>(
jsonStream,
jsonSerializerOptions);
diff --git a/src/libs/Together/Generated/Together.AnyOf.2.Json.g.cs b/src/libs/Together/Generated/Together.AnyOf.2.Json.g.cs
index ed4d6e64..24491b01 100644
--- a/src/libs/Together/Generated/Together.AnyOf.2.Json.g.cs
+++ b/src/libs/Together/Generated/Together.AnyOf.2.Json.g.cs
@@ -16,6 +16,14 @@ public string ToJson(
jsonSerializerContext);
}
+ ///
+ /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext.
+ ///
+ public string ToJson()
+ {
+ return ToJson(global::Together.SourceGenerationContext.Default);
+ }
+
///
/// Serializes the current instance to a JSON string using the provided JsonSerializerOptions.
///
@@ -26,6 +34,11 @@ public string ToJson(
public string ToJson(
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null)
{
+ if (jsonSerializerOptions is null)
+ {
+ return ToJson(global::Together.SourceGenerationContext.Default);
+ }
+
return global::System.Text.Json.JsonSerializer.Serialize(
this,
jsonSerializerOptions);
@@ -44,6 +57,17 @@ public string ToJson(
jsonSerializerContext) as global::Together.AnyOf?;
}
+ ///
+ /// Deserializes a JSON string using the generated default JsonSerializerContext.
+ ///
+ public static global::Together.AnyOf? FromJson(
+ string json)
+ {
+ return FromJson(
+ json,
+ global::Together.SourceGenerationContext.Default);
+ }
+
///
/// Deserializes a JSON string using the provided JsonSerializerOptions.
///
@@ -55,6 +79,13 @@ public string ToJson(
string json,
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null)
{
+ if (jsonSerializerOptions is null)
+ {
+ return FromJson(
+ json,
+ global::Together.SourceGenerationContext.Default);
+ }
+
return global::System.Text.Json.JsonSerializer.Deserialize>(
json,
jsonSerializerOptions);
@@ -73,6 +104,17 @@ public string ToJson(
jsonSerializerContext).ConfigureAwait(false)) as global::Together.AnyOf?;
}
+ ///
+ /// Deserializes a JSON stream using the generated default JsonSerializerContext.
+ ///
+ public static global::System.Threading.Tasks.ValueTask?> FromJsonStreamAsync(
+ global::System.IO.Stream jsonStream)
+ {
+ return FromJsonStreamAsync(
+ jsonStream,
+ global::Together.SourceGenerationContext.Default);
+ }
+
///
/// Deserializes a JSON stream using the provided JsonSerializerOptions.
///
@@ -84,6 +126,13 @@ public string ToJson(
global::System.IO.Stream jsonStream,
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null)
{
+ if (jsonSerializerOptions is null)
+ {
+ return FromJsonStreamAsync(
+ jsonStream,
+ global::Together.SourceGenerationContext.Default);
+ }
+
return global::System.Text.Json.JsonSerializer.DeserializeAsync?>(
jsonStream,
jsonSerializerOptions);
diff --git a/src/libs/Together/Generated/Together.AudioClient.AudioSpeech.g.cs b/src/libs/Together/Generated/Together.AudioClient.AudioSpeech.g.cs
index b245e32e..c3252c69 100644
--- a/src/libs/Together/Generated/Together.AudioClient.AudioSpeech.g.cs
+++ b/src/libs/Together/Generated/Together.AudioClient.AudioSpeech.g.cs
@@ -6,6 +6,19 @@ namespace Together
public partial class AudioClient
{
+ private static readonly global::Together.AutoSDKServer[] s_AudioSpeechServers = new global::Together.AutoSDKServer[]
+ { new global::Together.AutoSDKServer(
+ id: "https-api-together-ai-v1",
+ name: "Default environment for APIs",
+ url: "https://api.together.ai/v1",
+ description: "Default environment for APIs"),
+ new global::Together.AutoSDKServer(
+ id: "https-api-inference-together-ai-v2",
+ name: "Optimized environment for inference",
+ url: "https://api-inference.together.ai/v2",
+ description: "Optimized environment for inference"),
+ };
+
private static readonly global::Together.EndPointSecurityRequirement s_AudioSpeechSecurityRequirement0 =
new global::Together.EndPointSecurityRequirement
@@ -98,7 +111,9 @@ partial void ProcessAudioSpeechResponse(
var __pathBuilder = new global::Together.PathBuilder(
path: "/audio/speech",
- baseUri: HttpClient.BaseAddress);
+ baseUri: ResolveBaseUri(
+ servers: s_AudioSpeechServers,
+ defaultBaseUrl: "https://api.together.ai/v1"));
var __path = __pathBuilder.ToString();
__path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters(
path: __path,
@@ -344,17 +359,15 @@ partial void ProcessAudioSpeechResponse(
{
}
- throw new global::Together.ApiException(
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
using var __stream = await __response.Content.ReadAsStreamAsync(
@@ -373,16 +386,15 @@ partial void ProcessAudioSpeechResponse(
}
var __streamedResponse = global::Together.AudioSpeechStreamResponse.FromJson(__content, JsonSerializerContext) ??
- throw new global::Together.ApiException(
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: $"Response deserialization failed for \"{__content}\" ",
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ innerException: null,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
yield return __streamedResponse;
}
diff --git a/src/libs/Together/Generated/Together.AudioClient.AudioTranscriptions.g.cs b/src/libs/Together/Generated/Together.AudioClient.AudioTranscriptions.g.cs
index 4c1a3135..6d1ac466 100644
--- a/src/libs/Together/Generated/Together.AudioClient.AudioTranscriptions.g.cs
+++ b/src/libs/Together/Generated/Together.AudioClient.AudioTranscriptions.g.cs
@@ -6,6 +6,19 @@ namespace Together
public partial class AudioClient
{
+ private static readonly global::Together.AutoSDKServer[] s_AudioTranscriptionsServers = new global::Together.AutoSDKServer[]
+ { new global::Together.AutoSDKServer(
+ id: "https-api-together-ai-v1",
+ name: "Default environment for APIs",
+ url: "https://api.together.ai/v1",
+ description: "Default environment for APIs"),
+ new global::Together.AutoSDKServer(
+ id: "https-api-inference-together-ai-v2",
+ name: "Optimized environment for inference",
+ url: "https://api-inference.together.ai/v2",
+ description: "Optimized environment for inference"),
+ };
+
private static readonly global::Together.EndPointSecurityRequirement s_AudioTranscriptionsSecurityRequirement0 =
new global::Together.EndPointSecurityRequirement
@@ -137,7 +150,9 @@ partial void ProcessAudioTranscriptionsResponseContent(
var __pathBuilder = new global::Together.PathBuilder(
path: "/audio/transcriptions",
- baseUri: HttpClient.BaseAddress);
+ baseUri: ResolveBaseUri(
+ servers: s_AudioTranscriptionsServers,
+ defaultBaseUrl: "https://api.together.ai/v1"));
var __path = __pathBuilder.ToString();
__path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters(
path: __path,
@@ -438,7 +453,7 @@ partial void ProcessAudioTranscriptionsResponseContent(
retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
- // BadRequest
+ // BadRequest. Possible error codes include `audio_too_long` (audio duration exceeds the 4 hour cap), `file_too_large` (URL-fetched audio exceeds the 1 GB server-side cap), `unsupported_format` (codec or container could not be decoded), and `invalid_params` (request parameters failed validation).
if ((int)__response.StatusCode == 400)
{
string? __content_400 = null;
@@ -463,18 +478,17 @@ partial void ProcessAudioTranscriptionsResponseContent(
__exception_400 = __ex;
}
- throw new global::Together.ApiException(
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_400 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_400,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_400,
- ResponseObject = __value_400,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_400,
+ responseObject: __value_400,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Unauthorized
if ((int)__response.StatusCode == 401)
@@ -501,18 +515,54 @@ partial void ProcessAudioTranscriptionsResponseContent(
__exception_401 = __ex;
}
- throw new global::Together.ApiException(
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_401 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_401,
- statusCode: __response.StatusCode)
+ responseBody: __content_401,
+ responseObject: __value_401,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ // Payload Too Large. The request body exceeded the 500 MB edge limit. For larger payloads, host the file and submit an HTTPS URL via the `file` field (URL-fetched audio is capped at 1 GB server-side).
+ if ((int)__response.StatusCode == 413)
+ {
+ string? __content_413 = null;
+ global::System.Exception? __exception_413 = null;
+ string? __value_413 = null;
+ try
+ {
+ if (__effectiveReadResponseAsString)
+ {
+ __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+ __value_413 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_413, typeof(string), JsonSerializerContext);
+ }
+ else
+ {
+ __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+
+ __value_413 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_413, typeof(string), JsonSerializerContext);
+ }
+ }
+ catch (global::System.Exception __ex)
{
- ResponseBody = __content_401,
- ResponseObject = __value_401,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ __exception_413 = __ex;
+ }
+
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content_413 ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __exception_413,
+ responseBody: __content_413,
+ responseObject: __value_413,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// RateLimit
if ((int)__response.StatusCode == 429)
@@ -539,18 +589,17 @@ partial void ProcessAudioTranscriptionsResponseContent(
__exception_429 = __ex;
}
- throw new global::Together.ApiException(
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_429 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_429,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_429,
- ResponseObject = __value_429,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_429,
+ responseObject: __value_429,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
if (__effectiveReadResponseAsString)
@@ -584,17 +633,15 @@ partial void ProcessAudioTranscriptionsResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::Together.ApiException(
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
}
else
@@ -631,17 +678,15 @@ partial void ProcessAudioTranscriptionsResponseContent(
{
}
- throw new global::Together.ApiException(
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
}
@@ -657,7 +702,7 @@ partial void ProcessAudioTranscriptionsResponseContent(
/// Transcribes audio into text
///
///
- /// Audio file upload or public HTTP/HTTPS URL. Supported formats .wav, .mp3, .m4a, .webm, .flac, .ogg, .opus, .aac.
+ /// Audio file upload or public HTTP/HTTPS URL. Supported formats: .wav, .mp3, .m4a, .webm, .flac, .ogg, .opus, .aac. Maximum duration 4 hours; longer audio is rejected with `audio_too_long`. Binary uploads are additionally capped at 500 MB (HTTP 413); URL-fetched audio is capped at 1 GB.
///
///
/// Model to use for transcription
@@ -677,7 +722,7 @@ partial void ProcessAudioTranscriptionsResponseContent(
///
///
/// Sampling temperature between 0.0 and 1.0
- /// Default Value: 0
+ /// Default Value: 0.0
///
///
/// Controls level of timestamp detail in verbose_json. Only used when response_format is verbose_json. Can be a single granularity or an array to get multiple levels.
@@ -715,7 +760,7 @@ partial void ProcessAudioTranscriptionsResponseContent(
string? language = default,
string? prompt = default,
global::Together.AudioTranscriptionRequestResponseFormat? responseFormat = default,
- float? temperature = default,
+ double? temperature = default,
global::Together.OneOf>? timestampGranularities = default,
bool? diarize = default,
int? minSpeakers = default,
diff --git a/src/libs/Together/Generated/Together.AudioClient.AudioTranslations.g.cs b/src/libs/Together/Generated/Together.AudioClient.AudioTranslations.g.cs
index ece22f0e..6282739e 100644
--- a/src/libs/Together/Generated/Together.AudioClient.AudioTranslations.g.cs
+++ b/src/libs/Together/Generated/Together.AudioClient.AudioTranslations.g.cs
@@ -6,6 +6,19 @@ namespace Together
public partial class AudioClient
{
+ private static readonly global::Together.AutoSDKServer[] s_AudioTranslationsServers = new global::Together.AutoSDKServer[]
+ { new global::Together.AutoSDKServer(
+ id: "https-api-together-ai-v1",
+ name: "Default environment for APIs",
+ url: "https://api.together.ai/v1",
+ description: "Default environment for APIs"),
+ new global::Together.AutoSDKServer(
+ id: "https-api-inference-together-ai-v2",
+ name: "Optimized environment for inference",
+ url: "https://api-inference.together.ai/v2",
+ description: "Optimized environment for inference"),
+ };
+
private static readonly global::Together.EndPointSecurityRequirement s_AudioTranslationsSecurityRequirement0 =
new global::Together.EndPointSecurityRequirement
@@ -141,7 +154,9 @@ partial void ProcessAudioTranslationsResponseContent(
var __pathBuilder = new global::Together.PathBuilder(
path: "/audio/translations",
- baseUri: HttpClient.BaseAddress);
+ baseUri: ResolveBaseUri(
+ servers: s_AudioTranslationsServers,
+ defaultBaseUrl: "https://api.together.ai/v1"));
var __path = __pathBuilder.ToString();
__path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters(
path: __path,
@@ -418,7 +433,7 @@ partial void ProcessAudioTranslationsResponseContent(
retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
- // BadRequest
+ // BadRequest. Possible error codes include `audio_too_long` (audio duration exceeds the 4 hour cap), `file_too_large` (URL-fetched audio exceeds the 1 GB server-side cap), `unsupported_format` (codec or container could not be decoded), and `invalid_params` (request parameters failed validation).
if ((int)__response.StatusCode == 400)
{
string? __content_400 = null;
@@ -443,18 +458,17 @@ partial void ProcessAudioTranslationsResponseContent(
__exception_400 = __ex;
}
- throw new global::Together.ApiException(
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_400 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_400,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_400,
- ResponseObject = __value_400,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_400,
+ responseObject: __value_400,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Unauthorized
if ((int)__response.StatusCode == 401)
@@ -481,18 +495,54 @@ partial void ProcessAudioTranslationsResponseContent(
__exception_401 = __ex;
}
- throw new global::Together.ApiException(
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_401 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_401,
- statusCode: __response.StatusCode)
+ responseBody: __content_401,
+ responseObject: __value_401,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ // Payload Too Large. The request body exceeded the 500 MB edge limit. For larger payloads, host the file and submit an HTTPS URL via the `file` field (URL-fetched audio is capped at 1 GB server-side).
+ if ((int)__response.StatusCode == 413)
+ {
+ string? __content_413 = null;
+ global::System.Exception? __exception_413 = null;
+ string? __value_413 = null;
+ try
+ {
+ if (__effectiveReadResponseAsString)
+ {
+ __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+ __value_413 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_413, typeof(string), JsonSerializerContext);
+ }
+ else
+ {
+ __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+
+ __value_413 = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content_413, typeof(string), JsonSerializerContext);
+ }
+ }
+ catch (global::System.Exception __ex)
{
- ResponseBody = __content_401,
- ResponseObject = __value_401,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ __exception_413 = __ex;
+ }
+
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content_413 ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __exception_413,
+ responseBody: __content_413,
+ responseObject: __value_413,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// RateLimit
if ((int)__response.StatusCode == 429)
@@ -519,18 +569,17 @@ partial void ProcessAudioTranslationsResponseContent(
__exception_429 = __ex;
}
- throw new global::Together.ApiException(
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_429 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_429,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_429,
- ResponseObject = __value_429,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_429,
+ responseObject: __value_429,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
if (__effectiveReadResponseAsString)
@@ -564,17 +613,15 @@ partial void ProcessAudioTranslationsResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::Together.ApiException(
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
}
else
@@ -611,17 +658,15 @@ partial void ProcessAudioTranslationsResponseContent(
{
}
- throw new global::Together.ApiException(
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
}
@@ -637,7 +682,7 @@ partial void ProcessAudioTranslationsResponseContent(
/// Translates audio into English
///
///
- /// Audio file upload or public HTTP/HTTPS URL. Supported formats .wav, .mp3, .m4a, .webm, .flac, .ogg, .opus, .aac.
+ /// Audio file upload or public HTTP/HTTPS URL. Supported formats: .wav, .mp3, .m4a, .webm, .flac, .ogg, .opus, .aac. Maximum duration 4 hours; longer audio is rejected with `audio_too_long`. Binary uploads are additionally capped at 500 MB (HTTP 413); URL-fetched audio is capped at 1 GB.
///
///
/// Model to use for translation
@@ -657,7 +702,7 @@ partial void ProcessAudioTranslationsResponseContent(
///
///
/// Sampling temperature between 0.0 and 1.0
- /// Default Value: 0
+ /// Default Value: 0.0
///
///
/// Controls level of timestamp detail in verbose_json. Only used when response_format is verbose_json. Can be a single granularity or an array to get multiple levels.
@@ -673,7 +718,7 @@ partial void ProcessAudioTranslationsResponseContent(
string? language = default,
string? prompt = default,
global::Together.AudioTranslationRequestResponseFormat? responseFormat = default,
- float? temperature = default,
+ double? temperature = default,
global::Together.OneOf>? timestampGranularities = default,
global::Together.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
diff --git a/src/libs/Together/Generated/Together.AudioClient.RealtimeTranscription.g.cs b/src/libs/Together/Generated/Together.AudioClient.RealtimeTranscription.g.cs
index 136df8f3..88070e0f 100644
--- a/src/libs/Together/Generated/Together.AudioClient.RealtimeTranscription.g.cs
+++ b/src/libs/Together/Generated/Together.AudioClient.RealtimeTranscription.g.cs
@@ -6,6 +6,19 @@ namespace Together
public partial class AudioClient
{
+ private static readonly global::Together.AutoSDKServer[] s_RealtimeTranscriptionServers = new global::Together.AutoSDKServer[]
+ { new global::Together.AutoSDKServer(
+ id: "https-api-together-ai-v1",
+ name: "Default environment for APIs",
+ url: "https://api.together.ai/v1",
+ description: "Default environment for APIs"),
+ new global::Together.AutoSDKServer(
+ id: "https-api-inference-together-ai-v2",
+ name: "Optimized environment for inference",
+ url: "https://api-inference.together.ai/v2",
+ description: "Optimized environment for inference"),
+ };
+
private static readonly global::Together.EndPointSecurityRequirement s_RealtimeTranscriptionSecurityRequirement0 =
new global::Together.EndPointSecurityRequirement
@@ -91,7 +104,7 @@ partial void ProcessRealtimeTranscriptionResponse(
/// 2. **Session message** after connection: Send `transcription_session.updated` with a `turn_detection` object (see above)
/// To disable VAD at connection time, use `turn_detection=none` as a query parameter.
/// **VAD Parameters:**
- /// All parameters are optional. Omitted fields use their defaults.
+ /// All parameters are Omitted fields use their defaults.
/// | Parameter | Type | Default | Description |
/// |-----------|------|---------|-------------|
/// | `type` | string | `server_vad` | VAD mode. Use `server_vad` to enable, or set `turn_detection` to `null` to disable. |
@@ -284,7 +297,7 @@ await RealtimeTranscriptionAsResponseAsync(
/// 2. **Session message** after connection: Send `transcription_session.updated` with a `turn_detection` object (see above)
/// To disable VAD at connection time, use `turn_detection=none` as a query parameter.
/// **VAD Parameters:**
- /// All parameters are optional. Omitted fields use their defaults.
+ /// All parameters are Omitted fields use their defaults.
/// | Parameter | Type | Default | Description |
/// |-----------|------|---------|-------------|
/// | `type` | string | `server_vad` | VAD mode. Use `server_vad` to enable, or set `turn_detection` to `null` to disable. |
@@ -449,7 +462,9 @@ await RealtimeTranscriptionAsResponseAsync(
var __pathBuilder = new global::Together.PathBuilder(
path: "/realtime",
- baseUri: HttpClient.BaseAddress);
+ baseUri: ResolveBaseUri(
+ servers: s_RealtimeTranscriptionServers,
+ defaultBaseUrl: "https://api.together.ai/v1"));
__pathBuilder
.AddRequiredParameter("model", model)
.AddRequiredParameter("input_audio_format", inputAudioFormat.ToValueString())
@@ -695,17 +710,16 @@ await RealtimeTranscriptionAsResponseAsync(
__exception_101 = __ex;
}
- throw new global::Together.ApiException(
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_101 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_101,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_101,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_101,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
if (__effectiveReadResponseAsString)
@@ -732,17 +746,15 @@ await RealtimeTranscriptionAsResponseAsync(
}
catch (global::System.Exception __ex)
{
- throw new global::Together.ApiException(
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
}
else
@@ -770,17 +782,15 @@ await RealtimeTranscriptionAsResponseAsync(
{
}
- throw new global::Together.ApiException(
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
}
diff --git a/src/libs/Together/Generated/Together.AudioClient.RealtimeTts.g.cs b/src/libs/Together/Generated/Together.AudioClient.RealtimeTts.g.cs
index 0f229fe1..4f81a473 100644
--- a/src/libs/Together/Generated/Together.AudioClient.RealtimeTts.g.cs
+++ b/src/libs/Together/Generated/Together.AudioClient.RealtimeTts.g.cs
@@ -6,6 +6,19 @@ namespace Together
public partial class AudioClient
{
+ private static readonly global::Together.AutoSDKServer[] s_RealtimeTtsServers = new global::Together.AutoSDKServer[]
+ { new global::Together.AutoSDKServer(
+ id: "https-api-together-ai-v1",
+ name: "Default environment for APIs",
+ url: "https://api.together.ai/v1",
+ description: "Default environment for APIs"),
+ new global::Together.AutoSDKServer(
+ id: "https-api-inference-together-ai-v2",
+ name: "Optimized environment for inference",
+ url: "https://api-inference.together.ai/v2",
+ description: "Optimized environment for inference"),
+ };
+
private static readonly global::Together.EndPointSecurityRequirement s_RealtimeTtsSecurityRequirement0 =
new global::Together.EndPointSecurityRequirement
@@ -475,7 +488,9 @@ await RealtimeTtsAsResponseAsync(
var __pathBuilder = new global::Together.PathBuilder(
path: "/audio/speech/websocket",
- baseUri: HttpClient.BaseAddress);
+ baseUri: ResolveBaseUri(
+ servers: s_RealtimeTtsServers,
+ defaultBaseUrl: "https://api.together.ai/v1"));
__pathBuilder
.AddOptionalParameter("model", model?.ToValueString())
.AddOptionalParameter("voice", voice)
@@ -725,17 +740,16 @@ await RealtimeTtsAsResponseAsync(
__exception_101 = __ex;
}
- throw new global::Together.ApiException(
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_101 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_101,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_101,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_101,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
if (__effectiveReadResponseAsString)
@@ -762,17 +776,15 @@ await RealtimeTtsAsResponseAsync(
}
catch (global::System.Exception __ex)
{
- throw new global::Together.ApiException(
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
}
else
@@ -800,17 +812,15 @@ await RealtimeTtsAsResponseAsync(
{
}
- throw new global::Together.ApiException(
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
}
diff --git a/src/libs/Together/Generated/Together.AudioClient.g.cs b/src/libs/Together/Generated/Together.AudioClient.g.cs
index 57377267..9a387980 100644
--- a/src/libs/Together/Generated/Together.AudioClient.g.cs
+++ b/src/libs/Together/Generated/Together.AudioClient.g.cs
@@ -10,7 +10,7 @@ namespace Together
public sealed partial class AudioClient : global::Together.IAudioClient, global::System.IDisposable
{
///
- ///
+ /// Default environment for APIs
///
public const string DefaultBaseUrl = "https://api.together.ai/v1";
@@ -20,7 +20,7 @@ public sealed partial class AudioClient : global::Together.IAudioClient, global:
public global::System.Net.Http.HttpClient HttpClient { get; }
///
- public System.Uri? BaseUri => HttpClient.BaseAddress;
+ public System.Uri? BaseUri => ResolveDisplayedBaseUri();
///
public global::System.Collections.Generic.List Authorizations { get; }
@@ -42,6 +42,34 @@ public sealed partial class AudioClient : global::Together.IAudioClient, global:
public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::Together.SourceGenerationContext.Default;
+
+ private static readonly global::Together.AutoSDKServer[] s_availableServers = new global::Together.AutoSDKServer[]
+ { new global::Together.AutoSDKServer(
+ id: "https-api-together-ai-v1",
+ name: "Default environment for APIs",
+ url: "https://api.together.ai/v1",
+ description: "Default environment for APIs"),
+ new global::Together.AutoSDKServer(
+ id: "https-api-inference-together-ai-v2",
+ name: "Optimized environment for inference",
+ url: "https://api-inference.together.ai/v2",
+ description: "Optimized environment for inference"),
+ };
+
+ ///
+ /// The server options available for this client.
+ ///
+ public global::System.Collections.Generic.IReadOnlyList AvailableServers => s_availableServers;
+
+ ///
+ /// The currently selected server for this client, if any.
+ ///
+ public global::Together.AutoSDKServer? SelectedServer
+ {
+ get => ResolveSelectedServer();
+ set => SelectServer(value);
+ }
+
///
/// Creates a new instance of the AudioClient.
/// If no httpClient is provided, a new one will be created.
@@ -140,5 +168,117 @@ partial void ProcessResponseContent(
global::System.Net.Http.HttpClient client,
global::System.Net.Http.HttpResponseMessage response,
ref string content);
+
+
+ ///
+ /// Selects one of the generated server options by id.
+ ///
+ public bool TrySelectServer(string serverId)
+ {
+ if (string.IsNullOrWhiteSpace(serverId))
+ {
+ return false;
+ }
+
+ foreach (var server in s_availableServers)
+ {
+ if (string.Equals(server.Id, serverId, global::System.StringComparison.OrdinalIgnoreCase))
+ {
+ AutoSDKServerConfiguration.SelectedServer = server;
+ AutoSDKServerConfiguration.ExplicitBaseUri = null;
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ ///
+ /// Clears the currently selected server.
+ ///
+ public void ClearSelectedServer()
+ {
+ AutoSDKServerConfiguration.SelectedServer = null;
+ }
+
+ private global::Together.AutoSDKServer? ResolveSelectedServer()
+ {
+ var selectedServer = AutoSDKServerConfiguration.SelectedServer;
+ if (selectedServer is null)
+ {
+ return null;
+ }
+
+ foreach (var server in s_availableServers)
+ {
+ if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal))
+ {
+ return server;
+ }
+ }
+
+ return null;
+ }
+
+ private void SelectServer(global::Together.AutoSDKServer? server)
+ {
+ if (server is null)
+ {
+ AutoSDKServerConfiguration.SelectedServer = null;
+ return;
+ }
+
+ foreach (var candidate in s_availableServers)
+ {
+ if (string.Equals(candidate.Id, server.Id, global::System.StringComparison.Ordinal))
+ {
+ AutoSDKServerConfiguration.SelectedServer = candidate;
+ AutoSDKServerConfiguration.ExplicitBaseUri = null;
+ return;
+ }
+ }
+
+ throw new global::System.ArgumentException("The provided server is not available for this client.", nameof(server));
+ }
+
+ private global::System.Uri? ResolveDisplayedBaseUri()
+ {
+ if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri)
+ {
+ return explicitBaseUri;
+ }
+
+ return ResolveSelectedServer()?.Uri ?? (s_availableServers.Length > 0 ? s_availableServers[0].Uri : HttpClient.BaseAddress);
+ }
+
+ private global::System.Uri? ResolveBaseUri(
+ global::Together.AutoSDKServer[] servers,
+ string defaultBaseUrl)
+ {
+ if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri)
+ {
+ return explicitBaseUri;
+ }
+
+ if (AutoSDKServerConfiguration.SelectedServer is global::Together.AutoSDKServer selectedServer)
+ {
+ foreach (var server in servers)
+ {
+ if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal))
+ {
+ return server.Uri;
+ }
+ }
+ }
+
+ if (servers.Length > 0)
+ {
+ return servers[0].Uri;
+ }
+
+ return string.IsNullOrWhiteSpace(defaultBaseUrl)
+ ? HttpClient.BaseAddress
+ : new global::System.Uri(defaultBaseUrl, global::System.UriKind.RelativeOrAbsolute);
+ }
}
}
\ No newline at end of file
diff --git a/src/libs/Together/Generated/Together.BatchesClient.CreateBatches.g.cs b/src/libs/Together/Generated/Together.BatchesClient.CreateBatches.g.cs
index 2d999b02..1930a432 100644
--- a/src/libs/Together/Generated/Together.BatchesClient.CreateBatches.g.cs
+++ b/src/libs/Together/Generated/Together.BatchesClient.CreateBatches.g.cs
@@ -6,6 +6,19 @@ namespace Together
public partial class BatchesClient
{
+ private static readonly global::Together.AutoSDKServer[] s_CreateBatchesServers = new global::Together.AutoSDKServer[]
+ { new global::Together.AutoSDKServer(
+ id: "https-api-together-ai-v1",
+ name: "Default environment for APIs",
+ url: "https://api.together.ai/v1",
+ description: "Default environment for APIs"),
+ new global::Together.AutoSDKServer(
+ id: "https-api-inference-together-ai-v2",
+ name: "Optimized environment for inference",
+ url: "https://api-inference.together.ai/v2",
+ description: "Optimized environment for inference"),
+ };
+
private static readonly global::Together.EndPointSecurityRequirement s_CreateBatchesSecurityRequirement0 =
new global::Together.EndPointSecurityRequirement
@@ -131,7 +144,9 @@ partial void ProcessCreateBatchesResponseContent(
var __pathBuilder = new global::Together.PathBuilder(
path: "/batches",
- baseUri: HttpClient.BaseAddress);
+ baseUri: ResolveBaseUri(
+ servers: s_CreateBatchesServers,
+ defaultBaseUrl: "https://api.together.ai/v1"));
var __path = __pathBuilder.ToString();
__path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters(
path: __path,
@@ -382,18 +397,17 @@ partial void ProcessCreateBatchesResponseContent(
__exception_400 = __ex;
}
- throw new global::Together.ApiException(
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_400 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_400,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_400,
- ResponseObject = __value_400,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_400,
+ responseObject: __value_400,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Unauthorized
if ((int)__response.StatusCode == 401)
@@ -420,18 +434,17 @@ partial void ProcessCreateBatchesResponseContent(
__exception_401 = __ex;
}
- throw new global::Together.ApiException(
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_401 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_401,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_401,
- ResponseObject = __value_401,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_401,
+ responseObject: __value_401,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Too Many Requests
if ((int)__response.StatusCode == 429)
@@ -458,18 +471,17 @@ partial void ProcessCreateBatchesResponseContent(
__exception_429 = __ex;
}
- throw new global::Together.ApiException(
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_429 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_429,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_429,
- ResponseObject = __value_429,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_429,
+ responseObject: __value_429,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Internal Server Error
if ((int)__response.StatusCode == 500)
@@ -496,18 +508,17 @@ partial void ProcessCreateBatchesResponseContent(
__exception_500 = __ex;
}
- throw new global::Together.ApiException(
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_500 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_500,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_500,
- ResponseObject = __value_500,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_500,
+ responseObject: __value_500,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
if (__effectiveReadResponseAsString)
@@ -541,17 +552,15 @@ partial void ProcessCreateBatchesResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::Together.ApiException(
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
}
else
@@ -588,17 +597,15 @@ partial void ProcessCreateBatchesResponseContent(
{
}
- throw new global::Together.ApiException(
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
}
diff --git a/src/libs/Together/Generated/Together.BatchesClient.CreateBatchesByIdCancel.g.cs b/src/libs/Together/Generated/Together.BatchesClient.CreateBatchesByIdCancel.g.cs
index 89f73a2a..316d0732 100644
--- a/src/libs/Together/Generated/Together.BatchesClient.CreateBatchesByIdCancel.g.cs
+++ b/src/libs/Together/Generated/Together.BatchesClient.CreateBatchesByIdCancel.g.cs
@@ -6,6 +6,19 @@ namespace Together
public partial class BatchesClient
{
+ private static readonly global::Together.AutoSDKServer[] s_CreateBatchesByIdCancelServers = new global::Together.AutoSDKServer[]
+ { new global::Together.AutoSDKServer(
+ id: "https-api-together-ai-v1",
+ name: "Default environment for APIs",
+ url: "https://api.together.ai/v1",
+ description: "Default environment for APIs"),
+ new global::Together.AutoSDKServer(
+ id: "https-api-inference-together-ai-v2",
+ name: "Optimized environment for inference",
+ url: "https://api-inference.together.ai/v2",
+ description: "Optimized environment for inference"),
+ };
+
private static readonly global::Together.EndPointSecurityRequirement s_CreateBatchesByIdCancelSecurityRequirement0 =
new global::Together.EndPointSecurityRequirement
@@ -132,7 +145,9 @@ partial void ProcessCreateBatchesByIdCancelResponseContent(
var __pathBuilder = new global::Together.PathBuilder(
path: $"/batches/{id}/cancel",
- baseUri: HttpClient.BaseAddress);
+ baseUri: ResolveBaseUri(
+ servers: s_CreateBatchesByIdCancelServers,
+ defaultBaseUrl: "https://api.together.ai/v1"));
var __path = __pathBuilder.ToString();
__path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters(
path: __path,
@@ -377,18 +392,17 @@ partial void ProcessCreateBatchesByIdCancelResponseContent(
__exception_400 = __ex;
}
- throw new global::Together.ApiException(
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_400 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_400,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_400,
- ResponseObject = __value_400,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_400,
+ responseObject: __value_400,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Unauthorized
if ((int)__response.StatusCode == 401)
@@ -415,18 +429,17 @@ partial void ProcessCreateBatchesByIdCancelResponseContent(
__exception_401 = __ex;
}
- throw new global::Together.ApiException(
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_401 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_401,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_401,
- ResponseObject = __value_401,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_401,
+ responseObject: __value_401,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Forbidden
if ((int)__response.StatusCode == 403)
@@ -453,18 +466,17 @@ partial void ProcessCreateBatchesByIdCancelResponseContent(
__exception_403 = __ex;
}
- throw new global::Together.ApiException(
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_403 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_403,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_403,
- ResponseObject = __value_403,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_403,
+ responseObject: __value_403,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Not Found
if ((int)__response.StatusCode == 404)
@@ -491,18 +503,17 @@ partial void ProcessCreateBatchesByIdCancelResponseContent(
__exception_404 = __ex;
}
- throw new global::Together.ApiException(
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_404 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_404,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_404,
- ResponseObject = __value_404,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_404,
+ responseObject: __value_404,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Internal Server Error
if ((int)__response.StatusCode == 500)
@@ -529,18 +540,17 @@ partial void ProcessCreateBatchesByIdCancelResponseContent(
__exception_500 = __ex;
}
- throw new global::Together.ApiException(
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_500 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_500,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_500,
- ResponseObject = __value_500,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_500,
+ responseObject: __value_500,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
if (__effectiveReadResponseAsString)
@@ -574,17 +584,15 @@ partial void ProcessCreateBatchesByIdCancelResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::Together.ApiException(
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
}
else
@@ -621,17 +629,15 @@ partial void ProcessCreateBatchesByIdCancelResponseContent(
{
}
- throw new global::Together.ApiException(
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
}
diff --git a/src/libs/Together/Generated/Together.BatchesClient.GetBatches.g.cs b/src/libs/Together/Generated/Together.BatchesClient.GetBatches.g.cs
index 20809fff..a96f2bb2 100644
--- a/src/libs/Together/Generated/Together.BatchesClient.GetBatches.g.cs
+++ b/src/libs/Together/Generated/Together.BatchesClient.GetBatches.g.cs
@@ -6,6 +6,19 @@ namespace Together
public partial class BatchesClient
{
+ private static readonly global::Together.AutoSDKServer[] s_GetBatchesServers = new global::Together.AutoSDKServer[]
+ { new global::Together.AutoSDKServer(
+ id: "https-api-together-ai-v1",
+ name: "Default environment for APIs",
+ url: "https://api.together.ai/v1",
+ description: "Default environment for APIs"),
+ new global::Together.AutoSDKServer(
+ id: "https-api-inference-together-ai-v2",
+ name: "Optimized environment for inference",
+ url: "https://api-inference.together.ai/v2",
+ description: "Optimized environment for inference"),
+ };
+
private static readonly global::Together.EndPointSecurityRequirement s_GetBatchesSecurityRequirement0 =
new global::Together.EndPointSecurityRequirement
@@ -120,7 +133,9 @@ partial void ProcessGetBatchesResponseContent(
var __pathBuilder = new global::Together.PathBuilder(
path: "/batches",
- baseUri: HttpClient.BaseAddress);
+ baseUri: ResolveBaseUri(
+ servers: s_GetBatchesServers,
+ defaultBaseUrl: "https://api.together.ai/v1"));
var __path = __pathBuilder.ToString();
__path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters(
path: __path,
@@ -364,18 +379,17 @@ partial void ProcessGetBatchesResponseContent(
__exception_401 = __ex;
}
- throw new global::Together.ApiException(
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_401 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_401,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_401,
- ResponseObject = __value_401,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_401,
+ responseObject: __value_401,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Internal Server Error
if ((int)__response.StatusCode == 500)
@@ -402,18 +416,17 @@ partial void ProcessGetBatchesResponseContent(
__exception_500 = __ex;
}
- throw new global::Together.ApiException(
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_500 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_500,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_500,
- ResponseObject = __value_500,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_500,
+ responseObject: __value_500,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
if (__effectiveReadResponseAsString)
@@ -447,17 +460,15 @@ partial void ProcessGetBatchesResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::Together.ApiException(
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
}
else
@@ -494,17 +505,15 @@ partial void ProcessGetBatchesResponseContent(
{
}
- throw new global::Together.ApiException(
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
}
diff --git a/src/libs/Together/Generated/Together.BatchesClient.GetBatchesById.g.cs b/src/libs/Together/Generated/Together.BatchesClient.GetBatchesById.g.cs
index e40ec7d7..2322f486 100644
--- a/src/libs/Together/Generated/Together.BatchesClient.GetBatchesById.g.cs
+++ b/src/libs/Together/Generated/Together.BatchesClient.GetBatchesById.g.cs
@@ -6,6 +6,19 @@ namespace Together
public partial class BatchesClient
{
+ private static readonly global::Together.AutoSDKServer[] s_GetBatchesByIdServers = new global::Together.AutoSDKServer[]
+ { new global::Together.AutoSDKServer(
+ id: "https-api-together-ai-v1",
+ name: "Default environment for APIs",
+ url: "https://api.together.ai/v1",
+ description: "Default environment for APIs"),
+ new global::Together.AutoSDKServer(
+ id: "https-api-inference-together-ai-v2",
+ name: "Optimized environment for inference",
+ url: "https://api-inference.together.ai/v2",
+ description: "Optimized environment for inference"),
+ };
+
private static readonly global::Together.EndPointSecurityRequirement s_GetBatchesByIdSecurityRequirement0 =
new global::Together.EndPointSecurityRequirement
@@ -132,7 +145,9 @@ partial void ProcessGetBatchesByIdResponseContent(
var __pathBuilder = new global::Together.PathBuilder(
path: $"/batches/{id}",
- baseUri: HttpClient.BaseAddress);
+ baseUri: ResolveBaseUri(
+ servers: s_GetBatchesByIdServers,
+ defaultBaseUrl: "https://api.together.ai/v1"));
var __path = __pathBuilder.ToString();
__path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters(
path: __path,
@@ -377,18 +392,17 @@ partial void ProcessGetBatchesByIdResponseContent(
__exception_400 = __ex;
}
- throw new global::Together.ApiException(
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_400 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_400,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_400,
- ResponseObject = __value_400,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_400,
+ responseObject: __value_400,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Unauthorized
if ((int)__response.StatusCode == 401)
@@ -415,18 +429,17 @@ partial void ProcessGetBatchesByIdResponseContent(
__exception_401 = __ex;
}
- throw new global::Together.ApiException(
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_401 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_401,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_401,
- ResponseObject = __value_401,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_401,
+ responseObject: __value_401,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Forbidden
if ((int)__response.StatusCode == 403)
@@ -453,18 +466,17 @@ partial void ProcessGetBatchesByIdResponseContent(
__exception_403 = __ex;
}
- throw new global::Together.ApiException(
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_403 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_403,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_403,
- ResponseObject = __value_403,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_403,
+ responseObject: __value_403,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Not Found
if ((int)__response.StatusCode == 404)
@@ -491,18 +503,17 @@ partial void ProcessGetBatchesByIdResponseContent(
__exception_404 = __ex;
}
- throw new global::Together.ApiException(
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_404 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_404,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_404,
- ResponseObject = __value_404,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_404,
+ responseObject: __value_404,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Internal Server Error
if ((int)__response.StatusCode == 500)
@@ -529,18 +540,17 @@ partial void ProcessGetBatchesByIdResponseContent(
__exception_500 = __ex;
}
- throw new global::Together.ApiException(
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_500 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_500,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_500,
- ResponseObject = __value_500,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_500,
+ responseObject: __value_500,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
if (__effectiveReadResponseAsString)
@@ -574,17 +584,15 @@ partial void ProcessGetBatchesByIdResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::Together.ApiException(
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
}
else
@@ -621,17 +629,15 @@ partial void ProcessGetBatchesByIdResponseContent(
{
}
- throw new global::Together.ApiException(
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
}
diff --git a/src/libs/Together/Generated/Together.BatchesClient.g.cs b/src/libs/Together/Generated/Together.BatchesClient.g.cs
index 6e71aeb8..689ab127 100644
--- a/src/libs/Together/Generated/Together.BatchesClient.g.cs
+++ b/src/libs/Together/Generated/Together.BatchesClient.g.cs
@@ -10,7 +10,7 @@ namespace Together
public sealed partial class BatchesClient : global::Together.IBatchesClient, global::System.IDisposable
{
///
- ///
+ /// Default environment for APIs
///
public const string DefaultBaseUrl = "https://api.together.ai/v1";
@@ -20,7 +20,7 @@ public sealed partial class BatchesClient : global::Together.IBatchesClient, glo
public global::System.Net.Http.HttpClient HttpClient { get; }
///
- public System.Uri? BaseUri => HttpClient.BaseAddress;
+ public System.Uri? BaseUri => ResolveDisplayedBaseUri();
///
public global::System.Collections.Generic.List Authorizations { get; }
@@ -42,6 +42,34 @@ public sealed partial class BatchesClient : global::Together.IBatchesClient, glo
public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::Together.SourceGenerationContext.Default;
+
+ private static readonly global::Together.AutoSDKServer[] s_availableServers = new global::Together.AutoSDKServer[]
+ { new global::Together.AutoSDKServer(
+ id: "https-api-together-ai-v1",
+ name: "Default environment for APIs",
+ url: "https://api.together.ai/v1",
+ description: "Default environment for APIs"),
+ new global::Together.AutoSDKServer(
+ id: "https-api-inference-together-ai-v2",
+ name: "Optimized environment for inference",
+ url: "https://api-inference.together.ai/v2",
+ description: "Optimized environment for inference"),
+ };
+
+ ///
+ /// The server options available for this client.
+ ///
+ public global::System.Collections.Generic.IReadOnlyList AvailableServers => s_availableServers;
+
+ ///
+ /// The currently selected server for this client, if any.
+ ///
+ public global::Together.AutoSDKServer? SelectedServer
+ {
+ get => ResolveSelectedServer();
+ set => SelectServer(value);
+ }
+
///
/// Creates a new instance of the BatchesClient.
/// If no httpClient is provided, a new one will be created.
@@ -140,5 +168,117 @@ partial void ProcessResponseContent(
global::System.Net.Http.HttpClient client,
global::System.Net.Http.HttpResponseMessage response,
ref string content);
+
+
+ ///
+ /// Selects one of the generated server options by id.
+ ///
+ public bool TrySelectServer(string serverId)
+ {
+ if (string.IsNullOrWhiteSpace(serverId))
+ {
+ return false;
+ }
+
+ foreach (var server in s_availableServers)
+ {
+ if (string.Equals(server.Id, serverId, global::System.StringComparison.OrdinalIgnoreCase))
+ {
+ AutoSDKServerConfiguration.SelectedServer = server;
+ AutoSDKServerConfiguration.ExplicitBaseUri = null;
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ ///
+ /// Clears the currently selected server.
+ ///
+ public void ClearSelectedServer()
+ {
+ AutoSDKServerConfiguration.SelectedServer = null;
+ }
+
+ private global::Together.AutoSDKServer? ResolveSelectedServer()
+ {
+ var selectedServer = AutoSDKServerConfiguration.SelectedServer;
+ if (selectedServer is null)
+ {
+ return null;
+ }
+
+ foreach (var server in s_availableServers)
+ {
+ if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal))
+ {
+ return server;
+ }
+ }
+
+ return null;
+ }
+
+ private void SelectServer(global::Together.AutoSDKServer? server)
+ {
+ if (server is null)
+ {
+ AutoSDKServerConfiguration.SelectedServer = null;
+ return;
+ }
+
+ foreach (var candidate in s_availableServers)
+ {
+ if (string.Equals(candidate.Id, server.Id, global::System.StringComparison.Ordinal))
+ {
+ AutoSDKServerConfiguration.SelectedServer = candidate;
+ AutoSDKServerConfiguration.ExplicitBaseUri = null;
+ return;
+ }
+ }
+
+ throw new global::System.ArgumentException("The provided server is not available for this client.", nameof(server));
+ }
+
+ private global::System.Uri? ResolveDisplayedBaseUri()
+ {
+ if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri)
+ {
+ return explicitBaseUri;
+ }
+
+ return ResolveSelectedServer()?.Uri ?? (s_availableServers.Length > 0 ? s_availableServers[0].Uri : HttpClient.BaseAddress);
+ }
+
+ private global::System.Uri? ResolveBaseUri(
+ global::Together.AutoSDKServer[] servers,
+ string defaultBaseUrl)
+ {
+ if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri)
+ {
+ return explicitBaseUri;
+ }
+
+ if (AutoSDKServerConfiguration.SelectedServer is global::Together.AutoSDKServer selectedServer)
+ {
+ foreach (var server in servers)
+ {
+ if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal))
+ {
+ return server.Uri;
+ }
+ }
+ }
+
+ if (servers.Length > 0)
+ {
+ return servers[0].Uri;
+ }
+
+ return string.IsNullOrWhiteSpace(defaultBaseUrl)
+ ? HttpClient.BaseAddress
+ : new global::System.Uri(defaultBaseUrl, global::System.UriKind.RelativeOrAbsolute);
+ }
}
}
\ No newline at end of file
diff --git a/src/libs/Together/Generated/Together.ChatClient.ChatCompletions.g.cs b/src/libs/Together/Generated/Together.ChatClient.ChatCompletions.g.cs
index f0800704..8d1d3e62 100644
--- a/src/libs/Together/Generated/Together.ChatClient.ChatCompletions.g.cs
+++ b/src/libs/Together/Generated/Together.ChatClient.ChatCompletions.g.cs
@@ -8,6 +8,19 @@ namespace Together
public partial class ChatClient
{
+ private static readonly global::Together.AutoSDKServer[] s_ChatCompletionsServers = new global::Together.AutoSDKServer[]
+ { new global::Together.AutoSDKServer(
+ id: "https-api-together-ai-v1",
+ name: "Default environment for APIs",
+ url: "https://api.together.ai/v1",
+ description: "Default environment for APIs"),
+ new global::Together.AutoSDKServer(
+ id: "https-api-inference-together-ai-v2",
+ name: "Optimized environment for inference",
+ url: "https://api-inference.together.ai/v2",
+ description: "Optimized environment for inference"),
+ };
+
private static readonly global::Together.EndPointSecurityRequirement s_ChatCompletionsSecurityRequirement0 =
new global::Together.EndPointSecurityRequirement
@@ -175,7 +188,9 @@ partial void ProcessChatCompletionsResponseContent(
var __pathBuilder = new global::Together.PathBuilder(
path: "/chat/completions",
- baseUri: HttpClient.BaseAddress);
+ baseUri: ResolveBaseUri(
+ servers: s_ChatCompletionsServers,
+ defaultBaseUrl: "https://api.together.ai/v1"));
var __path = __pathBuilder.ToString();
__path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters(
path: __path,
@@ -426,18 +441,17 @@ partial void ProcessChatCompletionsResponseContent(
__exception_400 = __ex;
}
- throw new global::Together.ApiException(
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_400 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_400,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_400,
- ResponseObject = __value_400,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_400,
+ responseObject: __value_400,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Unauthorized
if ((int)__response.StatusCode == 401)
@@ -464,18 +478,17 @@ partial void ProcessChatCompletionsResponseContent(
__exception_401 = __ex;
}
- throw new global::Together.ApiException(
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_401 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_401,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_401,
- ResponseObject = __value_401,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_401,
+ responseObject: __value_401,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// NotFound
if ((int)__response.StatusCode == 404)
@@ -502,18 +515,17 @@ partial void ProcessChatCompletionsResponseContent(
__exception_404 = __ex;
}
- throw new global::Together.ApiException(
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_404 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_404,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_404,
- ResponseObject = __value_404,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_404,
+ responseObject: __value_404,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// RateLimit
if ((int)__response.StatusCode == 429)
@@ -540,18 +552,17 @@ partial void ProcessChatCompletionsResponseContent(
__exception_429 = __ex;
}
- throw new global::Together.ApiException(
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_429 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_429,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_429,
- ResponseObject = __value_429,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_429,
+ responseObject: __value_429,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Overloaded
if ((int)__response.StatusCode == 503)
@@ -578,18 +589,17 @@ partial void ProcessChatCompletionsResponseContent(
__exception_503 = __ex;
}
- throw new global::Together.ApiException(
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_503 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_503,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_503,
- ResponseObject = __value_503,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_503,
+ responseObject: __value_503,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Timeout
if ((int)__response.StatusCode == 504)
@@ -616,18 +626,17 @@ partial void ProcessChatCompletionsResponseContent(
__exception_504 = __ex;
}
- throw new global::Together.ApiException(
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_504 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_504,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_504,
- ResponseObject = __value_504,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_504,
+ responseObject: __value_504,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
if (__effectiveReadResponseAsString)
@@ -661,17 +670,15 @@ partial void ProcessChatCompletionsResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::Together.ApiException(
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
}
else
@@ -708,17 +715,15 @@ partial void ProcessChatCompletionsResponseContent(
{
}
- throw new global::Together.ApiException(
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
}
@@ -781,7 +786,7 @@ partial void ProcessChatCompletionsResponseContent(
///
///
/// Adjusts the likelihood of specific tokens appearing in the generated output.
- /// Example: {"105":21.4,"1024":-10.5}
+ /// Example: {"1024":-10.5,"105":21.4}
///
///
/// Seed value for reproducibility.
@@ -827,18 +832,18 @@ partial void ProcessChatCompletionsResponseContent(
string model,
int? maxTokens = default,
global::System.Collections.Generic.IList? stop = default,
- float? temperature = default,
- float? topP = default,
+ double? temperature = default,
+ double? topP = default,
int? topK = default,
global::Together.ChatCompletionRequestContextLengthExceededBehavior? contextLengthExceededBehavior = default,
double? repetitionPenalty = default,
int? logprobs = default,
bool? echo = default,
int? n = default,
- float? minP = default,
- float? presencePenalty = default,
- float? frequencyPenalty = default,
- global::System.Collections.Generic.Dictionary? logitBias = default,
+ double? minP = default,
+ double? presencePenalty = default,
+ double? frequencyPenalty = default,
+ global::System.Collections.Generic.Dictionary? logitBias = default,
int? seed = default,
global::Together.OneOf? functionCall = default,
global::Together.ResponseFormat? responseFormat = default,
diff --git a/src/libs/Together/Generated/Together.ChatClient.ChatCompletionsAsStream.g.cs b/src/libs/Together/Generated/Together.ChatClient.ChatCompletionsAsStream.g.cs
index 21d4104e..18d9d0f9 100644
--- a/src/libs/Together/Generated/Together.ChatClient.ChatCompletionsAsStream.g.cs
+++ b/src/libs/Together/Generated/Together.ChatClient.ChatCompletionsAsStream.g.cs
@@ -8,6 +8,19 @@ namespace Together
public partial class ChatClient
{
+ private static readonly global::Together.AutoSDKServer[] s_ChatCompletionsAsStreamServers = new global::Together.AutoSDKServer[]
+ { new global::Together.AutoSDKServer(
+ id: "https-api-together-ai-v1",
+ name: "Default environment for APIs",
+ url: "https://api.together.ai/v1",
+ description: "Default environment for APIs"),
+ new global::Together.AutoSDKServer(
+ id: "https-api-inference-together-ai-v2",
+ name: "Optimized environment for inference",
+ url: "https://api-inference.together.ai/v2",
+ description: "Optimized environment for inference"),
+ };
+
private static readonly global::Together.EndPointSecurityRequirement s_ChatCompletionsAsStreamSecurityRequirement0 =
new global::Together.EndPointSecurityRequirement
@@ -131,7 +144,9 @@ partial void ProcessChatCompletionsAsStreamResponse(
var __pathBuilder = new global::Together.PathBuilder(
path: "/chat/completions",
- baseUri: HttpClient.BaseAddress);
+ baseUri: ResolveBaseUri(
+ servers: s_ChatCompletionsAsStreamServers,
+ defaultBaseUrl: "https://api.together.ai/v1"));
var __path = __pathBuilder.ToString();
__path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters(
path: __path,
@@ -377,17 +392,15 @@ partial void ProcessChatCompletionsAsStreamResponse(
{
}
- throw new global::Together.ApiException(
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
using var __stream = await __response.Content.ReadAsStreamAsync(
@@ -406,16 +419,15 @@ partial void ProcessChatCompletionsAsStreamResponse(
}
var __streamedResponse = global::Together.ChatCompletionStream.FromJson(__content, JsonSerializerContext) ??
- throw new global::Together.ApiException(
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: $"Response deserialization failed for \"{__content}\" ",
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ innerException: null,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
yield return __streamedResponse;
}
@@ -479,7 +491,7 @@ partial void ProcessChatCompletionsAsStreamResponse(
///
///
/// Adjusts the likelihood of specific tokens appearing in the generated output.
- /// Example: {"105":21.4,"1024":-10.5}
+ /// Example: {"1024":-10.5,"105":21.4}
///
///
/// Seed value for reproducibility.
@@ -525,18 +537,18 @@ partial void ProcessChatCompletionsAsStreamResponse(
string model,
int? maxTokens = default,
global::System.Collections.Generic.IList? stop = default,
- float? temperature = default,
- float? topP = default,
+ double? temperature = default,
+ double? topP = default,
int? topK = default,
global::Together.ChatCompletionRequestContextLengthExceededBehavior? contextLengthExceededBehavior = default,
double? repetitionPenalty = default,
int? logprobs = default,
bool? echo = default,
int? n = default,
- float? minP = default,
- float? presencePenalty = default,
- float? frequencyPenalty = default,
- global::System.Collections.Generic.Dictionary? logitBias = default,
+ double? minP = default,
+ double? presencePenalty = default,
+ double? frequencyPenalty = default,
+ global::System.Collections.Generic.Dictionary? logitBias = default,
int? seed = default,
global::Together.OneOf? functionCall = default,
global::Together.ResponseFormat? responseFormat = default,
diff --git a/src/libs/Together/Generated/Together.ChatClient.g.cs b/src/libs/Together/Generated/Together.ChatClient.g.cs
index 28d20481..bdbd3f57 100644
--- a/src/libs/Together/Generated/Together.ChatClient.g.cs
+++ b/src/libs/Together/Generated/Together.ChatClient.g.cs
@@ -10,7 +10,7 @@ namespace Together
public sealed partial class ChatClient : global::Together.IChatClient, global::System.IDisposable
{
///
- ///
+ /// Default environment for APIs
///
public const string DefaultBaseUrl = "https://api.together.ai/v1";
@@ -20,7 +20,7 @@ public sealed partial class ChatClient : global::Together.IChatClient, global::S
public global::System.Net.Http.HttpClient HttpClient { get; }
///
- public System.Uri? BaseUri => HttpClient.BaseAddress;
+ public System.Uri? BaseUri => ResolveDisplayedBaseUri();
///
public global::System.Collections.Generic.List Authorizations { get; }
@@ -42,6 +42,34 @@ public sealed partial class ChatClient : global::Together.IChatClient, global::S
public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::Together.SourceGenerationContext.Default;
+
+ private static readonly global::Together.AutoSDKServer[] s_availableServers = new global::Together.AutoSDKServer[]
+ { new global::Together.AutoSDKServer(
+ id: "https-api-together-ai-v1",
+ name: "Default environment for APIs",
+ url: "https://api.together.ai/v1",
+ description: "Default environment for APIs"),
+ new global::Together.AutoSDKServer(
+ id: "https-api-inference-together-ai-v2",
+ name: "Optimized environment for inference",
+ url: "https://api-inference.together.ai/v2",
+ description: "Optimized environment for inference"),
+ };
+
+ ///
+ /// The server options available for this client.
+ ///
+ public global::System.Collections.Generic.IReadOnlyList AvailableServers => s_availableServers;
+
+ ///
+ /// The currently selected server for this client, if any.
+ ///
+ public global::Together.AutoSDKServer? SelectedServer
+ {
+ get => ResolveSelectedServer();
+ set => SelectServer(value);
+ }
+
///
/// Creates a new instance of the ChatClient.
/// If no httpClient is provided, a new one will be created.
@@ -140,5 +168,117 @@ partial void ProcessResponseContent(
global::System.Net.Http.HttpClient client,
global::System.Net.Http.HttpResponseMessage response,
ref string content);
+
+
+ ///
+ /// Selects one of the generated server options by id.
+ ///
+ public bool TrySelectServer(string serverId)
+ {
+ if (string.IsNullOrWhiteSpace(serverId))
+ {
+ return false;
+ }
+
+ foreach (var server in s_availableServers)
+ {
+ if (string.Equals(server.Id, serverId, global::System.StringComparison.OrdinalIgnoreCase))
+ {
+ AutoSDKServerConfiguration.SelectedServer = server;
+ AutoSDKServerConfiguration.ExplicitBaseUri = null;
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ ///
+ /// Clears the currently selected server.
+ ///
+ public void ClearSelectedServer()
+ {
+ AutoSDKServerConfiguration.SelectedServer = null;
+ }
+
+ private global::Together.AutoSDKServer? ResolveSelectedServer()
+ {
+ var selectedServer = AutoSDKServerConfiguration.SelectedServer;
+ if (selectedServer is null)
+ {
+ return null;
+ }
+
+ foreach (var server in s_availableServers)
+ {
+ if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal))
+ {
+ return server;
+ }
+ }
+
+ return null;
+ }
+
+ private void SelectServer(global::Together.AutoSDKServer? server)
+ {
+ if (server is null)
+ {
+ AutoSDKServerConfiguration.SelectedServer = null;
+ return;
+ }
+
+ foreach (var candidate in s_availableServers)
+ {
+ if (string.Equals(candidate.Id, server.Id, global::System.StringComparison.Ordinal))
+ {
+ AutoSDKServerConfiguration.SelectedServer = candidate;
+ AutoSDKServerConfiguration.ExplicitBaseUri = null;
+ return;
+ }
+ }
+
+ throw new global::System.ArgumentException("The provided server is not available for this client.", nameof(server));
+ }
+
+ private global::System.Uri? ResolveDisplayedBaseUri()
+ {
+ if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri)
+ {
+ return explicitBaseUri;
+ }
+
+ return ResolveSelectedServer()?.Uri ?? (s_availableServers.Length > 0 ? s_availableServers[0].Uri : HttpClient.BaseAddress);
+ }
+
+ private global::System.Uri? ResolveBaseUri(
+ global::Together.AutoSDKServer[] servers,
+ string defaultBaseUrl)
+ {
+ if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri)
+ {
+ return explicitBaseUri;
+ }
+
+ if (AutoSDKServerConfiguration.SelectedServer is global::Together.AutoSDKServer selectedServer)
+ {
+ foreach (var server in servers)
+ {
+ if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal))
+ {
+ return server.Uri;
+ }
+ }
+ }
+
+ if (servers.Length > 0)
+ {
+ return servers[0].Uri;
+ }
+
+ return string.IsNullOrWhiteSpace(defaultBaseUrl)
+ ? HttpClient.BaseAddress
+ : new global::System.Uri(defaultBaseUrl, global::System.UriKind.RelativeOrAbsolute);
+ }
}
}
\ No newline at end of file
diff --git a/src/libs/Together/Generated/Together.CodeInterpreterClient.SessionsList.g.cs b/src/libs/Together/Generated/Together.CodeInterpreterClient.SessionsList.g.cs
index f5d64711..40e54869 100644
--- a/src/libs/Together/Generated/Together.CodeInterpreterClient.SessionsList.g.cs
+++ b/src/libs/Together/Generated/Together.CodeInterpreterClient.SessionsList.g.cs
@@ -6,6 +6,19 @@ namespace Together
public partial class CodeInterpreterClient
{
+ private static readonly global::Together.AutoSDKServer[] s_SessionsListServers = new global::Together.AutoSDKServer[]
+ { new global::Together.AutoSDKServer(
+ id: "https-api-together-ai-v1",
+ name: "Default environment for APIs",
+ url: "https://api.together.ai/v1",
+ description: "Default environment for APIs"),
+ new global::Together.AutoSDKServer(
+ id: "https-api-inference-together-ai-v2",
+ name: "Optimized environment for inference",
+ url: "https://api-inference.together.ai/v2",
+ description: "Optimized environment for inference"),
+ };
+
private static readonly global::Together.EndPointSecurityRequirement s_SessionsListSecurityRequirement0 =
new global::Together.EndPointSecurityRequirement
@@ -120,7 +133,9 @@ partial void ProcessSessionsListResponseContent(
var __pathBuilder = new global::Together.PathBuilder(
path: "/tci/sessions",
- baseUri: HttpClient.BaseAddress);
+ baseUri: ResolveBaseUri(
+ servers: s_SessionsListServers,
+ defaultBaseUrl: "https://api.together.ai/v1"));
var __path = __pathBuilder.ToString();
__path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters(
path: __path,
@@ -371,17 +386,15 @@ partial void ProcessSessionsListResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::Together.ApiException(
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
}
else
@@ -418,17 +431,15 @@ partial void ProcessSessionsListResponseContent(
{
}
- throw new global::Together.ApiException(
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
}
diff --git a/src/libs/Together/Generated/Together.CodeInterpreterClient.TciExecute.g.cs b/src/libs/Together/Generated/Together.CodeInterpreterClient.TciExecute.g.cs
index c03fa6d7..8eacb182 100644
--- a/src/libs/Together/Generated/Together.CodeInterpreterClient.TciExecute.g.cs
+++ b/src/libs/Together/Generated/Together.CodeInterpreterClient.TciExecute.g.cs
@@ -6,6 +6,19 @@ namespace Together
public partial class CodeInterpreterClient
{
+ private static readonly global::Together.AutoSDKServer[] s_TciExecuteServers = new global::Together.AutoSDKServer[]
+ { new global::Together.AutoSDKServer(
+ id: "https-api-together-ai-v1",
+ name: "Default environment for APIs",
+ url: "https://api.together.ai/v1",
+ description: "Default environment for APIs"),
+ new global::Together.AutoSDKServer(
+ id: "https-api-inference-together-ai-v2",
+ name: "Optimized environment for inference",
+ url: "https://api-inference.together.ai/v2",
+ description: "Optimized environment for inference"),
+ };
+
private static readonly global::Together.EndPointSecurityRequirement s_TciExecuteSecurityRequirement0 =
new global::Together.EndPointSecurityRequirement
@@ -139,7 +152,9 @@ partial void ProcessTciExecuteResponseContent(
var __pathBuilder = new global::Together.PathBuilder(
path: "/tci/execute",
- baseUri: HttpClient.BaseAddress);
+ baseUri: ResolveBaseUri(
+ servers: s_TciExecuteServers,
+ defaultBaseUrl: "https://api.together.ai/v1"));
var __path = __pathBuilder.ToString();
__path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters(
path: __path,
@@ -397,17 +412,15 @@ partial void ProcessTciExecuteResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::Together.ApiException(
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
}
else
@@ -444,17 +457,15 @@ partial void ProcessTciExecuteResponseContent(
{
}
- throw new global::Together.ApiException(
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
}
diff --git a/src/libs/Together/Generated/Together.CodeInterpreterClient.g.cs b/src/libs/Together/Generated/Together.CodeInterpreterClient.g.cs
index abbb1d1c..1e1ae65f 100644
--- a/src/libs/Together/Generated/Together.CodeInterpreterClient.g.cs
+++ b/src/libs/Together/Generated/Together.CodeInterpreterClient.g.cs
@@ -10,7 +10,7 @@ namespace Together
public sealed partial class CodeInterpreterClient : global::Together.ICodeInterpreterClient, global::System.IDisposable
{
///
- ///
+ /// Default environment for APIs
///
public const string DefaultBaseUrl = "https://api.together.ai/v1";
@@ -20,7 +20,7 @@ public sealed partial class CodeInterpreterClient : global::Together.ICodeInterp
public global::System.Net.Http.HttpClient HttpClient { get; }
///
- public System.Uri? BaseUri => HttpClient.BaseAddress;
+ public System.Uri? BaseUri => ResolveDisplayedBaseUri();
///
public global::System.Collections.Generic.List Authorizations { get; }
@@ -42,6 +42,34 @@ public sealed partial class CodeInterpreterClient : global::Together.ICodeInterp
public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::Together.SourceGenerationContext.Default;
+
+ private static readonly global::Together.AutoSDKServer[] s_availableServers = new global::Together.AutoSDKServer[]
+ { new global::Together.AutoSDKServer(
+ id: "https-api-together-ai-v1",
+ name: "Default environment for APIs",
+ url: "https://api.together.ai/v1",
+ description: "Default environment for APIs"),
+ new global::Together.AutoSDKServer(
+ id: "https-api-inference-together-ai-v2",
+ name: "Optimized environment for inference",
+ url: "https://api-inference.together.ai/v2",
+ description: "Optimized environment for inference"),
+ };
+
+ ///
+ /// The server options available for this client.
+ ///
+ public global::System.Collections.Generic.IReadOnlyList AvailableServers => s_availableServers;
+
+ ///
+ /// The currently selected server for this client, if any.
+ ///
+ public global::Together.AutoSDKServer? SelectedServer
+ {
+ get => ResolveSelectedServer();
+ set => SelectServer(value);
+ }
+
///
/// Creates a new instance of the CodeInterpreterClient.
/// If no httpClient is provided, a new one will be created.
@@ -140,5 +168,117 @@ partial void ProcessResponseContent(
global::System.Net.Http.HttpClient client,
global::System.Net.Http.HttpResponseMessage response,
ref string content);
+
+
+ ///
+ /// Selects one of the generated server options by id.
+ ///
+ public bool TrySelectServer(string serverId)
+ {
+ if (string.IsNullOrWhiteSpace(serverId))
+ {
+ return false;
+ }
+
+ foreach (var server in s_availableServers)
+ {
+ if (string.Equals(server.Id, serverId, global::System.StringComparison.OrdinalIgnoreCase))
+ {
+ AutoSDKServerConfiguration.SelectedServer = server;
+ AutoSDKServerConfiguration.ExplicitBaseUri = null;
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ ///
+ /// Clears the currently selected server.
+ ///
+ public void ClearSelectedServer()
+ {
+ AutoSDKServerConfiguration.SelectedServer = null;
+ }
+
+ private global::Together.AutoSDKServer? ResolveSelectedServer()
+ {
+ var selectedServer = AutoSDKServerConfiguration.SelectedServer;
+ if (selectedServer is null)
+ {
+ return null;
+ }
+
+ foreach (var server in s_availableServers)
+ {
+ if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal))
+ {
+ return server;
+ }
+ }
+
+ return null;
+ }
+
+ private void SelectServer(global::Together.AutoSDKServer? server)
+ {
+ if (server is null)
+ {
+ AutoSDKServerConfiguration.SelectedServer = null;
+ return;
+ }
+
+ foreach (var candidate in s_availableServers)
+ {
+ if (string.Equals(candidate.Id, server.Id, global::System.StringComparison.Ordinal))
+ {
+ AutoSDKServerConfiguration.SelectedServer = candidate;
+ AutoSDKServerConfiguration.ExplicitBaseUri = null;
+ return;
+ }
+ }
+
+ throw new global::System.ArgumentException("The provided server is not available for this client.", nameof(server));
+ }
+
+ private global::System.Uri? ResolveDisplayedBaseUri()
+ {
+ if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri)
+ {
+ return explicitBaseUri;
+ }
+
+ return ResolveSelectedServer()?.Uri ?? (s_availableServers.Length > 0 ? s_availableServers[0].Uri : HttpClient.BaseAddress);
+ }
+
+ private global::System.Uri? ResolveBaseUri(
+ global::Together.AutoSDKServer[] servers,
+ string defaultBaseUrl)
+ {
+ if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri)
+ {
+ return explicitBaseUri;
+ }
+
+ if (AutoSDKServerConfiguration.SelectedServer is global::Together.AutoSDKServer selectedServer)
+ {
+ foreach (var server in servers)
+ {
+ if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal))
+ {
+ return server.Uri;
+ }
+ }
+ }
+
+ if (servers.Length > 0)
+ {
+ return servers[0].Uri;
+ }
+
+ return string.IsNullOrWhiteSpace(defaultBaseUrl)
+ ? HttpClient.BaseAddress
+ : new global::System.Uri(defaultBaseUrl, global::System.UriKind.RelativeOrAbsolute);
+ }
}
}
\ No newline at end of file
diff --git a/src/libs/Together/Generated/Together.CompletionClient.Completions.g.cs b/src/libs/Together/Generated/Together.CompletionClient.Completions.g.cs
index bd5f62c4..9f61b4e9 100644
--- a/src/libs/Together/Generated/Together.CompletionClient.Completions.g.cs
+++ b/src/libs/Together/Generated/Together.CompletionClient.Completions.g.cs
@@ -6,6 +6,19 @@ namespace Together
public partial class CompletionClient
{
+ private static readonly global::Together.AutoSDKServer[] s_CompletionsServers = new global::Together.AutoSDKServer[]
+ { new global::Together.AutoSDKServer(
+ id: "https-api-together-ai-v1",
+ name: "Default environment for APIs",
+ url: "https://api.together.ai/v1",
+ description: "Default environment for APIs"),
+ new global::Together.AutoSDKServer(
+ id: "https-api-inference-together-ai-v2",
+ name: "Optimized environment for inference",
+ url: "https://api-inference.together.ai/v2",
+ description: "Optimized environment for inference"),
+ };
+
private static readonly global::Together.EndPointSecurityRequirement s_CompletionsSecurityRequirement0 =
new global::Together.EndPointSecurityRequirement
@@ -160,7 +173,9 @@ partial void ProcessCompletionsResponseContent(
var __pathBuilder = new global::Together.PathBuilder(
path: "/completions",
- baseUri: HttpClient.BaseAddress);
+ baseUri: ResolveBaseUri(
+ servers: s_CompletionsServers,
+ defaultBaseUrl: "https://api.together.ai/v1"));
var __path = __pathBuilder.ToString();
__path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters(
path: __path,
@@ -411,18 +426,17 @@ partial void ProcessCompletionsResponseContent(
__exception_400 = __ex;
}
- throw new global::Together.ApiException(
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_400 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_400,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_400,
- ResponseObject = __value_400,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_400,
+ responseObject: __value_400,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Unauthorized
if ((int)__response.StatusCode == 401)
@@ -449,18 +463,17 @@ partial void ProcessCompletionsResponseContent(
__exception_401 = __ex;
}
- throw new global::Together.ApiException(
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_401 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_401,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_401,
- ResponseObject = __value_401,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_401,
+ responseObject: __value_401,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// NotFound
if ((int)__response.StatusCode == 404)
@@ -487,18 +500,17 @@ partial void ProcessCompletionsResponseContent(
__exception_404 = __ex;
}
- throw new global::Together.ApiException(
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_404 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_404,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_404,
- ResponseObject = __value_404,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_404,
+ responseObject: __value_404,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// RateLimit
if ((int)__response.StatusCode == 429)
@@ -525,18 +537,17 @@ partial void ProcessCompletionsResponseContent(
__exception_429 = __ex;
}
- throw new global::Together.ApiException(
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_429 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_429,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_429,
- ResponseObject = __value_429,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_429,
+ responseObject: __value_429,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Overloaded
if ((int)__response.StatusCode == 503)
@@ -563,18 +574,17 @@ partial void ProcessCompletionsResponseContent(
__exception_503 = __ex;
}
- throw new global::Together.ApiException(
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_503 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_503,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_503,
- ResponseObject = __value_503,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_503,
+ responseObject: __value_503,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Timeout
if ((int)__response.StatusCode == 504)
@@ -601,18 +611,17 @@ partial void ProcessCompletionsResponseContent(
__exception_504 = __ex;
}
- throw new global::Together.ApiException(
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_504 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_504,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_504,
- ResponseObject = __value_504,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_504,
+ responseObject: __value_504,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
if (__effectiveReadResponseAsString)
@@ -646,17 +655,15 @@ partial void ProcessCompletionsResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::Together.ApiException(
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
}
else
@@ -693,17 +700,15 @@ partial void ProcessCompletionsResponseContent(
{
}
- throw new global::Together.ApiException(
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
}
@@ -768,7 +773,7 @@ partial void ProcessCompletionsResponseContent(
///
///
/// Adjusts the likelihood of specific tokens appearing in the generated output.
- /// Example: {"105":21.4,"1024":-10.5}
+ /// Example: {"1024":-10.5,"105":21.4}
///
///
/// Seed value for reproducibility.
@@ -782,18 +787,18 @@ partial void ProcessCompletionsResponseContent(
global::Together.AnyOf model,
int? maxTokens = default,
global::System.Collections.Generic.IList? stop = default,
- float? temperature = default,
- float? topP = default,
+ double? temperature = default,
+ double? topP = default,
int? topK = default,
- float? repetitionPenalty = default,
+ double? repetitionPenalty = default,
int? logprobs = default,
bool? echo = default,
int? n = default,
global::Together.AnyOf? safetyModel = default,
- float? minP = default,
- float? presencePenalty = default,
- float? frequencyPenalty = default,
- global::System.Collections.Generic.Dictionary? logitBias = default,
+ double? minP = default,
+ double? presencePenalty = default,
+ double? frequencyPenalty = default,
+ global::System.Collections.Generic.Dictionary? logitBias = default,
int? seed = default,
global::Together.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
diff --git a/src/libs/Together/Generated/Together.CompletionClient.CompletionsAsStream.g.cs b/src/libs/Together/Generated/Together.CompletionClient.CompletionsAsStream.g.cs
index e54366c2..00bccff5 100644
--- a/src/libs/Together/Generated/Together.CompletionClient.CompletionsAsStream.g.cs
+++ b/src/libs/Together/Generated/Together.CompletionClient.CompletionsAsStream.g.cs
@@ -6,6 +6,19 @@ namespace Together
public partial class CompletionClient
{
+ private static readonly global::Together.AutoSDKServer[] s_CompletionsAsStreamServers = new global::Together.AutoSDKServer[]
+ { new global::Together.AutoSDKServer(
+ id: "https-api-together-ai-v1",
+ name: "Default environment for APIs",
+ url: "https://api.together.ai/v1",
+ description: "Default environment for APIs"),
+ new global::Together.AutoSDKServer(
+ id: "https-api-inference-together-ai-v2",
+ name: "Optimized environment for inference",
+ url: "https://api-inference.together.ai/v2",
+ description: "Optimized environment for inference"),
+ };
+
private static readonly global::Together.EndPointSecurityRequirement s_CompletionsAsStreamSecurityRequirement0 =
new global::Together.EndPointSecurityRequirement
@@ -118,7 +131,9 @@ partial void ProcessCompletionsAsStreamResponse(
var __pathBuilder = new global::Together.PathBuilder(
path: "/completions",
- baseUri: HttpClient.BaseAddress);
+ baseUri: ResolveBaseUri(
+ servers: s_CompletionsAsStreamServers,
+ defaultBaseUrl: "https://api.together.ai/v1"));
var __path = __pathBuilder.ToString();
__path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters(
path: __path,
@@ -364,17 +379,15 @@ partial void ProcessCompletionsAsStreamResponse(
{
}
- throw new global::Together.ApiException(
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
using var __stream = await __response.Content.ReadAsStreamAsync(
@@ -393,16 +406,15 @@ partial void ProcessCompletionsAsStreamResponse(
}
var __streamedResponse = global::Together.CompletionStream.FromJson(__content, JsonSerializerContext) ??
- throw new global::Together.ApiException(
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: $"Response deserialization failed for \"{__content}\" ",
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ innerException: null,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
yield return __streamedResponse;
}
@@ -468,7 +480,7 @@ partial void ProcessCompletionsAsStreamResponse(
///
///
/// Adjusts the likelihood of specific tokens appearing in the generated output.
- /// Example: {"105":21.4,"1024":-10.5}
+ /// Example: {"1024":-10.5,"105":21.4}
///
///
/// Seed value for reproducibility.
@@ -482,18 +494,18 @@ partial void ProcessCompletionsAsStreamResponse(
global::Together.AnyOf model,
int? maxTokens = default,
global::System.Collections.Generic.IList? stop = default,
- float? temperature = default,
- float? topP = default,
+ double? temperature = default,
+ double? topP = default,
int? topK = default,
- float? repetitionPenalty = default,
+ double? repetitionPenalty = default,
int? logprobs = default,
bool? echo = default,
int? n = default,
global::Together.AnyOf? safetyModel = default,
- float? minP = default,
- float? presencePenalty = default,
- float? frequencyPenalty = default,
- global::System.Collections.Generic.Dictionary? logitBias = default,
+ double? minP = default,
+ double? presencePenalty = default,
+ double? frequencyPenalty = default,
+ global::System.Collections.Generic.Dictionary? logitBias = default,
int? seed = default,
global::Together.AutoSDKRequestOptions? requestOptions = default,
[global::System.Runtime.CompilerServices.EnumeratorCancellation] global::System.Threading.CancellationToken cancellationToken = default)
diff --git a/src/libs/Together/Generated/Together.CompletionClient.g.cs b/src/libs/Together/Generated/Together.CompletionClient.g.cs
index a77b79cc..c5c5ae7f 100644
--- a/src/libs/Together/Generated/Together.CompletionClient.g.cs
+++ b/src/libs/Together/Generated/Together.CompletionClient.g.cs
@@ -10,7 +10,7 @@ namespace Together
public sealed partial class CompletionClient : global::Together.ICompletionClient, global::System.IDisposable
{
///
- ///
+ /// Default environment for APIs
///
public const string DefaultBaseUrl = "https://api.together.ai/v1";
@@ -20,7 +20,7 @@ public sealed partial class CompletionClient : global::Together.ICompletionClien
public global::System.Net.Http.HttpClient HttpClient { get; }
///
- public System.Uri? BaseUri => HttpClient.BaseAddress;
+ public System.Uri? BaseUri => ResolveDisplayedBaseUri();
///
public global::System.Collections.Generic.List Authorizations { get; }
@@ -42,6 +42,34 @@ public sealed partial class CompletionClient : global::Together.ICompletionClien
public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::Together.SourceGenerationContext.Default;
+
+ private static readonly global::Together.AutoSDKServer[] s_availableServers = new global::Together.AutoSDKServer[]
+ { new global::Together.AutoSDKServer(
+ id: "https-api-together-ai-v1",
+ name: "Default environment for APIs",
+ url: "https://api.together.ai/v1",
+ description: "Default environment for APIs"),
+ new global::Together.AutoSDKServer(
+ id: "https-api-inference-together-ai-v2",
+ name: "Optimized environment for inference",
+ url: "https://api-inference.together.ai/v2",
+ description: "Optimized environment for inference"),
+ };
+
+ ///
+ /// The server options available for this client.
+ ///
+ public global::System.Collections.Generic.IReadOnlyList AvailableServers => s_availableServers;
+
+ ///
+ /// The currently selected server for this client, if any.
+ ///
+ public global::Together.AutoSDKServer? SelectedServer
+ {
+ get => ResolveSelectedServer();
+ set => SelectServer(value);
+ }
+
///
/// Creates a new instance of the CompletionClient.
/// If no httpClient is provided, a new one will be created.
@@ -140,5 +168,117 @@ partial void ProcessResponseContent(
global::System.Net.Http.HttpClient client,
global::System.Net.Http.HttpResponseMessage response,
ref string content);
+
+
+ ///
+ /// Selects one of the generated server options by id.
+ ///
+ public bool TrySelectServer(string serverId)
+ {
+ if (string.IsNullOrWhiteSpace(serverId))
+ {
+ return false;
+ }
+
+ foreach (var server in s_availableServers)
+ {
+ if (string.Equals(server.Id, serverId, global::System.StringComparison.OrdinalIgnoreCase))
+ {
+ AutoSDKServerConfiguration.SelectedServer = server;
+ AutoSDKServerConfiguration.ExplicitBaseUri = null;
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ ///
+ /// Clears the currently selected server.
+ ///
+ public void ClearSelectedServer()
+ {
+ AutoSDKServerConfiguration.SelectedServer = null;
+ }
+
+ private global::Together.AutoSDKServer? ResolveSelectedServer()
+ {
+ var selectedServer = AutoSDKServerConfiguration.SelectedServer;
+ if (selectedServer is null)
+ {
+ return null;
+ }
+
+ foreach (var server in s_availableServers)
+ {
+ if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal))
+ {
+ return server;
+ }
+ }
+
+ return null;
+ }
+
+ private void SelectServer(global::Together.AutoSDKServer? server)
+ {
+ if (server is null)
+ {
+ AutoSDKServerConfiguration.SelectedServer = null;
+ return;
+ }
+
+ foreach (var candidate in s_availableServers)
+ {
+ if (string.Equals(candidate.Id, server.Id, global::System.StringComparison.Ordinal))
+ {
+ AutoSDKServerConfiguration.SelectedServer = candidate;
+ AutoSDKServerConfiguration.ExplicitBaseUri = null;
+ return;
+ }
+ }
+
+ throw new global::System.ArgumentException("The provided server is not available for this client.", nameof(server));
+ }
+
+ private global::System.Uri? ResolveDisplayedBaseUri()
+ {
+ if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri)
+ {
+ return explicitBaseUri;
+ }
+
+ return ResolveSelectedServer()?.Uri ?? (s_availableServers.Length > 0 ? s_availableServers[0].Uri : HttpClient.BaseAddress);
+ }
+
+ private global::System.Uri? ResolveBaseUri(
+ global::Together.AutoSDKServer[] servers,
+ string defaultBaseUrl)
+ {
+ if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri)
+ {
+ return explicitBaseUri;
+ }
+
+ if (AutoSDKServerConfiguration.SelectedServer is global::Together.AutoSDKServer selectedServer)
+ {
+ foreach (var server in servers)
+ {
+ if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal))
+ {
+ return server.Uri;
+ }
+ }
+ }
+
+ if (servers.Length > 0)
+ {
+ return servers[0].Uri;
+ }
+
+ return string.IsNullOrWhiteSpace(defaultBaseUrl)
+ ? HttpClient.BaseAddress
+ : new global::System.Uri(defaultBaseUrl, global::System.UriKind.RelativeOrAbsolute);
+ }
}
}
\ No newline at end of file
diff --git a/src/libs/Together/Generated/Together.ConfigServiceClient.ConfigServiceGetProjectConfig.g.cs b/src/libs/Together/Generated/Together.ConfigServiceClient.ConfigServiceGetProjectConfig.g.cs
new file mode 100644
index 00000000..a79f2913
--- /dev/null
+++ b/src/libs/Together/Generated/Together.ConfigServiceClient.ConfigServiceGetProjectConfig.g.cs
@@ -0,0 +1,490 @@
+
+#nullable enable
+
+namespace Together
+{
+ public partial class ConfigServiceClient
+ {
+
+ private static readonly global::Together.AutoSDKServer[] s_ConfigServiceGetProjectConfigServers = new global::Together.AutoSDKServer[]
+ { new global::Together.AutoSDKServer(
+ id: "https-api-together-ai-v2",
+ name: "api.together.ai v2",
+ url: "https://api.together.ai/v2",
+ description: ""),
+ };
+
+
+ private static readonly global::Together.EndPointSecurityRequirement s_ConfigServiceGetProjectConfigSecurityRequirement0 =
+ new global::Together.EndPointSecurityRequirement
+ {
+ Authorizations = new global::Together.EndPointAuthorizationRequirement[]
+ { new global::Together.EndPointAuthorizationRequirement
+ {
+ Type = "Http",
+ SchemeId = "BearerAuth",
+ Location = "Header",
+ Name = "Bearer",
+ FriendlyName = "Bearer",
+ },
+ },
+ };
+ private static readonly global::Together.EndPointSecurityRequirement[] s_ConfigServiceGetProjectConfigSecurityRequirements =
+ new global::Together.EndPointSecurityRequirement[]
+ { s_ConfigServiceGetProjectConfigSecurityRequirement0,
+ };
+ partial void PrepareConfigServiceGetProjectConfigArguments(
+ global::System.Net.Http.HttpClient httpClient,
+ ref string projectId,
+ ref string id);
+ partial void PrepareConfigServiceGetProjectConfigRequest(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpRequestMessage httpRequestMessage,
+ string projectId,
+ string id);
+ partial void ProcessConfigServiceGetProjectConfigResponse(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpResponseMessage httpResponseMessage);
+
+ partial void ProcessConfigServiceGetProjectConfigResponseContent(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpResponseMessage httpResponseMessage,
+ ref string content);
+
+ ///
+ /// Get a model configuration
+ /// Retrieves a model configuration revision by ID, including its runtime selectors and certifications.
+ ///
+ ///
+ /// Project identifier.
+ ///
+ ///
+ /// Config revision identifier.
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task ConfigServiceGetProjectConfigAsync(
+ string projectId,
+ string id,
+ global::Together.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await ConfigServiceGetProjectConfigAsResponseAsync(
+ projectId: projectId,
+ id: id,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Get a model configuration
+ /// Retrieves a model configuration revision by ID, including its runtime selectors and certifications.
+ ///
+ ///
+ /// Project identifier.
+ ///
+ ///
+ /// Config revision identifier.
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> ConfigServiceGetProjectConfigAsResponseAsync(
+ string projectId,
+ string id,
+ global::Together.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ PrepareArguments(
+ client: HttpClient);
+ PrepareConfigServiceGetProjectConfigArguments(
+ httpClient: HttpClient,
+ projectId: ref projectId,
+ id: ref id);
+
+
+ var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations(
+ availableAuthorizations: Authorizations,
+ securityRequirements: s_ConfigServiceGetProjectConfigSecurityRequirements,
+ operationName: "ConfigServiceGetProjectConfigAsync");
+
+ using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken);
+ var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken;
+ var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ fallbackValue: ReadResponseAsString);
+ var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ supportsRetry: true);
+
+ global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
+ {
+
+ var __pathBuilder = new global::Together.PathBuilder(
+ path: $"/projects/{projectId}/configs/{id}",
+ baseUri: ResolveBaseUri(
+ servers: s_ConfigServiceGetProjectConfigServers,
+ defaultBaseUrl: "https://api.together.ai/v2"));
+ var __path = __pathBuilder.ToString();
+ __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters(
+ path: __path,
+ clientParameters: Options.QueryParameters,
+ requestParameters: requestOptions?.QueryParameters);
+ 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" ||
+ __authorization.Type == "OpenIdConnect")
+ {
+ __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);
+ }
+ }
+ global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders(
+ request: __httpRequest,
+ clientHeaders: Options.Headers,
+ requestHeaders: requestOptions?.Headers);
+
+ PrepareRequest(
+ client: HttpClient,
+ request: __httpRequest);
+ PrepareConfigServiceGetProjectConfigRequest(
+ httpClient: HttpClient,
+ httpRequestMessage: __httpRequest,
+ projectId: projectId!,
+ id: id!);
+
+ return __httpRequest;
+ }
+
+ global::System.Net.Http.HttpRequestMessage? __httpRequest = null;
+ global::System.Net.Http.HttpResponseMessage? __response = null;
+ var __attemptNumber = 0;
+ try
+ {
+ for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++)
+ {
+ __attemptNumber = __attempt;
+ __httpRequest = __CreateHttpRequest();
+ await global::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "ConfigServiceGetProjectConfig",
+ methodName: "ConfigServiceGetProjectConfigAsync",
+ pathTemplate: "$\"/projects/{projectId}/configs/{id}\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ try
+ {
+ __response = await HttpClient.SendAsync(
+ request: __httpRequest,
+ completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ }
+ catch (global::System.Net.Http.HttpRequestException __exception)
+ {
+ var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
+ var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
+ await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "ConfigServiceGetProjectConfig",
+ methodName: "ConfigServiceGetProjectConfigAsync",
+ pathTemplate: "$\"/projects/{projectId}/configs/{id}\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: __exception,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ if (!__willRetry)
+ {
+ throw;
+ }
+
+ __httpRequest.Dispose();
+ __httpRequest = null;
+ await global::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ if (__response != null &&
+ __attempt < __maxAttempts &&
+ global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
+ {
+ var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
+ await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "ConfigServiceGetProjectConfig",
+ methodName: "ConfigServiceGetProjectConfigAsync",
+ pathTemplate: "$\"/projects/{projectId}/configs/{id}\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ break;
+ }
+
+ if (__response == null)
+ {
+ throw new global::System.InvalidOperationException("No response received.");
+ }
+
+ using (__response)
+ {
+
+ ProcessResponse(
+ client: HttpClient,
+ response: __response);
+ ProcessConfigServiceGetProjectConfigResponse(
+ httpClient: HttpClient,
+ httpResponseMessage: __response);
+ if (__response.IsSuccessStatusCode)
+ {
+ await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "ConfigServiceGetProjectConfig",
+ methodName: "ConfigServiceGetProjectConfigAsync",
+ pathTemplate: "$\"/projects/{projectId}/configs/{id}\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ else
+ {
+ await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "ConfigServiceGetProjectConfig",
+ methodName: "ConfigServiceGetProjectConfigAsync",
+ pathTemplate: "$\"/projects/{projectId}/configs/{id}\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ // Default error response
+ if (!__response.IsSuccessStatusCode)
+ {
+ string? __content_default = null;
+ global::System.Exception? __exception_default = null;
+ global::Together.ErrorData? __value_default = null;
+ try
+ {
+ if (__effectiveReadResponseAsString)
+ {
+ __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+ __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext);
+ }
+ else
+ {
+ __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+
+ __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext);
+ }
+ }
+ catch (global::System.Exception __ex)
+ {
+ __exception_default = __ex;
+ }
+
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content_default ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __exception_default,
+ responseBody: __content_default,
+ responseObject: __value_default,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+
+ if (__effectiveReadResponseAsString)
+ {
+ var __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ ProcessResponseContent(
+ client: HttpClient,
+ response: __response,
+ content: ref __content);
+ ProcessConfigServiceGetProjectConfigResponseContent(
+ httpClient: HttpClient,
+ httpResponseMessage: __response,
+ content: ref __content);
+
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+
+ var __value = global::Together.DeModelConfig.FromJson(__content, JsonSerializerContext) ??
+ throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Together.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
+ }
+ catch (global::System.Exception __ex)
+ {
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ }
+ else
+ {
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+ using var __content = await __response.Content.ReadAsStreamAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ var __value = await global::Together.DeModelConfig.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Together.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
+ }
+ catch (global::System.Exception __ex)
+ {
+ string? __content = null;
+ try
+ {
+ __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+ }
+ catch (global::System.Exception)
+ {
+ }
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ }
+
+ }
+ }
+ finally
+ {
+ __httpRequest?.Dispose();
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/libs/Together/Generated/Together.ConfigServiceClient.ConfigServiceListProjectConfigs.g.cs b/src/libs/Together/Generated/Together.ConfigServiceClient.ConfigServiceListProjectConfigs.g.cs
new file mode 100644
index 00000000..a1e2bcc4
--- /dev/null
+++ b/src/libs/Together/Generated/Together.ConfigServiceClient.ConfigServiceListProjectConfigs.g.cs
@@ -0,0 +1,535 @@
+
+#nullable enable
+
+namespace Together
+{
+ public partial class ConfigServiceClient
+ {
+
+ private static readonly global::Together.AutoSDKServer[] s_ConfigServiceListProjectConfigsServers = new global::Together.AutoSDKServer[]
+ { new global::Together.AutoSDKServer(
+ id: "https-api-together-ai-v2",
+ name: "api.together.ai v2",
+ url: "https://api.together.ai/v2",
+ description: ""),
+ };
+
+
+ private static readonly global::Together.EndPointSecurityRequirement s_ConfigServiceListProjectConfigsSecurityRequirement0 =
+ new global::Together.EndPointSecurityRequirement
+ {
+ Authorizations = new global::Together.EndPointAuthorizationRequirement[]
+ { new global::Together.EndPointAuthorizationRequirement
+ {
+ Type = "Http",
+ SchemeId = "BearerAuth",
+ Location = "Header",
+ Name = "Bearer",
+ FriendlyName = "Bearer",
+ },
+ },
+ };
+ private static readonly global::Together.EndPointSecurityRequirement[] s_ConfigServiceListProjectConfigsSecurityRequirements =
+ new global::Together.EndPointSecurityRequirement[]
+ { s_ConfigServiceListProjectConfigsSecurityRequirement0,
+ };
+ partial void PrepareConfigServiceListProjectConfigsArguments(
+ global::System.Net.Http.HttpClient httpClient,
+ ref string projectId,
+ ref string? referenceModelId,
+ ref string? referenceModel,
+ ref int? limit,
+ ref string? after);
+ partial void PrepareConfigServiceListProjectConfigsRequest(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpRequestMessage httpRequestMessage,
+ string projectId,
+ string? referenceModelId,
+ string? referenceModel,
+ int? limit,
+ string? after);
+ partial void ProcessConfigServiceListProjectConfigsResponse(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpResponseMessage httpResponseMessage);
+
+ partial void ProcessConfigServiceListProjectConfigsResponseContent(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpResponseMessage httpResponseMessage,
+ ref string content);
+
+ ///
+ /// List model configurations
+ /// Lists production-ready configuration revisions compatible with a reference model. Specify the model with `referenceModel` or the deprecated `referenceModelId`; if both are supplied, they must identify the same model. Results include public configurations and configurations owned by the specified project.
+ ///
+ ///
+ /// Project identifier.
+ ///
+ ///
+ /// Deprecated. Use `referenceModel`. Reference model identifier filter; if both are set, they must agree.
+ ///
+ ///
+ /// Model resource-name filter using `projects/{projectId}/models/{modelId}`; alternative to `referenceModelId`. If both are set, they must agree.
+ ///
+ ///
+ /// Maximum number of results to return.
+ ///
+ ///
+ /// Cursor from a previous list response.
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task ConfigServiceListProjectConfigsAsync(
+ string projectId,
+ string? referenceModelId = default,
+ string? referenceModel = default,
+ int? limit = default,
+ string? after = default,
+ global::Together.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await ConfigServiceListProjectConfigsAsResponseAsync(
+ projectId: projectId,
+ referenceModelId: referenceModelId,
+ referenceModel: referenceModel,
+ limit: limit,
+ after: after,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// List model configurations
+ /// Lists production-ready configuration revisions compatible with a reference model. Specify the model with `referenceModel` or the deprecated `referenceModelId`; if both are supplied, they must identify the same model. Results include public configurations and configurations owned by the specified project.
+ ///
+ ///
+ /// Project identifier.
+ ///
+ ///
+ /// Deprecated. Use `referenceModel`. Reference model identifier filter; if both are set, they must agree.
+ ///
+ ///
+ /// Model resource-name filter using `projects/{projectId}/models/{modelId}`; alternative to `referenceModelId`. If both are set, they must agree.
+ ///
+ ///
+ /// Maximum number of results to return.
+ ///
+ ///
+ /// Cursor from a previous list response.
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> ConfigServiceListProjectConfigsAsResponseAsync(
+ string projectId,
+ string? referenceModelId = default,
+ string? referenceModel = default,
+ int? limit = default,
+ string? after = default,
+ global::Together.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ PrepareArguments(
+ client: HttpClient);
+ PrepareConfigServiceListProjectConfigsArguments(
+ httpClient: HttpClient,
+ projectId: ref projectId,
+ referenceModelId: ref referenceModelId,
+ referenceModel: ref referenceModel,
+ limit: ref limit,
+ after: ref after);
+
+
+ var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations(
+ availableAuthorizations: Authorizations,
+ securityRequirements: s_ConfigServiceListProjectConfigsSecurityRequirements,
+ operationName: "ConfigServiceListProjectConfigsAsync");
+
+ using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken);
+ var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken;
+ var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ fallbackValue: ReadResponseAsString);
+ var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ supportsRetry: true);
+
+ global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
+ {
+
+ var __pathBuilder = new global::Together.PathBuilder(
+ path: $"/projects/{projectId}/configs",
+ baseUri: ResolveBaseUri(
+ servers: s_ConfigServiceListProjectConfigsServers,
+ defaultBaseUrl: "https://api.together.ai/v2"));
+ __pathBuilder
+ .AddOptionalParameter("referenceModelId", referenceModelId)
+ .AddOptionalParameter("referenceModel", referenceModel)
+ .AddOptionalParameter("limit", limit?.ToString())
+ .AddOptionalParameter("after", after)
+ ;
+ var __path = __pathBuilder.ToString();
+ __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters(
+ path: __path,
+ clientParameters: Options.QueryParameters,
+ requestParameters: requestOptions?.QueryParameters);
+ 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" ||
+ __authorization.Type == "OpenIdConnect")
+ {
+ __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);
+ }
+ }
+ global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders(
+ request: __httpRequest,
+ clientHeaders: Options.Headers,
+ requestHeaders: requestOptions?.Headers);
+
+ PrepareRequest(
+ client: HttpClient,
+ request: __httpRequest);
+ PrepareConfigServiceListProjectConfigsRequest(
+ httpClient: HttpClient,
+ httpRequestMessage: __httpRequest,
+ projectId: projectId!,
+ referenceModelId: referenceModelId,
+ referenceModel: referenceModel,
+ limit: limit,
+ after: after);
+
+ return __httpRequest;
+ }
+
+ global::System.Net.Http.HttpRequestMessage? __httpRequest = null;
+ global::System.Net.Http.HttpResponseMessage? __response = null;
+ var __attemptNumber = 0;
+ try
+ {
+ for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++)
+ {
+ __attemptNumber = __attempt;
+ __httpRequest = __CreateHttpRequest();
+ await global::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "ConfigServiceListProjectConfigs",
+ methodName: "ConfigServiceListProjectConfigsAsync",
+ pathTemplate: "$\"/projects/{projectId}/configs\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ try
+ {
+ __response = await HttpClient.SendAsync(
+ request: __httpRequest,
+ completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ }
+ catch (global::System.Net.Http.HttpRequestException __exception)
+ {
+ var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
+ var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
+ await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "ConfigServiceListProjectConfigs",
+ methodName: "ConfigServiceListProjectConfigsAsync",
+ pathTemplate: "$\"/projects/{projectId}/configs\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: __exception,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ if (!__willRetry)
+ {
+ throw;
+ }
+
+ __httpRequest.Dispose();
+ __httpRequest = null;
+ await global::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ if (__response != null &&
+ __attempt < __maxAttempts &&
+ global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
+ {
+ var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
+ await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "ConfigServiceListProjectConfigs",
+ methodName: "ConfigServiceListProjectConfigsAsync",
+ pathTemplate: "$\"/projects/{projectId}/configs\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ break;
+ }
+
+ if (__response == null)
+ {
+ throw new global::System.InvalidOperationException("No response received.");
+ }
+
+ using (__response)
+ {
+
+ ProcessResponse(
+ client: HttpClient,
+ response: __response);
+ ProcessConfigServiceListProjectConfigsResponse(
+ httpClient: HttpClient,
+ httpResponseMessage: __response);
+ if (__response.IsSuccessStatusCode)
+ {
+ await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "ConfigServiceListProjectConfigs",
+ methodName: "ConfigServiceListProjectConfigsAsync",
+ pathTemplate: "$\"/projects/{projectId}/configs\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ else
+ {
+ await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "ConfigServiceListProjectConfigs",
+ methodName: "ConfigServiceListProjectConfigsAsync",
+ pathTemplate: "$\"/projects/{projectId}/configs\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ // Default error response
+ if (!__response.IsSuccessStatusCode)
+ {
+ string? __content_default = null;
+ global::System.Exception? __exception_default = null;
+ global::Together.ErrorData? __value_default = null;
+ try
+ {
+ if (__effectiveReadResponseAsString)
+ {
+ __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+ __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext);
+ }
+ else
+ {
+ __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+
+ __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext);
+ }
+ }
+ catch (global::System.Exception __ex)
+ {
+ __exception_default = __ex;
+ }
+
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content_default ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __exception_default,
+ responseBody: __content_default,
+ responseObject: __value_default,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+
+ if (__effectiveReadResponseAsString)
+ {
+ var __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ ProcessResponseContent(
+ client: HttpClient,
+ response: __response,
+ content: ref __content);
+ ProcessConfigServiceListProjectConfigsResponseContent(
+ httpClient: HttpClient,
+ httpResponseMessage: __response,
+ content: ref __content);
+
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+
+ var __value = global::Together.DeListProjectConfigsResponse.FromJson(__content, JsonSerializerContext) ??
+ throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Together.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
+ }
+ catch (global::System.Exception __ex)
+ {
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ }
+ else
+ {
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+ using var __content = await __response.Content.ReadAsStreamAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ var __value = await global::Together.DeListProjectConfigsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Together.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
+ }
+ catch (global::System.Exception __ex)
+ {
+ string? __content = null;
+ try
+ {
+ __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+ }
+ catch (global::System.Exception)
+ {
+ }
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ }
+
+ }
+ }
+ finally
+ {
+ __httpRequest?.Dispose();
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/libs/Together/Generated/Together.ConfigServiceClient.g.cs b/src/libs/Together/Generated/Together.ConfigServiceClient.g.cs
new file mode 100644
index 00000000..6a22909f
--- /dev/null
+++ b/src/libs/Together/Generated/Together.ConfigServiceClient.g.cs
@@ -0,0 +1,175 @@
+
+#nullable enable
+
+namespace Together
+{
+ ///
+ /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used.
+ ///
+ public sealed partial class ConfigServiceClient : global::Together.IConfigServiceClient, global::System.IDisposable
+ {
+ ///
+ ///
+ ///
+ public const string DefaultBaseUrl = "https://api.together.ai/v2";
+
+ private bool _disposeHttpClient = true;
+
+ ///
+ public global::System.Net.Http.HttpClient HttpClient { get; }
+
+ ///
+ public System.Uri? BaseUri => HttpClient.BaseAddress;
+
+ ///
+ public global::System.Collections.Generic.List Authorizations { get; }
+
+ ///
+ public bool ReadResponseAsString { get; set; }
+#if DEBUG
+ = true;
+#endif
+
+ ///
+ public global::Together.AutoSDKClientOptions Options { get; }
+
+
+ internal global::Together.AutoSDKServerConfiguration AutoSDKServerConfiguration { get; set; } = new global::Together.AutoSDKServerConfiguration();
+ ///
+ ///
+ ///
+ public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::Together.SourceGenerationContext.Default;
+
+
+ ///
+ /// Creates a new instance of the ConfigServiceClient.
+ /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used.
+ ///
+ /// The HttpClient instance. If not provided, a new one will be created.
+ /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used.
+ /// The authorizations to use for the requests.
+ /// Dispose the HttpClient when the instance is disposed. True by default.
+ public ConfigServiceClient(
+ global::System.Net.Http.HttpClient? httpClient = null,
+ global::System.Uri? baseUri = null,
+ global::System.Collections.Generic.List? authorizations = null,
+ bool disposeHttpClient = true) : this(
+ httpClient,
+ baseUri,
+ authorizations,
+ options: null,
+ disposeHttpClient: disposeHttpClient)
+ {
+ }
+
+ ///
+ /// Creates a new instance of the ConfigServiceClient with explicit options but no base URL override.
+ /// Skips passing baseUri so the default base URL from the OpenAPI spec applies.
+ ///
+ /// The HttpClient instance. If not provided, a new one will be created.
+ /// The authorizations to use for the requests.
+ /// Client-wide request defaults such as headers, query parameters, retries, and timeout.
+ /// Dispose the HttpClient when the instance is disposed. True by default.
+ public ConfigServiceClient(
+ global::System.Net.Http.HttpClient? httpClient,
+ global::System.Collections.Generic.List? authorizations,
+ global::Together.AutoSDKClientOptions? options,
+ bool disposeHttpClient = true) : this(
+ httpClient,
+ baseUri: null,
+ authorizations,
+ options,
+ disposeHttpClient: disposeHttpClient)
+ {
+ }
+
+ ///
+ /// Creates a new instance of the ConfigServiceClient.
+ /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used.
+ ///
+ /// The HttpClient instance. If not provided, a new one will be created.
+ /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used.
+ /// The authorizations to use for the requests.
+ /// Client-wide request defaults such as headers, query parameters, retries, and timeout.
+ /// Dispose the HttpClient when the instance is disposed. True by default.
+ public ConfigServiceClient(
+ global::System.Net.Http.HttpClient? httpClient,
+ global::System.Uri? baseUri,
+ global::System.Collections.Generic.List? authorizations,
+ global::Together.AutoSDKClientOptions? options,
+ bool disposeHttpClient = true)
+ {
+
+ HttpClient = httpClient ?? new global::System.Net.Http.HttpClient();
+ if (baseUri is not null)
+ {
+ HttpClient.BaseAddress ??= baseUri;
+ }
+ Authorizations = authorizations ?? new global::System.Collections.Generic.List();
+ Options = options ?? new global::Together.AutoSDKClientOptions();
+ _disposeHttpClient = disposeHttpClient;
+
+ AutoSDKServerConfiguration.ExplicitBaseUri = baseUri ?? httpClient?.BaseAddress;
+
+ Initialized(HttpClient);
+ }
+
+ ///
+ public void Dispose()
+ {
+ if (_disposeHttpClient)
+ {
+ HttpClient.Dispose();
+ }
+ }
+
+ partial void Initialized(
+ global::System.Net.Http.HttpClient client);
+ partial void PrepareArguments(
+ global::System.Net.Http.HttpClient client);
+ partial void PrepareRequest(
+ global::System.Net.Http.HttpClient client,
+ global::System.Net.Http.HttpRequestMessage request);
+ partial void ProcessResponse(
+ global::System.Net.Http.HttpClient client,
+ global::System.Net.Http.HttpResponseMessage response);
+ partial void ProcessResponseContent(
+ global::System.Net.Http.HttpClient client,
+ global::System.Net.Http.HttpResponseMessage response,
+ ref string content);
+
+
+ private global::System.Uri? ResolveBaseUri(
+ global::Together.AutoSDKServer[] servers,
+ string defaultBaseUrl)
+ {
+ if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri)
+ {
+ return explicitBaseUri;
+ }
+
+ if (AutoSDKServerConfiguration.SelectedServer is global::Together.AutoSDKServer selectedServer)
+ {
+ foreach (var server in servers)
+ {
+ if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal))
+ {
+ return server.Uri;
+ }
+ }
+ }
+
+ if (servers.Length > 0)
+ {
+ return servers[0].Uri;
+ }
+
+ return string.IsNullOrWhiteSpace(defaultBaseUrl)
+ ? HttpClient.BaseAddress
+ : new global::System.Uri(defaultBaseUrl, global::System.UriKind.RelativeOrAbsolute);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceAddAdapter.g.cs b/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceAddAdapter.g.cs
new file mode 100644
index 00000000..33a78f07
--- /dev/null
+++ b/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceAddAdapter.g.cs
@@ -0,0 +1,573 @@
+
+#nullable enable
+
+namespace Together
+{
+ public partial class DeploymentServiceClient
+ {
+
+ private static readonly global::Together.AutoSDKServer[] s_DeploymentServiceAddAdapterServers = new global::Together.AutoSDKServer[]
+ { new global::Together.AutoSDKServer(
+ id: "https-api-together-ai-v2",
+ name: "api.together.ai v2",
+ url: "https://api.together.ai/v2",
+ description: ""),
+ };
+
+
+ private static readonly global::Together.EndPointSecurityRequirement s_DeploymentServiceAddAdapterSecurityRequirement0 =
+ new global::Together.EndPointSecurityRequirement
+ {
+ Authorizations = new global::Together.EndPointAuthorizationRequirement[]
+ { new global::Together.EndPointAuthorizationRequirement
+ {
+ Type = "Http",
+ SchemeId = "BearerAuth",
+ Location = "Header",
+ Name = "Bearer",
+ FriendlyName = "Bearer",
+ },
+ },
+ };
+ private static readonly global::Together.EndPointSecurityRequirement[] s_DeploymentServiceAddAdapterSecurityRequirements =
+ new global::Together.EndPointSecurityRequirement[]
+ { s_DeploymentServiceAddAdapterSecurityRequirement0,
+ };
+ partial void PrepareDeploymentServiceAddAdapterArguments(
+ global::System.Net.Http.HttpClient httpClient,
+ ref string projectId,
+ ref string endpointId,
+ ref string deploymentId,
+ global::Together.DeAddAdapterRequest request);
+ partial void PrepareDeploymentServiceAddAdapterRequest(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpRequestMessage httpRequestMessage,
+ string projectId,
+ string endpointId,
+ string deploymentId,
+ global::Together.DeAddAdapterRequest request);
+ partial void ProcessDeploymentServiceAddAdapterResponse(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpResponseMessage httpResponseMessage);
+
+ partial void ProcessDeploymentServiceAddAdapterResponseContent(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpResponseMessage httpResponseMessage,
+ ref string content);
+
+ ///
+ /// Add a deployment adapter
+ /// Attaches a LoRA adapter to a deployment. If the deployment is at adapter capacity, force can evict the oldest adapter.
+ ///
+ ///
+ /// Project identifier.
+ ///
+ ///
+ /// Endpoint identifier.
+ ///
+ ///
+ /// Deployment identifier.
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task DeploymentServiceAddAdapterAsync(
+ string projectId,
+ string endpointId,
+ string deploymentId,
+
+ global::Together.DeAddAdapterRequest request,
+ global::Together.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await DeploymentServiceAddAdapterAsResponseAsync(
+ projectId: projectId,
+ endpointId: endpointId,
+ deploymentId: deploymentId,
+
+ request: request,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Add a deployment adapter
+ /// Attaches a LoRA adapter to a deployment. If the deployment is at adapter capacity, force can evict the oldest adapter.
+ ///
+ ///
+ /// Project identifier.
+ ///
+ ///
+ /// Endpoint identifier.
+ ///
+ ///
+ /// Deployment identifier.
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> DeploymentServiceAddAdapterAsResponseAsync(
+ string projectId,
+ string endpointId,
+ string deploymentId,
+
+ global::Together.DeAddAdapterRequest request,
+ global::Together.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ request = request ?? throw new global::System.ArgumentNullException(nameof(request));
+
+ PrepareArguments(
+ client: HttpClient);
+ PrepareDeploymentServiceAddAdapterArguments(
+ httpClient: HttpClient,
+ projectId: ref projectId,
+ endpointId: ref endpointId,
+ deploymentId: ref deploymentId,
+ request: request);
+
+
+ var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations(
+ availableAuthorizations: Authorizations,
+ securityRequirements: s_DeploymentServiceAddAdapterSecurityRequirements,
+ operationName: "DeploymentServiceAddAdapterAsync");
+
+ using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken);
+ var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken;
+ var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ fallbackValue: ReadResponseAsString);
+ var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ supportsRetry: true);
+
+ global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
+ {
+
+ var __pathBuilder = new global::Together.PathBuilder(
+ path: $"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters",
+ baseUri: ResolveBaseUri(
+ servers: s_DeploymentServiceAddAdapterServers,
+ defaultBaseUrl: "https://api.together.ai/v2"));
+ var __path = __pathBuilder.ToString();
+ __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters(
+ path: __path,
+ clientParameters: Options.QueryParameters,
+ requestParameters: requestOptions?.QueryParameters);
+ 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" ||
+ __authorization.Type == "OpenIdConnect")
+ {
+ __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 = request.ToJson(JsonSerializerContext);
+ var __httpRequestContent = new global::System.Net.Http.StringContent(
+ content: __httpRequestContentBody,
+ encoding: global::System.Text.Encoding.UTF8,
+ mediaType: "application/json");
+ __httpRequest.Content = __httpRequestContent;
+ global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders(
+ request: __httpRequest,
+ clientHeaders: Options.Headers,
+ requestHeaders: requestOptions?.Headers);
+
+ PrepareRequest(
+ client: HttpClient,
+ request: __httpRequest);
+ PrepareDeploymentServiceAddAdapterRequest(
+ httpClient: HttpClient,
+ httpRequestMessage: __httpRequest,
+ projectId: projectId!,
+ endpointId: endpointId!,
+ deploymentId: deploymentId!,
+ request: request);
+
+ return __httpRequest;
+ }
+
+ global::System.Net.Http.HttpRequestMessage? __httpRequest = null;
+ global::System.Net.Http.HttpResponseMessage? __response = null;
+ var __attemptNumber = 0;
+ try
+ {
+ for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++)
+ {
+ __attemptNumber = __attempt;
+ __httpRequest = __CreateHttpRequest();
+ await global::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "DeploymentServiceAddAdapter",
+ methodName: "DeploymentServiceAddAdapterAsync",
+ pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ try
+ {
+ __response = await HttpClient.SendAsync(
+ request: __httpRequest,
+ completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ }
+ catch (global::System.Net.Http.HttpRequestException __exception)
+ {
+ var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
+ var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
+ await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "DeploymentServiceAddAdapter",
+ methodName: "DeploymentServiceAddAdapterAsync",
+ pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: __exception,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ if (!__willRetry)
+ {
+ throw;
+ }
+
+ __httpRequest.Dispose();
+ __httpRequest = null;
+ await global::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ if (__response != null &&
+ __attempt < __maxAttempts &&
+ global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
+ {
+ var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
+ await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "DeploymentServiceAddAdapter",
+ methodName: "DeploymentServiceAddAdapterAsync",
+ pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ break;
+ }
+
+ if (__response == null)
+ {
+ throw new global::System.InvalidOperationException("No response received.");
+ }
+
+ using (__response)
+ {
+
+ ProcessResponse(
+ client: HttpClient,
+ response: __response);
+ ProcessDeploymentServiceAddAdapterResponse(
+ httpClient: HttpClient,
+ httpResponseMessage: __response);
+ if (__response.IsSuccessStatusCode)
+ {
+ await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "DeploymentServiceAddAdapter",
+ methodName: "DeploymentServiceAddAdapterAsync",
+ pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ else
+ {
+ await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "DeploymentServiceAddAdapter",
+ methodName: "DeploymentServiceAddAdapterAsync",
+ pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ // Default error response
+ if (!__response.IsSuccessStatusCode)
+ {
+ string? __content_default = null;
+ global::System.Exception? __exception_default = null;
+ global::Together.ErrorData? __value_default = null;
+ try
+ {
+ if (__effectiveReadResponseAsString)
+ {
+ __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+ __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext);
+ }
+ else
+ {
+ __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+
+ __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext);
+ }
+ }
+ catch (global::System.Exception __ex)
+ {
+ __exception_default = __ex;
+ }
+
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content_default ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __exception_default,
+ responseBody: __content_default,
+ responseObject: __value_default,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+
+ if (__effectiveReadResponseAsString)
+ {
+ var __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ ProcessResponseContent(
+ client: HttpClient,
+ response: __response,
+ content: ref __content);
+ ProcessDeploymentServiceAddAdapterResponseContent(
+ httpClient: HttpClient,
+ httpResponseMessage: __response,
+ content: ref __content);
+
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+
+ var __value = global::Together.DeAdapterEntry.FromJson(__content, JsonSerializerContext) ??
+ throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Together.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
+ }
+ catch (global::System.Exception __ex)
+ {
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ }
+ else
+ {
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+ using var __content = await __response.Content.ReadAsStreamAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ var __value = await global::Together.DeAdapterEntry.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Together.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
+ }
+ catch (global::System.Exception __ex)
+ {
+ string? __content = null;
+ try
+ {
+ __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+ }
+ catch (global::System.Exception)
+ {
+ }
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ }
+
+ }
+ }
+ finally
+ {
+ __httpRequest?.Dispose();
+ }
+ }
+ ///
+ /// Add a deployment adapter
+ /// Attaches a LoRA adapter to a deployment. If the deployment is at adapter capacity, force can evict the oldest adapter.
+ ///
+ ///
+ /// Project identifier.
+ ///
+ ///
+ /// Endpoint identifier.
+ ///
+ ///
+ /// Deployment identifier.
+ ///
+ ///
+ /// Adapter model identifier to attach.
+ ///
+ ///
+ /// Optional adapter revision to pin. If omitted, the latest revision is resolved at request time.
+ ///
+ ///
+ /// Whether to evict the oldest adapter if the deployment is at adapter capacity.
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task DeploymentServiceAddAdapterAsync(
+ string projectId,
+ string endpointId,
+ string deploymentId,
+ string adapterModelId,
+ string? adapterRevisionId = default,
+ bool? force = default,
+ global::Together.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __request = new global::Together.DeAddAdapterRequest
+ {
+ AdapterModelId = adapterModelId,
+ AdapterRevisionId = adapterRevisionId,
+ Force = force,
+ };
+
+ return await DeploymentServiceAddAdapterAsync(
+ projectId: projectId,
+ endpointId: endpointId,
+ deploymentId: deploymentId,
+ request: __request,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceCreateDeployment.g.cs b/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceCreateDeployment.g.cs
new file mode 100644
index 00000000..fe508302
--- /dev/null
+++ b/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceCreateDeployment.g.cs
@@ -0,0 +1,606 @@
+
+#nullable enable
+
+namespace Together
+{
+ public partial class DeploymentServiceClient
+ {
+
+ private static readonly global::Together.AutoSDKServer[] s_DeploymentServiceCreateDeploymentServers = new global::Together.AutoSDKServer[]
+ { new global::Together.AutoSDKServer(
+ id: "https-api-together-ai-v2",
+ name: "api.together.ai v2",
+ url: "https://api.together.ai/v2",
+ description: ""),
+ };
+
+
+ private static readonly global::Together.EndPointSecurityRequirement s_DeploymentServiceCreateDeploymentSecurityRequirement0 =
+ new global::Together.EndPointSecurityRequirement
+ {
+ Authorizations = new global::Together.EndPointAuthorizationRequirement[]
+ { new global::Together.EndPointAuthorizationRequirement
+ {
+ Type = "Http",
+ SchemeId = "BearerAuth",
+ Location = "Header",
+ Name = "Bearer",
+ FriendlyName = "Bearer",
+ },
+ },
+ };
+ private static readonly global::Together.EndPointSecurityRequirement[] s_DeploymentServiceCreateDeploymentSecurityRequirements =
+ new global::Together.EndPointSecurityRequirement[]
+ { s_DeploymentServiceCreateDeploymentSecurityRequirement0,
+ };
+ partial void PrepareDeploymentServiceCreateDeploymentArguments(
+ global::System.Net.Http.HttpClient httpClient,
+ ref string projectId,
+ ref string endpointId,
+ ref bool? validateOnly,
+ global::Together.DeCreateDeploymentRequest request);
+ partial void PrepareDeploymentServiceCreateDeploymentRequest(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpRequestMessage httpRequestMessage,
+ string projectId,
+ string endpointId,
+ bool? validateOnly,
+ global::Together.DeCreateDeploymentRequest request);
+ partial void ProcessDeploymentServiceCreateDeploymentResponse(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpResponseMessage httpResponseMessage);
+
+ partial void ProcessDeploymentServiceCreateDeploymentResponseContent(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpResponseMessage httpResponseMessage,
+ ref string content);
+
+ ///
+ /// Create a deployment
+ /// Creates a model deployment under an endpoint. The deployment provisions asynchronously; monitor its status before routing live traffic to it.
+ ///
+ ///
+ /// ID of the project that owns the endpoint.
+ ///
+ ///
+ /// ID of the endpoint that will contain the deployment.
+ ///
+ ///
+ /// When true, validates the request without creating or provisioning a deployment.
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task DeploymentServiceCreateDeploymentAsync(
+ string projectId,
+ string endpointId,
+
+ global::Together.DeCreateDeploymentRequest request,
+ bool? validateOnly = default,
+ global::Together.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await DeploymentServiceCreateDeploymentAsResponseAsync(
+ projectId: projectId,
+ endpointId: endpointId,
+
+ request: request,
+ validateOnly: validateOnly,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Create a deployment
+ /// Creates a model deployment under an endpoint. The deployment provisions asynchronously; monitor its status before routing live traffic to it.
+ ///
+ ///
+ /// ID of the project that owns the endpoint.
+ ///
+ ///
+ /// ID of the endpoint that will contain the deployment.
+ ///
+ ///
+ /// When true, validates the request without creating or provisioning a deployment.
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> DeploymentServiceCreateDeploymentAsResponseAsync(
+ string projectId,
+ string endpointId,
+
+ global::Together.DeCreateDeploymentRequest request,
+ bool? validateOnly = default,
+ global::Together.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ request = request ?? throw new global::System.ArgumentNullException(nameof(request));
+
+ PrepareArguments(
+ client: HttpClient);
+ PrepareDeploymentServiceCreateDeploymentArguments(
+ httpClient: HttpClient,
+ projectId: ref projectId,
+ endpointId: ref endpointId,
+ validateOnly: ref validateOnly,
+ request: request);
+
+
+ var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations(
+ availableAuthorizations: Authorizations,
+ securityRequirements: s_DeploymentServiceCreateDeploymentSecurityRequirements,
+ operationName: "DeploymentServiceCreateDeploymentAsync");
+
+ using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken);
+ var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken;
+ var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ fallbackValue: ReadResponseAsString);
+ var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ supportsRetry: true);
+
+ global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
+ {
+
+ var __pathBuilder = new global::Together.PathBuilder(
+ path: $"/projects/{projectId}/endpoints/{endpointId}/deployments",
+ baseUri: ResolveBaseUri(
+ servers: s_DeploymentServiceCreateDeploymentServers,
+ defaultBaseUrl: "https://api.together.ai/v2"));
+ __pathBuilder
+ .AddOptionalParameter("validateOnly", validateOnly?.ToString().ToLowerInvariant())
+ ;
+ var __path = __pathBuilder.ToString();
+ __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters(
+ path: __path,
+ clientParameters: Options.QueryParameters,
+ requestParameters: requestOptions?.QueryParameters);
+ 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" ||
+ __authorization.Type == "OpenIdConnect")
+ {
+ __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 = request.ToJson(JsonSerializerContext);
+ var __httpRequestContent = new global::System.Net.Http.StringContent(
+ content: __httpRequestContentBody,
+ encoding: global::System.Text.Encoding.UTF8,
+ mediaType: "application/json");
+ __httpRequest.Content = __httpRequestContent;
+ global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders(
+ request: __httpRequest,
+ clientHeaders: Options.Headers,
+ requestHeaders: requestOptions?.Headers);
+
+ PrepareRequest(
+ client: HttpClient,
+ request: __httpRequest);
+ PrepareDeploymentServiceCreateDeploymentRequest(
+ httpClient: HttpClient,
+ httpRequestMessage: __httpRequest,
+ projectId: projectId!,
+ endpointId: endpointId!,
+ validateOnly: validateOnly,
+ request: request);
+
+ return __httpRequest;
+ }
+
+ global::System.Net.Http.HttpRequestMessage? __httpRequest = null;
+ global::System.Net.Http.HttpResponseMessage? __response = null;
+ var __attemptNumber = 0;
+ try
+ {
+ for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++)
+ {
+ __attemptNumber = __attempt;
+ __httpRequest = __CreateHttpRequest();
+ await global::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "DeploymentServiceCreateDeployment",
+ methodName: "DeploymentServiceCreateDeploymentAsync",
+ pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ try
+ {
+ __response = await HttpClient.SendAsync(
+ request: __httpRequest,
+ completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ }
+ catch (global::System.Net.Http.HttpRequestException __exception)
+ {
+ var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
+ var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
+ await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "DeploymentServiceCreateDeployment",
+ methodName: "DeploymentServiceCreateDeploymentAsync",
+ pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: __exception,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ if (!__willRetry)
+ {
+ throw;
+ }
+
+ __httpRequest.Dispose();
+ __httpRequest = null;
+ await global::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ if (__response != null &&
+ __attempt < __maxAttempts &&
+ global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
+ {
+ var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
+ await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "DeploymentServiceCreateDeployment",
+ methodName: "DeploymentServiceCreateDeploymentAsync",
+ pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ break;
+ }
+
+ if (__response == null)
+ {
+ throw new global::System.InvalidOperationException("No response received.");
+ }
+
+ using (__response)
+ {
+
+ ProcessResponse(
+ client: HttpClient,
+ response: __response);
+ ProcessDeploymentServiceCreateDeploymentResponse(
+ httpClient: HttpClient,
+ httpResponseMessage: __response);
+ if (__response.IsSuccessStatusCode)
+ {
+ await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "DeploymentServiceCreateDeployment",
+ methodName: "DeploymentServiceCreateDeploymentAsync",
+ pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ else
+ {
+ await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "DeploymentServiceCreateDeployment",
+ methodName: "DeploymentServiceCreateDeploymentAsync",
+ pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ // Default error response
+ if (!__response.IsSuccessStatusCode)
+ {
+ string? __content_default = null;
+ global::System.Exception? __exception_default = null;
+ global::Together.ErrorData? __value_default = null;
+ try
+ {
+ if (__effectiveReadResponseAsString)
+ {
+ __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+ __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext);
+ }
+ else
+ {
+ __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+
+ __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext);
+ }
+ }
+ catch (global::System.Exception __ex)
+ {
+ __exception_default = __ex;
+ }
+
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content_default ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __exception_default,
+ responseBody: __content_default,
+ responseObject: __value_default,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+
+ if (__effectiveReadResponseAsString)
+ {
+ var __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ ProcessResponseContent(
+ client: HttpClient,
+ response: __response,
+ content: ref __content);
+ ProcessDeploymentServiceCreateDeploymentResponseContent(
+ httpClient: HttpClient,
+ httpResponseMessage: __response,
+ content: ref __content);
+
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+
+ var __value = global::Together.DeDeployment.FromJson(__content, JsonSerializerContext) ??
+ throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Together.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
+ }
+ catch (global::System.Exception __ex)
+ {
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ }
+ else
+ {
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+ using var __content = await __response.Content.ReadAsStreamAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ var __value = await global::Together.DeDeployment.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Together.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
+ }
+ catch (global::System.Exception __ex)
+ {
+ string? __content = null;
+ try
+ {
+ __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+ }
+ catch (global::System.Exception)
+ {
+ }
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ }
+
+ }
+ }
+ finally
+ {
+ __httpRequest?.Dispose();
+ }
+ }
+ ///
+ /// Create a deployment
+ /// Creates a model deployment under an endpoint. The deployment provisions asynchronously; monitor its status before routing live traffic to it.
+ ///
+ ///
+ /// ID of the project that owns the endpoint.
+ ///
+ ///
+ /// ID of the endpoint that will contain the deployment.
+ ///
+ ///
+ /// When true, validates the request without creating or provisioning a deployment.
+ ///
+ ///
+ /// Name for the deployment within its endpoint. Returned as a fully-qualified endpoint string.
+ ///
+ ///
+ /// Deprecated. Use `model`. Model identifier to serve, accepted when `model` is unset.
+ ///
+ ///
+ /// Deprecated. Use `model` with a /revisions/{revisionId} segment. If omitted, the latest revision is resolved at creation.
+ ///
+ ///
+ /// Deprecated. Use `config`. Config revision identifier to deploy, accepted when `config` is unset.
+ ///
+ ///
+ /// Model resource name in the form `projects/{projectId}/models/{modelId}[/revisions/{revisionId}]`. Omit the revision segment to pin the latest revision at creation time.
+ ///
+ ///
+ /// Autoscaling configuration for the deployment.
+ ///
+ ///
+ /// Immutable config revision in the form `projects/{projectId}/configs/{configRevisionId}`. The config must be compatible with the model.
+ ///
+ ///
+ /// Enables dynamic loading of LoRA adapters on the deployment.
+ ///
+ ///
+ /// Placement policy to use when scheduling the deployment.
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task DeploymentServiceCreateDeploymentAsync(
+ string projectId,
+ string endpointId,
+ string name,
+ global::Together.DeAutoscaling autoscaling,
+ bool? validateOnly = default,
+ string? modelId = default,
+ string? modelRevisionId = default,
+ string? configId = default,
+ string? model = default,
+ string? config = default,
+ bool? enableLora = default,
+ global::Together.DePlacement? placement = default,
+ global::Together.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __request = new global::Together.DeCreateDeploymentRequest
+ {
+ Name = name,
+ ModelId = modelId,
+ ModelRevisionId = modelRevisionId,
+ ConfigId = configId,
+ Model = model,
+ Autoscaling = autoscaling,
+ Config = config,
+ EnableLora = enableLora,
+ Placement = placement,
+ };
+
+ return await DeploymentServiceCreateDeploymentAsync(
+ projectId: projectId,
+ endpointId: endpointId,
+ validateOnly: validateOnly,
+ request: __request,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceDeleteDeployment.g.cs b/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceDeleteDeployment.g.cs
new file mode 100644
index 00000000..48fe4afc
--- /dev/null
+++ b/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceDeleteDeployment.g.cs
@@ -0,0 +1,519 @@
+
+#nullable enable
+
+namespace Together
+{
+ public partial class DeploymentServiceClient
+ {
+
+ private static readonly global::Together.AutoSDKServer[] s_DeploymentServiceDeleteDeploymentServers = new global::Together.AutoSDKServer[]
+ { new global::Together.AutoSDKServer(
+ id: "https-api-together-ai-v2",
+ name: "api.together.ai v2",
+ url: "https://api.together.ai/v2",
+ description: ""),
+ };
+
+
+ private static readonly global::Together.EndPointSecurityRequirement s_DeploymentServiceDeleteDeploymentSecurityRequirement0 =
+ new global::Together.EndPointSecurityRequirement
+ {
+ Authorizations = new global::Together.EndPointAuthorizationRequirement[]
+ { new global::Together.EndPointAuthorizationRequirement
+ {
+ Type = "Http",
+ SchemeId = "BearerAuth",
+ Location = "Header",
+ Name = "Bearer",
+ FriendlyName = "Bearer",
+ },
+ },
+ };
+ private static readonly global::Together.EndPointSecurityRequirement[] s_DeploymentServiceDeleteDeploymentSecurityRequirements =
+ new global::Together.EndPointSecurityRequirement[]
+ { s_DeploymentServiceDeleteDeploymentSecurityRequirement0,
+ };
+ partial void PrepareDeploymentServiceDeleteDeploymentArguments(
+ global::System.Net.Http.HttpClient httpClient,
+ ref string projectId,
+ ref string endpointId,
+ ref string id,
+ ref string? etag);
+ partial void PrepareDeploymentServiceDeleteDeploymentRequest(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpRequestMessage httpRequestMessage,
+ string projectId,
+ string endpointId,
+ string id,
+ string? etag);
+ partial void ProcessDeploymentServiceDeleteDeploymentResponse(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpResponseMessage httpResponseMessage);
+
+ partial void ProcessDeploymentServiceDeleteDeploymentResponseContent(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpResponseMessage httpResponseMessage,
+ ref string content);
+
+ ///
+ /// Delete a deployment
+ /// Permanently deletes a deployment from its endpoint. Remove the deployment from live traffic first; use `etag` to reject the request if it changed after it was read.
+ ///
+ ///
+ /// Project identifier.
+ ///
+ ///
+ /// Endpoint identifier.
+ ///
+ ///
+ /// Deployment identifier.
+ ///
+ ///
+ /// Etag for optimistic concurrency. If set, the delete is rejected if the current etag does not match.
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task DeploymentServiceDeleteDeploymentAsync(
+ string projectId,
+ string endpointId,
+ string id,
+ string? etag = default,
+ global::Together.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await DeploymentServiceDeleteDeploymentAsResponseAsync(
+ projectId: projectId,
+ endpointId: endpointId,
+ id: id,
+ etag: etag,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Delete a deployment
+ /// Permanently deletes a deployment from its endpoint. Remove the deployment from live traffic first; use `etag` to reject the request if it changed after it was read.
+ ///
+ ///
+ /// Project identifier.
+ ///
+ ///
+ /// Endpoint identifier.
+ ///
+ ///
+ /// Deployment identifier.
+ ///
+ ///
+ /// Etag for optimistic concurrency. If set, the delete is rejected if the current etag does not match.
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> DeploymentServiceDeleteDeploymentAsResponseAsync(
+ string projectId,
+ string endpointId,
+ string id,
+ string? etag = default,
+ global::Together.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ PrepareArguments(
+ client: HttpClient);
+ PrepareDeploymentServiceDeleteDeploymentArguments(
+ httpClient: HttpClient,
+ projectId: ref projectId,
+ endpointId: ref endpointId,
+ id: ref id,
+ etag: ref etag);
+
+
+ var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations(
+ availableAuthorizations: Authorizations,
+ securityRequirements: s_DeploymentServiceDeleteDeploymentSecurityRequirements,
+ operationName: "DeploymentServiceDeleteDeploymentAsync");
+
+ using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken);
+ var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken;
+ var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ fallbackValue: ReadResponseAsString);
+ var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ supportsRetry: true);
+
+ global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
+ {
+
+ var __pathBuilder = new global::Together.PathBuilder(
+ path: $"/projects/{projectId}/endpoints/{endpointId}/deployments/{id}",
+ baseUri: ResolveBaseUri(
+ servers: s_DeploymentServiceDeleteDeploymentServers,
+ defaultBaseUrl: "https://api.together.ai/v2"));
+ __pathBuilder
+ .AddOptionalParameter("etag", etag)
+ ;
+ var __path = __pathBuilder.ToString();
+ __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters(
+ path: __path,
+ clientParameters: Options.QueryParameters,
+ requestParameters: requestOptions?.QueryParameters);
+ var __httpRequest = new global::System.Net.Http.HttpRequestMessage(
+ method: global::System.Net.Http.HttpMethod.Delete,
+ 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" ||
+ __authorization.Type == "OpenIdConnect")
+ {
+ __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);
+ }
+ }
+ global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders(
+ request: __httpRequest,
+ clientHeaders: Options.Headers,
+ requestHeaders: requestOptions?.Headers);
+
+ PrepareRequest(
+ client: HttpClient,
+ request: __httpRequest);
+ PrepareDeploymentServiceDeleteDeploymentRequest(
+ httpClient: HttpClient,
+ httpRequestMessage: __httpRequest,
+ projectId: projectId!,
+ endpointId: endpointId!,
+ id: id!,
+ etag: etag);
+
+ return __httpRequest;
+ }
+
+ global::System.Net.Http.HttpRequestMessage? __httpRequest = null;
+ global::System.Net.Http.HttpResponseMessage? __response = null;
+ var __attemptNumber = 0;
+ try
+ {
+ for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++)
+ {
+ __attemptNumber = __attempt;
+ __httpRequest = __CreateHttpRequest();
+ await global::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "DeploymentServiceDeleteDeployment",
+ methodName: "DeploymentServiceDeleteDeploymentAsync",
+ pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{id}\"",
+ httpMethod: "DELETE",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ try
+ {
+ __response = await HttpClient.SendAsync(
+ request: __httpRequest,
+ completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ }
+ catch (global::System.Net.Http.HttpRequestException __exception)
+ {
+ var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
+ var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
+ await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "DeploymentServiceDeleteDeployment",
+ methodName: "DeploymentServiceDeleteDeploymentAsync",
+ pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{id}\"",
+ httpMethod: "DELETE",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: __exception,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ if (!__willRetry)
+ {
+ throw;
+ }
+
+ __httpRequest.Dispose();
+ __httpRequest = null;
+ await global::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ if (__response != null &&
+ __attempt < __maxAttempts &&
+ global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
+ {
+ var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
+ await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "DeploymentServiceDeleteDeployment",
+ methodName: "DeploymentServiceDeleteDeploymentAsync",
+ pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{id}\"",
+ httpMethod: "DELETE",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ break;
+ }
+
+ if (__response == null)
+ {
+ throw new global::System.InvalidOperationException("No response received.");
+ }
+
+ using (__response)
+ {
+
+ ProcessResponse(
+ client: HttpClient,
+ response: __response);
+ ProcessDeploymentServiceDeleteDeploymentResponse(
+ httpClient: HttpClient,
+ httpResponseMessage: __response);
+ if (__response.IsSuccessStatusCode)
+ {
+ await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "DeploymentServiceDeleteDeployment",
+ methodName: "DeploymentServiceDeleteDeploymentAsync",
+ pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{id}\"",
+ httpMethod: "DELETE",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ else
+ {
+ await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "DeploymentServiceDeleteDeployment",
+ methodName: "DeploymentServiceDeleteDeploymentAsync",
+ pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{id}\"",
+ httpMethod: "DELETE",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ // Default error response
+ if (!__response.IsSuccessStatusCode)
+ {
+ string? __content_default = null;
+ global::System.Exception? __exception_default = null;
+ global::Together.ErrorData? __value_default = null;
+ try
+ {
+ if (__effectiveReadResponseAsString)
+ {
+ __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+ __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext);
+ }
+ else
+ {
+ __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+
+ __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext);
+ }
+ }
+ catch (global::System.Exception __ex)
+ {
+ __exception_default = __ex;
+ }
+
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content_default ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __exception_default,
+ responseBody: __content_default,
+ responseObject: __value_default,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+
+ if (__effectiveReadResponseAsString)
+ {
+ var __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ ProcessResponseContent(
+ client: HttpClient,
+ response: __response,
+ content: ref __content);
+ ProcessDeploymentServiceDeleteDeploymentResponseContent(
+ httpClient: HttpClient,
+ httpResponseMessage: __response,
+ content: ref __content);
+
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+
+ var __value = global::Together.DeDeleteResponse.FromJson(__content, JsonSerializerContext) ??
+ throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Together.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
+ }
+ catch (global::System.Exception __ex)
+ {
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ }
+ else
+ {
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+ using var __content = await __response.Content.ReadAsStreamAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ var __value = await global::Together.DeDeleteResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Together.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
+ }
+ catch (global::System.Exception __ex)
+ {
+ string? __content = null;
+ try
+ {
+ __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+ }
+ catch (global::System.Exception)
+ {
+ }
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ }
+
+ }
+ }
+ finally
+ {
+ __httpRequest?.Dispose();
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceGetAdapter.g.cs b/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceGetAdapter.g.cs
new file mode 100644
index 00000000..9d0e21df
--- /dev/null
+++ b/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceGetAdapter.g.cs
@@ -0,0 +1,516 @@
+
+#nullable enable
+
+namespace Together
+{
+ public partial class DeploymentServiceClient
+ {
+
+ private static readonly global::Together.AutoSDKServer[] s_DeploymentServiceGetAdapterServers = new global::Together.AutoSDKServer[]
+ { new global::Together.AutoSDKServer(
+ id: "https-api-together-ai-v2",
+ name: "api.together.ai v2",
+ url: "https://api.together.ai/v2",
+ description: ""),
+ };
+
+
+ private static readonly global::Together.EndPointSecurityRequirement s_DeploymentServiceGetAdapterSecurityRequirement0 =
+ new global::Together.EndPointSecurityRequirement
+ {
+ Authorizations = new global::Together.EndPointAuthorizationRequirement[]
+ { new global::Together.EndPointAuthorizationRequirement
+ {
+ Type = "Http",
+ SchemeId = "BearerAuth",
+ Location = "Header",
+ Name = "Bearer",
+ FriendlyName = "Bearer",
+ },
+ },
+ };
+ private static readonly global::Together.EndPointSecurityRequirement[] s_DeploymentServiceGetAdapterSecurityRequirements =
+ new global::Together.EndPointSecurityRequirement[]
+ { s_DeploymentServiceGetAdapterSecurityRequirement0,
+ };
+ partial void PrepareDeploymentServiceGetAdapterArguments(
+ global::System.Net.Http.HttpClient httpClient,
+ ref string projectId,
+ ref string endpointId,
+ ref string deploymentId,
+ ref string id);
+ partial void PrepareDeploymentServiceGetAdapterRequest(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpRequestMessage httpRequestMessage,
+ string projectId,
+ string endpointId,
+ string deploymentId,
+ string id);
+ partial void ProcessDeploymentServiceGetAdapterResponse(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpResponseMessage httpResponseMessage);
+
+ partial void ProcessDeploymentServiceGetAdapterResponseContent(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpResponseMessage httpResponseMessage,
+ ref string content);
+
+ ///
+ /// Get a deployment adapter
+ /// Gets an attached adapter and its per-cluster load state.
+ ///
+ ///
+ /// Project identifier.
+ ///
+ ///
+ /// Endpoint identifier.
+ ///
+ ///
+ /// Deployment identifier.
+ ///
+ ///
+ /// Adapter model identifier.
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task DeploymentServiceGetAdapterAsync(
+ string projectId,
+ string endpointId,
+ string deploymentId,
+ string id,
+ global::Together.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await DeploymentServiceGetAdapterAsResponseAsync(
+ projectId: projectId,
+ endpointId: endpointId,
+ deploymentId: deploymentId,
+ id: id,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Get a deployment adapter
+ /// Gets an attached adapter and its per-cluster load state.
+ ///
+ ///
+ /// Project identifier.
+ ///
+ ///
+ /// Endpoint identifier.
+ ///
+ ///
+ /// Deployment identifier.
+ ///
+ ///
+ /// Adapter model identifier.
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> DeploymentServiceGetAdapterAsResponseAsync(
+ string projectId,
+ string endpointId,
+ string deploymentId,
+ string id,
+ global::Together.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ PrepareArguments(
+ client: HttpClient);
+ PrepareDeploymentServiceGetAdapterArguments(
+ httpClient: HttpClient,
+ projectId: ref projectId,
+ endpointId: ref endpointId,
+ deploymentId: ref deploymentId,
+ id: ref id);
+
+
+ var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations(
+ availableAuthorizations: Authorizations,
+ securityRequirements: s_DeploymentServiceGetAdapterSecurityRequirements,
+ operationName: "DeploymentServiceGetAdapterAsync");
+
+ using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken);
+ var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken;
+ var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ fallbackValue: ReadResponseAsString);
+ var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ supportsRetry: true);
+
+ global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
+ {
+
+ var __pathBuilder = new global::Together.PathBuilder(
+ path: $"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters/{id}",
+ baseUri: ResolveBaseUri(
+ servers: s_DeploymentServiceGetAdapterServers,
+ defaultBaseUrl: "https://api.together.ai/v2"));
+ var __path = __pathBuilder.ToString();
+ __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters(
+ path: __path,
+ clientParameters: Options.QueryParameters,
+ requestParameters: requestOptions?.QueryParameters);
+ 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" ||
+ __authorization.Type == "OpenIdConnect")
+ {
+ __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);
+ }
+ }
+ global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders(
+ request: __httpRequest,
+ clientHeaders: Options.Headers,
+ requestHeaders: requestOptions?.Headers);
+
+ PrepareRequest(
+ client: HttpClient,
+ request: __httpRequest);
+ PrepareDeploymentServiceGetAdapterRequest(
+ httpClient: HttpClient,
+ httpRequestMessage: __httpRequest,
+ projectId: projectId!,
+ endpointId: endpointId!,
+ deploymentId: deploymentId!,
+ id: id!);
+
+ return __httpRequest;
+ }
+
+ global::System.Net.Http.HttpRequestMessage? __httpRequest = null;
+ global::System.Net.Http.HttpResponseMessage? __response = null;
+ var __attemptNumber = 0;
+ try
+ {
+ for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++)
+ {
+ __attemptNumber = __attempt;
+ __httpRequest = __CreateHttpRequest();
+ await global::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "DeploymentServiceGetAdapter",
+ methodName: "DeploymentServiceGetAdapterAsync",
+ pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters/{id}\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ try
+ {
+ __response = await HttpClient.SendAsync(
+ request: __httpRequest,
+ completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ }
+ catch (global::System.Net.Http.HttpRequestException __exception)
+ {
+ var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
+ var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
+ await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "DeploymentServiceGetAdapter",
+ methodName: "DeploymentServiceGetAdapterAsync",
+ pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters/{id}\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: __exception,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ if (!__willRetry)
+ {
+ throw;
+ }
+
+ __httpRequest.Dispose();
+ __httpRequest = null;
+ await global::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ if (__response != null &&
+ __attempt < __maxAttempts &&
+ global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
+ {
+ var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
+ await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "DeploymentServiceGetAdapter",
+ methodName: "DeploymentServiceGetAdapterAsync",
+ pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters/{id}\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ break;
+ }
+
+ if (__response == null)
+ {
+ throw new global::System.InvalidOperationException("No response received.");
+ }
+
+ using (__response)
+ {
+
+ ProcessResponse(
+ client: HttpClient,
+ response: __response);
+ ProcessDeploymentServiceGetAdapterResponse(
+ httpClient: HttpClient,
+ httpResponseMessage: __response);
+ if (__response.IsSuccessStatusCode)
+ {
+ await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "DeploymentServiceGetAdapter",
+ methodName: "DeploymentServiceGetAdapterAsync",
+ pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters/{id}\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ else
+ {
+ await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "DeploymentServiceGetAdapter",
+ methodName: "DeploymentServiceGetAdapterAsync",
+ pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters/{id}\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ // Default error response
+ if (!__response.IsSuccessStatusCode)
+ {
+ string? __content_default = null;
+ global::System.Exception? __exception_default = null;
+ global::Together.ErrorData? __value_default = null;
+ try
+ {
+ if (__effectiveReadResponseAsString)
+ {
+ __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+ __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext);
+ }
+ else
+ {
+ __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+
+ __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext);
+ }
+ }
+ catch (global::System.Exception __ex)
+ {
+ __exception_default = __ex;
+ }
+
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content_default ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __exception_default,
+ responseBody: __content_default,
+ responseObject: __value_default,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+
+ if (__effectiveReadResponseAsString)
+ {
+ var __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ ProcessResponseContent(
+ client: HttpClient,
+ response: __response,
+ content: ref __content);
+ ProcessDeploymentServiceGetAdapterResponseContent(
+ httpClient: HttpClient,
+ httpResponseMessage: __response,
+ content: ref __content);
+
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+
+ var __value = global::Together.DeAdapterEntry.FromJson(__content, JsonSerializerContext) ??
+ throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Together.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
+ }
+ catch (global::System.Exception __ex)
+ {
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ }
+ else
+ {
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+ using var __content = await __response.Content.ReadAsStreamAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ var __value = await global::Together.DeAdapterEntry.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Together.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
+ }
+ catch (global::System.Exception __ex)
+ {
+ string? __content = null;
+ try
+ {
+ __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+ }
+ catch (global::System.Exception)
+ {
+ }
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ }
+
+ }
+ }
+ finally
+ {
+ __httpRequest?.Dispose();
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceGetDeployment.g.cs b/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceGetDeployment.g.cs
new file mode 100644
index 00000000..3b7c5723
--- /dev/null
+++ b/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceGetDeployment.g.cs
@@ -0,0 +1,503 @@
+
+#nullable enable
+
+namespace Together
+{
+ public partial class DeploymentServiceClient
+ {
+
+ private static readonly global::Together.AutoSDKServer[] s_DeploymentServiceGetDeploymentServers = new global::Together.AutoSDKServer[]
+ { new global::Together.AutoSDKServer(
+ id: "https-api-together-ai-v2",
+ name: "api.together.ai v2",
+ url: "https://api.together.ai/v2",
+ description: ""),
+ };
+
+
+ private static readonly global::Together.EndPointSecurityRequirement s_DeploymentServiceGetDeploymentSecurityRequirement0 =
+ new global::Together.EndPointSecurityRequirement
+ {
+ Authorizations = new global::Together.EndPointAuthorizationRequirement[]
+ { new global::Together.EndPointAuthorizationRequirement
+ {
+ Type = "Http",
+ SchemeId = "BearerAuth",
+ Location = "Header",
+ Name = "Bearer",
+ FriendlyName = "Bearer",
+ },
+ },
+ };
+ private static readonly global::Together.EndPointSecurityRequirement[] s_DeploymentServiceGetDeploymentSecurityRequirements =
+ new global::Together.EndPointSecurityRequirement[]
+ { s_DeploymentServiceGetDeploymentSecurityRequirement0,
+ };
+ partial void PrepareDeploymentServiceGetDeploymentArguments(
+ global::System.Net.Http.HttpClient httpClient,
+ ref string projectId,
+ ref string endpointId,
+ ref string id);
+ partial void PrepareDeploymentServiceGetDeploymentRequest(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpRequestMessage httpRequestMessage,
+ string projectId,
+ string endpointId,
+ string id);
+ partial void ProcessDeploymentServiceGetDeploymentResponse(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpResponseMessage httpResponseMessage);
+
+ partial void ProcessDeploymentServiceGetDeploymentResponseContent(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpResponseMessage httpResponseMessage,
+ ref string content);
+
+ ///
+ /// Get a deployment
+ /// Retrieves a deployment's desired configuration, placement, runtime information, and current provisioning status.
+ ///
+ ///
+ /// Project identifier.
+ ///
+ ///
+ /// Endpoint identifier.
+ ///
+ ///
+ /// Deployment identifier.
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task DeploymentServiceGetDeploymentAsync(
+ string projectId,
+ string endpointId,
+ string id,
+ global::Together.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await DeploymentServiceGetDeploymentAsResponseAsync(
+ projectId: projectId,
+ endpointId: endpointId,
+ id: id,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Get a deployment
+ /// Retrieves a deployment's desired configuration, placement, runtime information, and current provisioning status.
+ ///
+ ///
+ /// Project identifier.
+ ///
+ ///
+ /// Endpoint identifier.
+ ///
+ ///
+ /// Deployment identifier.
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> DeploymentServiceGetDeploymentAsResponseAsync(
+ string projectId,
+ string endpointId,
+ string id,
+ global::Together.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ PrepareArguments(
+ client: HttpClient);
+ PrepareDeploymentServiceGetDeploymentArguments(
+ httpClient: HttpClient,
+ projectId: ref projectId,
+ endpointId: ref endpointId,
+ id: ref id);
+
+
+ var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations(
+ availableAuthorizations: Authorizations,
+ securityRequirements: s_DeploymentServiceGetDeploymentSecurityRequirements,
+ operationName: "DeploymentServiceGetDeploymentAsync");
+
+ using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken);
+ var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken;
+ var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ fallbackValue: ReadResponseAsString);
+ var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ supportsRetry: true);
+
+ global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
+ {
+
+ var __pathBuilder = new global::Together.PathBuilder(
+ path: $"/projects/{projectId}/endpoints/{endpointId}/deployments/{id}",
+ baseUri: ResolveBaseUri(
+ servers: s_DeploymentServiceGetDeploymentServers,
+ defaultBaseUrl: "https://api.together.ai/v2"));
+ var __path = __pathBuilder.ToString();
+ __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters(
+ path: __path,
+ clientParameters: Options.QueryParameters,
+ requestParameters: requestOptions?.QueryParameters);
+ 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" ||
+ __authorization.Type == "OpenIdConnect")
+ {
+ __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);
+ }
+ }
+ global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders(
+ request: __httpRequest,
+ clientHeaders: Options.Headers,
+ requestHeaders: requestOptions?.Headers);
+
+ PrepareRequest(
+ client: HttpClient,
+ request: __httpRequest);
+ PrepareDeploymentServiceGetDeploymentRequest(
+ httpClient: HttpClient,
+ httpRequestMessage: __httpRequest,
+ projectId: projectId!,
+ endpointId: endpointId!,
+ id: id!);
+
+ return __httpRequest;
+ }
+
+ global::System.Net.Http.HttpRequestMessage? __httpRequest = null;
+ global::System.Net.Http.HttpResponseMessage? __response = null;
+ var __attemptNumber = 0;
+ try
+ {
+ for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++)
+ {
+ __attemptNumber = __attempt;
+ __httpRequest = __CreateHttpRequest();
+ await global::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "DeploymentServiceGetDeployment",
+ methodName: "DeploymentServiceGetDeploymentAsync",
+ pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{id}\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ try
+ {
+ __response = await HttpClient.SendAsync(
+ request: __httpRequest,
+ completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ }
+ catch (global::System.Net.Http.HttpRequestException __exception)
+ {
+ var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
+ var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
+ await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "DeploymentServiceGetDeployment",
+ methodName: "DeploymentServiceGetDeploymentAsync",
+ pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{id}\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: __exception,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ if (!__willRetry)
+ {
+ throw;
+ }
+
+ __httpRequest.Dispose();
+ __httpRequest = null;
+ await global::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ if (__response != null &&
+ __attempt < __maxAttempts &&
+ global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
+ {
+ var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
+ await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "DeploymentServiceGetDeployment",
+ methodName: "DeploymentServiceGetDeploymentAsync",
+ pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{id}\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ break;
+ }
+
+ if (__response == null)
+ {
+ throw new global::System.InvalidOperationException("No response received.");
+ }
+
+ using (__response)
+ {
+
+ ProcessResponse(
+ client: HttpClient,
+ response: __response);
+ ProcessDeploymentServiceGetDeploymentResponse(
+ httpClient: HttpClient,
+ httpResponseMessage: __response);
+ if (__response.IsSuccessStatusCode)
+ {
+ await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "DeploymentServiceGetDeployment",
+ methodName: "DeploymentServiceGetDeploymentAsync",
+ pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{id}\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ else
+ {
+ await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "DeploymentServiceGetDeployment",
+ methodName: "DeploymentServiceGetDeploymentAsync",
+ pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{id}\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ // Default error response
+ if (!__response.IsSuccessStatusCode)
+ {
+ string? __content_default = null;
+ global::System.Exception? __exception_default = null;
+ global::Together.ErrorData? __value_default = null;
+ try
+ {
+ if (__effectiveReadResponseAsString)
+ {
+ __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+ __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext);
+ }
+ else
+ {
+ __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+
+ __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext);
+ }
+ }
+ catch (global::System.Exception __ex)
+ {
+ __exception_default = __ex;
+ }
+
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content_default ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __exception_default,
+ responseBody: __content_default,
+ responseObject: __value_default,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+
+ if (__effectiveReadResponseAsString)
+ {
+ var __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ ProcessResponseContent(
+ client: HttpClient,
+ response: __response,
+ content: ref __content);
+ ProcessDeploymentServiceGetDeploymentResponseContent(
+ httpClient: HttpClient,
+ httpResponseMessage: __response,
+ content: ref __content);
+
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+
+ var __value = global::Together.DeDeployment.FromJson(__content, JsonSerializerContext) ??
+ throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Together.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
+ }
+ catch (global::System.Exception __ex)
+ {
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ }
+ else
+ {
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+ using var __content = await __response.Content.ReadAsStreamAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ var __value = await global::Together.DeDeployment.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Together.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
+ }
+ catch (global::System.Exception __ex)
+ {
+ string? __content = null;
+ try
+ {
+ __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+ }
+ catch (global::System.Exception)
+ {
+ }
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ }
+
+ }
+ }
+ finally
+ {
+ __httpRequest?.Dispose();
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceListAdapters.g.cs b/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceListAdapters.g.cs
new file mode 100644
index 00000000..ffc3a17e
--- /dev/null
+++ b/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceListAdapters.g.cs
@@ -0,0 +1,533 @@
+
+#nullable enable
+
+namespace Together
+{
+ public partial class DeploymentServiceClient
+ {
+
+ private static readonly global::Together.AutoSDKServer[] s_DeploymentServiceListAdaptersServers = new global::Together.AutoSDKServer[]
+ { new global::Together.AutoSDKServer(
+ id: "https-api-together-ai-v2",
+ name: "api.together.ai v2",
+ url: "https://api.together.ai/v2",
+ description: ""),
+ };
+
+
+ private static readonly global::Together.EndPointSecurityRequirement s_DeploymentServiceListAdaptersSecurityRequirement0 =
+ new global::Together.EndPointSecurityRequirement
+ {
+ Authorizations = new global::Together.EndPointAuthorizationRequirement[]
+ { new global::Together.EndPointAuthorizationRequirement
+ {
+ Type = "Http",
+ SchemeId = "BearerAuth",
+ Location = "Header",
+ Name = "Bearer",
+ FriendlyName = "Bearer",
+ },
+ },
+ };
+ private static readonly global::Together.EndPointSecurityRequirement[] s_DeploymentServiceListAdaptersSecurityRequirements =
+ new global::Together.EndPointSecurityRequirement[]
+ { s_DeploymentServiceListAdaptersSecurityRequirement0,
+ };
+ partial void PrepareDeploymentServiceListAdaptersArguments(
+ global::System.Net.Http.HttpClient httpClient,
+ ref string projectId,
+ ref string endpointId,
+ ref string deploymentId,
+ ref int? limit,
+ ref string? after);
+ partial void PrepareDeploymentServiceListAdaptersRequest(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpRequestMessage httpRequestMessage,
+ string projectId,
+ string endpointId,
+ string deploymentId,
+ int? limit,
+ string? after);
+ partial void ProcessDeploymentServiceListAdaptersResponse(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpResponseMessage httpResponseMessage);
+
+ partial void ProcessDeploymentServiceListAdaptersResponseContent(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpResponseMessage httpResponseMessage,
+ ref string content);
+
+ ///
+ /// List deployment adapters
+ /// Lists LoRA adapters attached to a deployment with per-cluster load state.
+ ///
+ ///
+ /// Project identifier.
+ ///
+ ///
+ /// Endpoint identifier.
+ ///
+ ///
+ /// Deployment identifier.
+ ///
+ ///
+ /// Maximum number of adapters to return.
+ ///
+ ///
+ /// Cursor from a previous adapter list response.
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task DeploymentServiceListAdaptersAsync(
+ string projectId,
+ string endpointId,
+ string deploymentId,
+ int? limit = default,
+ string? after = default,
+ global::Together.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await DeploymentServiceListAdaptersAsResponseAsync(
+ projectId: projectId,
+ endpointId: endpointId,
+ deploymentId: deploymentId,
+ limit: limit,
+ after: after,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// List deployment adapters
+ /// Lists LoRA adapters attached to a deployment with per-cluster load state.
+ ///
+ ///
+ /// Project identifier.
+ ///
+ ///
+ /// Endpoint identifier.
+ ///
+ ///
+ /// Deployment identifier.
+ ///
+ ///
+ /// Maximum number of adapters to return.
+ ///
+ ///
+ /// Cursor from a previous adapter list response.
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> DeploymentServiceListAdaptersAsResponseAsync(
+ string projectId,
+ string endpointId,
+ string deploymentId,
+ int? limit = default,
+ string? after = default,
+ global::Together.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ PrepareArguments(
+ client: HttpClient);
+ PrepareDeploymentServiceListAdaptersArguments(
+ httpClient: HttpClient,
+ projectId: ref projectId,
+ endpointId: ref endpointId,
+ deploymentId: ref deploymentId,
+ limit: ref limit,
+ after: ref after);
+
+
+ var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations(
+ availableAuthorizations: Authorizations,
+ securityRequirements: s_DeploymentServiceListAdaptersSecurityRequirements,
+ operationName: "DeploymentServiceListAdaptersAsync");
+
+ using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken);
+ var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken;
+ var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ fallbackValue: ReadResponseAsString);
+ var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ supportsRetry: true);
+
+ global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
+ {
+
+ var __pathBuilder = new global::Together.PathBuilder(
+ path: $"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters",
+ baseUri: ResolveBaseUri(
+ servers: s_DeploymentServiceListAdaptersServers,
+ defaultBaseUrl: "https://api.together.ai/v2"));
+ __pathBuilder
+ .AddOptionalParameter("limit", limit?.ToString())
+ .AddOptionalParameter("after", after)
+ ;
+ var __path = __pathBuilder.ToString();
+ __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters(
+ path: __path,
+ clientParameters: Options.QueryParameters,
+ requestParameters: requestOptions?.QueryParameters);
+ 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" ||
+ __authorization.Type == "OpenIdConnect")
+ {
+ __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);
+ }
+ }
+ global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders(
+ request: __httpRequest,
+ clientHeaders: Options.Headers,
+ requestHeaders: requestOptions?.Headers);
+
+ PrepareRequest(
+ client: HttpClient,
+ request: __httpRequest);
+ PrepareDeploymentServiceListAdaptersRequest(
+ httpClient: HttpClient,
+ httpRequestMessage: __httpRequest,
+ projectId: projectId!,
+ endpointId: endpointId!,
+ deploymentId: deploymentId!,
+ limit: limit,
+ after: after);
+
+ return __httpRequest;
+ }
+
+ global::System.Net.Http.HttpRequestMessage? __httpRequest = null;
+ global::System.Net.Http.HttpResponseMessage? __response = null;
+ var __attemptNumber = 0;
+ try
+ {
+ for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++)
+ {
+ __attemptNumber = __attempt;
+ __httpRequest = __CreateHttpRequest();
+ await global::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "DeploymentServiceListAdapters",
+ methodName: "DeploymentServiceListAdaptersAsync",
+ pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ try
+ {
+ __response = await HttpClient.SendAsync(
+ request: __httpRequest,
+ completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ }
+ catch (global::System.Net.Http.HttpRequestException __exception)
+ {
+ var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
+ var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
+ await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "DeploymentServiceListAdapters",
+ methodName: "DeploymentServiceListAdaptersAsync",
+ pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: __exception,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ if (!__willRetry)
+ {
+ throw;
+ }
+
+ __httpRequest.Dispose();
+ __httpRequest = null;
+ await global::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ if (__response != null &&
+ __attempt < __maxAttempts &&
+ global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
+ {
+ var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
+ await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "DeploymentServiceListAdapters",
+ methodName: "DeploymentServiceListAdaptersAsync",
+ pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ break;
+ }
+
+ if (__response == null)
+ {
+ throw new global::System.InvalidOperationException("No response received.");
+ }
+
+ using (__response)
+ {
+
+ ProcessResponse(
+ client: HttpClient,
+ response: __response);
+ ProcessDeploymentServiceListAdaptersResponse(
+ httpClient: HttpClient,
+ httpResponseMessage: __response);
+ if (__response.IsSuccessStatusCode)
+ {
+ await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "DeploymentServiceListAdapters",
+ methodName: "DeploymentServiceListAdaptersAsync",
+ pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ else
+ {
+ await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "DeploymentServiceListAdapters",
+ methodName: "DeploymentServiceListAdaptersAsync",
+ pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ // Default error response
+ if (!__response.IsSuccessStatusCode)
+ {
+ string? __content_default = null;
+ global::System.Exception? __exception_default = null;
+ global::Together.ErrorData? __value_default = null;
+ try
+ {
+ if (__effectiveReadResponseAsString)
+ {
+ __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+ __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext);
+ }
+ else
+ {
+ __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+
+ __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext);
+ }
+ }
+ catch (global::System.Exception __ex)
+ {
+ __exception_default = __ex;
+ }
+
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content_default ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __exception_default,
+ responseBody: __content_default,
+ responseObject: __value_default,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+
+ if (__effectiveReadResponseAsString)
+ {
+ var __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ ProcessResponseContent(
+ client: HttpClient,
+ response: __response,
+ content: ref __content);
+ ProcessDeploymentServiceListAdaptersResponseContent(
+ httpClient: HttpClient,
+ httpResponseMessage: __response,
+ content: ref __content);
+
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+
+ var __value = global::Together.DeListAdaptersResponse.FromJson(__content, JsonSerializerContext) ??
+ throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Together.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
+ }
+ catch (global::System.Exception __ex)
+ {
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ }
+ else
+ {
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+ using var __content = await __response.Content.ReadAsStreamAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ var __value = await global::Together.DeListAdaptersResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Together.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
+ }
+ catch (global::System.Exception __ex)
+ {
+ string? __content = null;
+ try
+ {
+ __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+ }
+ catch (global::System.Exception)
+ {
+ }
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ }
+
+ }
+ }
+ finally
+ {
+ __httpRequest?.Dispose();
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceListDeployments.g.cs b/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceListDeployments.g.cs
new file mode 100644
index 00000000..c343b5bf
--- /dev/null
+++ b/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceListDeployments.g.cs
@@ -0,0 +1,548 @@
+
+#nullable enable
+
+namespace Together
+{
+ public partial class DeploymentServiceClient
+ {
+
+ private static readonly global::Together.AutoSDKServer[] s_DeploymentServiceListDeploymentsServers = new global::Together.AutoSDKServer[]
+ { new global::Together.AutoSDKServer(
+ id: "https-api-together-ai-v2",
+ name: "api.together.ai v2",
+ url: "https://api.together.ai/v2",
+ description: ""),
+ };
+
+
+ private static readonly global::Together.EndPointSecurityRequirement s_DeploymentServiceListDeploymentsSecurityRequirement0 =
+ new global::Together.EndPointSecurityRequirement
+ {
+ Authorizations = new global::Together.EndPointAuthorizationRequirement[]
+ { new global::Together.EndPointAuthorizationRequirement
+ {
+ Type = "Http",
+ SchemeId = "BearerAuth",
+ Location = "Header",
+ Name = "Bearer",
+ FriendlyName = "Bearer",
+ },
+ },
+ };
+ private static readonly global::Together.EndPointSecurityRequirement[] s_DeploymentServiceListDeploymentsSecurityRequirements =
+ new global::Together.EndPointSecurityRequirement[]
+ { s_DeploymentServiceListDeploymentsSecurityRequirement0,
+ };
+ partial void PrepareDeploymentServiceListDeploymentsArguments(
+ global::System.Net.Http.HttpClient httpClient,
+ ref string projectId,
+ ref string endpointId,
+ ref int? limit,
+ ref string? after,
+ ref string? orderBy,
+ ref string? filter);
+ partial void PrepareDeploymentServiceListDeploymentsRequest(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpRequestMessage httpRequestMessage,
+ string projectId,
+ string endpointId,
+ int? limit,
+ string? after,
+ string? orderBy,
+ string? filter);
+ partial void ProcessDeploymentServiceListDeploymentsResponse(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpResponseMessage httpResponseMessage);
+
+ partial void ProcessDeploymentServiceListDeploymentsResponseContent(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpResponseMessage httpResponseMessage,
+ ref string content);
+
+ ///
+ /// List deployments
+ /// Lists the deployments attached to an endpoint, including their model, configuration, scaling settings, placement, and current status.
+ ///
+ ///
+ /// ID of the project that owns the endpoint.
+ ///
+ ///
+ /// ID of the endpoint whose deployments are listed.
+ ///
+ ///
+ /// Maximum number of deployments to return. Max 500, defaults to 50.
+ ///
+ ///
+ /// Cursor from a previous deployment list response.
+ ///
+ ///
+ /// Sort field for the results. Supports `created_at` or `updated_at`, optionally followed by `asc` or `desc`.
+ ///
+ ///
+ /// Filter expression using `name`, `state`, `model`, `created_at`, or `updated_at` with comparison operators and AND/OR/NOT; `state` takes a DeploymentState enum name and `model` takes a model resource name. `name` supports substring matching with `:` and prefix/suffix wildcards with `*`, and accepts a bare deployment name or `<project_slug>/<endpoint_name>/<deployment_name>`.
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task DeploymentServiceListDeploymentsAsync(
+ string projectId,
+ string endpointId,
+ int? limit = default,
+ string? after = default,
+ string? orderBy = default,
+ string? filter = default,
+ global::Together.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await DeploymentServiceListDeploymentsAsResponseAsync(
+ projectId: projectId,
+ endpointId: endpointId,
+ limit: limit,
+ after: after,
+ orderBy: orderBy,
+ filter: filter,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// List deployments
+ /// Lists the deployments attached to an endpoint, including their model, configuration, scaling settings, placement, and current status.
+ ///
+ ///
+ /// ID of the project that owns the endpoint.
+ ///
+ ///
+ /// ID of the endpoint whose deployments are listed.
+ ///
+ ///
+ /// Maximum number of deployments to return. Max 500, defaults to 50.
+ ///
+ ///
+ /// Cursor from a previous deployment list response.
+ ///
+ ///
+ /// Sort field for the results. Supports `created_at` or `updated_at`, optionally followed by `asc` or `desc`.
+ ///
+ ///
+ /// Filter expression using `name`, `state`, `model`, `created_at`, or `updated_at` with comparison operators and AND/OR/NOT; `state` takes a DeploymentState enum name and `model` takes a model resource name. `name` supports substring matching with `:` and prefix/suffix wildcards with `*`, and accepts a bare deployment name or `<project_slug>/<endpoint_name>/<deployment_name>`.
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> DeploymentServiceListDeploymentsAsResponseAsync(
+ string projectId,
+ string endpointId,
+ int? limit = default,
+ string? after = default,
+ string? orderBy = default,
+ string? filter = default,
+ global::Together.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ PrepareArguments(
+ client: HttpClient);
+ PrepareDeploymentServiceListDeploymentsArguments(
+ httpClient: HttpClient,
+ projectId: ref projectId,
+ endpointId: ref endpointId,
+ limit: ref limit,
+ after: ref after,
+ orderBy: ref orderBy,
+ filter: ref filter);
+
+
+ var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations(
+ availableAuthorizations: Authorizations,
+ securityRequirements: s_DeploymentServiceListDeploymentsSecurityRequirements,
+ operationName: "DeploymentServiceListDeploymentsAsync");
+
+ using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken);
+ var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken;
+ var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ fallbackValue: ReadResponseAsString);
+ var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ supportsRetry: true);
+
+ global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
+ {
+
+ var __pathBuilder = new global::Together.PathBuilder(
+ path: $"/projects/{projectId}/endpoints/{endpointId}/deployments",
+ baseUri: ResolveBaseUri(
+ servers: s_DeploymentServiceListDeploymentsServers,
+ defaultBaseUrl: "https://api.together.ai/v2"));
+ __pathBuilder
+ .AddOptionalParameter("limit", limit?.ToString())
+ .AddOptionalParameter("after", after)
+ .AddOptionalParameter("orderBy", orderBy)
+ .AddOptionalParameter("filter", filter)
+ ;
+ var __path = __pathBuilder.ToString();
+ __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters(
+ path: __path,
+ clientParameters: Options.QueryParameters,
+ requestParameters: requestOptions?.QueryParameters);
+ 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" ||
+ __authorization.Type == "OpenIdConnect")
+ {
+ __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);
+ }
+ }
+ global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders(
+ request: __httpRequest,
+ clientHeaders: Options.Headers,
+ requestHeaders: requestOptions?.Headers);
+
+ PrepareRequest(
+ client: HttpClient,
+ request: __httpRequest);
+ PrepareDeploymentServiceListDeploymentsRequest(
+ httpClient: HttpClient,
+ httpRequestMessage: __httpRequest,
+ projectId: projectId!,
+ endpointId: endpointId!,
+ limit: limit,
+ after: after,
+ orderBy: orderBy,
+ filter: filter);
+
+ return __httpRequest;
+ }
+
+ global::System.Net.Http.HttpRequestMessage? __httpRequest = null;
+ global::System.Net.Http.HttpResponseMessage? __response = null;
+ var __attemptNumber = 0;
+ try
+ {
+ for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++)
+ {
+ __attemptNumber = __attempt;
+ __httpRequest = __CreateHttpRequest();
+ await global::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "DeploymentServiceListDeployments",
+ methodName: "DeploymentServiceListDeploymentsAsync",
+ pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ try
+ {
+ __response = await HttpClient.SendAsync(
+ request: __httpRequest,
+ completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ }
+ catch (global::System.Net.Http.HttpRequestException __exception)
+ {
+ var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
+ var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
+ await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "DeploymentServiceListDeployments",
+ methodName: "DeploymentServiceListDeploymentsAsync",
+ pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: __exception,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ if (!__willRetry)
+ {
+ throw;
+ }
+
+ __httpRequest.Dispose();
+ __httpRequest = null;
+ await global::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ if (__response != null &&
+ __attempt < __maxAttempts &&
+ global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
+ {
+ var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
+ await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "DeploymentServiceListDeployments",
+ methodName: "DeploymentServiceListDeploymentsAsync",
+ pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ break;
+ }
+
+ if (__response == null)
+ {
+ throw new global::System.InvalidOperationException("No response received.");
+ }
+
+ using (__response)
+ {
+
+ ProcessResponse(
+ client: HttpClient,
+ response: __response);
+ ProcessDeploymentServiceListDeploymentsResponse(
+ httpClient: HttpClient,
+ httpResponseMessage: __response);
+ if (__response.IsSuccessStatusCode)
+ {
+ await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "DeploymentServiceListDeployments",
+ methodName: "DeploymentServiceListDeploymentsAsync",
+ pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ else
+ {
+ await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "DeploymentServiceListDeployments",
+ methodName: "DeploymentServiceListDeploymentsAsync",
+ pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ // Default error response
+ if (!__response.IsSuccessStatusCode)
+ {
+ string? __content_default = null;
+ global::System.Exception? __exception_default = null;
+ global::Together.ErrorData? __value_default = null;
+ try
+ {
+ if (__effectiveReadResponseAsString)
+ {
+ __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+ __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext);
+ }
+ else
+ {
+ __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+
+ __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext);
+ }
+ }
+ catch (global::System.Exception __ex)
+ {
+ __exception_default = __ex;
+ }
+
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content_default ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __exception_default,
+ responseBody: __content_default,
+ responseObject: __value_default,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+
+ if (__effectiveReadResponseAsString)
+ {
+ var __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ ProcessResponseContent(
+ client: HttpClient,
+ response: __response,
+ content: ref __content);
+ ProcessDeploymentServiceListDeploymentsResponseContent(
+ httpClient: HttpClient,
+ httpResponseMessage: __response,
+ content: ref __content);
+
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+
+ var __value = global::Together.DeListDeploymentsResponse.FromJson(__content, JsonSerializerContext) ??
+ throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Together.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
+ }
+ catch (global::System.Exception __ex)
+ {
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ }
+ else
+ {
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+ using var __content = await __response.Content.ReadAsStreamAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ var __value = await global::Together.DeListDeploymentsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Together.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
+ }
+ catch (global::System.Exception __ex)
+ {
+ string? __content = null;
+ try
+ {
+ __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+ }
+ catch (global::System.Exception)
+ {
+ }
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ }
+
+ }
+ }
+ finally
+ {
+ __httpRequest?.Dispose();
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceRemoveAdapter.g.cs b/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceRemoveAdapter.g.cs
new file mode 100644
index 00000000..38e946c9
--- /dev/null
+++ b/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceRemoveAdapter.g.cs
@@ -0,0 +1,532 @@
+
+#nullable enable
+
+namespace Together
+{
+ public partial class DeploymentServiceClient
+ {
+
+ private static readonly global::Together.AutoSDKServer[] s_DeploymentServiceRemoveAdapterServers = new global::Together.AutoSDKServer[]
+ { new global::Together.AutoSDKServer(
+ id: "https-api-together-ai-v2",
+ name: "api.together.ai v2",
+ url: "https://api.together.ai/v2",
+ description: ""),
+ };
+
+
+ private static readonly global::Together.EndPointSecurityRequirement s_DeploymentServiceRemoveAdapterSecurityRequirement0 =
+ new global::Together.EndPointSecurityRequirement
+ {
+ Authorizations = new global::Together.EndPointAuthorizationRequirement[]
+ { new global::Together.EndPointAuthorizationRequirement
+ {
+ Type = "Http",
+ SchemeId = "BearerAuth",
+ Location = "Header",
+ Name = "Bearer",
+ FriendlyName = "Bearer",
+ },
+ },
+ };
+ private static readonly global::Together.EndPointSecurityRequirement[] s_DeploymentServiceRemoveAdapterSecurityRequirements =
+ new global::Together.EndPointSecurityRequirement[]
+ { s_DeploymentServiceRemoveAdapterSecurityRequirement0,
+ };
+ partial void PrepareDeploymentServiceRemoveAdapterArguments(
+ global::System.Net.Http.HttpClient httpClient,
+ ref string projectId,
+ ref string endpointId,
+ ref string deploymentId,
+ ref string id,
+ ref string etag);
+ partial void PrepareDeploymentServiceRemoveAdapterRequest(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpRequestMessage httpRequestMessage,
+ string projectId,
+ string endpointId,
+ string deploymentId,
+ string id,
+ string etag);
+ partial void ProcessDeploymentServiceRemoveAdapterResponse(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpResponseMessage httpResponseMessage);
+
+ partial void ProcessDeploymentServiceRemoveAdapterResponseContent(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpResponseMessage httpResponseMessage,
+ ref string content);
+
+ ///
+ /// Remove a deployment adapter
+ /// Detaches an adapter from a deployment using its row-level etag for optimistic concurrency.
+ ///
+ ///
+ /// Project identifier.
+ ///
+ ///
+ /// Endpoint identifier.
+ ///
+ ///
+ /// Deployment identifier.
+ ///
+ ///
+ /// Adapter model identifier.
+ ///
+ ///
+ /// Adapter etag from a previous add, update, get, or list response. The removal is rejected if the adapter changed after that response.
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task DeploymentServiceRemoveAdapterAsync(
+ string projectId,
+ string endpointId,
+ string deploymentId,
+ string id,
+ string etag,
+ global::Together.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await DeploymentServiceRemoveAdapterAsResponseAsync(
+ projectId: projectId,
+ endpointId: endpointId,
+ deploymentId: deploymentId,
+ id: id,
+ etag: etag,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Remove a deployment adapter
+ /// Detaches an adapter from a deployment using its row-level etag for optimistic concurrency.
+ ///
+ ///
+ /// Project identifier.
+ ///
+ ///
+ /// Endpoint identifier.
+ ///
+ ///
+ /// Deployment identifier.
+ ///
+ ///
+ /// Adapter model identifier.
+ ///
+ ///
+ /// Adapter etag from a previous add, update, get, or list response. The removal is rejected if the adapter changed after that response.
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> DeploymentServiceRemoveAdapterAsResponseAsync(
+ string projectId,
+ string endpointId,
+ string deploymentId,
+ string id,
+ string etag,
+ global::Together.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ PrepareArguments(
+ client: HttpClient);
+ PrepareDeploymentServiceRemoveAdapterArguments(
+ httpClient: HttpClient,
+ projectId: ref projectId,
+ endpointId: ref endpointId,
+ deploymentId: ref deploymentId,
+ id: ref id,
+ etag: ref etag);
+
+
+ var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations(
+ availableAuthorizations: Authorizations,
+ securityRequirements: s_DeploymentServiceRemoveAdapterSecurityRequirements,
+ operationName: "DeploymentServiceRemoveAdapterAsync");
+
+ using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken);
+ var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken;
+ var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ fallbackValue: ReadResponseAsString);
+ var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ supportsRetry: true);
+
+ global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
+ {
+
+ var __pathBuilder = new global::Together.PathBuilder(
+ path: $"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters/{id}",
+ baseUri: ResolveBaseUri(
+ servers: s_DeploymentServiceRemoveAdapterServers,
+ defaultBaseUrl: "https://api.together.ai/v2"));
+ __pathBuilder
+ .AddRequiredParameter("etag", etag)
+ ;
+ var __path = __pathBuilder.ToString();
+ __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters(
+ path: __path,
+ clientParameters: Options.QueryParameters,
+ requestParameters: requestOptions?.QueryParameters);
+ var __httpRequest = new global::System.Net.Http.HttpRequestMessage(
+ method: global::System.Net.Http.HttpMethod.Delete,
+ 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" ||
+ __authorization.Type == "OpenIdConnect")
+ {
+ __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);
+ }
+ }
+ global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders(
+ request: __httpRequest,
+ clientHeaders: Options.Headers,
+ requestHeaders: requestOptions?.Headers);
+
+ PrepareRequest(
+ client: HttpClient,
+ request: __httpRequest);
+ PrepareDeploymentServiceRemoveAdapterRequest(
+ httpClient: HttpClient,
+ httpRequestMessage: __httpRequest,
+ projectId: projectId!,
+ endpointId: endpointId!,
+ deploymentId: deploymentId!,
+ id: id!,
+ etag: etag!);
+
+ return __httpRequest;
+ }
+
+ global::System.Net.Http.HttpRequestMessage? __httpRequest = null;
+ global::System.Net.Http.HttpResponseMessage? __response = null;
+ var __attemptNumber = 0;
+ try
+ {
+ for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++)
+ {
+ __attemptNumber = __attempt;
+ __httpRequest = __CreateHttpRequest();
+ await global::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "DeploymentServiceRemoveAdapter",
+ methodName: "DeploymentServiceRemoveAdapterAsync",
+ pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters/{id}\"",
+ httpMethod: "DELETE",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ try
+ {
+ __response = await HttpClient.SendAsync(
+ request: __httpRequest,
+ completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ }
+ catch (global::System.Net.Http.HttpRequestException __exception)
+ {
+ var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
+ var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
+ await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "DeploymentServiceRemoveAdapter",
+ methodName: "DeploymentServiceRemoveAdapterAsync",
+ pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters/{id}\"",
+ httpMethod: "DELETE",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: __exception,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ if (!__willRetry)
+ {
+ throw;
+ }
+
+ __httpRequest.Dispose();
+ __httpRequest = null;
+ await global::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ if (__response != null &&
+ __attempt < __maxAttempts &&
+ global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
+ {
+ var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
+ await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "DeploymentServiceRemoveAdapter",
+ methodName: "DeploymentServiceRemoveAdapterAsync",
+ pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters/{id}\"",
+ httpMethod: "DELETE",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ break;
+ }
+
+ if (__response == null)
+ {
+ throw new global::System.InvalidOperationException("No response received.");
+ }
+
+ using (__response)
+ {
+
+ ProcessResponse(
+ client: HttpClient,
+ response: __response);
+ ProcessDeploymentServiceRemoveAdapterResponse(
+ httpClient: HttpClient,
+ httpResponseMessage: __response);
+ if (__response.IsSuccessStatusCode)
+ {
+ await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "DeploymentServiceRemoveAdapter",
+ methodName: "DeploymentServiceRemoveAdapterAsync",
+ pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters/{id}\"",
+ httpMethod: "DELETE",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ else
+ {
+ await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "DeploymentServiceRemoveAdapter",
+ methodName: "DeploymentServiceRemoveAdapterAsync",
+ pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters/{id}\"",
+ httpMethod: "DELETE",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ // Default error response
+ if (!__response.IsSuccessStatusCode)
+ {
+ string? __content_default = null;
+ global::System.Exception? __exception_default = null;
+ global::Together.ErrorData? __value_default = null;
+ try
+ {
+ if (__effectiveReadResponseAsString)
+ {
+ __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+ __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext);
+ }
+ else
+ {
+ __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+
+ __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext);
+ }
+ }
+ catch (global::System.Exception __ex)
+ {
+ __exception_default = __ex;
+ }
+
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content_default ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __exception_default,
+ responseBody: __content_default,
+ responseObject: __value_default,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+
+ if (__effectiveReadResponseAsString)
+ {
+ var __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ ProcessResponseContent(
+ client: HttpClient,
+ response: __response,
+ content: ref __content);
+ ProcessDeploymentServiceRemoveAdapterResponseContent(
+ httpClient: HttpClient,
+ httpResponseMessage: __response,
+ content: ref __content);
+
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+
+ var __value = global::Together.DeDeleteResponse.FromJson(__content, JsonSerializerContext) ??
+ throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Together.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
+ }
+ catch (global::System.Exception __ex)
+ {
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ }
+ else
+ {
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+ using var __content = await __response.Content.ReadAsStreamAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ var __value = await global::Together.DeDeleteResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Together.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
+ }
+ catch (global::System.Exception __ex)
+ {
+ string? __content = null;
+ try
+ {
+ __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+ }
+ catch (global::System.Exception)
+ {
+ }
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ }
+
+ }
+ }
+ finally
+ {
+ __httpRequest?.Dispose();
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceUpdateAdapter.g.cs b/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceUpdateAdapter.g.cs
new file mode 100644
index 00000000..4ffab614
--- /dev/null
+++ b/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceUpdateAdapter.g.cs
@@ -0,0 +1,586 @@
+
+#nullable enable
+
+namespace Together
+{
+ public partial class DeploymentServiceClient
+ {
+
+ private static readonly global::Together.AutoSDKServer[] s_DeploymentServiceUpdateAdapterServers = new global::Together.AutoSDKServer[]
+ { new global::Together.AutoSDKServer(
+ id: "https-api-together-ai-v2",
+ name: "api.together.ai v2",
+ url: "https://api.together.ai/v2",
+ description: ""),
+ };
+
+
+ private static readonly global::Together.EndPointSecurityRequirement s_DeploymentServiceUpdateAdapterSecurityRequirement0 =
+ new global::Together.EndPointSecurityRequirement
+ {
+ Authorizations = new global::Together.EndPointAuthorizationRequirement[]
+ { new global::Together.EndPointAuthorizationRequirement
+ {
+ Type = "Http",
+ SchemeId = "BearerAuth",
+ Location = "Header",
+ Name = "Bearer",
+ FriendlyName = "Bearer",
+ },
+ },
+ };
+ private static readonly global::Together.EndPointSecurityRequirement[] s_DeploymentServiceUpdateAdapterSecurityRequirements =
+ new global::Together.EndPointSecurityRequirement[]
+ { s_DeploymentServiceUpdateAdapterSecurityRequirement0,
+ };
+ partial void PrepareDeploymentServiceUpdateAdapterArguments(
+ global::System.Net.Http.HttpClient httpClient,
+ ref string projectId,
+ ref string endpointId,
+ ref string deploymentId,
+ ref string id,
+ global::Together.DeUpdateAdapterRequest request);
+ partial void PrepareDeploymentServiceUpdateAdapterRequest(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpRequestMessage httpRequestMessage,
+ string projectId,
+ string endpointId,
+ string deploymentId,
+ string id,
+ global::Together.DeUpdateAdapterRequest request);
+ partial void ProcessDeploymentServiceUpdateAdapterResponse(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpResponseMessage httpResponseMessage);
+
+ partial void ProcessDeploymentServiceUpdateAdapterResponseContent(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpResponseMessage httpResponseMessage,
+ ref string content);
+
+ ///
+ /// Update a deployment adapter
+ /// Updates the pinned revision of an attached adapter using its row-level etag for optimistic concurrency.
+ ///
+ ///
+ /// Project identifier.
+ ///
+ ///
+ /// Endpoint identifier.
+ ///
+ ///
+ /// Deployment identifier.
+ ///
+ ///
+ /// Adapter model identifier.
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task DeploymentServiceUpdateAdapterAsync(
+ string projectId,
+ string endpointId,
+ string deploymentId,
+ string id,
+
+ global::Together.DeUpdateAdapterRequest request,
+ global::Together.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await DeploymentServiceUpdateAdapterAsResponseAsync(
+ projectId: projectId,
+ endpointId: endpointId,
+ deploymentId: deploymentId,
+ id: id,
+
+ request: request,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Update a deployment adapter
+ /// Updates the pinned revision of an attached adapter using its row-level etag for optimistic concurrency.
+ ///
+ ///
+ /// Project identifier.
+ ///
+ ///
+ /// Endpoint identifier.
+ ///
+ ///
+ /// Deployment identifier.
+ ///
+ ///
+ /// Adapter model identifier.
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> DeploymentServiceUpdateAdapterAsResponseAsync(
+ string projectId,
+ string endpointId,
+ string deploymentId,
+ string id,
+
+ global::Together.DeUpdateAdapterRequest request,
+ global::Together.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ request = request ?? throw new global::System.ArgumentNullException(nameof(request));
+
+ PrepareArguments(
+ client: HttpClient);
+ PrepareDeploymentServiceUpdateAdapterArguments(
+ httpClient: HttpClient,
+ projectId: ref projectId,
+ endpointId: ref endpointId,
+ deploymentId: ref deploymentId,
+ id: ref id,
+ request: request);
+
+
+ var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations(
+ availableAuthorizations: Authorizations,
+ securityRequirements: s_DeploymentServiceUpdateAdapterSecurityRequirements,
+ operationName: "DeploymentServiceUpdateAdapterAsync");
+
+ using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken);
+ var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken;
+ var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ fallbackValue: ReadResponseAsString);
+ var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ supportsRetry: true);
+
+ global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
+ {
+
+ var __pathBuilder = new global::Together.PathBuilder(
+ path: $"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters/{id}",
+ baseUri: ResolveBaseUri(
+ servers: s_DeploymentServiceUpdateAdapterServers,
+ defaultBaseUrl: "https://api.together.ai/v2"));
+ var __path = __pathBuilder.ToString();
+ __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters(
+ path: __path,
+ clientParameters: Options.QueryParameters,
+ requestParameters: requestOptions?.QueryParameters);
+ var __httpRequest = new global::System.Net.Http.HttpRequestMessage(
+ method: new global::System.Net.Http.HttpMethod("PATCH"),
+ 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" ||
+ __authorization.Type == "OpenIdConnect")
+ {
+ __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 = request.ToJson(JsonSerializerContext);
+ var __httpRequestContent = new global::System.Net.Http.StringContent(
+ content: __httpRequestContentBody,
+ encoding: global::System.Text.Encoding.UTF8,
+ mediaType: "application/json");
+ __httpRequest.Content = __httpRequestContent;
+ global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders(
+ request: __httpRequest,
+ clientHeaders: Options.Headers,
+ requestHeaders: requestOptions?.Headers);
+
+ PrepareRequest(
+ client: HttpClient,
+ request: __httpRequest);
+ PrepareDeploymentServiceUpdateAdapterRequest(
+ httpClient: HttpClient,
+ httpRequestMessage: __httpRequest,
+ projectId: projectId!,
+ endpointId: endpointId!,
+ deploymentId: deploymentId!,
+ id: id!,
+ request: request);
+
+ return __httpRequest;
+ }
+
+ global::System.Net.Http.HttpRequestMessage? __httpRequest = null;
+ global::System.Net.Http.HttpResponseMessage? __response = null;
+ var __attemptNumber = 0;
+ try
+ {
+ for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++)
+ {
+ __attemptNumber = __attempt;
+ __httpRequest = __CreateHttpRequest();
+ await global::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "DeploymentServiceUpdateAdapter",
+ methodName: "DeploymentServiceUpdateAdapterAsync",
+ pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters/{id}\"",
+ httpMethod: "PATCH",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ try
+ {
+ __response = await HttpClient.SendAsync(
+ request: __httpRequest,
+ completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ }
+ catch (global::System.Net.Http.HttpRequestException __exception)
+ {
+ var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
+ var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
+ await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "DeploymentServiceUpdateAdapter",
+ methodName: "DeploymentServiceUpdateAdapterAsync",
+ pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters/{id}\"",
+ httpMethod: "PATCH",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: __exception,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ if (!__willRetry)
+ {
+ throw;
+ }
+
+ __httpRequest.Dispose();
+ __httpRequest = null;
+ await global::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ if (__response != null &&
+ __attempt < __maxAttempts &&
+ global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
+ {
+ var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
+ await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "DeploymentServiceUpdateAdapter",
+ methodName: "DeploymentServiceUpdateAdapterAsync",
+ pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters/{id}\"",
+ httpMethod: "PATCH",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ break;
+ }
+
+ if (__response == null)
+ {
+ throw new global::System.InvalidOperationException("No response received.");
+ }
+
+ using (__response)
+ {
+
+ ProcessResponse(
+ client: HttpClient,
+ response: __response);
+ ProcessDeploymentServiceUpdateAdapterResponse(
+ httpClient: HttpClient,
+ httpResponseMessage: __response);
+ if (__response.IsSuccessStatusCode)
+ {
+ await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "DeploymentServiceUpdateAdapter",
+ methodName: "DeploymentServiceUpdateAdapterAsync",
+ pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters/{id}\"",
+ httpMethod: "PATCH",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ else
+ {
+ await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "DeploymentServiceUpdateAdapter",
+ methodName: "DeploymentServiceUpdateAdapterAsync",
+ pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters/{id}\"",
+ httpMethod: "PATCH",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ // Default error response
+ if (!__response.IsSuccessStatusCode)
+ {
+ string? __content_default = null;
+ global::System.Exception? __exception_default = null;
+ global::Together.ErrorData? __value_default = null;
+ try
+ {
+ if (__effectiveReadResponseAsString)
+ {
+ __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+ __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext);
+ }
+ else
+ {
+ __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+
+ __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext);
+ }
+ }
+ catch (global::System.Exception __ex)
+ {
+ __exception_default = __ex;
+ }
+
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content_default ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __exception_default,
+ responseBody: __content_default,
+ responseObject: __value_default,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+
+ if (__effectiveReadResponseAsString)
+ {
+ var __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ ProcessResponseContent(
+ client: HttpClient,
+ response: __response,
+ content: ref __content);
+ ProcessDeploymentServiceUpdateAdapterResponseContent(
+ httpClient: HttpClient,
+ httpResponseMessage: __response,
+ content: ref __content);
+
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+
+ var __value = global::Together.DeAdapterEntry.FromJson(__content, JsonSerializerContext) ??
+ throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Together.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
+ }
+ catch (global::System.Exception __ex)
+ {
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ }
+ else
+ {
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+ using var __content = await __response.Content.ReadAsStreamAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ var __value = await global::Together.DeAdapterEntry.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Together.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
+ }
+ catch (global::System.Exception __ex)
+ {
+ string? __content = null;
+ try
+ {
+ __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+ }
+ catch (global::System.Exception)
+ {
+ }
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ }
+
+ }
+ }
+ finally
+ {
+ __httpRequest?.Dispose();
+ }
+ }
+ ///
+ /// Update a deployment adapter
+ /// Updates the pinned revision of an attached adapter using its row-level etag for optimistic concurrency.
+ ///
+ ///
+ /// Project identifier.
+ ///
+ ///
+ /// Endpoint identifier.
+ ///
+ ///
+ /// Deployment identifier.
+ ///
+ ///
+ /// Adapter model identifier.
+ ///
+ ///
+ /// New adapter revision to pin.
+ ///
+ ///
+ /// Row-level etag from a prior AddAdapter, UpdateAdapter, GetAdapter, or ListAdapters response.
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task DeploymentServiceUpdateAdapterAsync(
+ string projectId,
+ string endpointId,
+ string deploymentId,
+ string id,
+ string adapterRevisionId,
+ string etag,
+ global::Together.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __request = new global::Together.DeUpdateAdapterRequest
+ {
+ AdapterRevisionId = adapterRevisionId,
+ Etag = etag,
+ };
+
+ return await DeploymentServiceUpdateAdapterAsync(
+ projectId: projectId,
+ endpointId: endpointId,
+ deploymentId: deploymentId,
+ id: id,
+ request: __request,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceUpdateDeployment.g.cs b/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceUpdateDeployment.g.cs
new file mode 100644
index 00000000..bedcd034
--- /dev/null
+++ b/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceUpdateDeployment.g.cs
@@ -0,0 +1,594 @@
+
+#nullable enable
+
+namespace Together
+{
+ public partial class DeploymentServiceClient
+ {
+
+ private static readonly global::Together.AutoSDKServer[] s_DeploymentServiceUpdateDeploymentServers = new global::Together.AutoSDKServer[]
+ { new global::Together.AutoSDKServer(
+ id: "https-api-together-ai-v2",
+ name: "api.together.ai v2",
+ url: "https://api.together.ai/v2",
+ description: ""),
+ };
+
+
+ private static readonly global::Together.EndPointSecurityRequirement s_DeploymentServiceUpdateDeploymentSecurityRequirement0 =
+ new global::Together.EndPointSecurityRequirement
+ {
+ Authorizations = new global::Together.EndPointAuthorizationRequirement[]
+ { new global::Together.EndPointAuthorizationRequirement
+ {
+ Type = "Http",
+ SchemeId = "BearerAuth",
+ Location = "Header",
+ Name = "Bearer",
+ FriendlyName = "Bearer",
+ },
+ },
+ };
+ private static readonly global::Together.EndPointSecurityRequirement[] s_DeploymentServiceUpdateDeploymentSecurityRequirements =
+ new global::Together.EndPointSecurityRequirement[]
+ { s_DeploymentServiceUpdateDeploymentSecurityRequirement0,
+ };
+ partial void PrepareDeploymentServiceUpdateDeploymentArguments(
+ global::System.Net.Http.HttpClient httpClient,
+ ref string projectId,
+ ref string endpointId,
+ ref string id,
+ ref string? updateMask,
+ global::Together.DeUpdateDeploymentRequest request);
+ partial void PrepareDeploymentServiceUpdateDeploymentRequest(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpRequestMessage httpRequestMessage,
+ string projectId,
+ string endpointId,
+ string id,
+ string? updateMask,
+ global::Together.DeUpdateDeploymentRequest request);
+ partial void ProcessDeploymentServiceUpdateDeploymentResponse(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpResponseMessage httpResponseMessage);
+
+ partial void ProcessDeploymentServiceUpdateDeploymentResponseContent(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpResponseMessage httpResponseMessage,
+ ref string content);
+
+ ///
+ /// Update a deployment
+ /// Updates mutable deployment fields such as its model, configuration, autoscaling bounds, or LoRA support. Changes that affect serving may trigger asynchronous reprovisioning.
+ ///
+ ///
+ /// Project identifier.
+ ///
+ ///
+ /// Endpoint identifier.
+ ///
+ ///
+ /// Deployment identifier.
+ ///
+ ///
+ /// Fields to update. If not set, the fields populated on `deployment` are updated.
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task DeploymentServiceUpdateDeploymentAsync(
+ string projectId,
+ string endpointId,
+ string id,
+
+ global::Together.DeUpdateDeploymentRequest request,
+ string? updateMask = default,
+ global::Together.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await DeploymentServiceUpdateDeploymentAsResponseAsync(
+ projectId: projectId,
+ endpointId: endpointId,
+ id: id,
+
+ request: request,
+ updateMask: updateMask,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Update a deployment
+ /// Updates mutable deployment fields such as its model, configuration, autoscaling bounds, or LoRA support. Changes that affect serving may trigger asynchronous reprovisioning.
+ ///
+ ///
+ /// Project identifier.
+ ///
+ ///
+ /// Endpoint identifier.
+ ///
+ ///
+ /// Deployment identifier.
+ ///
+ ///
+ /// Fields to update. If not set, the fields populated on `deployment` are updated.
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> DeploymentServiceUpdateDeploymentAsResponseAsync(
+ string projectId,
+ string endpointId,
+ string id,
+
+ global::Together.DeUpdateDeploymentRequest request,
+ string? updateMask = default,
+ global::Together.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ request = request ?? throw new global::System.ArgumentNullException(nameof(request));
+
+ PrepareArguments(
+ client: HttpClient);
+ PrepareDeploymentServiceUpdateDeploymentArguments(
+ httpClient: HttpClient,
+ projectId: ref projectId,
+ endpointId: ref endpointId,
+ id: ref id,
+ updateMask: ref updateMask,
+ request: request);
+
+
+ var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations(
+ availableAuthorizations: Authorizations,
+ securityRequirements: s_DeploymentServiceUpdateDeploymentSecurityRequirements,
+ operationName: "DeploymentServiceUpdateDeploymentAsync");
+
+ using var __timeoutCancellationTokenSource = global::Together.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken);
+ var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken;
+ var __effectiveReadResponseAsString = global::Together.AutoSDKRequestOptionsSupport.GetReadResponseAsString(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ fallbackValue: ReadResponseAsString);
+ var __maxAttempts = global::Together.AutoSDKRequestOptionsSupport.GetMaxAttempts(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ supportsRetry: true);
+
+ global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
+ {
+
+ var __pathBuilder = new global::Together.PathBuilder(
+ path: $"/projects/{projectId}/endpoints/{endpointId}/deployments/{id}",
+ baseUri: ResolveBaseUri(
+ servers: s_DeploymentServiceUpdateDeploymentServers,
+ defaultBaseUrl: "https://api.together.ai/v2"));
+ __pathBuilder
+ .AddOptionalParameter("updateMask", updateMask)
+ ;
+ var __path = __pathBuilder.ToString();
+ __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters(
+ path: __path,
+ clientParameters: Options.QueryParameters,
+ requestParameters: requestOptions?.QueryParameters);
+ var __httpRequest = new global::System.Net.Http.HttpRequestMessage(
+ method: new global::System.Net.Http.HttpMethod("PATCH"),
+ 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" ||
+ __authorization.Type == "OpenIdConnect")
+ {
+ __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 = request.ToJson(JsonSerializerContext);
+ var __httpRequestContent = new global::System.Net.Http.StringContent(
+ content: __httpRequestContentBody,
+ encoding: global::System.Text.Encoding.UTF8,
+ mediaType: "application/json");
+ __httpRequest.Content = __httpRequestContent;
+ global::Together.AutoSDKRequestOptionsSupport.ApplyHeaders(
+ request: __httpRequest,
+ clientHeaders: Options.Headers,
+ requestHeaders: requestOptions?.Headers);
+
+ PrepareRequest(
+ client: HttpClient,
+ request: __httpRequest);
+ PrepareDeploymentServiceUpdateDeploymentRequest(
+ httpClient: HttpClient,
+ httpRequestMessage: __httpRequest,
+ projectId: projectId!,
+ endpointId: endpointId!,
+ id: id!,
+ updateMask: updateMask,
+ request: request);
+
+ return __httpRequest;
+ }
+
+ global::System.Net.Http.HttpRequestMessage? __httpRequest = null;
+ global::System.Net.Http.HttpResponseMessage? __response = null;
+ var __attemptNumber = 0;
+ try
+ {
+ for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++)
+ {
+ __attemptNumber = __attempt;
+ __httpRequest = __CreateHttpRequest();
+ await global::Together.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "DeploymentServiceUpdateDeployment",
+ methodName: "DeploymentServiceUpdateDeploymentAsync",
+ pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{id}\"",
+ httpMethod: "PATCH",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ try
+ {
+ __response = await HttpClient.SendAsync(
+ request: __httpRequest,
+ completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ }
+ catch (global::System.Net.Http.HttpRequestException __exception)
+ {
+ var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
+ var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
+ await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "DeploymentServiceUpdateDeployment",
+ methodName: "DeploymentServiceUpdateDeploymentAsync",
+ pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{id}\"",
+ httpMethod: "PATCH",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: __exception,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ if (!__willRetry)
+ {
+ throw;
+ }
+
+ __httpRequest.Dispose();
+ __httpRequest = null;
+ await global::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ if (__response != null &&
+ __attempt < __maxAttempts &&
+ global::Together.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
+ {
+ var __retryDelay = global::Together.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
+ await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "DeploymentServiceUpdateDeployment",
+ methodName: "DeploymentServiceUpdateDeploymentAsync",
+ pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{id}\"",
+ httpMethod: "PATCH",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ 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::Together.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ break;
+ }
+
+ if (__response == null)
+ {
+ throw new global::System.InvalidOperationException("No response received.");
+ }
+
+ using (__response)
+ {
+
+ ProcessResponse(
+ client: HttpClient,
+ response: __response);
+ ProcessDeploymentServiceUpdateDeploymentResponse(
+ httpClient: HttpClient,
+ httpResponseMessage: __response);
+ if (__response.IsSuccessStatusCode)
+ {
+ await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "DeploymentServiceUpdateDeployment",
+ methodName: "DeploymentServiceUpdateDeploymentAsync",
+ pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{id}\"",
+ httpMethod: "PATCH",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ else
+ {
+ await global::Together.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "DeploymentServiceUpdateDeployment",
+ methodName: "DeploymentServiceUpdateDeploymentAsync",
+ pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{id}\"",
+ httpMethod: "PATCH",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ // Default error response
+ if (!__response.IsSuccessStatusCode)
+ {
+ string? __content_default = null;
+ global::System.Exception? __exception_default = null;
+ global::Together.ErrorData? __value_default = null;
+ try
+ {
+ if (__effectiveReadResponseAsString)
+ {
+ __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+ __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext);
+ }
+ else
+ {
+ __content_default = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+
+ __value_default = global::Together.ErrorData.FromJson(__content_default, JsonSerializerContext);
+ }
+ }
+ catch (global::System.Exception __ex)
+ {
+ __exception_default = __ex;
+ }
+
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content_default ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __exception_default,
+ responseBody: __content_default,
+ responseObject: __value_default,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+
+ if (__effectiveReadResponseAsString)
+ {
+ var __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ ProcessResponseContent(
+ client: HttpClient,
+ response: __response,
+ content: ref __content);
+ ProcessDeploymentServiceUpdateDeploymentResponseContent(
+ httpClient: HttpClient,
+ httpResponseMessage: __response,
+ content: ref __content);
+
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+
+ var __value = global::Together.DeDeployment.FromJson(__content, JsonSerializerContext) ??
+ throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Together.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
+ }
+ catch (global::System.Exception __ex)
+ {
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ }
+ else
+ {
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+ using var __content = await __response.Content.ReadAsStreamAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ var __value = await global::Together.DeDeployment.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Together.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
+ }
+ catch (global::System.Exception __ex)
+ {
+ string? __content = null;
+ try
+ {
+ __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+ }
+ catch (global::System.Exception)
+ {
+ }
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ }
+
+ }
+ }
+ finally
+ {
+ __httpRequest?.Dispose();
+ }
+ }
+ ///
+ /// Update a deployment
+ /// Updates mutable deployment fields such as its model, configuration, autoscaling bounds, or LoRA support. Changes that affect serving may trigger asynchronous reprovisioning.
+ ///
+ ///
+ /// Project identifier.
+ ///
+ ///
+ /// Endpoint identifier.
+ ///
+ ///
+ /// Deployment identifier.
+ ///
+ ///
+ /// Fields to update. If not set, the fields populated on `deployment` are updated.
+ ///
+ ///
+ /// Updated endpoint string.
+ ///
+ ///
+ /// Updated autoscaling configuration.
+ ///
+ ///
+ /// Current deployment version. The update is rejected if this value no longer matches.
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task DeploymentServiceUpdateDeploymentAsync(
+ string projectId,
+ string endpointId,
+ string id,
+ string? updateMask = default,
+ string? name = default,
+ global::Together.DeAutoscaling? autoscaling = default,
+ string? etag = default,
+ global::Together.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __request = new global::Together.DeUpdateDeploymentRequest
+ {
+ Name = name,
+ Autoscaling = autoscaling,
+ Etag = etag,
+ };
+
+ return await DeploymentServiceUpdateDeploymentAsync(
+ projectId: projectId,
+ endpointId: endpointId,
+ id: id,
+ updateMask: updateMask,
+ request: __request,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/libs/Together/Generated/Together.DeploymentServiceClient.g.cs b/src/libs/Together/Generated/Together.DeploymentServiceClient.g.cs
new file mode 100644
index 00000000..ceb02179
--- /dev/null
+++ b/src/libs/Together/Generated/Together.DeploymentServiceClient.g.cs
@@ -0,0 +1,175 @@
+
+#nullable enable
+
+namespace Together
+{
+ ///
+ /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used.
+ ///
+ public sealed partial class DeploymentServiceClient : global::Together.IDeploymentServiceClient, global::System.IDisposable
+ {
+ ///
+ ///
+ ///
+ public const string DefaultBaseUrl = "https://api.together.ai/v2";
+
+ private bool _disposeHttpClient = true;
+
+ ///
+ public global::System.Net.Http.HttpClient HttpClient { get; }
+
+ ///
+ public System.Uri? BaseUri => HttpClient.BaseAddress;
+
+ ///
+ public global::System.Collections.Generic.List Authorizations { get; }
+
+ ///
+ public bool ReadResponseAsString { get; set; }
+#if DEBUG
+ = true;
+#endif
+
+ ///
+ public global::Together.AutoSDKClientOptions Options { get; }
+
+
+ internal global::Together.AutoSDKServerConfiguration AutoSDKServerConfiguration { get; set; } = new global::Together.AutoSDKServerConfiguration();
+ ///
+ ///
+ ///
+ public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::Together.SourceGenerationContext.Default;
+
+
+ ///
+ /// Creates a new instance of the DeploymentServiceClient.
+ /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used.
+ ///
+ /// The HttpClient instance. If not provided, a new one will be created.
+ /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used.
+ /// The authorizations to use for the requests.
+ /// Dispose the HttpClient when the instance is disposed. True by default.
+ public DeploymentServiceClient(
+ global::System.Net.Http.HttpClient? httpClient = null,
+ global::System.Uri? baseUri = null,
+ global::System.Collections.Generic.List? authorizations = null,
+ bool disposeHttpClient = true) : this(
+ httpClient,
+ baseUri,
+ authorizations,
+ options: null,
+ disposeHttpClient: disposeHttpClient)
+ {
+ }
+
+ ///
+ /// Creates a new instance of the DeploymentServiceClient with explicit options but no base URL override.
+ /// Skips passing baseUri so the default base URL from the OpenAPI spec applies.
+ ///
+ /// The HttpClient instance. If not provided, a new one will be created.
+ /// The authorizations to use for the requests.
+ /// Client-wide request defaults such as headers, query parameters, retries, and timeout.
+ /// Dispose the HttpClient when the instance is disposed. True by default.
+ public DeploymentServiceClient(
+ global::System.Net.Http.HttpClient? httpClient,
+ global::System.Collections.Generic.List? authorizations,
+ global::Together.AutoSDKClientOptions? options,
+ bool disposeHttpClient = true) : this(
+ httpClient,
+ baseUri: null,
+ authorizations,
+ options,
+ disposeHttpClient: disposeHttpClient)
+ {
+ }
+
+ ///
+ /// Creates a new instance of the DeploymentServiceClient.
+ /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used.
+ ///
+ /// The HttpClient instance. If not provided, a new one will be created.
+ /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used.
+ /// The authorizations to use for the requests.
+ /// Client-wide request defaults such as headers, query parameters, retries, and timeout.
+ /// Dispose the HttpClient when the instance is disposed. True by default.
+ public DeploymentServiceClient(
+ global::System.Net.Http.HttpClient? httpClient,
+ global::System.Uri? baseUri,
+ global::System.Collections.Generic.List? authorizations,
+ global::Together.AutoSDKClientOptions? options,
+ bool disposeHttpClient = true)
+ {
+
+ HttpClient = httpClient ?? new global::System.Net.Http.HttpClient();
+ if (baseUri is not null)
+ {
+ HttpClient.BaseAddress ??= baseUri;
+ }
+ Authorizations = authorizations ?? new global::System.Collections.Generic.List();
+ Options = options ?? new global::Together.AutoSDKClientOptions();
+ _disposeHttpClient = disposeHttpClient;
+
+ AutoSDKServerConfiguration.ExplicitBaseUri = baseUri ?? httpClient?.BaseAddress;
+
+ Initialized(HttpClient);
+ }
+
+ ///
+ public void Dispose()
+ {
+ if (_disposeHttpClient)
+ {
+ HttpClient.Dispose();
+ }
+ }
+
+ partial void Initialized(
+ global::System.Net.Http.HttpClient client);
+ partial void PrepareArguments(
+ global::System.Net.Http.HttpClient client);
+ partial void PrepareRequest(
+ global::System.Net.Http.HttpClient client,
+ global::System.Net.Http.HttpRequestMessage request);
+ partial void ProcessResponse(
+ global::System.Net.Http.HttpClient client,
+ global::System.Net.Http.HttpResponseMessage response);
+ partial void ProcessResponseContent(
+ global::System.Net.Http.HttpClient client,
+ global::System.Net.Http.HttpResponseMessage response,
+ ref string content);
+
+
+ private global::System.Uri? ResolveBaseUri(
+ global::Together.AutoSDKServer[] servers,
+ string defaultBaseUrl)
+ {
+ if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri)
+ {
+ return explicitBaseUri;
+ }
+
+ if (AutoSDKServerConfiguration.SelectedServer is global::Together.AutoSDKServer selectedServer)
+ {
+ foreach (var server in servers)
+ {
+ if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal))
+ {
+ return server.Uri;
+ }
+ }
+ }
+
+ if (servers.Length > 0)
+ {
+ return servers[0].Uri;
+ }
+
+ return string.IsNullOrWhiteSpace(defaultBaseUrl)
+ ? HttpClient.BaseAddress
+ : new global::System.Uri(defaultBaseUrl, global::System.UriKind.RelativeOrAbsolute);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/libs/Together/Generated/Together.DeploymentsClient.CreateDeployments.g.cs b/src/libs/Together/Generated/Together.DeploymentsClient.CreateDeployments.g.cs
index 6ab78bd7..2a345ecb 100644
--- a/src/libs/Together/Generated/Together.DeploymentsClient.CreateDeployments.g.cs
+++ b/src/libs/Together/Generated/Together.DeploymentsClient.CreateDeployments.g.cs
@@ -6,6 +6,19 @@ namespace Together
public partial class DeploymentsClient
{
+ private static readonly global::Together.AutoSDKServer[] s_CreateDeploymentsServers = new global::Together.AutoSDKServer[]
+ { new global::Together.AutoSDKServer(
+ id: "https-api-together-ai-v1",
+ name: "Default environment for APIs",
+ url: "https://api.together.ai/v1",
+ description: "Default environment for APIs"),
+ new global::Together.AutoSDKServer(
+ id: "https-api-inference-together-ai-v2",
+ name: "Optimized environment for inference",
+ url: "https://api-inference.together.ai/v2",
+ description: "Optimized environment for inference"),
+ };
+
private static readonly global::Together.EndPointSecurityRequirement s_CreateDeploymentsSecurityRequirement0 =
new global::Together.EndPointSecurityRequirement
@@ -131,7 +144,9 @@ partial void ProcessCreateDeploymentsResponseContent(
var __pathBuilder = new global::Together.PathBuilder(
path: "/deployments",
- baseUri: HttpClient.BaseAddress);
+ baseUri: ResolveBaseUri(
+ servers: s_CreateDeploymentsServers,
+ defaultBaseUrl: "https://api.together.ai/v1"));
var __path = __pathBuilder.ToString();
__path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters(
path: __path,
@@ -382,18 +397,17 @@ partial void ProcessCreateDeploymentsResponseContent(
__exception_400 = __ex;
}
- throw new global::Together.ApiException(
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_400 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_400,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_400,
- ResponseObject = __value_400,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_400,
+ responseObject: __value_400,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Internal server error
if ((int)__response.StatusCode == 500)
@@ -420,18 +434,17 @@ partial void ProcessCreateDeploymentsResponseContent(
__exception_500 = __ex;
}
- throw new global::Together.ApiException(
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_500 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_500,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_500,
- ResponseObject = __value_500,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_500,
+ responseObject: __value_500,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
if (__effectiveReadResponseAsString)
@@ -465,17 +478,15 @@ partial void ProcessCreateDeploymentsResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::Together.ApiException(
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
}
else
@@ -512,17 +523,15 @@ partial void ProcessCreateDeploymentsResponseContent(
{
}
- throw new global::Together.ApiException(
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
}
diff --git a/src/libs/Together/Generated/Together.DeploymentsClient.DeleteDeploymentsById.g.cs b/src/libs/Together/Generated/Together.DeploymentsClient.DeleteDeploymentsById.g.cs
index cb0a43dc..abc8ed40 100644
--- a/src/libs/Together/Generated/Together.DeploymentsClient.DeleteDeploymentsById.g.cs
+++ b/src/libs/Together/Generated/Together.DeploymentsClient.DeleteDeploymentsById.g.cs
@@ -6,6 +6,19 @@ namespace Together
public partial class DeploymentsClient
{
+ private static readonly global::Together.AutoSDKServer[] s_DeleteDeploymentsByIdServers = new global::Together.AutoSDKServer[]
+ { new global::Together.AutoSDKServer(
+ id: "https-api-together-ai-v1",
+ name: "Default environment for APIs",
+ url: "https://api.together.ai/v1",
+ description: "Default environment for APIs"),
+ new global::Together.AutoSDKServer(
+ id: "https-api-inference-together-ai-v2",
+ name: "Optimized environment for inference",
+ url: "https://api-inference.together.ai/v2",
+ description: "Optimized environment for inference"),
+ };
+
private static readonly global::Together.EndPointSecurityRequirement s_DeleteDeploymentsByIdSecurityRequirement0 =
new global::Together.EndPointSecurityRequirement
@@ -122,7 +135,9 @@ partial void ProcessDeleteDeploymentsByIdResponseContent(
var __pathBuilder = new global::Together.PathBuilder(
path: $"/deployments/{id}",
- baseUri: HttpClient.BaseAddress);
+ baseUri: ResolveBaseUri(
+ servers: s_DeleteDeploymentsByIdServers,
+ defaultBaseUrl: "https://api.together.ai/v1"));
var __path = __pathBuilder.ToString();
__path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters(
path: __path,
@@ -367,18 +382,17 @@ partial void ProcessDeleteDeploymentsByIdResponseContent(
__exception_404 = __ex;
}
- throw new global::Together.ApiException(
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_404 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_404,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_404,
- ResponseObject = __value_404,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_404,
+ responseObject: __value_404,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Internal server error
if ((int)__response.StatusCode == 500)
@@ -405,18 +419,17 @@ partial void ProcessDeleteDeploymentsByIdResponseContent(
__exception_500 = __ex;
}
- throw new global::Together.ApiException(
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_500 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_500,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_500,
- ResponseObject = __value_500,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_500,
+ responseObject: __value_500,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
if (__effectiveReadResponseAsString)
@@ -448,17 +461,15 @@ partial void ProcessDeleteDeploymentsByIdResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::Together.ApiException(
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
}
else
@@ -493,17 +504,15 @@ partial void ProcessDeleteDeploymentsByIdResponseContent(
{
}
- throw new global::Together.ApiException(
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
}
diff --git a/src/libs/Together/Generated/Together.DeploymentsClient.EditDeploymentsById.g.cs b/src/libs/Together/Generated/Together.DeploymentsClient.EditDeploymentsById.g.cs
index a098243b..6845a2dc 100644
--- a/src/libs/Together/Generated/Together.DeploymentsClient.EditDeploymentsById.g.cs
+++ b/src/libs/Together/Generated/Together.DeploymentsClient.EditDeploymentsById.g.cs
@@ -6,6 +6,19 @@ namespace Together
public partial class DeploymentsClient
{
+ private static readonly global::Together.AutoSDKServer[] s_EditDeploymentsByIdServers = new global::Together.AutoSDKServer[]
+ { new global::Together.AutoSDKServer(
+ id: "https-api-together-ai-v1",
+ name: "Default environment for APIs",
+ url: "https://api.together.ai/v1",
+ description: "Default environment for APIs"),
+ new global::Together.AutoSDKServer(
+ id: "https-api-inference-together-ai-v2",
+ name: "Optimized environment for inference",
+ url: "https://api-inference.together.ai/v2",
+ description: "Optimized environment for inference"),
+ };
+
private static readonly global::Together.EndPointSecurityRequirement s_EditDeploymentsByIdSecurityRequirement0 =
new global::Together.EndPointSecurityRequirement
@@ -135,7 +148,9 @@ partial void ProcessEditDeploymentsByIdResponseContent(
var __pathBuilder = new global::Together.PathBuilder(
path: $"/deployments/{id}",
- baseUri: HttpClient.BaseAddress);
+ baseUri: ResolveBaseUri(
+ servers: s_EditDeploymentsByIdServers,
+ defaultBaseUrl: "https://api.together.ai/v1"));
var __path = __pathBuilder.ToString();
__path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters(
path: __path,
@@ -387,18 +402,17 @@ partial void ProcessEditDeploymentsByIdResponseContent(
__exception_400 = __ex;
}
- throw new global::Together.ApiException(
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_400 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_400,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_400,
- ResponseObject = __value_400,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_400,
+ responseObject: __value_400,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Deployment not found
if ((int)__response.StatusCode == 404)
@@ -425,18 +439,17 @@ partial void ProcessEditDeploymentsByIdResponseContent(
__exception_404 = __ex;
}
- throw new global::Together.ApiException(
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_404 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_404,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_404,
- ResponseObject = __value_404,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_404,
+ responseObject: __value_404,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
// Internal server error
if ((int)__response.StatusCode == 500)
@@ -463,18 +476,17 @@ partial void ProcessEditDeploymentsByIdResponseContent(
__exception_500 = __ex;
}
- throw new global::Together.ApiException(
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_500 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_500,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_500,
- ResponseObject = __value_500,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_500,
+ responseObject: __value_500,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
if (__effectiveReadResponseAsString)
@@ -508,17 +520,15 @@ partial void ProcessEditDeploymentsByIdResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::Together.ApiException(
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
}
else
@@ -555,17 +565,15 @@ partial void ProcessEditDeploymentsByIdResponseContent(
{
}
- throw new global::Together.ApiException(
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
}
diff --git a/src/libs/Together/Generated/Together.DeploymentsClient.GetDeployments.g.cs b/src/libs/Together/Generated/Together.DeploymentsClient.GetDeployments.g.cs
index 8993303f..44df336f 100644
--- a/src/libs/Together/Generated/Together.DeploymentsClient.GetDeployments.g.cs
+++ b/src/libs/Together/Generated/Together.DeploymentsClient.GetDeployments.g.cs
@@ -6,6 +6,19 @@ namespace Together
public partial class DeploymentsClient
{
+ private static readonly global::Together.AutoSDKServer[] s_GetDeploymentsServers = new global::Together.AutoSDKServer[]
+ { new global::Together.AutoSDKServer(
+ id: "https-api-together-ai-v1",
+ name: "Default environment for APIs",
+ url: "https://api.together.ai/v1",
+ description: "Default environment for APIs"),
+ new global::Together.AutoSDKServer(
+ id: "https-api-inference-together-ai-v2",
+ name: "Optimized environment for inference",
+ url: "https://api-inference.together.ai/v2",
+ description: "Optimized environment for inference"),
+ };
+
private static readonly global::Together.EndPointSecurityRequirement s_GetDeploymentsSecurityRequirement0 =
new global::Together.EndPointSecurityRequirement
@@ -110,7 +123,9 @@ partial void ProcessGetDeploymentsResponseContent(
var __pathBuilder = new global::Together.PathBuilder(
path: "/deployments",
- baseUri: HttpClient.BaseAddress);
+ baseUri: ResolveBaseUri(
+ servers: s_GetDeploymentsServers,
+ defaultBaseUrl: "https://api.together.ai/v1"));
var __path = __pathBuilder.ToString();
__path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters(
path: __path,
@@ -354,18 +369,17 @@ partial void ProcessGetDeploymentsResponseContent(
__exception_500 = __ex;
}
- throw new global::Together.ApiException(
+
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content_500 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_500,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content_500,
- ResponseObject = __value_500,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content_500,
+ responseObject: __value_500,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
if (__effectiveReadResponseAsString)
@@ -399,17 +413,15 @@ partial void ProcessGetDeploymentsResponseContent(
}
catch (global::System.Exception __ex)
{
- throw new global::Together.ApiException(
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
}
else
@@ -446,17 +458,15 @@ partial void ProcessGetDeploymentsResponseContent(
{
}
- throw new global::Together.ApiException(
+ throw global::Together.ApiException.Create(
+ statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
- statusCode: __response.StatusCode)
- {
- ResponseBody = __content,
- ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
- h => h.Value),
- };
+ h => h.Value));
}
}
diff --git a/src/libs/Together/Generated/Together.DeploymentsClient.GetDeploymentsById.g.cs b/src/libs/Together/Generated/Together.DeploymentsClient.GetDeploymentsById.g.cs
index a0091413..ea4a3bc5 100644
--- a/src/libs/Together/Generated/Together.DeploymentsClient.GetDeploymentsById.g.cs
+++ b/src/libs/Together/Generated/Together.DeploymentsClient.GetDeploymentsById.g.cs
@@ -6,6 +6,19 @@ namespace Together
public partial class DeploymentsClient
{
+ private static readonly global::Together.AutoSDKServer[] s_GetDeploymentsByIdServers = new global::Together.AutoSDKServer[]
+ { new global::Together.AutoSDKServer(
+ id: "https-api-together-ai-v1",
+ name: "Default environment for APIs",
+ url: "https://api.together.ai/v1",
+ description: "Default environment for APIs"),
+ new global::Together.AutoSDKServer(
+ id: "https-api-inference-together-ai-v2",
+ name: "Optimized environment for inference",
+ url: "https://api-inference.together.ai/v2",
+ description: "Optimized environment for inference"),
+ };
+
private static readonly global::Together.EndPointSecurityRequirement s_GetDeploymentsByIdSecurityRequirement0 =
new global::Together.EndPointSecurityRequirement
@@ -122,7 +135,9 @@ partial void ProcessGetDeploymentsByIdResponseContent(
var __pathBuilder = new global::Together.PathBuilder(
path: $"/deployments/{id}",
- baseUri: HttpClient.BaseAddress);
+ baseUri: ResolveBaseUri(
+ servers: s_GetDeploymentsByIdServers,
+ defaultBaseUrl: "https://api.together.ai/v1"));
var __path = __pathBuilder.ToString();
__path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters(
path: __path,
@@ -367,18 +382,17 @@ partial void ProcessGetDeploymentsByIdResponseContent(
__exception_404 = __ex;
}
- throw new global::Together.ApiException(
+
+ throw global::Together.ApiException