diff --git a/src/libs/Together/Generated/Together.ABExperimentService.JsonSerializerContext.g.cs b/src/libs/Together/Generated/Together.ABExperimentService.JsonSerializerContext.g.cs index 4b36f2d5..48fd7e59 100644 --- a/src/libs/Together/Generated/Together.ABExperimentService.JsonSerializerContext.g.cs +++ b/src/libs/Together/Generated/Together.ABExperimentService.JsonSerializerContext.g.cs @@ -2,40 +2,7 @@ #nullable enable namespace Together -{ - /// - /// - /// - [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( - DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull - )] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeCreateABExperimentRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeABExperimentMember))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeUpdateABExperimentRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeDeleteResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeABExperiment))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeABExperimentMemberRole), TypeInfoPropertyName = "DeABExperimentMemberRole2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeListABExperimentsResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ErrorData))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ErrorDataError))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeABExperimentMemberRole?), TypeInfoPropertyName = "NullableDeABExperimentMemberRole2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - internal sealed partial class ABExperimentServiceSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext - { - } - /// +{ /// /// /// public sealed partial class ABExperimentServiceSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext @@ -79,26 +46,7 @@ private ABExperimentServiceSourceGenerationContext(global::System.Text.Json.Json [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) { - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter, global::System.Collections.Generic.IList>()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter>()); - options.Converters.Add(new global::Together.JsonConverters.UnixTimestampJsonConverter()); - options.Converters.Add(new LazyEnumJsonConverterFactory()); + global::Together.SourceGenerationContext.AddConverters(options); } private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() @@ -113,34 +61,6 @@ public static void AddConverters(global::System.Text.Json.JsonSerializerOptions return options; } - - private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Serialization.JsonConverterFactory - { - public override bool CanConvert(global::System.Type typeToConvert) - { - return - typeToConvert == typeof(global::Together.DeABExperimentMemberRole) - - || typeToConvert == typeof(global::Together.DeABExperimentMemberRole?); - } - - public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - if (typeToConvert == typeof(global::Together.DeABExperimentMemberRole)) - { - return new global::Together.JsonConverters.DeABExperimentMemberRoleJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeABExperimentMemberRole?)) - { - return new global::Together.JsonConverters.DeABExperimentMemberRoleNullableJsonConverter(); - } - throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); - } - } - private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver { private readonly object _gate = new(); @@ -180,7 +100,7 @@ private sealed class LazyChunkResolver : global::System.Text.Json.Serialization. { return index switch { - 0 => new ABExperimentServiceSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), + 0 => global::Together.SourceGenerationContext.TypeInfoResolver, _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), }; } diff --git a/src/libs/Together/Generated/Together.ABExperimentServiceClient.ABExperimentServiceCreateABExperiment.g.cs b/src/libs/Together/Generated/Together.ABExperimentServiceClient.ABExperimentServiceCreateABExperiment.g.cs index 5d1e385d..2defed9b 100644 --- a/src/libs/Together/Generated/Together.ABExperimentServiceClient.ABExperimentServiceCreateABExperiment.g.cs +++ b/src/libs/Together/Generated/Together.ABExperimentServiceClient.ABExperimentServiceCreateABExperiment.g.cs @@ -6,6 +6,14 @@ 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 @@ -59,6 +67,29 @@ partial void ProcessABExperimentServiceCreateABExperimentResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// experiment = client.beta.endpoints.ab_experiments.create(
+ /// "ep_abc123",
+ /// project_id=project_id,
+ /// name="new-config-test",
+ /// members=[
+ /// {
+ /// "deployment_id": "dep_abc123",
+ /// "role": "AB_EXPERIMENT_MEMBER_ROLE_CONTROL",
+ /// "percent": 90,
+ /// },
+ /// {
+ /// "deployment_id": "dep_def456",
+ /// "role": "AB_EXPERIMENT_MEMBER_ROLE_VARIANT",
+ /// "percent": 10,
+ /// },
+ /// ],
+ /// )
+ /// print(experiment.id) + ///
public async global::System.Threading.Tasks.Task ABExperimentServiceCreateABExperimentAsync( string projectId, string endpointId, @@ -92,6 +123,29 @@ partial void ProcessABExperimentServiceCreateABExperimentResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// experiment = client.beta.endpoints.ab_experiments.create(
+ /// "ep_abc123",
+ /// project_id=project_id,
+ /// name="new-config-test",
+ /// members=[
+ /// {
+ /// "deployment_id": "dep_abc123",
+ /// "role": "AB_EXPERIMENT_MEMBER_ROLE_CONTROL",
+ /// "percent": 90,
+ /// },
+ /// {
+ /// "deployment_id": "dep_def456",
+ /// "role": "AB_EXPERIMENT_MEMBER_ROLE_VARIANT",
+ /// "percent": 10,
+ /// },
+ /// ],
+ /// )
+ /// print(experiment.id) + ///
public async global::System.Threading.Tasks.Task> ABExperimentServiceCreateABExperimentAsResponseAsync( string projectId, string endpointId, @@ -134,8 +188,10 @@ partial void ProcessABExperimentServiceCreateABExperimentResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v2/projects/{projectId}/endpoints/{endpointId}/abExperiments", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + 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, @@ -203,7 +259,7 @@ partial void ProcessABExperimentServiceCreateABExperimentResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ABExperimentServiceCreateABExperiment", methodName: "ABExperimentServiceCreateABExperimentAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/abExperiments\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/abExperiments\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -237,7 +293,7 @@ partial void ProcessABExperimentServiceCreateABExperimentResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ABExperimentServiceCreateABExperiment", methodName: "ABExperimentServiceCreateABExperimentAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/abExperiments\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/abExperiments\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -278,7 +334,7 @@ partial void ProcessABExperimentServiceCreateABExperimentResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ABExperimentServiceCreateABExperiment", methodName: "ABExperimentServiceCreateABExperimentAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/abExperiments\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/abExperiments\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -326,7 +382,7 @@ partial void ProcessABExperimentServiceCreateABExperimentResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ABExperimentServiceCreateABExperiment", methodName: "ABExperimentServiceCreateABExperimentAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/abExperiments\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/abExperiments\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -348,7 +404,7 @@ partial void ProcessABExperimentServiceCreateABExperimentResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ABExperimentServiceCreateABExperiment", methodName: "ABExperimentServiceCreateABExperimentAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/abExperiments\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/abExperiments\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.ABExperimentServiceClient.ABExperimentServiceDeleteABExperiment.g.cs b/src/libs/Together/Generated/Together.ABExperimentServiceClient.ABExperimentServiceDeleteABExperiment.g.cs index 03fb05ac..f01facde 100644 --- a/src/libs/Together/Generated/Together.ABExperimentServiceClient.ABExperimentServiceDeleteABExperiment.g.cs +++ b/src/libs/Together/Generated/Together.ABExperimentServiceClient.ABExperimentServiceDeleteABExperiment.g.cs @@ -6,6 +6,14 @@ 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 @@ -66,6 +74,16 @@ partial void ProcessABExperimentServiceDeleteABExperimentResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// client.beta.endpoints.ab_experiments.delete(
+ /// "abx_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// ) + ///
public async global::System.Threading.Tasks.Task ABExperimentServiceDeleteABExperimentAsync( string projectId, string endpointId, @@ -104,6 +122,16 @@ partial void ProcessABExperimentServiceDeleteABExperimentResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// client.beta.endpoints.ab_experiments.delete(
+ /// "abx_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// ) + ///
public async global::System.Threading.Tasks.Task> ABExperimentServiceDeleteABExperimentAsResponseAsync( string projectId, string endpointId, @@ -145,8 +173,10 @@ partial void ProcessABExperimentServiceDeleteABExperimentResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v2/projects/{projectId}/endpoints/{endpointId}/abExperiments/{id}", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/projects/{projectId}/endpoints/{endpointId}/abExperiments/{id}", + baseUri: ResolveBaseUri( + servers: s_ABExperimentServiceDeleteABExperimentServers, + defaultBaseUrl: "https://api.together.ai/v2")); __pathBuilder .AddOptionalParameter("etag", etag) ; @@ -212,7 +242,7 @@ partial void ProcessABExperimentServiceDeleteABExperimentResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ABExperimentServiceDeleteABExperiment", methodName: "ABExperimentServiceDeleteABExperimentAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/abExperiments/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/abExperiments/{id}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -246,7 +276,7 @@ partial void ProcessABExperimentServiceDeleteABExperimentResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ABExperimentServiceDeleteABExperiment", methodName: "ABExperimentServiceDeleteABExperimentAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/abExperiments/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/abExperiments/{id}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -287,7 +317,7 @@ partial void ProcessABExperimentServiceDeleteABExperimentResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ABExperimentServiceDeleteABExperiment", methodName: "ABExperimentServiceDeleteABExperimentAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/abExperiments/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/abExperiments/{id}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -335,7 +365,7 @@ partial void ProcessABExperimentServiceDeleteABExperimentResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ABExperimentServiceDeleteABExperiment", methodName: "ABExperimentServiceDeleteABExperimentAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/abExperiments/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/abExperiments/{id}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -357,7 +387,7 @@ partial void ProcessABExperimentServiceDeleteABExperimentResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ABExperimentServiceDeleteABExperiment", methodName: "ABExperimentServiceDeleteABExperimentAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/abExperiments/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/abExperiments/{id}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.ABExperimentServiceClient.ABExperimentServiceGetABExperiment.g.cs b/src/libs/Together/Generated/Together.ABExperimentServiceClient.ABExperimentServiceGetABExperiment.g.cs index 02130f64..e3b515cb 100644 --- a/src/libs/Together/Generated/Together.ABExperimentServiceClient.ABExperimentServiceGetABExperiment.g.cs +++ b/src/libs/Together/Generated/Together.ABExperimentServiceClient.ABExperimentServiceGetABExperiment.g.cs @@ -6,6 +6,14 @@ 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 @@ -61,6 +69,17 @@ partial void ProcessABExperimentServiceGetABExperimentResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// experiment = client.beta.endpoints.ab_experiments.retrieve(
+ /// "abx_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// )
+ /// print(experiment.name, experiment.members) + ///
public async global::System.Threading.Tasks.Task ABExperimentServiceGetABExperimentAsync( string projectId, string endpointId, @@ -94,6 +113,17 @@ partial void ProcessABExperimentServiceGetABExperimentResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// experiment = client.beta.endpoints.ab_experiments.retrieve(
+ /// "abx_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// )
+ /// print(experiment.name, experiment.members) + ///
public async global::System.Threading.Tasks.Task> ABExperimentServiceGetABExperimentAsResponseAsync( string projectId, string endpointId, @@ -133,8 +163,10 @@ partial void ProcessABExperimentServiceGetABExperimentResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v2/projects/{projectId}/endpoints/{endpointId}/abExperiments/{id}", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + 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, @@ -196,7 +228,7 @@ partial void ProcessABExperimentServiceGetABExperimentResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ABExperimentServiceGetABExperiment", methodName: "ABExperimentServiceGetABExperimentAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/abExperiments/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/abExperiments/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -230,7 +262,7 @@ partial void ProcessABExperimentServiceGetABExperimentResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ABExperimentServiceGetABExperiment", methodName: "ABExperimentServiceGetABExperimentAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/abExperiments/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/abExperiments/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -271,7 +303,7 @@ partial void ProcessABExperimentServiceGetABExperimentResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ABExperimentServiceGetABExperiment", methodName: "ABExperimentServiceGetABExperimentAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/abExperiments/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/abExperiments/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -319,7 +351,7 @@ partial void ProcessABExperimentServiceGetABExperimentResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ABExperimentServiceGetABExperiment", methodName: "ABExperimentServiceGetABExperimentAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/abExperiments/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/abExperiments/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -341,7 +373,7 @@ partial void ProcessABExperimentServiceGetABExperimentResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ABExperimentServiceGetABExperiment", methodName: "ABExperimentServiceGetABExperimentAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/abExperiments/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/abExperiments/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.ABExperimentServiceClient.ABExperimentServiceListABExperiments.g.cs b/src/libs/Together/Generated/Together.ABExperimentServiceClient.ABExperimentServiceListABExperiments.g.cs index d6e3ca76..1b2a669b 100644 --- a/src/libs/Together/Generated/Together.ABExperimentServiceClient.ABExperimentServiceListABExperiments.g.cs +++ b/src/libs/Together/Generated/Together.ABExperimentServiceClient.ABExperimentServiceListABExperiments.g.cs @@ -6,6 +6,14 @@ 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 @@ -66,6 +74,17 @@ partial void ProcessABExperimentServiceListABExperimentsResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// experiments = client.beta.endpoints.ab_experiments.list(
+ /// "ep_abc123",
+ /// project_id=project_id,
+ /// )
+ /// for experiment in experiments:
+ /// print(experiment.id, experiment.name) + ///
public async global::System.Threading.Tasks.Task ABExperimentServiceListABExperimentsAsync( string projectId, string endpointId, @@ -104,6 +123,17 @@ partial void ProcessABExperimentServiceListABExperimentsResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// experiments = client.beta.endpoints.ab_experiments.list(
+ /// "ep_abc123",
+ /// project_id=project_id,
+ /// )
+ /// for experiment in experiments:
+ /// print(experiment.id, experiment.name) + ///
public async global::System.Threading.Tasks.Task> ABExperimentServiceListABExperimentsAsResponseAsync( string projectId, string endpointId, @@ -145,8 +175,10 @@ partial void ProcessABExperimentServiceListABExperimentsResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v2/projects/{projectId}/endpoints/{endpointId}/abExperiments", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + 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) @@ -213,7 +245,7 @@ partial void ProcessABExperimentServiceListABExperimentsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ABExperimentServiceListABExperiments", methodName: "ABExperimentServiceListABExperimentsAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/abExperiments\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/abExperiments\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -247,7 +279,7 @@ partial void ProcessABExperimentServiceListABExperimentsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ABExperimentServiceListABExperiments", methodName: "ABExperimentServiceListABExperimentsAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/abExperiments\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/abExperiments\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -288,7 +320,7 @@ partial void ProcessABExperimentServiceListABExperimentsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ABExperimentServiceListABExperiments", methodName: "ABExperimentServiceListABExperimentsAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/abExperiments\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/abExperiments\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -336,7 +368,7 @@ partial void ProcessABExperimentServiceListABExperimentsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ABExperimentServiceListABExperiments", methodName: "ABExperimentServiceListABExperimentsAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/abExperiments\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/abExperiments\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -358,7 +390,7 @@ partial void ProcessABExperimentServiceListABExperimentsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ABExperimentServiceListABExperiments", methodName: "ABExperimentServiceListABExperimentsAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/abExperiments\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/abExperiments\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.ABExperimentServiceClient.ABExperimentServiceUpdateABExperiment.g.cs b/src/libs/Together/Generated/Together.ABExperimentServiceClient.ABExperimentServiceUpdateABExperiment.g.cs index 541cff7e..b678eaa8 100644 --- a/src/libs/Together/Generated/Together.ABExperimentServiceClient.ABExperimentServiceUpdateABExperiment.g.cs +++ b/src/libs/Together/Generated/Together.ABExperimentServiceClient.ABExperimentServiceUpdateABExperiment.g.cs @@ -6,6 +6,14 @@ 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 @@ -69,6 +77,30 @@ partial void ProcessABExperimentServiceUpdateABExperimentResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// experiment = client.beta.endpoints.ab_experiments.update(
+ /// "abx_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// update_mask="members",
+ /// members=[
+ /// {
+ /// "deployment_id": "dep_abc123",
+ /// "role": "AB_EXPERIMENT_MEMBER_ROLE_CONTROL",
+ /// "percent": 50,
+ /// },
+ /// {
+ /// "deployment_id": "dep_def456",
+ /// "role": "AB_EXPERIMENT_MEMBER_ROLE_VARIANT",
+ /// "percent": 50,
+ /// },
+ /// ],
+ /// )
+ /// print(experiment.members) + ///
public async global::System.Threading.Tasks.Task ABExperimentServiceUpdateABExperimentAsync( string projectId, string endpointId, @@ -112,6 +144,30 @@ partial void ProcessABExperimentServiceUpdateABExperimentResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// experiment = client.beta.endpoints.ab_experiments.update(
+ /// "abx_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// update_mask="members",
+ /// members=[
+ /// {
+ /// "deployment_id": "dep_abc123",
+ /// "role": "AB_EXPERIMENT_MEMBER_ROLE_CONTROL",
+ /// "percent": 50,
+ /// },
+ /// {
+ /// "deployment_id": "dep_def456",
+ /// "role": "AB_EXPERIMENT_MEMBER_ROLE_VARIANT",
+ /// "percent": 50,
+ /// },
+ /// ],
+ /// )
+ /// print(experiment.members) + ///
public async global::System.Threading.Tasks.Task> ABExperimentServiceUpdateABExperimentAsResponseAsync( string projectId, string endpointId, @@ -158,8 +214,10 @@ partial void ProcessABExperimentServiceUpdateABExperimentResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v2/projects/{projectId}/endpoints/{endpointId}/abExperiments/{id}", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/projects/{projectId}/endpoints/{endpointId}/abExperiments/{id}", + baseUri: ResolveBaseUri( + servers: s_ABExperimentServiceUpdateABExperimentServers, + defaultBaseUrl: "https://api.together.ai/v2")); __pathBuilder .AddOptionalParameter("updateMask", updateMask) ; @@ -232,7 +290,7 @@ partial void ProcessABExperimentServiceUpdateABExperimentResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ABExperimentServiceUpdateABExperiment", methodName: "ABExperimentServiceUpdateABExperimentAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/abExperiments/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/abExperiments/{id}\"", httpMethod: "PATCH", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -266,7 +324,7 @@ partial void ProcessABExperimentServiceUpdateABExperimentResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ABExperimentServiceUpdateABExperiment", methodName: "ABExperimentServiceUpdateABExperimentAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/abExperiments/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/abExperiments/{id}\"", httpMethod: "PATCH", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -307,7 +365,7 @@ partial void ProcessABExperimentServiceUpdateABExperimentResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ABExperimentServiceUpdateABExperiment", methodName: "ABExperimentServiceUpdateABExperimentAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/abExperiments/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/abExperiments/{id}\"", httpMethod: "PATCH", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -355,7 +413,7 @@ partial void ProcessABExperimentServiceUpdateABExperimentResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ABExperimentServiceUpdateABExperiment", methodName: "ABExperimentServiceUpdateABExperimentAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/abExperiments/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/abExperiments/{id}\"", httpMethod: "PATCH", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -377,7 +435,7 @@ partial void ProcessABExperimentServiceUpdateABExperimentResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ABExperimentServiceUpdateABExperiment", methodName: "ABExperimentServiceUpdateABExperimentAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/abExperiments/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/abExperiments/{id}\"", httpMethod: "PATCH", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.ABExperimentServiceClient.g.cs b/src/libs/Together/Generated/Together.ABExperimentServiceClient.g.cs index 8cc3b224..d416cd6e 100644 --- a/src/libs/Together/Generated/Together.ABExperimentServiceClient.g.cs +++ b/src/libs/Together/Generated/Together.ABExperimentServiceClient.g.cs @@ -10,9 +10,9 @@ namespace Together public sealed partial class ABExperimentServiceClient : global::Together.IABExperimentServiceClient, global::System.IDisposable { /// - /// Default environment for APIs + /// /// - public const string DefaultBaseUrl = "https://api.together.ai/"; + public const string DefaultBaseUrl = "https://api.together.ai/v2"; private bool _disposeHttpClient = true; @@ -151,5 +151,36 @@ 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.Account.JsonSerializerContext.g.cs b/src/libs/Together/Generated/Together.Account.JsonSerializerContext.g.cs index 091aa543..6fdb8779 100644 --- a/src/libs/Together/Generated/Together.Account.JsonSerializerContext.g.cs +++ b/src/libs/Together/Generated/Together.Account.JsonSerializerContext.g.cs @@ -2,48 +2,7 @@ #nullable enable namespace Together -{ - /// - /// - /// - [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( - DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull - )] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ErrorData))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ErrorDataError))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.WhoamiApiKey))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.WhoamiOrganization))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.WhoamiProject))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.WhoamiUser))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.WhoamiProjectApiKey))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.WhoamiProjectApiKeyType), TypeInfoPropertyName = "WhoamiProjectApiKeyType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.WhoamiOrgApiKey))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.WhoamiOrgApiKeyType), TypeInfoPropertyName = "WhoamiOrgApiKeyType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.WhoamiUserJwt))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.WhoamiUserJwtType), TypeInfoPropertyName = "WhoamiUserJwtType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.WhoamiUserOrgJwt))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.WhoamiUserOrgJwtType), TypeInfoPropertyName = "WhoamiUserOrgJwtType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.WhoamiUserOrgProjectJwt))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.WhoamiUserOrgProjectJwtType), TypeInfoPropertyName = "WhoamiUserOrgProjectJwtType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.WhoamiResponse), TypeInfoPropertyName = "WhoamiResponse2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.WhoamiResponseDiscriminator))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.WhoamiResponseDiscriminatorType), TypeInfoPropertyName = "WhoamiResponseDiscriminatorType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.WhoamiProjectApiKeyType?), TypeInfoPropertyName = "NullableWhoamiProjectApiKeyType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.WhoamiOrgApiKeyType?), TypeInfoPropertyName = "NullableWhoamiOrgApiKeyType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.WhoamiUserJwtType?), TypeInfoPropertyName = "NullableWhoamiUserJwtType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.WhoamiUserOrgJwtType?), TypeInfoPropertyName = "NullableWhoamiUserOrgJwtType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.WhoamiUserOrgProjectJwtType?), TypeInfoPropertyName = "NullableWhoamiUserOrgProjectJwtType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.WhoamiResponse?), TypeInfoPropertyName = "NullableWhoamiResponse2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.WhoamiResponseDiscriminatorType?), TypeInfoPropertyName = "NullableWhoamiResponseDiscriminatorType2")] - internal sealed partial class AccountSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext - { - } - /// +{ /// /// /// public sealed partial class AccountSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext @@ -87,27 +46,7 @@ private AccountSourceGenerationContext(global::System.Text.Json.JsonSerializerOp [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) { - options.Converters.Add(new global::Together.JsonConverters.WhoamiResponseJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter, global::System.Collections.Generic.IList>()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter>()); - options.Converters.Add(new global::Together.JsonConverters.UnixTimestampJsonConverter()); - options.Converters.Add(new LazyEnumJsonConverterFactory()); + global::Together.SourceGenerationContext.AddConverters(options); } private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() @@ -122,104 +61,6 @@ public static void AddConverters(global::System.Text.Json.JsonSerializerOptions return options; } - - private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Serialization.JsonConverterFactory - { - public override bool CanConvert(global::System.Type typeToConvert) - { - return - typeToConvert == typeof(global::Together.WhoamiProjectApiKeyType) - - || typeToConvert == typeof(global::Together.WhoamiProjectApiKeyType?) - - || typeToConvert == typeof(global::Together.WhoamiOrgApiKeyType) - - || typeToConvert == typeof(global::Together.WhoamiOrgApiKeyType?) - - || typeToConvert == typeof(global::Together.WhoamiUserJwtType) - - || typeToConvert == typeof(global::Together.WhoamiUserJwtType?) - - || typeToConvert == typeof(global::Together.WhoamiUserOrgJwtType) - - || typeToConvert == typeof(global::Together.WhoamiUserOrgJwtType?) - - || typeToConvert == typeof(global::Together.WhoamiUserOrgProjectJwtType) - - || typeToConvert == typeof(global::Together.WhoamiUserOrgProjectJwtType?) - - || typeToConvert == typeof(global::Together.WhoamiResponseDiscriminatorType) - - || typeToConvert == typeof(global::Together.WhoamiResponseDiscriminatorType?); - } - - public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - if (typeToConvert == typeof(global::Together.WhoamiProjectApiKeyType)) - { - return new global::Together.JsonConverters.WhoamiProjectApiKeyTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.WhoamiProjectApiKeyType?)) - { - return new global::Together.JsonConverters.WhoamiProjectApiKeyTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.WhoamiOrgApiKeyType)) - { - return new global::Together.JsonConverters.WhoamiOrgApiKeyTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.WhoamiOrgApiKeyType?)) - { - return new global::Together.JsonConverters.WhoamiOrgApiKeyTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.WhoamiUserJwtType)) - { - return new global::Together.JsonConverters.WhoamiUserJwtTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.WhoamiUserJwtType?)) - { - return new global::Together.JsonConverters.WhoamiUserJwtTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.WhoamiUserOrgJwtType)) - { - return new global::Together.JsonConverters.WhoamiUserOrgJwtTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.WhoamiUserOrgJwtType?)) - { - return new global::Together.JsonConverters.WhoamiUserOrgJwtTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.WhoamiUserOrgProjectJwtType)) - { - return new global::Together.JsonConverters.WhoamiUserOrgProjectJwtTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.WhoamiUserOrgProjectJwtType?)) - { - return new global::Together.JsonConverters.WhoamiUserOrgProjectJwtTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.WhoamiResponseDiscriminatorType)) - { - return new global::Together.JsonConverters.WhoamiResponseDiscriminatorTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.WhoamiResponseDiscriminatorType?)) - { - return new global::Together.JsonConverters.WhoamiResponseDiscriminatorTypeNullableJsonConverter(); - } - throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); - } - } - private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver { private readonly object _gate = new(); @@ -259,7 +100,7 @@ private sealed class LazyChunkResolver : global::System.Text.Json.Serialization. { return index switch { - 0 => new AccountSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), + 0 => global::Together.SourceGenerationContext.TypeInfoResolver, _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), }; } diff --git a/src/libs/Together/Generated/Together.AccountClient.Whoami.g.cs b/src/libs/Together/Generated/Together.AccountClient.Whoami.g.cs index a5fb8e88..9756a89b 100644 --- a/src/libs/Together/Generated/Together.AccountClient.Whoami.g.cs +++ b/src/libs/Together/Generated/Together.AccountClient.Whoami.g.cs @@ -6,6 +6,19 @@ 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 @@ -40,13 +53,19 @@ partial void ProcessWhoamiResponseContent( ref string content); /// - /// Identify the caller
- /// Returns identity information for the authenticated caller. Accepts project API keys and user session JWTs. The response `type` indicates which fields are present.
- /// For project-scoped credentials, `project.slug` can be used with an endpoint slug as `<project_slug>/<endpoint_slug>` to form the `model` value in dedicated endpoint inference calls. + /// 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) @@ -59,13 +78,19 @@ partial void ProcessWhoamiResponseContent( return __response.Body; } /// - /// Identify the caller
- /// Returns identity information for the authenticated caller. Accepts project API keys and user session JWTs. The response `type` indicates which fields are present.
- /// For project-scoped credentials, `project.slug` can be used with an endpoint slug as `<project_slug>/<endpoint_slug>` to form the `model` value in dedicated endpoint inference calls. + /// 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) @@ -99,8 +124,10 @@ partial void ProcessWhoamiResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: "/v3/whoami", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: "/whoami", + baseUri: ResolveBaseUri( + servers: s_WhoamiServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -159,7 +186,7 @@ partial void ProcessWhoamiResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "Whoami", methodName: "WhoamiAsync", - pathTemplate: "\"/v3/whoami\"", + pathTemplate: "\"/whoami\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -193,7 +220,7 @@ partial void ProcessWhoamiResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "Whoami", methodName: "WhoamiAsync", - pathTemplate: "\"/v3/whoami\"", + pathTemplate: "\"/whoami\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -234,7 +261,7 @@ partial void ProcessWhoamiResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "Whoami", methodName: "WhoamiAsync", - pathTemplate: "\"/v3/whoami\"", + pathTemplate: "\"/whoami\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -282,7 +309,7 @@ partial void ProcessWhoamiResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "Whoami", methodName: "WhoamiAsync", - pathTemplate: "\"/v3/whoami\"", + pathTemplate: "\"/whoami\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -304,7 +331,7 @@ partial void ProcessWhoamiResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "Whoami", methodName: "WhoamiAsync", - pathTemplate: "\"/v3/whoami\"", + pathTemplate: "\"/whoami\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -319,44 +346,7 @@ partial void ProcessWhoamiResponseContent( retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } - // Invalid request - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - global::Together.ErrorData? __value_400 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_400 = global::Together.ErrorData.FromJson(__content_400, JsonSerializerContext); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_400 = global::Together.ErrorData.FromJson(__content_400, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - - throw global::Together.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - responseBody: __content_400, - responseObject: __value_400, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Authentication failed + // Unauthorized — missing or invalid API key if ((int)__response.StatusCode == 401) { string? __content_401 = null; @@ -393,154 +383,6 @@ partial void ProcessWhoamiResponseContent( h => h.Key, h => h.Value)); } - // Authentication failed or permission denied - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - global::Together.ErrorData? __value_403 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_403 = global::Together.ErrorData.FromJson(__content_403, JsonSerializerContext); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_403 = global::Together.ErrorData.FromJson(__content_403, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - - throw global::Together.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - responseBody: __content_403, - responseObject: __value_403, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Not found - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::Together.ErrorData? __value_404 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_404 = global::Together.ErrorData.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_404 = global::Together.ErrorData.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - - throw global::Together.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - responseBody: __content_404, - responseObject: __value_404, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Conflict - if ((int)__response.StatusCode == 409) - { - string? __content_409 = null; - global::System.Exception? __exception_409 = null; - global::Together.ErrorData? __value_409 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_409 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_409 = global::Together.ErrorData.FromJson(__content_409, JsonSerializerContext); - } - else - { - __content_409 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_409 = global::Together.ErrorData.FromJson(__content_409, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_409 = __ex; - } - - - throw global::Together.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_409 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_409, - responseBody: __content_409, - responseObject: __value_409, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Request body too large - if ((int)__response.StatusCode == 413) - { - string? __content_413 = null; - global::System.Exception? __exception_413 = null; - global::Together.ErrorData? __value_413 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_413 = global::Together.ErrorData.FromJson(__content_413, JsonSerializerContext); - } - else - { - __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_413 = global::Together.ErrorData.FromJson(__content_413, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __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)); - } // Internal server error if ((int)__response.StatusCode == 500) { @@ -578,80 +420,6 @@ partial void ProcessWhoamiResponseContent( h => h.Key, h => h.Value)); } - // Service unavailable - if ((int)__response.StatusCode == 503) - { - string? __content_503 = null; - global::System.Exception? __exception_503 = null; - global::Together.ErrorData? __value_503 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_503 = global::Together.ErrorData.FromJson(__content_503, JsonSerializerContext); - } - else - { - __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_503 = global::Together.ErrorData.FromJson(__content_503, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_503 = __ex; - } - - - throw global::Together.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_503, - responseBody: __content_503, - responseObject: __value_503, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } - // Request timed out - if ((int)__response.StatusCode == 504) - { - string? __content_504 = null; - global::System.Exception? __exception_504 = null; - global::Together.ErrorData? __value_504 = null; - try - { - if (__effectiveReadResponseAsString) - { - __content_504 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - __value_504 = global::Together.ErrorData.FromJson(__content_504, JsonSerializerContext); - } - else - { - __content_504 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); - - __value_504 = global::Together.ErrorData.FromJson(__content_504, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_504 = __ex; - } - - - throw global::Together.ApiException.Create( - statusCode: __response.StatusCode, - message: __content_504 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_504, - responseBody: __content_504, - responseObject: __value_504, - responseHeaders: global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value)); - } if (__effectiveReadResponseAsString) { diff --git a/src/libs/Together/Generated/Together.AccountClient.g.cs b/src/libs/Together/Generated/Together.AccountClient.g.cs index cdd51316..6bebce37 100644 --- a/src/libs/Together/Generated/Together.AccountClient.g.cs +++ b/src/libs/Together/Generated/Together.AccountClient.g.cs @@ -12,7 +12,7 @@ public sealed partial class AccountClient : global::Together.IAccountClient, glo /// /// Default environment for APIs /// - public const string DefaultBaseUrl = "https://api.together.ai/"; + public const string DefaultBaseUrl = "https://api.together.ai/v1"; private bool _disposeHttpClient = true; @@ -20,7 +20,7 @@ public sealed partial class AccountClient : global::Together.IAccountClient, 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; } @@ -53,6 +53,34 @@ public sealed partial class AccountClient : global::Together.IAccountClient, glo } + + 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. @@ -151,5 +179,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.Audio.JsonSerializerContext.g.cs b/src/libs/Together/Generated/Together.Audio.JsonSerializerContext.g.cs index 9b0cf729..fc65664b 100644 --- a/src/libs/Together/Generated/Together.Audio.JsonSerializerContext.g.cs +++ b/src/libs/Together/Generated/Together.Audio.JsonSerializerContext.g.cs @@ -2,101 +2,7 @@ #nullable enable namespace Together -{ - /// - /// - /// - [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( - DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull - )] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(double))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ErrorData))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ErrorDataError))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.StreamSentinel))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioSpeechRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AnyOf), TypeInfoPropertyName = "AnyOfAudioSpeechRequestModelString2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioSpeechRequestModel), TypeInfoPropertyName = "AudioSpeechRequestModel2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioSpeechRequestResponseFormat), TypeInfoPropertyName = "AudioSpeechRequestResponseFormat2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioSpeechRequestResponseEncoding), TypeInfoPropertyName = "AudioSpeechRequestResponseEncoding2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioSpeechRequestExtraParams))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioTranscriptionRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf), TypeInfoPropertyName = "OneOfByteArrayString2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(byte[]))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioTranscriptionRequestModel), TypeInfoPropertyName = "AudioTranscriptionRequestModel2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioTranscriptionRequestResponseFormat), TypeInfoPropertyName = "AudioTranscriptionRequestResponseFormat2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf>), TypeInfoPropertyName = "OneOfAudioTranscriptionRequestTimestampGranularitiesIListAudioTranscriptionRequestTimestampGranularitie2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioTranscriptionRequestTimestampGranularities), TypeInfoPropertyName = "AudioTranscriptionRequestTimestampGranularities2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioTranscriptionRequestTimestampGranularitie), TypeInfoPropertyName = "AudioTranscriptionRequestTimestampGranularitie2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioTranscriptionResponse), TypeInfoPropertyName = "AudioTranscriptionResponse2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioTranscriptionJsonResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioTranscriptionVerboseJsonResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioTranscriptionSegment))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioTranscriptionWord))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioTranscriptionSpeakerSegment))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioTranslationRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioTranslationRequestModel), TypeInfoPropertyName = "AudioTranslationRequestModel2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioTranslationRequestResponseFormat), TypeInfoPropertyName = "AudioTranslationRequestResponseFormat2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf>), TypeInfoPropertyName = "OneOfAudioTranslationRequestTimestampGranularitiesIListAudioTranslationRequestTimestampGranularitie2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioTranslationRequestTimestampGranularities), TypeInfoPropertyName = "AudioTranslationRequestTimestampGranularities2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioTranslationRequestTimestampGranularitie), TypeInfoPropertyName = "AudioTranslationRequestTimestampGranularitie2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioTranslationResponse), TypeInfoPropertyName = "AudioTranslationResponse2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioTranslationJsonResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioTranslationVerboseJsonResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioSpeechStreamResponse), TypeInfoPropertyName = "AudioSpeechStreamResponse2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioSpeechStreamEvent))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioSpeechStreamChunk))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.StreamSentinelData), TypeInfoPropertyName = "StreamSentinelData2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RealtimeTtsModel), TypeInfoPropertyName = "RealtimeTtsModel2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RealtimeTranscriptionInputAudioFormat), TypeInfoPropertyName = "RealtimeTranscriptionInputAudioFormat2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(double?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AnyOf?), TypeInfoPropertyName = "NullableAnyOfAudioSpeechRequestModelString2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioSpeechRequestModel?), TypeInfoPropertyName = "NullableAudioSpeechRequestModel2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioSpeechRequestResponseFormat?), TypeInfoPropertyName = "NullableAudioSpeechRequestResponseFormat2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioSpeechRequestResponseEncoding?), TypeInfoPropertyName = "NullableAudioSpeechRequestResponseEncoding2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf?), TypeInfoPropertyName = "NullableOneOfByteArrayString2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioTranscriptionRequestModel?), TypeInfoPropertyName = "NullableAudioTranscriptionRequestModel2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioTranscriptionRequestResponseFormat?), TypeInfoPropertyName = "NullableAudioTranscriptionRequestResponseFormat2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf>?), TypeInfoPropertyName = "NullableOneOfAudioTranscriptionRequestTimestampGranularitiesIListAudioTranscriptionRequestTimestampGranularitie2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioTranscriptionRequestTimestampGranularities?), TypeInfoPropertyName = "NullableAudioTranscriptionRequestTimestampGranularities2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioTranscriptionRequestTimestampGranularitie?), TypeInfoPropertyName = "NullableAudioTranscriptionRequestTimestampGranularitie2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioTranscriptionResponse?), TypeInfoPropertyName = "NullableAudioTranscriptionResponse2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioTranslationRequestModel?), TypeInfoPropertyName = "NullableAudioTranslationRequestModel2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioTranslationRequestResponseFormat?), TypeInfoPropertyName = "NullableAudioTranslationRequestResponseFormat2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf>?), TypeInfoPropertyName = "NullableOneOfAudioTranslationRequestTimestampGranularitiesIListAudioTranslationRequestTimestampGranularitie2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioTranslationRequestTimestampGranularities?), TypeInfoPropertyName = "NullableAudioTranslationRequestTimestampGranularities2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioTranslationRequestTimestampGranularitie?), TypeInfoPropertyName = "NullableAudioTranslationRequestTimestampGranularitie2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioTranslationResponse?), TypeInfoPropertyName = "NullableAudioTranslationResponse2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioSpeechStreamResponse?), TypeInfoPropertyName = "NullableAudioSpeechStreamResponse2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.StreamSentinelData?), TypeInfoPropertyName = "NullableStreamSentinelData2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RealtimeTtsModel?), TypeInfoPropertyName = "NullableRealtimeTtsModel2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RealtimeTranscriptionInputAudioFormat?), TypeInfoPropertyName = "NullableRealtimeTranscriptionInputAudioFormat2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf>))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf>))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - internal sealed partial class AudioSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext - { - } - /// +{ /// /// /// public sealed partial class AudioSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext @@ -140,32 +46,7 @@ private AudioSourceGenerationContext(global::System.Text.Json.JsonSerializerOpti [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) { - options.Converters.Add(new global::Together.JsonConverters.AudioTranscriptionResponseJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.AudioTranslationResponseJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.AudioSpeechStreamResponseJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter, global::System.Collections.Generic.IList>()); - options.Converters.Add(new global::Together.JsonConverters.AnyOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter>()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter>()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter>()); - options.Converters.Add(new global::Together.JsonConverters.UnixTimestampJsonConverter()); - options.Converters.Add(new LazyEnumJsonConverterFactory()); + global::Together.SourceGenerationContext.AddConverters(options); } private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() @@ -180,216 +61,6 @@ public static void AddConverters(global::System.Text.Json.JsonSerializerOptions return options; } - - private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Serialization.JsonConverterFactory - { - public override bool CanConvert(global::System.Type typeToConvert) - { - return - typeToConvert == typeof(global::Together.AudioSpeechRequestModel) - - || typeToConvert == typeof(global::Together.AudioSpeechRequestModel?) - - || typeToConvert == typeof(global::Together.AudioSpeechRequestResponseFormat) - - || typeToConvert == typeof(global::Together.AudioSpeechRequestResponseFormat?) - - || typeToConvert == typeof(global::Together.AudioSpeechRequestResponseEncoding) - - || typeToConvert == typeof(global::Together.AudioSpeechRequestResponseEncoding?) - - || typeToConvert == typeof(global::Together.AudioTranscriptionRequestModel) - - || typeToConvert == typeof(global::Together.AudioTranscriptionRequestModel?) - - || typeToConvert == typeof(global::Together.AudioTranscriptionRequestResponseFormat) - - || typeToConvert == typeof(global::Together.AudioTranscriptionRequestResponseFormat?) - - || typeToConvert == typeof(global::Together.AudioTranscriptionRequestTimestampGranularities) - - || typeToConvert == typeof(global::Together.AudioTranscriptionRequestTimestampGranularities?) - - || typeToConvert == typeof(global::Together.AudioTranscriptionRequestTimestampGranularitie) - - || typeToConvert == typeof(global::Together.AudioTranscriptionRequestTimestampGranularitie?) - - || typeToConvert == typeof(global::Together.AudioTranslationRequestModel) - - || typeToConvert == typeof(global::Together.AudioTranslationRequestModel?) - - || typeToConvert == typeof(global::Together.AudioTranslationRequestResponseFormat) - - || typeToConvert == typeof(global::Together.AudioTranslationRequestResponseFormat?) - - || typeToConvert == typeof(global::Together.AudioTranslationRequestTimestampGranularities) - - || typeToConvert == typeof(global::Together.AudioTranslationRequestTimestampGranularities?) - - || typeToConvert == typeof(global::Together.AudioTranslationRequestTimestampGranularitie) - - || typeToConvert == typeof(global::Together.AudioTranslationRequestTimestampGranularitie?) - - || typeToConvert == typeof(global::Together.StreamSentinelData) - - || typeToConvert == typeof(global::Together.StreamSentinelData?) - - || typeToConvert == typeof(global::Together.RealtimeTtsModel) - - || typeToConvert == typeof(global::Together.RealtimeTtsModel?) - - || typeToConvert == typeof(global::Together.RealtimeTranscriptionInputAudioFormat) - - || typeToConvert == typeof(global::Together.RealtimeTranscriptionInputAudioFormat?); - } - - public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - if (typeToConvert == typeof(global::Together.AudioSpeechRequestModel)) - { - return new global::Together.JsonConverters.AudioSpeechRequestModelJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.AudioSpeechRequestModel?)) - { - return new global::Together.JsonConverters.AudioSpeechRequestModelNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.AudioSpeechRequestResponseFormat)) - { - return new global::Together.JsonConverters.AudioSpeechRequestResponseFormatJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.AudioSpeechRequestResponseFormat?)) - { - return new global::Together.JsonConverters.AudioSpeechRequestResponseFormatNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.AudioSpeechRequestResponseEncoding)) - { - return new global::Together.JsonConverters.AudioSpeechRequestResponseEncodingJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.AudioSpeechRequestResponseEncoding?)) - { - return new global::Together.JsonConverters.AudioSpeechRequestResponseEncodingNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.AudioTranscriptionRequestModel)) - { - return new global::Together.JsonConverters.AudioTranscriptionRequestModelJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.AudioTranscriptionRequestModel?)) - { - return new global::Together.JsonConverters.AudioTranscriptionRequestModelNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.AudioTranscriptionRequestResponseFormat)) - { - return new global::Together.JsonConverters.AudioTranscriptionRequestResponseFormatJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.AudioTranscriptionRequestResponseFormat?)) - { - return new global::Together.JsonConverters.AudioTranscriptionRequestResponseFormatNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.AudioTranscriptionRequestTimestampGranularities)) - { - return new global::Together.JsonConverters.AudioTranscriptionRequestTimestampGranularitiesJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.AudioTranscriptionRequestTimestampGranularities?)) - { - return new global::Together.JsonConverters.AudioTranscriptionRequestTimestampGranularitiesNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.AudioTranscriptionRequestTimestampGranularitie)) - { - return new global::Together.JsonConverters.AudioTranscriptionRequestTimestampGranularitieJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.AudioTranscriptionRequestTimestampGranularitie?)) - { - return new global::Together.JsonConverters.AudioTranscriptionRequestTimestampGranularitieNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.AudioTranslationRequestModel)) - { - return new global::Together.JsonConverters.AudioTranslationRequestModelJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.AudioTranslationRequestModel?)) - { - return new global::Together.JsonConverters.AudioTranslationRequestModelNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.AudioTranslationRequestResponseFormat)) - { - return new global::Together.JsonConverters.AudioTranslationRequestResponseFormatJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.AudioTranslationRequestResponseFormat?)) - { - return new global::Together.JsonConverters.AudioTranslationRequestResponseFormatNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.AudioTranslationRequestTimestampGranularities)) - { - return new global::Together.JsonConverters.AudioTranslationRequestTimestampGranularitiesJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.AudioTranslationRequestTimestampGranularities?)) - { - return new global::Together.JsonConverters.AudioTranslationRequestTimestampGranularitiesNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.AudioTranslationRequestTimestampGranularitie)) - { - return new global::Together.JsonConverters.AudioTranslationRequestTimestampGranularitieJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.AudioTranslationRequestTimestampGranularitie?)) - { - return new global::Together.JsonConverters.AudioTranslationRequestTimestampGranularitieNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.StreamSentinelData)) - { - return new global::Together.JsonConverters.StreamSentinelDataJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.StreamSentinelData?)) - { - return new global::Together.JsonConverters.StreamSentinelDataNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.RealtimeTtsModel)) - { - return new global::Together.JsonConverters.RealtimeTtsModelJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.RealtimeTtsModel?)) - { - return new global::Together.JsonConverters.RealtimeTtsModelNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.RealtimeTranscriptionInputAudioFormat)) - { - return new global::Together.JsonConverters.RealtimeTranscriptionInputAudioFormatJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.RealtimeTranscriptionInputAudioFormat?)) - { - return new global::Together.JsonConverters.RealtimeTranscriptionInputAudioFormatNullableJsonConverter(); - } - throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); - } - } - private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver { private readonly object _gate = new(); @@ -429,7 +100,7 @@ private sealed class LazyChunkResolver : global::System.Text.Json.Serialization. { return index switch { - 0 => new AudioSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), + 0 => global::Together.SourceGenerationContext.TypeInfoResolver, _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), }; } diff --git a/src/libs/Together/Generated/Together.AudioClient.AudioSpeech.g.cs b/src/libs/Together/Generated/Together.AudioClient.AudioSpeech.g.cs index 024e0b97..9eec325a 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 @@ -49,6 +62,20 @@ partial void ProcessAudioSpeechResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.audio.speech.with_streaming_response.create(
+ /// model="cartesia/sonic-2",
+ /// input="The quick brown fox jumps over the lazy dog.",
+ /// voice="laidback woman",
+ /// )
+ /// with response as stream:
+ /// stream.stream_to_file("audio.wav") + ///
public async global::System.Threading.Tasks.Task AudioSpeechAsync( global::Together.AudioSpeechRequest request, @@ -72,6 +99,20 @@ partial void ProcessAudioSpeechResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.audio.speech.with_streaming_response.create(
+ /// model="cartesia/sonic-2",
+ /// input="The quick brown fox jumps over the lazy dog.",
+ /// voice="laidback woman",
+ /// )
+ /// with response as stream:
+ /// stream.stream_to_file("audio.wav") + ///
public async global::System.Threading.Tasks.Task AudioSpeechAsStreamAsync( global::Together.AudioSpeechRequest request, @@ -123,8 +164,10 @@ partial void ProcessAudioSpeechResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: "/v1/audio/speech", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: "/audio/speech", + baseUri: ResolveBaseUri( + servers: s_AudioSpeechServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -194,7 +237,7 @@ partial void ProcessAudioSpeechResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "AudioSpeech", methodName: "AudioSpeechAsync", - pathTemplate: "\"/v1/audio/speech\"", + pathTemplate: "\"/audio/speech\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -228,7 +271,7 @@ partial void ProcessAudioSpeechResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "AudioSpeech", methodName: "AudioSpeechAsync", - pathTemplate: "\"/v1/audio/speech\"", + pathTemplate: "\"/audio/speech\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -269,7 +312,7 @@ partial void ProcessAudioSpeechResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "AudioSpeech", methodName: "AudioSpeechAsync", - pathTemplate: "\"/v1/audio/speech\"", + pathTemplate: "\"/audio/speech\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -317,7 +360,7 @@ partial void ProcessAudioSpeechResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "AudioSpeech", methodName: "AudioSpeechAsync", - pathTemplate: "\"/v1/audio/speech\"", + pathTemplate: "\"/audio/speech\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -339,7 +382,7 @@ partial void ProcessAudioSpeechResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "AudioSpeech", methodName: "AudioSpeechAsync", - pathTemplate: "\"/v1/audio/speech\"", + pathTemplate: "\"/audio/speech\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -487,6 +530,20 @@ partial void ProcessAudioSpeechResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.audio.speech.with_streaming_response.create(
+ /// model="cartesia/sonic-2",
+ /// input="The quick brown fox jumps over the lazy dog.",
+ /// voice="laidback woman",
+ /// )
+ /// with response as stream:
+ /// stream.stream_to_file("audio.wav") + ///
public async global::System.Threading.Tasks.Task> AudioSpeechAsResponseAsync( global::Together.AudioSpeechRequest request, @@ -538,8 +595,10 @@ partial void ProcessAudioSpeechResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: "/v1/audio/speech", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: "/audio/speech", + baseUri: ResolveBaseUri( + servers: s_AudioSpeechServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -609,7 +668,7 @@ partial void ProcessAudioSpeechResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "AudioSpeech", methodName: "AudioSpeechAsync", - pathTemplate: "\"/v1/audio/speech\"", + pathTemplate: "\"/audio/speech\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -643,7 +702,7 @@ partial void ProcessAudioSpeechResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "AudioSpeech", methodName: "AudioSpeechAsync", - pathTemplate: "\"/v1/audio/speech\"", + pathTemplate: "\"/audio/speech\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -684,7 +743,7 @@ partial void ProcessAudioSpeechResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "AudioSpeech", methodName: "AudioSpeechAsync", - pathTemplate: "\"/v1/audio/speech\"", + pathTemplate: "\"/audio/speech\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -732,7 +791,7 @@ partial void ProcessAudioSpeechResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "AudioSpeech", methodName: "AudioSpeechAsync", - pathTemplate: "\"/v1/audio/speech\"", + pathTemplate: "\"/audio/speech\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -754,7 +813,7 @@ partial void ProcessAudioSpeechResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "AudioSpeech", methodName: "AudioSpeechAsync", - pathTemplate: "\"/v1/audio/speech\"", + pathTemplate: "\"/audio/speech\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.AudioClient.AudioSpeechAsEventStream.g.cs b/src/libs/Together/Generated/Together.AudioClient.AudioSpeechAsEventStream.g.cs index d344a945..1a140d26 100644 --- a/src/libs/Together/Generated/Together.AudioClient.AudioSpeechAsEventStream.g.cs +++ b/src/libs/Together/Generated/Together.AudioClient.AudioSpeechAsEventStream.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class AudioClient { + private static readonly global::Together.AutoSDKServer[] s_AudioSpeechAsEventStreamServers = 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_AudioSpeechAsEventStreamSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -44,6 +57,20 @@ partial void ProcessAudioSpeechAsEventStreamResponse( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.audio.speech.with_streaming_response.create(
+ /// model="cartesia/sonic-2",
+ /// input="The quick brown fox jumps over the lazy dog.",
+ /// voice="laidback woman",
+ /// )
+ /// with response as stream:
+ /// stream.stream_to_file("audio.wav") + ///
public async global::System.Collections.Generic.IAsyncEnumerable AudioSpeechAsEventStreamAsync( global::Together.AudioSpeechRequest request, @@ -95,8 +122,10 @@ partial void ProcessAudioSpeechAsEventStreamResponse( { var __pathBuilder = new global::Together.PathBuilder( - path: "/v1/audio/speech", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: "/audio/speech", + baseUri: ResolveBaseUri( + servers: s_AudioSpeechAsEventStreamServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -166,7 +195,7 @@ partial void ProcessAudioSpeechAsEventStreamResponse( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "AudioSpeechAsEventStream", methodName: "AudioSpeechAsEventStreamAsync", - pathTemplate: "\"/v1/audio/speech\"", + pathTemplate: "\"/audio/speech\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -200,7 +229,7 @@ partial void ProcessAudioSpeechAsEventStreamResponse( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "AudioSpeechAsEventStream", methodName: "AudioSpeechAsEventStreamAsync", - pathTemplate: "\"/v1/audio/speech\"", + pathTemplate: "\"/audio/speech\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -241,7 +270,7 @@ partial void ProcessAudioSpeechAsEventStreamResponse( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "AudioSpeechAsEventStream", methodName: "AudioSpeechAsEventStreamAsync", - pathTemplate: "\"/v1/audio/speech\"", + pathTemplate: "\"/audio/speech\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -289,7 +318,7 @@ partial void ProcessAudioSpeechAsEventStreamResponse( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "AudioSpeechAsEventStream", methodName: "AudioSpeechAsEventStreamAsync", - pathTemplate: "\"/v1/audio/speech\"", + pathTemplate: "\"/audio/speech\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -311,7 +340,7 @@ partial void ProcessAudioSpeechAsEventStreamResponse( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "AudioSpeechAsEventStream", methodName: "AudioSpeechAsEventStreamAsync", - pathTemplate: "\"/v1/audio/speech\"", + pathTemplate: "\"/audio/speech\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.AudioClient.AudioTranscriptions.g.cs b/src/libs/Together/Generated/Together.AudioClient.AudioTranscriptions.g.cs index 7ff2c386..1bed2e75 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 @@ -49,6 +62,19 @@ partial void ProcessAudioTranscriptionsResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// import os
+ /// from together import Together
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// file = open("audio.wav", "rb")
+ /// response = client.audio.transcriptions.create(
+ /// model="openai/whisper-large-v3",
+ /// file=file,
+ /// )
+ /// print(response.text) + ///
public async global::System.Threading.Tasks.Task AudioTranscriptionsAsync( global::Together.AudioTranscriptionRequest request, @@ -72,6 +98,19 @@ partial void ProcessAudioTranscriptionsResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// import os
+ /// from together import Together
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// file = open("audio.wav", "rb")
+ /// response = client.audio.transcriptions.create(
+ /// model="openai/whisper-large-v3",
+ /// file=file,
+ /// )
+ /// print(response.text) + ///
public async global::System.Threading.Tasks.Task> AudioTranscriptionsAsResponseAsync( global::Together.AudioTranscriptionRequest request, @@ -110,8 +149,10 @@ partial void ProcessAudioTranscriptionsResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: "/v1/audio/transcriptions", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: "/audio/transcriptions", + baseUri: ResolveBaseUri( + servers: s_AudioTranscriptionsServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -315,7 +356,7 @@ __fileNameFile1 is null context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "AudioTranscriptions", methodName: "AudioTranscriptionsAsync", - pathTemplate: "\"/v1/audio/transcriptions\"", + pathTemplate: "\"/audio/transcriptions\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -349,7 +390,7 @@ __fileNameFile1 is null context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "AudioTranscriptions", methodName: "AudioTranscriptionsAsync", - pathTemplate: "\"/v1/audio/transcriptions\"", + pathTemplate: "\"/audio/transcriptions\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -390,7 +431,7 @@ __fileNameFile1 is null context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "AudioTranscriptions", methodName: "AudioTranscriptionsAsync", - pathTemplate: "\"/v1/audio/transcriptions\"", + pathTemplate: "\"/audio/transcriptions\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -438,7 +479,7 @@ __fileNameFile1 is null context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "AudioTranscriptions", methodName: "AudioTranscriptionsAsync", - pathTemplate: "\"/v1/audio/transcriptions\"", + pathTemplate: "\"/audio/transcriptions\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -460,7 +501,7 @@ __fileNameFile1 is null context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "AudioTranscriptions", methodName: "AudioTranscriptionsAsync", - pathTemplate: "\"/v1/audio/transcriptions\"", + pathTemplate: "\"/audio/transcriptions\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.AudioClient.AudioTranslations.g.cs b/src/libs/Together/Generated/Together.AudioClient.AudioTranslations.g.cs index bd3c0287..497cb627 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 @@ -49,6 +62,20 @@ partial void ProcessAudioTranslationsResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// file = open("audio.wav", "rb")
+ /// response = client.audio.translations.create(
+ /// model="openai/whisper-large-v3",
+ /// file=file,
+ /// language="es",
+ /// )
+ /// print(response.text) + ///
public async global::System.Threading.Tasks.Task AudioTranslationsAsync( global::Together.AudioTranslationRequest request, @@ -72,6 +99,20 @@ partial void ProcessAudioTranslationsResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// file = open("audio.wav", "rb")
+ /// response = client.audio.translations.create(
+ /// model="openai/whisper-large-v3",
+ /// file=file,
+ /// language="es",
+ /// )
+ /// print(response.text) + ///
public async global::System.Threading.Tasks.Task> AudioTranslationsAsResponseAsync( global::Together.AudioTranslationRequest request, @@ -110,8 +151,10 @@ partial void ProcessAudioTranslationsResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: "/v1/audio/translations", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: "/audio/translations", + baseUri: ResolveBaseUri( + servers: s_AudioTranslationsServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -290,7 +333,7 @@ __fileNameFile1 is null context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "AudioTranslations", methodName: "AudioTranslationsAsync", - pathTemplate: "\"/v1/audio/translations\"", + pathTemplate: "\"/audio/translations\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -324,7 +367,7 @@ __fileNameFile1 is null context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "AudioTranslations", methodName: "AudioTranslationsAsync", - pathTemplate: "\"/v1/audio/translations\"", + pathTemplate: "\"/audio/translations\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -365,7 +408,7 @@ __fileNameFile1 is null context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "AudioTranslations", methodName: "AudioTranslationsAsync", - pathTemplate: "\"/v1/audio/translations\"", + pathTemplate: "\"/audio/translations\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -413,7 +456,7 @@ __fileNameFile1 is null context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "AudioTranslations", methodName: "AudioTranslationsAsync", - pathTemplate: "\"/v1/audio/translations\"", + pathTemplate: "\"/audio/translations\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -435,7 +478,7 @@ __fileNameFile1 is null context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "AudioTranslations", methodName: "AudioTranslationsAsync", - pathTemplate: "\"/v1/audio/translations\"", + pathTemplate: "\"/audio/translations\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.AudioClient.RealtimeTranscription.g.cs b/src/libs/Together/Generated/Together.AudioClient.RealtimeTranscription.g.cs index ee5e5a8b..56a1282c 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 @@ -170,6 +183,54 @@ partial void ProcessRealtimeTranscriptionResponse( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// import asyncio
+ /// import websockets
+ /// import json
+ /// import base64
+ /// import os
+ /// async def transcribe_audio():
+ /// api_key = os.environ.get("TOGETHER_API_KEY")
+ /// url = "wss://api.together.ai/v1/realtime?model=openai/whisper-large-v3&input_audio_format=pcm_s16le_16000"
+ /// headers = {
+ /// "Authorization": f"Bearer {api_key}"
+ /// }
+ /// async with websockets.connect(url, additional_headers=headers) as ws:
+ /// # audio.wav must be 16 kHz, 16-bit mono PCM to match input_audio_format
+ /// with open("audio.wav", "rb") as f:
+ /// audio_data = f.read()
+ /// # Send audio in chunks with delay to simulate real-time
+ /// chunk_size = 8192
+ /// bytes_per_second = 16000 * 2 # 16kHz * 2 bytes (16-bit)
+ /// delay_per_chunk = chunk_size / bytes_per_second
+ /// for i in range(0, len(audio_data), chunk_size):
+ /// chunk = audio_data[i:i+chunk_size]
+ /// base64_chunk = base64.b64encode(chunk).decode('utf-8')
+ /// await ws.send(json.dumps({
+ /// "type": "input_audio_buffer.append",
+ /// "audio": base64_chunk
+ /// }))
+ /// # Simulate real-time streaming
+ /// if i + chunk_size < len(audio_data):
+ /// await asyncio.sleep(delay_per_chunk)
+ /// # Commit the audio buffer
+ /// await ws.send(json.dumps({
+ /// "type": "input_audio_buffer.commit"
+ /// }))
+ /// # Receive transcription results
+ /// async for message in ws:
+ /// data = json.loads(message)
+ /// if data["type"] == "conversation.item.input_audio_transcription.delta":
+ /// print(f"Partial: {data['delta']}")
+ /// elif data["type"] == "conversation.item.input_audio_transcription.completed":
+ /// print(f"Final: {data['transcript']}")
+ /// break
+ /// elif data["type"] == "conversation.item.input_audio_transcription.failed":
+ /// error = data.get("error", {})
+ /// print(f"Error: {error.get('message')}")
+ /// break
+ /// asyncio.run(transcribe_audio()) + ///
public async global::System.Threading.Tasks.Task RealtimeTranscriptionAsync( string model, global::Together.RealtimeTranscriptionInputAudioFormat inputAudioFormat = global::Together.RealtimeTranscriptionInputAudioFormat.PcmS16le16000, @@ -315,6 +376,54 @@ await RealtimeTranscriptionAsResponseAsync( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// import asyncio
+ /// import websockets
+ /// import json
+ /// import base64
+ /// import os
+ /// async def transcribe_audio():
+ /// api_key = os.environ.get("TOGETHER_API_KEY")
+ /// url = "wss://api.together.ai/v1/realtime?model=openai/whisper-large-v3&input_audio_format=pcm_s16le_16000"
+ /// headers = {
+ /// "Authorization": f"Bearer {api_key}"
+ /// }
+ /// async with websockets.connect(url, additional_headers=headers) as ws:
+ /// # audio.wav must be 16 kHz, 16-bit mono PCM to match input_audio_format
+ /// with open("audio.wav", "rb") as f:
+ /// audio_data = f.read()
+ /// # Send audio in chunks with delay to simulate real-time
+ /// chunk_size = 8192
+ /// bytes_per_second = 16000 * 2 # 16kHz * 2 bytes (16-bit)
+ /// delay_per_chunk = chunk_size / bytes_per_second
+ /// for i in range(0, len(audio_data), chunk_size):
+ /// chunk = audio_data[i:i+chunk_size]
+ /// base64_chunk = base64.b64encode(chunk).decode('utf-8')
+ /// await ws.send(json.dumps({
+ /// "type": "input_audio_buffer.append",
+ /// "audio": base64_chunk
+ /// }))
+ /// # Simulate real-time streaming
+ /// if i + chunk_size < len(audio_data):
+ /// await asyncio.sleep(delay_per_chunk)
+ /// # Commit the audio buffer
+ /// await ws.send(json.dumps({
+ /// "type": "input_audio_buffer.commit"
+ /// }))
+ /// # Receive transcription results
+ /// async for message in ws:
+ /// data = json.loads(message)
+ /// if data["type"] == "conversation.item.input_audio_transcription.delta":
+ /// print(f"Partial: {data['delta']}")
+ /// elif data["type"] == "conversation.item.input_audio_transcription.completed":
+ /// print(f"Final: {data['transcript']}")
+ /// break
+ /// elif data["type"] == "conversation.item.input_audio_transcription.failed":
+ /// error = data.get("error", {})
+ /// print(f"Error: {error.get('message')}")
+ /// break
+ /// asyncio.run(transcribe_audio()) + ///
public async global::System.Threading.Tasks.Task RealtimeTranscriptionAsResponseAsync( string model, global::Together.RealtimeTranscriptionInputAudioFormat inputAudioFormat = global::Together.RealtimeTranscriptionInputAudioFormat.PcmS16le16000, @@ -352,8 +461,10 @@ await RealtimeTranscriptionAsResponseAsync( { var __pathBuilder = new global::Together.PathBuilder( - path: "/v1/realtime", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: "/realtime", + baseUri: ResolveBaseUri( + servers: s_RealtimeTranscriptionServers, + defaultBaseUrl: "https://api.together.ai/v1")); __pathBuilder .AddRequiredParameter("model", model) .AddRequiredParameter("input_audio_format", inputAudioFormat.ToValueString()) @@ -418,7 +529,7 @@ await RealtimeTranscriptionAsResponseAsync( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RealtimeTranscription", methodName: "RealtimeTranscriptionAsync", - pathTemplate: "\"/v1/realtime\"", + pathTemplate: "\"/realtime\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -452,7 +563,7 @@ await RealtimeTranscriptionAsResponseAsync( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RealtimeTranscription", methodName: "RealtimeTranscriptionAsync", - pathTemplate: "\"/v1/realtime\"", + pathTemplate: "\"/realtime\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -493,7 +604,7 @@ await RealtimeTranscriptionAsResponseAsync( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RealtimeTranscription", methodName: "RealtimeTranscriptionAsync", - pathTemplate: "\"/v1/realtime\"", + pathTemplate: "\"/realtime\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -541,7 +652,7 @@ await RealtimeTranscriptionAsResponseAsync( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RealtimeTranscription", methodName: "RealtimeTranscriptionAsync", - pathTemplate: "\"/v1/realtime\"", + pathTemplate: "\"/realtime\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -563,7 +674,7 @@ await RealtimeTranscriptionAsResponseAsync( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RealtimeTranscription", methodName: "RealtimeTranscriptionAsync", - pathTemplate: "\"/v1/realtime\"", + pathTemplate: "\"/realtime\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.AudioClient.RealtimeTts.g.cs b/src/libs/Together/Generated/Together.AudioClient.RealtimeTts.g.cs index 1badb2f1..5ccbd85e 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 @@ -167,6 +180,69 @@ partial void ProcessRealtimeTtsResponse( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// import asyncio
+ /// import websockets
+ /// import json
+ /// import base64
+ /// import os
+ /// async def generate_speech():
+ /// api_key = os.environ.get("TOGETHER_API_KEY")
+ /// url = "wss://api.together.ai/v1/audio/speech/websocket?model=hexgrad/Kokoro-82M&voice=af_heart"
+ /// headers = {
+ /// "Authorization": f"Bearer {api_key}"
+ /// }
+ /// async with websockets.connect(url, additional_headers=headers) as ws:
+ /// # Wait for session created
+ /// session_msg = await ws.recv()
+ /// session_data = json.loads(session_msg)
+ /// if session_data.get("type") != "session.created":
+ /// print(f"Failed to start session: {session_data}")
+ /// return
+ /// print(f"Session created: {session_data['session']['id']}")
+ /// # Send text for TTS
+ /// text_chunks = [
+ /// "Hello, this is a test.",
+ /// "This is the second sentence.",
+ /// "And this is the final one."
+ /// ]
+ /// async def send_text():
+ /// for chunk in text_chunks:
+ /// await ws.send(json.dumps({
+ /// "type": "input_text_buffer.append",
+ /// "text": chunk
+ /// }))
+ /// await asyncio.sleep(0.5) # Simulate typing
+ /// # Commit to process any remaining text
+ /// await ws.send(json.dumps({
+ /// "type": "input_text_buffer.commit"
+ /// }))
+ /// async def receive_audio():
+ /// audio_data = bytearray()
+ /// async for message in ws:
+ /// data = json.loads(message)
+ /// if data["type"] == "conversation.item.input_text.received":
+ /// print(f"Text received: {data['text']}")
+ /// elif data["type"] == "conversation.item.audio_output.delta":
+ /// # Decode base64 audio chunk
+ /// audio_chunk = base64.b64decode(data['delta'])
+ /// audio_data.extend(audio_chunk)
+ /// print(f"Received audio chunk for item {data['item_id']}")
+ /// elif data["type"] == "conversation.item.audio_output.done":
+ /// print(f"Audio generation complete for item {data['item_id']}")
+ /// break
+ /// elif data["type"] == "conversation.item.tts.failed":
+ /// error = data.get("error", {})
+ /// print(f"Error: {error.get('message')}")
+ /// break
+ /// # Save the raw PCM samples to a file
+ /// with open("output.pcm", "wb") as f:
+ /// f.write(audio_data)
+ /// print("Audio saved to output.pcm")
+ /// # Run send and receive concurrently
+ /// await asyncio.gather(send_text(), receive_audio())
+ /// asyncio.run(generate_speech()) + ///
public async global::System.Threading.Tasks.Task RealtimeTtsAsync( global::Together.RealtimeTtsModel? model = default, string? voice = default, @@ -309,6 +385,69 @@ await RealtimeTtsAsResponseAsync( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// import asyncio
+ /// import websockets
+ /// import json
+ /// import base64
+ /// import os
+ /// async def generate_speech():
+ /// api_key = os.environ.get("TOGETHER_API_KEY")
+ /// url = "wss://api.together.ai/v1/audio/speech/websocket?model=hexgrad/Kokoro-82M&voice=af_heart"
+ /// headers = {
+ /// "Authorization": f"Bearer {api_key}"
+ /// }
+ /// async with websockets.connect(url, additional_headers=headers) as ws:
+ /// # Wait for session created
+ /// session_msg = await ws.recv()
+ /// session_data = json.loads(session_msg)
+ /// if session_data.get("type") != "session.created":
+ /// print(f"Failed to start session: {session_data}")
+ /// return
+ /// print(f"Session created: {session_data['session']['id']}")
+ /// # Send text for TTS
+ /// text_chunks = [
+ /// "Hello, this is a test.",
+ /// "This is the second sentence.",
+ /// "And this is the final one."
+ /// ]
+ /// async def send_text():
+ /// for chunk in text_chunks:
+ /// await ws.send(json.dumps({
+ /// "type": "input_text_buffer.append",
+ /// "text": chunk
+ /// }))
+ /// await asyncio.sleep(0.5) # Simulate typing
+ /// # Commit to process any remaining text
+ /// await ws.send(json.dumps({
+ /// "type": "input_text_buffer.commit"
+ /// }))
+ /// async def receive_audio():
+ /// audio_data = bytearray()
+ /// async for message in ws:
+ /// data = json.loads(message)
+ /// if data["type"] == "conversation.item.input_text.received":
+ /// print(f"Text received: {data['text']}")
+ /// elif data["type"] == "conversation.item.audio_output.delta":
+ /// # Decode base64 audio chunk
+ /// audio_chunk = base64.b64decode(data['delta'])
+ /// audio_data.extend(audio_chunk)
+ /// print(f"Received audio chunk for item {data['item_id']}")
+ /// elif data["type"] == "conversation.item.audio_output.done":
+ /// print(f"Audio generation complete for item {data['item_id']}")
+ /// break
+ /// elif data["type"] == "conversation.item.tts.failed":
+ /// error = data.get("error", {})
+ /// print(f"Error: {error.get('message')}")
+ /// break
+ /// # Save the raw PCM samples to a file
+ /// with open("output.pcm", "wb") as f:
+ /// f.write(audio_data)
+ /// print("Audio saved to output.pcm")
+ /// # Run send and receive concurrently
+ /// await asyncio.gather(send_text(), receive_audio())
+ /// asyncio.run(generate_speech()) + ///
public async global::System.Threading.Tasks.Task RealtimeTtsAsResponseAsync( global::Together.RealtimeTtsModel? model = default, string? voice = default, @@ -350,8 +489,10 @@ await RealtimeTtsAsResponseAsync( { var __pathBuilder = new global::Together.PathBuilder( - path: "/v1/audio/speech/websocket", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: "/audio/speech/websocket", + baseUri: ResolveBaseUri( + servers: s_RealtimeTtsServers, + defaultBaseUrl: "https://api.together.ai/v1")); __pathBuilder .AddOptionalParameter("model", model?.ToValueString()) .AddOptionalParameter("voice", voice) @@ -420,7 +561,7 @@ await RealtimeTtsAsResponseAsync( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RealtimeTts", methodName: "RealtimeTtsAsync", - pathTemplate: "\"/v1/audio/speech/websocket\"", + pathTemplate: "\"/audio/speech/websocket\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -454,7 +595,7 @@ await RealtimeTtsAsResponseAsync( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RealtimeTts", methodName: "RealtimeTtsAsync", - pathTemplate: "\"/v1/audio/speech/websocket\"", + pathTemplate: "\"/audio/speech/websocket\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -495,7 +636,7 @@ await RealtimeTtsAsResponseAsync( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RealtimeTts", methodName: "RealtimeTtsAsync", - pathTemplate: "\"/v1/audio/speech/websocket\"", + pathTemplate: "\"/audio/speech/websocket\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -543,7 +684,7 @@ await RealtimeTtsAsResponseAsync( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RealtimeTts", methodName: "RealtimeTtsAsync", - pathTemplate: "\"/v1/audio/speech/websocket\"", + pathTemplate: "\"/audio/speech/websocket\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -565,7 +706,7 @@ await RealtimeTtsAsResponseAsync( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RealtimeTts", methodName: "RealtimeTtsAsync", - pathTemplate: "\"/v1/audio/speech/websocket\"", + pathTemplate: "\"/audio/speech/websocket\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.AudioClient.g.cs b/src/libs/Together/Generated/Together.AudioClient.g.cs index 7a1268f7..bceb0388 100644 --- a/src/libs/Together/Generated/Together.AudioClient.g.cs +++ b/src/libs/Together/Generated/Together.AudioClient.g.cs @@ -12,7 +12,7 @@ public sealed partial class AudioClient : global::Together.IAudioClient, global: /// /// Default environment for APIs /// - public const string DefaultBaseUrl = "https://api.together.ai/"; + public const string DefaultBaseUrl = "https://api.together.ai/v1"; private bool _disposeHttpClient = true; @@ -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; } @@ -53,6 +53,34 @@ public sealed partial class AudioClient : global::Together.IAudioClient, global: } + + 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. @@ -151,5 +179,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.Batches.JsonSerializerContext.g.cs b/src/libs/Together/Generated/Together.Batches.JsonSerializerContext.g.cs index 8885bab0..f481272e 100644 --- a/src/libs/Together/Generated/Together.Batches.JsonSerializerContext.g.cs +++ b/src/libs/Together/Generated/Together.Batches.JsonSerializerContext.g.cs @@ -2,42 +2,7 @@ #nullable enable namespace Together -{ - /// - /// - /// - [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( - DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull - )] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(double))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(long))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Guid))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateBatchRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateBatchRequestEndpoint), TypeInfoPropertyName = "CreateBatchRequestEndpoint2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.BatchErrorResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.BatchJobWithWarning))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.BatchJob))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.BatchJobStatus), TypeInfoPropertyName = "BatchJobStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(double?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(long?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Guid?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateBatchRequestEndpoint?), TypeInfoPropertyName = "NullableCreateBatchRequestEndpoint2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.BatchJobStatus?), TypeInfoPropertyName = "NullableBatchJobStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - internal sealed partial class BatchesSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext - { - } - /// +{ /// /// /// public sealed partial class BatchesSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext @@ -81,26 +46,7 @@ private BatchesSourceGenerationContext(global::System.Text.Json.JsonSerializerOp [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) { - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter, global::System.Collections.Generic.IList>()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter>()); - options.Converters.Add(new global::Together.JsonConverters.UnixTimestampJsonConverter()); - options.Converters.Add(new LazyEnumJsonConverterFactory()); + global::Together.SourceGenerationContext.AddConverters(options); } private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() @@ -115,48 +61,6 @@ public static void AddConverters(global::System.Text.Json.JsonSerializerOptions return options; } - - private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Serialization.JsonConverterFactory - { - public override bool CanConvert(global::System.Type typeToConvert) - { - return - typeToConvert == typeof(global::Together.CreateBatchRequestEndpoint) - - || typeToConvert == typeof(global::Together.CreateBatchRequestEndpoint?) - - || typeToConvert == typeof(global::Together.BatchJobStatus) - - || typeToConvert == typeof(global::Together.BatchJobStatus?); - } - - public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - if (typeToConvert == typeof(global::Together.CreateBatchRequestEndpoint)) - { - return new global::Together.JsonConverters.CreateBatchRequestEndpointJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.CreateBatchRequestEndpoint?)) - { - return new global::Together.JsonConverters.CreateBatchRequestEndpointNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.BatchJobStatus)) - { - return new global::Together.JsonConverters.BatchJobStatusJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.BatchJobStatus?)) - { - return new global::Together.JsonConverters.BatchJobStatusNullableJsonConverter(); - } - throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); - } - } - private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver { private readonly object _gate = new(); @@ -196,7 +100,7 @@ private sealed class LazyChunkResolver : global::System.Text.Json.Serialization. { return index switch { - 0 => new BatchesSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), + 0 => global::Together.SourceGenerationContext.TypeInfoResolver, _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), }; } diff --git a/src/libs/Together/Generated/Together.BatchesClient.CreateBatches.g.cs b/src/libs/Together/Generated/Together.BatchesClient.CreateBatches.g.cs index 6c6bbfb9..3e6fe1b1 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 @@ -49,6 +62,15 @@ partial void ProcessCreateBatchesResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// batch = client.batches.create(input_file_id="<FILE_ID>", endpoint="/v1/chat/completions")
+ /// print(batch.job) + ///
public async global::System.Threading.Tasks.Task CreateBatchesAsync( global::Together.CreateBatchRequest request, @@ -72,6 +94,15 @@ partial void ProcessCreateBatchesResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// batch = client.batches.create(input_file_id="<FILE_ID>", endpoint="/v1/chat/completions")
+ /// print(batch.job) + ///
public async global::System.Threading.Tasks.Task> CreateBatchesAsResponseAsync( global::Together.CreateBatchRequest request, @@ -110,8 +141,10 @@ partial void ProcessCreateBatchesResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: "/v1/batches", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: "/batches", + baseUri: ResolveBaseUri( + servers: s_CreateBatchesServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -177,7 +210,7 @@ partial void ProcessCreateBatchesResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "createBatches", methodName: "CreateBatchesAsync", - pathTemplate: "\"/v1/batches\"", + pathTemplate: "\"/batches\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -211,7 +244,7 @@ partial void ProcessCreateBatchesResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "createBatches", methodName: "CreateBatchesAsync", - pathTemplate: "\"/v1/batches\"", + pathTemplate: "\"/batches\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -252,7 +285,7 @@ partial void ProcessCreateBatchesResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "createBatches", methodName: "CreateBatchesAsync", - pathTemplate: "\"/v1/batches\"", + pathTemplate: "\"/batches\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -300,7 +333,7 @@ partial void ProcessCreateBatchesResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "createBatches", methodName: "CreateBatchesAsync", - pathTemplate: "\"/v1/batches\"", + pathTemplate: "\"/batches\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -322,7 +355,7 @@ partial void ProcessCreateBatchesResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "createBatches", methodName: "CreateBatchesAsync", - pathTemplate: "\"/v1/batches\"", + pathTemplate: "\"/batches\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.BatchesClient.CreateBatchesByIdCancel.g.cs b/src/libs/Together/Generated/Together.BatchesClient.CreateBatchesByIdCancel.g.cs index 8473a854..0699ba35 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 @@ -52,6 +65,15 @@ partial void ProcessCreateBatchesByIdCancelResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// batch = client.batches.cancel("<BATCH_ID>")
+ /// print(batch) + ///
public async global::System.Threading.Tasks.Task CreateBatchesByIdCancelAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -76,6 +98,15 @@ partial void ProcessCreateBatchesByIdCancelResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// batch = client.batches.cancel("<BATCH_ID>")
+ /// print(batch) + ///
public async global::System.Threading.Tasks.Task> CreateBatchesByIdCancelAsResponseAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -111,8 +142,10 @@ partial void ProcessCreateBatchesByIdCancelResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v1/batches/{id}/cancel", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/batches/{id}/cancel", + baseUri: ResolveBaseUri( + servers: s_CreateBatchesByIdCancelServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -172,7 +205,7 @@ partial void ProcessCreateBatchesByIdCancelResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "createBatchesByIdCancel", methodName: "CreateBatchesByIdCancelAsync", - pathTemplate: "$\"/v1/batches/{id}/cancel\"", + pathTemplate: "$\"/batches/{id}/cancel\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -206,7 +239,7 @@ partial void ProcessCreateBatchesByIdCancelResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "createBatchesByIdCancel", methodName: "CreateBatchesByIdCancelAsync", - pathTemplate: "$\"/v1/batches/{id}/cancel\"", + pathTemplate: "$\"/batches/{id}/cancel\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -247,7 +280,7 @@ partial void ProcessCreateBatchesByIdCancelResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "createBatchesByIdCancel", methodName: "CreateBatchesByIdCancelAsync", - pathTemplate: "$\"/v1/batches/{id}/cancel\"", + pathTemplate: "$\"/batches/{id}/cancel\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -295,7 +328,7 @@ partial void ProcessCreateBatchesByIdCancelResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "createBatchesByIdCancel", methodName: "CreateBatchesByIdCancelAsync", - pathTemplate: "$\"/v1/batches/{id}/cancel\"", + pathTemplate: "$\"/batches/{id}/cancel\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -317,7 +350,7 @@ partial void ProcessCreateBatchesByIdCancelResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "createBatchesByIdCancel", methodName: "CreateBatchesByIdCancelAsync", - pathTemplate: "$\"/v1/batches/{id}/cancel\"", + pathTemplate: "$\"/batches/{id}/cancel\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.BatchesClient.GetBatches.g.cs b/src/libs/Together/Generated/Together.BatchesClient.GetBatches.g.cs index e4e36b58..4a7ee439 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 @@ -46,6 +59,16 @@ partial void ProcessGetBatchesResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// batches = client.batches.list()
+ /// for batch in batches:
+ /// print(batch.id) + ///
public async global::System.Threading.Tasks.Task> GetBatchesAsync( global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -64,6 +87,16 @@ partial void ProcessGetBatchesResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// batches = client.batches.list()
+ /// for batch in batches:
+ /// print(batch.id) + ///
public async global::System.Threading.Tasks.Task>> GetBatchesAsResponseAsync( global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -97,8 +130,10 @@ partial void ProcessGetBatchesResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: "/v1/batches", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: "/batches", + baseUri: ResolveBaseUri( + servers: s_GetBatchesServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -157,7 +192,7 @@ partial void ProcessGetBatchesResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getBatches", methodName: "GetBatchesAsync", - pathTemplate: "\"/v1/batches\"", + pathTemplate: "\"/batches\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -191,7 +226,7 @@ partial void ProcessGetBatchesResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getBatches", methodName: "GetBatchesAsync", - pathTemplate: "\"/v1/batches\"", + pathTemplate: "\"/batches\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -232,7 +267,7 @@ partial void ProcessGetBatchesResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getBatches", methodName: "GetBatchesAsync", - pathTemplate: "\"/v1/batches\"", + pathTemplate: "\"/batches\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -280,7 +315,7 @@ partial void ProcessGetBatchesResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getBatches", methodName: "GetBatchesAsync", - pathTemplate: "\"/v1/batches\"", + pathTemplate: "\"/batches\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -302,7 +337,7 @@ partial void ProcessGetBatchesResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getBatches", methodName: "GetBatchesAsync", - pathTemplate: "\"/v1/batches\"", + pathTemplate: "\"/batches\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.BatchesClient.GetBatchesById.g.cs b/src/libs/Together/Generated/Together.BatchesClient.GetBatchesById.g.cs index 3a8e0623..488adfe2 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 @@ -52,6 +65,15 @@ partial void ProcessGetBatchesByIdResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// batch = client.batches.retrieve("<BATCH_ID>")
+ /// print(batch) + ///
public async global::System.Threading.Tasks.Task GetBatchesByIdAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -76,6 +98,15 @@ partial void ProcessGetBatchesByIdResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// batch = client.batches.retrieve("<BATCH_ID>")
+ /// print(batch) + ///
public async global::System.Threading.Tasks.Task> GetBatchesByIdAsResponseAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -111,8 +142,10 @@ partial void ProcessGetBatchesByIdResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v1/batches/{id}", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/batches/{id}", + baseUri: ResolveBaseUri( + servers: s_GetBatchesByIdServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -172,7 +205,7 @@ partial void ProcessGetBatchesByIdResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getBatchesById", methodName: "GetBatchesByIdAsync", - pathTemplate: "$\"/v1/batches/{id}\"", + pathTemplate: "$\"/batches/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -206,7 +239,7 @@ partial void ProcessGetBatchesByIdResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getBatchesById", methodName: "GetBatchesByIdAsync", - pathTemplate: "$\"/v1/batches/{id}\"", + pathTemplate: "$\"/batches/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -247,7 +280,7 @@ partial void ProcessGetBatchesByIdResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getBatchesById", methodName: "GetBatchesByIdAsync", - pathTemplate: "$\"/v1/batches/{id}\"", + pathTemplate: "$\"/batches/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -295,7 +328,7 @@ partial void ProcessGetBatchesByIdResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getBatchesById", methodName: "GetBatchesByIdAsync", - pathTemplate: "$\"/v1/batches/{id}\"", + pathTemplate: "$\"/batches/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -317,7 +350,7 @@ partial void ProcessGetBatchesByIdResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getBatchesById", methodName: "GetBatchesByIdAsync", - pathTemplate: "$\"/v1/batches/{id}\"", + pathTemplate: "$\"/batches/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.BatchesClient.g.cs b/src/libs/Together/Generated/Together.BatchesClient.g.cs index d3edd295..4733ce45 100644 --- a/src/libs/Together/Generated/Together.BatchesClient.g.cs +++ b/src/libs/Together/Generated/Together.BatchesClient.g.cs @@ -12,7 +12,7 @@ public sealed partial class BatchesClient : global::Together.IBatchesClient, glo /// /// Default environment for APIs /// - public const string DefaultBaseUrl = "https://api.together.ai/"; + public const string DefaultBaseUrl = "https://api.together.ai/v1"; private bool _disposeHttpClient = true; @@ -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; } @@ -53,6 +53,34 @@ public sealed partial class BatchesClient : global::Together.IBatchesClient, glo } + + 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. @@ -151,5 +179,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.Billing.JsonSerializerContext.g.cs b/src/libs/Together/Generated/Together.Billing.JsonSerializerContext.g.cs index 304fe5d0..63b856ea 100644 --- a/src/libs/Together/Generated/Together.Billing.JsonSerializerContext.g.cs +++ b/src/libs/Together/Generated/Together.Billing.JsonSerializerContext.g.cs @@ -2,37 +2,7 @@ #nullable enable namespace Together -{ - /// - /// - /// - [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( - DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull - )] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ErrorData))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ErrorDataError))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.BillingUsageReport))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.BillingUsageWindow))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.BillingUsageLineItem))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GetBillingUsageGranularity), TypeInfoPropertyName = "GetBillingUsageGranularity2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GetBillingUsageGranularity?), TypeInfoPropertyName = "NullableGetBillingUsageGranularity2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - internal sealed partial class BillingSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext - { - } - /// +{ /// /// /// public sealed partial class BillingSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext @@ -76,26 +46,7 @@ private BillingSourceGenerationContext(global::System.Text.Json.JsonSerializerOp [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) { - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter, global::System.Collections.Generic.IList>()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter>()); - options.Converters.Add(new global::Together.JsonConverters.UnixTimestampJsonConverter()); - options.Converters.Add(new LazyEnumJsonConverterFactory()); + global::Together.SourceGenerationContext.AddConverters(options); } private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() @@ -110,34 +61,6 @@ public static void AddConverters(global::System.Text.Json.JsonSerializerOptions return options; } - - private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Serialization.JsonConverterFactory - { - public override bool CanConvert(global::System.Type typeToConvert) - { - return - typeToConvert == typeof(global::Together.GetBillingUsageGranularity) - - || typeToConvert == typeof(global::Together.GetBillingUsageGranularity?); - } - - public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - if (typeToConvert == typeof(global::Together.GetBillingUsageGranularity)) - { - return new global::Together.JsonConverters.GetBillingUsageGranularityJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.GetBillingUsageGranularity?)) - { - return new global::Together.JsonConverters.GetBillingUsageGranularityNullableJsonConverter(); - } - throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); - } - } - private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver { private readonly object _gate = new(); @@ -177,7 +100,7 @@ private sealed class LazyChunkResolver : global::System.Text.Json.Serialization. { return index switch { - 0 => new BillingSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), + 0 => global::Together.SourceGenerationContext.TypeInfoResolver, _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), }; } diff --git a/src/libs/Together/Generated/Together.BillingClient.GetBillingUsage.g.cs b/src/libs/Together/Generated/Together.BillingClient.GetBillingUsage.g.cs index 645aed9d..59e69c90 100644 --- a/src/libs/Together/Generated/Together.BillingClient.GetBillingUsage.g.cs +++ b/src/libs/Together/Generated/Together.BillingClient.GetBillingUsage.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class BillingClient { + private static readonly global::Together.AutoSDKServer[] s_GetBillingUsageServers = 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_GetBillingUsageSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -73,6 +86,18 @@ partial void ProcessGetBillingUsageResponseContent( /// 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()
+ /// # The SDK has no dedicated method for this endpoint yet, so call it with
+ /// # the client's generic GET helper.
+ /// usage = client.get(
+ /// "/billing/usage",
+ /// cast_to=object,
+ /// options={"params": {"month": "2026-06", "granularity": "day"}},
+ /// )
+ /// print(usage) + ///
public async global::System.Threading.Tasks.Task GetBillingUsageAsync( string? month = default, string? organizationId = default, @@ -118,6 +143,18 @@ partial void ProcessGetBillingUsageResponseContent( /// 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()
+ /// # The SDK has no dedicated method for this endpoint yet, so call it with
+ /// # the client's generic GET helper.
+ /// usage = client.get(
+ /// "/billing/usage",
+ /// cast_to=object,
+ /// options={"params": {"month": "2026-06", "granularity": "day"}},
+ /// )
+ /// print(usage) + ///
public async global::System.Threading.Tasks.Task> GetBillingUsageAsResponseAsync( string? month = default, string? organizationId = default, @@ -161,8 +198,10 @@ partial void ProcessGetBillingUsageResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: "/v1/billing/usage", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: "/billing/usage", + baseUri: ResolveBaseUri( + servers: s_GetBillingUsageServers, + defaultBaseUrl: "https://api.together.ai/v1")); __pathBuilder .AddOptionalParameter("month", month) .AddOptionalParameter("organization_id", organizationId) @@ -233,7 +272,7 @@ partial void ProcessGetBillingUsageResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetBillingUsage", methodName: "GetBillingUsageAsync", - pathTemplate: "\"/v1/billing/usage\"", + pathTemplate: "\"/billing/usage\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -267,7 +306,7 @@ partial void ProcessGetBillingUsageResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetBillingUsage", methodName: "GetBillingUsageAsync", - pathTemplate: "\"/v1/billing/usage\"", + pathTemplate: "\"/billing/usage\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -308,7 +347,7 @@ partial void ProcessGetBillingUsageResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetBillingUsage", methodName: "GetBillingUsageAsync", - pathTemplate: "\"/v1/billing/usage\"", + pathTemplate: "\"/billing/usage\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -356,7 +395,7 @@ partial void ProcessGetBillingUsageResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetBillingUsage", methodName: "GetBillingUsageAsync", - pathTemplate: "\"/v1/billing/usage\"", + pathTemplate: "\"/billing/usage\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -378,7 +417,7 @@ partial void ProcessGetBillingUsageResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetBillingUsage", methodName: "GetBillingUsageAsync", - pathTemplate: "\"/v1/billing/usage\"", + pathTemplate: "\"/billing/usage\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.BillingClient.g.cs b/src/libs/Together/Generated/Together.BillingClient.g.cs index 14bf7a37..b65ca4e7 100644 --- a/src/libs/Together/Generated/Together.BillingClient.g.cs +++ b/src/libs/Together/Generated/Together.BillingClient.g.cs @@ -12,7 +12,7 @@ public sealed partial class BillingClient : global::Together.IBillingClient, glo /// /// Default environment for APIs /// - public const string DefaultBaseUrl = "https://api.together.ai/"; + public const string DefaultBaseUrl = "https://api.together.ai/v1"; private bool _disposeHttpClient = true; @@ -20,7 +20,7 @@ public sealed partial class BillingClient : global::Together.IBillingClient, 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; } @@ -53,6 +53,34 @@ public sealed partial class BillingClient : global::Together.IBillingClient, glo } + + 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 BillingClient. /// If no httpClient is provided, a new one will be created. @@ -151,5 +179,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.Chat.JsonSerializerContext.g.cs b/src/libs/Together/Generated/Together.Chat.JsonSerializerContext.g.cs index 2bc0c577..96240c78 100644 --- a/src/libs/Together/Generated/Together.Chat.JsonSerializerContext.g.cs +++ b/src/libs/Together/Generated/Together.Chat.JsonSerializerContext.g.cs @@ -2,152 +2,7 @@ #nullable enable namespace Together -{ - /// - /// - /// - [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( - DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull - )] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList>), TypeInfoPropertyName = "ChatCompletionUserMessageContentMultimodalItemInputAudio_9a6c1a339fc4e5a1")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf), TypeInfoPropertyName = "ChatCompletionUserMessageContentMultimodalItemInputAudio_e050a39467d446fd")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf?), TypeInfoPropertyName = "ChatCompletionUserMessageContentMultimodalItemInputAudio_f38c2c0c365e74fc")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List>), TypeInfoPropertyName = "ChatCompletionUserMessageContentMultimodalItemInputAudio_6724b54fa98b04fd")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(double))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(object))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.UsageData))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ErrorData))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ErrorDataError))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FinishReason), TypeInfoPropertyName = "FinishReason2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.LogprobsPart))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.PromptPartItem))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.InferenceWarning))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.StreamSentinel))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AllOf), TypeInfoPropertyName = "AllOfUsageDataObject2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ToolChoice2))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionChoicesDataItem))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionMessage))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AllOf), TypeInfoPropertyName = "AllOfObjectLogprobsPart2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionMessageRole), TypeInfoPropertyName = "ChatCompletionMessageRole2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionMessageParam), TypeInfoPropertyName = "ChatCompletionMessageParam2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionRequestContextLengthExceededBehavior), TypeInfoPropertyName = "ChatCompletionRequestContextLengthExceededBehavior2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf), TypeInfoPropertyName = "OneOfChatCompletionRequestFunctionCallEnumChatCompletionRequestFunctionCallEnum22")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionRequestFunctionCallEnum), TypeInfoPropertyName = "ChatCompletionRequestFunctionCallEnum2_3")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionRequestFunctionCallEnum2))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ResponseFormat), TypeInfoPropertyName = "ResponseFormat2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ResponseFormatText))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ResponseFormatJsonSchema))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ResponseFormatJsonObject))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionRequestResponseFormatDiscriminator))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionRequestResponseFormatDiscriminatorType), TypeInfoPropertyName = "ChatCompletionRequestResponseFormatDiscriminatorType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ToolsPart))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf), TypeInfoPropertyName = "OneOfStringToolChoice22")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionRequestReasoningEffort), TypeInfoPropertyName = "ChatCompletionRequestReasoningEffort2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionRequestReasoning))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ResponseFormatTextType), TypeInfoPropertyName = "ResponseFormatTextType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ResponseFormatJsonObjectType), TypeInfoPropertyName = "ResponseFormatJsonObjectType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ResponseFormatJsonSchemaType), TypeInfoPropertyName = "ResponseFormatJsonSchemaType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ResponseFormatJsonSchemaJsonSchema))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ResponseFormatJsonSchemaSchema))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionSystemMessageParam))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionUserMessageParam))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionAssistantMessageParam))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionToolMessageParam))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionSystemMessageParamRole), TypeInfoPropertyName = "ChatCompletionSystemMessageParamRole2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionUserMessageContent), TypeInfoPropertyName = "ChatCompletionUserMessageContent2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionUserMessageParamRole), TypeInfoPropertyName = "ChatCompletionUserMessageParamRole2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemVariant1))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemVariant1Type), TypeInfoPropertyName = "ChatCompletionUserMessageContentMultimodalItemVariant1Type2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemVariant2))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemVariant2Type), TypeInfoPropertyName = "ChatCompletionUserMessageContentMultimodalItemVariant2Type2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemVariant2ImageUrl))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemVideo))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemVideoType), TypeInfoPropertyName = "ChatCompletionUserMessageContentMultimodalItemVideoType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemVideoVideoUrl))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemAudio))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemAudioType), TypeInfoPropertyName = "ChatCompletionUserMessageContentMultimodalItemAudioType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemAudioAudioUrl))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemInputAudio))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemInputAudioType), TypeInfoPropertyName = "ChatCompletionUserMessageContentMultimodalItemInputAudioType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemInputAudioInputAudio))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemInputAudioInputAudioFormat), TypeInfoPropertyName = "ChatCompletionUserMessageContentMultimodalItemInputAudioInputAudioFormat2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionAssistantMessageParamRole), TypeInfoPropertyName = "ChatCompletionAssistantMessageParamRole2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionToolMessageParamRole), TypeInfoPropertyName = "ChatCompletionToolMessageParamRole2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionStream), TypeInfoPropertyName = "ChatCompletionStream2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionEvent))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionChunk))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionChunkChoice))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionChunkChoiceDelta))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionChunkChoiceDeltaRole), TypeInfoPropertyName = "ChatCompletionChunkChoiceDeltaRole2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.StreamSentinelData), TypeInfoPropertyName = "StreamSentinelData2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ToolsPartFunction))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ToolChoiceType), TypeInfoPropertyName = "ToolChoiceType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ToolChoiceFunction))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(double?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FinishReason?), TypeInfoPropertyName = "NullableFinishReason2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AllOf?), TypeInfoPropertyName = "NullableAllOfUsageDataObject2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AllOf?), TypeInfoPropertyName = "NullableAllOfObjectLogprobsPart2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionMessageRole?), TypeInfoPropertyName = "NullableChatCompletionMessageRole2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionMessageParam?), TypeInfoPropertyName = "NullableChatCompletionMessageParam2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionRequestContextLengthExceededBehavior?), TypeInfoPropertyName = "NullableChatCompletionRequestContextLengthExceededBehavior2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf?), TypeInfoPropertyName = "NullableOneOfChatCompletionRequestFunctionCallEnumChatCompletionRequestFunctionCallEnum22")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionRequestFunctionCallEnum?), TypeInfoPropertyName = "NullableChatCompletionRequestFunctionCallEnum2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ResponseFormat?), TypeInfoPropertyName = "NullableResponseFormat2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionRequestResponseFormatDiscriminatorType?), TypeInfoPropertyName = "NullableChatCompletionRequestResponseFormatDiscriminatorType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf?), TypeInfoPropertyName = "NullableOneOfStringToolChoice22")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionRequestReasoningEffort?), TypeInfoPropertyName = "NullableChatCompletionRequestReasoningEffort2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ResponseFormatTextType?), TypeInfoPropertyName = "NullableResponseFormatTextType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ResponseFormatJsonObjectType?), TypeInfoPropertyName = "NullableResponseFormatJsonObjectType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ResponseFormatJsonSchemaType?), TypeInfoPropertyName = "NullableResponseFormatJsonSchemaType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionSystemMessageParamRole?), TypeInfoPropertyName = "NullableChatCompletionSystemMessageParamRole2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionUserMessageContent?), TypeInfoPropertyName = "NullableChatCompletionUserMessageContent2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionUserMessageParamRole?), TypeInfoPropertyName = "NullableChatCompletionUserMessageParamRole2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemVariant1Type?), TypeInfoPropertyName = "NullableChatCompletionUserMessageContentMultimodalItemVariant1Type2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemVariant2Type?), TypeInfoPropertyName = "NullableChatCompletionUserMessageContentMultimodalItemVariant2Type2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemVideoType?), TypeInfoPropertyName = "NullableChatCompletionUserMessageContentMultimodalItemVideoType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemAudioType?), TypeInfoPropertyName = "NullableChatCompletionUserMessageContentMultimodalItemAudioType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemInputAudioType?), TypeInfoPropertyName = "NullableChatCompletionUserMessageContentMultimodalItemInputAudioType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemInputAudioInputAudioFormat?), TypeInfoPropertyName = "NullableChatCompletionUserMessageContentMultimodalItemInputAudioInputAudioFormat2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionAssistantMessageParamRole?), TypeInfoPropertyName = "NullableChatCompletionAssistantMessageParamRole2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionToolMessageParamRole?), TypeInfoPropertyName = "NullableChatCompletionToolMessageParamRole2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionStream?), TypeInfoPropertyName = "NullableChatCompletionStream2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionChunkChoiceDeltaRole?), TypeInfoPropertyName = "NullableChatCompletionChunkChoiceDeltaRole2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.StreamSentinelData?), TypeInfoPropertyName = "NullableStreamSentinelData2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ToolChoiceType?), TypeInfoPropertyName = "NullableToolChoiceType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - internal sealed partial class ChatSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext - { - } - /// +{ /// /// /// public sealed partial class ChatSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext @@ -191,37 +46,7 @@ private ChatSourceGenerationContext(global::System.Text.Json.JsonSerializerOptio [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) { - options.Converters.Add(new global::Together.JsonConverters.ResponseFormatJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.ChatCompletionMessageParamJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.ChatCompletionUserMessageContentJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.ChatCompletionStreamJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter, global::System.Collections.Generic.IList>()); - options.Converters.Add(new global::Together.JsonConverters.AllOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.AllOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.AllOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.AllOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter>()); - options.Converters.Add(new global::Together.JsonConverters.UnixTimestampJsonConverter()); - options.Converters.Add(new LazyEnumJsonConverterFactory()); + global::Together.SourceGenerationContext.AddConverters(options); } private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() @@ -236,328 +61,6 @@ public static void AddConverters(global::System.Text.Json.JsonSerializerOptions return options; } - - private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Serialization.JsonConverterFactory - { - public override bool CanConvert(global::System.Type typeToConvert) - { - return - typeToConvert == typeof(global::Together.FinishReason) - - || typeToConvert == typeof(global::Together.FinishReason?) - - || typeToConvert == typeof(global::Together.ChatCompletionMessageRole) - - || typeToConvert == typeof(global::Together.ChatCompletionMessageRole?) - - || typeToConvert == typeof(global::Together.ChatCompletionRequestContextLengthExceededBehavior) - - || typeToConvert == typeof(global::Together.ChatCompletionRequestContextLengthExceededBehavior?) - - || typeToConvert == typeof(global::Together.ChatCompletionRequestFunctionCallEnum) - - || typeToConvert == typeof(global::Together.ChatCompletionRequestFunctionCallEnum?) - - || typeToConvert == typeof(global::Together.ChatCompletionRequestResponseFormatDiscriminatorType) - - || typeToConvert == typeof(global::Together.ChatCompletionRequestResponseFormatDiscriminatorType?) - - || typeToConvert == typeof(global::Together.ChatCompletionRequestReasoningEffort) - - || typeToConvert == typeof(global::Together.ChatCompletionRequestReasoningEffort?) - - || typeToConvert == typeof(global::Together.ResponseFormatTextType) - - || typeToConvert == typeof(global::Together.ResponseFormatTextType?) - - || typeToConvert == typeof(global::Together.ResponseFormatJsonObjectType) - - || typeToConvert == typeof(global::Together.ResponseFormatJsonObjectType?) - - || typeToConvert == typeof(global::Together.ResponseFormatJsonSchemaType) - - || typeToConvert == typeof(global::Together.ResponseFormatJsonSchemaType?) - - || typeToConvert == typeof(global::Together.ChatCompletionSystemMessageParamRole) - - || typeToConvert == typeof(global::Together.ChatCompletionSystemMessageParamRole?) - - || typeToConvert == typeof(global::Together.ChatCompletionUserMessageParamRole) - - || typeToConvert == typeof(global::Together.ChatCompletionUserMessageParamRole?) - - || typeToConvert == typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemVariant1Type) - - || typeToConvert == typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemVariant1Type?) - - || typeToConvert == typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemVariant2Type) - - || typeToConvert == typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemVariant2Type?) - - || typeToConvert == typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemVideoType) - - || typeToConvert == typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemVideoType?) - - || typeToConvert == typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemAudioType) - - || typeToConvert == typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemAudioType?) - - || typeToConvert == typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemInputAudioType) - - || typeToConvert == typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemInputAudioType?) - - || typeToConvert == typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemInputAudioInputAudioFormat) - - || typeToConvert == typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemInputAudioInputAudioFormat?) - - || typeToConvert == typeof(global::Together.ChatCompletionAssistantMessageParamRole) - - || typeToConvert == typeof(global::Together.ChatCompletionAssistantMessageParamRole?) - - || typeToConvert == typeof(global::Together.ChatCompletionToolMessageParamRole) - - || typeToConvert == typeof(global::Together.ChatCompletionToolMessageParamRole?) - - || typeToConvert == typeof(global::Together.ChatCompletionChunkChoiceDeltaRole) - - || typeToConvert == typeof(global::Together.ChatCompletionChunkChoiceDeltaRole?) - - || typeToConvert == typeof(global::Together.StreamSentinelData) - - || typeToConvert == typeof(global::Together.StreamSentinelData?) - - || typeToConvert == typeof(global::Together.ToolChoiceType) - - || typeToConvert == typeof(global::Together.ToolChoiceType?); - } - - public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - if (typeToConvert == typeof(global::Together.FinishReason)) - { - return new global::Together.JsonConverters.FinishReasonJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.FinishReason?)) - { - return new global::Together.JsonConverters.FinishReasonNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.ChatCompletionMessageRole)) - { - return new global::Together.JsonConverters.ChatCompletionMessageRoleJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.ChatCompletionMessageRole?)) - { - return new global::Together.JsonConverters.ChatCompletionMessageRoleNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.ChatCompletionRequestContextLengthExceededBehavior)) - { - return new global::Together.JsonConverters.ChatCompletionRequestContextLengthExceededBehaviorJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.ChatCompletionRequestContextLengthExceededBehavior?)) - { - return new global::Together.JsonConverters.ChatCompletionRequestContextLengthExceededBehaviorNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.ChatCompletionRequestFunctionCallEnum)) - { - return new global::Together.JsonConverters.ChatCompletionRequestFunctionCallEnumJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.ChatCompletionRequestFunctionCallEnum?)) - { - return new global::Together.JsonConverters.ChatCompletionRequestFunctionCallEnumNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.ChatCompletionRequestResponseFormatDiscriminatorType)) - { - return new global::Together.JsonConverters.ChatCompletionRequestResponseFormatDiscriminatorTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.ChatCompletionRequestResponseFormatDiscriminatorType?)) - { - return new global::Together.JsonConverters.ChatCompletionRequestResponseFormatDiscriminatorTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.ChatCompletionRequestReasoningEffort)) - { - return new global::Together.JsonConverters.ChatCompletionRequestReasoningEffortJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.ChatCompletionRequestReasoningEffort?)) - { - return new global::Together.JsonConverters.ChatCompletionRequestReasoningEffortNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.ResponseFormatTextType)) - { - return new global::Together.JsonConverters.ResponseFormatTextTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.ResponseFormatTextType?)) - { - return new global::Together.JsonConverters.ResponseFormatTextTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.ResponseFormatJsonObjectType)) - { - return new global::Together.JsonConverters.ResponseFormatJsonObjectTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.ResponseFormatJsonObjectType?)) - { - return new global::Together.JsonConverters.ResponseFormatJsonObjectTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.ResponseFormatJsonSchemaType)) - { - return new global::Together.JsonConverters.ResponseFormatJsonSchemaTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.ResponseFormatJsonSchemaType?)) - { - return new global::Together.JsonConverters.ResponseFormatJsonSchemaTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.ChatCompletionSystemMessageParamRole)) - { - return new global::Together.JsonConverters.ChatCompletionSystemMessageParamRoleJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.ChatCompletionSystemMessageParamRole?)) - { - return new global::Together.JsonConverters.ChatCompletionSystemMessageParamRoleNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.ChatCompletionUserMessageParamRole)) - { - return new global::Together.JsonConverters.ChatCompletionUserMessageParamRoleJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.ChatCompletionUserMessageParamRole?)) - { - return new global::Together.JsonConverters.ChatCompletionUserMessageParamRoleNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemVariant1Type)) - { - return new global::Together.JsonConverters.ChatCompletionUserMessageContentMultimodalItemVariant1TypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemVariant1Type?)) - { - return new global::Together.JsonConverters.ChatCompletionUserMessageContentMultimodalItemVariant1TypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemVariant2Type)) - { - return new global::Together.JsonConverters.ChatCompletionUserMessageContentMultimodalItemVariant2TypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemVariant2Type?)) - { - return new global::Together.JsonConverters.ChatCompletionUserMessageContentMultimodalItemVariant2TypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemVideoType)) - { - return new global::Together.JsonConverters.ChatCompletionUserMessageContentMultimodalItemVideoTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemVideoType?)) - { - return new global::Together.JsonConverters.ChatCompletionUserMessageContentMultimodalItemVideoTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemAudioType)) - { - return new global::Together.JsonConverters.ChatCompletionUserMessageContentMultimodalItemAudioTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemAudioType?)) - { - return new global::Together.JsonConverters.ChatCompletionUserMessageContentMultimodalItemAudioTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemInputAudioType)) - { - return new global::Together.JsonConverters.ChatCompletionUserMessageContentMultimodalItemInputAudioTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemInputAudioType?)) - { - return new global::Together.JsonConverters.ChatCompletionUserMessageContentMultimodalItemInputAudioTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemInputAudioInputAudioFormat)) - { - return new global::Together.JsonConverters.ChatCompletionUserMessageContentMultimodalItemInputAudioInputAudioFormatJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemInputAudioInputAudioFormat?)) - { - return new global::Together.JsonConverters.ChatCompletionUserMessageContentMultimodalItemInputAudioInputAudioFormatNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.ChatCompletionAssistantMessageParamRole)) - { - return new global::Together.JsonConverters.ChatCompletionAssistantMessageParamRoleJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.ChatCompletionAssistantMessageParamRole?)) - { - return new global::Together.JsonConverters.ChatCompletionAssistantMessageParamRoleNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.ChatCompletionToolMessageParamRole)) - { - return new global::Together.JsonConverters.ChatCompletionToolMessageParamRoleJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.ChatCompletionToolMessageParamRole?)) - { - return new global::Together.JsonConverters.ChatCompletionToolMessageParamRoleNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.ChatCompletionChunkChoiceDeltaRole)) - { - return new global::Together.JsonConverters.ChatCompletionChunkChoiceDeltaRoleJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.ChatCompletionChunkChoiceDeltaRole?)) - { - return new global::Together.JsonConverters.ChatCompletionChunkChoiceDeltaRoleNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.StreamSentinelData)) - { - return new global::Together.JsonConverters.StreamSentinelDataJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.StreamSentinelData?)) - { - return new global::Together.JsonConverters.StreamSentinelDataNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.ToolChoiceType)) - { - return new global::Together.JsonConverters.ToolChoiceTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.ToolChoiceType?)) - { - return new global::Together.JsonConverters.ToolChoiceTypeNullableJsonConverter(); - } - throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); - } - } - private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver { private readonly object _gate = new(); @@ -597,7 +100,7 @@ private sealed class LazyChunkResolver : global::System.Text.Json.Serialization. { return index switch { - 0 => new ChatSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), + 0 => global::Together.SourceGenerationContext.TypeInfoResolver, _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), }; } diff --git a/src/libs/Together/Generated/Together.ChatClient.ChatCompletions.g.cs b/src/libs/Together/Generated/Together.ChatClient.ChatCompletions.g.cs index dcb3d91d..eb3504d1 100644 --- a/src/libs/Together/Generated/Together.ChatClient.ChatCompletions.g.cs +++ b/src/libs/Together/Generated/Together.ChatClient.ChatCompletions.g.cs @@ -1,6 +1,8 @@ #nullable enable +#pragma warning disable CS0618 // Type or member is obsolete + namespace Together { public partial class ChatClient @@ -8,10 +10,15 @@ public partial class ChatClient private static readonly global::Together.AutoSDKServer[] s_ChatCompletionsServers = new global::Together.AutoSDKServer[] { new global::Together.AutoSDKServer( - id: "https-api-inference-together-ai", - name: "api-inference.together.ai", - url: "https://api-inference.together.ai/", - description: ""), + 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"), }; @@ -57,6 +64,22 @@ partial void ProcessChatCompletionsResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.chat.completions.create(
+ /// model="Qwen/Qwen3.5-9B",
+ /// messages=[
+ /// {"role": "system", "content": "You are a helpful assistant."},
+ /// {"role": "user", "content": "What are some fun things to do in New York?"},
+ /// ],
+ /// reasoning={"enabled": False},
+ /// )
+ /// print(response.choices[0].message.content) + ///
public async global::System.Threading.Tasks.Task ChatCompletionsAsync( global::Together.ChatCompletionRequest request, @@ -80,6 +103,22 @@ partial void ProcessChatCompletionsResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.chat.completions.create(
+ /// model="Qwen/Qwen3.5-9B",
+ /// messages=[
+ /// {"role": "system", "content": "You are a helpful assistant."},
+ /// {"role": "user", "content": "What are some fun things to do in New York?"},
+ /// ],
+ /// reasoning={"enabled": False},
+ /// )
+ /// print(response.choices[0].message.content) + ///
public async global::System.Threading.Tasks.Task> ChatCompletionsAsResponseAsync( global::Together.ChatCompletionRequest request, @@ -148,10 +187,10 @@ partial void ProcessChatCompletionsResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: "/v1/chat/completions", + path: "/chat/completions", baseUri: ResolveBaseUri( servers: s_ChatCompletionsServers, - defaultBaseUrl: "https://api-inference.together.ai/")); + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -221,7 +260,7 @@ partial void ProcessChatCompletionsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ChatCompletions", methodName: "ChatCompletionsAsync", - pathTemplate: "\"/v1/chat/completions\"", + pathTemplate: "\"/chat/completions\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -255,7 +294,7 @@ partial void ProcessChatCompletionsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ChatCompletions", methodName: "ChatCompletionsAsync", - pathTemplate: "\"/v1/chat/completions\"", + pathTemplate: "\"/chat/completions\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -296,7 +335,7 @@ partial void ProcessChatCompletionsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ChatCompletions", methodName: "ChatCompletionsAsync", - pathTemplate: "\"/v1/chat/completions\"", + pathTemplate: "\"/chat/completions\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -344,7 +383,7 @@ partial void ProcessChatCompletionsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ChatCompletions", methodName: "ChatCompletionsAsync", - pathTemplate: "\"/v1/chat/completions\"", + pathTemplate: "\"/chat/completions\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -366,7 +405,7 @@ partial void ProcessChatCompletionsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ChatCompletions", methodName: "ChatCompletionsAsync", - pathTemplate: "\"/v1/chat/completions\"", + pathTemplate: "\"/chat/completions\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.ChatClient.ChatCompletionsAsStream.g.cs b/src/libs/Together/Generated/Together.ChatClient.ChatCompletionsAsStream.g.cs index e09f1a34..6d162569 100644 --- a/src/libs/Together/Generated/Together.ChatClient.ChatCompletionsAsStream.g.cs +++ b/src/libs/Together/Generated/Together.ChatClient.ChatCompletionsAsStream.g.cs @@ -1,6 +1,8 @@ #nullable enable +#pragma warning disable CS0618 // Type or member is obsolete + namespace Together { public partial class ChatClient @@ -8,10 +10,15 @@ public partial class ChatClient private static readonly global::Together.AutoSDKServer[] s_ChatCompletionsAsStreamServers = new global::Together.AutoSDKServer[] { new global::Together.AutoSDKServer( - id: "https-api-inference-together-ai", - name: "api-inference.together.ai", - url: "https://api-inference.together.ai/", - description: ""), + 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"), }; @@ -52,6 +59,22 @@ partial void ProcessChatCompletionsAsStreamResponse( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.chat.completions.create(
+ /// model="Qwen/Qwen3.5-9B",
+ /// messages=[
+ /// {"role": "system", "content": "You are a helpful assistant."},
+ /// {"role": "user", "content": "What are some fun things to do in New York?"},
+ /// ],
+ /// reasoning={"enabled": False},
+ /// )
+ /// print(response.choices[0].message.content) + ///
public async global::System.Collections.Generic.IAsyncEnumerable ChatCompletionsAsStreamAsync( global::Together.ChatCompletionRequest request, @@ -120,10 +143,10 @@ partial void ProcessChatCompletionsAsStreamResponse( { var __pathBuilder = new global::Together.PathBuilder( - path: "/v1/chat/completions", + path: "/chat/completions", baseUri: ResolveBaseUri( servers: s_ChatCompletionsAsStreamServers, - defaultBaseUrl: "https://api-inference.together.ai/")); + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -193,7 +216,7 @@ partial void ProcessChatCompletionsAsStreamResponse( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ChatCompletionsAsStream", methodName: "ChatCompletionsAsStreamAsync", - pathTemplate: "\"/v1/chat/completions\"", + pathTemplate: "\"/chat/completions\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -227,7 +250,7 @@ partial void ProcessChatCompletionsAsStreamResponse( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ChatCompletionsAsStream", methodName: "ChatCompletionsAsStreamAsync", - pathTemplate: "\"/v1/chat/completions\"", + pathTemplate: "\"/chat/completions\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -268,7 +291,7 @@ partial void ProcessChatCompletionsAsStreamResponse( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ChatCompletionsAsStream", methodName: "ChatCompletionsAsStreamAsync", - pathTemplate: "\"/v1/chat/completions\"", + pathTemplate: "\"/chat/completions\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -316,7 +339,7 @@ partial void ProcessChatCompletionsAsStreamResponse( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ChatCompletionsAsStream", methodName: "ChatCompletionsAsStreamAsync", - pathTemplate: "\"/v1/chat/completions\"", + pathTemplate: "\"/chat/completions\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -338,7 +361,7 @@ partial void ProcessChatCompletionsAsStreamResponse( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ChatCompletionsAsStream", methodName: "ChatCompletionsAsStreamAsync", - pathTemplate: "\"/v1/chat/completions\"", + pathTemplate: "\"/chat/completions\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.ChatClient.g.cs b/src/libs/Together/Generated/Together.ChatClient.g.cs index 433727c0..973fe9a7 100644 --- a/src/libs/Together/Generated/Together.ChatClient.g.cs +++ b/src/libs/Together/Generated/Together.ChatClient.g.cs @@ -10,9 +10,9 @@ namespace Together public sealed partial class ChatClient : global::Together.IChatClient, global::System.IDisposable { /// - /// + /// Default environment for APIs /// - public const string DefaultBaseUrl = "https://api-inference.together.ai/"; + public const string DefaultBaseUrl = "https://api.together.ai/v1"; private bool _disposeHttpClient = true; @@ -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; } @@ -53,6 +53,34 @@ public sealed partial class ChatClient : global::Together.IChatClient, global::S } + + 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. @@ -153,6 +181,87 @@ partial void ProcessResponseContent( 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) diff --git a/src/libs/Together/Generated/Together.CodeInterpreter.JsonSerializerContext.g.cs b/src/libs/Together/Generated/Together.CodeInterpreter.JsonSerializerContext.g.cs new file mode 100644 index 00000000..e7564557 --- /dev/null +++ b/src/libs/Together/Generated/Together.CodeInterpreter.JsonSerializerContext.g.cs @@ -0,0 +1,109 @@ + +#nullable enable + +namespace Together +{ /// + /// + /// + public sealed partial class CodeInterpreterSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext + { + private static readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver Resolver = new LazyChunkResolver(); + + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + internal static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver TypeInfoResolver => Resolver; + + + private static readonly global::System.Text.Json.JsonSerializerOptions DefaultOptions = CreateDefaultOptions(); + + /// + /// + /// + public static CodeInterpreterSourceGenerationContext Default { get; } = new(DefaultOptions); + + private CodeInterpreterSourceGenerationContext(global::System.Text.Json.JsonSerializerOptions options) + : base(options) + { + } + + /// + protected override global::System.Text.Json.JsonSerializerOptions? GeneratedSerializerOptions => DefaultOptions; + + /// + public override global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo(global::System.Type type) + { + return Resolver.GetTypeInfo(type, Options); + } + + /// + /// Adds this package's converters to . + /// + /// + /// A converter has to be on the options a chained resolver builds its JsonTypeInfo against, + /// and a context resolves types from every package below it. Each package contributes only + /// what it owns and calls down the chain for the rest, so the family's converter table is + /// written once rather than copied into all of them. + /// + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) + { + global::Together.SourceGenerationContext.AddConverters(options); + } + + private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() + { + var options = new global::System.Text.Json.JsonSerializerOptions + { + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + TypeInfoResolver = Resolver, + }; + AddConverters(options); + + return options; + } + + private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver + { + private readonly object _gate = new(); + private readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[] _resolvers = new global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[1]; + + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo( + global::System.Type type, + global::System.Text.Json.JsonSerializerOptions options) + { + for (var index = 0; index < _resolvers.Length; index++) + { + var typeInfo = GetResolver(index).GetTypeInfo(type, options); + if (typeInfo is not null) + { + return typeInfo; + } + } + + return null; + } + + private global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver GetResolver(int index) + { + var resolver = global::System.Threading.Volatile.Read(ref _resolvers[index]); + if (resolver is not null) + { + return resolver; + } + + lock (_gate) + { + return _resolvers[index] ??= CreateResolver(index); + } + } + + private static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver CreateResolver(int index) + { + return index switch + { + 0 => global::Together.SourceGenerationContext.TypeInfoResolver, + _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), + }; + } + } + } +} \ 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 new file mode 100644 index 00000000..44045972 --- /dev/null +++ b/src/libs/Together/Generated/Together.CodeInterpreterClient.SessionsList.g.cs @@ -0,0 +1,452 @@ + +#nullable enable + +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 + { + 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_SessionsListSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_SessionsListSecurityRequirement0, + }; + partial void PrepareSessionsListArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareSessionsListRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessSessionsListResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessSessionsListResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// List active sessions
+ /// Lists all your currently active sessions. + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.code_interpreter.sessions.list()
+ /// for session in response.data.sessions:
+ /// print(session.id) + ///
+ public async global::System.Threading.Tasks.Task SessionsListAsync( + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await SessionsListAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List active sessions
+ /// Lists all your currently active sessions. + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.code_interpreter.sessions.list()
+ /// for session in response.data.sessions:
+ /// print(session.id) + ///
+ public async global::System.Threading.Tasks.Task> SessionsListAsResponseAsync( + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareSessionsListArguments( + httpClient: HttpClient); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_SessionsListSecurityRequirements, + operationName: "SessionsListAsync"); + + 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: "/tci/sessions", + baseUri: ResolveBaseUri( + servers: s_SessionsListServers, + 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); + PrepareSessionsListRequest( + 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: "SessionsList", + methodName: "SessionsListAsync", + pathTemplate: "\"/tci/sessions\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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: "SessionsList", + methodName: "SessionsListAsync", + pathTemplate: "\"/tci/sessions\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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: "SessionsList", + methodName: "SessionsListAsync", + pathTemplate: "\"/tci/sessions\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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); + ProcessSessionsListResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "SessionsList", + methodName: "SessionsListAsync", + pathTemplate: "\"/tci/sessions\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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: "SessionsList", + methodName: "SessionsListAsync", + pathTemplate: "\"/tci/sessions\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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); + } + + 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); + ProcessSessionsListResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.SessionListResponse.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.SessionListResponse.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.CodeInterpreterClient.TciExecute.g.cs b/src/libs/Together/Generated/Together.CodeInterpreterClient.TciExecute.g.cs new file mode 100644 index 00000000..4f7c1a2f --- /dev/null +++ b/src/libs/Together/Generated/Together.CodeInterpreterClient.TciExecute.g.cs @@ -0,0 +1,522 @@ + +#nullable enable + +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 + { + 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_TciExecuteSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_TciExecuteSecurityRequirement0, + }; + partial void PrepareTciExecuteArguments( + global::System.Net.Http.HttpClient httpClient, + global::Together.ExecuteRequest request); + partial void PrepareTciExecuteRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + global::Together.ExecuteRequest request); + partial void ProcessTciExecuteResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessTciExecuteResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Execute code
+ /// Executes the given code snippet and returns the output. Without a session_id, a new session is created to run the code. If you pass a valid session_id, the code runs in that session. This is useful for running multiple code snippets in the same environment, because dependencies and similar things are persisted
+ /// between calls to the same session. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.code_interpreter.execute(
+ /// code="print('Hello world!')",
+ /// language="python",
+ /// )
+ /// print(response.data.outputs[0].data); + ///
+ public async global::System.Threading.Tasks.Task TciExecuteAsync( + + global::Together.ExecuteRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await TciExecuteAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Execute code
+ /// Executes the given code snippet and returns the output. Without a session_id, a new session is created to run the code. If you pass a valid session_id, the code runs in that session. This is useful for running multiple code snippets in the same environment, because dependencies and similar things are persisted
+ /// between calls to the same session. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.code_interpreter.execute(
+ /// code="print('Hello world!')",
+ /// language="python",
+ /// )
+ /// print(response.data.outputs[0].data); + ///
+ public async global::System.Threading.Tasks.Task> TciExecuteAsResponseAsync( + + global::Together.ExecuteRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareTciExecuteArguments( + httpClient: HttpClient, + request: request); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_TciExecuteSecurityRequirements, + operationName: "TciExecuteAsync"); + + 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: "/tci/execute", + baseUri: ResolveBaseUri( + servers: s_TciExecuteServers, + 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.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); + PrepareTciExecuteRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + 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: "TciExecute", + methodName: "TciExecuteAsync", + pathTemplate: "\"/tci/execute\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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: "TciExecute", + methodName: "TciExecuteAsync", + pathTemplate: "\"/tci/execute\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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: "TciExecute", + methodName: "TciExecuteAsync", + pathTemplate: "\"/tci/execute\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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); + ProcessTciExecuteResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "TciExecute", + methodName: "TciExecuteAsync", + pathTemplate: "\"/tci/execute\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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: "TciExecute", + methodName: "TciExecuteAsync", + pathTemplate: "\"/tci/execute\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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); + } + + 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); + ProcessTciExecuteResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.ExecuteResponse.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.ExecuteResponse.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(); + } + } + /// + /// Execute code
+ /// Executes the given code snippet and returns the output. Without a session_id, a new session is created to run the code. If you pass a valid session_id, the code runs in that session. This is useful for running multiple code snippets in the same environment, because dependencies and similar things are persisted
+ /// between calls to the same session. + ///
+ /// + /// Code snippet to execute.
+ /// Example: print('Hello, world!') + /// + /// + /// Files to upload to the session. If present, files are uploaded before executing the given code. + /// + /// + /// Programming language for the code to execute. Currently only supports Python.
+ /// Default Value: python + /// + /// + /// Identifier of the current session. Used to make follow-up calls. Returns an error if the session does not belong to the caller or has expired.
+ /// Example: ses_abcDEF123 + /// + /// 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 TciExecuteAsync( + string code, + global::System.Collections.Generic.IList? files = default, + global::Together.ExecuteRequestLanguage language = global::Together.ExecuteRequestLanguage.Python, + string? sessionId = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Together.ExecuteRequest + { + Code = code, + Files = files, + Language = language, + SessionId = sessionId, + }; + + return await TciExecuteAsync( + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.CodeInterpreterClient.g.cs b/src/libs/Together/Generated/Together.CodeInterpreterClient.g.cs new file mode 100644 index 00000000..1e1304a6 --- /dev/null +++ b/src/libs/Together/Generated/Together.CodeInterpreterClient.g.cs @@ -0,0 +1,295 @@ + +#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 CodeInterpreterClient : global::Together.ICodeInterpreterClient, 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; } + + + /// + public global::System.Func CreateIdempotencyKey { get; set; } = () => global::System.Guid.NewGuid().ToString("D"); + + + internal global::Together.AutoSDKServerConfiguration AutoSDKServerConfiguration { get; set; } = new global::Together.AutoSDKServerConfiguration(); + + internal global::System.Lazy? JsonSerializerContextProvider { get; set; } + + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext + { + get => JsonSerializerContextProvider?.Value ?? global::Together.CodeInterpreterSourceGenerationContext.Default; + set => JsonSerializerContextProvider = new(() => value); + } + + + + 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. + /// 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 CodeInterpreterClient( + 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 CodeInterpreterClient 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 CodeInterpreterClient( + 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 CodeInterpreterClient. + /// 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 CodeInterpreterClient( + 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.Completion.JsonSerializerContext.g.cs b/src/libs/Together/Generated/Together.Completion.JsonSerializerContext.g.cs index a67f5131..be318c85 100644 --- a/src/libs/Together/Generated/Together.Completion.JsonSerializerContext.g.cs +++ b/src/libs/Together/Generated/Together.Completion.JsonSerializerContext.g.cs @@ -2,80 +2,7 @@ #nullable enable namespace Together -{ - /// - /// - /// - [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( - DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull - )] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(double))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(object))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.UsageData))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ErrorData))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ErrorDataError))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FinishReason), TypeInfoPropertyName = "FinishReason2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.LogprobsPart))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.PromptPartItem))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CompletionChoicesDataItem))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CompletionRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AnyOf), TypeInfoPropertyName = "AnyOfCompletionRequestModelString2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CompletionRequestModel), TypeInfoPropertyName = "CompletionRequestModel2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AnyOf), TypeInfoPropertyName = "AnyOfCompletionRequestSafetyModelString2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CompletionRequestSafetyModel), TypeInfoPropertyName = "CompletionRequestSafetyModel2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CompletionResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CompletionStream), TypeInfoPropertyName = "CompletionStream2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CompletionEvent))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.StreamSentinel))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CompletionChunk))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CompletionToken))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CompletionChoice))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AllOf), TypeInfoPropertyName = "AllOfUsageDataObject2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AllOf), TypeInfoPropertyName = "AllOfFinishReasonObject2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CompletionChoiceDelta))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CompletionChoiceDeltaRole), TypeInfoPropertyName = "CompletionChoiceDeltaRole2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ToolChoice2))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.StreamSentinelData), TypeInfoPropertyName = "StreamSentinelData2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ToolChoiceType), TypeInfoPropertyName = "ToolChoiceType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ToolChoiceFunction))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(double?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FinishReason?), TypeInfoPropertyName = "NullableFinishReason2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AnyOf?), TypeInfoPropertyName = "NullableAnyOfCompletionRequestModelString2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CompletionRequestModel?), TypeInfoPropertyName = "NullableCompletionRequestModel2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AnyOf?), TypeInfoPropertyName = "NullableAnyOfCompletionRequestSafetyModelString2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CompletionRequestSafetyModel?), TypeInfoPropertyName = "NullableCompletionRequestSafetyModel2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CompletionStream?), TypeInfoPropertyName = "NullableCompletionStream2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AllOf?), TypeInfoPropertyName = "NullableAllOfUsageDataObject2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AllOf?), TypeInfoPropertyName = "NullableAllOfFinishReasonObject2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CompletionChoiceDeltaRole?), TypeInfoPropertyName = "NullableCompletionChoiceDeltaRole2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.StreamSentinelData?), TypeInfoPropertyName = "NullableStreamSentinelData2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ToolChoiceType?), TypeInfoPropertyName = "NullableToolChoiceType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - internal sealed partial class CompletionSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext - { - } - /// +{ /// /// /// public sealed partial class CompletionSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext @@ -119,34 +46,7 @@ private CompletionSourceGenerationContext(global::System.Text.Json.JsonSerialize [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) { - options.Converters.Add(new global::Together.JsonConverters.CompletionStreamJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter, global::System.Collections.Generic.IList>()); - options.Converters.Add(new global::Together.JsonConverters.AnyOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.AnyOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.AllOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.AllOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.AllOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.AllOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter>()); - options.Converters.Add(new global::Together.JsonConverters.UnixTimestampJsonConverter()); - options.Converters.Add(new LazyEnumJsonConverterFactory()); + global::Together.SourceGenerationContext.AddConverters(options); } private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() @@ -161,104 +61,6 @@ public static void AddConverters(global::System.Text.Json.JsonSerializerOptions return options; } - - private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Serialization.JsonConverterFactory - { - public override bool CanConvert(global::System.Type typeToConvert) - { - return - typeToConvert == typeof(global::Together.FinishReason) - - || typeToConvert == typeof(global::Together.FinishReason?) - - || typeToConvert == typeof(global::Together.CompletionRequestModel) - - || typeToConvert == typeof(global::Together.CompletionRequestModel?) - - || typeToConvert == typeof(global::Together.CompletionRequestSafetyModel) - - || typeToConvert == typeof(global::Together.CompletionRequestSafetyModel?) - - || typeToConvert == typeof(global::Together.CompletionChoiceDeltaRole) - - || typeToConvert == typeof(global::Together.CompletionChoiceDeltaRole?) - - || typeToConvert == typeof(global::Together.StreamSentinelData) - - || typeToConvert == typeof(global::Together.StreamSentinelData?) - - || typeToConvert == typeof(global::Together.ToolChoiceType) - - || typeToConvert == typeof(global::Together.ToolChoiceType?); - } - - public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - if (typeToConvert == typeof(global::Together.FinishReason)) - { - return new global::Together.JsonConverters.FinishReasonJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.FinishReason?)) - { - return new global::Together.JsonConverters.FinishReasonNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.CompletionRequestModel)) - { - return new global::Together.JsonConverters.CompletionRequestModelJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.CompletionRequestModel?)) - { - return new global::Together.JsonConverters.CompletionRequestModelNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.CompletionRequestSafetyModel)) - { - return new global::Together.JsonConverters.CompletionRequestSafetyModelJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.CompletionRequestSafetyModel?)) - { - return new global::Together.JsonConverters.CompletionRequestSafetyModelNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.CompletionChoiceDeltaRole)) - { - return new global::Together.JsonConverters.CompletionChoiceDeltaRoleJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.CompletionChoiceDeltaRole?)) - { - return new global::Together.JsonConverters.CompletionChoiceDeltaRoleNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.StreamSentinelData)) - { - return new global::Together.JsonConverters.StreamSentinelDataJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.StreamSentinelData?)) - { - return new global::Together.JsonConverters.StreamSentinelDataNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.ToolChoiceType)) - { - return new global::Together.JsonConverters.ToolChoiceTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.ToolChoiceType?)) - { - return new global::Together.JsonConverters.ToolChoiceTypeNullableJsonConverter(); - } - throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); - } - } - private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver { private readonly object _gate = new(); @@ -298,7 +100,7 @@ private sealed class LazyChunkResolver : global::System.Text.Json.Serialization. { return index switch { - 0 => new CompletionSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), + 0 => global::Together.SourceGenerationContext.TypeInfoResolver, _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), }; } diff --git a/src/libs/Together/Generated/Together.CompletionClient.Completions.g.cs b/src/libs/Together/Generated/Together.CompletionClient.Completions.g.cs index aded7d9f..b75c5855 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 @@ -49,6 +62,19 @@ partial void ProcessCompletionsResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.completions.create(
+ /// model="Qwen/Qwen3.5-9B",
+ /// prompt="The largest city in France is",
+ /// max_tokens=1
+ /// )
+ /// print(response.choices[0].text) + ///
public async global::System.Threading.Tasks.Task CompletionsAsync( global::Together.CompletionRequest request, @@ -72,6 +98,19 @@ partial void ProcessCompletionsResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.completions.create(
+ /// model="Qwen/Qwen3.5-9B",
+ /// prompt="The largest city in France is",
+ /// max_tokens=1
+ /// )
+ /// print(response.choices[0].text) + ///
public async global::System.Threading.Tasks.Task> CompletionsAsResponseAsync( global::Together.CompletionRequest request, @@ -131,8 +170,10 @@ partial void ProcessCompletionsResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: "/v1/completions", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: "/completions", + baseUri: ResolveBaseUri( + servers: s_CompletionsServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -202,7 +243,7 @@ partial void ProcessCompletionsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "Completions", methodName: "CompletionsAsync", - pathTemplate: "\"/v1/completions\"", + pathTemplate: "\"/completions\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -236,7 +277,7 @@ partial void ProcessCompletionsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "Completions", methodName: "CompletionsAsync", - pathTemplate: "\"/v1/completions\"", + pathTemplate: "\"/completions\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -277,7 +318,7 @@ partial void ProcessCompletionsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "Completions", methodName: "CompletionsAsync", - pathTemplate: "\"/v1/completions\"", + pathTemplate: "\"/completions\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -325,7 +366,7 @@ partial void ProcessCompletionsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "Completions", methodName: "CompletionsAsync", - pathTemplate: "\"/v1/completions\"", + pathTemplate: "\"/completions\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -347,7 +388,7 @@ partial void ProcessCompletionsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "Completions", methodName: "CompletionsAsync", - pathTemplate: "\"/v1/completions\"", + pathTemplate: "\"/completions\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.CompletionClient.CompletionsAsStream.g.cs b/src/libs/Together/Generated/Together.CompletionClient.CompletionsAsStream.g.cs index 4518b525..6030d796 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 @@ -44,6 +57,19 @@ partial void ProcessCompletionsAsStreamResponse( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.completions.create(
+ /// model="Qwen/Qwen3.5-9B",
+ /// prompt="The largest city in France is",
+ /// max_tokens=1
+ /// )
+ /// print(response.choices[0].text) + ///
public async global::System.Collections.Generic.IAsyncEnumerable CompletionsAsStreamAsync( global::Together.CompletionRequest request, @@ -103,8 +129,10 @@ partial void ProcessCompletionsAsStreamResponse( { var __pathBuilder = new global::Together.PathBuilder( - path: "/v1/completions", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: "/completions", + baseUri: ResolveBaseUri( + servers: s_CompletionsAsStreamServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -174,7 +202,7 @@ partial void ProcessCompletionsAsStreamResponse( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "CompletionsAsStream", methodName: "CompletionsAsStreamAsync", - pathTemplate: "\"/v1/completions\"", + pathTemplate: "\"/completions\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -208,7 +236,7 @@ partial void ProcessCompletionsAsStreamResponse( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "CompletionsAsStream", methodName: "CompletionsAsStreamAsync", - pathTemplate: "\"/v1/completions\"", + pathTemplate: "\"/completions\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -249,7 +277,7 @@ partial void ProcessCompletionsAsStreamResponse( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "CompletionsAsStream", methodName: "CompletionsAsStreamAsync", - pathTemplate: "\"/v1/completions\"", + pathTemplate: "\"/completions\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -297,7 +325,7 @@ partial void ProcessCompletionsAsStreamResponse( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "CompletionsAsStream", methodName: "CompletionsAsStreamAsync", - pathTemplate: "\"/v1/completions\"", + pathTemplate: "\"/completions\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -319,7 +347,7 @@ partial void ProcessCompletionsAsStreamResponse( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "CompletionsAsStream", methodName: "CompletionsAsStreamAsync", - pathTemplate: "\"/v1/completions\"", + pathTemplate: "\"/completions\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.CompletionClient.g.cs b/src/libs/Together/Generated/Together.CompletionClient.g.cs index afab26bc..88917274 100644 --- a/src/libs/Together/Generated/Together.CompletionClient.g.cs +++ b/src/libs/Together/Generated/Together.CompletionClient.g.cs @@ -12,7 +12,7 @@ public sealed partial class CompletionClient : global::Together.ICompletionClien /// /// Default environment for APIs /// - public const string DefaultBaseUrl = "https://api.together.ai/"; + public const string DefaultBaseUrl = "https://api.together.ai/v1"; private bool _disposeHttpClient = true; @@ -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; } @@ -53,6 +53,34 @@ public sealed partial class CompletionClient : global::Together.ICompletionClien } + + 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. @@ -151,5 +179,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.ConfigService.JsonSerializerContext.g.cs b/src/libs/Together/Generated/Together.ConfigService.JsonSerializerContext.g.cs index 97cebcde..c7c35186 100644 --- a/src/libs/Together/Generated/Together.ConfigService.JsonSerializerContext.g.cs +++ b/src/libs/Together/Generated/Together.ConfigService.JsonSerializerContext.g.cs @@ -2,42 +2,7 @@ #nullable enable namespace Together -{ - /// - /// - /// - [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( - DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull - )] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeListProjectConfigsResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeModelConfig))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeCertification))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeSelector))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeCertificationTarget), TypeInfoPropertyName = "DeCertificationTarget2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeCertificationCertificationType), TypeInfoPropertyName = "DeCertificationCertificationType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ErrorData))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ErrorDataError))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeCertificationTarget?), TypeInfoPropertyName = "NullableDeCertificationTarget2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeCertificationCertificationType?), TypeInfoPropertyName = "NullableDeCertificationCertificationType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - internal sealed partial class ConfigServiceSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext - { - } - /// +{ /// /// /// public sealed partial class ConfigServiceSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext @@ -81,26 +46,7 @@ private ConfigServiceSourceGenerationContext(global::System.Text.Json.JsonSerial [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) { - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter, global::System.Collections.Generic.IList>()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter>()); - options.Converters.Add(new global::Together.JsonConverters.UnixTimestampJsonConverter()); - options.Converters.Add(new LazyEnumJsonConverterFactory()); + global::Together.SourceGenerationContext.AddConverters(options); } private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() @@ -115,48 +61,6 @@ public static void AddConverters(global::System.Text.Json.JsonSerializerOptions return options; } - - private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Serialization.JsonConverterFactory - { - public override bool CanConvert(global::System.Type typeToConvert) - { - return - typeToConvert == typeof(global::Together.DeCertificationTarget) - - || typeToConvert == typeof(global::Together.DeCertificationTarget?) - - || typeToConvert == typeof(global::Together.DeCertificationCertificationType) - - || typeToConvert == typeof(global::Together.DeCertificationCertificationType?); - } - - public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - if (typeToConvert == typeof(global::Together.DeCertificationTarget)) - { - return new global::Together.JsonConverters.DeCertificationTargetJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeCertificationTarget?)) - { - return new global::Together.JsonConverters.DeCertificationTargetNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeCertificationCertificationType)) - { - return new global::Together.JsonConverters.DeCertificationCertificationTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeCertificationCertificationType?)) - { - return new global::Together.JsonConverters.DeCertificationCertificationTypeNullableJsonConverter(); - } - throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); - } - } - private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver { private readonly object _gate = new(); @@ -196,7 +100,7 @@ private sealed class LazyChunkResolver : global::System.Text.Json.Serialization. { return index switch { - 0 => new ConfigServiceSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), + 0 => global::Together.SourceGenerationContext.TypeInfoResolver, _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), }; } diff --git a/src/libs/Together/Generated/Together.ConfigServiceClient.ConfigServiceGetProjectConfig.g.cs b/src/libs/Together/Generated/Together.ConfigServiceClient.ConfigServiceGetProjectConfig.g.cs index 12a2bd18..f27cc8e4 100644 --- a/src/libs/Together/Generated/Together.ConfigServiceClient.ConfigServiceGetProjectConfig.g.cs +++ b/src/libs/Together/Generated/Together.ConfigServiceClient.ConfigServiceGetProjectConfig.g.cs @@ -6,6 +6,14 @@ 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 @@ -56,6 +64,16 @@ partial void ProcessConfigServiceGetProjectConfigResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// config = client.beta.models.configs.retrieve(
+ /// "cr_abc123",
+ /// project_id=project_id,
+ /// )
+ /// print(config.id, config.reference_model) + ///
public async global::System.Threading.Tasks.Task ConfigServiceGetProjectConfigAsync( string projectId, string id, @@ -84,6 +102,16 @@ partial void ProcessConfigServiceGetProjectConfigResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// config = client.beta.models.configs.retrieve(
+ /// "cr_abc123",
+ /// project_id=project_id,
+ /// )
+ /// print(config.id, config.reference_model) + ///
public async global::System.Threading.Tasks.Task> ConfigServiceGetProjectConfigAsResponseAsync( string projectId, string id, @@ -121,8 +149,10 @@ partial void ProcessConfigServiceGetProjectConfigResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v2/projects/{projectId}/configs/{id}", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + 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, @@ -183,7 +213,7 @@ partial void ProcessConfigServiceGetProjectConfigResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ConfigServiceGetProjectConfig", methodName: "ConfigServiceGetProjectConfigAsync", - pathTemplate: "$\"/v2/projects/{projectId}/configs/{id}\"", + pathTemplate: "$\"/projects/{projectId}/configs/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -217,7 +247,7 @@ partial void ProcessConfigServiceGetProjectConfigResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ConfigServiceGetProjectConfig", methodName: "ConfigServiceGetProjectConfigAsync", - pathTemplate: "$\"/v2/projects/{projectId}/configs/{id}\"", + pathTemplate: "$\"/projects/{projectId}/configs/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -258,7 +288,7 @@ partial void ProcessConfigServiceGetProjectConfigResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ConfigServiceGetProjectConfig", methodName: "ConfigServiceGetProjectConfigAsync", - pathTemplate: "$\"/v2/projects/{projectId}/configs/{id}\"", + pathTemplate: "$\"/projects/{projectId}/configs/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -306,7 +336,7 @@ partial void ProcessConfigServiceGetProjectConfigResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ConfigServiceGetProjectConfig", methodName: "ConfigServiceGetProjectConfigAsync", - pathTemplate: "$\"/v2/projects/{projectId}/configs/{id}\"", + pathTemplate: "$\"/projects/{projectId}/configs/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -328,7 +358,7 @@ partial void ProcessConfigServiceGetProjectConfigResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ConfigServiceGetProjectConfig", methodName: "ConfigServiceGetProjectConfigAsync", - pathTemplate: "$\"/v2/projects/{projectId}/configs/{id}\"", + pathTemplate: "$\"/projects/{projectId}/configs/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.ConfigServiceClient.ConfigServiceListProjectConfigs.g.cs b/src/libs/Together/Generated/Together.ConfigServiceClient.ConfigServiceListProjectConfigs.g.cs index 40dbab4a..fa9d658a 100644 --- a/src/libs/Together/Generated/Together.ConfigServiceClient.ConfigServiceListProjectConfigs.g.cs +++ b/src/libs/Together/Generated/Together.ConfigServiceClient.ConfigServiceListProjectConfigs.g.cs @@ -6,6 +6,14 @@ 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 @@ -71,6 +79,20 @@ partial void ProcessConfigServiceListProjectConfigsResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// # Configurations are listed per model. A supported model's base_model is
+ /// # the resource name to pass as reference_model.
+ /// model = client.beta.models.retrieve_supported("arch_abc123")
+ /// configs = client.beta.models.configs.list(
+ /// project_id=project_id,
+ /// reference_model=model.base_model,
+ /// )
+ /// for config in configs:
+ /// print(config.id, config.reference_model) + ///
public async global::System.Threading.Tasks.Task ConfigServiceListProjectConfigsAsync( string projectId, string? referenceModelId = default, @@ -114,6 +136,20 @@ partial void ProcessConfigServiceListProjectConfigsResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// # Configurations are listed per model. A supported model's base_model is
+ /// # the resource name to pass as reference_model.
+ /// model = client.beta.models.retrieve_supported("arch_abc123")
+ /// configs = client.beta.models.configs.list(
+ /// project_id=project_id,
+ /// reference_model=model.base_model,
+ /// )
+ /// for config in configs:
+ /// print(config.id, config.reference_model) + ///
public async global::System.Threading.Tasks.Task> ConfigServiceListProjectConfigsAsResponseAsync( string projectId, string? referenceModelId = default, @@ -157,8 +193,10 @@ partial void ProcessConfigServiceListProjectConfigsResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v2/projects/{projectId}/configs", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/projects/{projectId}/configs", + baseUri: ResolveBaseUri( + servers: s_ConfigServiceListProjectConfigsServers, + defaultBaseUrl: "https://api.together.ai/v2")); __pathBuilder .AddOptionalParameter("referenceModelId", referenceModelId) .AddOptionalParameter("referenceModel", referenceModel) @@ -228,7 +266,7 @@ partial void ProcessConfigServiceListProjectConfigsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ConfigServiceListProjectConfigs", methodName: "ConfigServiceListProjectConfigsAsync", - pathTemplate: "$\"/v2/projects/{projectId}/configs\"", + pathTemplate: "$\"/projects/{projectId}/configs\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -262,7 +300,7 @@ partial void ProcessConfigServiceListProjectConfigsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ConfigServiceListProjectConfigs", methodName: "ConfigServiceListProjectConfigsAsync", - pathTemplate: "$\"/v2/projects/{projectId}/configs\"", + pathTemplate: "$\"/projects/{projectId}/configs\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -303,7 +341,7 @@ partial void ProcessConfigServiceListProjectConfigsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ConfigServiceListProjectConfigs", methodName: "ConfigServiceListProjectConfigsAsync", - pathTemplate: "$\"/v2/projects/{projectId}/configs\"", + pathTemplate: "$\"/projects/{projectId}/configs\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -351,7 +389,7 @@ partial void ProcessConfigServiceListProjectConfigsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ConfigServiceListProjectConfigs", methodName: "ConfigServiceListProjectConfigsAsync", - pathTemplate: "$\"/v2/projects/{projectId}/configs\"", + pathTemplate: "$\"/projects/{projectId}/configs\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -373,7 +411,7 @@ partial void ProcessConfigServiceListProjectConfigsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ConfigServiceListProjectConfigs", methodName: "ConfigServiceListProjectConfigsAsync", - pathTemplate: "$\"/v2/projects/{projectId}/configs\"", + pathTemplate: "$\"/projects/{projectId}/configs\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.ConfigServiceClient.g.cs b/src/libs/Together/Generated/Together.ConfigServiceClient.g.cs index 255aeef4..9b25f9a6 100644 --- a/src/libs/Together/Generated/Together.ConfigServiceClient.g.cs +++ b/src/libs/Together/Generated/Together.ConfigServiceClient.g.cs @@ -10,9 +10,9 @@ namespace Together public sealed partial class ConfigServiceClient : global::Together.IConfigServiceClient, global::System.IDisposable { /// - /// Default environment for APIs + /// /// - public const string DefaultBaseUrl = "https://api.together.ai/"; + public const string DefaultBaseUrl = "https://api.together.ai/v2"; private bool _disposeHttpClient = true; @@ -151,5 +151,36 @@ 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.DeploymentService.JsonSerializerContext.g.cs b/src/libs/Together/Generated/Together.DeploymentService.JsonSerializerContext.g.cs index b61a4db4..60346c70 100644 --- a/src/libs/Together/Generated/Together.DeploymentService.JsonSerializerContext.g.cs +++ b/src/libs/Together/Generated/Together.DeploymentService.JsonSerializerContext.g.cs @@ -2,89 +2,7 @@ #nullable enable namespace Together -{ - /// - /// - /// - [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( - DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull - )] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeAutoscalingResponse), TypeInfoPropertyName = "DeAutoscalingResponse2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(double))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeCreateDeploymentRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeAutoscaling))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DePlacement), TypeInfoPropertyName = "DePlacement2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeUpdateDeploymentRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeDeleteResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeDeployment))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeDeploymentTrafficMode), TypeInfoPropertyName = "DeDeploymentTrafficMode2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeRuntimeInfo))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeDeploymentStatus))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeAdapterEntry))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeDeploymentAdapterStatus))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeDeploymentAdapterStatusState), TypeInfoPropertyName = "DeDeploymentAdapterStatusState2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeListAdaptersResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeAddAdapterRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeUpdateAdapterRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(object))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DePlacementVariant1))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeInlinePlacement))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DePlacementVariant2))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeInlinePlacementConstraint), TypeInfoPropertyName = "DeInlinePlacementConstraint2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeCompliancePolicy))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeListDeploymentsResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeScalingMetric))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeScalingRules))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeDeploymentStatusState), TypeInfoPropertyName = "DeDeploymentStatusState2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeStatusDetails))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeRegionStatus))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeScalingPolicy))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeScalingPolicyType), TypeInfoPropertyName = "DeScalingPolicyType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeScalingRulesSelectPolicy), TypeInfoPropertyName = "DeScalingRulesSelectPolicy2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeScalingMetricName), TypeInfoPropertyName = "DeScalingMetricName2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeScalingMetricType), TypeInfoPropertyName = "DeScalingMetricType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ErrorData))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ErrorDataError))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeAutoscalingResponse?), TypeInfoPropertyName = "NullableDeAutoscalingResponse2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(double?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DePlacement?), TypeInfoPropertyName = "NullableDePlacement2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeDeploymentTrafficMode?), TypeInfoPropertyName = "NullableDeDeploymentTrafficMode2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeDeploymentAdapterStatusState?), TypeInfoPropertyName = "NullableDeDeploymentAdapterStatusState2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeInlinePlacementConstraint?), TypeInfoPropertyName = "NullableDeInlinePlacementConstraint2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeDeploymentStatusState?), TypeInfoPropertyName = "NullableDeDeploymentStatusState2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeScalingPolicyType?), TypeInfoPropertyName = "NullableDeScalingPolicyType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeScalingRulesSelectPolicy?), TypeInfoPropertyName = "NullableDeScalingRulesSelectPolicy2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeScalingMetricName?), TypeInfoPropertyName = "NullableDeScalingMetricName2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeScalingMetricType?), TypeInfoPropertyName = "NullableDeScalingMetricType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - internal sealed partial class DeploymentServiceSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext - { - } - /// +{ /// /// /// public sealed partial class DeploymentServiceSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext @@ -128,28 +46,7 @@ private DeploymentServiceSourceGenerationContext(global::System.Text.Json.JsonSe [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) { - options.Converters.Add(new global::Together.JsonConverters.DePlacementJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.DeAutoscalingResponseJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter, global::System.Collections.Generic.IList>()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter>()); - options.Converters.Add(new global::Together.JsonConverters.UnixTimestampJsonConverter()); - options.Converters.Add(new LazyEnumJsonConverterFactory()); + global::Together.SourceGenerationContext.AddConverters(options); } private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() @@ -164,132 +61,6 @@ public static void AddConverters(global::System.Text.Json.JsonSerializerOptions return options; } - - private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Serialization.JsonConverterFactory - { - public override bool CanConvert(global::System.Type typeToConvert) - { - return - typeToConvert == typeof(global::Together.DeDeploymentTrafficMode) - - || typeToConvert == typeof(global::Together.DeDeploymentTrafficMode?) - - || typeToConvert == typeof(global::Together.DeDeploymentAdapterStatusState) - - || typeToConvert == typeof(global::Together.DeDeploymentAdapterStatusState?) - - || typeToConvert == typeof(global::Together.DeInlinePlacementConstraint) - - || typeToConvert == typeof(global::Together.DeInlinePlacementConstraint?) - - || typeToConvert == typeof(global::Together.DeDeploymentStatusState) - - || typeToConvert == typeof(global::Together.DeDeploymentStatusState?) - - || typeToConvert == typeof(global::Together.DeScalingPolicyType) - - || typeToConvert == typeof(global::Together.DeScalingPolicyType?) - - || typeToConvert == typeof(global::Together.DeScalingRulesSelectPolicy) - - || typeToConvert == typeof(global::Together.DeScalingRulesSelectPolicy?) - - || typeToConvert == typeof(global::Together.DeScalingMetricName) - - || typeToConvert == typeof(global::Together.DeScalingMetricName?) - - || typeToConvert == typeof(global::Together.DeScalingMetricType) - - || typeToConvert == typeof(global::Together.DeScalingMetricType?); - } - - public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - if (typeToConvert == typeof(global::Together.DeDeploymentTrafficMode)) - { - return new global::Together.JsonConverters.DeDeploymentTrafficModeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeDeploymentTrafficMode?)) - { - return new global::Together.JsonConverters.DeDeploymentTrafficModeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeDeploymentAdapterStatusState)) - { - return new global::Together.JsonConverters.DeDeploymentAdapterStatusStateJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeDeploymentAdapterStatusState?)) - { - return new global::Together.JsonConverters.DeDeploymentAdapterStatusStateNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeInlinePlacementConstraint)) - { - return new global::Together.JsonConverters.DeInlinePlacementConstraintJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeInlinePlacementConstraint?)) - { - return new global::Together.JsonConverters.DeInlinePlacementConstraintNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeDeploymentStatusState)) - { - return new global::Together.JsonConverters.DeDeploymentStatusStateJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeDeploymentStatusState?)) - { - return new global::Together.JsonConverters.DeDeploymentStatusStateNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeScalingPolicyType)) - { - return new global::Together.JsonConverters.DeScalingPolicyTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeScalingPolicyType?)) - { - return new global::Together.JsonConverters.DeScalingPolicyTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeScalingRulesSelectPolicy)) - { - return new global::Together.JsonConverters.DeScalingRulesSelectPolicyJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeScalingRulesSelectPolicy?)) - { - return new global::Together.JsonConverters.DeScalingRulesSelectPolicyNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeScalingMetricName)) - { - return new global::Together.JsonConverters.DeScalingMetricNameJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeScalingMetricName?)) - { - return new global::Together.JsonConverters.DeScalingMetricNameNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeScalingMetricType)) - { - return new global::Together.JsonConverters.DeScalingMetricTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeScalingMetricType?)) - { - return new global::Together.JsonConverters.DeScalingMetricTypeNullableJsonConverter(); - } - throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); - } - } - private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver { private readonly object _gate = new(); @@ -329,7 +100,7 @@ private sealed class LazyChunkResolver : global::System.Text.Json.Serialization. { return index switch { - 0 => new DeploymentServiceSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), + 0 => global::Together.SourceGenerationContext.TypeInfoResolver, _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), }; } diff --git a/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceAddAdapter.g.cs b/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceAddAdapter.g.cs index 5243d5da..1b655b6a 100644 --- a/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceAddAdapter.g.cs +++ b/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceAddAdapter.g.cs @@ -6,6 +6,14 @@ 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 @@ -64,6 +72,18 @@ partial void ProcessDeploymentServiceAddAdapterResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// adapter = client.beta.endpoints.adapters.create(
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// deployment_id="dep_abc123",
+ /// adapter_model_id="ml_abc123",
+ /// )
+ /// print(adapter) + ///
public async global::System.Threading.Tasks.Task DeploymentServiceAddAdapterAsync( string projectId, string endpointId, @@ -102,6 +122,18 @@ partial void ProcessDeploymentServiceAddAdapterResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// adapter = client.beta.endpoints.adapters.create(
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// deployment_id="dep_abc123",
+ /// adapter_model_id="ml_abc123",
+ /// )
+ /// print(adapter) + ///
public async global::System.Threading.Tasks.Task> DeploymentServiceAddAdapterAsResponseAsync( string projectId, string endpointId, @@ -146,8 +178,10 @@ partial void ProcessDeploymentServiceAddAdapterResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v2/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + 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, @@ -216,7 +250,7 @@ partial void ProcessDeploymentServiceAddAdapterResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "DeploymentServiceAddAdapter", methodName: "DeploymentServiceAddAdapterAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -250,7 +284,7 @@ partial void ProcessDeploymentServiceAddAdapterResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "DeploymentServiceAddAdapter", methodName: "DeploymentServiceAddAdapterAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -291,7 +325,7 @@ partial void ProcessDeploymentServiceAddAdapterResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "DeploymentServiceAddAdapter", methodName: "DeploymentServiceAddAdapterAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -339,7 +373,7 @@ partial void ProcessDeploymentServiceAddAdapterResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "DeploymentServiceAddAdapter", methodName: "DeploymentServiceAddAdapterAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -361,7 +395,7 @@ partial void ProcessDeploymentServiceAddAdapterResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "DeploymentServiceAddAdapter", methodName: "DeploymentServiceAddAdapterAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceCreateDeployment.g.cs b/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceCreateDeployment.g.cs index 2ed7cc8b..31b7fb27 100644 --- a/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceCreateDeployment.g.cs +++ b/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceCreateDeployment.g.cs @@ -6,6 +6,14 @@ 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 @@ -64,6 +72,20 @@ partial void ProcessDeploymentServiceCreateDeploymentResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// deployment = client.beta.endpoints.deployments.create(
+ /// "ep_abc123",
+ /// project_id=project_id,
+ /// name="prod",
+ /// model=f"projects/{project_id}/models/ml_abc123",
+ /// config=f"projects/{project_id}/configs/cr_abc123",
+ /// autoscaling={"min_replicas": 1, "max_replicas": 2},
+ /// )
+ /// print(deployment.id, deployment.status) + ///
public async global::System.Threading.Tasks.Task DeploymentServiceCreateDeploymentAsync( string projectId, string endpointId, @@ -102,6 +124,20 @@ partial void ProcessDeploymentServiceCreateDeploymentResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// deployment = client.beta.endpoints.deployments.create(
+ /// "ep_abc123",
+ /// project_id=project_id,
+ /// name="prod",
+ /// model=f"projects/{project_id}/models/ml_abc123",
+ /// config=f"projects/{project_id}/configs/cr_abc123",
+ /// autoscaling={"min_replicas": 1, "max_replicas": 2},
+ /// )
+ /// print(deployment.id, deployment.status) + ///
public async global::System.Threading.Tasks.Task> DeploymentServiceCreateDeploymentAsResponseAsync( string projectId, string endpointId, @@ -146,8 +182,10 @@ partial void ProcessDeploymentServiceCreateDeploymentResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v2/projects/{projectId}/endpoints/{endpointId}/deployments", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/projects/{projectId}/endpoints/{endpointId}/deployments", + baseUri: ResolveBaseUri( + servers: s_DeploymentServiceCreateDeploymentServers, + defaultBaseUrl: "https://api.together.ai/v2")); __pathBuilder .AddOptionalParameter("validateOnly", validateOnly?.ToString().ToLowerInvariant()) ; @@ -219,7 +257,7 @@ partial void ProcessDeploymentServiceCreateDeploymentResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "DeploymentServiceCreateDeployment", methodName: "DeploymentServiceCreateDeploymentAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/deployments\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -253,7 +291,7 @@ partial void ProcessDeploymentServiceCreateDeploymentResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "DeploymentServiceCreateDeployment", methodName: "DeploymentServiceCreateDeploymentAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/deployments\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -294,7 +332,7 @@ partial void ProcessDeploymentServiceCreateDeploymentResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "DeploymentServiceCreateDeployment", methodName: "DeploymentServiceCreateDeploymentAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/deployments\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -342,7 +380,7 @@ partial void ProcessDeploymentServiceCreateDeploymentResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "DeploymentServiceCreateDeployment", methodName: "DeploymentServiceCreateDeploymentAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/deployments\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -364,7 +402,7 @@ partial void ProcessDeploymentServiceCreateDeploymentResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "DeploymentServiceCreateDeployment", methodName: "DeploymentServiceCreateDeploymentAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/deployments\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceDeleteDeployment.g.cs b/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceDeleteDeployment.g.cs index e4406bc8..c7675696 100644 --- a/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceDeleteDeployment.g.cs +++ b/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceDeleteDeployment.g.cs @@ -6,6 +6,14 @@ 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 @@ -66,6 +74,16 @@ partial void ProcessDeploymentServiceDeleteDeploymentResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// client.beta.endpoints.deployments.delete(
+ /// "dep_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// ) + ///
public async global::System.Threading.Tasks.Task DeploymentServiceDeleteDeploymentAsync( string projectId, string endpointId, @@ -104,6 +122,16 @@ partial void ProcessDeploymentServiceDeleteDeploymentResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// client.beta.endpoints.deployments.delete(
+ /// "dep_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// ) + ///
public async global::System.Threading.Tasks.Task> DeploymentServiceDeleteDeploymentAsResponseAsync( string projectId, string endpointId, @@ -145,8 +173,10 @@ partial void ProcessDeploymentServiceDeleteDeploymentResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v2/projects/{projectId}/endpoints/{endpointId}/deployments/{id}", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/projects/{projectId}/endpoints/{endpointId}/deployments/{id}", + baseUri: ResolveBaseUri( + servers: s_DeploymentServiceDeleteDeploymentServers, + defaultBaseUrl: "https://api.together.ai/v2")); __pathBuilder .AddOptionalParameter("etag", etag) ; @@ -212,7 +242,7 @@ partial void ProcessDeploymentServiceDeleteDeploymentResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "DeploymentServiceDeleteDeployment", methodName: "DeploymentServiceDeleteDeploymentAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/deployments/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{id}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -246,7 +276,7 @@ partial void ProcessDeploymentServiceDeleteDeploymentResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "DeploymentServiceDeleteDeployment", methodName: "DeploymentServiceDeleteDeploymentAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/deployments/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{id}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -287,7 +317,7 @@ partial void ProcessDeploymentServiceDeleteDeploymentResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "DeploymentServiceDeleteDeployment", methodName: "DeploymentServiceDeleteDeploymentAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/deployments/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{id}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -335,7 +365,7 @@ partial void ProcessDeploymentServiceDeleteDeploymentResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "DeploymentServiceDeleteDeployment", methodName: "DeploymentServiceDeleteDeploymentAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/deployments/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{id}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -357,7 +387,7 @@ partial void ProcessDeploymentServiceDeleteDeploymentResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "DeploymentServiceDeleteDeployment", methodName: "DeploymentServiceDeleteDeploymentAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/deployments/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{id}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceGetAdapter.g.cs b/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceGetAdapter.g.cs index e8bdc90a..b14f44eb 100644 --- a/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceGetAdapter.g.cs +++ b/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceGetAdapter.g.cs @@ -6,6 +6,14 @@ 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 @@ -49,7 +57,7 @@ partial void ProcessDeploymentServiceGetAdapterResponseContent( /// /// Get a deployment adapter
- /// Gets an adapter attachment by its `dad_` id and returns its per-cluster load state. + /// Gets an attached adapter and its per-cluster load state. ///
/// /// Project identifier. @@ -61,11 +69,23 @@ partial void ProcessDeploymentServiceGetAdapterResponseContent( /// Deployment identifier. /// /// - /// Adapter attachment `dad_` id from a prior add, update, get, or list response. + /// Adapter model identifier. /// /// 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()
+ /// project_id = client.whoami().project_id
+ /// adapter = client.beta.endpoints.adapters.retrieve(
+ /// "dad_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// deployment_id="dep_abc123",
+ /// )
+ /// print(adapter) + ///
public async global::System.Threading.Tasks.Task DeploymentServiceGetAdapterAsync( string projectId, string endpointId, @@ -87,7 +107,7 @@ partial void ProcessDeploymentServiceGetAdapterResponseContent( } /// /// Get a deployment adapter
- /// Gets an adapter attachment by its `dad_` id and returns its per-cluster load state. + /// Gets an attached adapter and its per-cluster load state. ///
/// /// Project identifier. @@ -99,11 +119,23 @@ partial void ProcessDeploymentServiceGetAdapterResponseContent( /// Deployment identifier. /// /// - /// Adapter attachment `dad_` id from a prior add, update, get, or list response. + /// Adapter model identifier. /// /// 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()
+ /// project_id = client.whoami().project_id
+ /// adapter = client.beta.endpoints.adapters.retrieve(
+ /// "dad_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// deployment_id="dep_abc123",
+ /// )
+ /// print(adapter) + ///
public async global::System.Threading.Tasks.Task> DeploymentServiceGetAdapterAsResponseAsync( string projectId, string endpointId, @@ -145,8 +177,10 @@ partial void ProcessDeploymentServiceGetAdapterResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v2/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters/{id}", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + 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, @@ -209,7 +243,7 @@ partial void ProcessDeploymentServiceGetAdapterResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "DeploymentServiceGetAdapter", methodName: "DeploymentServiceGetAdapterAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -243,7 +277,7 @@ partial void ProcessDeploymentServiceGetAdapterResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "DeploymentServiceGetAdapter", methodName: "DeploymentServiceGetAdapterAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -284,7 +318,7 @@ partial void ProcessDeploymentServiceGetAdapterResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "DeploymentServiceGetAdapter", methodName: "DeploymentServiceGetAdapterAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -332,7 +366,7 @@ partial void ProcessDeploymentServiceGetAdapterResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "DeploymentServiceGetAdapter", methodName: "DeploymentServiceGetAdapterAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -354,7 +388,7 @@ partial void ProcessDeploymentServiceGetAdapterResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "DeploymentServiceGetAdapter", methodName: "DeploymentServiceGetAdapterAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceGetDeployment.g.cs b/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceGetDeployment.g.cs index 342852c8..1db33f04 100644 --- a/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceGetDeployment.g.cs +++ b/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceGetDeployment.g.cs @@ -6,6 +6,14 @@ 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 @@ -61,6 +69,17 @@ partial void ProcessDeploymentServiceGetDeploymentResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// deployment = client.beta.endpoints.deployments.retrieve(
+ /// "dep_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// )
+ /// print(deployment.name, deployment.status) + ///
public async global::System.Threading.Tasks.Task DeploymentServiceGetDeploymentAsync( string projectId, string endpointId, @@ -94,6 +113,17 @@ partial void ProcessDeploymentServiceGetDeploymentResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// deployment = client.beta.endpoints.deployments.retrieve(
+ /// "dep_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// )
+ /// print(deployment.name, deployment.status) + ///
public async global::System.Threading.Tasks.Task> DeploymentServiceGetDeploymentAsResponseAsync( string projectId, string endpointId, @@ -133,8 +163,10 @@ partial void ProcessDeploymentServiceGetDeploymentResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v2/projects/{projectId}/endpoints/{endpointId}/deployments/{id}", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + 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, @@ -196,7 +228,7 @@ partial void ProcessDeploymentServiceGetDeploymentResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "DeploymentServiceGetDeployment", methodName: "DeploymentServiceGetDeploymentAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/deployments/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -230,7 +262,7 @@ partial void ProcessDeploymentServiceGetDeploymentResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "DeploymentServiceGetDeployment", methodName: "DeploymentServiceGetDeploymentAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/deployments/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -271,7 +303,7 @@ partial void ProcessDeploymentServiceGetDeploymentResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "DeploymentServiceGetDeployment", methodName: "DeploymentServiceGetDeploymentAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/deployments/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -319,7 +351,7 @@ partial void ProcessDeploymentServiceGetDeploymentResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "DeploymentServiceGetDeployment", methodName: "DeploymentServiceGetDeploymentAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/deployments/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -341,7 +373,7 @@ partial void ProcessDeploymentServiceGetDeploymentResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "DeploymentServiceGetDeployment", methodName: "DeploymentServiceGetDeploymentAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/deployments/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceListAdapters.g.cs b/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceListAdapters.g.cs index 0a912195..f91e78e4 100644 --- a/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceListAdapters.g.cs +++ b/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceListAdapters.g.cs @@ -6,6 +6,14 @@ 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 @@ -71,6 +79,18 @@ partial void ProcessDeploymentServiceListAdaptersResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// adapters = client.beta.endpoints.adapters.list(
+ /// endpoint_id="ep_abc123",
+ /// deployment_id="dep_abc123",
+ /// project_id=project_id,
+ /// )
+ /// for adapter in adapters:
+ /// print(adapter.id, adapter.adapter_model_id) + ///
public async global::System.Threading.Tasks.Task DeploymentServiceListAdaptersAsync( string projectId, string endpointId, @@ -114,6 +134,18 @@ partial void ProcessDeploymentServiceListAdaptersResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// adapters = client.beta.endpoints.adapters.list(
+ /// endpoint_id="ep_abc123",
+ /// deployment_id="dep_abc123",
+ /// project_id=project_id,
+ /// )
+ /// for adapter in adapters:
+ /// print(adapter.id, adapter.adapter_model_id) + ///
public async global::System.Threading.Tasks.Task> DeploymentServiceListAdaptersAsResponseAsync( string projectId, string endpointId, @@ -157,8 +189,10 @@ partial void ProcessDeploymentServiceListAdaptersResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v2/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + 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) @@ -226,7 +260,7 @@ partial void ProcessDeploymentServiceListAdaptersResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "DeploymentServiceListAdapters", methodName: "DeploymentServiceListAdaptersAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -260,7 +294,7 @@ partial void ProcessDeploymentServiceListAdaptersResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "DeploymentServiceListAdapters", methodName: "DeploymentServiceListAdaptersAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -301,7 +335,7 @@ partial void ProcessDeploymentServiceListAdaptersResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "DeploymentServiceListAdapters", methodName: "DeploymentServiceListAdaptersAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -349,7 +383,7 @@ partial void ProcessDeploymentServiceListAdaptersResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "DeploymentServiceListAdapters", methodName: "DeploymentServiceListAdaptersAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -371,7 +405,7 @@ partial void ProcessDeploymentServiceListAdaptersResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "DeploymentServiceListAdapters", methodName: "DeploymentServiceListAdaptersAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceListDeployments.g.cs b/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceListDeployments.g.cs index 6e66884a..880d630f 100644 --- a/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceListDeployments.g.cs +++ b/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceListDeployments.g.cs @@ -6,6 +6,14 @@ 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 @@ -76,6 +84,17 @@ partial void ProcessDeploymentServiceListDeploymentsResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// deployments = client.beta.endpoints.deployments.list(
+ /// "ep_abc123",
+ /// project_id=project_id,
+ /// )
+ /// for deployment in deployments:
+ /// print(deployment.id, deployment.name, deployment.status) + ///
public async global::System.Threading.Tasks.Task DeploymentServiceListDeploymentsAsync( string projectId, string endpointId, @@ -124,6 +143,17 @@ partial void ProcessDeploymentServiceListDeploymentsResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// deployments = client.beta.endpoints.deployments.list(
+ /// "ep_abc123",
+ /// project_id=project_id,
+ /// )
+ /// for deployment in deployments:
+ /// print(deployment.id, deployment.name, deployment.status) + ///
public async global::System.Threading.Tasks.Task> DeploymentServiceListDeploymentsAsResponseAsync( string projectId, string endpointId, @@ -169,8 +199,10 @@ partial void ProcessDeploymentServiceListDeploymentsResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v2/projects/{projectId}/endpoints/{endpointId}/deployments", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + 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) @@ -241,7 +273,7 @@ partial void ProcessDeploymentServiceListDeploymentsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "DeploymentServiceListDeployments", methodName: "DeploymentServiceListDeploymentsAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/deployments\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -275,7 +307,7 @@ partial void ProcessDeploymentServiceListDeploymentsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "DeploymentServiceListDeployments", methodName: "DeploymentServiceListDeploymentsAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/deployments\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -316,7 +348,7 @@ partial void ProcessDeploymentServiceListDeploymentsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "DeploymentServiceListDeployments", methodName: "DeploymentServiceListDeploymentsAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/deployments\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -364,7 +396,7 @@ partial void ProcessDeploymentServiceListDeploymentsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "DeploymentServiceListDeployments", methodName: "DeploymentServiceListDeploymentsAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/deployments\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -386,7 +418,7 @@ partial void ProcessDeploymentServiceListDeploymentsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "DeploymentServiceListDeployments", methodName: "DeploymentServiceListDeploymentsAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/deployments\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceRemoveAdapter.g.cs b/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceRemoveAdapter.g.cs index 8e511cd1..b82fb694 100644 --- a/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceRemoveAdapter.g.cs +++ b/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceRemoveAdapter.g.cs @@ -6,6 +6,14 @@ 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 @@ -51,7 +59,7 @@ partial void ProcessDeploymentServiceRemoveAdapterResponseContent( /// /// Remove a deployment adapter
- /// Detaches an adapter attachment by its `dad_` id using its row-level etag for optimistic concurrency. + /// Detaches an adapter from a deployment using its row-level etag for optimistic concurrency. ///
/// /// Project identifier. @@ -63,7 +71,7 @@ partial void ProcessDeploymentServiceRemoveAdapterResponseContent( /// Deployment identifier. /// /// - /// Adapter attachment `dad_` id from a prior add, update, get, or list response. + /// 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. @@ -71,6 +79,25 @@ partial void ProcessDeploymentServiceRemoveAdapterResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// # Read the attachment first: removing it requires its current etag.
+ /// adapter = client.beta.endpoints.adapters.retrieve(
+ /// "dad_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// deployment_id="dep_abc123",
+ /// )
+ /// client.beta.endpoints.adapters.delete(
+ /// "dad_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// deployment_id="dep_abc123",
+ /// etag=adapter.etag,
+ /// ) + ///
public async global::System.Threading.Tasks.Task DeploymentServiceRemoveAdapterAsync( string projectId, string endpointId, @@ -94,7 +121,7 @@ partial void ProcessDeploymentServiceRemoveAdapterResponseContent( } /// /// Remove a deployment adapter
- /// Detaches an adapter attachment by its `dad_` id using its row-level etag for optimistic concurrency. + /// Detaches an adapter from a deployment using its row-level etag for optimistic concurrency. ///
/// /// Project identifier. @@ -106,7 +133,7 @@ partial void ProcessDeploymentServiceRemoveAdapterResponseContent( /// Deployment identifier. /// /// - /// Adapter attachment `dad_` id from a prior add, update, get, or list response. + /// 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. @@ -114,6 +141,25 @@ partial void ProcessDeploymentServiceRemoveAdapterResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// # Read the attachment first: removing it requires its current etag.
+ /// adapter = client.beta.endpoints.adapters.retrieve(
+ /// "dad_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// deployment_id="dep_abc123",
+ /// )
+ /// client.beta.endpoints.adapters.delete(
+ /// "dad_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// deployment_id="dep_abc123",
+ /// etag=adapter.etag,
+ /// ) + ///
public async global::System.Threading.Tasks.Task> DeploymentServiceRemoveAdapterAsResponseAsync( string projectId, string endpointId, @@ -157,8 +203,10 @@ partial void ProcessDeploymentServiceRemoveAdapterResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v2/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters/{id}", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters/{id}", + baseUri: ResolveBaseUri( + servers: s_DeploymentServiceRemoveAdapterServers, + defaultBaseUrl: "https://api.together.ai/v2")); __pathBuilder .AddRequiredParameter("etag", etag) ; @@ -225,7 +273,7 @@ partial void ProcessDeploymentServiceRemoveAdapterResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "DeploymentServiceRemoveAdapter", methodName: "DeploymentServiceRemoveAdapterAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters/{id}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -259,7 +307,7 @@ partial void ProcessDeploymentServiceRemoveAdapterResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "DeploymentServiceRemoveAdapter", methodName: "DeploymentServiceRemoveAdapterAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters/{id}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -300,7 +348,7 @@ partial void ProcessDeploymentServiceRemoveAdapterResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "DeploymentServiceRemoveAdapter", methodName: "DeploymentServiceRemoveAdapterAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters/{id}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -348,7 +396,7 @@ partial void ProcessDeploymentServiceRemoveAdapterResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "DeploymentServiceRemoveAdapter", methodName: "DeploymentServiceRemoveAdapterAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters/{id}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -370,7 +418,7 @@ partial void ProcessDeploymentServiceRemoveAdapterResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "DeploymentServiceRemoveAdapter", methodName: "DeploymentServiceRemoveAdapterAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters/{id}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceUpdateAdapter.g.cs b/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceUpdateAdapter.g.cs index cf655297..37e22a20 100644 --- a/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceUpdateAdapter.g.cs +++ b/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceUpdateAdapter.g.cs @@ -6,6 +6,14 @@ 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 @@ -51,7 +59,7 @@ partial void ProcessDeploymentServiceUpdateAdapterResponseContent( /// /// Update a deployment adapter
- /// Updates the pinned revision of an adapter attachment by its `dad_` id using its row-level etag for optimistic concurrency. + /// Updates the pinned revision of an attached adapter using its row-level etag for optimistic concurrency. ///
/// /// Project identifier. @@ -63,12 +71,33 @@ partial void ProcessDeploymentServiceUpdateAdapterResponseContent( /// Deployment identifier. /// /// - /// Adapter attachment `dad_` id from a prior add, update, get, or list response. + /// Adapter model identifier. /// /// /// 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()
+ /// project_id = client.whoami().project_id
+ /// # Read the attachment first: updating it requires its current etag.
+ /// adapter = client.beta.endpoints.adapters.retrieve(
+ /// "dad_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// deployment_id="dep_abc123",
+ /// )
+ /// updated = client.beta.endpoints.adapters.update(
+ /// "dad_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// deployment_id="dep_abc123",
+ /// adapter_revision_id="rv_abc123",
+ /// etag=adapter.etag,
+ /// )
+ /// print(updated) + ///
public async global::System.Threading.Tasks.Task DeploymentServiceUpdateAdapterAsync( string projectId, string endpointId, @@ -94,7 +123,7 @@ partial void ProcessDeploymentServiceUpdateAdapterResponseContent( } /// /// Update a deployment adapter
- /// Updates the pinned revision of an adapter attachment by its `dad_` id using its row-level etag for optimistic concurrency. + /// Updates the pinned revision of an attached adapter using its row-level etag for optimistic concurrency. ///
/// /// Project identifier. @@ -106,12 +135,33 @@ partial void ProcessDeploymentServiceUpdateAdapterResponseContent( /// Deployment identifier. /// /// - /// Adapter attachment `dad_` id from a prior add, update, get, or list response. + /// Adapter model identifier. /// /// /// 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()
+ /// project_id = client.whoami().project_id
+ /// # Read the attachment first: updating it requires its current etag.
+ /// adapter = client.beta.endpoints.adapters.retrieve(
+ /// "dad_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// deployment_id="dep_abc123",
+ /// )
+ /// updated = client.beta.endpoints.adapters.update(
+ /// "dad_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// deployment_id="dep_abc123",
+ /// adapter_revision_id="rv_abc123",
+ /// etag=adapter.etag,
+ /// )
+ /// print(updated) + ///
public async global::System.Threading.Tasks.Task> DeploymentServiceUpdateAdapterAsResponseAsync( string projectId, string endpointId, @@ -158,8 +208,10 @@ partial void ProcessDeploymentServiceUpdateAdapterResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v2/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters/{id}", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + 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, @@ -229,7 +281,7 @@ partial void ProcessDeploymentServiceUpdateAdapterResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "DeploymentServiceUpdateAdapter", methodName: "DeploymentServiceUpdateAdapterAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters/{id}\"", httpMethod: "PATCH", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -263,7 +315,7 @@ partial void ProcessDeploymentServiceUpdateAdapterResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "DeploymentServiceUpdateAdapter", methodName: "DeploymentServiceUpdateAdapterAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters/{id}\"", httpMethod: "PATCH", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -304,7 +356,7 @@ partial void ProcessDeploymentServiceUpdateAdapterResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "DeploymentServiceUpdateAdapter", methodName: "DeploymentServiceUpdateAdapterAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters/{id}\"", httpMethod: "PATCH", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -352,7 +404,7 @@ partial void ProcessDeploymentServiceUpdateAdapterResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "DeploymentServiceUpdateAdapter", methodName: "DeploymentServiceUpdateAdapterAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters/{id}\"", httpMethod: "PATCH", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -374,7 +426,7 @@ partial void ProcessDeploymentServiceUpdateAdapterResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "DeploymentServiceUpdateAdapter", methodName: "DeploymentServiceUpdateAdapterAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters/{id}\"", httpMethod: "PATCH", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -524,7 +576,7 @@ partial void ProcessDeploymentServiceUpdateAdapterResponseContent( } /// /// Update a deployment adapter
- /// Updates the pinned revision of an adapter attachment by its `dad_` id using its row-level etag for optimistic concurrency. + /// Updates the pinned revision of an attached adapter using its row-level etag for optimistic concurrency. ///
/// /// Project identifier. @@ -536,7 +588,7 @@ partial void ProcessDeploymentServiceUpdateAdapterResponseContent( /// Deployment identifier. /// /// - /// Adapter attachment `dad_` id from a prior add, update, get, or list response. + /// Adapter model identifier. /// /// /// New adapter revision to pin. diff --git a/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceUpdateDeployment.g.cs b/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceUpdateDeployment.g.cs index e02f3474..308bd8c1 100644 --- a/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceUpdateDeployment.g.cs +++ b/src/libs/Together/Generated/Together.DeploymentServiceClient.DeploymentServiceUpdateDeployment.g.cs @@ -6,6 +6,14 @@ 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 @@ -69,6 +77,28 @@ partial void ProcessDeploymentServiceUpdateDeploymentResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// deployment = client.beta.endpoints.deployments.update(
+ /// "dep_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// autoscaling={
+ /// "min_replicas": 1,
+ /// "max_replicas": 4,
+ /// "scaling_metrics": [
+ /// {
+ /// "name": "gpu_utilization",
+ /// "target": 70,
+ /// "type": "METRIC_TARGET_TYPE_UTILIZATION",
+ /// }
+ /// ],
+ /// },
+ /// )
+ /// print(deployment.autoscaling) + ///
public async global::System.Threading.Tasks.Task DeploymentServiceUpdateDeploymentAsync( string projectId, string endpointId, @@ -112,6 +142,28 @@ partial void ProcessDeploymentServiceUpdateDeploymentResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// deployment = client.beta.endpoints.deployments.update(
+ /// "dep_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// autoscaling={
+ /// "min_replicas": 1,
+ /// "max_replicas": 4,
+ /// "scaling_metrics": [
+ /// {
+ /// "name": "gpu_utilization",
+ /// "target": 70,
+ /// "type": "METRIC_TARGET_TYPE_UTILIZATION",
+ /// }
+ /// ],
+ /// },
+ /// )
+ /// print(deployment.autoscaling) + ///
public async global::System.Threading.Tasks.Task> DeploymentServiceUpdateDeploymentAsResponseAsync( string projectId, string endpointId, @@ -158,8 +210,10 @@ partial void ProcessDeploymentServiceUpdateDeploymentResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v2/projects/{projectId}/endpoints/{endpointId}/deployments/{id}", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/projects/{projectId}/endpoints/{endpointId}/deployments/{id}", + baseUri: ResolveBaseUri( + servers: s_DeploymentServiceUpdateDeploymentServers, + defaultBaseUrl: "https://api.together.ai/v2")); __pathBuilder .AddOptionalParameter("updateMask", updateMask) ; @@ -232,7 +286,7 @@ partial void ProcessDeploymentServiceUpdateDeploymentResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "DeploymentServiceUpdateDeployment", methodName: "DeploymentServiceUpdateDeploymentAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/deployments/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{id}\"", httpMethod: "PATCH", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -266,7 +320,7 @@ partial void ProcessDeploymentServiceUpdateDeploymentResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "DeploymentServiceUpdateDeployment", methodName: "DeploymentServiceUpdateDeploymentAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/deployments/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{id}\"", httpMethod: "PATCH", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -307,7 +361,7 @@ partial void ProcessDeploymentServiceUpdateDeploymentResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "DeploymentServiceUpdateDeployment", methodName: "DeploymentServiceUpdateDeploymentAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/deployments/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{id}\"", httpMethod: "PATCH", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -355,7 +409,7 @@ partial void ProcessDeploymentServiceUpdateDeploymentResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "DeploymentServiceUpdateDeployment", methodName: "DeploymentServiceUpdateDeploymentAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/deployments/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{id}\"", httpMethod: "PATCH", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -377,7 +431,7 @@ partial void ProcessDeploymentServiceUpdateDeploymentResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "DeploymentServiceUpdateDeployment", methodName: "DeploymentServiceUpdateDeploymentAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/deployments/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/deployments/{id}\"", httpMethod: "PATCH", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.DeploymentServiceClient.g.cs b/src/libs/Together/Generated/Together.DeploymentServiceClient.g.cs index 349b1448..a24a54e9 100644 --- a/src/libs/Together/Generated/Together.DeploymentServiceClient.g.cs +++ b/src/libs/Together/Generated/Together.DeploymentServiceClient.g.cs @@ -10,9 +10,9 @@ namespace Together public sealed partial class DeploymentServiceClient : global::Together.IDeploymentServiceClient, global::System.IDisposable { /// - /// Default environment for APIs + /// /// - public const string DefaultBaseUrl = "https://api.together.ai/"; + public const string DefaultBaseUrl = "https://api.together.ai/v2"; private bool _disposeHttpClient = true; @@ -151,5 +151,36 @@ 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.Deployments.JsonSerializerContext.g.cs b/src/libs/Together/Generated/Together.Deployments.JsonSerializerContext.g.cs index 90a68f54..110914c9 100644 --- a/src/libs/Together/Generated/Together.Deployments.JsonSerializerContext.g.cs +++ b/src/libs/Together/Generated/Together.Deployments.JsonSerializerContext.g.cs @@ -2,84 +2,7 @@ #nullable enable namespace Together -{ - /// - /// - /// - [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( - DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull - )] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(double))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(object))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateDeploymentRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf), TypeInfoPropertyName = "OneOfHTTPAutoscalingConfigQueueAutoscalingConfigCustomMetricAutoscalingConfig2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.HTTPAutoscalingConfig))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.QueueAutoscalingConfig))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CustomMetricAutoscalingConfig))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateDeploymentRequestCapacityType), TypeInfoPropertyName = "CreateDeploymentRequestCapacityType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.EnvironmentVariable))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateDeploymentRequestGpuType), TypeInfoPropertyName = "CreateDeploymentRequestGpuType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ModelMount))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.VolumeMount))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeploymentListResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeploymentResponseItem))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeploymentLogs))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeploymentResponseItemCapacityType), TypeInfoPropertyName = "DeploymentResponseItemCapacityType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeploymentResponseItemGpuType), TypeInfoPropertyName = "DeploymentResponseItemGpuType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ReplicaEvent))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeploymentStatus), TypeInfoPropertyName = "DeploymentStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RevisionDetailResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RevisionDetailResponseCapacityType), TypeInfoPropertyName = "RevisionDetailResponseCapacityType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RevisionEventItem))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RevisionEventItemAction), TypeInfoPropertyName = "RevisionEventItemAction2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RevisionEventListResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RollbackDeploymentRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.HTTPAutoscalingConfigMetric), TypeInfoPropertyName = "HTTPAutoscalingConfigMetric2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.QueueAutoscalingConfigMetric), TypeInfoPropertyName = "QueueAutoscalingConfigMetric2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CustomMetricAutoscalingConfigMetric), TypeInfoPropertyName = "CustomMetricAutoscalingConfigMetric2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.UpdateDeploymentRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.UpdateDeploymentRequestCapacityType), TypeInfoPropertyName = "UpdateDeploymentRequestCapacityType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.UpdateDeploymentRequestGpuType), TypeInfoPropertyName = "UpdateDeploymentRequestGpuType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(double?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf?), TypeInfoPropertyName = "NullableOneOfHTTPAutoscalingConfigQueueAutoscalingConfigCustomMetricAutoscalingConfig2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateDeploymentRequestCapacityType?), TypeInfoPropertyName = "NullableCreateDeploymentRequestCapacityType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateDeploymentRequestGpuType?), TypeInfoPropertyName = "NullableCreateDeploymentRequestGpuType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeploymentResponseItemCapacityType?), TypeInfoPropertyName = "NullableDeploymentResponseItemCapacityType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeploymentResponseItemGpuType?), TypeInfoPropertyName = "NullableDeploymentResponseItemGpuType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeploymentStatus?), TypeInfoPropertyName = "NullableDeploymentStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RevisionDetailResponseCapacityType?), TypeInfoPropertyName = "NullableRevisionDetailResponseCapacityType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RevisionEventItemAction?), TypeInfoPropertyName = "NullableRevisionEventItemAction2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.HTTPAutoscalingConfigMetric?), TypeInfoPropertyName = "NullableHTTPAutoscalingConfigMetric2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.QueueAutoscalingConfigMetric?), TypeInfoPropertyName = "NullableQueueAutoscalingConfigMetric2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CustomMetricAutoscalingConfigMetric?), TypeInfoPropertyName = "NullableCustomMetricAutoscalingConfigMetric2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.UpdateDeploymentRequestCapacityType?), TypeInfoPropertyName = "NullableUpdateDeploymentRequestCapacityType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.UpdateDeploymentRequestGpuType?), TypeInfoPropertyName = "NullableUpdateDeploymentRequestGpuType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - internal sealed partial class DeploymentsSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext - { - } - /// +{ /// /// /// public sealed partial class DeploymentsSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext @@ -123,30 +46,7 @@ private DeploymentsSourceGenerationContext(global::System.Text.Json.JsonSerializ [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) { - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter, global::System.Collections.Generic.IList>()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter>()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.UnixTimestampJsonConverter()); - options.Converters.Add(new LazyEnumJsonConverterFactory()); + global::Together.SourceGenerationContext.AddConverters(options); } private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() @@ -161,188 +61,6 @@ public static void AddConverters(global::System.Text.Json.JsonSerializerOptions return options; } - - private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Serialization.JsonConverterFactory - { - public override bool CanConvert(global::System.Type typeToConvert) - { - return - typeToConvert == typeof(global::Together.CreateDeploymentRequestCapacityType) - - || typeToConvert == typeof(global::Together.CreateDeploymentRequestCapacityType?) - - || typeToConvert == typeof(global::Together.CreateDeploymentRequestGpuType) - - || typeToConvert == typeof(global::Together.CreateDeploymentRequestGpuType?) - - || typeToConvert == typeof(global::Together.DeploymentResponseItemCapacityType) - - || typeToConvert == typeof(global::Together.DeploymentResponseItemCapacityType?) - - || typeToConvert == typeof(global::Together.DeploymentResponseItemGpuType) - - || typeToConvert == typeof(global::Together.DeploymentResponseItemGpuType?) - - || typeToConvert == typeof(global::Together.RevisionDetailResponseCapacityType) - - || typeToConvert == typeof(global::Together.RevisionDetailResponseCapacityType?) - - || typeToConvert == typeof(global::Together.RevisionEventItemAction) - - || typeToConvert == typeof(global::Together.RevisionEventItemAction?) - - || typeToConvert == typeof(global::Together.DeploymentStatus) - - || typeToConvert == typeof(global::Together.DeploymentStatus?) - - || typeToConvert == typeof(global::Together.HTTPAutoscalingConfigMetric) - - || typeToConvert == typeof(global::Together.HTTPAutoscalingConfigMetric?) - - || typeToConvert == typeof(global::Together.QueueAutoscalingConfigMetric) - - || typeToConvert == typeof(global::Together.QueueAutoscalingConfigMetric?) - - || typeToConvert == typeof(global::Together.CustomMetricAutoscalingConfigMetric) - - || typeToConvert == typeof(global::Together.CustomMetricAutoscalingConfigMetric?) - - || typeToConvert == typeof(global::Together.UpdateDeploymentRequestCapacityType) - - || typeToConvert == typeof(global::Together.UpdateDeploymentRequestCapacityType?) - - || typeToConvert == typeof(global::Together.UpdateDeploymentRequestGpuType) - - || typeToConvert == typeof(global::Together.UpdateDeploymentRequestGpuType?); - } - - public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - if (typeToConvert == typeof(global::Together.CreateDeploymentRequestCapacityType)) - { - return new global::Together.JsonConverters.CreateDeploymentRequestCapacityTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.CreateDeploymentRequestCapacityType?)) - { - return new global::Together.JsonConverters.CreateDeploymentRequestCapacityTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.CreateDeploymentRequestGpuType)) - { - return new global::Together.JsonConverters.CreateDeploymentRequestGpuTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.CreateDeploymentRequestGpuType?)) - { - return new global::Together.JsonConverters.CreateDeploymentRequestGpuTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeploymentResponseItemCapacityType)) - { - return new global::Together.JsonConverters.DeploymentResponseItemCapacityTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeploymentResponseItemCapacityType?)) - { - return new global::Together.JsonConverters.DeploymentResponseItemCapacityTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeploymentResponseItemGpuType)) - { - return new global::Together.JsonConverters.DeploymentResponseItemGpuTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeploymentResponseItemGpuType?)) - { - return new global::Together.JsonConverters.DeploymentResponseItemGpuTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.RevisionDetailResponseCapacityType)) - { - return new global::Together.JsonConverters.RevisionDetailResponseCapacityTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.RevisionDetailResponseCapacityType?)) - { - return new global::Together.JsonConverters.RevisionDetailResponseCapacityTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.RevisionEventItemAction)) - { - return new global::Together.JsonConverters.RevisionEventItemActionJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.RevisionEventItemAction?)) - { - return new global::Together.JsonConverters.RevisionEventItemActionNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeploymentStatus)) - { - return new global::Together.JsonConverters.DeploymentStatusJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeploymentStatus?)) - { - return new global::Together.JsonConverters.DeploymentStatusNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.HTTPAutoscalingConfigMetric)) - { - return new global::Together.JsonConverters.HTTPAutoscalingConfigMetricJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.HTTPAutoscalingConfigMetric?)) - { - return new global::Together.JsonConverters.HTTPAutoscalingConfigMetricNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.QueueAutoscalingConfigMetric)) - { - return new global::Together.JsonConverters.QueueAutoscalingConfigMetricJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.QueueAutoscalingConfigMetric?)) - { - return new global::Together.JsonConverters.QueueAutoscalingConfigMetricNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.CustomMetricAutoscalingConfigMetric)) - { - return new global::Together.JsonConverters.CustomMetricAutoscalingConfigMetricJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.CustomMetricAutoscalingConfigMetric?)) - { - return new global::Together.JsonConverters.CustomMetricAutoscalingConfigMetricNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.UpdateDeploymentRequestCapacityType)) - { - return new global::Together.JsonConverters.UpdateDeploymentRequestCapacityTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.UpdateDeploymentRequestCapacityType?)) - { - return new global::Together.JsonConverters.UpdateDeploymentRequestCapacityTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.UpdateDeploymentRequestGpuType)) - { - return new global::Together.JsonConverters.UpdateDeploymentRequestGpuTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.UpdateDeploymentRequestGpuType?)) - { - return new global::Together.JsonConverters.UpdateDeploymentRequestGpuTypeNullableJsonConverter(); - } - throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); - } - } - private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver { private readonly object _gate = new(); @@ -382,7 +100,7 @@ private sealed class LazyChunkResolver : global::System.Text.Json.Serialization. { return index switch { - 0 => new DeploymentsSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), + 0 => global::Together.SourceGenerationContext.TypeInfoResolver, _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), }; } diff --git a/src/libs/Together/Generated/Together.DeploymentsClient.CreateDeployments.g.cs b/src/libs/Together/Generated/Together.DeploymentsClient.CreateDeployments.g.cs index 6a57cfbc..428316c6 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 @@ -49,6 +62,16 @@ partial void ProcessCreateDeploymentsResponseContent( /// 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()
+ /// deployment = client.beta.jig.deploy(
+ /// name="my-deployment",
+ /// gpu_type="h100-80gb",
+ /// image="registry.together.ai/proj_abcdefg1234567890/my-image:latest"
+ /// )
+ /// print(deployment) + ///
public async global::System.Threading.Tasks.Task CreateDeploymentsAsync( global::Together.CreateDeploymentRequest request, @@ -72,6 +95,16 @@ partial void ProcessCreateDeploymentsResponseContent( /// 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()
+ /// deployment = client.beta.jig.deploy(
+ /// name="my-deployment",
+ /// gpu_type="h100-80gb",
+ /// image="registry.together.ai/proj_abcdefg1234567890/my-image:latest"
+ /// )
+ /// print(deployment) + ///
public async global::System.Threading.Tasks.Task> CreateDeploymentsAsResponseAsync( global::Together.CreateDeploymentRequest request, @@ -110,8 +143,10 @@ partial void ProcessCreateDeploymentsResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: "/v1/deployments", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: "/deployments", + baseUri: ResolveBaseUri( + servers: s_CreateDeploymentsServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -177,7 +212,7 @@ partial void ProcessCreateDeploymentsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "createDeployments", methodName: "CreateDeploymentsAsync", - pathTemplate: "\"/v1/deployments\"", + pathTemplate: "\"/deployments\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -211,7 +246,7 @@ partial void ProcessCreateDeploymentsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "createDeployments", methodName: "CreateDeploymentsAsync", - pathTemplate: "\"/v1/deployments\"", + pathTemplate: "\"/deployments\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -252,7 +287,7 @@ partial void ProcessCreateDeploymentsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "createDeployments", methodName: "CreateDeploymentsAsync", - pathTemplate: "\"/v1/deployments\"", + pathTemplate: "\"/deployments\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -300,7 +335,7 @@ partial void ProcessCreateDeploymentsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "createDeployments", methodName: "CreateDeploymentsAsync", - pathTemplate: "\"/v1/deployments\"", + pathTemplate: "\"/deployments\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -322,7 +357,7 @@ partial void ProcessCreateDeploymentsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "createDeployments", methodName: "CreateDeploymentsAsync", - pathTemplate: "\"/v1/deployments\"", + pathTemplate: "\"/deployments\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.DeploymentsClient.CreateDeploymentsByIdRollback.g.cs b/src/libs/Together/Generated/Together.DeploymentsClient.CreateDeploymentsByIdRollback.g.cs index 77c08dc1..0f64e569 100644 --- a/src/libs/Together/Generated/Together.DeploymentsClient.CreateDeploymentsByIdRollback.g.cs +++ b/src/libs/Together/Generated/Together.DeploymentsClient.CreateDeploymentsByIdRollback.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class DeploymentsClient { + private static readonly global::Together.AutoSDKServer[] s_CreateDeploymentsByIdRollbackServers = 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_CreateDeploymentsByIdRollbackSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -124,8 +137,10 @@ partial void ProcessCreateDeploymentsByIdRollbackResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v1/deployments/{id}/rollback", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/deployments/{id}/rollback", + baseUri: ResolveBaseUri( + servers: s_CreateDeploymentsByIdRollbackServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -192,7 +207,7 @@ partial void ProcessCreateDeploymentsByIdRollbackResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "createDeploymentsByIdRollback", methodName: "CreateDeploymentsByIdRollbackAsync", - pathTemplate: "$\"/v1/deployments/{id}/rollback\"", + pathTemplate: "$\"/deployments/{id}/rollback\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -226,7 +241,7 @@ partial void ProcessCreateDeploymentsByIdRollbackResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "createDeploymentsByIdRollback", methodName: "CreateDeploymentsByIdRollbackAsync", - pathTemplate: "$\"/v1/deployments/{id}/rollback\"", + pathTemplate: "$\"/deployments/{id}/rollback\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -267,7 +282,7 @@ partial void ProcessCreateDeploymentsByIdRollbackResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "createDeploymentsByIdRollback", methodName: "CreateDeploymentsByIdRollbackAsync", - pathTemplate: "$\"/v1/deployments/{id}/rollback\"", + pathTemplate: "$\"/deployments/{id}/rollback\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -315,7 +330,7 @@ partial void ProcessCreateDeploymentsByIdRollbackResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "createDeploymentsByIdRollback", methodName: "CreateDeploymentsByIdRollbackAsync", - pathTemplate: "$\"/v1/deployments/{id}/rollback\"", + pathTemplate: "$\"/deployments/{id}/rollback\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -337,7 +352,7 @@ partial void ProcessCreateDeploymentsByIdRollbackResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "createDeploymentsByIdRollback", methodName: "CreateDeploymentsByIdRollbackAsync", - pathTemplate: "$\"/v1/deployments/{id}/rollback\"", + pathTemplate: "$\"/deployments/{id}/rollback\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.DeploymentsClient.DeleteDeploymentsById.g.cs b/src/libs/Together/Generated/Together.DeploymentsClient.DeleteDeploymentsById.g.cs index a2e0b876..695fa016 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 @@ -51,6 +64,12 @@ partial void ProcessDeleteDeploymentsByIdResponseContent( /// 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()
+ /// deployment = client.beta.jig.destroy("my-deployment")
+ /// print(deployment) + ///
public async global::System.Threading.Tasks.Task DeleteDeploymentsByIdAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -74,6 +93,12 @@ partial void ProcessDeleteDeploymentsByIdResponseContent( /// 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()
+ /// deployment = client.beta.jig.destroy("my-deployment")
+ /// print(deployment) + ///
public async global::System.Threading.Tasks.Task> DeleteDeploymentsByIdAsResponseAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -109,8 +134,10 @@ partial void ProcessDeleteDeploymentsByIdResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v1/deployments/{id}", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/deployments/{id}", + baseUri: ResolveBaseUri( + servers: s_DeleteDeploymentsByIdServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -170,7 +197,7 @@ partial void ProcessDeleteDeploymentsByIdResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "deleteDeploymentsById", methodName: "DeleteDeploymentsByIdAsync", - pathTemplate: "$\"/v1/deployments/{id}\"", + pathTemplate: "$\"/deployments/{id}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -204,7 +231,7 @@ partial void ProcessDeleteDeploymentsByIdResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "deleteDeploymentsById", methodName: "DeleteDeploymentsByIdAsync", - pathTemplate: "$\"/v1/deployments/{id}\"", + pathTemplate: "$\"/deployments/{id}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -245,7 +272,7 @@ partial void ProcessDeleteDeploymentsByIdResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "deleteDeploymentsById", methodName: "DeleteDeploymentsByIdAsync", - pathTemplate: "$\"/v1/deployments/{id}\"", + pathTemplate: "$\"/deployments/{id}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -293,7 +320,7 @@ partial void ProcessDeleteDeploymentsByIdResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "deleteDeploymentsById", methodName: "DeleteDeploymentsByIdAsync", - pathTemplate: "$\"/v1/deployments/{id}\"", + pathTemplate: "$\"/deployments/{id}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -315,7 +342,7 @@ partial void ProcessDeleteDeploymentsByIdResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "deleteDeploymentsById", methodName: "DeleteDeploymentsByIdAsync", - pathTemplate: "$\"/v1/deployments/{id}\"", + pathTemplate: "$\"/deployments/{id}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.DeploymentsClient.EditDeploymentsById.g.cs b/src/libs/Together/Generated/Together.DeploymentsClient.EditDeploymentsById.g.cs index 2bb206d0..05f50d73 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 @@ -54,6 +67,12 @@ partial void ProcessEditDeploymentsByIdResponseContent( /// 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()
+ /// deployment = client.beta.jig.update("my-deployment", gpu_count=2)
+ /// print(deployment) + ///
public async global::System.Threading.Tasks.Task EditDeploymentsByIdAsync( string id, @@ -82,6 +101,12 @@ partial void ProcessEditDeploymentsByIdResponseContent( /// 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()
+ /// deployment = client.beta.jig.update("my-deployment", gpu_count=2)
+ /// print(deployment) + ///
public async global::System.Threading.Tasks.Task> EditDeploymentsByIdAsResponseAsync( string id, @@ -122,8 +147,10 @@ partial void ProcessEditDeploymentsByIdResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v1/deployments/{id}", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/deployments/{id}", + baseUri: ResolveBaseUri( + servers: s_EditDeploymentsByIdServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -190,7 +217,7 @@ partial void ProcessEditDeploymentsByIdResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "editDeploymentsById", methodName: "EditDeploymentsByIdAsync", - pathTemplate: "$\"/v1/deployments/{id}\"", + pathTemplate: "$\"/deployments/{id}\"", httpMethod: "PATCH", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -224,7 +251,7 @@ partial void ProcessEditDeploymentsByIdResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "editDeploymentsById", methodName: "EditDeploymentsByIdAsync", - pathTemplate: "$\"/v1/deployments/{id}\"", + pathTemplate: "$\"/deployments/{id}\"", httpMethod: "PATCH", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -265,7 +292,7 @@ partial void ProcessEditDeploymentsByIdResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "editDeploymentsById", methodName: "EditDeploymentsByIdAsync", - pathTemplate: "$\"/v1/deployments/{id}\"", + pathTemplate: "$\"/deployments/{id}\"", httpMethod: "PATCH", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -313,7 +340,7 @@ partial void ProcessEditDeploymentsByIdResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "editDeploymentsById", methodName: "EditDeploymentsByIdAsync", - pathTemplate: "$\"/v1/deployments/{id}\"", + pathTemplate: "$\"/deployments/{id}\"", httpMethod: "PATCH", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -335,7 +362,7 @@ partial void ProcessEditDeploymentsByIdResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "editDeploymentsById", methodName: "EditDeploymentsByIdAsync", - pathTemplate: "$\"/v1/deployments/{id}\"", + pathTemplate: "$\"/deployments/{id}\"", httpMethod: "PATCH", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.DeploymentsClient.GetDeployments.g.cs b/src/libs/Together/Generated/Together.DeploymentsClient.GetDeployments.g.cs index c4184bec..0b3d485e 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 @@ -46,6 +59,12 @@ partial void ProcessGetDeploymentsResponseContent( /// 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()
+ /// deployments = client.beta.jig.list()
+ /// print(deployments) + ///
public async global::System.Threading.Tasks.Task GetDeploymentsAsync( global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -64,6 +83,12 @@ partial void ProcessGetDeploymentsResponseContent( /// 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()
+ /// deployments = client.beta.jig.list()
+ /// print(deployments) + ///
public async global::System.Threading.Tasks.Task> GetDeploymentsAsResponseAsync( global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -97,8 +122,10 @@ partial void ProcessGetDeploymentsResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: "/v1/deployments", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: "/deployments", + baseUri: ResolveBaseUri( + servers: s_GetDeploymentsServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -157,7 +184,7 @@ partial void ProcessGetDeploymentsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getDeployments", methodName: "GetDeploymentsAsync", - pathTemplate: "\"/v1/deployments\"", + pathTemplate: "\"/deployments\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -191,7 +218,7 @@ partial void ProcessGetDeploymentsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getDeployments", methodName: "GetDeploymentsAsync", - pathTemplate: "\"/v1/deployments\"", + pathTemplate: "\"/deployments\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -232,7 +259,7 @@ partial void ProcessGetDeploymentsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getDeployments", methodName: "GetDeploymentsAsync", - pathTemplate: "\"/v1/deployments\"", + pathTemplate: "\"/deployments\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -280,7 +307,7 @@ partial void ProcessGetDeploymentsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getDeployments", methodName: "GetDeploymentsAsync", - pathTemplate: "\"/v1/deployments\"", + pathTemplate: "\"/deployments\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -302,7 +329,7 @@ partial void ProcessGetDeploymentsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getDeployments", methodName: "GetDeploymentsAsync", - pathTemplate: "\"/v1/deployments\"", + pathTemplate: "\"/deployments\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.DeploymentsClient.GetDeploymentsById.g.cs b/src/libs/Together/Generated/Together.DeploymentsClient.GetDeploymentsById.g.cs index 08860d5d..ed553ac2 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 @@ -51,6 +64,12 @@ partial void ProcessGetDeploymentsByIdResponseContent( /// 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()
+ /// deployment = client.beta.jig.retrieve("my-deployment")
+ /// print(deployment) + ///
public async global::System.Threading.Tasks.Task GetDeploymentsByIdAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -74,6 +93,12 @@ partial void ProcessGetDeploymentsByIdResponseContent( /// 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()
+ /// deployment = client.beta.jig.retrieve("my-deployment")
+ /// print(deployment) + ///
public async global::System.Threading.Tasks.Task> GetDeploymentsByIdAsResponseAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -109,8 +134,10 @@ partial void ProcessGetDeploymentsByIdResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v1/deployments/{id}", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/deployments/{id}", + baseUri: ResolveBaseUri( + servers: s_GetDeploymentsByIdServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -170,7 +197,7 @@ partial void ProcessGetDeploymentsByIdResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getDeploymentsById", methodName: "GetDeploymentsByIdAsync", - pathTemplate: "$\"/v1/deployments/{id}\"", + pathTemplate: "$\"/deployments/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -204,7 +231,7 @@ partial void ProcessGetDeploymentsByIdResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getDeploymentsById", methodName: "GetDeploymentsByIdAsync", - pathTemplate: "$\"/v1/deployments/{id}\"", + pathTemplate: "$\"/deployments/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -245,7 +272,7 @@ partial void ProcessGetDeploymentsByIdResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getDeploymentsById", methodName: "GetDeploymentsByIdAsync", - pathTemplate: "$\"/v1/deployments/{id}\"", + pathTemplate: "$\"/deployments/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -293,7 +320,7 @@ partial void ProcessGetDeploymentsByIdResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getDeploymentsById", methodName: "GetDeploymentsByIdAsync", - pathTemplate: "$\"/v1/deployments/{id}\"", + pathTemplate: "$\"/deployments/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -315,7 +342,7 @@ partial void ProcessGetDeploymentsByIdResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getDeploymentsById", methodName: "GetDeploymentsByIdAsync", - pathTemplate: "$\"/v1/deployments/{id}\"", + pathTemplate: "$\"/deployments/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.DeploymentsClient.GetDeploymentsByIdLogs.g.cs b/src/libs/Together/Generated/Together.DeploymentsClient.GetDeploymentsByIdLogs.g.cs index 74592102..acc776e4 100644 --- a/src/libs/Together/Generated/Together.DeploymentsClient.GetDeploymentsByIdLogs.g.cs +++ b/src/libs/Together/Generated/Together.DeploymentsClient.GetDeploymentsByIdLogs.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class DeploymentsClient { + private static readonly global::Together.AutoSDKServer[] s_GetDeploymentsByIdLogsServers = 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_GetDeploymentsByIdLogsSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -66,6 +79,12 @@ partial void ProcessGetDeploymentsByIdLogsResponseContent( /// 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()
+ /// logs = client.beta.jig.retrieve_logs("my-deployment")
+ /// print(logs) + ///
public async global::System.Threading.Tasks.Task GetDeploymentsByIdLogsAsync( string id, string? replicaId = default, @@ -104,6 +123,12 @@ partial void ProcessGetDeploymentsByIdLogsResponseContent( /// 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()
+ /// logs = client.beta.jig.retrieve_logs("my-deployment")
+ /// print(logs) + ///
public async global::System.Threading.Tasks.Task> GetDeploymentsByIdLogsAsResponseAsync( string id, string? replicaId = default, @@ -145,8 +170,10 @@ partial void ProcessGetDeploymentsByIdLogsResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v1/deployments/{id}/logs", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/deployments/{id}/logs", + baseUri: ResolveBaseUri( + servers: s_GetDeploymentsByIdLogsServers, + defaultBaseUrl: "https://api.together.ai/v1")); __pathBuilder .AddOptionalParameter("replica_id", replicaId) .AddOptionalParameter("version", version) @@ -214,7 +241,7 @@ partial void ProcessGetDeploymentsByIdLogsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getDeploymentsByIdLogs", methodName: "GetDeploymentsByIdLogsAsync", - pathTemplate: "$\"/v1/deployments/{id}/logs\"", + pathTemplate: "$\"/deployments/{id}/logs\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -248,7 +275,7 @@ partial void ProcessGetDeploymentsByIdLogsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getDeploymentsByIdLogs", methodName: "GetDeploymentsByIdLogsAsync", - pathTemplate: "$\"/v1/deployments/{id}/logs\"", + pathTemplate: "$\"/deployments/{id}/logs\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -289,7 +316,7 @@ partial void ProcessGetDeploymentsByIdLogsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getDeploymentsByIdLogs", methodName: "GetDeploymentsByIdLogsAsync", - pathTemplate: "$\"/v1/deployments/{id}/logs\"", + pathTemplate: "$\"/deployments/{id}/logs\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -337,7 +364,7 @@ partial void ProcessGetDeploymentsByIdLogsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getDeploymentsByIdLogs", methodName: "GetDeploymentsByIdLogsAsync", - pathTemplate: "$\"/v1/deployments/{id}/logs\"", + pathTemplate: "$\"/deployments/{id}/logs\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -359,7 +386,7 @@ partial void ProcessGetDeploymentsByIdLogsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getDeploymentsByIdLogs", methodName: "GetDeploymentsByIdLogsAsync", - pathTemplate: "$\"/v1/deployments/{id}/logs\"", + pathTemplate: "$\"/deployments/{id}/logs\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.DeploymentsClient.GetDeploymentsByIdRevisions.g.cs b/src/libs/Together/Generated/Together.DeploymentsClient.GetDeploymentsByIdRevisions.g.cs index 0e8477bd..471a25e2 100644 --- a/src/libs/Together/Generated/Together.DeploymentsClient.GetDeploymentsByIdRevisions.g.cs +++ b/src/libs/Together/Generated/Together.DeploymentsClient.GetDeploymentsByIdRevisions.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class DeploymentsClient { + private static readonly global::Together.AutoSDKServer[] s_GetDeploymentsByIdRevisionsServers = 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_GetDeploymentsByIdRevisionsSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -135,8 +148,10 @@ partial void ProcessGetDeploymentsByIdRevisionsResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v1/deployments/{id}/revisions", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/deployments/{id}/revisions", + baseUri: ResolveBaseUri( + servers: s_GetDeploymentsByIdRevisionsServers, + defaultBaseUrl: "https://api.together.ai/v1")); __pathBuilder .AddOptionalParameter("limit", limit?.ToString()) .AddOptionalParameter("before", before?.ToString()) @@ -202,7 +217,7 @@ partial void ProcessGetDeploymentsByIdRevisionsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getDeploymentsByIdRevisions", methodName: "GetDeploymentsByIdRevisionsAsync", - pathTemplate: "$\"/v1/deployments/{id}/revisions\"", + pathTemplate: "$\"/deployments/{id}/revisions\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -236,7 +251,7 @@ partial void ProcessGetDeploymentsByIdRevisionsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getDeploymentsByIdRevisions", methodName: "GetDeploymentsByIdRevisionsAsync", - pathTemplate: "$\"/v1/deployments/{id}/revisions\"", + pathTemplate: "$\"/deployments/{id}/revisions\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -277,7 +292,7 @@ partial void ProcessGetDeploymentsByIdRevisionsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getDeploymentsByIdRevisions", methodName: "GetDeploymentsByIdRevisionsAsync", - pathTemplate: "$\"/v1/deployments/{id}/revisions\"", + pathTemplate: "$\"/deployments/{id}/revisions\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -325,7 +340,7 @@ partial void ProcessGetDeploymentsByIdRevisionsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getDeploymentsByIdRevisions", methodName: "GetDeploymentsByIdRevisionsAsync", - pathTemplate: "$\"/v1/deployments/{id}/revisions\"", + pathTemplate: "$\"/deployments/{id}/revisions\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -347,7 +362,7 @@ partial void ProcessGetDeploymentsByIdRevisionsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getDeploymentsByIdRevisions", methodName: "GetDeploymentsByIdRevisionsAsync", - pathTemplate: "$\"/v1/deployments/{id}/revisions\"", + pathTemplate: "$\"/deployments/{id}/revisions\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.DeploymentsClient.GetDeploymentsByIdRevisionsByRevisionIdentifier.g.cs b/src/libs/Together/Generated/Together.DeploymentsClient.GetDeploymentsByIdRevisionsByRevisionIdentifier.g.cs index 1b7f1de2..cdfd438e 100644 --- a/src/libs/Together/Generated/Together.DeploymentsClient.GetDeploymentsByIdRevisionsByRevisionIdentifier.g.cs +++ b/src/libs/Together/Generated/Together.DeploymentsClient.GetDeploymentsByIdRevisionsByRevisionIdentifier.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class DeploymentsClient { + private static readonly global::Together.AutoSDKServer[] s_GetDeploymentsByIdRevisionsByRevisionIdentifierServers = 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_GetDeploymentsByIdRevisionsByRevisionIdentifierSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -125,8 +138,10 @@ partial void ProcessGetDeploymentsByIdRevisionsByRevisionIdentifierResponseConte { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v1/deployments/{id}/revisions/{revisionIdentifier}", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/deployments/{id}/revisions/{revisionIdentifier}", + baseUri: ResolveBaseUri( + servers: s_GetDeploymentsByIdRevisionsByRevisionIdentifierServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -187,7 +202,7 @@ partial void ProcessGetDeploymentsByIdRevisionsByRevisionIdentifierResponseConte context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getDeploymentsByIdRevisionsByRevisionIdentifier", methodName: "GetDeploymentsByIdRevisionsByRevisionIdentifierAsync", - pathTemplate: "$\"/v1/deployments/{id}/revisions/{revisionIdentifier}\"", + pathTemplate: "$\"/deployments/{id}/revisions/{revisionIdentifier}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -221,7 +236,7 @@ partial void ProcessGetDeploymentsByIdRevisionsByRevisionIdentifierResponseConte context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getDeploymentsByIdRevisionsByRevisionIdentifier", methodName: "GetDeploymentsByIdRevisionsByRevisionIdentifierAsync", - pathTemplate: "$\"/v1/deployments/{id}/revisions/{revisionIdentifier}\"", + pathTemplate: "$\"/deployments/{id}/revisions/{revisionIdentifier}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -262,7 +277,7 @@ partial void ProcessGetDeploymentsByIdRevisionsByRevisionIdentifierResponseConte context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getDeploymentsByIdRevisionsByRevisionIdentifier", methodName: "GetDeploymentsByIdRevisionsByRevisionIdentifierAsync", - pathTemplate: "$\"/v1/deployments/{id}/revisions/{revisionIdentifier}\"", + pathTemplate: "$\"/deployments/{id}/revisions/{revisionIdentifier}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -310,7 +325,7 @@ partial void ProcessGetDeploymentsByIdRevisionsByRevisionIdentifierResponseConte context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getDeploymentsByIdRevisionsByRevisionIdentifier", methodName: "GetDeploymentsByIdRevisionsByRevisionIdentifierAsync", - pathTemplate: "$\"/v1/deployments/{id}/revisions/{revisionIdentifier}\"", + pathTemplate: "$\"/deployments/{id}/revisions/{revisionIdentifier}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -332,7 +347,7 @@ partial void ProcessGetDeploymentsByIdRevisionsByRevisionIdentifierResponseConte context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getDeploymentsByIdRevisionsByRevisionIdentifier", methodName: "GetDeploymentsByIdRevisionsByRevisionIdentifierAsync", - pathTemplate: "$\"/v1/deployments/{id}/revisions/{revisionIdentifier}\"", + pathTemplate: "$\"/deployments/{id}/revisions/{revisionIdentifier}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.DeploymentsClient.g.cs b/src/libs/Together/Generated/Together.DeploymentsClient.g.cs index 5db7e313..f6445803 100644 --- a/src/libs/Together/Generated/Together.DeploymentsClient.g.cs +++ b/src/libs/Together/Generated/Together.DeploymentsClient.g.cs @@ -12,7 +12,7 @@ public sealed partial class DeploymentsClient : global::Together.IDeploymentsCli /// /// Default environment for APIs /// - public const string DefaultBaseUrl = "https://api.together.ai/"; + public const string DefaultBaseUrl = "https://api.together.ai/v1"; private bool _disposeHttpClient = true; @@ -20,7 +20,7 @@ public sealed partial class DeploymentsClient : global::Together.IDeploymentsCli 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; } @@ -53,6 +53,34 @@ public sealed partial class DeploymentsClient : global::Together.IDeploymentsCli } + + 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 DeploymentsClient. /// If no httpClient is provided, a new one will be created. @@ -151,5 +179,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.DeploymentsStorage.JsonSerializerContext.g.cs b/src/libs/Together/Generated/Together.DeploymentsStorage.JsonSerializerContext.g.cs index 624e598a..a16ee1aa 100644 --- a/src/libs/Together/Generated/Together.DeploymentsStorage.JsonSerializerContext.g.cs +++ b/src/libs/Together/Generated/Together.DeploymentsStorage.JsonSerializerContext.g.cs @@ -2,23 +2,7 @@ #nullable enable namespace Together -{ - /// - /// - /// - [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( - DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull - )] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.SignedURLResponse))] - internal sealed partial class DeploymentsStorageSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext - { - } - /// +{ /// /// /// public sealed partial class DeploymentsStorageSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext @@ -62,25 +46,7 @@ private DeploymentsStorageSourceGenerationContext(global::System.Text.Json.JsonS [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) { - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter, global::System.Collections.Generic.IList>()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter>()); - options.Converters.Add(new global::Together.JsonConverters.UnixTimestampJsonConverter()); + global::Together.SourceGenerationContext.AddConverters(options); } private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() @@ -134,7 +100,7 @@ private sealed class LazyChunkResolver : global::System.Text.Json.Serialization. { return index switch { - 0 => new DeploymentsStorageSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), + 0 => global::Together.SourceGenerationContext.TypeInfoResolver, _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), }; } diff --git a/src/libs/Together/Generated/Together.DeploymentsStorageClient.GetDeploymentsStorageByFilename.g.cs b/src/libs/Together/Generated/Together.DeploymentsStorageClient.GetDeploymentsStorageByFilename.g.cs index 1f5944dc..b558afe7 100644 --- a/src/libs/Together/Generated/Together.DeploymentsStorageClient.GetDeploymentsStorageByFilename.g.cs +++ b/src/libs/Together/Generated/Together.DeploymentsStorageClient.GetDeploymentsStorageByFilename.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class DeploymentsStorageClient { + private static readonly global::Together.AutoSDKServer[] s_GetDeploymentsStorageByFilenameServers = 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_GetDeploymentsStorageByFilenameSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -102,8 +115,10 @@ await GetDeploymentsStorageByFilenameAsResponseAsync( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v1/deployments/storage/{filename}", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/deployments/storage/{filename}", + baseUri: ResolveBaseUri( + servers: s_GetDeploymentsStorageByFilenameServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -163,7 +178,7 @@ await GetDeploymentsStorageByFilenameAsResponseAsync( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getDeploymentsStorageByFilename", methodName: "GetDeploymentsStorageByFilenameAsync", - pathTemplate: "$\"/v1/deployments/storage/{filename}\"", + pathTemplate: "$\"/deployments/storage/{filename}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -197,7 +212,7 @@ await GetDeploymentsStorageByFilenameAsResponseAsync( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getDeploymentsStorageByFilename", methodName: "GetDeploymentsStorageByFilenameAsync", - pathTemplate: "$\"/v1/deployments/storage/{filename}\"", + pathTemplate: "$\"/deployments/storage/{filename}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -238,7 +253,7 @@ await GetDeploymentsStorageByFilenameAsResponseAsync( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getDeploymentsStorageByFilename", methodName: "GetDeploymentsStorageByFilenameAsync", - pathTemplate: "$\"/v1/deployments/storage/{filename}\"", + pathTemplate: "$\"/deployments/storage/{filename}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -286,7 +301,7 @@ await GetDeploymentsStorageByFilenameAsResponseAsync( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getDeploymentsStorageByFilename", methodName: "GetDeploymentsStorageByFilenameAsync", - pathTemplate: "$\"/v1/deployments/storage/{filename}\"", + pathTemplate: "$\"/deployments/storage/{filename}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -308,7 +323,7 @@ await GetDeploymentsStorageByFilenameAsResponseAsync( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getDeploymentsStorageByFilename", methodName: "GetDeploymentsStorageByFilenameAsync", - pathTemplate: "$\"/v1/deployments/storage/{filename}\"", + pathTemplate: "$\"/deployments/storage/{filename}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.DeploymentsStorageClient.GetDeploymentsStorageByFilenameUrl.g.cs b/src/libs/Together/Generated/Together.DeploymentsStorageClient.GetDeploymentsStorageByFilenameUrl.g.cs index fdc24755..489c9591 100644 --- a/src/libs/Together/Generated/Together.DeploymentsStorageClient.GetDeploymentsStorageByFilenameUrl.g.cs +++ b/src/libs/Together/Generated/Together.DeploymentsStorageClient.GetDeploymentsStorageByFilenameUrl.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class DeploymentsStorageClient { + private static readonly global::Together.AutoSDKServer[] s_GetDeploymentsStorageByFilenameUrlServers = 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_GetDeploymentsStorageByFilenameUrlSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -109,8 +122,10 @@ partial void ProcessGetDeploymentsStorageByFilenameUrlResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v1/deployments/storage/{filename}/url", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/deployments/storage/{filename}/url", + baseUri: ResolveBaseUri( + servers: s_GetDeploymentsStorageByFilenameUrlServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -170,7 +185,7 @@ partial void ProcessGetDeploymentsStorageByFilenameUrlResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getDeploymentsStorageByFilenameUrl", methodName: "GetDeploymentsStorageByFilenameUrlAsync", - pathTemplate: "$\"/v1/deployments/storage/{filename}/url\"", + pathTemplate: "$\"/deployments/storage/{filename}/url\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -204,7 +219,7 @@ partial void ProcessGetDeploymentsStorageByFilenameUrlResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getDeploymentsStorageByFilenameUrl", methodName: "GetDeploymentsStorageByFilenameUrlAsync", - pathTemplate: "$\"/v1/deployments/storage/{filename}/url\"", + pathTemplate: "$\"/deployments/storage/{filename}/url\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -245,7 +260,7 @@ partial void ProcessGetDeploymentsStorageByFilenameUrlResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getDeploymentsStorageByFilenameUrl", methodName: "GetDeploymentsStorageByFilenameUrlAsync", - pathTemplate: "$\"/v1/deployments/storage/{filename}/url\"", + pathTemplate: "$\"/deployments/storage/{filename}/url\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -293,7 +308,7 @@ partial void ProcessGetDeploymentsStorageByFilenameUrlResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getDeploymentsStorageByFilenameUrl", methodName: "GetDeploymentsStorageByFilenameUrlAsync", - pathTemplate: "$\"/v1/deployments/storage/{filename}/url\"", + pathTemplate: "$\"/deployments/storage/{filename}/url\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -315,7 +330,7 @@ partial void ProcessGetDeploymentsStorageByFilenameUrlResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getDeploymentsStorageByFilenameUrl", methodName: "GetDeploymentsStorageByFilenameUrlAsync", - pathTemplate: "$\"/v1/deployments/storage/{filename}/url\"", + pathTemplate: "$\"/deployments/storage/{filename}/url\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.DeploymentsStorageClient.g.cs b/src/libs/Together/Generated/Together.DeploymentsStorageClient.g.cs index a1d82137..23139335 100644 --- a/src/libs/Together/Generated/Together.DeploymentsStorageClient.g.cs +++ b/src/libs/Together/Generated/Together.DeploymentsStorageClient.g.cs @@ -12,7 +12,7 @@ public sealed partial class DeploymentsStorageClient : global::Together.IDeploym /// /// Default environment for APIs /// - public const string DefaultBaseUrl = "https://api.together.ai/"; + public const string DefaultBaseUrl = "https://api.together.ai/v1"; private bool _disposeHttpClient = true; @@ -20,7 +20,7 @@ public sealed partial class DeploymentsStorageClient : global::Together.IDeploym 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; } @@ -53,6 +53,34 @@ public sealed partial class DeploymentsStorageClient : global::Together.IDeploym } + + 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 DeploymentsStorageClient. /// If no httpClient is provided, a new one will be created. @@ -151,5 +179,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.DeploymentsVolumes.JsonSerializerContext.g.cs b/src/libs/Together/Generated/Together.DeploymentsVolumes.JsonSerializerContext.g.cs index b9013596..239d16b4 100644 --- a/src/libs/Together/Generated/Together.DeploymentsVolumes.JsonSerializerContext.g.cs +++ b/src/libs/Together/Generated/Together.DeploymentsVolumes.JsonSerializerContext.g.cs @@ -2,51 +2,7 @@ #nullable enable namespace Together -{ - /// - /// - /// - [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( - DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull - )] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(object))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(long))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateVolumeRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.VolumeContentRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.VolumeType), TypeInfoPropertyName = "VolumeType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ListVolumesResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.VolumeResponseItem))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.VolumeContent))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.VolumeStatus), TypeInfoPropertyName = "VolumeStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.VersionHistoryItem))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.VolumeOrigin))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.VolumeContentRequestType), TypeInfoPropertyName = "VolumeContentRequestType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FileInfo))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.VolumeContentType), TypeInfoPropertyName = "VolumeContentType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.S3Origin))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(long?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.VolumeType?), TypeInfoPropertyName = "NullableVolumeType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.VolumeStatus?), TypeInfoPropertyName = "NullableVolumeStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.VolumeContentRequestType?), TypeInfoPropertyName = "NullableVolumeContentRequestType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.VolumeContentType?), TypeInfoPropertyName = "NullableVolumeContentType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - internal sealed partial class DeploymentsVolumesSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext - { - } - /// +{ /// /// /// public sealed partial class DeploymentsVolumesSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext @@ -90,26 +46,7 @@ private DeploymentsVolumesSourceGenerationContext(global::System.Text.Json.JsonS [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) { - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter, global::System.Collections.Generic.IList>()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter>()); - options.Converters.Add(new global::Together.JsonConverters.UnixTimestampJsonConverter()); - options.Converters.Add(new LazyEnumJsonConverterFactory()); + global::Together.SourceGenerationContext.AddConverters(options); } private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() @@ -124,76 +61,6 @@ public static void AddConverters(global::System.Text.Json.JsonSerializerOptions return options; } - - private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Serialization.JsonConverterFactory - { - public override bool CanConvert(global::System.Type typeToConvert) - { - return - typeToConvert == typeof(global::Together.VolumeContentRequestType) - - || typeToConvert == typeof(global::Together.VolumeContentRequestType?) - - || typeToConvert == typeof(global::Together.VolumeContentType) - - || typeToConvert == typeof(global::Together.VolumeContentType?) - - || typeToConvert == typeof(global::Together.VolumeStatus) - - || typeToConvert == typeof(global::Together.VolumeStatus?) - - || typeToConvert == typeof(global::Together.VolumeType) - - || typeToConvert == typeof(global::Together.VolumeType?); - } - - public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - if (typeToConvert == typeof(global::Together.VolumeContentRequestType)) - { - return new global::Together.JsonConverters.VolumeContentRequestTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.VolumeContentRequestType?)) - { - return new global::Together.JsonConverters.VolumeContentRequestTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.VolumeContentType)) - { - return new global::Together.JsonConverters.VolumeContentTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.VolumeContentType?)) - { - return new global::Together.JsonConverters.VolumeContentTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.VolumeStatus)) - { - return new global::Together.JsonConverters.VolumeStatusJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.VolumeStatus?)) - { - return new global::Together.JsonConverters.VolumeStatusNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.VolumeType)) - { - return new global::Together.JsonConverters.VolumeTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.VolumeType?)) - { - return new global::Together.JsonConverters.VolumeTypeNullableJsonConverter(); - } - throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); - } - } - private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver { private readonly object _gate = new(); @@ -233,7 +100,7 @@ private sealed class LazyChunkResolver : global::System.Text.Json.Serialization. { return index switch { - 0 => new DeploymentsVolumesSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), + 0 => global::Together.SourceGenerationContext.TypeInfoResolver, _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), }; } diff --git a/src/libs/Together/Generated/Together.DeploymentsVolumesClient.CreateDeploymentsStorageVolumes.g.cs b/src/libs/Together/Generated/Together.DeploymentsVolumesClient.CreateDeploymentsStorageVolumes.g.cs index 35ed0d4f..ac24acb8 100644 --- a/src/libs/Together/Generated/Together.DeploymentsVolumesClient.CreateDeploymentsStorageVolumes.g.cs +++ b/src/libs/Together/Generated/Together.DeploymentsVolumesClient.CreateDeploymentsStorageVolumes.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class DeploymentsVolumesClient { + private static readonly global::Together.AutoSDKServer[] s_CreateDeploymentsStorageVolumesServers = 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_CreateDeploymentsStorageVolumesSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -49,6 +62,18 @@ partial void ProcessCreateDeploymentsStorageVolumesResponseContent( /// 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()
+ /// # Files uploaded under source_prefix are loaded into the volume.
+ /// # `tg beta jig volumes create` uploads them and creates the volume for you.
+ /// volume = client.beta.jig.volumes.create(
+ /// name="my-volume",
+ /// type="readOnly",
+ /// content={"type": "files", "source_prefix": "my-volume/0"},
+ /// )
+ /// print(volume.id) + ///
public async global::System.Threading.Tasks.Task CreateDeploymentsStorageVolumesAsync( global::Together.CreateVolumeRequest request, @@ -72,6 +97,18 @@ partial void ProcessCreateDeploymentsStorageVolumesResponseContent( /// 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()
+ /// # Files uploaded under source_prefix are loaded into the volume.
+ /// # `tg beta jig volumes create` uploads them and creates the volume for you.
+ /// volume = client.beta.jig.volumes.create(
+ /// name="my-volume",
+ /// type="readOnly",
+ /// content={"type": "files", "source_prefix": "my-volume/0"},
+ /// )
+ /// print(volume.id) + ///
public async global::System.Threading.Tasks.Task> CreateDeploymentsStorageVolumesAsResponseAsync( global::Together.CreateVolumeRequest request, @@ -110,8 +147,10 @@ partial void ProcessCreateDeploymentsStorageVolumesResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: "/v1/deployments/storage/volumes", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: "/deployments/storage/volumes", + baseUri: ResolveBaseUri( + servers: s_CreateDeploymentsStorageVolumesServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -177,7 +216,7 @@ partial void ProcessCreateDeploymentsStorageVolumesResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "createDeploymentsStorageVolumes", methodName: "CreateDeploymentsStorageVolumesAsync", - pathTemplate: "\"/v1/deployments/storage/volumes\"", + pathTemplate: "\"/deployments/storage/volumes\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -211,7 +250,7 @@ partial void ProcessCreateDeploymentsStorageVolumesResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "createDeploymentsStorageVolumes", methodName: "CreateDeploymentsStorageVolumesAsync", - pathTemplate: "\"/v1/deployments/storage/volumes\"", + pathTemplate: "\"/deployments/storage/volumes\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -252,7 +291,7 @@ partial void ProcessCreateDeploymentsStorageVolumesResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "createDeploymentsStorageVolumes", methodName: "CreateDeploymentsStorageVolumesAsync", - pathTemplate: "\"/v1/deployments/storage/volumes\"", + pathTemplate: "\"/deployments/storage/volumes\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -300,7 +339,7 @@ partial void ProcessCreateDeploymentsStorageVolumesResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "createDeploymentsStorageVolumes", methodName: "CreateDeploymentsStorageVolumesAsync", - pathTemplate: "\"/v1/deployments/storage/volumes\"", + pathTemplate: "\"/deployments/storage/volumes\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -322,7 +361,7 @@ partial void ProcessCreateDeploymentsStorageVolumesResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "createDeploymentsStorageVolumes", methodName: "CreateDeploymentsStorageVolumesAsync", - pathTemplate: "\"/v1/deployments/storage/volumes\"", + pathTemplate: "\"/deployments/storage/volumes\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.DeploymentsVolumesClient.GetDeploymentsStorageVolumes.g.cs b/src/libs/Together/Generated/Together.DeploymentsVolumesClient.GetDeploymentsStorageVolumes.g.cs index 028f28d8..c2f6d230 100644 --- a/src/libs/Together/Generated/Together.DeploymentsVolumesClient.GetDeploymentsStorageVolumes.g.cs +++ b/src/libs/Together/Generated/Together.DeploymentsVolumesClient.GetDeploymentsStorageVolumes.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class DeploymentsVolumesClient { + private static readonly global::Together.AutoSDKServer[] s_GetDeploymentsStorageVolumesServers = 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_GetDeploymentsStorageVolumesSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -46,6 +59,12 @@ partial void ProcessGetDeploymentsStorageVolumesResponseContent( /// 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()
+ /// volumes = client.beta.jig.volumes.list()
+ /// print(volumes) + ///
public async global::System.Threading.Tasks.Task GetDeploymentsStorageVolumesAsync( global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -64,6 +83,12 @@ partial void ProcessGetDeploymentsStorageVolumesResponseContent( /// 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()
+ /// volumes = client.beta.jig.volumes.list()
+ /// print(volumes) + ///
public async global::System.Threading.Tasks.Task> GetDeploymentsStorageVolumesAsResponseAsync( global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -97,8 +122,10 @@ partial void ProcessGetDeploymentsStorageVolumesResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: "/v1/deployments/storage/volumes", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: "/deployments/storage/volumes", + baseUri: ResolveBaseUri( + servers: s_GetDeploymentsStorageVolumesServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -157,7 +184,7 @@ partial void ProcessGetDeploymentsStorageVolumesResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getDeploymentsStorageVolumes", methodName: "GetDeploymentsStorageVolumesAsync", - pathTemplate: "\"/v1/deployments/storage/volumes\"", + pathTemplate: "\"/deployments/storage/volumes\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -191,7 +218,7 @@ partial void ProcessGetDeploymentsStorageVolumesResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getDeploymentsStorageVolumes", methodName: "GetDeploymentsStorageVolumesAsync", - pathTemplate: "\"/v1/deployments/storage/volumes\"", + pathTemplate: "\"/deployments/storage/volumes\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -232,7 +259,7 @@ partial void ProcessGetDeploymentsStorageVolumesResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getDeploymentsStorageVolumes", methodName: "GetDeploymentsStorageVolumesAsync", - pathTemplate: "\"/v1/deployments/storage/volumes\"", + pathTemplate: "\"/deployments/storage/volumes\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -280,7 +307,7 @@ partial void ProcessGetDeploymentsStorageVolumesResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getDeploymentsStorageVolumes", methodName: "GetDeploymentsStorageVolumesAsync", - pathTemplate: "\"/v1/deployments/storage/volumes\"", + pathTemplate: "\"/deployments/storage/volumes\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -302,7 +329,7 @@ partial void ProcessGetDeploymentsStorageVolumesResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getDeploymentsStorageVolumes", methodName: "GetDeploymentsStorageVolumesAsync", - pathTemplate: "\"/v1/deployments/storage/volumes\"", + pathTemplate: "\"/deployments/storage/volumes\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.DeploymentsVolumesClient.g.cs b/src/libs/Together/Generated/Together.DeploymentsVolumesClient.g.cs index 4c13a3a0..00cf0704 100644 --- a/src/libs/Together/Generated/Together.DeploymentsVolumesClient.g.cs +++ b/src/libs/Together/Generated/Together.DeploymentsVolumesClient.g.cs @@ -12,7 +12,7 @@ public sealed partial class DeploymentsVolumesClient : global::Together.IDeploym /// /// Default environment for APIs /// - public const string DefaultBaseUrl = "https://api.together.ai/"; + public const string DefaultBaseUrl = "https://api.together.ai/v1"; private bool _disposeHttpClient = true; @@ -20,7 +20,7 @@ public sealed partial class DeploymentsVolumesClient : global::Together.IDeploym 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; } @@ -53,6 +53,34 @@ public sealed partial class DeploymentsVolumesClient : global::Together.IDeploym } + + 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 DeploymentsVolumesClient. /// If no httpClient is provided, a new one will be created. @@ -151,5 +179,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.Embeddings.JsonSerializerContext.g.cs b/src/libs/Together/Generated/Together.Embeddings.JsonSerializerContext.g.cs index b8db3118..118bf66b 100644 --- a/src/libs/Together/Generated/Together.Embeddings.JsonSerializerContext.g.cs +++ b/src/libs/Together/Generated/Together.Embeddings.JsonSerializerContext.g.cs @@ -2,44 +2,7 @@ #nullable enable namespace Together -{ - /// - /// - /// - [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( - DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull - )] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(double))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ErrorData))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ErrorDataError))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.EmbeddingsRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AnyOf), TypeInfoPropertyName = "AnyOfEmbeddingsRequestModelString2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.EmbeddingsRequestModel), TypeInfoPropertyName = "EmbeddingsRequestModel2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf>), TypeInfoPropertyName = "OneOfStringIListString2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.EmbeddingsResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.EmbeddingsResponseDataItem))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(double?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AnyOf?), TypeInfoPropertyName = "NullableAnyOfEmbeddingsRequestModelString2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.EmbeddingsRequestModel?), TypeInfoPropertyName = "NullableEmbeddingsRequestModel2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf>?), TypeInfoPropertyName = "NullableOneOfStringIListString2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf>))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - internal sealed partial class EmbeddingsSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext - { - } - /// +{ /// /// /// public sealed partial class EmbeddingsSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext @@ -83,27 +46,7 @@ private EmbeddingsSourceGenerationContext(global::System.Text.Json.JsonSerialize [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) { - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter, global::System.Collections.Generic.IList>()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.AnyOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter>()); - options.Converters.Add(new global::Together.JsonConverters.UnixTimestampJsonConverter()); - options.Converters.Add(new LazyEnumJsonConverterFactory()); + global::Together.SourceGenerationContext.AddConverters(options); } private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() @@ -118,34 +61,6 @@ public static void AddConverters(global::System.Text.Json.JsonSerializerOptions return options; } - - private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Serialization.JsonConverterFactory - { - public override bool CanConvert(global::System.Type typeToConvert) - { - return - typeToConvert == typeof(global::Together.EmbeddingsRequestModel) - - || typeToConvert == typeof(global::Together.EmbeddingsRequestModel?); - } - - public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - if (typeToConvert == typeof(global::Together.EmbeddingsRequestModel)) - { - return new global::Together.JsonConverters.EmbeddingsRequestModelJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.EmbeddingsRequestModel?)) - { - return new global::Together.JsonConverters.EmbeddingsRequestModelNullableJsonConverter(); - } - throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); - } - } - private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver { private readonly object _gate = new(); @@ -185,7 +100,7 @@ private sealed class LazyChunkResolver : global::System.Text.Json.Serialization. { return index switch { - 0 => new EmbeddingsSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), + 0 => global::Together.SourceGenerationContext.TypeInfoResolver, _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), }; } diff --git a/src/libs/Together/Generated/Together.EmbeddingsClient.Embeddings.g.cs b/src/libs/Together/Generated/Together.EmbeddingsClient.Embeddings.g.cs index ca6d86a0..2b2aad84 100644 --- a/src/libs/Together/Generated/Together.EmbeddingsClient.Embeddings.g.cs +++ b/src/libs/Together/Generated/Together.EmbeddingsClient.Embeddings.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class EmbeddingsClient { + private static readonly global::Together.AutoSDKServer[] s_EmbeddingsServers = 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_EmbeddingsSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -49,6 +62,18 @@ partial void ProcessEmbeddingsResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.embeddings.create(
+ /// model="BAAI/bge-large-en-v1.5",
+ /// input="New York City",
+ /// )
+ /// print(response.data[0].embedding) + ///
public async global::System.Threading.Tasks.Task EmbeddingsAsync( global::Together.EmbeddingsRequest request, @@ -72,6 +97,18 @@ partial void ProcessEmbeddingsResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.embeddings.create(
+ /// model="BAAI/bge-large-en-v1.5",
+ /// input="New York City",
+ /// )
+ /// print(response.data[0].embedding) + ///
public async global::System.Threading.Tasks.Task> EmbeddingsAsResponseAsync( global::Together.EmbeddingsRequest request, @@ -110,8 +147,10 @@ partial void ProcessEmbeddingsResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: "/v1/embeddings", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: "/embeddings", + baseUri: ResolveBaseUri( + servers: s_EmbeddingsServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -177,7 +216,7 @@ partial void ProcessEmbeddingsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "Embeddings", methodName: "EmbeddingsAsync", - pathTemplate: "\"/v1/embeddings\"", + pathTemplate: "\"/embeddings\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -211,7 +250,7 @@ partial void ProcessEmbeddingsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "Embeddings", methodName: "EmbeddingsAsync", - pathTemplate: "\"/v1/embeddings\"", + pathTemplate: "\"/embeddings\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -252,7 +291,7 @@ partial void ProcessEmbeddingsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "Embeddings", methodName: "EmbeddingsAsync", - pathTemplate: "\"/v1/embeddings\"", + pathTemplate: "\"/embeddings\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -300,7 +339,7 @@ partial void ProcessEmbeddingsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "Embeddings", methodName: "EmbeddingsAsync", - pathTemplate: "\"/v1/embeddings\"", + pathTemplate: "\"/embeddings\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -322,7 +361,7 @@ partial void ProcessEmbeddingsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "Embeddings", methodName: "EmbeddingsAsync", - pathTemplate: "\"/v1/embeddings\"", + pathTemplate: "\"/embeddings\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.EmbeddingsClient.g.cs b/src/libs/Together/Generated/Together.EmbeddingsClient.g.cs index 8a6ff4f9..d24d47a4 100644 --- a/src/libs/Together/Generated/Together.EmbeddingsClient.g.cs +++ b/src/libs/Together/Generated/Together.EmbeddingsClient.g.cs @@ -12,7 +12,7 @@ public sealed partial class EmbeddingsClient : global::Together.IEmbeddingsClien /// /// Default environment for APIs /// - public const string DefaultBaseUrl = "https://api.together.ai/"; + public const string DefaultBaseUrl = "https://api.together.ai/v1"; private bool _disposeHttpClient = true; @@ -20,7 +20,7 @@ public sealed partial class EmbeddingsClient : global::Together.IEmbeddingsClien 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; } @@ -53,6 +53,34 @@ public sealed partial class EmbeddingsClient : global::Together.IEmbeddingsClien } + + 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 EmbeddingsClient. /// If no httpClient is provided, a new one will be created. @@ -151,5 +179,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.EndpointService.JsonSerializerContext.g.cs b/src/libs/Together/Generated/Together.EndpointService.JsonSerializerContext.g.cs index d584fd2d..3b31043e 100644 --- a/src/libs/Together/Generated/Together.EndpointService.JsonSerializerContext.g.cs +++ b/src/libs/Together/Generated/Together.EndpointService.JsonSerializerContext.g.cs @@ -2,115 +2,7 @@ #nullable enable namespace Together -{ - /// - /// - /// - [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( - DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull - )] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeListPublicEndpointsResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DePublicEndpoint))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeListEndpointsResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeEndpoint))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeTrafficSplitEntry))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeEndpointVisibility), TypeInfoPropertyName = "DeEndpointVisibility2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeEndpointEndpointType), TypeInfoPropertyName = "DeEndpointEndpointType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeDeploymentSummary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeDeploymentSummaryTrafficMode), TypeInfoPropertyName = "DeDeploymentSummaryTrafficMode2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeDeploymentSummaryState), TypeInfoPropertyName = "DeDeploymentSummaryState2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeAutoscalingResponse), TypeInfoPropertyName = "DeAutoscalingResponse2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(double))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeCreateEndpointRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeCreateEndpointRequestVisibility), TypeInfoPropertyName = "DeCreateEndpointRequestVisibility2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeEndpointUpdate))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeEndpointUpdateVisibility), TypeInfoPropertyName = "DeEndpointUpdateVisibility2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeAutoscaling))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeDeleteResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(object))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeListEndpointEventsResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeEndpointEvent))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeAnalyticsData))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeMetricsTimeRange))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeEndpointMetrics))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeTimeSeriesDataPoint))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeDeploymentAnalyticsData))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeScalingMetric))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeScalingRules))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeEndpointEventLevel), TypeInfoPropertyName = "DeEndpointEventLevel2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeEndpointEventSourceKind), TypeInfoPropertyName = "DeEndpointEventSourceKind2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeDeploymentMetrics))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeRequestMetrics))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeLatencyMetrics))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeThroughputMetrics))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeErrorMetrics))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeResourceUtilization))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeTokenMetrics))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeScalingPolicy))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeScalingPolicyType), TypeInfoPropertyName = "DeScalingPolicyType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeScalingRulesSelectPolicy), TypeInfoPropertyName = "DeScalingRulesSelectPolicy2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeScalingMetricName), TypeInfoPropertyName = "DeScalingMetricName2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeScalingMetricType), TypeInfoPropertyName = "DeScalingMetricType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ErrorData))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ErrorDataError))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.EndpointServiceListEndpointEventsMinLevel), TypeInfoPropertyName = "EndpointServiceListEndpointEventsMinLevel2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.EndpointServiceListEndpointEventsSourceKind), TypeInfoPropertyName = "EndpointServiceListEndpointEventsSourceKind2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeEndpointVisibility?), TypeInfoPropertyName = "NullableDeEndpointVisibility2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeEndpointEndpointType?), TypeInfoPropertyName = "NullableDeEndpointEndpointType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeDeploymentSummaryTrafficMode?), TypeInfoPropertyName = "NullableDeDeploymentSummaryTrafficMode2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeDeploymentSummaryState?), TypeInfoPropertyName = "NullableDeDeploymentSummaryState2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeAutoscalingResponse?), TypeInfoPropertyName = "NullableDeAutoscalingResponse2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(double?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeCreateEndpointRequestVisibility?), TypeInfoPropertyName = "NullableDeCreateEndpointRequestVisibility2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeEndpointUpdateVisibility?), TypeInfoPropertyName = "NullableDeEndpointUpdateVisibility2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeEndpointEventLevel?), TypeInfoPropertyName = "NullableDeEndpointEventLevel2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeEndpointEventSourceKind?), TypeInfoPropertyName = "NullableDeEndpointEventSourceKind2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeScalingPolicyType?), TypeInfoPropertyName = "NullableDeScalingPolicyType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeScalingRulesSelectPolicy?), TypeInfoPropertyName = "NullableDeScalingRulesSelectPolicy2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeScalingMetricName?), TypeInfoPropertyName = "NullableDeScalingMetricName2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeScalingMetricType?), TypeInfoPropertyName = "NullableDeScalingMetricType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.EndpointServiceListEndpointEventsMinLevel?), TypeInfoPropertyName = "NullableEndpointServiceListEndpointEventsMinLevel2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.EndpointServiceListEndpointEventsSourceKind?), TypeInfoPropertyName = "NullableEndpointServiceListEndpointEventsSourceKind2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - internal sealed partial class EndpointServiceSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext - { - } - /// +{ /// /// /// public sealed partial class EndpointServiceSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext @@ -154,27 +46,7 @@ private EndpointServiceSourceGenerationContext(global::System.Text.Json.JsonSeri [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) { - options.Converters.Add(new global::Together.JsonConverters.DeAutoscalingResponseJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter, global::System.Collections.Generic.IList>()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter>()); - options.Converters.Add(new global::Together.JsonConverters.UnixTimestampJsonConverter()); - options.Converters.Add(new LazyEnumJsonConverterFactory()); + global::Together.SourceGenerationContext.AddConverters(options); } private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() @@ -189,216 +61,6 @@ public static void AddConverters(global::System.Text.Json.JsonSerializerOptions return options; } - - private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Serialization.JsonConverterFactory - { - public override bool CanConvert(global::System.Type typeToConvert) - { - return - typeToConvert == typeof(global::Together.DeEndpointVisibility) - - || typeToConvert == typeof(global::Together.DeEndpointVisibility?) - - || typeToConvert == typeof(global::Together.DeEndpointEndpointType) - - || typeToConvert == typeof(global::Together.DeEndpointEndpointType?) - - || typeToConvert == typeof(global::Together.DeDeploymentSummaryTrafficMode) - - || typeToConvert == typeof(global::Together.DeDeploymentSummaryTrafficMode?) - - || typeToConvert == typeof(global::Together.DeDeploymentSummaryState) - - || typeToConvert == typeof(global::Together.DeDeploymentSummaryState?) - - || typeToConvert == typeof(global::Together.DeCreateEndpointRequestVisibility) - - || typeToConvert == typeof(global::Together.DeCreateEndpointRequestVisibility?) - - || typeToConvert == typeof(global::Together.DeEndpointUpdateVisibility) - - || typeToConvert == typeof(global::Together.DeEndpointUpdateVisibility?) - - || typeToConvert == typeof(global::Together.DeEndpointEventLevel) - - || typeToConvert == typeof(global::Together.DeEndpointEventLevel?) - - || typeToConvert == typeof(global::Together.DeEndpointEventSourceKind) - - || typeToConvert == typeof(global::Together.DeEndpointEventSourceKind?) - - || typeToConvert == typeof(global::Together.DeScalingPolicyType) - - || typeToConvert == typeof(global::Together.DeScalingPolicyType?) - - || typeToConvert == typeof(global::Together.DeScalingRulesSelectPolicy) - - || typeToConvert == typeof(global::Together.DeScalingRulesSelectPolicy?) - - || typeToConvert == typeof(global::Together.DeScalingMetricName) - - || typeToConvert == typeof(global::Together.DeScalingMetricName?) - - || typeToConvert == typeof(global::Together.DeScalingMetricType) - - || typeToConvert == typeof(global::Together.DeScalingMetricType?) - - || typeToConvert == typeof(global::Together.EndpointServiceListEndpointEventsMinLevel) - - || typeToConvert == typeof(global::Together.EndpointServiceListEndpointEventsMinLevel?) - - || typeToConvert == typeof(global::Together.EndpointServiceListEndpointEventsSourceKind) - - || typeToConvert == typeof(global::Together.EndpointServiceListEndpointEventsSourceKind?); - } - - public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - if (typeToConvert == typeof(global::Together.DeEndpointVisibility)) - { - return new global::Together.JsonConverters.DeEndpointVisibilityJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeEndpointVisibility?)) - { - return new global::Together.JsonConverters.DeEndpointVisibilityNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeEndpointEndpointType)) - { - return new global::Together.JsonConverters.DeEndpointEndpointTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeEndpointEndpointType?)) - { - return new global::Together.JsonConverters.DeEndpointEndpointTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeDeploymentSummaryTrafficMode)) - { - return new global::Together.JsonConverters.DeDeploymentSummaryTrafficModeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeDeploymentSummaryTrafficMode?)) - { - return new global::Together.JsonConverters.DeDeploymentSummaryTrafficModeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeDeploymentSummaryState)) - { - return new global::Together.JsonConverters.DeDeploymentSummaryStateJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeDeploymentSummaryState?)) - { - return new global::Together.JsonConverters.DeDeploymentSummaryStateNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeCreateEndpointRequestVisibility)) - { - return new global::Together.JsonConverters.DeCreateEndpointRequestVisibilityJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeCreateEndpointRequestVisibility?)) - { - return new global::Together.JsonConverters.DeCreateEndpointRequestVisibilityNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeEndpointUpdateVisibility)) - { - return new global::Together.JsonConverters.DeEndpointUpdateVisibilityJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeEndpointUpdateVisibility?)) - { - return new global::Together.JsonConverters.DeEndpointUpdateVisibilityNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeEndpointEventLevel)) - { - return new global::Together.JsonConverters.DeEndpointEventLevelJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeEndpointEventLevel?)) - { - return new global::Together.JsonConverters.DeEndpointEventLevelNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeEndpointEventSourceKind)) - { - return new global::Together.JsonConverters.DeEndpointEventSourceKindJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeEndpointEventSourceKind?)) - { - return new global::Together.JsonConverters.DeEndpointEventSourceKindNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeScalingPolicyType)) - { - return new global::Together.JsonConverters.DeScalingPolicyTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeScalingPolicyType?)) - { - return new global::Together.JsonConverters.DeScalingPolicyTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeScalingRulesSelectPolicy)) - { - return new global::Together.JsonConverters.DeScalingRulesSelectPolicyJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeScalingRulesSelectPolicy?)) - { - return new global::Together.JsonConverters.DeScalingRulesSelectPolicyNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeScalingMetricName)) - { - return new global::Together.JsonConverters.DeScalingMetricNameJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeScalingMetricName?)) - { - return new global::Together.JsonConverters.DeScalingMetricNameNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeScalingMetricType)) - { - return new global::Together.JsonConverters.DeScalingMetricTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeScalingMetricType?)) - { - return new global::Together.JsonConverters.DeScalingMetricTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.EndpointServiceListEndpointEventsMinLevel)) - { - return new global::Together.JsonConverters.EndpointServiceListEndpointEventsMinLevelJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.EndpointServiceListEndpointEventsMinLevel?)) - { - return new global::Together.JsonConverters.EndpointServiceListEndpointEventsMinLevelNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.EndpointServiceListEndpointEventsSourceKind)) - { - return new global::Together.JsonConverters.EndpointServiceListEndpointEventsSourceKindJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.EndpointServiceListEndpointEventsSourceKind?)) - { - return new global::Together.JsonConverters.EndpointServiceListEndpointEventsSourceKindNullableJsonConverter(); - } - throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); - } - } - private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver { private readonly object _gate = new(); @@ -438,7 +100,7 @@ private sealed class LazyChunkResolver : global::System.Text.Json.Serialization. { return index switch { - 0 => new EndpointServiceSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), + 0 => global::Together.SourceGenerationContext.TypeInfoResolver, _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), }; } diff --git a/src/libs/Together/Generated/Together.EndpointServiceClient.EndpointServiceCreateEndpoint.g.cs b/src/libs/Together/Generated/Together.EndpointServiceClient.EndpointServiceCreateEndpoint.g.cs index d1e503d7..d312ac41 100644 --- a/src/libs/Together/Generated/Together.EndpointServiceClient.EndpointServiceCreateEndpoint.g.cs +++ b/src/libs/Together/Generated/Together.EndpointServiceClient.EndpointServiceCreateEndpoint.g.cs @@ -6,6 +6,14 @@ namespace Together public partial class EndpointServiceClient { + private static readonly global::Together.AutoSDKServer[] s_EndpointServiceCreateEndpointServers = 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_EndpointServiceCreateEndpointSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -54,6 +62,16 @@ partial void ProcessEndpointServiceCreateEndpointResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// endpoint = client.beta.endpoints.create(
+ /// project_id=project_id,
+ /// name="my-endpoint",
+ /// )
+ /// print(endpoint.id, endpoint.name) + ///
public async global::System.Threading.Tasks.Task EndpointServiceCreateEndpointAsync( string projectId, @@ -82,6 +100,16 @@ partial void ProcessEndpointServiceCreateEndpointResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// endpoint = client.beta.endpoints.create(
+ /// project_id=project_id,
+ /// name="my-endpoint",
+ /// )
+ /// print(endpoint.id, endpoint.name) + ///
public async global::System.Threading.Tasks.Task> EndpointServiceCreateEndpointAsResponseAsync( string projectId, @@ -122,8 +150,10 @@ partial void ProcessEndpointServiceCreateEndpointResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v2/projects/{projectId}/endpoints", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/projects/{projectId}/endpoints", + baseUri: ResolveBaseUri( + servers: s_EndpointServiceCreateEndpointServers, + defaultBaseUrl: "https://api.together.ai/v2")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -190,7 +220,7 @@ partial void ProcessEndpointServiceCreateEndpointResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "EndpointServiceCreateEndpoint", methodName: "EndpointServiceCreateEndpointAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints\"", + pathTemplate: "$\"/projects/{projectId}/endpoints\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -224,7 +254,7 @@ partial void ProcessEndpointServiceCreateEndpointResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "EndpointServiceCreateEndpoint", methodName: "EndpointServiceCreateEndpointAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints\"", + pathTemplate: "$\"/projects/{projectId}/endpoints\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -265,7 +295,7 @@ partial void ProcessEndpointServiceCreateEndpointResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "EndpointServiceCreateEndpoint", methodName: "EndpointServiceCreateEndpointAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints\"", + pathTemplate: "$\"/projects/{projectId}/endpoints\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -313,7 +343,7 @@ partial void ProcessEndpointServiceCreateEndpointResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "EndpointServiceCreateEndpoint", methodName: "EndpointServiceCreateEndpointAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints\"", + pathTemplate: "$\"/projects/{projectId}/endpoints\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -335,7 +365,7 @@ partial void ProcessEndpointServiceCreateEndpointResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "EndpointServiceCreateEndpoint", methodName: "EndpointServiceCreateEndpointAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints\"", + pathTemplate: "$\"/projects/{projectId}/endpoints\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.EndpointServiceClient.EndpointServiceDeleteEndpoint.g.cs b/src/libs/Together/Generated/Together.EndpointServiceClient.EndpointServiceDeleteEndpoint.g.cs index 3ddbd2e2..a1e55919 100644 --- a/src/libs/Together/Generated/Together.EndpointServiceClient.EndpointServiceDeleteEndpoint.g.cs +++ b/src/libs/Together/Generated/Together.EndpointServiceClient.EndpointServiceDeleteEndpoint.g.cs @@ -6,6 +6,14 @@ namespace Together public partial class EndpointServiceClient { + private static readonly global::Together.AutoSDKServer[] s_EndpointServiceDeleteEndpointServers = 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_EndpointServiceDeleteEndpointSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -61,6 +69,12 @@ partial void ProcessEndpointServiceDeleteEndpointResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// client.beta.endpoints.delete("ep_abc123", project_id=project_id) + ///
public async global::System.Threading.Tasks.Task EndpointServiceDeleteEndpointAsync( string projectId, string id, @@ -94,6 +108,12 @@ partial void ProcessEndpointServiceDeleteEndpointResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// client.beta.endpoints.delete("ep_abc123", project_id=project_id) + ///
public async global::System.Threading.Tasks.Task> EndpointServiceDeleteEndpointAsResponseAsync( string projectId, string id, @@ -133,8 +153,10 @@ partial void ProcessEndpointServiceDeleteEndpointResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v2/projects/{projectId}/endpoints/{id}", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/projects/{projectId}/endpoints/{id}", + baseUri: ResolveBaseUri( + servers: s_EndpointServiceDeleteEndpointServers, + defaultBaseUrl: "https://api.together.ai/v2")); __pathBuilder .AddOptionalParameter("etag", etag) ; @@ -199,7 +221,7 @@ partial void ProcessEndpointServiceDeleteEndpointResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "EndpointServiceDeleteEndpoint", methodName: "EndpointServiceDeleteEndpointAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{id}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -233,7 +255,7 @@ partial void ProcessEndpointServiceDeleteEndpointResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "EndpointServiceDeleteEndpoint", methodName: "EndpointServiceDeleteEndpointAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{id}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -274,7 +296,7 @@ partial void ProcessEndpointServiceDeleteEndpointResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "EndpointServiceDeleteEndpoint", methodName: "EndpointServiceDeleteEndpointAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{id}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -322,7 +344,7 @@ partial void ProcessEndpointServiceDeleteEndpointResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "EndpointServiceDeleteEndpoint", methodName: "EndpointServiceDeleteEndpointAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{id}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -344,7 +366,7 @@ partial void ProcessEndpointServiceDeleteEndpointResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "EndpointServiceDeleteEndpoint", methodName: "EndpointServiceDeleteEndpointAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{id}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.EndpointServiceClient.EndpointServiceGetEndpoint.g.cs b/src/libs/Together/Generated/Together.EndpointServiceClient.EndpointServiceGetEndpoint.g.cs index c628f2e2..dade8804 100644 --- a/src/libs/Together/Generated/Together.EndpointServiceClient.EndpointServiceGetEndpoint.g.cs +++ b/src/libs/Together/Generated/Together.EndpointServiceClient.EndpointServiceGetEndpoint.g.cs @@ -6,6 +6,14 @@ namespace Together public partial class EndpointServiceClient { + private static readonly global::Together.AutoSDKServer[] s_EndpointServiceGetEndpointServers = 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_EndpointServiceGetEndpointSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -56,6 +64,16 @@ partial void ProcessEndpointServiceGetEndpointResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// endpoint = client.beta.endpoints.retrieve(
+ /// "ep_abc123",
+ /// project_id=project_id,
+ /// )
+ /// print(endpoint.name, endpoint.traffic_split) + ///
public async global::System.Threading.Tasks.Task EndpointServiceGetEndpointAsync( string projectId, string id, @@ -84,6 +102,16 @@ partial void ProcessEndpointServiceGetEndpointResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// endpoint = client.beta.endpoints.retrieve(
+ /// "ep_abc123",
+ /// project_id=project_id,
+ /// )
+ /// print(endpoint.name, endpoint.traffic_split) + ///
public async global::System.Threading.Tasks.Task> EndpointServiceGetEndpointAsResponseAsync( string projectId, string id, @@ -121,8 +149,10 @@ partial void ProcessEndpointServiceGetEndpointResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v2/projects/{projectId}/endpoints/{id}", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/projects/{projectId}/endpoints/{id}", + baseUri: ResolveBaseUri( + servers: s_EndpointServiceGetEndpointServers, + defaultBaseUrl: "https://api.together.ai/v2")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -183,7 +213,7 @@ partial void ProcessEndpointServiceGetEndpointResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "EndpointServiceGetEndpoint", methodName: "EndpointServiceGetEndpointAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -217,7 +247,7 @@ partial void ProcessEndpointServiceGetEndpointResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "EndpointServiceGetEndpoint", methodName: "EndpointServiceGetEndpointAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -258,7 +288,7 @@ partial void ProcessEndpointServiceGetEndpointResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "EndpointServiceGetEndpoint", methodName: "EndpointServiceGetEndpointAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -306,7 +336,7 @@ partial void ProcessEndpointServiceGetEndpointResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "EndpointServiceGetEndpoint", methodName: "EndpointServiceGetEndpointAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -328,7 +358,7 @@ partial void ProcessEndpointServiceGetEndpointResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "EndpointServiceGetEndpoint", methodName: "EndpointServiceGetEndpointAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.EndpointServiceClient.EndpointServiceGetEndpointAnalytics.g.cs b/src/libs/Together/Generated/Together.EndpointServiceClient.EndpointServiceGetEndpointAnalytics.g.cs index 8f07f0c2..f13d615d 100644 --- a/src/libs/Together/Generated/Together.EndpointServiceClient.EndpointServiceGetEndpointAnalytics.g.cs +++ b/src/libs/Together/Generated/Together.EndpointServiceClient.EndpointServiceGetEndpointAnalytics.g.cs @@ -6,6 +6,14 @@ namespace Together public partial class EndpointServiceClient { + private static readonly global::Together.AutoSDKServer[] s_EndpointServiceGetEndpointAnalyticsServers = 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_EndpointServiceGetEndpointAnalyticsSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -81,6 +89,18 @@ partial void ProcessEndpointServiceGetEndpointAnalyticsResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// analytics = client.beta.endpoints.analytics(
+ /// "ep_abc123",
+ /// project_id=project_id,
+ /// start_time="2026-10-01T00:00:00Z",
+ /// end_time="2026-10-02T00:00:00Z",
+ /// )
+ /// print(analytics) + ///
public async global::System.Threading.Tasks.Task EndpointServiceGetEndpointAnalyticsAsync( string projectId, string id, @@ -134,6 +154,18 @@ partial void ProcessEndpointServiceGetEndpointAnalyticsResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// analytics = client.beta.endpoints.analytics(
+ /// "ep_abc123",
+ /// project_id=project_id,
+ /// start_time="2026-10-01T00:00:00Z",
+ /// end_time="2026-10-02T00:00:00Z",
+ /// )
+ /// print(analytics) + ///
public async global::System.Threading.Tasks.Task> EndpointServiceGetEndpointAnalyticsAsResponseAsync( string projectId, string id, @@ -181,8 +213,10 @@ partial void ProcessEndpointServiceGetEndpointAnalyticsResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v2/projects/{projectId}/endpoints/{id}/analytics", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/projects/{projectId}/endpoints/{id}/analytics", + baseUri: ResolveBaseUri( + servers: s_EndpointServiceGetEndpointAnalyticsServers, + defaultBaseUrl: "https://api.together.ai/v2")); __pathBuilder .AddOptionalParameter("deploymentId", deploymentId) .AddOptionalParameter("startTime", startTime?.ToString("yyyy-MM-ddTHH:mm:ssZ")) @@ -255,7 +289,7 @@ partial void ProcessEndpointServiceGetEndpointAnalyticsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "EndpointServiceGetEndpointAnalytics", methodName: "EndpointServiceGetEndpointAnalyticsAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{id}/analytics\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{id}/analytics\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -289,7 +323,7 @@ partial void ProcessEndpointServiceGetEndpointAnalyticsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "EndpointServiceGetEndpointAnalytics", methodName: "EndpointServiceGetEndpointAnalyticsAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{id}/analytics\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{id}/analytics\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -330,7 +364,7 @@ partial void ProcessEndpointServiceGetEndpointAnalyticsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "EndpointServiceGetEndpointAnalytics", methodName: "EndpointServiceGetEndpointAnalyticsAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{id}/analytics\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{id}/analytics\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -378,7 +412,7 @@ partial void ProcessEndpointServiceGetEndpointAnalyticsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "EndpointServiceGetEndpointAnalytics", methodName: "EndpointServiceGetEndpointAnalyticsAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{id}/analytics\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{id}/analytics\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -400,7 +434,7 @@ partial void ProcessEndpointServiceGetEndpointAnalyticsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "EndpointServiceGetEndpointAnalytics", methodName: "EndpointServiceGetEndpointAnalyticsAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{id}/analytics\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{id}/analytics\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.EndpointServiceClient.EndpointServiceListEndpointEvents.g.cs b/src/libs/Together/Generated/Together.EndpointServiceClient.EndpointServiceListEndpointEvents.g.cs index 57719ce1..4cc42727 100644 --- a/src/libs/Together/Generated/Together.EndpointServiceClient.EndpointServiceListEndpointEvents.g.cs +++ b/src/libs/Together/Generated/Together.EndpointServiceClient.EndpointServiceListEndpointEvents.g.cs @@ -6,6 +6,14 @@ namespace Together public partial class EndpointServiceClient { + private static readonly global::Together.AutoSDKServer[] s_EndpointServiceListEndpointEventsServers = 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_EndpointServiceListEndpointEventsSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -101,6 +109,18 @@ partial void ProcessEndpointServiceListEndpointEventsResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// events = client.beta.endpoints.list_events(
+ /// "ep_abc123",
+ /// project_id=project_id,
+ /// min_level="LEVEL_WARN",
+ /// )
+ /// for event in events:
+ /// print(event) + ///
public async global::System.Threading.Tasks.Task EndpointServiceListEndpointEventsAsync( string projectId, string id, @@ -174,6 +194,18 @@ partial void ProcessEndpointServiceListEndpointEventsResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// events = client.beta.endpoints.list_events(
+ /// "ep_abc123",
+ /// project_id=project_id,
+ /// min_level="LEVEL_WARN",
+ /// )
+ /// for event in events:
+ /// print(event) + ///
public async global::System.Threading.Tasks.Task> EndpointServiceListEndpointEventsAsResponseAsync( string projectId, string id, @@ -229,8 +261,10 @@ partial void ProcessEndpointServiceListEndpointEventsResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v2/projects/{projectId}/endpoints/{id}/events", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/projects/{projectId}/endpoints/{id}/events", + baseUri: ResolveBaseUri( + servers: s_EndpointServiceListEndpointEventsServers, + defaultBaseUrl: "https://api.together.ai/v2")); __pathBuilder .AddOptionalParameter("limit", limit?.ToString()) .AddOptionalParameter("after", after) @@ -311,7 +345,7 @@ partial void ProcessEndpointServiceListEndpointEventsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "EndpointServiceListEndpointEvents", methodName: "EndpointServiceListEndpointEventsAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{id}/events\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{id}/events\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -345,7 +379,7 @@ partial void ProcessEndpointServiceListEndpointEventsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "EndpointServiceListEndpointEvents", methodName: "EndpointServiceListEndpointEventsAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{id}/events\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{id}/events\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -386,7 +420,7 @@ partial void ProcessEndpointServiceListEndpointEventsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "EndpointServiceListEndpointEvents", methodName: "EndpointServiceListEndpointEventsAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{id}/events\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{id}/events\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -434,7 +468,7 @@ partial void ProcessEndpointServiceListEndpointEventsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "EndpointServiceListEndpointEvents", methodName: "EndpointServiceListEndpointEventsAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{id}/events\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{id}/events\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -456,7 +490,7 @@ partial void ProcessEndpointServiceListEndpointEventsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "EndpointServiceListEndpointEvents", methodName: "EndpointServiceListEndpointEventsAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{id}/events\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{id}/events\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.EndpointServiceClient.EndpointServiceListEndpoints.g.cs b/src/libs/Together/Generated/Together.EndpointServiceClient.EndpointServiceListEndpoints.g.cs index ca94c0d1..150bda23 100644 --- a/src/libs/Together/Generated/Together.EndpointServiceClient.EndpointServiceListEndpoints.g.cs +++ b/src/libs/Together/Generated/Together.EndpointServiceClient.EndpointServiceListEndpoints.g.cs @@ -6,6 +6,14 @@ namespace Together public partial class EndpointServiceClient { + private static readonly global::Together.AutoSDKServer[] s_EndpointServiceListEndpointsServers = 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_EndpointServiceListEndpointsSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -72,6 +80,13 @@ partial void ProcessEndpointServiceListEndpointsResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// for endpoint in client.beta.endpoints.list(project_id=project_id):
+ /// print(endpoint.id, endpoint.name) + ///
public async global::System.Threading.Tasks.Task EndpointServiceListEndpointsAsync( string projectId, int? limit = default, @@ -116,6 +131,13 @@ partial void ProcessEndpointServiceListEndpointsResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// for endpoint in client.beta.endpoints.list(project_id=project_id):
+ /// print(endpoint.id, endpoint.name) + ///
public async global::System.Threading.Tasks.Task> EndpointServiceListEndpointsAsResponseAsync( string projectId, int? limit = default, @@ -159,8 +181,10 @@ partial void ProcessEndpointServiceListEndpointsResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v2/projects/{projectId}/endpoints", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/projects/{projectId}/endpoints", + baseUri: ResolveBaseUri( + servers: s_EndpointServiceListEndpointsServers, + defaultBaseUrl: "https://api.together.ai/v2")); __pathBuilder .AddOptionalParameter("limit", limit?.ToString()) .AddOptionalParameter("after", after) @@ -230,7 +254,7 @@ partial void ProcessEndpointServiceListEndpointsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "EndpointServiceListEndpoints", methodName: "EndpointServiceListEndpointsAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints\"", + pathTemplate: "$\"/projects/{projectId}/endpoints\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -264,7 +288,7 @@ partial void ProcessEndpointServiceListEndpointsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "EndpointServiceListEndpoints", methodName: "EndpointServiceListEndpointsAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints\"", + pathTemplate: "$\"/projects/{projectId}/endpoints\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -305,7 +329,7 @@ partial void ProcessEndpointServiceListEndpointsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "EndpointServiceListEndpoints", methodName: "EndpointServiceListEndpointsAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints\"", + pathTemplate: "$\"/projects/{projectId}/endpoints\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -353,7 +377,7 @@ partial void ProcessEndpointServiceListEndpointsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "EndpointServiceListEndpoints", methodName: "EndpointServiceListEndpointsAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints\"", + pathTemplate: "$\"/projects/{projectId}/endpoints\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -375,7 +399,7 @@ partial void ProcessEndpointServiceListEndpointsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "EndpointServiceListEndpoints", methodName: "EndpointServiceListEndpointsAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints\"", + pathTemplate: "$\"/projects/{projectId}/endpoints\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.EndpointServiceClient.EndpointServiceListOrganizationEndpoints.g.cs b/src/libs/Together/Generated/Together.EndpointServiceClient.EndpointServiceListOrganizationEndpoints.g.cs index 8e763d15..310f8e05 100644 --- a/src/libs/Together/Generated/Together.EndpointServiceClient.EndpointServiceListOrganizationEndpoints.g.cs +++ b/src/libs/Together/Generated/Together.EndpointServiceClient.EndpointServiceListOrganizationEndpoints.g.cs @@ -6,6 +6,14 @@ namespace Together public partial class EndpointServiceClient { + private static readonly global::Together.AutoSDKServer[] s_EndpointServiceListOrganizationEndpointsServers = 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_EndpointServiceListOrganizationEndpointsSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -71,6 +79,13 @@ partial void ProcessEndpointServiceListOrganizationEndpointsResponseContent( /// 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()
+ /// organization_id = client.whoami().organization_id
+ /// for endpoint in client.beta.endpoints.list_org_scoped(organization_id):
+ /// print(endpoint.id, endpoint.name) + ///
public async global::System.Threading.Tasks.Task EndpointServiceListOrganizationEndpointsAsync( string organizationId, int? limit = default, @@ -114,6 +129,13 @@ partial void ProcessEndpointServiceListOrganizationEndpointsResponseContent( /// 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()
+ /// organization_id = client.whoami().organization_id
+ /// for endpoint in client.beta.endpoints.list_org_scoped(organization_id):
+ /// print(endpoint.id, endpoint.name) + ///
public async global::System.Threading.Tasks.Task> EndpointServiceListOrganizationEndpointsAsResponseAsync( string organizationId, int? limit = default, @@ -157,8 +179,10 @@ partial void ProcessEndpointServiceListOrganizationEndpointsResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v2/organizations/{organizationId}/endpoints", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/organizations/{organizationId}/endpoints", + baseUri: ResolveBaseUri( + servers: s_EndpointServiceListOrganizationEndpointsServers, + defaultBaseUrl: "https://api.together.ai/v2")); __pathBuilder .AddOptionalParameter("limit", limit?.ToString()) .AddOptionalParameter("after", after) @@ -228,7 +252,7 @@ partial void ProcessEndpointServiceListOrganizationEndpointsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "EndpointServiceListOrganizationEndpoints", methodName: "EndpointServiceListOrganizationEndpointsAsync", - pathTemplate: "$\"/v2/organizations/{organizationId}/endpoints\"", + pathTemplate: "$\"/organizations/{organizationId}/endpoints\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -262,7 +286,7 @@ partial void ProcessEndpointServiceListOrganizationEndpointsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "EndpointServiceListOrganizationEndpoints", methodName: "EndpointServiceListOrganizationEndpointsAsync", - pathTemplate: "$\"/v2/organizations/{organizationId}/endpoints\"", + pathTemplate: "$\"/organizations/{organizationId}/endpoints\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -303,7 +327,7 @@ partial void ProcessEndpointServiceListOrganizationEndpointsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "EndpointServiceListOrganizationEndpoints", methodName: "EndpointServiceListOrganizationEndpointsAsync", - pathTemplate: "$\"/v2/organizations/{organizationId}/endpoints\"", + pathTemplate: "$\"/organizations/{organizationId}/endpoints\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -351,7 +375,7 @@ partial void ProcessEndpointServiceListOrganizationEndpointsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "EndpointServiceListOrganizationEndpoints", methodName: "EndpointServiceListOrganizationEndpointsAsync", - pathTemplate: "$\"/v2/organizations/{organizationId}/endpoints\"", + pathTemplate: "$\"/organizations/{organizationId}/endpoints\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -373,7 +397,7 @@ partial void ProcessEndpointServiceListOrganizationEndpointsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "EndpointServiceListOrganizationEndpoints", methodName: "EndpointServiceListOrganizationEndpointsAsync", - pathTemplate: "$\"/v2/organizations/{organizationId}/endpoints\"", + pathTemplate: "$\"/organizations/{organizationId}/endpoints\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.EndpointServiceClient.EndpointServiceListPublicEndpoints.g.cs b/src/libs/Together/Generated/Together.EndpointServiceClient.EndpointServiceListPublicEndpoints.g.cs index 60ce3ab0..4c227da0 100644 --- a/src/libs/Together/Generated/Together.EndpointServiceClient.EndpointServiceListPublicEndpoints.g.cs +++ b/src/libs/Together/Generated/Together.EndpointServiceClient.EndpointServiceListPublicEndpoints.g.cs @@ -6,6 +6,14 @@ namespace Together public partial class EndpointServiceClient { + private static readonly global::Together.AutoSDKServer[] s_EndpointServiceListPublicEndpointsServers = 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_EndpointServiceListPublicEndpointsSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -145,8 +153,10 @@ partial void ProcessEndpointServiceListPublicEndpointsResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: "/v2/public/endpoints", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: "/public/endpoints", + baseUri: ResolveBaseUri( + servers: s_EndpointServiceListPublicEndpointsServers, + defaultBaseUrl: "https://api.together.ai/v2")); __pathBuilder .AddOptionalParameter("limit", limit?.ToString()) .AddOptionalParameter("after", after) @@ -215,7 +225,7 @@ partial void ProcessEndpointServiceListPublicEndpointsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "EndpointServiceListPublicEndpoints", methodName: "EndpointServiceListPublicEndpointsAsync", - pathTemplate: "\"/v2/public/endpoints\"", + pathTemplate: "\"/public/endpoints\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -249,7 +259,7 @@ partial void ProcessEndpointServiceListPublicEndpointsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "EndpointServiceListPublicEndpoints", methodName: "EndpointServiceListPublicEndpointsAsync", - pathTemplate: "\"/v2/public/endpoints\"", + pathTemplate: "\"/public/endpoints\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -290,7 +300,7 @@ partial void ProcessEndpointServiceListPublicEndpointsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "EndpointServiceListPublicEndpoints", methodName: "EndpointServiceListPublicEndpointsAsync", - pathTemplate: "\"/v2/public/endpoints\"", + pathTemplate: "\"/public/endpoints\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -338,7 +348,7 @@ partial void ProcessEndpointServiceListPublicEndpointsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "EndpointServiceListPublicEndpoints", methodName: "EndpointServiceListPublicEndpointsAsync", - pathTemplate: "\"/v2/public/endpoints\"", + pathTemplate: "\"/public/endpoints\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -360,7 +370,7 @@ partial void ProcessEndpointServiceListPublicEndpointsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "EndpointServiceListPublicEndpoints", methodName: "EndpointServiceListPublicEndpointsAsync", - pathTemplate: "\"/v2/public/endpoints\"", + pathTemplate: "\"/public/endpoints\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.EndpointServiceClient.EndpointServiceUpdateEndpoint.g.cs b/src/libs/Together/Generated/Together.EndpointServiceClient.EndpointServiceUpdateEndpoint.g.cs index 05a06572..15a9188f 100644 --- a/src/libs/Together/Generated/Together.EndpointServiceClient.EndpointServiceUpdateEndpoint.g.cs +++ b/src/libs/Together/Generated/Together.EndpointServiceClient.EndpointServiceUpdateEndpoint.g.cs @@ -6,6 +6,14 @@ namespace Together public partial class EndpointServiceClient { + private static readonly global::Together.AutoSDKServer[] s_EndpointServiceUpdateEndpointServers = 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_EndpointServiceUpdateEndpointSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -64,6 +72,17 @@ partial void ProcessEndpointServiceUpdateEndpointResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// endpoint = client.beta.endpoints.update(
+ /// "ep_abc123",
+ /// project_id=project_id,
+ /// traffic_split=[{"deployment_id": "dep_abc123", "weight": 1}],
+ /// )
+ /// print(endpoint.traffic_split) + ///
public async global::System.Threading.Tasks.Task EndpointServiceUpdateEndpointAsync( string projectId, string id, @@ -102,6 +121,17 @@ partial void ProcessEndpointServiceUpdateEndpointResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// endpoint = client.beta.endpoints.update(
+ /// "ep_abc123",
+ /// project_id=project_id,
+ /// traffic_split=[{"deployment_id": "dep_abc123", "weight": 1}],
+ /// )
+ /// print(endpoint.traffic_split) + ///
public async global::System.Threading.Tasks.Task> EndpointServiceUpdateEndpointAsResponseAsync( string projectId, string id, @@ -146,8 +176,10 @@ partial void ProcessEndpointServiceUpdateEndpointResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v2/projects/{projectId}/endpoints/{id}", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/projects/{projectId}/endpoints/{id}", + baseUri: ResolveBaseUri( + servers: s_EndpointServiceUpdateEndpointServers, + defaultBaseUrl: "https://api.together.ai/v2")); __pathBuilder .AddOptionalParameter("updateMask", updateMask) ; @@ -219,7 +251,7 @@ partial void ProcessEndpointServiceUpdateEndpointResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "EndpointServiceUpdateEndpoint", methodName: "EndpointServiceUpdateEndpointAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{id}\"", httpMethod: "PATCH", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -253,7 +285,7 @@ partial void ProcessEndpointServiceUpdateEndpointResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "EndpointServiceUpdateEndpoint", methodName: "EndpointServiceUpdateEndpointAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{id}\"", httpMethod: "PATCH", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -294,7 +326,7 @@ partial void ProcessEndpointServiceUpdateEndpointResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "EndpointServiceUpdateEndpoint", methodName: "EndpointServiceUpdateEndpointAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{id}\"", httpMethod: "PATCH", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -342,7 +374,7 @@ partial void ProcessEndpointServiceUpdateEndpointResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "EndpointServiceUpdateEndpoint", methodName: "EndpointServiceUpdateEndpointAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{id}\"", httpMethod: "PATCH", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -364,7 +396,7 @@ partial void ProcessEndpointServiceUpdateEndpointResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "EndpointServiceUpdateEndpoint", methodName: "EndpointServiceUpdateEndpointAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{id}\"", httpMethod: "PATCH", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.EndpointServiceClient.g.cs b/src/libs/Together/Generated/Together.EndpointServiceClient.g.cs index addf5841..4e5459f0 100644 --- a/src/libs/Together/Generated/Together.EndpointServiceClient.g.cs +++ b/src/libs/Together/Generated/Together.EndpointServiceClient.g.cs @@ -10,9 +10,9 @@ namespace Together public sealed partial class EndpointServiceClient : global::Together.IEndpointServiceClient, global::System.IDisposable { /// - /// Default environment for APIs + /// /// - public const string DefaultBaseUrl = "https://api.together.ai/"; + public const string DefaultBaseUrl = "https://api.together.ai/v2"; private bool _disposeHttpClient = true; @@ -151,5 +151,36 @@ 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.Endpoints.JsonSerializerContext.g.cs b/src/libs/Together/Generated/Together.Endpoints.JsonSerializerContext.g.cs new file mode 100644 index 00000000..a85f5965 --- /dev/null +++ b/src/libs/Together/Generated/Together.Endpoints.JsonSerializerContext.g.cs @@ -0,0 +1,109 @@ + +#nullable enable + +namespace Together +{ /// + /// + /// + public sealed partial class EndpointsSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext + { + private static readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver Resolver = new LazyChunkResolver(); + + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + internal static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver TypeInfoResolver => Resolver; + + + private static readonly global::System.Text.Json.JsonSerializerOptions DefaultOptions = CreateDefaultOptions(); + + /// + /// + /// + public static EndpointsSourceGenerationContext Default { get; } = new(DefaultOptions); + + private EndpointsSourceGenerationContext(global::System.Text.Json.JsonSerializerOptions options) + : base(options) + { + } + + /// + protected override global::System.Text.Json.JsonSerializerOptions? GeneratedSerializerOptions => DefaultOptions; + + /// + public override global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo(global::System.Type type) + { + return Resolver.GetTypeInfo(type, Options); + } + + /// + /// Adds this package's converters to . + /// + /// + /// A converter has to be on the options a chained resolver builds its JsonTypeInfo against, + /// and a context resolves types from every package below it. Each package contributes only + /// what it owns and calls down the chain for the rest, so the family's converter table is + /// written once rather than copied into all of them. + /// + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) + { + global::Together.SourceGenerationContext.AddConverters(options); + } + + private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() + { + var options = new global::System.Text.Json.JsonSerializerOptions + { + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + TypeInfoResolver = Resolver, + }; + AddConverters(options); + + return options; + } + + private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver + { + private readonly object _gate = new(); + private readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[] _resolvers = new global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[1]; + + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo( + global::System.Type type, + global::System.Text.Json.JsonSerializerOptions options) + { + for (var index = 0; index < _resolvers.Length; index++) + { + var typeInfo = GetResolver(index).GetTypeInfo(type, options); + if (typeInfo is not null) + { + return typeInfo; + } + } + + return null; + } + + private global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver GetResolver(int index) + { + var resolver = global::System.Threading.Volatile.Read(ref _resolvers[index]); + if (resolver is not null) + { + return resolver; + } + + lock (_gate) + { + return _resolvers[index] ??= CreateResolver(index); + } + } + + private static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver CreateResolver(int index) + { + return index switch + { + 0 => global::Together.SourceGenerationContext.TypeInfoResolver, + _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), + }; + } + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Endpoints2.JsonSerializerContext.g.cs b/src/libs/Together/Generated/Together.Endpoints2.JsonSerializerContext.g.cs new file mode 100644 index 00000000..070d6cba --- /dev/null +++ b/src/libs/Together/Generated/Together.Endpoints2.JsonSerializerContext.g.cs @@ -0,0 +1,109 @@ + +#nullable enable + +namespace Together +{ /// + /// + /// + public sealed partial class Endpoints2SourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext + { + private static readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver Resolver = new LazyChunkResolver(); + + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + internal static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver TypeInfoResolver => Resolver; + + + private static readonly global::System.Text.Json.JsonSerializerOptions DefaultOptions = CreateDefaultOptions(); + + /// + /// + /// + public static Endpoints2SourceGenerationContext Default { get; } = new(DefaultOptions); + + private Endpoints2SourceGenerationContext(global::System.Text.Json.JsonSerializerOptions options) + : base(options) + { + } + + /// + protected override global::System.Text.Json.JsonSerializerOptions? GeneratedSerializerOptions => DefaultOptions; + + /// + public override global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo(global::System.Type type) + { + return Resolver.GetTypeInfo(type, Options); + } + + /// + /// Adds this package's converters to . + /// + /// + /// A converter has to be on the options a chained resolver builds its JsonTypeInfo against, + /// and a context resolves types from every package below it. Each package contributes only + /// what it owns and calls down the chain for the rest, so the family's converter table is + /// written once rather than copied into all of them. + /// + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) + { + global::Together.SourceGenerationContext.AddConverters(options); + } + + private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() + { + var options = new global::System.Text.Json.JsonSerializerOptions + { + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + TypeInfoResolver = Resolver, + }; + AddConverters(options); + + return options; + } + + private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver + { + private readonly object _gate = new(); + private readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[] _resolvers = new global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[1]; + + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo( + global::System.Type type, + global::System.Text.Json.JsonSerializerOptions options) + { + for (var index = 0; index < _resolvers.Length; index++) + { + var typeInfo = GetResolver(index).GetTypeInfo(type, options); + if (typeInfo is not null) + { + return typeInfo; + } + } + + return null; + } + + private global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver GetResolver(int index) + { + var resolver = global::System.Threading.Volatile.Read(ref _resolvers[index]); + if (resolver is not null) + { + return resolver; + } + + lock (_gate) + { + return _resolvers[index] ??= CreateResolver(index); + } + } + + private static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver CreateResolver(int index) + { + return index switch + { + 0 => global::Together.SourceGenerationContext.TypeInfoResolver, + _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), + }; + } + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Endpoints2Client.AvailabilityZones.g.cs b/src/libs/Together/Generated/Together.Endpoints2Client.AvailabilityZones.g.cs new file mode 100644 index 00000000..60a222af --- /dev/null +++ b/src/libs/Together/Generated/Together.Endpoints2Client.AvailabilityZones.g.cs @@ -0,0 +1,450 @@ + +#nullable enable + +namespace Together +{ + public partial class Endpoints2Client + { + + private static readonly global::Together.AutoSDKServer[] s_AvailabilityZonesServers = 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_AvailabilityZonesSecurityRequirement0 = + 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_AvailabilityZonesSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_AvailabilityZonesSecurityRequirement0, + }; + partial void PrepareAvailabilityZonesArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareAvailabilityZonesRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessAvailabilityZonesResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessAvailabilityZonesResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// List all available availability zones
+ /// List all available availability zones. + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.endpoints.list_avzones()
+ /// print(response.avzones) + ///
+ public async global::System.Threading.Tasks.Task AvailabilityZonesAsync( + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AvailabilityZonesAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List all available availability zones
+ /// List all available availability zones. + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.endpoints.list_avzones()
+ /// print(response.avzones) + ///
+ public async global::System.Threading.Tasks.Task> AvailabilityZonesAsResponseAsync( + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareAvailabilityZonesArguments( + httpClient: HttpClient); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_AvailabilityZonesSecurityRequirements, + operationName: "AvailabilityZonesAsync"); + + 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: "/clusters/availability-zones", + baseUri: ResolveBaseUri( + servers: s_AvailabilityZonesServers, + 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); + PrepareAvailabilityZonesRequest( + 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: "AvailabilityZones", + methodName: "AvailabilityZonesAsync", + pathTemplate: "\"/clusters/availability-zones\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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: "AvailabilityZones", + methodName: "AvailabilityZonesAsync", + pathTemplate: "\"/clusters/availability-zones\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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: "AvailabilityZones", + methodName: "AvailabilityZonesAsync", + pathTemplate: "\"/clusters/availability-zones\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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); + ProcessAvailabilityZonesResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AvailabilityZones", + methodName: "AvailabilityZonesAsync", + pathTemplate: "\"/clusters/availability-zones\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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: "AvailabilityZones", + methodName: "AvailabilityZonesAsync", + pathTemplate: "\"/clusters/availability-zones\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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); + } + + 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); + ProcessAvailabilityZonesResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.ListAvailibilityZonesResponse.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.ListAvailibilityZonesResponse.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.Endpoints2Client.g.cs b/src/libs/Together/Generated/Together.Endpoints2Client.g.cs new file mode 100644 index 00000000..6d2de809 --- /dev/null +++ b/src/libs/Together/Generated/Together.Endpoints2Client.g.cs @@ -0,0 +1,295 @@ + +#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 Endpoints2Client : global::Together.IEndpoints2Client, 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; } + + + /// + public global::System.Func CreateIdempotencyKey { get; set; } = () => global::System.Guid.NewGuid().ToString("D"); + + + internal global::Together.AutoSDKServerConfiguration AutoSDKServerConfiguration { get; set; } = new global::Together.AutoSDKServerConfiguration(); + + internal global::System.Lazy? JsonSerializerContextProvider { get; set; } + + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext + { + get => JsonSerializerContextProvider?.Value ?? global::Together.Endpoints2SourceGenerationContext.Default; + set => JsonSerializerContextProvider = new(() => value); + } + + + + 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 Endpoints2Client. + /// 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 Endpoints2Client( + 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 Endpoints2Client 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 Endpoints2Client( + 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 Endpoints2Client. + /// 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 Endpoints2Client( + 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.EndpointsClient.AddAdapter.g.cs b/src/libs/Together/Generated/Together.EndpointsClient.AddAdapter.g.cs new file mode 100644 index 00000000..78c39298 --- /dev/null +++ b/src/libs/Together/Generated/Together.EndpointsClient.AddAdapter.g.cs @@ -0,0 +1,637 @@ + +#nullable enable + +namespace Together +{ + public partial class EndpointsClient + { + + private static readonly global::Together.AutoSDKServer[] s_AddAdapterServers = 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_AddAdapterSecurityRequirement0 = + 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_AddAdapterSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_AddAdapterSecurityRequirement0, + }; + partial void PrepareAddAdapterArguments( + global::System.Net.Http.HttpClient httpClient, + ref string endpointId, + global::Together.AddAdapterRequest request); + partial void PrepareAddAdapterRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string endpointId, + global::Together.AddAdapterRequest request); + partial void ProcessAddAdapterResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessAddAdapterResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Add a LoRA adapter to an endpoint
+ /// Adds a LoRA adapter model to a dedicated endpoint. After this call,
+ /// inference requests to the adapter model name will be routed to the
+ /// specified endpoint. The endpoint must have LoRA enabled, and the
+ /// adapter's base model must be compatible with the endpoint's model.
+ /// The endpoint name prefix in model_id must match the resolved endpoint. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// result = client.endpoints.adapters.add(
+ /// "<ENDPOINT_ID>",
+ /// model_id="username/my-endpoint-name:username/my-adapter-model",
+ /// )
+ /// print(result.api_model_id) + ///
+ public async global::System.Threading.Tasks.Task AddAdapterAsync( + string endpointId, + + global::Together.AddAdapterRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AddAdapterAsResponseAsync( + endpointId: endpointId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Add a LoRA adapter to an endpoint
+ /// Adds a LoRA adapter model to a dedicated endpoint. After this call,
+ /// inference requests to the adapter model name will be routed to the
+ /// specified endpoint. The endpoint must have LoRA enabled, and the
+ /// adapter's base model must be compatible with the endpoint's model.
+ /// The endpoint name prefix in model_id must match the resolved endpoint. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// result = client.endpoints.adapters.add(
+ /// "<ENDPOINT_ID>",
+ /// model_id="username/my-endpoint-name:username/my-adapter-model",
+ /// )
+ /// print(result.api_model_id) + ///
+ public async global::System.Threading.Tasks.Task> AddAdapterAsResponseAsync( + string endpointId, + + global::Together.AddAdapterRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareAddAdapterArguments( + httpClient: HttpClient, + endpointId: ref endpointId, + request: request); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_AddAdapterSecurityRequirements, + operationName: "AddAdapterAsync"); + + 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: $"/endpoints/{endpointId}/adapters", + baseUri: ResolveBaseUri( + servers: s_AddAdapterServers, + 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.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); + PrepareAddAdapterRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + 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: "AddAdapter", + methodName: "AddAdapterAsync", + pathTemplate: "$\"/endpoints/{endpointId}/adapters\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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: "AddAdapter", + methodName: "AddAdapterAsync", + pathTemplate: "$\"/endpoints/{endpointId}/adapters\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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: "AddAdapter", + methodName: "AddAdapterAsync", + pathTemplate: "$\"/endpoints/{endpointId}/adapters\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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); + ProcessAddAdapterResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AddAdapter", + methodName: "AddAdapterAsync", + pathTemplate: "$\"/endpoints/{endpointId}/adapters\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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: "AddAdapter", + methodName: "AddAdapterAsync", + pathTemplate: "$\"/endpoints/{endpointId}/adapters\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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); + } + // Bad Request — invalid model_id format, endpoint name mismatch, LoRA not enabled, incompatible base model, or adapter already bound + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + global::Together.ErrorData? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = global::Together.ErrorData.FromJson(__content_400, JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = global::Together.ErrorData.FromJson(__content_400, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Forbidden — adapter model not found or not owned + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + global::Together.ErrorData? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = global::Together.ErrorData.FromJson(__content_403, JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = global::Together.ErrorData.FromJson(__content_403, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not Found — endpoint does not exist + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::Together.ErrorData? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::Together.ErrorData.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::Together.ErrorData.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + 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); + ProcessAddAdapterResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.AddAdapterResponse.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.AddAdapterResponse.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 LoRA adapter to an endpoint
+ /// Adds a LoRA adapter model to a dedicated endpoint. After this call,
+ /// inference requests to the adapter model name will be routed to the
+ /// specified endpoint. The endpoint must have LoRA enabled, and the
+ /// adapter's base model must be compatible with the endpoint's model.
+ /// The endpoint name prefix in model_id must match the resolved endpoint. + ///
+ /// + /// + /// Combined identifier in format "endpoint_name:adapter_model_name".
+ /// Example: username/Meta-Llama-3.1-8B-Instruct-def456:username/my-adapter-abc123 + /// + /// 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 AddAdapterAsync( + string endpointId, + string modelId, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Together.AddAdapterRequest + { + ModelId = modelId, + }; + + return await AddAdapterAsync( + endpointId: endpointId, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.EndpointsClient.CreateEndpoint.g.cs b/src/libs/Together/Generated/Together.EndpointsClient.CreateEndpoint.g.cs new file mode 100644 index 00000000..485d8a90 --- /dev/null +++ b/src/libs/Together/Generated/Together.EndpointsClient.CreateEndpoint.g.cs @@ -0,0 +1,627 @@ + +#nullable enable + +#pragma warning disable CS0618 // Type or member is obsolete + +namespace Together +{ + public partial class EndpointsClient + { + + private static readonly global::Together.AutoSDKServer[] s_CreateEndpointServers = 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_CreateEndpointSecurityRequirement0 = + 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_CreateEndpointSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_CreateEndpointSecurityRequirement0, + }; + partial void PrepareCreateEndpointArguments( + global::System.Net.Http.HttpClient httpClient, + global::Together.CreateEndpointRequest request); + partial void PrepareCreateEndpointRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + global::Together.CreateEndpointRequest request); + partial void ProcessCreateEndpointResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessCreateEndpointResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Create a dedicated endpoint
+ /// Creates a new dedicated endpoint for serving models. The endpoint starts automatically after creation. You can deploy any supported model on hardware configurations that meet the model's requirements. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// endpoint = client.endpoints.create(
+ /// model="Qwen/Qwen3.5-9B-FP8",
+ /// hardware="1x_nvidia_h100_80gb_sxm",
+ /// autoscaling={
+ /// "min_replicas": 2,
+ /// "max_replicas": 5,
+ /// }
+ /// )
+ /// print(endpoint.id) + ///
+ public async global::System.Threading.Tasks.Task CreateEndpointAsync( + + global::Together.CreateEndpointRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateEndpointAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create a dedicated endpoint
+ /// Creates a new dedicated endpoint for serving models. The endpoint starts automatically after creation. You can deploy any supported model on hardware configurations that meet the model's requirements. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// endpoint = client.endpoints.create(
+ /// model="Qwen/Qwen3.5-9B-FP8",
+ /// hardware="1x_nvidia_h100_80gb_sxm",
+ /// autoscaling={
+ /// "min_replicas": 2,
+ /// "max_replicas": 5,
+ /// }
+ /// )
+ /// print(endpoint.id) + ///
+ public async global::System.Threading.Tasks.Task> CreateEndpointAsResponseAsync( + + global::Together.CreateEndpointRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareCreateEndpointArguments( + httpClient: HttpClient, + request: request); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_CreateEndpointSecurityRequirements, + operationName: "CreateEndpointAsync"); + + 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: "/endpoints", + baseUri: ResolveBaseUri( + servers: s_CreateEndpointServers, + 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.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); + PrepareCreateEndpointRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + 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: "CreateEndpoint", + methodName: "CreateEndpointAsync", + pathTemplate: "\"/endpoints\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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: "CreateEndpoint", + methodName: "CreateEndpointAsync", + pathTemplate: "\"/endpoints\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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: "CreateEndpoint", + methodName: "CreateEndpointAsync", + pathTemplate: "\"/endpoints\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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); + ProcessCreateEndpointResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateEndpoint", + methodName: "CreateEndpointAsync", + pathTemplate: "\"/endpoints\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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: "CreateEndpoint", + methodName: "CreateEndpointAsync", + pathTemplate: "\"/endpoints\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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 + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + global::Together.ErrorData? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = global::Together.ErrorData.FromJson(__content_403, JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = global::Together.ErrorData.FromJson(__content_403, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal 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); + ProcessCreateEndpointResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.DedicatedEndpoint.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.DedicatedEndpoint.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 dedicated endpoint
+ /// Creates a new dedicated endpoint for serving models. The endpoint starts automatically after creation. You can deploy any supported model on hardware configurations that meet the model's requirements. + ///
+ /// + /// A human-readable name for the endpoint
+ /// Example: My Llama3 70b endpoint + /// + /// + /// The model to deploy on this endpoint
+ /// Example: deepseek-ai/DeepSeek-R1 + /// + /// + /// The hardware configuration to use for this endpoint
+ /// Example: 1x_nvidia_a100_80gb_sxm + /// + /// + /// Configuration for automatic scaling of the endpoint + /// + /// + /// Whether to disable speculative decoding for this endpoint
+ /// Default Value: false + /// + /// + /// The desired state of the endpoint
+ /// Default Value: STARTED
+ /// Example: STARTED + /// + /// + /// The number of minutes of inactivity after which the endpoint stops automatically. Set to null, omit, or set to 0 to disable automatic timeout.
+ /// Example: 60 + /// + /// + /// Create the endpoint in a specified availability zone (e.g., us-central-4b) + /// + /// 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 CreateEndpointAsync( + string model, + string hardware, + global::Together.Autoscaling autoscaling, + string? displayName = default, + bool? disableSpeculativeDecoding = default, + global::Together.CreateEndpointRequestState? state = default, + int? inactiveTimeout = default, + string? availabilityZone = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Together.CreateEndpointRequest + { + DisplayName = displayName, + Model = model, + Hardware = hardware, + Autoscaling = autoscaling, + DisableSpeculativeDecoding = disableSpeculativeDecoding, + State = state, + InactiveTimeout = inactiveTimeout, + AvailabilityZone = availabilityZone, + }; + + return await CreateEndpointAsync( + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.EndpointsClient.DeleteEndpoint.g.cs b/src/libs/Together/Generated/Together.EndpointsClient.DeleteEndpoint.g.cs new file mode 100644 index 00000000..73da795f --- /dev/null +++ b/src/libs/Together/Generated/Together.EndpointsClient.DeleteEndpoint.g.cs @@ -0,0 +1,553 @@ + +#nullable enable + +namespace Together +{ + public partial class EndpointsClient + { + + private static readonly global::Together.AutoSDKServer[] s_DeleteEndpointServers = 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_DeleteEndpointSecurityRequirement0 = + 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_DeleteEndpointSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_DeleteEndpointSecurityRequirement0, + }; + partial void PrepareDeleteEndpointArguments( + global::System.Net.Http.HttpClient httpClient, + ref string endpointId); + partial void PrepareDeleteEndpointRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string endpointId); + partial void ProcessDeleteEndpointResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Delete endpoint
+ /// Permanently deletes an endpoint. This action cannot be undone. + ///
+ /// + /// The ID of the endpoint to delete
+ /// Example: endpoint-d23901de-ef8f-44bf-b3e7-de9c1ca8f2d7 + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// endpoint = client.endpoints.delete("<ENDPOINT_ID>")
+ /// print(endpoint) + ///
+ public async global::System.Threading.Tasks.Task DeleteEndpointAsync( + string endpointId, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + await DeleteEndpointAsResponseAsync( + endpointId: endpointId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Delete endpoint
+ /// Permanently deletes an endpoint. This action cannot be undone. + ///
+ /// + /// The ID of the endpoint to delete
+ /// Example: endpoint-d23901de-ef8f-44bf-b3e7-de9c1ca8f2d7 + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// endpoint = client.endpoints.delete("<ENDPOINT_ID>")
+ /// print(endpoint) + ///
+ public async global::System.Threading.Tasks.Task DeleteEndpointAsResponseAsync( + string endpointId, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareDeleteEndpointArguments( + httpClient: HttpClient, + endpointId: ref endpointId); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_DeleteEndpointSecurityRequirements, + operationName: "DeleteEndpointAsync"); + + 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: $"/endpoints/{endpointId}", + baseUri: ResolveBaseUri( + servers: s_DeleteEndpointServers, + 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.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); + PrepareDeleteEndpointRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + endpointId: endpointId); + + 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: "DeleteEndpoint", + methodName: "DeleteEndpointAsync", + pathTemplate: "$\"/endpoints/{endpointId}\"", + httpMethod: "DELETE", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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: "DeleteEndpoint", + methodName: "DeleteEndpointAsync", + pathTemplate: "$\"/endpoints/{endpointId}\"", + httpMethod: "DELETE", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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: "DeleteEndpoint", + methodName: "DeleteEndpointAsync", + pathTemplate: "$\"/endpoints/{endpointId}\"", + httpMethod: "DELETE", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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); + ProcessDeleteEndpointResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteEndpoint", + methodName: "DeleteEndpointAsync", + pathTemplate: "$\"/endpoints/{endpointId}\"", + httpMethod: "DELETE", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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: "DeleteEndpoint", + methodName: "DeleteEndpointAsync", + pathTemplate: "$\"/endpoints/{endpointId}\"", + httpMethod: "DELETE", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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 + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + global::Together.ErrorData? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = global::Together.ErrorData.FromJson(__content_403, JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = global::Together.ErrorData.FromJson(__content_403, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not Found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::Together.ErrorData? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::Together.ErrorData.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::Together.ErrorData.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal 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); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); + } + 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(); + return new global::Together.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Together.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); + } + 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.EndpointsClient.GetEndpoint.g.cs b/src/libs/Together/Generated/Together.EndpointsClient.GetEndpoint.g.cs new file mode 100644 index 00000000..dc336563 --- /dev/null +++ b/src/libs/Together/Generated/Together.EndpointsClient.GetEndpoint.g.cs @@ -0,0 +1,576 @@ + +#nullable enable + +namespace Together +{ + public partial class EndpointsClient + { + + private static readonly global::Together.AutoSDKServer[] s_GetEndpointServers = 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_GetEndpointSecurityRequirement0 = + 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_GetEndpointSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_GetEndpointSecurityRequirement0, + }; + partial void PrepareGetEndpointArguments( + global::System.Net.Http.HttpClient httpClient, + ref string endpointId); + partial void PrepareGetEndpointRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string endpointId); + partial void ProcessGetEndpointResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessGetEndpointResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Get endpoint by ID
+ /// Retrieves details about a specific endpoint, including its current state, configuration, and scaling settings. + ///
+ /// + /// The ID of the endpoint to retrieve
+ /// Example: endpoint-d23901de-ef8f-44bf-b3e7-de9c1ca8f2d7 + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// endpoint = client.endpoints.retrieve("<ENDPOINT_ID>")
+ /// print(endpoint.id) + ///
+ public async global::System.Threading.Tasks.Task GetEndpointAsync( + string endpointId, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetEndpointAsResponseAsync( + endpointId: endpointId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get endpoint by ID
+ /// Retrieves details about a specific endpoint, including its current state, configuration, and scaling settings. + ///
+ /// + /// The ID of the endpoint to retrieve
+ /// Example: endpoint-d23901de-ef8f-44bf-b3e7-de9c1ca8f2d7 + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// endpoint = client.endpoints.retrieve("<ENDPOINT_ID>")
+ /// print(endpoint.id) + ///
+ public async global::System.Threading.Tasks.Task> GetEndpointAsResponseAsync( + string endpointId, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareGetEndpointArguments( + httpClient: HttpClient, + endpointId: ref endpointId); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_GetEndpointSecurityRequirements, + operationName: "GetEndpointAsync"); + + 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: $"/endpoints/{endpointId}", + baseUri: ResolveBaseUri( + servers: s_GetEndpointServers, + 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); + PrepareGetEndpointRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + endpointId: endpointId); + + 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: "GetEndpoint", + methodName: "GetEndpointAsync", + pathTemplate: "$\"/endpoints/{endpointId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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: "GetEndpoint", + methodName: "GetEndpointAsync", + pathTemplate: "$\"/endpoints/{endpointId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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: "GetEndpoint", + methodName: "GetEndpointAsync", + pathTemplate: "$\"/endpoints/{endpointId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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); + ProcessGetEndpointResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetEndpoint", + methodName: "GetEndpointAsync", + pathTemplate: "$\"/endpoints/{endpointId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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: "GetEndpoint", + methodName: "GetEndpointAsync", + pathTemplate: "$\"/endpoints/{endpointId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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 + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + global::Together.ErrorData? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = global::Together.ErrorData.FromJson(__content_403, JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = global::Together.ErrorData.FromJson(__content_403, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not Found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::Together.ErrorData? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::Together.ErrorData.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::Together.ErrorData.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal 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); + ProcessGetEndpointResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.DedicatedEndpoint.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.DedicatedEndpoint.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.EndpointsClient.ListAdapters.g.cs b/src/libs/Together/Generated/Together.EndpointsClient.ListAdapters.g.cs new file mode 100644 index 00000000..fc93eca9 --- /dev/null +++ b/src/libs/Together/Generated/Together.EndpointsClient.ListAdapters.g.cs @@ -0,0 +1,498 @@ + +#nullable enable + +namespace Together +{ + public partial class EndpointsClient + { + + private static readonly global::Together.AutoSDKServer[] s_ListAdaptersServers = 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_ListAdaptersSecurityRequirement0 = + 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_ListAdaptersSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_ListAdaptersSecurityRequirement0, + }; + partial void PrepareListAdaptersArguments( + global::System.Net.Http.HttpClient httpClient, + ref string endpointId); + partial void PrepareListAdaptersRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string endpointId); + partial void ProcessListAdaptersResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessListAdaptersResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// List adapters on an endpoint
+ /// Returns all LoRA adapters bound to the specified dedicated endpoint. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// adapters = client.endpoints.adapters.list("<ENDPOINT_ID>")
+ /// for adapter in adapters.data or []:
+ /// print(adapter.api_model_id, adapter.adapter_name, adapter.endpoint_name) + ///
+ public async global::System.Threading.Tasks.Task ListAdaptersAsync( + string endpointId, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListAdaptersAsResponseAsync( + endpointId: endpointId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List adapters on an endpoint
+ /// Returns all LoRA adapters bound to the specified dedicated endpoint. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// adapters = client.endpoints.adapters.list("<ENDPOINT_ID>")
+ /// for adapter in adapters.data or []:
+ /// print(adapter.api_model_id, adapter.adapter_name, adapter.endpoint_name) + ///
+ public async global::System.Threading.Tasks.Task> ListAdaptersAsResponseAsync( + string endpointId, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareListAdaptersArguments( + httpClient: HttpClient, + endpointId: ref endpointId); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ListAdaptersSecurityRequirements, + operationName: "ListAdaptersAsync"); + + 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: $"/endpoints/{endpointId}/adapters", + baseUri: ResolveBaseUri( + servers: s_ListAdaptersServers, + 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); + PrepareListAdaptersRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + endpointId: endpointId); + + 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: "ListAdapters", + methodName: "ListAdaptersAsync", + pathTemplate: "$\"/endpoints/{endpointId}/adapters\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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: "ListAdapters", + methodName: "ListAdaptersAsync", + pathTemplate: "$\"/endpoints/{endpointId}/adapters\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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: "ListAdapters", + methodName: "ListAdaptersAsync", + pathTemplate: "$\"/endpoints/{endpointId}/adapters\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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); + ProcessListAdaptersResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListAdapters", + methodName: "ListAdaptersAsync", + pathTemplate: "$\"/endpoints/{endpointId}/adapters\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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: "ListAdapters", + methodName: "ListAdaptersAsync", + pathTemplate: "$\"/endpoints/{endpointId}/adapters\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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); + } + // Not Found — endpoint does not exist + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::Together.ErrorData? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::Together.ErrorData.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::Together.ErrorData.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + 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); + ProcessListAdaptersResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.ListAdaptersResponse.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.ListAdaptersResponse.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.EndpointsClient.ListEndpoints.g.cs b/src/libs/Together/Generated/Together.EndpointsClient.ListEndpoints.g.cs new file mode 100644 index 00000000..78d66e0c --- /dev/null +++ b/src/libs/Together/Generated/Together.EndpointsClient.ListEndpoints.g.cs @@ -0,0 +1,570 @@ + +#nullable enable + +namespace Together +{ + public partial class EndpointsClient + { + + private static readonly global::Together.AutoSDKServer[] s_ListEndpointsServers = 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_ListEndpointsSecurityRequirement0 = + 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_ListEndpointsSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_ListEndpointsSecurityRequirement0, + }; + partial void PrepareListEndpointsArguments( + global::System.Net.Http.HttpClient httpClient, + ref global::Together.ListEndpointsType? type, + ref global::Together.ListEndpointsUsageType? usageType, + ref bool? mine); + partial void PrepareListEndpointsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + global::Together.ListEndpointsType? type, + global::Together.ListEndpointsUsageType? usageType, + bool? mine); + partial void ProcessListEndpointsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessListEndpointsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// List all endpoints
+ /// Returns a list of all endpoints associated with your account. You can filter the results by type (dedicated or serverless). + ///
+ /// + /// Filter endpoints by type + /// + /// + /// Filter endpoints by usage type + /// + /// + /// If true, return only endpoints owned by the caller + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.endpoints.list()
+ /// for endpoint in response.data:
+ /// print(endpoint.id) + ///
+ public async global::System.Threading.Tasks.Task ListEndpointsAsync( + global::Together.ListEndpointsType? type = default, + global::Together.ListEndpointsUsageType? usageType = default, + bool? mine = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListEndpointsAsResponseAsync( + type: type, + usageType: usageType, + mine: mine, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List all endpoints
+ /// Returns a list of all endpoints associated with your account. You can filter the results by type (dedicated or serverless). + ///
+ /// + /// Filter endpoints by type + /// + /// + /// Filter endpoints by usage type + /// + /// + /// If true, return only endpoints owned by the caller + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.endpoints.list()
+ /// for endpoint in response.data:
+ /// print(endpoint.id) + ///
+ public async global::System.Threading.Tasks.Task> ListEndpointsAsResponseAsync( + global::Together.ListEndpointsType? type = default, + global::Together.ListEndpointsUsageType? usageType = default, + bool? mine = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareListEndpointsArguments( + httpClient: HttpClient, + type: ref type, + usageType: ref usageType, + mine: ref mine); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ListEndpointsSecurityRequirements, + operationName: "ListEndpointsAsync"); + + 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: "/endpoints", + baseUri: ResolveBaseUri( + servers: s_ListEndpointsServers, + defaultBaseUrl: "https://api.together.ai/v1")); + __pathBuilder + .AddOptionalParameter("type", type?.ToValueString()) + .AddOptionalParameter("usage_type", usageType?.ToValueString()) + .AddOptionalParameter("mine", mine?.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.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); + PrepareListEndpointsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + type: type, + usageType: usageType, + mine: mine); + + 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: "ListEndpoints", + methodName: "ListEndpointsAsync", + pathTemplate: "\"/endpoints\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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: "ListEndpoints", + methodName: "ListEndpointsAsync", + pathTemplate: "\"/endpoints\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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: "ListEndpoints", + methodName: "ListEndpointsAsync", + pathTemplate: "\"/endpoints\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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); + ProcessListEndpointsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListEndpoints", + methodName: "ListEndpointsAsync", + pathTemplate: "\"/endpoints\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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: "ListEndpoints", + methodName: "ListEndpointsAsync", + pathTemplate: "\"/endpoints\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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 + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + global::Together.ErrorData? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = global::Together.ErrorData.FromJson(__content_403, JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = global::Together.ErrorData.FromJson(__content_403, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal 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); + ProcessListEndpointsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.ListEndpointsResponse.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.ListEndpointsResponse.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.EndpointsClient.RemoveAdapter.g.cs b/src/libs/Together/Generated/Together.EndpointsClient.RemoveAdapter.g.cs new file mode 100644 index 00000000..1b1061d5 --- /dev/null +++ b/src/libs/Together/Generated/Together.EndpointsClient.RemoveAdapter.g.cs @@ -0,0 +1,625 @@ + +#nullable enable + +namespace Together +{ + public partial class EndpointsClient + { + + private static readonly global::Together.AutoSDKServer[] s_RemoveAdapterServers = 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_RemoveAdapterSecurityRequirement0 = + 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_RemoveAdapterSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_RemoveAdapterSecurityRequirement0, + }; + partial void PrepareRemoveAdapterArguments( + global::System.Net.Http.HttpClient httpClient, + ref string endpointId, + global::Together.RemoveAdapterRequest request); + partial void PrepareRemoveAdapterRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string endpointId, + global::Together.RemoveAdapterRequest request); + partial void ProcessRemoveAdapterResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessRemoveAdapterResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Remove a LoRA adapter from an endpoint
+ /// Removes the routing rule that binds an adapter to an endpoint.
+ /// The adapter must be currently bound to this specific endpoint. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// client.endpoints.adapters.remove(
+ /// "<ENDPOINT_ID>",
+ /// model_id="username/my-endpoint-name:username/my-adapter-model",
+ /// ) + ///
+ public async global::System.Threading.Tasks.Task RemoveAdapterAsync( + string endpointId, + + global::Together.RemoveAdapterRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await RemoveAdapterAsResponseAsync( + endpointId: endpointId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Remove a LoRA adapter from an endpoint
+ /// Removes the routing rule that binds an adapter to an endpoint.
+ /// The adapter must be currently bound to this specific endpoint. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// client.endpoints.adapters.remove(
+ /// "<ENDPOINT_ID>",
+ /// model_id="username/my-endpoint-name:username/my-adapter-model",
+ /// ) + ///
+ public async global::System.Threading.Tasks.Task> RemoveAdapterAsResponseAsync( + string endpointId, + + global::Together.RemoveAdapterRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareRemoveAdapterArguments( + httpClient: HttpClient, + endpointId: ref endpointId, + request: request); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_RemoveAdapterSecurityRequirements, + operationName: "RemoveAdapterAsync"); + + 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: $"/endpoints/{endpointId}/adapters", + baseUri: ResolveBaseUri( + servers: s_RemoveAdapterServers, + 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.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); + } + } + 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); + PrepareRemoveAdapterRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + 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: "RemoveAdapter", + methodName: "RemoveAdapterAsync", + pathTemplate: "$\"/endpoints/{endpointId}/adapters\"", + httpMethod: "DELETE", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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: "RemoveAdapter", + methodName: "RemoveAdapterAsync", + pathTemplate: "$\"/endpoints/{endpointId}/adapters\"", + httpMethod: "DELETE", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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: "RemoveAdapter", + methodName: "RemoveAdapterAsync", + pathTemplate: "$\"/endpoints/{endpointId}/adapters\"", + httpMethod: "DELETE", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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); + ProcessRemoveAdapterResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RemoveAdapter", + methodName: "RemoveAdapterAsync", + pathTemplate: "$\"/endpoints/{endpointId}/adapters\"", + httpMethod: "DELETE", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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: "RemoveAdapter", + methodName: "RemoveAdapterAsync", + pathTemplate: "$\"/endpoints/{endpointId}/adapters\"", + httpMethod: "DELETE", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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); + } + // Bad Request — invalid model_id format, or adapter not bound to this endpoint + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + global::Together.ErrorData? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = global::Together.ErrorData.FromJson(__content_400, JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = global::Together.ErrorData.FromJson(__content_400, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Forbidden — adapter model not found or not owned + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + global::Together.ErrorData? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = global::Together.ErrorData.FromJson(__content_403, JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = global::Together.ErrorData.FromJson(__content_403, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not Found — endpoint does not exist + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::Together.ErrorData? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::Together.ErrorData.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::Together.ErrorData.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + 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); + ProcessRemoveAdapterResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.RemoveAdapterResponse.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.RemoveAdapterResponse.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(); + } + } + /// + /// Remove a LoRA adapter from an endpoint
+ /// Removes the routing rule that binds an adapter to an endpoint.
+ /// The adapter must be currently bound to this specific endpoint. + ///
+ /// + /// + /// Combined identifier in format "endpoint_name:adapter_model_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 RemoveAdapterAsync( + string endpointId, + string modelId, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Together.RemoveAdapterRequest + { + ModelId = modelId, + }; + + return await RemoveAdapterAsync( + endpointId: endpointId, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.EndpointsClient.UpdateEndpoint.g.cs b/src/libs/Together/Generated/Together.EndpointsClient.UpdateEndpoint.g.cs new file mode 100644 index 00000000..8aa0e54a --- /dev/null +++ b/src/libs/Together/Generated/Together.EndpointsClient.UpdateEndpoint.g.cs @@ -0,0 +1,651 @@ + +#nullable enable + +namespace Together +{ + public partial class EndpointsClient + { + + private static readonly global::Together.AutoSDKServer[] s_UpdateEndpointServers = 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_UpdateEndpointSecurityRequirement0 = + 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_UpdateEndpointSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_UpdateEndpointSecurityRequirement0, + }; + partial void PrepareUpdateEndpointArguments( + global::System.Net.Http.HttpClient httpClient, + ref string endpointId, + global::Together.UpdateEndpointRequest request); + partial void PrepareUpdateEndpointRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string endpointId, + global::Together.UpdateEndpointRequest request); + partial void ProcessUpdateEndpointResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessUpdateEndpointResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Update endpoint, this can also be used to start or stop a dedicated endpoint
+ /// Updates an existing endpoint's configuration. You can modify the display name, autoscaling settings, or change the endpoint's state (start/stop). + ///
+ /// + /// The ID of the endpoint to update
+ /// Example: endpoint-d23901de-ef8f-44bf-b3e7-de9c1ca8f2d7 + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// endpoint = client.endpoints.update(
+ /// "<ENDPOINT_ID>",
+ /// state="STOPPED"
+ /// )
+ /// print(endpoint) + ///
+ public async global::System.Threading.Tasks.Task UpdateEndpointAsync( + string endpointId, + + global::Together.UpdateEndpointRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UpdateEndpointAsResponseAsync( + endpointId: endpointId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update endpoint, this can also be used to start or stop a dedicated endpoint
+ /// Updates an existing endpoint's configuration. You can modify the display name, autoscaling settings, or change the endpoint's state (start/stop). + ///
+ /// + /// The ID of the endpoint to update
+ /// Example: endpoint-d23901de-ef8f-44bf-b3e7-de9c1ca8f2d7 + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// endpoint = client.endpoints.update(
+ /// "<ENDPOINT_ID>",
+ /// state="STOPPED"
+ /// )
+ /// print(endpoint) + ///
+ public async global::System.Threading.Tasks.Task> UpdateEndpointAsResponseAsync( + string endpointId, + + global::Together.UpdateEndpointRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareUpdateEndpointArguments( + httpClient: HttpClient, + endpointId: ref endpointId, + request: request); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_UpdateEndpointSecurityRequirements, + operationName: "UpdateEndpointAsync"); + + 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: $"/endpoints/{endpointId}", + baseUri: ResolveBaseUri( + servers: s_UpdateEndpointServers, + 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: 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); + PrepareUpdateEndpointRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + 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: "UpdateEndpoint", + methodName: "UpdateEndpointAsync", + pathTemplate: "$\"/endpoints/{endpointId}\"", + httpMethod: "PATCH", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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: "UpdateEndpoint", + methodName: "UpdateEndpointAsync", + pathTemplate: "$\"/endpoints/{endpointId}\"", + httpMethod: "PATCH", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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: "UpdateEndpoint", + methodName: "UpdateEndpointAsync", + pathTemplate: "$\"/endpoints/{endpointId}\"", + httpMethod: "PATCH", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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); + ProcessUpdateEndpointResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateEndpoint", + methodName: "UpdateEndpointAsync", + pathTemplate: "$\"/endpoints/{endpointId}\"", + httpMethod: "PATCH", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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: "UpdateEndpoint", + methodName: "UpdateEndpointAsync", + pathTemplate: "$\"/endpoints/{endpointId}\"", + httpMethod: "PATCH", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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 + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + global::Together.ErrorData? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = global::Together.ErrorData.FromJson(__content_403, JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = global::Together.ErrorData.FromJson(__content_403, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not Found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::Together.ErrorData? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::Together.ErrorData.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::Together.ErrorData.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal 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); + ProcessUpdateEndpointResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.DedicatedEndpoint.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.DedicatedEndpoint.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 endpoint, this can also be used to start or stop a dedicated endpoint
+ /// Updates an existing endpoint's configuration. You can modify the display name, autoscaling settings, or change the endpoint's state (start/stop). + ///
+ /// + /// The ID of the endpoint to update
+ /// Example: endpoint-d23901de-ef8f-44bf-b3e7-de9c1ca8f2d7 + /// + /// + /// A human-readable name for the endpoint
+ /// Example: My Llama3 70b endpoint + /// + /// + /// The desired state of the endpoint
+ /// Example: STARTED + /// + /// + /// New autoscaling configuration for the endpoint + /// + /// + /// The number of minutes of inactivity after which the endpoint stops automatically. Set to 0 to disable automatic timeout.
+ /// Example: 60 + /// + /// 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 UpdateEndpointAsync( + string endpointId, + string? displayName = default, + global::Together.UpdateEndpointRequestState? state = default, + global::Together.Autoscaling? autoscaling = default, + int? inactiveTimeout = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Together.UpdateEndpointRequest + { + DisplayName = displayName, + State = state, + Autoscaling = autoscaling, + InactiveTimeout = inactiveTimeout, + }; + + return await UpdateEndpointAsync( + endpointId: endpointId, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.EndpointsClient.g.cs b/src/libs/Together/Generated/Together.EndpointsClient.g.cs new file mode 100644 index 00000000..890932e0 --- /dev/null +++ b/src/libs/Together/Generated/Together.EndpointsClient.g.cs @@ -0,0 +1,295 @@ + +#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 EndpointsClient : global::Together.IEndpointsClient, 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; } + + + /// + public global::System.Func CreateIdempotencyKey { get; set; } = () => global::System.Guid.NewGuid().ToString("D"); + + + internal global::Together.AutoSDKServerConfiguration AutoSDKServerConfiguration { get; set; } = new global::Together.AutoSDKServerConfiguration(); + + internal global::System.Lazy? JsonSerializerContextProvider { get; set; } + + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext + { + get => JsonSerializerContextProvider?.Value ?? global::Together.EndpointsSourceGenerationContext.Default; + set => JsonSerializerContextProvider = new(() => value); + } + + + + 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 EndpointsClient. + /// 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 EndpointsClient( + 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 EndpointsClient 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 EndpointsClient( + 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 EndpointsClient. + /// 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 EndpointsClient( + 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.Evaluation.JsonSerializerContext.g.cs b/src/libs/Together/Generated/Together.Evaluation.JsonSerializerContext.g.cs index ac1cc9f1..fc224989 100644 --- a/src/libs/Together/Generated/Together.Evaluation.JsonSerializerContext.g.cs +++ b/src/libs/Together/Generated/Together.Evaluation.JsonSerializerContext.g.cs @@ -2,79 +2,7 @@ #nullable enable namespace Together -{ - /// - /// - /// - [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( - DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull - )] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(double))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(object))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ErrorData))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ErrorDataError))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.EvaluationTypedRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.EvaluationTypedRequestType), TypeInfoPropertyName = "EvaluationTypedRequestType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf), TypeInfoPropertyName = "OneOfEvaluationClassifyParametersEvaluationScoreParametersEvaluationCompareParameters2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.EvaluationClassifyParameters))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.EvaluationScoreParameters))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.EvaluationCompareParameters))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.EvaluationJudgeModelConfig))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.EvaluationModelOrString), TypeInfoPropertyName = "EvaluationModelOrString2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf), TypeInfoPropertyName = "OneOfEvaluationModelRequestString2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.EvaluationModelRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.EvaluationJudgeModelConfigModelSource), TypeInfoPropertyName = "EvaluationJudgeModelConfigModelSource2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.EvaluationModelRequestModelSource), TypeInfoPropertyName = "EvaluationModelRequestModelSource2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.EvaluationResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.EvaluationResponseStatus), TypeInfoPropertyName = "EvaluationResponseStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.EvaluationJob))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.EvaluationJobType), TypeInfoPropertyName = "EvaluationJobType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.EvaluationJobStatus), TypeInfoPropertyName = "EvaluationJobStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.EvaluationJobStatusUpdate))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf), TypeInfoPropertyName = "OneOfEvaluationClassifyResultsEvaluationScoreResultsEvaluationCompareResultsEvaluationJobResults2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.EvaluationClassifyResults))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.EvaluationScoreResults))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.EvaluationCompareResults))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.EvaluationJobResults))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.EvaluationScoreResultsAggregatedScores))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GetModelListResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GetEvaluationJobStatusAndResultsResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GetEvaluationJobStatusAndResultsResponseStatus), TypeInfoPropertyName = "GetEvaluationJobStatusAndResultsResponseStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf), TypeInfoPropertyName = "OneOfEvaluationClassifyResultsEvaluationScoreResultsEvaluationCompareResults2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(double?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.EvaluationTypedRequestType?), TypeInfoPropertyName = "NullableEvaluationTypedRequestType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf?), TypeInfoPropertyName = "NullableOneOfEvaluationClassifyParametersEvaluationScoreParametersEvaluationCompareParameters2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.EvaluationModelOrString?), TypeInfoPropertyName = "NullableEvaluationModelOrString2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf?), TypeInfoPropertyName = "NullableOneOfEvaluationModelRequestString2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.EvaluationJudgeModelConfigModelSource?), TypeInfoPropertyName = "NullableEvaluationJudgeModelConfigModelSource2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.EvaluationModelRequestModelSource?), TypeInfoPropertyName = "NullableEvaluationModelRequestModelSource2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.EvaluationResponseStatus?), TypeInfoPropertyName = "NullableEvaluationResponseStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.EvaluationJobType?), TypeInfoPropertyName = "NullableEvaluationJobType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.EvaluationJobStatus?), TypeInfoPropertyName = "NullableEvaluationJobStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf?), TypeInfoPropertyName = "NullableOneOfEvaluationClassifyResultsEvaluationScoreResultsEvaluationCompareResultsEvaluationJobResults2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GetEvaluationJobStatusAndResultsResponseStatus?), TypeInfoPropertyName = "NullableGetEvaluationJobStatusAndResultsResponseStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf?), TypeInfoPropertyName = "NullableOneOfEvaluationClassifyResultsEvaluationScoreResultsEvaluationCompareResults2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - internal sealed partial class EvaluationSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext - { - } - /// +{ /// /// /// public sealed partial class EvaluationSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext @@ -118,32 +46,7 @@ private EvaluationSourceGenerationContext(global::System.Text.Json.JsonSerialize [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) { - options.Converters.Add(new global::Together.JsonConverters.EvaluationModelOrStringJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter, global::System.Collections.Generic.IList>()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter>()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.UnixTimestampJsonConverter()); - options.Converters.Add(new LazyEnumJsonConverterFactory()); + global::Together.SourceGenerationContext.AddConverters(options); } private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() @@ -158,118 +61,6 @@ public static void AddConverters(global::System.Text.Json.JsonSerializerOptions return options; } - - private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Serialization.JsonConverterFactory - { - public override bool CanConvert(global::System.Type typeToConvert) - { - return - typeToConvert == typeof(global::Together.EvaluationTypedRequestType) - - || typeToConvert == typeof(global::Together.EvaluationTypedRequestType?) - - || typeToConvert == typeof(global::Together.EvaluationJudgeModelConfigModelSource) - - || typeToConvert == typeof(global::Together.EvaluationJudgeModelConfigModelSource?) - - || typeToConvert == typeof(global::Together.EvaluationModelRequestModelSource) - - || typeToConvert == typeof(global::Together.EvaluationModelRequestModelSource?) - - || typeToConvert == typeof(global::Together.EvaluationResponseStatus) - - || typeToConvert == typeof(global::Together.EvaluationResponseStatus?) - - || typeToConvert == typeof(global::Together.EvaluationJobType) - - || typeToConvert == typeof(global::Together.EvaluationJobType?) - - || typeToConvert == typeof(global::Together.EvaluationJobStatus) - - || typeToConvert == typeof(global::Together.EvaluationJobStatus?) - - || typeToConvert == typeof(global::Together.GetEvaluationJobStatusAndResultsResponseStatus) - - || typeToConvert == typeof(global::Together.GetEvaluationJobStatusAndResultsResponseStatus?); - } - - public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - if (typeToConvert == typeof(global::Together.EvaluationTypedRequestType)) - { - return new global::Together.JsonConverters.EvaluationTypedRequestTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.EvaluationTypedRequestType?)) - { - return new global::Together.JsonConverters.EvaluationTypedRequestTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.EvaluationJudgeModelConfigModelSource)) - { - return new global::Together.JsonConverters.EvaluationJudgeModelConfigModelSourceJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.EvaluationJudgeModelConfigModelSource?)) - { - return new global::Together.JsonConverters.EvaluationJudgeModelConfigModelSourceNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.EvaluationModelRequestModelSource)) - { - return new global::Together.JsonConverters.EvaluationModelRequestModelSourceJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.EvaluationModelRequestModelSource?)) - { - return new global::Together.JsonConverters.EvaluationModelRequestModelSourceNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.EvaluationResponseStatus)) - { - return new global::Together.JsonConverters.EvaluationResponseStatusJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.EvaluationResponseStatus?)) - { - return new global::Together.JsonConverters.EvaluationResponseStatusNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.EvaluationJobType)) - { - return new global::Together.JsonConverters.EvaluationJobTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.EvaluationJobType?)) - { - return new global::Together.JsonConverters.EvaluationJobTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.EvaluationJobStatus)) - { - return new global::Together.JsonConverters.EvaluationJobStatusJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.EvaluationJobStatus?)) - { - return new global::Together.JsonConverters.EvaluationJobStatusNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.GetEvaluationJobStatusAndResultsResponseStatus)) - { - return new global::Together.JsonConverters.GetEvaluationJobStatusAndResultsResponseStatusJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.GetEvaluationJobStatusAndResultsResponseStatus?)) - { - return new global::Together.JsonConverters.GetEvaluationJobStatusAndResultsResponseStatusNullableJsonConverter(); - } - throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); - } - } - private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver { private readonly object _gate = new(); @@ -309,7 +100,7 @@ private sealed class LazyChunkResolver : global::System.Text.Json.Serialization. { return index switch { - 0 => new EvaluationSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), + 0 => global::Together.SourceGenerationContext.TypeInfoResolver, _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), }; } diff --git a/src/libs/Together/Generated/Together.EvaluationClient.CreateEvaluationJob.g.cs b/src/libs/Together/Generated/Together.EvaluationClient.CreateEvaluationJob.g.cs index ef40e53f..122e6188 100644 --- a/src/libs/Together/Generated/Together.EvaluationClient.CreateEvaluationJob.g.cs +++ b/src/libs/Together/Generated/Together.EvaluationClient.CreateEvaluationJob.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class EvaluationClient { + private static readonly global::Together.AutoSDKServer[] s_CreateEvaluationJobServers = 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_CreateEvaluationJobSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -48,6 +61,28 @@ partial void ProcessCreateEvaluationJobResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.evals.create(
+ /// type="classify",
+ /// parameters={
+ /// "judge": {
+ /// "model": "openai/gpt-oss-120b",
+ /// "model_source": "serverless",
+ /// "system_template": "You are an expert evaluator...",
+ /// },
+ /// "input_data_file_path": "<FILE_ID>",
+ /// "labels": ["good", "bad"],
+ /// "pass_labels": ["good"],
+ /// "model_to_evaluate": "Qwen/Qwen3.5-9B",
+ /// },
+ /// )
+ /// print(response.workflow_id) + ///
public async global::System.Threading.Tasks.Task CreateEvaluationJobAsync( global::Together.EvaluationTypedRequest request, @@ -70,6 +105,28 @@ partial void ProcessCreateEvaluationJobResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.evals.create(
+ /// type="classify",
+ /// parameters={
+ /// "judge": {
+ /// "model": "openai/gpt-oss-120b",
+ /// "model_source": "serverless",
+ /// "system_template": "You are an expert evaluator...",
+ /// },
+ /// "input_data_file_path": "<FILE_ID>",
+ /// "labels": ["good", "bad"],
+ /// "pass_labels": ["good"],
+ /// "model_to_evaluate": "Qwen/Qwen3.5-9B",
+ /// },
+ /// )
+ /// print(response.workflow_id) + ///
public async global::System.Threading.Tasks.Task> CreateEvaluationJobAsResponseAsync( global::Together.EvaluationTypedRequest request, @@ -108,8 +165,10 @@ partial void ProcessCreateEvaluationJobResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: "/v1/evaluation", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: "/evaluation", + baseUri: ResolveBaseUri( + servers: s_CreateEvaluationJobServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -175,7 +234,7 @@ partial void ProcessCreateEvaluationJobResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "CreateEvaluationJob", methodName: "CreateEvaluationJobAsync", - pathTemplate: "\"/v1/evaluation\"", + pathTemplate: "\"/evaluation\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -209,7 +268,7 @@ partial void ProcessCreateEvaluationJobResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "CreateEvaluationJob", methodName: "CreateEvaluationJobAsync", - pathTemplate: "\"/v1/evaluation\"", + pathTemplate: "\"/evaluation\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -250,7 +309,7 @@ partial void ProcessCreateEvaluationJobResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "CreateEvaluationJob", methodName: "CreateEvaluationJobAsync", - pathTemplate: "\"/v1/evaluation\"", + pathTemplate: "\"/evaluation\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -298,7 +357,7 @@ partial void ProcessCreateEvaluationJobResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "CreateEvaluationJob", methodName: "CreateEvaluationJobAsync", - pathTemplate: "\"/v1/evaluation\"", + pathTemplate: "\"/evaluation\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -320,7 +379,7 @@ partial void ProcessCreateEvaluationJobResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "CreateEvaluationJob", methodName: "CreateEvaluationJobAsync", - pathTemplate: "\"/v1/evaluation\"", + pathTemplate: "\"/evaluation\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.EvaluationClient.GetAllEvaluationJobs.g.cs b/src/libs/Together/Generated/Together.EvaluationClient.GetAllEvaluationJobs.g.cs index f910b754..19f396f0 100644 --- a/src/libs/Together/Generated/Together.EvaluationClient.GetAllEvaluationJobs.g.cs +++ b/src/libs/Together/Generated/Together.EvaluationClient.GetAllEvaluationJobs.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class EvaluationClient { + private static readonly global::Together.AutoSDKServer[] s_GetAllEvaluationJobsServers = 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_GetAllEvaluationJobsSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -56,6 +69,16 @@ partial void ProcessGetAllEvaluationJobsResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.evals.list()
+ /// for job in response:
+ /// print(job.workflow_id) + ///
public async global::System.Threading.Tasks.Task> GetAllEvaluationJobsAsync( string? status = default, int? limit = default, @@ -84,6 +107,16 @@ partial void ProcessGetAllEvaluationJobsResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.evals.list()
+ /// for job in response:
+ /// print(job.workflow_id) + ///
public async global::System.Threading.Tasks.Task>> GetAllEvaluationJobsAsResponseAsync( string? status = default, int? limit = default, @@ -121,8 +154,10 @@ partial void ProcessGetAllEvaluationJobsResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: "/v1/evaluation", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: "/evaluation", + baseUri: ResolveBaseUri( + servers: s_GetAllEvaluationJobsServers, + defaultBaseUrl: "https://api.together.ai/v1")); __pathBuilder .AddOptionalParameter("status", status) .AddOptionalParameter("limit", limit?.ToString()) @@ -187,7 +222,7 @@ partial void ProcessGetAllEvaluationJobsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetAllEvaluationJobs", methodName: "GetAllEvaluationJobsAsync", - pathTemplate: "\"/v1/evaluation\"", + pathTemplate: "\"/evaluation\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -221,7 +256,7 @@ partial void ProcessGetAllEvaluationJobsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetAllEvaluationJobs", methodName: "GetAllEvaluationJobsAsync", - pathTemplate: "\"/v1/evaluation\"", + pathTemplate: "\"/evaluation\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -262,7 +297,7 @@ partial void ProcessGetAllEvaluationJobsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetAllEvaluationJobs", methodName: "GetAllEvaluationJobsAsync", - pathTemplate: "\"/v1/evaluation\"", + pathTemplate: "\"/evaluation\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -310,7 +345,7 @@ partial void ProcessGetAllEvaluationJobsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetAllEvaluationJobs", methodName: "GetAllEvaluationJobsAsync", - pathTemplate: "\"/v1/evaluation\"", + pathTemplate: "\"/evaluation\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -332,7 +367,7 @@ partial void ProcessGetAllEvaluationJobsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetAllEvaluationJobs", methodName: "GetAllEvaluationJobsAsync", - pathTemplate: "\"/v1/evaluation\"", + pathTemplate: "\"/evaluation\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.EvaluationClient.GetEvaluationJobDetails.g.cs b/src/libs/Together/Generated/Together.EvaluationClient.GetEvaluationJobDetails.g.cs index 456d633e..398e9846 100644 --- a/src/libs/Together/Generated/Together.EvaluationClient.GetEvaluationJobDetails.g.cs +++ b/src/libs/Together/Generated/Together.EvaluationClient.GetEvaluationJobDetails.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class EvaluationClient { + private static readonly global::Together.AutoSDKServer[] s_GetEvaluationJobDetailsServers = 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_GetEvaluationJobDetailsSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -50,6 +63,15 @@ partial void ProcessGetEvaluationJobDetailsResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.evals.retrieve('<EVALUATION_ID>')
+ /// print(response) + ///
public async global::System.Threading.Tasks.Task GetEvaluationJobDetailsAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -72,6 +94,15 @@ partial void ProcessGetEvaluationJobDetailsResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.evals.retrieve('<EVALUATION_ID>')
+ /// print(response) + ///
public async global::System.Threading.Tasks.Task> GetEvaluationJobDetailsAsResponseAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -107,8 +138,10 @@ partial void ProcessGetEvaluationJobDetailsResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v1/evaluation/{id}", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/evaluation/{id}", + baseUri: ResolveBaseUri( + servers: s_GetEvaluationJobDetailsServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -168,7 +201,7 @@ partial void ProcessGetEvaluationJobDetailsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetEvaluationJobDetails", methodName: "GetEvaluationJobDetailsAsync", - pathTemplate: "$\"/v1/evaluation/{id}\"", + pathTemplate: "$\"/evaluation/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -202,7 +235,7 @@ partial void ProcessGetEvaluationJobDetailsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetEvaluationJobDetails", methodName: "GetEvaluationJobDetailsAsync", - pathTemplate: "$\"/v1/evaluation/{id}\"", + pathTemplate: "$\"/evaluation/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -243,7 +276,7 @@ partial void ProcessGetEvaluationJobDetailsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetEvaluationJobDetails", methodName: "GetEvaluationJobDetailsAsync", - pathTemplate: "$\"/v1/evaluation/{id}\"", + pathTemplate: "$\"/evaluation/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -291,7 +324,7 @@ partial void ProcessGetEvaluationJobDetailsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetEvaluationJobDetails", methodName: "GetEvaluationJobDetailsAsync", - pathTemplate: "$\"/v1/evaluation/{id}\"", + pathTemplate: "$\"/evaluation/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -313,7 +346,7 @@ partial void ProcessGetEvaluationJobDetailsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetEvaluationJobDetails", methodName: "GetEvaluationJobDetailsAsync", - pathTemplate: "$\"/v1/evaluation/{id}\"", + pathTemplate: "$\"/evaluation/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.EvaluationClient.GetEvaluationJobStatusAndResults.g.cs b/src/libs/Together/Generated/Together.EvaluationClient.GetEvaluationJobStatusAndResults.g.cs index a527e8e8..2d309fae 100644 --- a/src/libs/Together/Generated/Together.EvaluationClient.GetEvaluationJobStatusAndResults.g.cs +++ b/src/libs/Together/Generated/Together.EvaluationClient.GetEvaluationJobStatusAndResults.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class EvaluationClient { + private static readonly global::Together.AutoSDKServer[] s_GetEvaluationJobStatusAndResultsServers = 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_GetEvaluationJobStatusAndResultsSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -50,6 +63,16 @@ partial void ProcessGetEvaluationJobStatusAndResultsResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.evals.status('<EVALUATION_ID>')
+ /// print(response.status)
+ /// print(response.results) + ///
public async global::System.Threading.Tasks.Task GetEvaluationJobStatusAndResultsAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -72,6 +95,16 @@ partial void ProcessGetEvaluationJobStatusAndResultsResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.evals.status('<EVALUATION_ID>')
+ /// print(response.status)
+ /// print(response.results) + ///
public async global::System.Threading.Tasks.Task> GetEvaluationJobStatusAndResultsAsResponseAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -107,8 +140,10 @@ partial void ProcessGetEvaluationJobStatusAndResultsResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v1/evaluation/{id}/status", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/evaluation/{id}/status", + baseUri: ResolveBaseUri( + servers: s_GetEvaluationJobStatusAndResultsServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -168,7 +203,7 @@ partial void ProcessGetEvaluationJobStatusAndResultsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetEvaluationJobStatusAndResults", methodName: "GetEvaluationJobStatusAndResultsAsync", - pathTemplate: "$\"/v1/evaluation/{id}/status\"", + pathTemplate: "$\"/evaluation/{id}/status\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -202,7 +237,7 @@ partial void ProcessGetEvaluationJobStatusAndResultsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetEvaluationJobStatusAndResults", methodName: "GetEvaluationJobStatusAndResultsAsync", - pathTemplate: "$\"/v1/evaluation/{id}/status\"", + pathTemplate: "$\"/evaluation/{id}/status\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -243,7 +278,7 @@ partial void ProcessGetEvaluationJobStatusAndResultsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetEvaluationJobStatusAndResults", methodName: "GetEvaluationJobStatusAndResultsAsync", - pathTemplate: "$\"/v1/evaluation/{id}/status\"", + pathTemplate: "$\"/evaluation/{id}/status\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -291,7 +326,7 @@ partial void ProcessGetEvaluationJobStatusAndResultsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetEvaluationJobStatusAndResults", methodName: "GetEvaluationJobStatusAndResultsAsync", - pathTemplate: "$\"/v1/evaluation/{id}/status\"", + pathTemplate: "$\"/evaluation/{id}/status\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -313,7 +348,7 @@ partial void ProcessGetEvaluationJobStatusAndResultsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetEvaluationJobStatusAndResults", methodName: "GetEvaluationJobStatusAndResultsAsync", - pathTemplate: "$\"/v1/evaluation/{id}/status\"", + pathTemplate: "$\"/evaluation/{id}/status\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.EvaluationClient.GetModelList.g.cs b/src/libs/Together/Generated/Together.EvaluationClient.GetModelList.g.cs index 9ba4a5a7..73edbc3b 100644 --- a/src/libs/Together/Generated/Together.EvaluationClient.GetModelList.g.cs +++ b/src/libs/Together/Generated/Together.EvaluationClient.GetModelList.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class EvaluationClient { + private static readonly global::Together.AutoSDKServer[] s_GetModelListServers = 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_GetModelListSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -51,6 +64,18 @@ partial void ProcessGetModelListResponseContent( /// 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()
+ /// # The SDK has no dedicated method for this endpoint yet, so call it with
+ /// # the client's generic GET helper.
+ /// models = client.get(
+ /// "/evaluation/model-list",
+ /// cast_to=object,
+ /// options={"params": {"model_source": "serverless"}},
+ /// )
+ /// print(models) + ///
public async global::System.Threading.Tasks.Task GetModelListAsync( string? modelSource = default, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -74,6 +99,18 @@ partial void ProcessGetModelListResponseContent( /// 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()
+ /// # The SDK has no dedicated method for this endpoint yet, so call it with
+ /// # the client's generic GET helper.
+ /// models = client.get(
+ /// "/evaluation/model-list",
+ /// cast_to=object,
+ /// options={"params": {"model_source": "serverless"}},
+ /// )
+ /// print(models) + ///
public async global::System.Threading.Tasks.Task> GetModelListAsResponseAsync( string? modelSource = default, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -109,8 +146,10 @@ partial void ProcessGetModelListResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: "/v1/evaluation/model-list", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: "/evaluation/model-list", + baseUri: ResolveBaseUri( + servers: s_GetModelListServers, + defaultBaseUrl: "https://api.together.ai/v1")); __pathBuilder .AddOptionalParameter("model_source", modelSource) ; @@ -173,7 +212,7 @@ partial void ProcessGetModelListResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetModelList", methodName: "GetModelListAsync", - pathTemplate: "\"/v1/evaluation/model-list\"", + pathTemplate: "\"/evaluation/model-list\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -207,7 +246,7 @@ partial void ProcessGetModelListResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetModelList", methodName: "GetModelListAsync", - pathTemplate: "\"/v1/evaluation/model-list\"", + pathTemplate: "\"/evaluation/model-list\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -248,7 +287,7 @@ partial void ProcessGetModelListResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetModelList", methodName: "GetModelListAsync", - pathTemplate: "\"/v1/evaluation/model-list\"", + pathTemplate: "\"/evaluation/model-list\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -296,7 +335,7 @@ partial void ProcessGetModelListResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetModelList", methodName: "GetModelListAsync", - pathTemplate: "\"/v1/evaluation/model-list\"", + pathTemplate: "\"/evaluation/model-list\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -318,7 +357,7 @@ partial void ProcessGetModelListResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetModelList", methodName: "GetModelListAsync", - pathTemplate: "\"/v1/evaluation/model-list\"", + pathTemplate: "\"/evaluation/model-list\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.EvaluationClient.g.cs b/src/libs/Together/Generated/Together.EvaluationClient.g.cs index 81d9f652..88a79f9e 100644 --- a/src/libs/Together/Generated/Together.EvaluationClient.g.cs +++ b/src/libs/Together/Generated/Together.EvaluationClient.g.cs @@ -12,7 +12,7 @@ public sealed partial class EvaluationClient : global::Together.IEvaluationClien /// /// Default environment for APIs /// - public const string DefaultBaseUrl = "https://api.together.ai/"; + public const string DefaultBaseUrl = "https://api.together.ai/v1"; private bool _disposeHttpClient = true; @@ -20,7 +20,7 @@ public sealed partial class EvaluationClient : global::Together.IEvaluationClien 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; } @@ -53,6 +53,34 @@ public sealed partial class EvaluationClient : global::Together.IEvaluationClien } + + 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 EvaluationClient. /// If no httpClient is provided, a new one will be created. @@ -151,5 +179,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.Files.JsonSerializerContext.g.cs b/src/libs/Together/Generated/Together.Files.JsonSerializerContext.g.cs index 4d153a8e..2d7973bc 100644 --- a/src/libs/Together/Generated/Together.Files.JsonSerializerContext.g.cs +++ b/src/libs/Together/Generated/Together.Files.JsonSerializerContext.g.cs @@ -2,46 +2,7 @@ #nullable enable namespace Together -{ - /// - /// - /// - [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( - DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull - )] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(long))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ErrorData))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ErrorDataError))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(byte[]))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FileResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FilePurpose), TypeInfoPropertyName = "FilePurpose2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FileType), TypeInfoPropertyName = "FileType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FileProcessingStatus), TypeInfoPropertyName = "FileProcessingStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FileValidationReport))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FileValidationReportErrorType), TypeInfoPropertyName = "FileValidationReportErrorType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FileList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FileDeleteResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateFilesUploadRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(long?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FilePurpose?), TypeInfoPropertyName = "NullableFilePurpose2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FileType?), TypeInfoPropertyName = "NullableFileType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FileProcessingStatus?), TypeInfoPropertyName = "NullableFileProcessingStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FileValidationReportErrorType?), TypeInfoPropertyName = "NullableFileValidationReportErrorType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - internal sealed partial class FilesSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext - { - } - /// +{ /// /// /// public sealed partial class FilesSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext @@ -85,26 +46,7 @@ private FilesSourceGenerationContext(global::System.Text.Json.JsonSerializerOpti [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) { - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter, global::System.Collections.Generic.IList>()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter>()); - options.Converters.Add(new global::Together.JsonConverters.UnixTimestampJsonConverter()); - options.Converters.Add(new LazyEnumJsonConverterFactory()); + global::Together.SourceGenerationContext.AddConverters(options); } private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() @@ -119,76 +61,6 @@ public static void AddConverters(global::System.Text.Json.JsonSerializerOptions return options; } - - private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Serialization.JsonConverterFactory - { - public override bool CanConvert(global::System.Type typeToConvert) - { - return - typeToConvert == typeof(global::Together.FileProcessingStatus) - - || typeToConvert == typeof(global::Together.FileProcessingStatus?) - - || typeToConvert == typeof(global::Together.FileValidationReportErrorType) - - || typeToConvert == typeof(global::Together.FileValidationReportErrorType?) - - || typeToConvert == typeof(global::Together.FilePurpose) - - || typeToConvert == typeof(global::Together.FilePurpose?) - - || typeToConvert == typeof(global::Together.FileType) - - || typeToConvert == typeof(global::Together.FileType?); - } - - public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - if (typeToConvert == typeof(global::Together.FileProcessingStatus)) - { - return new global::Together.JsonConverters.FileProcessingStatusJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.FileProcessingStatus?)) - { - return new global::Together.JsonConverters.FileProcessingStatusNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.FileValidationReportErrorType)) - { - return new global::Together.JsonConverters.FileValidationReportErrorTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.FileValidationReportErrorType?)) - { - return new global::Together.JsonConverters.FileValidationReportErrorTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.FilePurpose)) - { - return new global::Together.JsonConverters.FilePurposeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.FilePurpose?)) - { - return new global::Together.JsonConverters.FilePurposeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.FileType)) - { - return new global::Together.JsonConverters.FileTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.FileType?)) - { - return new global::Together.JsonConverters.FileTypeNullableJsonConverter(); - } - throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); - } - } - private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver { private readonly object _gate = new(); @@ -228,7 +100,7 @@ private sealed class LazyChunkResolver : global::System.Text.Json.Serialization. { return index switch { - 0 => new FilesSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), + 0 => global::Together.SourceGenerationContext.TypeInfoResolver, _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), }; } diff --git a/src/libs/Together/Generated/Together.FilesClient.CreateFilesUpload.g.cs b/src/libs/Together/Generated/Together.FilesClient.CreateFilesUpload.g.cs index 7c137b21..3d15ffba 100644 --- a/src/libs/Together/Generated/Together.FilesClient.CreateFilesUpload.g.cs +++ b/src/libs/Together/Generated/Together.FilesClient.CreateFilesUpload.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class FilesClient { + private static readonly global::Together.AutoSDKServer[] s_CreateFilesUploadServers = 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_CreateFilesUploadSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -49,6 +62,17 @@ partial void ProcessCreateFilesUploadResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// current_dir = os.path.dirname(os.path.abspath(__file__))
+ /// file_path = os.path.join(current_dir, "data.jsonl")
+ /// file = client.files.upload(file=file_path)
+ /// print(file.id) + ///
public async global::System.Threading.Tasks.Task CreateFilesUploadAsync( global::Together.CreateFilesUploadRequest request, @@ -72,6 +96,17 @@ partial void ProcessCreateFilesUploadResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// current_dir = os.path.dirname(os.path.abspath(__file__))
+ /// file_path = os.path.join(current_dir, "data.jsonl")
+ /// file = client.files.upload(file=file_path)
+ /// print(file.id) + ///
public async global::System.Threading.Tasks.Task> CreateFilesUploadAsResponseAsync( global::Together.CreateFilesUploadRequest request, @@ -110,8 +145,10 @@ partial void ProcessCreateFilesUploadResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: "/v1/files/upload", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: "/files/upload", + baseUri: ResolveBaseUri( + servers: s_CreateFilesUploadServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -229,7 +266,7 @@ request.FileName is null context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "createFilesUpload", methodName: "CreateFilesUploadAsync", - pathTemplate: "\"/v1/files/upload\"", + pathTemplate: "\"/files/upload\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -263,7 +300,7 @@ request.FileName is null context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "createFilesUpload", methodName: "CreateFilesUploadAsync", - pathTemplate: "\"/v1/files/upload\"", + pathTemplate: "\"/files/upload\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -304,7 +341,7 @@ request.FileName is null context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "createFilesUpload", methodName: "CreateFilesUploadAsync", - pathTemplate: "\"/v1/files/upload\"", + pathTemplate: "\"/files/upload\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -352,7 +389,7 @@ request.FileName is null context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "createFilesUpload", methodName: "CreateFilesUploadAsync", - pathTemplate: "\"/v1/files/upload\"", + pathTemplate: "\"/files/upload\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -374,7 +411,7 @@ request.FileName is null context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "createFilesUpload", methodName: "CreateFilesUploadAsync", - pathTemplate: "\"/v1/files/upload\"", + pathTemplate: "\"/files/upload\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -664,6 +701,17 @@ request.FileName is null /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// current_dir = os.path.dirname(os.path.abspath(__file__))
+ /// file_path = os.path.join(current_dir, "data.jsonl")
+ /// file = client.files.upload(file=file_path)
+ /// print(file.id) + ///
public async global::System.Threading.Tasks.Task CreateFilesUploadAsync( global::Together.FilePurpose purpose, string fileName, @@ -711,8 +759,10 @@ request.FileName is null { var __pathBuilder = new global::Together.PathBuilder( - path: "/v1/files/upload", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: "/files/upload", + baseUri: ResolveBaseUri( + servers: s_CreateFilesUploadServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -830,7 +880,7 @@ request.FileName is null context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "createFilesUpload", methodName: "CreateFilesUploadAsync", - pathTemplate: "\"/v1/files/upload\"", + pathTemplate: "\"/files/upload\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -864,7 +914,7 @@ request.FileName is null context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "createFilesUpload", methodName: "CreateFilesUploadAsync", - pathTemplate: "\"/v1/files/upload\"", + pathTemplate: "\"/files/upload\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -905,7 +955,7 @@ request.FileName is null context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "createFilesUpload", methodName: "CreateFilesUploadAsync", - pathTemplate: "\"/v1/files/upload\"", + pathTemplate: "\"/files/upload\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -953,7 +1003,7 @@ request.FileName is null context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "createFilesUpload", methodName: "CreateFilesUploadAsync", - pathTemplate: "\"/v1/files/upload\"", + pathTemplate: "\"/files/upload\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -975,7 +1025,7 @@ request.FileName is null context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "createFilesUpload", methodName: "CreateFilesUploadAsync", - pathTemplate: "\"/v1/files/upload\"", + pathTemplate: "\"/files/upload\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -1212,6 +1262,17 @@ request.FileName is null /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// current_dir = os.path.dirname(os.path.abspath(__file__))
+ /// file_path = os.path.join(current_dir, "data.jsonl")
+ /// file = client.files.upload(file=file_path)
+ /// print(file.id) + ///
public async global::System.Threading.Tasks.Task> CreateFilesUploadAsResponseAsync( global::Together.FilePurpose purpose, string fileName, @@ -1259,8 +1320,10 @@ request.FileName is null { var __pathBuilder = new global::Together.PathBuilder( - path: "/v1/files/upload", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: "/files/upload", + baseUri: ResolveBaseUri( + servers: s_CreateFilesUploadServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -1378,7 +1441,7 @@ request.FileName is null context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "createFilesUpload", methodName: "CreateFilesUploadAsync", - pathTemplate: "\"/v1/files/upload\"", + pathTemplate: "\"/files/upload\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -1412,7 +1475,7 @@ request.FileName is null context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "createFilesUpload", methodName: "CreateFilesUploadAsync", - pathTemplate: "\"/v1/files/upload\"", + pathTemplate: "\"/files/upload\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -1453,7 +1516,7 @@ request.FileName is null context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "createFilesUpload", methodName: "CreateFilesUploadAsync", - pathTemplate: "\"/v1/files/upload\"", + pathTemplate: "\"/files/upload\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -1501,7 +1564,7 @@ request.FileName is null context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "createFilesUpload", methodName: "CreateFilesUploadAsync", - pathTemplate: "\"/v1/files/upload\"", + pathTemplate: "\"/files/upload\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -1523,7 +1586,7 @@ request.FileName is null context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "createFilesUpload", methodName: "CreateFilesUploadAsync", - pathTemplate: "\"/v1/files/upload\"", + pathTemplate: "\"/files/upload\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.FilesClient.DeleteFilesById.g.cs b/src/libs/Together/Generated/Together.FilesClient.DeleteFilesById.g.cs index a0729c82..a36cf5d2 100644 --- a/src/libs/Together/Generated/Together.FilesClient.DeleteFilesById.g.cs +++ b/src/libs/Together/Generated/Together.FilesClient.DeleteFilesById.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class FilesClient { + private static readonly global::Together.AutoSDKServer[] s_DeleteFilesByIdServers = 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_DeleteFilesByIdSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -51,6 +64,15 @@ partial void ProcessDeleteFilesByIdResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.files.delete(id="<FILE_ID>")
+ /// print(response) + ///
public async global::System.Threading.Tasks.Task DeleteFilesByIdAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -74,6 +96,15 @@ partial void ProcessDeleteFilesByIdResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.files.delete(id="<FILE_ID>")
+ /// print(response) + ///
public async global::System.Threading.Tasks.Task> DeleteFilesByIdAsResponseAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -109,8 +140,10 @@ partial void ProcessDeleteFilesByIdResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v1/files/{id}", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/files/{id}", + baseUri: ResolveBaseUri( + servers: s_DeleteFilesByIdServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -170,7 +203,7 @@ partial void ProcessDeleteFilesByIdResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "deleteFilesById", methodName: "DeleteFilesByIdAsync", - pathTemplate: "$\"/v1/files/{id}\"", + pathTemplate: "$\"/files/{id}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -204,7 +237,7 @@ partial void ProcessDeleteFilesByIdResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "deleteFilesById", methodName: "DeleteFilesByIdAsync", - pathTemplate: "$\"/v1/files/{id}\"", + pathTemplate: "$\"/files/{id}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -245,7 +278,7 @@ partial void ProcessDeleteFilesByIdResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "deleteFilesById", methodName: "DeleteFilesByIdAsync", - pathTemplate: "$\"/v1/files/{id}\"", + pathTemplate: "$\"/files/{id}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -293,7 +326,7 @@ partial void ProcessDeleteFilesByIdResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "deleteFilesById", methodName: "DeleteFilesByIdAsync", - pathTemplate: "$\"/v1/files/{id}\"", + pathTemplate: "$\"/files/{id}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -315,7 +348,7 @@ partial void ProcessDeleteFilesByIdResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "deleteFilesById", methodName: "DeleteFilesByIdAsync", - pathTemplate: "$\"/v1/files/{id}\"", + pathTemplate: "$\"/files/{id}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.FilesClient.GetFiles.g.cs b/src/libs/Together/Generated/Together.FilesClient.GetFiles.g.cs index 85fab63a..0bab2897 100644 --- a/src/libs/Together/Generated/Together.FilesClient.GetFiles.g.cs +++ b/src/libs/Together/Generated/Together.FilesClient.GetFiles.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class FilesClient { + private static readonly global::Together.AutoSDKServer[] s_GetFilesServers = 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_GetFilesSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -46,6 +59,16 @@ partial void ProcessGetFilesResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.files.list()
+ /// for file in response.data:
+ /// print(file.id) + ///
public async global::System.Threading.Tasks.Task GetFilesAsync( global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -64,6 +87,16 @@ partial void ProcessGetFilesResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.files.list()
+ /// for file in response.data:
+ /// print(file.id) + ///
public async global::System.Threading.Tasks.Task> GetFilesAsResponseAsync( global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -97,8 +130,10 @@ partial void ProcessGetFilesResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: "/v1/files", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: "/files", + baseUri: ResolveBaseUri( + servers: s_GetFilesServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -157,7 +192,7 @@ partial void ProcessGetFilesResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getFiles", methodName: "GetFilesAsync", - pathTemplate: "\"/v1/files\"", + pathTemplate: "\"/files\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -191,7 +226,7 @@ partial void ProcessGetFilesResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getFiles", methodName: "GetFilesAsync", - pathTemplate: "\"/v1/files\"", + pathTemplate: "\"/files\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -232,7 +267,7 @@ partial void ProcessGetFilesResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getFiles", methodName: "GetFilesAsync", - pathTemplate: "\"/v1/files\"", + pathTemplate: "\"/files\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -280,7 +315,7 @@ partial void ProcessGetFilesResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getFiles", methodName: "GetFilesAsync", - pathTemplate: "\"/v1/files\"", + pathTemplate: "\"/files\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -302,7 +337,7 @@ partial void ProcessGetFilesResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getFiles", methodName: "GetFilesAsync", - pathTemplate: "\"/v1/files\"", + pathTemplate: "\"/files\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.FilesClient.GetFilesById.g.cs b/src/libs/Together/Generated/Together.FilesClient.GetFilesById.g.cs index e1198e99..5e583deb 100644 --- a/src/libs/Together/Generated/Together.FilesClient.GetFilesById.g.cs +++ b/src/libs/Together/Generated/Together.FilesClient.GetFilesById.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class FilesClient { + private static readonly global::Together.AutoSDKServer[] s_GetFilesByIdServers = 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_GetFilesByIdSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -51,6 +64,15 @@ partial void ProcessGetFilesByIdResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// file = client.files.retrieve(id="<FILE_ID>")
+ /// print(file) + ///
public async global::System.Threading.Tasks.Task GetFilesByIdAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -74,6 +96,15 @@ partial void ProcessGetFilesByIdResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// file = client.files.retrieve(id="<FILE_ID>")
+ /// print(file) + ///
public async global::System.Threading.Tasks.Task> GetFilesByIdAsResponseAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -109,8 +140,10 @@ partial void ProcessGetFilesByIdResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v1/files/{id}", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/files/{id}", + baseUri: ResolveBaseUri( + servers: s_GetFilesByIdServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -170,7 +203,7 @@ partial void ProcessGetFilesByIdResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getFilesById", methodName: "GetFilesByIdAsync", - pathTemplate: "$\"/v1/files/{id}\"", + pathTemplate: "$\"/files/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -204,7 +237,7 @@ partial void ProcessGetFilesByIdResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getFilesById", methodName: "GetFilesByIdAsync", - pathTemplate: "$\"/v1/files/{id}\"", + pathTemplate: "$\"/files/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -245,7 +278,7 @@ partial void ProcessGetFilesByIdResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getFilesById", methodName: "GetFilesByIdAsync", - pathTemplate: "$\"/v1/files/{id}\"", + pathTemplate: "$\"/files/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -293,7 +326,7 @@ partial void ProcessGetFilesByIdResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getFilesById", methodName: "GetFilesByIdAsync", - pathTemplate: "$\"/v1/files/{id}\"", + pathTemplate: "$\"/files/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -315,7 +348,7 @@ partial void ProcessGetFilesByIdResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getFilesById", methodName: "GetFilesByIdAsync", - pathTemplate: "$\"/v1/files/{id}\"", + pathTemplate: "$\"/files/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.FilesClient.GetFilesByIdContent.g.cs b/src/libs/Together/Generated/Together.FilesClient.GetFilesByIdContent.g.cs index 895bc3e9..4e09e8e9 100644 --- a/src/libs/Together/Generated/Together.FilesClient.GetFilesByIdContent.g.cs +++ b/src/libs/Together/Generated/Together.FilesClient.GetFilesByIdContent.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class FilesClient { + private static readonly global::Together.AutoSDKServer[] s_GetFilesByIdContentServers = 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_GetFilesByIdContentSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -51,6 +64,16 @@ partial void ProcessGetFilesByIdContentResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// with client.files.with_streaming_response.content(id="<FILE_ID>") as response:
+ /// for line in response.iter_lines():
+ /// print(line) + ///
public async global::System.Threading.Tasks.Task GetFilesByIdContentAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -74,6 +97,16 @@ partial void ProcessGetFilesByIdContentResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// with client.files.with_streaming_response.content(id="<FILE_ID>") as response:
+ /// for line in response.iter_lines():
+ /// print(line) + ///
public async global::System.Threading.Tasks.Task GetFilesByIdContentAsStreamAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -109,8 +142,10 @@ partial void ProcessGetFilesByIdContentResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v1/files/{id}/content", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/files/{id}/content", + baseUri: ResolveBaseUri( + servers: s_GetFilesByIdContentServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -170,7 +205,7 @@ partial void ProcessGetFilesByIdContentResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getFilesByIdContent", methodName: "GetFilesByIdContentAsync", - pathTemplate: "$\"/v1/files/{id}/content\"", + pathTemplate: "$\"/files/{id}/content\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -204,7 +239,7 @@ partial void ProcessGetFilesByIdContentResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getFilesByIdContent", methodName: "GetFilesByIdContentAsync", - pathTemplate: "$\"/v1/files/{id}/content\"", + pathTemplate: "$\"/files/{id}/content\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -245,7 +280,7 @@ partial void ProcessGetFilesByIdContentResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getFilesByIdContent", methodName: "GetFilesByIdContentAsync", - pathTemplate: "$\"/v1/files/{id}/content\"", + pathTemplate: "$\"/files/{id}/content\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -293,7 +328,7 @@ partial void ProcessGetFilesByIdContentResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getFilesByIdContent", methodName: "GetFilesByIdContentAsync", - pathTemplate: "$\"/v1/files/{id}/content\"", + pathTemplate: "$\"/files/{id}/content\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -315,7 +350,7 @@ partial void ProcessGetFilesByIdContentResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getFilesByIdContent", methodName: "GetFilesByIdContentAsync", - pathTemplate: "$\"/v1/files/{id}/content\"", + pathTemplate: "$\"/files/{id}/content\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -428,6 +463,16 @@ partial void ProcessGetFilesByIdContentResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// with client.files.with_streaming_response.content(id="<FILE_ID>") as response:
+ /// for line in response.iter_lines():
+ /// print(line) + ///
public async global::System.Threading.Tasks.Task> GetFilesByIdContentAsResponseAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -463,8 +508,10 @@ partial void ProcessGetFilesByIdContentResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v1/files/{id}/content", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/files/{id}/content", + baseUri: ResolveBaseUri( + servers: s_GetFilesByIdContentServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -524,7 +571,7 @@ partial void ProcessGetFilesByIdContentResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getFilesByIdContent", methodName: "GetFilesByIdContentAsync", - pathTemplate: "$\"/v1/files/{id}/content\"", + pathTemplate: "$\"/files/{id}/content\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -558,7 +605,7 @@ partial void ProcessGetFilesByIdContentResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getFilesByIdContent", methodName: "GetFilesByIdContentAsync", - pathTemplate: "$\"/v1/files/{id}/content\"", + pathTemplate: "$\"/files/{id}/content\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -599,7 +646,7 @@ partial void ProcessGetFilesByIdContentResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getFilesByIdContent", methodName: "GetFilesByIdContentAsync", - pathTemplate: "$\"/v1/files/{id}/content\"", + pathTemplate: "$\"/files/{id}/content\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -647,7 +694,7 @@ partial void ProcessGetFilesByIdContentResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getFilesByIdContent", methodName: "GetFilesByIdContentAsync", - pathTemplate: "$\"/v1/files/{id}/content\"", + pathTemplate: "$\"/files/{id}/content\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -669,7 +716,7 @@ partial void ProcessGetFilesByIdContentResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getFilesByIdContent", methodName: "GetFilesByIdContentAsync", - pathTemplate: "$\"/v1/files/{id}/content\"", + pathTemplate: "$\"/files/{id}/content\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.FilesClient.g.cs b/src/libs/Together/Generated/Together.FilesClient.g.cs index 24039096..ad456820 100644 --- a/src/libs/Together/Generated/Together.FilesClient.g.cs +++ b/src/libs/Together/Generated/Together.FilesClient.g.cs @@ -12,7 +12,7 @@ public sealed partial class FilesClient : global::Together.IFilesClient, global: /// /// Default environment for APIs /// - public const string DefaultBaseUrl = "https://api.together.ai/"; + public const string DefaultBaseUrl = "https://api.together.ai/v1"; private bool _disposeHttpClient = true; @@ -20,7 +20,7 @@ public sealed partial class FilesClient : global::Together.IFilesClient, 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; } @@ -53,6 +53,34 @@ public sealed partial class FilesClient : global::Together.IFilesClient, global: } + + 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 FilesClient. /// If no httpClient is provided, a new one will be created. @@ -151,5 +179,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.FineTuning.JsonSerializerContext.g.cs b/src/libs/Together/Generated/Together.FineTuning.JsonSerializerContext.g.cs index ca94a5f3..ab0b835b 100644 --- a/src/libs/Together/Generated/Together.FineTuning.JsonSerializerContext.g.cs +++ b/src/libs/Together/Generated/Together.FineTuning.JsonSerializerContext.g.cs @@ -2,144 +2,7 @@ #nullable enable namespace Together -{ - /// - /// - /// - [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( - DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull - )] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(double))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(long))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ErrorData))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ErrorDataError))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(byte[]))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FinetuneResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Guid))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf), TypeInfoPropertyName = "OneOfInt32FinetuneResponseBatchSize2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FinetuneResponseBatchSize), TypeInfoPropertyName = "FinetuneResponseBatchSize2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.LRScheduler))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf), TypeInfoPropertyName = "OneOfBooleanFinetuneResponseTrainOnInputs2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FinetuneResponseTrainOnInputs), TypeInfoPropertyName = "FinetuneResponseTrainOnInputs2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf), TypeInfoPropertyName = "OneOfTrainingMethodSFTTrainingMethodDPO2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.TrainingMethodSFT))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.TrainingMethodDPO))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf), TypeInfoPropertyName = "OneOfFullTrainingTypeLoRATrainingType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FullTrainingType))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.LoRATrainingType))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.MultimodalParams))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FinetuneJobStatus), TypeInfoPropertyName = "FinetuneJobStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FineTuneEvent))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FineTuneProgress))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FinetuneResponseTruncated))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FinetuneDeleteResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FineTunePreviewRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FineTunePreviewRequestTrainingMethod), TypeInfoPropertyName = "FineTunePreviewRequestTrainingMethod2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FineTunePreviewResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FineTunePreviewResponseDatasetFormat), TypeInfoPropertyName = "FineTunePreviewResponseDatasetFormat2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FineTunePreviewRow))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList>))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FineTunePreviewMessageError))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FineTunePreviewDetailError))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FineTuneModelLimits))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FineTuneModelLimitsFullTraining))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FineTuneModelLimitsLoraTraining))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FinetuneEventLevels), TypeInfoPropertyName = "FinetuneEventLevels2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FinetuneEventType), TypeInfoPropertyName = "FinetuneEventType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FinetuneTruncatedList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FinetuneListEvents))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FineTuneTokenizedDatasetRetrieveResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FinetuneListCheckpoints))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FineTuneCheckpoint))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FineTuneCheckpointCheckpoint), TypeInfoPropertyName = "FineTuneCheckpointCheckpoint2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FullTrainingTypeType), TypeInfoPropertyName = "FullTrainingTypeType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.LoRATrainingTypeType), TypeInfoPropertyName = "LoRATrainingTypeType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.TrainingMethodSFTMethod), TypeInfoPropertyName = "TrainingMethodSFTMethod2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf), TypeInfoPropertyName = "OneOfBooleanTrainingMethodSFTTrainOnInputs2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.TrainingMethodSFTTrainOnInputs), TypeInfoPropertyName = "TrainingMethodSFTTrainOnInputs2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.TrainingMethodDPOMethod), TypeInfoPropertyName = "TrainingMethodDPOMethod2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.LRSchedulerLrSchedulerType), TypeInfoPropertyName = "LRSchedulerLrSchedulerType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf), TypeInfoPropertyName = "OneOfLinearLRSchedulerArgsCosineLRSchedulerArgs2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.LinearLRSchedulerArgs))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CosineLRSchedulerArgs))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateFineTunesRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf), TypeInfoPropertyName = "OneOfInt32CreateFineTunesRequestBatchSize2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateFineTunesRequestBatchSize), TypeInfoPropertyName = "CreateFineTunesRequestBatchSize2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AnyOf), TypeInfoPropertyName = "AnyOfFullTrainingTypeLoRATrainingType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateFineTunesEstimatePriceRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GetFinetuneDownloadCheckpoint), TypeInfoPropertyName = "GetFinetuneDownloadCheckpoint2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf), TypeInfoPropertyName = "OneOfCreateFineTunesEstimatePriceResponseVariant1CreateFineTunesEstimatePriceResponseVariant22")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateFineTunesEstimatePriceResponseVariant1))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateFineTunesEstimatePriceResponseVariant2))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateFineTunesEstimatePriceResponseVariant2UnavailableReason), TypeInfoPropertyName = "CreateFineTunesEstimatePriceResponseVariant2UnavailableReason2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf), TypeInfoPropertyName = "OneOfFineTunePreviewMessageErrorFineTunePreviewDetailError2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GetFineTunesMetricsResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList>))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GetFineTunesModelsSupportedResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GetFineTunesModelsSupportedResponseDetailedModel))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GetFineTunesModelsLimitsResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(double?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(long?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Guid?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf?), TypeInfoPropertyName = "NullableOneOfInt32FinetuneResponseBatchSize2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FinetuneResponseBatchSize?), TypeInfoPropertyName = "NullableFinetuneResponseBatchSize2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf?), TypeInfoPropertyName = "NullableOneOfBooleanFinetuneResponseTrainOnInputs2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FinetuneResponseTrainOnInputs?), TypeInfoPropertyName = "NullableFinetuneResponseTrainOnInputs2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf?), TypeInfoPropertyName = "NullableOneOfTrainingMethodSFTTrainingMethodDPO2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf?), TypeInfoPropertyName = "NullableOneOfFullTrainingTypeLoRATrainingType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FinetuneJobStatus?), TypeInfoPropertyName = "NullableFinetuneJobStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FineTunePreviewRequestTrainingMethod?), TypeInfoPropertyName = "NullableFineTunePreviewRequestTrainingMethod2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FineTunePreviewResponseDatasetFormat?), TypeInfoPropertyName = "NullableFineTunePreviewResponseDatasetFormat2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FinetuneEventLevels?), TypeInfoPropertyName = "NullableFinetuneEventLevels2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FinetuneEventType?), TypeInfoPropertyName = "NullableFinetuneEventType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FineTuneCheckpointCheckpoint?), TypeInfoPropertyName = "NullableFineTuneCheckpointCheckpoint2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FullTrainingTypeType?), TypeInfoPropertyName = "NullableFullTrainingTypeType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.LoRATrainingTypeType?), TypeInfoPropertyName = "NullableLoRATrainingTypeType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.TrainingMethodSFTMethod?), TypeInfoPropertyName = "NullableTrainingMethodSFTMethod2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf?), TypeInfoPropertyName = "NullableOneOfBooleanTrainingMethodSFTTrainOnInputs2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.TrainingMethodSFTTrainOnInputs?), TypeInfoPropertyName = "NullableTrainingMethodSFTTrainOnInputs2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.TrainingMethodDPOMethod?), TypeInfoPropertyName = "NullableTrainingMethodDPOMethod2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.LRSchedulerLrSchedulerType?), TypeInfoPropertyName = "NullableLRSchedulerLrSchedulerType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf?), TypeInfoPropertyName = "NullableOneOfLinearLRSchedulerArgsCosineLRSchedulerArgs2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf?), TypeInfoPropertyName = "NullableOneOfInt32CreateFineTunesRequestBatchSize2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateFineTunesRequestBatchSize?), TypeInfoPropertyName = "NullableCreateFineTunesRequestBatchSize2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AnyOf?), TypeInfoPropertyName = "NullableAnyOfFullTrainingTypeLoRATrainingType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GetFinetuneDownloadCheckpoint?), TypeInfoPropertyName = "NullableGetFinetuneDownloadCheckpoint2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf?), TypeInfoPropertyName = "NullableOneOfCreateFineTunesEstimatePriceResponseVariant1CreateFineTunesEstimatePriceResponseVariant22")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateFineTunesEstimatePriceResponseVariant2UnavailableReason?), TypeInfoPropertyName = "NullableCreateFineTunesEstimatePriceResponseVariant2UnavailableReason2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf?), TypeInfoPropertyName = "NullableOneOfFineTunePreviewMessageErrorFineTunePreviewDetailError2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List>))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List>))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - internal sealed partial class FineTuningSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext - { - } - /// +{ /// /// /// public sealed partial class FineTuningSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext @@ -183,41 +46,7 @@ private FineTuningSourceGenerationContext(global::System.Text.Json.JsonSerialize [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) { - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter, global::System.Collections.Generic.IList>()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter>()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.AnyOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.UnixTimestampJsonConverter()); - options.Converters.Add(new LazyEnumJsonConverterFactory()); + global::Together.SourceGenerationContext.AddConverters(options); } private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() @@ -232,258 +61,6 @@ public static void AddConverters(global::System.Text.Json.JsonSerializerOptions return options; } - - private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Serialization.JsonConverterFactory - { - public override bool CanConvert(global::System.Type typeToConvert) - { - return - typeToConvert == typeof(global::Together.FinetuneResponseBatchSize) - - || typeToConvert == typeof(global::Together.FinetuneResponseBatchSize?) - - || typeToConvert == typeof(global::Together.FinetuneResponseTrainOnInputs) - - || typeToConvert == typeof(global::Together.FinetuneResponseTrainOnInputs?) - - || typeToConvert == typeof(global::Together.FineTunePreviewRequestTrainingMethod) - - || typeToConvert == typeof(global::Together.FineTunePreviewRequestTrainingMethod?) - - || typeToConvert == typeof(global::Together.FineTunePreviewResponseDatasetFormat) - - || typeToConvert == typeof(global::Together.FineTunePreviewResponseDatasetFormat?) - - || typeToConvert == typeof(global::Together.FinetuneJobStatus) - - || typeToConvert == typeof(global::Together.FinetuneJobStatus?) - - || typeToConvert == typeof(global::Together.FinetuneEventLevels) - - || typeToConvert == typeof(global::Together.FinetuneEventLevels?) - - || typeToConvert == typeof(global::Together.FinetuneEventType) - - || typeToConvert == typeof(global::Together.FinetuneEventType?) - - || typeToConvert == typeof(global::Together.FineTuneCheckpointCheckpoint) - - || typeToConvert == typeof(global::Together.FineTuneCheckpointCheckpoint?) - - || typeToConvert == typeof(global::Together.FullTrainingTypeType) - - || typeToConvert == typeof(global::Together.FullTrainingTypeType?) - - || typeToConvert == typeof(global::Together.LoRATrainingTypeType) - - || typeToConvert == typeof(global::Together.LoRATrainingTypeType?) - - || typeToConvert == typeof(global::Together.TrainingMethodSFTMethod) - - || typeToConvert == typeof(global::Together.TrainingMethodSFTMethod?) - - || typeToConvert == typeof(global::Together.TrainingMethodSFTTrainOnInputs) - - || typeToConvert == typeof(global::Together.TrainingMethodSFTTrainOnInputs?) - - || typeToConvert == typeof(global::Together.TrainingMethodDPOMethod) - - || typeToConvert == typeof(global::Together.TrainingMethodDPOMethod?) - - || typeToConvert == typeof(global::Together.LRSchedulerLrSchedulerType) - - || typeToConvert == typeof(global::Together.LRSchedulerLrSchedulerType?) - - || typeToConvert == typeof(global::Together.CreateFineTunesRequestBatchSize) - - || typeToConvert == typeof(global::Together.CreateFineTunesRequestBatchSize?) - - || typeToConvert == typeof(global::Together.GetFinetuneDownloadCheckpoint) - - || typeToConvert == typeof(global::Together.GetFinetuneDownloadCheckpoint?) - - || typeToConvert == typeof(global::Together.CreateFineTunesEstimatePriceResponseVariant2UnavailableReason) - - || typeToConvert == typeof(global::Together.CreateFineTunesEstimatePriceResponseVariant2UnavailableReason?); - } - - public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - if (typeToConvert == typeof(global::Together.FinetuneResponseBatchSize)) - { - return new global::Together.JsonConverters.FinetuneResponseBatchSizeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.FinetuneResponseBatchSize?)) - { - return new global::Together.JsonConverters.FinetuneResponseBatchSizeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.FinetuneResponseTrainOnInputs)) - { - return new global::Together.JsonConverters.FinetuneResponseTrainOnInputsJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.FinetuneResponseTrainOnInputs?)) - { - return new global::Together.JsonConverters.FinetuneResponseTrainOnInputsNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.FineTunePreviewRequestTrainingMethod)) - { - return new global::Together.JsonConverters.FineTunePreviewRequestTrainingMethodJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.FineTunePreviewRequestTrainingMethod?)) - { - return new global::Together.JsonConverters.FineTunePreviewRequestTrainingMethodNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.FineTunePreviewResponseDatasetFormat)) - { - return new global::Together.JsonConverters.FineTunePreviewResponseDatasetFormatJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.FineTunePreviewResponseDatasetFormat?)) - { - return new global::Together.JsonConverters.FineTunePreviewResponseDatasetFormatNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.FinetuneJobStatus)) - { - return new global::Together.JsonConverters.FinetuneJobStatusJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.FinetuneJobStatus?)) - { - return new global::Together.JsonConverters.FinetuneJobStatusNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.FinetuneEventLevels)) - { - return new global::Together.JsonConverters.FinetuneEventLevelsJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.FinetuneEventLevels?)) - { - return new global::Together.JsonConverters.FinetuneEventLevelsNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.FinetuneEventType)) - { - return new global::Together.JsonConverters.FinetuneEventTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.FinetuneEventType?)) - { - return new global::Together.JsonConverters.FinetuneEventTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.FineTuneCheckpointCheckpoint)) - { - return new global::Together.JsonConverters.FineTuneCheckpointCheckpointJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.FineTuneCheckpointCheckpoint?)) - { - return new global::Together.JsonConverters.FineTuneCheckpointCheckpointNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.FullTrainingTypeType)) - { - return new global::Together.JsonConverters.FullTrainingTypeTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.FullTrainingTypeType?)) - { - return new global::Together.JsonConverters.FullTrainingTypeTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.LoRATrainingTypeType)) - { - return new global::Together.JsonConverters.LoRATrainingTypeTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.LoRATrainingTypeType?)) - { - return new global::Together.JsonConverters.LoRATrainingTypeTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.TrainingMethodSFTMethod)) - { - return new global::Together.JsonConverters.TrainingMethodSFTMethodJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.TrainingMethodSFTMethod?)) - { - return new global::Together.JsonConverters.TrainingMethodSFTMethodNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.TrainingMethodSFTTrainOnInputs)) - { - return new global::Together.JsonConverters.TrainingMethodSFTTrainOnInputsJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.TrainingMethodSFTTrainOnInputs?)) - { - return new global::Together.JsonConverters.TrainingMethodSFTTrainOnInputsNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.TrainingMethodDPOMethod)) - { - return new global::Together.JsonConverters.TrainingMethodDPOMethodJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.TrainingMethodDPOMethod?)) - { - return new global::Together.JsonConverters.TrainingMethodDPOMethodNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.LRSchedulerLrSchedulerType)) - { - return new global::Together.JsonConverters.LRSchedulerLrSchedulerTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.LRSchedulerLrSchedulerType?)) - { - return new global::Together.JsonConverters.LRSchedulerLrSchedulerTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.CreateFineTunesRequestBatchSize)) - { - return new global::Together.JsonConverters.CreateFineTunesRequestBatchSizeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.CreateFineTunesRequestBatchSize?)) - { - return new global::Together.JsonConverters.CreateFineTunesRequestBatchSizeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.GetFinetuneDownloadCheckpoint)) - { - return new global::Together.JsonConverters.GetFinetuneDownloadCheckpointJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.GetFinetuneDownloadCheckpoint?)) - { - return new global::Together.JsonConverters.GetFinetuneDownloadCheckpointNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.CreateFineTunesEstimatePriceResponseVariant2UnavailableReason)) - { - return new global::Together.JsonConverters.CreateFineTunesEstimatePriceResponseVariant2UnavailableReasonJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.CreateFineTunesEstimatePriceResponseVariant2UnavailableReason?)) - { - return new global::Together.JsonConverters.CreateFineTunesEstimatePriceResponseVariant2UnavailableReasonNullableJsonConverter(); - } - throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); - } - } - private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver { private readonly object _gate = new(); @@ -523,7 +100,7 @@ private sealed class LazyChunkResolver : global::System.Text.Json.Serialization. { return index switch { - 0 => new FineTuningSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), + 0 => global::Together.SourceGenerationContext.TypeInfoResolver, _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), }; } diff --git a/src/libs/Together/Generated/Together.FineTuningClient.CreateFineTunes.g.cs b/src/libs/Together/Generated/Together.FineTuningClient.CreateFineTunes.g.cs index ee599f26..5de9a838 100644 --- a/src/libs/Together/Generated/Together.FineTuningClient.CreateFineTunes.g.cs +++ b/src/libs/Together/Generated/Together.FineTuningClient.CreateFineTunes.g.cs @@ -1,11 +1,26 @@ #nullable enable +#pragma warning disable CS0618 // Type or member is obsolete + namespace Together { public partial class FineTuningClient { + private static readonly global::Together.AutoSDKServer[] s_CreateFineTunesServers = 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_CreateFineTunesSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -49,6 +64,18 @@ partial void ProcessCreateFineTunesResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.fine_tuning.create(
+ /// model="meta-llama/Meta-Llama-3.1-8B-Instruct-Reference",
+ /// training_file="<FILE_ID>"
+ /// )
+ /// print(response) + ///
public async global::System.Threading.Tasks.Task CreateFineTunesAsync( global::Together.CreateFineTunesRequest request, @@ -72,6 +99,18 @@ partial void ProcessCreateFineTunesResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.fine_tuning.create(
+ /// model="meta-llama/Meta-Llama-3.1-8B-Instruct-Reference",
+ /// training_file="<FILE_ID>"
+ /// )
+ /// print(response) + ///
public async global::System.Threading.Tasks.Task> CreateFineTunesAsResponseAsync( global::Together.CreateFineTunesRequest request, @@ -110,8 +149,10 @@ partial void ProcessCreateFineTunesResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: "/v1/fine-tunes", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: "/fine-tunes", + baseUri: ResolveBaseUri( + servers: s_CreateFineTunesServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -177,7 +218,7 @@ partial void ProcessCreateFineTunesResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "createFineTunes", methodName: "CreateFineTunesAsync", - pathTemplate: "\"/v1/fine-tunes\"", + pathTemplate: "\"/fine-tunes\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -211,7 +252,7 @@ partial void ProcessCreateFineTunesResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "createFineTunes", methodName: "CreateFineTunesAsync", - pathTemplate: "\"/v1/fine-tunes\"", + pathTemplate: "\"/fine-tunes\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -252,7 +293,7 @@ partial void ProcessCreateFineTunesResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "createFineTunes", methodName: "CreateFineTunesAsync", - pathTemplate: "\"/v1/fine-tunes\"", + pathTemplate: "\"/fine-tunes\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -300,7 +341,7 @@ partial void ProcessCreateFineTunesResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "createFineTunes", methodName: "CreateFineTunesAsync", - pathTemplate: "\"/v1/fine-tunes\"", + pathTemplate: "\"/fine-tunes\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -322,7 +363,7 @@ partial void ProcessCreateFineTunesResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "createFineTunes", methodName: "CreateFineTunesAsync", - pathTemplate: "\"/v1/fine-tunes\"", + pathTemplate: "\"/fine-tunes\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.FineTuningClient.CreateFineTunesByIdCancel.g.cs b/src/libs/Together/Generated/Together.FineTuningClient.CreateFineTunesByIdCancel.g.cs index bcd8ffb3..5acee187 100644 --- a/src/libs/Together/Generated/Together.FineTuningClient.CreateFineTunesByIdCancel.g.cs +++ b/src/libs/Together/Generated/Together.FineTuningClient.CreateFineTunesByIdCancel.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class FineTuningClient { + private static readonly global::Together.AutoSDKServer[] s_CreateFineTunesByIdCancelServers = 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_CreateFineTunesByIdCancelSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -51,6 +64,15 @@ partial void ProcessCreateFineTunesByIdCancelResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.fine_tuning.cancel(id="<JOB_ID>")
+ /// print(response) + ///
public async global::System.Threading.Tasks.Task CreateFineTunesByIdCancelAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -74,6 +96,15 @@ partial void ProcessCreateFineTunesByIdCancelResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.fine_tuning.cancel(id="<JOB_ID>")
+ /// print(response) + ///
public async global::System.Threading.Tasks.Task> CreateFineTunesByIdCancelAsResponseAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -109,8 +140,10 @@ partial void ProcessCreateFineTunesByIdCancelResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v1/fine-tunes/{id}/cancel", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/fine-tunes/{id}/cancel", + baseUri: ResolveBaseUri( + servers: s_CreateFineTunesByIdCancelServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -170,7 +203,7 @@ partial void ProcessCreateFineTunesByIdCancelResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "createFineTunesByIdCancel", methodName: "CreateFineTunesByIdCancelAsync", - pathTemplate: "$\"/v1/fine-tunes/{id}/cancel\"", + pathTemplate: "$\"/fine-tunes/{id}/cancel\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -204,7 +237,7 @@ partial void ProcessCreateFineTunesByIdCancelResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "createFineTunesByIdCancel", methodName: "CreateFineTunesByIdCancelAsync", - pathTemplate: "$\"/v1/fine-tunes/{id}/cancel\"", + pathTemplate: "$\"/fine-tunes/{id}/cancel\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -245,7 +278,7 @@ partial void ProcessCreateFineTunesByIdCancelResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "createFineTunesByIdCancel", methodName: "CreateFineTunesByIdCancelAsync", - pathTemplate: "$\"/v1/fine-tunes/{id}/cancel\"", + pathTemplate: "$\"/fine-tunes/{id}/cancel\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -293,7 +326,7 @@ partial void ProcessCreateFineTunesByIdCancelResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "createFineTunesByIdCancel", methodName: "CreateFineTunesByIdCancelAsync", - pathTemplate: "$\"/v1/fine-tunes/{id}/cancel\"", + pathTemplate: "$\"/fine-tunes/{id}/cancel\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -315,7 +348,7 @@ partial void ProcessCreateFineTunesByIdCancelResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "createFineTunesByIdCancel", methodName: "CreateFineTunesByIdCancelAsync", - pathTemplate: "$\"/v1/fine-tunes/{id}/cancel\"", + pathTemplate: "$\"/fine-tunes/{id}/cancel\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.FineTuningClient.CreateFineTunesEstimatePrice.g.cs b/src/libs/Together/Generated/Together.FineTuningClient.CreateFineTunesEstimatePrice.g.cs index c1ed25f6..2bcb9030 100644 --- a/src/libs/Together/Generated/Together.FineTuningClient.CreateFineTunesEstimatePrice.g.cs +++ b/src/libs/Together/Generated/Together.FineTuningClient.CreateFineTunesEstimatePrice.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class FineTuningClient { + private static readonly global::Together.AutoSDKServer[] s_CreateFineTunesEstimatePriceServers = 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_CreateFineTunesEstimatePriceSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -49,6 +62,18 @@ partial void ProcessCreateFineTunesEstimatePriceResponseContent( /// 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()
+ /// estimate = client.fine_tuning.estimate_price(
+ /// training_file="<FILE_ID>",
+ /// model="meta-llama/Meta-Llama-3.1-8B-Instruct-Reference",
+ /// n_epochs=3,
+ /// training_method={"method": "sft", "train_on_inputs": "auto"},
+ /// training_type={"type": "Lora", "lora_r": 8, "lora_alpha": 16},
+ /// )
+ /// print(estimate) + ///
public async global::System.Threading.Tasks.Task> CreateFineTunesEstimatePriceAsync( global::Together.CreateFineTunesEstimatePriceRequest request, @@ -72,6 +97,18 @@ partial void ProcessCreateFineTunesEstimatePriceResponseContent( /// 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()
+ /// estimate = client.fine_tuning.estimate_price(
+ /// training_file="<FILE_ID>",
+ /// model="meta-llama/Meta-Llama-3.1-8B-Instruct-Reference",
+ /// n_epochs=3,
+ /// training_method={"method": "sft", "train_on_inputs": "auto"},
+ /// training_type={"type": "Lora", "lora_r": 8, "lora_alpha": 16},
+ /// )
+ /// print(estimate) + ///
public async global::System.Threading.Tasks.Task>> CreateFineTunesEstimatePriceAsResponseAsync( global::Together.CreateFineTunesEstimatePriceRequest request, @@ -110,8 +147,10 @@ partial void ProcessCreateFineTunesEstimatePriceResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: "/v1/fine-tunes/estimate-price", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: "/fine-tunes/estimate-price", + baseUri: ResolveBaseUri( + servers: s_CreateFineTunesEstimatePriceServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -177,7 +216,7 @@ partial void ProcessCreateFineTunesEstimatePriceResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "createFineTunesEstimatePrice", methodName: "CreateFineTunesEstimatePriceAsync", - pathTemplate: "\"/v1/fine-tunes/estimate-price\"", + pathTemplate: "\"/fine-tunes/estimate-price\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -211,7 +250,7 @@ partial void ProcessCreateFineTunesEstimatePriceResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "createFineTunesEstimatePrice", methodName: "CreateFineTunesEstimatePriceAsync", - pathTemplate: "\"/v1/fine-tunes/estimate-price\"", + pathTemplate: "\"/fine-tunes/estimate-price\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -252,7 +291,7 @@ partial void ProcessCreateFineTunesEstimatePriceResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "createFineTunesEstimatePrice", methodName: "CreateFineTunesEstimatePriceAsync", - pathTemplate: "\"/v1/fine-tunes/estimate-price\"", + pathTemplate: "\"/fine-tunes/estimate-price\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -300,7 +339,7 @@ partial void ProcessCreateFineTunesEstimatePriceResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "createFineTunesEstimatePrice", methodName: "CreateFineTunesEstimatePriceAsync", - pathTemplate: "\"/v1/fine-tunes/estimate-price\"", + pathTemplate: "\"/fine-tunes/estimate-price\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -322,7 +361,7 @@ partial void ProcessCreateFineTunesEstimatePriceResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "createFineTunesEstimatePrice", methodName: "CreateFineTunesEstimatePriceAsync", - pathTemplate: "\"/v1/fine-tunes/estimate-price\"", + pathTemplate: "\"/fine-tunes/estimate-price\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.FineTuningClient.CreateFineTunesPreview.g.cs b/src/libs/Together/Generated/Together.FineTuningClient.CreateFineTunesPreview.g.cs index 52dcf3bf..ffa3aab2 100644 --- a/src/libs/Together/Generated/Together.FineTuningClient.CreateFineTunesPreview.g.cs +++ b/src/libs/Together/Generated/Together.FineTuningClient.CreateFineTunesPreview.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class FineTuningClient { + private static readonly global::Together.AutoSDKServer[] s_CreateFineTunesPreviewServers = 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_CreateFineTunesPreviewSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -49,6 +62,15 @@ partial void ProcessCreateFineTunesPreviewResponseContent( /// 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()
+ /// preview = client.fine_tuning.preview(
+ /// model="meta-llama/Meta-Llama-3.1-8B-Instruct-Reference",
+ /// training_file="<FILE_ID>",
+ /// )
+ /// print(preview) + ///
public async global::System.Threading.Tasks.Task CreateFineTunesPreviewAsync( global::Together.FineTunePreviewRequest request, @@ -72,6 +94,15 @@ partial void ProcessCreateFineTunesPreviewResponseContent( /// 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()
+ /// preview = client.fine_tuning.preview(
+ /// model="meta-llama/Meta-Llama-3.1-8B-Instruct-Reference",
+ /// training_file="<FILE_ID>",
+ /// )
+ /// print(preview) + ///
public async global::System.Threading.Tasks.Task> CreateFineTunesPreviewAsResponseAsync( global::Together.FineTunePreviewRequest request, @@ -110,8 +141,10 @@ partial void ProcessCreateFineTunesPreviewResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: "/v1/fine-tunes/preview", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: "/fine-tunes/preview", + baseUri: ResolveBaseUri( + servers: s_CreateFineTunesPreviewServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -177,7 +210,7 @@ partial void ProcessCreateFineTunesPreviewResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "createFineTunesPreview", methodName: "CreateFineTunesPreviewAsync", - pathTemplate: "\"/v1/fine-tunes/preview\"", + pathTemplate: "\"/fine-tunes/preview\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -211,7 +244,7 @@ partial void ProcessCreateFineTunesPreviewResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "createFineTunesPreview", methodName: "CreateFineTunesPreviewAsync", - pathTemplate: "\"/v1/fine-tunes/preview\"", + pathTemplate: "\"/fine-tunes/preview\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -252,7 +285,7 @@ partial void ProcessCreateFineTunesPreviewResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "createFineTunesPreview", methodName: "CreateFineTunesPreviewAsync", - pathTemplate: "\"/v1/fine-tunes/preview\"", + pathTemplate: "\"/fine-tunes/preview\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -300,7 +333,7 @@ partial void ProcessCreateFineTunesPreviewResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "createFineTunesPreview", methodName: "CreateFineTunesPreviewAsync", - pathTemplate: "\"/v1/fine-tunes/preview\"", + pathTemplate: "\"/fine-tunes/preview\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -322,7 +355,7 @@ partial void ProcessCreateFineTunesPreviewResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "createFineTunesPreview", methodName: "CreateFineTunesPreviewAsync", - pathTemplate: "\"/v1/fine-tunes/preview\"", + pathTemplate: "\"/fine-tunes/preview\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.FineTuningClient.DeleteFineTunesById.g.cs b/src/libs/Together/Generated/Together.FineTuningClient.DeleteFineTunesById.g.cs index 94a93f6c..63367dcb 100644 --- a/src/libs/Together/Generated/Together.FineTuningClient.DeleteFineTunesById.g.cs +++ b/src/libs/Together/Generated/Together.FineTuningClient.DeleteFineTunesById.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class FineTuningClient { + private static readonly global::Together.AutoSDKServer[] s_DeleteFineTunesByIdServers = 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_DeleteFineTunesByIdSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -27,11 +40,13 @@ public partial class FineTuningClient }; partial void PrepareDeleteFineTunesByIdArguments( global::System.Net.Http.HttpClient httpClient, - ref string id); + ref string id, + ref bool? force); partial void PrepareDeleteFineTunesByIdRequest( global::System.Net.Http.HttpClient httpClient, global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string id); + string id, + bool? force); partial void ProcessDeleteFineTunesByIdResponse( global::System.Net.Http.HttpClient httpClient, global::System.Net.Http.HttpResponseMessage httpResponseMessage); @@ -48,16 +63,31 @@ partial void ProcessDeleteFineTunesByIdResponseContent( /// /// The ID of the fine-tune job to delete /// + /// + /// Deprecated and unused parameter.
+ /// Default Value: false + /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.fine_tuning.delete(id="<JOB_ID>")
+ /// print(response) + ///
public async global::System.Threading.Tasks.Task DeleteFineTunesByIdAsync( string id, + bool? force = default, global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __response = await DeleteFineTunesByIdAsResponseAsync( id: id, + force: force, requestOptions: requestOptions, cancellationToken: cancellationToken ).ConfigureAwait(false); @@ -71,11 +101,25 @@ partial void ProcessDeleteFineTunesByIdResponseContent( /// /// The ID of the fine-tune job to delete /// + /// + /// Deprecated and unused parameter.
+ /// Default Value: false + /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.fine_tuning.delete(id="<JOB_ID>")
+ /// print(response) + ///
public async global::System.Threading.Tasks.Task> DeleteFineTunesByIdAsResponseAsync( string id, + bool? force = default, global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { @@ -83,7 +127,8 @@ partial void ProcessDeleteFineTunesByIdResponseContent( client: HttpClient); PrepareDeleteFineTunesByIdArguments( httpClient: HttpClient, - id: ref id); + id: ref id, + force: ref force); var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( @@ -109,8 +154,13 @@ partial void ProcessDeleteFineTunesByIdResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v1/fine-tunes/{id}", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/fine-tunes/{id}", + baseUri: ResolveBaseUri( + servers: s_DeleteFineTunesByIdServers, + defaultBaseUrl: "https://api.together.ai/v1")); + __pathBuilder + .AddOptionalParameter("force", force?.ToString().ToLowerInvariant()) + ; var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -151,7 +201,8 @@ partial void ProcessDeleteFineTunesByIdResponseContent( PrepareDeleteFineTunesByIdRequest( httpClient: HttpClient, httpRequestMessage: __httpRequest, - id: id); + id: id, + force: force); return __httpRequest; } @@ -170,7 +221,7 @@ partial void ProcessDeleteFineTunesByIdResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "deleteFineTunesById", methodName: "DeleteFineTunesByIdAsync", - pathTemplate: "$\"/v1/fine-tunes/{id}\"", + pathTemplate: "$\"/fine-tunes/{id}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -204,7 +255,7 @@ partial void ProcessDeleteFineTunesByIdResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "deleteFineTunesById", methodName: "DeleteFineTunesByIdAsync", - pathTemplate: "$\"/v1/fine-tunes/{id}\"", + pathTemplate: "$\"/fine-tunes/{id}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -245,7 +296,7 @@ partial void ProcessDeleteFineTunesByIdResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "deleteFineTunesById", methodName: "DeleteFineTunesByIdAsync", - pathTemplate: "$\"/v1/fine-tunes/{id}\"", + pathTemplate: "$\"/fine-tunes/{id}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -293,7 +344,7 @@ partial void ProcessDeleteFineTunesByIdResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "deleteFineTunesById", methodName: "DeleteFineTunesByIdAsync", - pathTemplate: "$\"/v1/fine-tunes/{id}\"", + pathTemplate: "$\"/fine-tunes/{id}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -315,7 +366,7 @@ partial void ProcessDeleteFineTunesByIdResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "deleteFineTunesById", methodName: "DeleteFineTunesByIdAsync", - pathTemplate: "$\"/v1/fine-tunes/{id}\"", + pathTemplate: "$\"/fine-tunes/{id}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.FineTuningClient.GetFineTunes.g.cs b/src/libs/Together/Generated/Together.FineTuningClient.GetFineTunes.g.cs index f402b940..b89a9168 100644 --- a/src/libs/Together/Generated/Together.FineTuningClient.GetFineTunes.g.cs +++ b/src/libs/Together/Generated/Together.FineTuningClient.GetFineTunes.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class FineTuningClient { + private static readonly global::Together.AutoSDKServer[] s_GetFineTunesServers = 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_GetFineTunesSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -46,6 +59,16 @@ partial void ProcessGetFineTunesResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.fine_tuning.list()
+ /// for fine_tune in response.data:
+ /// print(f"ID: {fine_tune.id}, Status: {fine_tune.status}") + ///
public async global::System.Threading.Tasks.Task GetFineTunesAsync( global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -64,6 +87,16 @@ partial void ProcessGetFineTunesResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.fine_tuning.list()
+ /// for fine_tune in response.data:
+ /// print(f"ID: {fine_tune.id}, Status: {fine_tune.status}") + ///
public async global::System.Threading.Tasks.Task> GetFineTunesAsResponseAsync( global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -97,8 +130,10 @@ partial void ProcessGetFineTunesResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: "/v1/fine-tunes", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: "/fine-tunes", + baseUri: ResolveBaseUri( + servers: s_GetFineTunesServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -157,7 +192,7 @@ partial void ProcessGetFineTunesResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getFineTunes", methodName: "GetFineTunesAsync", - pathTemplate: "\"/v1/fine-tunes\"", + pathTemplate: "\"/fine-tunes\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -191,7 +226,7 @@ partial void ProcessGetFineTunesResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getFineTunes", methodName: "GetFineTunesAsync", - pathTemplate: "\"/v1/fine-tunes\"", + pathTemplate: "\"/fine-tunes\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -232,7 +267,7 @@ partial void ProcessGetFineTunesResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getFineTunes", methodName: "GetFineTunesAsync", - pathTemplate: "\"/v1/fine-tunes\"", + pathTemplate: "\"/fine-tunes\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -280,7 +315,7 @@ partial void ProcessGetFineTunesResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getFineTunes", methodName: "GetFineTunesAsync", - pathTemplate: "\"/v1/fine-tunes\"", + pathTemplate: "\"/fine-tunes\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -302,7 +337,7 @@ partial void ProcessGetFineTunesResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getFineTunes", methodName: "GetFineTunesAsync", - pathTemplate: "\"/v1/fine-tunes\"", + pathTemplate: "\"/fine-tunes\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.FineTuningClient.GetFineTunesById.g.cs b/src/libs/Together/Generated/Together.FineTuningClient.GetFineTunesById.g.cs index cf6b8fbe..2b05dcd2 100644 --- a/src/libs/Together/Generated/Together.FineTuningClient.GetFineTunesById.g.cs +++ b/src/libs/Together/Generated/Together.FineTuningClient.GetFineTunesById.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class FineTuningClient { + private static readonly global::Together.AutoSDKServer[] s_GetFineTunesByIdServers = 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_GetFineTunesByIdSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -51,6 +64,15 @@ partial void ProcessGetFineTunesByIdResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// fine_tune = client.fine_tuning.retrieve(id="<JOB_ID>")
+ /// print(fine_tune) + ///
public async global::System.Threading.Tasks.Task GetFineTunesByIdAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -74,6 +96,15 @@ partial void ProcessGetFineTunesByIdResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// fine_tune = client.fine_tuning.retrieve(id="<JOB_ID>")
+ /// print(fine_tune) + ///
public async global::System.Threading.Tasks.Task> GetFineTunesByIdAsResponseAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -109,8 +140,10 @@ partial void ProcessGetFineTunesByIdResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v1/fine-tunes/{id}", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/fine-tunes/{id}", + baseUri: ResolveBaseUri( + servers: s_GetFineTunesByIdServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -170,7 +203,7 @@ partial void ProcessGetFineTunesByIdResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getFineTunesById", methodName: "GetFineTunesByIdAsync", - pathTemplate: "$\"/v1/fine-tunes/{id}\"", + pathTemplate: "$\"/fine-tunes/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -204,7 +237,7 @@ partial void ProcessGetFineTunesByIdResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getFineTunesById", methodName: "GetFineTunesByIdAsync", - pathTemplate: "$\"/v1/fine-tunes/{id}\"", + pathTemplate: "$\"/fine-tunes/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -245,7 +278,7 @@ partial void ProcessGetFineTunesByIdResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getFineTunesById", methodName: "GetFineTunesByIdAsync", - pathTemplate: "$\"/v1/fine-tunes/{id}\"", + pathTemplate: "$\"/fine-tunes/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -293,7 +326,7 @@ partial void ProcessGetFineTunesByIdResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getFineTunesById", methodName: "GetFineTunesByIdAsync", - pathTemplate: "$\"/v1/fine-tunes/{id}\"", + pathTemplate: "$\"/fine-tunes/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -315,7 +348,7 @@ partial void ProcessGetFineTunesByIdResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getFineTunesById", methodName: "GetFineTunesByIdAsync", - pathTemplate: "$\"/v1/fine-tunes/{id}\"", + pathTemplate: "$\"/fine-tunes/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.FineTuningClient.GetFineTunesByIdCheckpoints.g.cs b/src/libs/Together/Generated/Together.FineTuningClient.GetFineTunesByIdCheckpoints.g.cs index d2b13053..6657776d 100644 --- a/src/libs/Together/Generated/Together.FineTuningClient.GetFineTunesByIdCheckpoints.g.cs +++ b/src/libs/Together/Generated/Together.FineTuningClient.GetFineTunesByIdCheckpoints.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class FineTuningClient { + private static readonly global::Together.AutoSDKServer[] s_GetFineTunesByIdCheckpointsServers = 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_GetFineTunesByIdCheckpointsSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -51,6 +64,15 @@ partial void ProcessGetFineTunesByIdCheckpointsResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// checkpoints = client.fine_tuning.list_checkpoints(id="<JOB_ID>")
+ /// print(checkpoints) + ///
public async global::System.Threading.Tasks.Task GetFineTunesByIdCheckpointsAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -74,6 +96,15 @@ partial void ProcessGetFineTunesByIdCheckpointsResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// checkpoints = client.fine_tuning.list_checkpoints(id="<JOB_ID>")
+ /// print(checkpoints) + ///
public async global::System.Threading.Tasks.Task> GetFineTunesByIdCheckpointsAsResponseAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -109,8 +140,10 @@ partial void ProcessGetFineTunesByIdCheckpointsResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v1/fine-tunes/{id}/checkpoints", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/fine-tunes/{id}/checkpoints", + baseUri: ResolveBaseUri( + servers: s_GetFineTunesByIdCheckpointsServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -170,7 +203,7 @@ partial void ProcessGetFineTunesByIdCheckpointsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getFineTunesByIdCheckpoints", methodName: "GetFineTunesByIdCheckpointsAsync", - pathTemplate: "$\"/v1/fine-tunes/{id}/checkpoints\"", + pathTemplate: "$\"/fine-tunes/{id}/checkpoints\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -204,7 +237,7 @@ partial void ProcessGetFineTunesByIdCheckpointsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getFineTunesByIdCheckpoints", methodName: "GetFineTunesByIdCheckpointsAsync", - pathTemplate: "$\"/v1/fine-tunes/{id}/checkpoints\"", + pathTemplate: "$\"/fine-tunes/{id}/checkpoints\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -245,7 +278,7 @@ partial void ProcessGetFineTunesByIdCheckpointsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getFineTunesByIdCheckpoints", methodName: "GetFineTunesByIdCheckpointsAsync", - pathTemplate: "$\"/v1/fine-tunes/{id}/checkpoints\"", + pathTemplate: "$\"/fine-tunes/{id}/checkpoints\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -293,7 +326,7 @@ partial void ProcessGetFineTunesByIdCheckpointsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getFineTunesByIdCheckpoints", methodName: "GetFineTunesByIdCheckpointsAsync", - pathTemplate: "$\"/v1/fine-tunes/{id}/checkpoints\"", + pathTemplate: "$\"/fine-tunes/{id}/checkpoints\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -315,7 +348,7 @@ partial void ProcessGetFineTunesByIdCheckpointsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getFineTunesByIdCheckpoints", methodName: "GetFineTunesByIdCheckpointsAsync", - pathTemplate: "$\"/v1/fine-tunes/{id}/checkpoints\"", + pathTemplate: "$\"/fine-tunes/{id}/checkpoints\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.FineTuningClient.GetFineTunesByIdDownloadTokenizedDataset.g.cs b/src/libs/Together/Generated/Together.FineTuningClient.GetFineTunesByIdDownloadTokenizedDataset.g.cs index cb685469..7a87e8bd 100644 --- a/src/libs/Together/Generated/Together.FineTuningClient.GetFineTunesByIdDownloadTokenizedDataset.g.cs +++ b/src/libs/Together/Generated/Together.FineTuningClient.GetFineTunesByIdDownloadTokenizedDataset.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class FineTuningClient { + private static readonly global::Together.AutoSDKServer[] s_GetFineTunesByIdDownloadTokenizedDatasetServers = 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_GetFineTunesByIdDownloadTokenizedDatasetSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -51,6 +64,19 @@ partial void ProcessGetFineTunesByIdDownloadTokenizedDatasetResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// tokenized_dataset = client.fine_tuning.retrieve_tokenized_dataset(
+ /// id="<JOB_ID>",
+ /// )
+ /// print(tokenized_dataset.url)
+ /// print(tokenized_dataset.filename)
+ /// print(tokenized_dataset.size) + ///
public async global::System.Threading.Tasks.Task GetFineTunesByIdDownloadTokenizedDatasetAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -74,6 +100,19 @@ partial void ProcessGetFineTunesByIdDownloadTokenizedDatasetResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// tokenized_dataset = client.fine_tuning.retrieve_tokenized_dataset(
+ /// id="<JOB_ID>",
+ /// )
+ /// print(tokenized_dataset.url)
+ /// print(tokenized_dataset.filename)
+ /// print(tokenized_dataset.size) + ///
public async global::System.Threading.Tasks.Task> GetFineTunesByIdDownloadTokenizedDatasetAsResponseAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -109,8 +148,10 @@ partial void ProcessGetFineTunesByIdDownloadTokenizedDatasetResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v1/fine-tunes/{id}/download-tokenized-dataset", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/fine-tunes/{id}/download-tokenized-dataset", + baseUri: ResolveBaseUri( + servers: s_GetFineTunesByIdDownloadTokenizedDatasetServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -170,7 +211,7 @@ partial void ProcessGetFineTunesByIdDownloadTokenizedDatasetResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getFineTunesByIdDownloadTokenizedDataset", methodName: "GetFineTunesByIdDownloadTokenizedDatasetAsync", - pathTemplate: "$\"/v1/fine-tunes/{id}/download-tokenized-dataset\"", + pathTemplate: "$\"/fine-tunes/{id}/download-tokenized-dataset\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -204,7 +245,7 @@ partial void ProcessGetFineTunesByIdDownloadTokenizedDatasetResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getFineTunesByIdDownloadTokenizedDataset", methodName: "GetFineTunesByIdDownloadTokenizedDatasetAsync", - pathTemplate: "$\"/v1/fine-tunes/{id}/download-tokenized-dataset\"", + pathTemplate: "$\"/fine-tunes/{id}/download-tokenized-dataset\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -245,7 +286,7 @@ partial void ProcessGetFineTunesByIdDownloadTokenizedDatasetResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getFineTunesByIdDownloadTokenizedDataset", methodName: "GetFineTunesByIdDownloadTokenizedDatasetAsync", - pathTemplate: "$\"/v1/fine-tunes/{id}/download-tokenized-dataset\"", + pathTemplate: "$\"/fine-tunes/{id}/download-tokenized-dataset\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -293,7 +334,7 @@ partial void ProcessGetFineTunesByIdDownloadTokenizedDatasetResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getFineTunesByIdDownloadTokenizedDataset", methodName: "GetFineTunesByIdDownloadTokenizedDatasetAsync", - pathTemplate: "$\"/v1/fine-tunes/{id}/download-tokenized-dataset\"", + pathTemplate: "$\"/fine-tunes/{id}/download-tokenized-dataset\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -315,7 +356,7 @@ partial void ProcessGetFineTunesByIdDownloadTokenizedDatasetResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getFineTunesByIdDownloadTokenizedDataset", methodName: "GetFineTunesByIdDownloadTokenizedDatasetAsync", - pathTemplate: "$\"/v1/fine-tunes/{id}/download-tokenized-dataset\"", + pathTemplate: "$\"/fine-tunes/{id}/download-tokenized-dataset\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.FineTuningClient.GetFineTunesByIdEvents.g.cs b/src/libs/Together/Generated/Together.FineTuningClient.GetFineTunesByIdEvents.g.cs index 4f46aecf..d24d0dd1 100644 --- a/src/libs/Together/Generated/Together.FineTuningClient.GetFineTunesByIdEvents.g.cs +++ b/src/libs/Together/Generated/Together.FineTuningClient.GetFineTunesByIdEvents.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class FineTuningClient { + private static readonly global::Together.AutoSDKServer[] s_GetFineTunesByIdEventsServers = 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_GetFineTunesByIdEventsSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -51,6 +64,16 @@ partial void ProcessGetFineTunesByIdEventsResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.fine_tuning.list_events(id="<JOB_ID>")
+ /// for event in response.data:
+ /// print(event) + ///
public async global::System.Threading.Tasks.Task GetFineTunesByIdEventsAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -74,6 +97,16 @@ partial void ProcessGetFineTunesByIdEventsResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.fine_tuning.list_events(id="<JOB_ID>")
+ /// for event in response.data:
+ /// print(event) + ///
public async global::System.Threading.Tasks.Task> GetFineTunesByIdEventsAsResponseAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -109,8 +142,10 @@ partial void ProcessGetFineTunesByIdEventsResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v1/fine-tunes/{id}/events", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/fine-tunes/{id}/events", + baseUri: ResolveBaseUri( + servers: s_GetFineTunesByIdEventsServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -170,7 +205,7 @@ partial void ProcessGetFineTunesByIdEventsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getFineTunesByIdEvents", methodName: "GetFineTunesByIdEventsAsync", - pathTemplate: "$\"/v1/fine-tunes/{id}/events\"", + pathTemplate: "$\"/fine-tunes/{id}/events\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -204,7 +239,7 @@ partial void ProcessGetFineTunesByIdEventsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getFineTunesByIdEvents", methodName: "GetFineTunesByIdEventsAsync", - pathTemplate: "$\"/v1/fine-tunes/{id}/events\"", + pathTemplate: "$\"/fine-tunes/{id}/events\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -245,7 +280,7 @@ partial void ProcessGetFineTunesByIdEventsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getFineTunesByIdEvents", methodName: "GetFineTunesByIdEventsAsync", - pathTemplate: "$\"/v1/fine-tunes/{id}/events\"", + pathTemplate: "$\"/fine-tunes/{id}/events\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -293,7 +328,7 @@ partial void ProcessGetFineTunesByIdEventsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getFineTunesByIdEvents", methodName: "GetFineTunesByIdEventsAsync", - pathTemplate: "$\"/v1/fine-tunes/{id}/events\"", + pathTemplate: "$\"/fine-tunes/{id}/events\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -315,7 +350,7 @@ partial void ProcessGetFineTunesByIdEventsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getFineTunesByIdEvents", methodName: "GetFineTunesByIdEventsAsync", - pathTemplate: "$\"/v1/fine-tunes/{id}/events\"", + pathTemplate: "$\"/fine-tunes/{id}/events\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.FineTuningClient.GetFineTunesByIdMetrics.g.cs b/src/libs/Together/Generated/Together.FineTuningClient.GetFineTunesByIdMetrics.g.cs index 06a99a81..cc0aa136 100644 --- a/src/libs/Together/Generated/Together.FineTuningClient.GetFineTunesByIdMetrics.g.cs +++ b/src/libs/Together/Generated/Together.FineTuningClient.GetFineTunesByIdMetrics.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class FineTuningClient { + private static readonly global::Together.AutoSDKServer[] s_GetFineTunesByIdMetricsServers = 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_GetFineTunesByIdMetricsSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -66,6 +79,16 @@ partial void ProcessGetFineTunesByIdMetricsResponseContent( /// 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()
+ /// metrics = client.fine_tuning.list_metrics(
+ /// "<JOB_ID>",
+ /// global_step_from=0,
+ /// global_step_to=500,
+ /// )
+ /// print(metrics) + ///
public async global::System.Threading.Tasks.Task GetFineTunesByIdMetricsAsync( string id, int? globalStepFrom = default, @@ -104,6 +127,16 @@ partial void ProcessGetFineTunesByIdMetricsResponseContent( /// 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()
+ /// metrics = client.fine_tuning.list_metrics(
+ /// "<JOB_ID>",
+ /// global_step_from=0,
+ /// global_step_to=500,
+ /// )
+ /// print(metrics) + ///
public async global::System.Threading.Tasks.Task> GetFineTunesByIdMetricsAsResponseAsync( string id, int? globalStepFrom = default, @@ -149,8 +182,10 @@ partial void ProcessGetFineTunesByIdMetricsResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v1/fine-tunes/{id}/metrics", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/fine-tunes/{id}/metrics", + baseUri: ResolveBaseUri( + servers: s_GetFineTunesByIdMetricsServers, + defaultBaseUrl: "https://api.together.ai/v1")); __pathBuilder .AddOptionalParameter("global_step_from", globalStepFrom?.ToString()) .AddOptionalParameter("global_step_to", globalStepTo?.ToString()) @@ -222,7 +257,7 @@ partial void ProcessGetFineTunesByIdMetricsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getFineTunesByIdMetrics", methodName: "GetFineTunesByIdMetricsAsync", - pathTemplate: "$\"/v1/fine-tunes/{id}/metrics\"", + pathTemplate: "$\"/fine-tunes/{id}/metrics\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -256,7 +291,7 @@ partial void ProcessGetFineTunesByIdMetricsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getFineTunesByIdMetrics", methodName: "GetFineTunesByIdMetricsAsync", - pathTemplate: "$\"/v1/fine-tunes/{id}/metrics\"", + pathTemplate: "$\"/fine-tunes/{id}/metrics\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -297,7 +332,7 @@ partial void ProcessGetFineTunesByIdMetricsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getFineTunesByIdMetrics", methodName: "GetFineTunesByIdMetricsAsync", - pathTemplate: "$\"/v1/fine-tunes/{id}/metrics\"", + pathTemplate: "$\"/fine-tunes/{id}/metrics\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -345,7 +380,7 @@ partial void ProcessGetFineTunesByIdMetricsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getFineTunesByIdMetrics", methodName: "GetFineTunesByIdMetricsAsync", - pathTemplate: "$\"/v1/fine-tunes/{id}/metrics\"", + pathTemplate: "$\"/fine-tunes/{id}/metrics\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -367,7 +402,7 @@ partial void ProcessGetFineTunesByIdMetricsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getFineTunesByIdMetrics", methodName: "GetFineTunesByIdMetricsAsync", - pathTemplate: "$\"/v1/fine-tunes/{id}/metrics\"", + pathTemplate: "$\"/fine-tunes/{id}/metrics\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.FineTuningClient.GetFineTunesModelsLimits.g.cs b/src/libs/Together/Generated/Together.FineTuningClient.GetFineTunesModelsLimits.g.cs index 29289250..6834c4b8 100644 --- a/src/libs/Together/Generated/Together.FineTuningClient.GetFineTunesModelsLimits.g.cs +++ b/src/libs/Together/Generated/Together.FineTuningClient.GetFineTunesModelsLimits.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class FineTuningClient { + private static readonly global::Together.AutoSDKServer[] s_GetFineTunesModelsLimitsServers = 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_GetFineTunesModelsLimitsSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -51,6 +64,14 @@ partial void ProcessGetFineTunesModelsLimitsResponseContent( /// 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()
+ /// limits = client.fine_tuning.model_limits(
+ /// model_name="meta-llama/Meta-Llama-3.1-8B-Instruct-Reference",
+ /// )
+ /// print(limits) + ///
public async global::System.Threading.Tasks.Task GetFineTunesModelsLimitsAsync( string modelName, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -74,6 +95,14 @@ partial void ProcessGetFineTunesModelsLimitsResponseContent( /// 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()
+ /// limits = client.fine_tuning.model_limits(
+ /// model_name="meta-llama/Meta-Llama-3.1-8B-Instruct-Reference",
+ /// )
+ /// print(limits) + ///
public async global::System.Threading.Tasks.Task> GetFineTunesModelsLimitsAsResponseAsync( string modelName, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -109,8 +138,10 @@ partial void ProcessGetFineTunesModelsLimitsResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: "/v1/fine-tunes/models/limits", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: "/fine-tunes/models/limits", + baseUri: ResolveBaseUri( + servers: s_GetFineTunesModelsLimitsServers, + defaultBaseUrl: "https://api.together.ai/v1")); __pathBuilder .AddRequiredParameter("model_name", modelName) ; @@ -173,7 +204,7 @@ partial void ProcessGetFineTunesModelsLimitsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getFineTunesModelsLimits", methodName: "GetFineTunesModelsLimitsAsync", - pathTemplate: "\"/v1/fine-tunes/models/limits\"", + pathTemplate: "\"/fine-tunes/models/limits\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -207,7 +238,7 @@ partial void ProcessGetFineTunesModelsLimitsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getFineTunesModelsLimits", methodName: "GetFineTunesModelsLimitsAsync", - pathTemplate: "\"/v1/fine-tunes/models/limits\"", + pathTemplate: "\"/fine-tunes/models/limits\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -248,7 +279,7 @@ partial void ProcessGetFineTunesModelsLimitsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getFineTunesModelsLimits", methodName: "GetFineTunesModelsLimitsAsync", - pathTemplate: "\"/v1/fine-tunes/models/limits\"", + pathTemplate: "\"/fine-tunes/models/limits\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -296,7 +327,7 @@ partial void ProcessGetFineTunesModelsLimitsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getFineTunesModelsLimits", methodName: "GetFineTunesModelsLimitsAsync", - pathTemplate: "\"/v1/fine-tunes/models/limits\"", + pathTemplate: "\"/fine-tunes/models/limits\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -318,7 +349,7 @@ partial void ProcessGetFineTunesModelsLimitsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getFineTunesModelsLimits", methodName: "GetFineTunesModelsLimitsAsync", - pathTemplate: "\"/v1/fine-tunes/models/limits\"", + pathTemplate: "\"/fine-tunes/models/limits\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.FineTuningClient.GetFineTunesModelsSupported.g.cs b/src/libs/Together/Generated/Together.FineTuningClient.GetFineTunesModelsSupported.g.cs index 9b7ce3e7..bce4b760 100644 --- a/src/libs/Together/Generated/Together.FineTuningClient.GetFineTunesModelsSupported.g.cs +++ b/src/libs/Together/Generated/Together.FineTuningClient.GetFineTunesModelsSupported.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class FineTuningClient { + private static readonly global::Together.AutoSDKServer[] s_GetFineTunesModelsSupportedServers = 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_GetFineTunesModelsSupportedSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -46,6 +59,14 @@ partial void ProcessGetFineTunesModelsSupportedResponseContent( /// 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()
+ /// # The SDK has no dedicated method for this endpoint yet, so call it with
+ /// # the client's generic GET helper.
+ /// models = client.get("/fine-tunes/models/supported", cast_to=object)
+ /// print(models) + ///
public async global::System.Threading.Tasks.Task GetFineTunesModelsSupportedAsync( global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -64,6 +85,14 @@ partial void ProcessGetFineTunesModelsSupportedResponseContent( /// 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()
+ /// # The SDK has no dedicated method for this endpoint yet, so call it with
+ /// # the client's generic GET helper.
+ /// models = client.get("/fine-tunes/models/supported", cast_to=object)
+ /// print(models) + ///
public async global::System.Threading.Tasks.Task> GetFineTunesModelsSupportedAsResponseAsync( global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -97,8 +126,10 @@ partial void ProcessGetFineTunesModelsSupportedResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: "/v1/fine-tunes/models/supported", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: "/fine-tunes/models/supported", + baseUri: ResolveBaseUri( + servers: s_GetFineTunesModelsSupportedServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -157,7 +188,7 @@ partial void ProcessGetFineTunesModelsSupportedResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getFineTunesModelsSupported", methodName: "GetFineTunesModelsSupportedAsync", - pathTemplate: "\"/v1/fine-tunes/models/supported\"", + pathTemplate: "\"/fine-tunes/models/supported\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -191,7 +222,7 @@ partial void ProcessGetFineTunesModelsSupportedResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getFineTunesModelsSupported", methodName: "GetFineTunesModelsSupportedAsync", - pathTemplate: "\"/v1/fine-tunes/models/supported\"", + pathTemplate: "\"/fine-tunes/models/supported\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -232,7 +263,7 @@ partial void ProcessGetFineTunesModelsSupportedResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getFineTunesModelsSupported", methodName: "GetFineTunesModelsSupportedAsync", - pathTemplate: "\"/v1/fine-tunes/models/supported\"", + pathTemplate: "\"/fine-tunes/models/supported\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -280,7 +311,7 @@ partial void ProcessGetFineTunesModelsSupportedResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getFineTunesModelsSupported", methodName: "GetFineTunesModelsSupportedAsync", - pathTemplate: "\"/v1/fine-tunes/models/supported\"", + pathTemplate: "\"/fine-tunes/models/supported\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -302,7 +333,7 @@ partial void ProcessGetFineTunesModelsSupportedResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getFineTunesModelsSupported", methodName: "GetFineTunesModelsSupportedAsync", - pathTemplate: "\"/v1/fine-tunes/models/supported\"", + pathTemplate: "\"/fine-tunes/models/supported\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.FineTuningClient.GetFinetuneDownload.g.cs b/src/libs/Together/Generated/Together.FineTuningClient.GetFinetuneDownload.g.cs index 25684ab2..feaee1f5 100644 --- a/src/libs/Together/Generated/Together.FineTuningClient.GetFinetuneDownload.g.cs +++ b/src/libs/Together/Generated/Together.FineTuningClient.GetFinetuneDownload.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class FineTuningClient { + private static readonly global::Together.AutoSDKServer[] s_GetFinetuneDownloadServers = 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_GetFinetuneDownloadSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -61,6 +74,18 @@ partial void ProcessGetFinetuneDownloadResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// # Using `with_streaming_response` gives you control to do what you want with the response.
+ /// stream = client.fine_tuning.with_streaming_response.content(ft_id="<JOB_ID>")
+ /// with stream as response:
+ /// for line in response.iter_lines():
+ /// print(line) + ///
public async global::System.Threading.Tasks.Task GetFinetuneDownloadAsync( string ftId, int? checkpointStep = default, @@ -94,6 +119,18 @@ partial void ProcessGetFinetuneDownloadResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// # Using `with_streaming_response` gives you control to do what you want with the response.
+ /// stream = client.fine_tuning.with_streaming_response.content(ft_id="<JOB_ID>")
+ /// with stream as response:
+ /// for line in response.iter_lines():
+ /// print(line) + ///
public async global::System.Threading.Tasks.Task GetFinetuneDownloadAsStreamAsync( string ftId, int? checkpointStep = default, @@ -133,8 +170,10 @@ partial void ProcessGetFinetuneDownloadResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: "/v1/finetune/download", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: "/finetune/download", + baseUri: ResolveBaseUri( + servers: s_GetFinetuneDownloadServers, + defaultBaseUrl: "https://api.together.ai/v1")); __pathBuilder .AddRequiredParameter("ft_id", ftId) .AddOptionalParameter("checkpoint_step", checkpointStep?.ToString()) @@ -201,7 +240,7 @@ partial void ProcessGetFinetuneDownloadResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getFinetuneDownload", methodName: "GetFinetuneDownloadAsync", - pathTemplate: "\"/v1/finetune/download\"", + pathTemplate: "\"/finetune/download\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -235,7 +274,7 @@ partial void ProcessGetFinetuneDownloadResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getFinetuneDownload", methodName: "GetFinetuneDownloadAsync", - pathTemplate: "\"/v1/finetune/download\"", + pathTemplate: "\"/finetune/download\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -276,7 +315,7 @@ partial void ProcessGetFinetuneDownloadResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getFinetuneDownload", methodName: "GetFinetuneDownloadAsync", - pathTemplate: "\"/v1/finetune/download\"", + pathTemplate: "\"/finetune/download\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -324,7 +363,7 @@ partial void ProcessGetFinetuneDownloadResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getFinetuneDownload", methodName: "GetFinetuneDownloadAsync", - pathTemplate: "\"/v1/finetune/download\"", + pathTemplate: "\"/finetune/download\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -346,7 +385,7 @@ partial void ProcessGetFinetuneDownloadResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getFinetuneDownload", methodName: "GetFinetuneDownloadAsync", - pathTemplate: "\"/v1/finetune/download\"", + pathTemplate: "\"/finetune/download\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -492,6 +531,18 @@ partial void ProcessGetFinetuneDownloadResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// # Using `with_streaming_response` gives you control to do what you want with the response.
+ /// stream = client.fine_tuning.with_streaming_response.content(ft_id="<JOB_ID>")
+ /// with stream as response:
+ /// for line in response.iter_lines():
+ /// print(line) + ///
public async global::System.Threading.Tasks.Task> GetFinetuneDownloadAsResponseAsync( string ftId, int? checkpointStep = default, @@ -531,8 +582,10 @@ partial void ProcessGetFinetuneDownloadResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: "/v1/finetune/download", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: "/finetune/download", + baseUri: ResolveBaseUri( + servers: s_GetFinetuneDownloadServers, + defaultBaseUrl: "https://api.together.ai/v1")); __pathBuilder .AddRequiredParameter("ft_id", ftId) .AddOptionalParameter("checkpoint_step", checkpointStep?.ToString()) @@ -599,7 +652,7 @@ partial void ProcessGetFinetuneDownloadResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getFinetuneDownload", methodName: "GetFinetuneDownloadAsync", - pathTemplate: "\"/v1/finetune/download\"", + pathTemplate: "\"/finetune/download\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -633,7 +686,7 @@ partial void ProcessGetFinetuneDownloadResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getFinetuneDownload", methodName: "GetFinetuneDownloadAsync", - pathTemplate: "\"/v1/finetune/download\"", + pathTemplate: "\"/finetune/download\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -674,7 +727,7 @@ partial void ProcessGetFinetuneDownloadResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getFinetuneDownload", methodName: "GetFinetuneDownloadAsync", - pathTemplate: "\"/v1/finetune/download\"", + pathTemplate: "\"/finetune/download\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -722,7 +775,7 @@ partial void ProcessGetFinetuneDownloadResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getFinetuneDownload", methodName: "GetFinetuneDownloadAsync", - pathTemplate: "\"/v1/finetune/download\"", + pathTemplate: "\"/finetune/download\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -744,7 +797,7 @@ partial void ProcessGetFinetuneDownloadResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getFinetuneDownload", methodName: "GetFinetuneDownloadAsync", - pathTemplate: "\"/v1/finetune/download\"", + pathTemplate: "\"/finetune/download\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.FineTuningClient.g.cs b/src/libs/Together/Generated/Together.FineTuningClient.g.cs index 7b26db1d..81d79e19 100644 --- a/src/libs/Together/Generated/Together.FineTuningClient.g.cs +++ b/src/libs/Together/Generated/Together.FineTuningClient.g.cs @@ -12,7 +12,7 @@ public sealed partial class FineTuningClient : global::Together.IFineTuningClien /// /// Default environment for APIs /// - public const string DefaultBaseUrl = "https://api.together.ai/"; + public const string DefaultBaseUrl = "https://api.together.ai/v1"; private bool _disposeHttpClient = true; @@ -20,7 +20,7 @@ public sealed partial class FineTuningClient : global::Together.IFineTuningClien 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; } @@ -53,6 +53,34 @@ public sealed partial class FineTuningClient : global::Together.IFineTuningClien } + + 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 FineTuningClient. /// If no httpClient is provided, a new one will be created. @@ -151,5 +179,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.GPUClusterService.JsonSerializerContext.g.cs b/src/libs/Together/Generated/Together.GPUClusterService.JsonSerializerContext.g.cs index 81a053aa..946406dd 100644 --- a/src/libs/Together/Generated/Together.GPUClusterService.JsonSerializerContext.g.cs +++ b/src/libs/Together/Generated/Together.GPUClusterService.JsonSerializerContext.g.cs @@ -2,136 +2,7 @@ #nullable enable namespace Together -{ - /// - /// - /// - [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( - DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull - )] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(double))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(object))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(long))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GPUClusterControlPlaneNode))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.NodePhaseTransition))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GPUClusterCreateRequest), TypeInfoPropertyName = "GPUClusterCreateRequest2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GPUClusterCreateRequestNvidiaVersion), TypeInfoPropertyName = "GPUClusterCreateRequestNvidiaVersion2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GPUClusterCreateRequestLegacyNvidia), TypeInfoPropertyName = "GPUClusterCreateRequestLegacyNvidia2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GPUClusterCreateRequestCommon))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GPUClusterCreateRequestCommonClusterType), TypeInfoPropertyName = "GPUClusterCreateRequestCommonClusterType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GPUClusterCreateRequestCommonGpuType), TypeInfoPropertyName = "GPUClusterCreateRequestCommonGpuType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GPUClustersSharedVolumeCreateRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GPUClusterCreateRequestCommonBillingType), TypeInfoPropertyName = "GPUClusterCreateRequestCommonBillingType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OIDCConfig))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AcceptanceTestsParams))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.InstanceClusterConfig))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AddOnCreateRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GPUClusterGPUWorkerNode))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.Remediation))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GPUClusterInfo))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GPUClusterInfoClusterType), TypeInfoPropertyName = "GPUClusterInfoClusterType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GPUClusterInfoGpuType), TypeInfoPropertyName = "GPUClusterInfoGpuType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GPUClusterVolume))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GPUClusterInfoStatus), TypeInfoPropertyName = "GPUClusterInfoStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ClusterPhaseTransition))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GPUClusterInfoBillingType), TypeInfoPropertyName = "GPUClusterInfoBillingType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AddOnInfo))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GPUClusterNodeLifecycleEvent))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GPUClusterUpdateRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GPUClusterUpdateRequestClusterType), TypeInfoPropertyName = "GPUClusterUpdateRequestClusterType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AddOnUpdateRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GPUClusters))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AcceptanceTestsParamsDcgmDiagLevel), TypeInfoPropertyName = "AcceptanceTestsParamsDcgmDiagLevel2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AddOnConfig))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DashboardConfig))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.IngressConfig))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.TorchpassConfig))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.SlurmWebConfig))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.HeadlampConfig))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AddOnState))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DashboardState))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.IngressState))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.TorchpassState))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.SlurmWebState))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.HeadlampState))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ClusterIngressConfig))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ClusterPhaseTransitionPhase), TypeInfoPropertyName = "ClusterPhaseTransitionPhase2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GPUClusterDeleteResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.InstanceClusterConfigLoadBalancer), TypeInfoPropertyName = "InstanceClusterConfigLoadBalancer2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.SlurmStartupScripts))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ObservabilityConfig))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.NodePhaseTransitionPhase), TypeInfoPropertyName = "NodePhaseTransitionPhase2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.PassiveHealthCheckAlert))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.PHCAnnotation))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.XidDetail))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.SlurmNodeUnavailableDetail))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.PassiveHealthCheckAlertSeverity), TypeInfoPropertyName = "PassiveHealthCheckAlertSeverity2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RemediationMode), TypeInfoPropertyName = "RemediationMode2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RemediationTrigger), TypeInfoPropertyName = "RemediationTrigger2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RemediationState), TypeInfoPropertyName = "RemediationState2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.XidEvent))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(double?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(long?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GPUClusterCreateRequest?), TypeInfoPropertyName = "NullableGPUClusterCreateRequest2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GPUClusterCreateRequestNvidiaVersion?), TypeInfoPropertyName = "NullableGPUClusterCreateRequestNvidiaVersion2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GPUClusterCreateRequestLegacyNvidia?), TypeInfoPropertyName = "NullableGPUClusterCreateRequestLegacyNvidia2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GPUClusterCreateRequestCommonClusterType?), TypeInfoPropertyName = "NullableGPUClusterCreateRequestCommonClusterType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GPUClusterCreateRequestCommonGpuType?), TypeInfoPropertyName = "NullableGPUClusterCreateRequestCommonGpuType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GPUClusterCreateRequestCommonBillingType?), TypeInfoPropertyName = "NullableGPUClusterCreateRequestCommonBillingType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GPUClusterInfoClusterType?), TypeInfoPropertyName = "NullableGPUClusterInfoClusterType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GPUClusterInfoGpuType?), TypeInfoPropertyName = "NullableGPUClusterInfoGpuType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GPUClusterInfoStatus?), TypeInfoPropertyName = "NullableGPUClusterInfoStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GPUClusterInfoBillingType?), TypeInfoPropertyName = "NullableGPUClusterInfoBillingType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GPUClusterUpdateRequestClusterType?), TypeInfoPropertyName = "NullableGPUClusterUpdateRequestClusterType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AcceptanceTestsParamsDcgmDiagLevel?), TypeInfoPropertyName = "NullableAcceptanceTestsParamsDcgmDiagLevel2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ClusterPhaseTransitionPhase?), TypeInfoPropertyName = "NullableClusterPhaseTransitionPhase2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.InstanceClusterConfigLoadBalancer?), TypeInfoPropertyName = "NullableInstanceClusterConfigLoadBalancer2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.NodePhaseTransitionPhase?), TypeInfoPropertyName = "NullableNodePhaseTransitionPhase2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.PassiveHealthCheckAlertSeverity?), TypeInfoPropertyName = "NullablePassiveHealthCheckAlertSeverity2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RemediationMode?), TypeInfoPropertyName = "NullableRemediationMode2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RemediationTrigger?), TypeInfoPropertyName = "NullableRemediationTrigger2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RemediationState?), TypeInfoPropertyName = "NullableRemediationState2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - internal sealed partial class GPUClusterServiceSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext - { - } - /// +{ /// /// /// public sealed partial class GPUClusterServiceSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext @@ -175,29 +46,7 @@ private GPUClusterServiceSourceGenerationContext(global::System.Text.Json.JsonSe [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) { - options.Converters.Add(new global::Together.JsonConverters.GPUClusterCreateRequestJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.GPUClusterCreateRequestNvidiaVersionJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.GPUClusterCreateRequestLegacyNvidiaJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter, global::System.Collections.Generic.IList>()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter>()); - options.Converters.Add(new global::Together.JsonConverters.UnixTimestampJsonConverter()); - options.Converters.Add(new LazyEnumJsonConverterFactory()); + global::Together.SourceGenerationContext.AddConverters(options); } private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() @@ -212,244 +61,6 @@ public static void AddConverters(global::System.Text.Json.JsonSerializerOptions return options; } - - private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Serialization.JsonConverterFactory - { - public override bool CanConvert(global::System.Type typeToConvert) - { - return - typeToConvert == typeof(global::Together.GPUClusterCreateRequestCommonClusterType) - - || typeToConvert == typeof(global::Together.GPUClusterCreateRequestCommonClusterType?) - - || typeToConvert == typeof(global::Together.GPUClusterCreateRequestCommonGpuType) - - || typeToConvert == typeof(global::Together.GPUClusterCreateRequestCommonGpuType?) - - || typeToConvert == typeof(global::Together.GPUClusterCreateRequestCommonBillingType) - - || typeToConvert == typeof(global::Together.GPUClusterCreateRequestCommonBillingType?) - - || typeToConvert == typeof(global::Together.GPUClusterInfoClusterType) - - || typeToConvert == typeof(global::Together.GPUClusterInfoClusterType?) - - || typeToConvert == typeof(global::Together.GPUClusterInfoGpuType) - - || typeToConvert == typeof(global::Together.GPUClusterInfoGpuType?) - - || typeToConvert == typeof(global::Together.GPUClusterInfoStatus) - - || typeToConvert == typeof(global::Together.GPUClusterInfoStatus?) - - || typeToConvert == typeof(global::Together.GPUClusterInfoBillingType) - - || typeToConvert == typeof(global::Together.GPUClusterInfoBillingType?) - - || typeToConvert == typeof(global::Together.GPUClusterUpdateRequestClusterType) - - || typeToConvert == typeof(global::Together.GPUClusterUpdateRequestClusterType?) - - || typeToConvert == typeof(global::Together.AcceptanceTestsParamsDcgmDiagLevel) - - || typeToConvert == typeof(global::Together.AcceptanceTestsParamsDcgmDiagLevel?) - - || typeToConvert == typeof(global::Together.ClusterPhaseTransitionPhase) - - || typeToConvert == typeof(global::Together.ClusterPhaseTransitionPhase?) - - || typeToConvert == typeof(global::Together.InstanceClusterConfigLoadBalancer) - - || typeToConvert == typeof(global::Together.InstanceClusterConfigLoadBalancer?) - - || typeToConvert == typeof(global::Together.NodePhaseTransitionPhase) - - || typeToConvert == typeof(global::Together.NodePhaseTransitionPhase?) - - || typeToConvert == typeof(global::Together.PassiveHealthCheckAlertSeverity) - - || typeToConvert == typeof(global::Together.PassiveHealthCheckAlertSeverity?) - - || typeToConvert == typeof(global::Together.RemediationMode) - - || typeToConvert == typeof(global::Together.RemediationMode?) - - || typeToConvert == typeof(global::Together.RemediationTrigger) - - || typeToConvert == typeof(global::Together.RemediationTrigger?) - - || typeToConvert == typeof(global::Together.RemediationState) - - || typeToConvert == typeof(global::Together.RemediationState?); - } - - public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - if (typeToConvert == typeof(global::Together.GPUClusterCreateRequestCommonClusterType)) - { - return new global::Together.JsonConverters.GPUClusterCreateRequestCommonClusterTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.GPUClusterCreateRequestCommonClusterType?)) - { - return new global::Together.JsonConverters.GPUClusterCreateRequestCommonClusterTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.GPUClusterCreateRequestCommonGpuType)) - { - return new global::Together.JsonConverters.GPUClusterCreateRequestCommonGpuTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.GPUClusterCreateRequestCommonGpuType?)) - { - return new global::Together.JsonConverters.GPUClusterCreateRequestCommonGpuTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.GPUClusterCreateRequestCommonBillingType)) - { - return new global::Together.JsonConverters.GPUClusterCreateRequestCommonBillingTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.GPUClusterCreateRequestCommonBillingType?)) - { - return new global::Together.JsonConverters.GPUClusterCreateRequestCommonBillingTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.GPUClusterInfoClusterType)) - { - return new global::Together.JsonConverters.GPUClusterInfoClusterTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.GPUClusterInfoClusterType?)) - { - return new global::Together.JsonConverters.GPUClusterInfoClusterTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.GPUClusterInfoGpuType)) - { - return new global::Together.JsonConverters.GPUClusterInfoGpuTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.GPUClusterInfoGpuType?)) - { - return new global::Together.JsonConverters.GPUClusterInfoGpuTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.GPUClusterInfoStatus)) - { - return new global::Together.JsonConverters.GPUClusterInfoStatusJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.GPUClusterInfoStatus?)) - { - return new global::Together.JsonConverters.GPUClusterInfoStatusNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.GPUClusterInfoBillingType)) - { - return new global::Together.JsonConverters.GPUClusterInfoBillingTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.GPUClusterInfoBillingType?)) - { - return new global::Together.JsonConverters.GPUClusterInfoBillingTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.GPUClusterUpdateRequestClusterType)) - { - return new global::Together.JsonConverters.GPUClusterUpdateRequestClusterTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.GPUClusterUpdateRequestClusterType?)) - { - return new global::Together.JsonConverters.GPUClusterUpdateRequestClusterTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.AcceptanceTestsParamsDcgmDiagLevel)) - { - return new global::Together.JsonConverters.AcceptanceTestsParamsDcgmDiagLevelJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.AcceptanceTestsParamsDcgmDiagLevel?)) - { - return new global::Together.JsonConverters.AcceptanceTestsParamsDcgmDiagLevelNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.ClusterPhaseTransitionPhase)) - { - return new global::Together.JsonConverters.ClusterPhaseTransitionPhaseJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.ClusterPhaseTransitionPhase?)) - { - return new global::Together.JsonConverters.ClusterPhaseTransitionPhaseNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.InstanceClusterConfigLoadBalancer)) - { - return new global::Together.JsonConverters.InstanceClusterConfigLoadBalancerJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.InstanceClusterConfigLoadBalancer?)) - { - return new global::Together.JsonConverters.InstanceClusterConfigLoadBalancerNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.NodePhaseTransitionPhase)) - { - return new global::Together.JsonConverters.NodePhaseTransitionPhaseJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.NodePhaseTransitionPhase?)) - { - return new global::Together.JsonConverters.NodePhaseTransitionPhaseNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.PassiveHealthCheckAlertSeverity)) - { - return new global::Together.JsonConverters.PassiveHealthCheckAlertSeverityJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.PassiveHealthCheckAlertSeverity?)) - { - return new global::Together.JsonConverters.PassiveHealthCheckAlertSeverityNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.RemediationMode)) - { - return new global::Together.JsonConverters.RemediationModeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.RemediationMode?)) - { - return new global::Together.JsonConverters.RemediationModeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.RemediationTrigger)) - { - return new global::Together.JsonConverters.RemediationTriggerJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.RemediationTrigger?)) - { - return new global::Together.JsonConverters.RemediationTriggerNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.RemediationState)) - { - return new global::Together.JsonConverters.RemediationStateJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.RemediationState?)) - { - return new global::Together.JsonConverters.RemediationStateNullableJsonConverter(); - } - throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); - } - } - private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver { private readonly object _gate = new(); @@ -489,7 +100,7 @@ private sealed class LazyChunkResolver : global::System.Text.Json.Serialization. { return index switch { - 0 => new GPUClusterServiceSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), + 0 => global::Together.SourceGenerationContext.TypeInfoResolver, _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), }; } diff --git a/src/libs/Together/Generated/Together.GPUClusterServiceClient.GPUClusterServiceCreate.g.cs b/src/libs/Together/Generated/Together.GPUClusterServiceClient.GPUClusterServiceCreate.g.cs index d93e6952..39e7b40c 100644 --- a/src/libs/Together/Generated/Together.GPUClusterServiceClient.GPUClusterServiceCreate.g.cs +++ b/src/libs/Together/Generated/Together.GPUClusterServiceClient.GPUClusterServiceCreate.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class GPUClusterServiceClient { + private static readonly global::Together.AutoSDKServer[] s_GPUClusterServiceCreateServers = 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_GPUClusterServiceCreateSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -52,6 +65,20 @@ partial void ProcessGPUClusterServiceCreateResponseContent( /// 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()
+ /// response = client.beta.clusters.create(
+ /// cluster_name="my-gpu-cluster",
+ /// region="us-central-8",
+ /// gpu_type="H100_SXM",
+ /// num_gpus=8,
+ /// nvidia_driver_version="560",
+ /// cuda_version="12.6",
+ /// billint_type="ON_DEMAND",
+ /// )
+ /// print(response.cluster_id) + ///
public async global::System.Threading.Tasks.Task GPUClusterServiceCreateAsync( global::Together.GPUClusterCreateRequest request, @@ -78,6 +105,20 @@ partial void ProcessGPUClusterServiceCreateResponseContent( /// 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()
+ /// response = client.beta.clusters.create(
+ /// cluster_name="my-gpu-cluster",
+ /// region="us-central-8",
+ /// gpu_type="H100_SXM",
+ /// num_gpus=8,
+ /// nvidia_driver_version="560",
+ /// cuda_version="12.6",
+ /// billint_type="ON_DEMAND",
+ /// )
+ /// print(response.cluster_id) + ///
public async global::System.Threading.Tasks.Task> GPUClusterServiceCreateAsResponseAsync( global::Together.GPUClusterCreateRequest request, @@ -114,8 +155,10 @@ partial void ProcessGPUClusterServiceCreateResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: "/v1/compute/clusters", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: "/compute/clusters", + baseUri: ResolveBaseUri( + servers: s_GPUClusterServiceCreateServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -181,7 +224,7 @@ partial void ProcessGPUClusterServiceCreateResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GPUClusterServiceCreate", methodName: "GPUClusterServiceCreateAsync", - pathTemplate: "\"/v1/compute/clusters\"", + pathTemplate: "\"/compute/clusters\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -215,7 +258,7 @@ partial void ProcessGPUClusterServiceCreateResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GPUClusterServiceCreate", methodName: "GPUClusterServiceCreateAsync", - pathTemplate: "\"/v1/compute/clusters\"", + pathTemplate: "\"/compute/clusters\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -256,7 +299,7 @@ partial void ProcessGPUClusterServiceCreateResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GPUClusterServiceCreate", methodName: "GPUClusterServiceCreateAsync", - pathTemplate: "\"/v1/compute/clusters\"", + pathTemplate: "\"/compute/clusters\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -304,7 +347,7 @@ partial void ProcessGPUClusterServiceCreateResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GPUClusterServiceCreate", methodName: "GPUClusterServiceCreateAsync", - pathTemplate: "\"/v1/compute/clusters\"", + pathTemplate: "\"/compute/clusters\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -326,7 +369,7 @@ partial void ProcessGPUClusterServiceCreateResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GPUClusterServiceCreate", methodName: "GPUClusterServiceCreateAsync", - pathTemplate: "\"/v1/compute/clusters\"", + pathTemplate: "\"/compute/clusters\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.GPUClusterServiceClient.GPUClusterServiceDelete.g.cs b/src/libs/Together/Generated/Together.GPUClusterServiceClient.GPUClusterServiceDelete.g.cs index ef69ddff..d883c3cf 100644 --- a/src/libs/Together/Generated/Together.GPUClusterServiceClient.GPUClusterServiceDelete.g.cs +++ b/src/libs/Together/Generated/Together.GPUClusterServiceClient.GPUClusterServiceDelete.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class GPUClusterServiceClient { + private static readonly global::Together.AutoSDKServer[] s_GPUClusterServiceDeleteServers = 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_GPUClusterServiceDeleteSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -51,6 +64,12 @@ partial void ProcessGPUClusterServiceDeleteResponseContent( /// 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()
+ /// cluster = client.beta.clusters.delete("cluster_id")
+ /// print(cluster) + ///
public async global::System.Threading.Tasks.Task GPUClusterServiceDeleteAsync( string clusterId, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -74,6 +93,12 @@ partial void ProcessGPUClusterServiceDeleteResponseContent( /// 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()
+ /// cluster = client.beta.clusters.delete("cluster_id")
+ /// print(cluster) + ///
public async global::System.Threading.Tasks.Task> GPUClusterServiceDeleteAsResponseAsync( string clusterId, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -109,8 +134,10 @@ partial void ProcessGPUClusterServiceDeleteResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v1/compute/clusters/{clusterId}", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/compute/clusters/{clusterId}", + baseUri: ResolveBaseUri( + servers: s_GPUClusterServiceDeleteServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -170,7 +197,7 @@ partial void ProcessGPUClusterServiceDeleteResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GPUClusterServiceDelete", methodName: "GPUClusterServiceDeleteAsync", - pathTemplate: "$\"/v1/compute/clusters/{clusterId}\"", + pathTemplate: "$\"/compute/clusters/{clusterId}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -204,7 +231,7 @@ partial void ProcessGPUClusterServiceDeleteResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GPUClusterServiceDelete", methodName: "GPUClusterServiceDeleteAsync", - pathTemplate: "$\"/v1/compute/clusters/{clusterId}\"", + pathTemplate: "$\"/compute/clusters/{clusterId}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -245,7 +272,7 @@ partial void ProcessGPUClusterServiceDeleteResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GPUClusterServiceDelete", methodName: "GPUClusterServiceDeleteAsync", - pathTemplate: "$\"/v1/compute/clusters/{clusterId}\"", + pathTemplate: "$\"/compute/clusters/{clusterId}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -293,7 +320,7 @@ partial void ProcessGPUClusterServiceDeleteResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GPUClusterServiceDelete", methodName: "GPUClusterServiceDeleteAsync", - pathTemplate: "$\"/v1/compute/clusters/{clusterId}\"", + pathTemplate: "$\"/compute/clusters/{clusterId}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -315,7 +342,7 @@ partial void ProcessGPUClusterServiceDeleteResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GPUClusterServiceDelete", methodName: "GPUClusterServiceDeleteAsync", - pathTemplate: "$\"/v1/compute/clusters/{clusterId}\"", + pathTemplate: "$\"/compute/clusters/{clusterId}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.GPUClusterServiceClient.GPUClusterServiceGet.g.cs b/src/libs/Together/Generated/Together.GPUClusterServiceClient.GPUClusterServiceGet.g.cs index c78c9b41..d4782aa5 100644 --- a/src/libs/Together/Generated/Together.GPUClusterServiceClient.GPUClusterServiceGet.g.cs +++ b/src/libs/Together/Generated/Together.GPUClusterServiceClient.GPUClusterServiceGet.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class GPUClusterServiceClient { + private static readonly global::Together.AutoSDKServer[] s_GPUClusterServiceGetServers = 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_GPUClusterServiceGetSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -51,6 +64,12 @@ partial void ProcessGPUClusterServiceGetResponseContent( /// 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()
+ /// cluster = client.beta.clusters.retrieve("cluster_id")
+ /// print(cluster) + ///
public async global::System.Threading.Tasks.Task GPUClusterServiceGetAsync( string clusterId, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -74,6 +93,12 @@ partial void ProcessGPUClusterServiceGetResponseContent( /// 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()
+ /// cluster = client.beta.clusters.retrieve("cluster_id")
+ /// print(cluster) + ///
public async global::System.Threading.Tasks.Task> GPUClusterServiceGetAsResponseAsync( string clusterId, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -109,8 +134,10 @@ partial void ProcessGPUClusterServiceGetResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v1/compute/clusters/{clusterId}", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/compute/clusters/{clusterId}", + baseUri: ResolveBaseUri( + servers: s_GPUClusterServiceGetServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -170,7 +197,7 @@ partial void ProcessGPUClusterServiceGetResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GPUClusterServiceGet", methodName: "GPUClusterServiceGetAsync", - pathTemplate: "$\"/v1/compute/clusters/{clusterId}\"", + pathTemplate: "$\"/compute/clusters/{clusterId}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -204,7 +231,7 @@ partial void ProcessGPUClusterServiceGetResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GPUClusterServiceGet", methodName: "GPUClusterServiceGetAsync", - pathTemplate: "$\"/v1/compute/clusters/{clusterId}\"", + pathTemplate: "$\"/compute/clusters/{clusterId}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -245,7 +272,7 @@ partial void ProcessGPUClusterServiceGetResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GPUClusterServiceGet", methodName: "GPUClusterServiceGetAsync", - pathTemplate: "$\"/v1/compute/clusters/{clusterId}\"", + pathTemplate: "$\"/compute/clusters/{clusterId}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -293,7 +320,7 @@ partial void ProcessGPUClusterServiceGetResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GPUClusterServiceGet", methodName: "GPUClusterServiceGetAsync", - pathTemplate: "$\"/v1/compute/clusters/{clusterId}\"", + pathTemplate: "$\"/compute/clusters/{clusterId}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -315,7 +342,7 @@ partial void ProcessGPUClusterServiceGetResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GPUClusterServiceGet", methodName: "GPUClusterServiceGetAsync", - pathTemplate: "$\"/v1/compute/clusters/{clusterId}\"", + pathTemplate: "$\"/compute/clusters/{clusterId}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.GPUClusterServiceClient.GPUClusterServiceList.g.cs b/src/libs/Together/Generated/Together.GPUClusterServiceClient.GPUClusterServiceList.g.cs index f1d72ad6..78e9983f 100644 --- a/src/libs/Together/Generated/Together.GPUClusterServiceClient.GPUClusterServiceList.g.cs +++ b/src/libs/Together/Generated/Together.GPUClusterServiceClient.GPUClusterServiceList.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class GPUClusterServiceClient { + private static readonly global::Together.AutoSDKServer[] s_GPUClusterServiceListServers = 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_GPUClusterServiceListSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -53,6 +66,15 @@ partial void ProcessGPUClusterServiceListResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.beta.clusters.list()
+ /// print(response.clusters) + ///
public async global::System.Threading.Tasks.Task GPUClusterServiceListAsync( string? projectId = default, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -78,6 +100,15 @@ partial void ProcessGPUClusterServiceListResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.beta.clusters.list()
+ /// print(response.clusters) + ///
public async global::System.Threading.Tasks.Task> GPUClusterServiceListAsResponseAsync( string? projectId = default, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -113,8 +144,10 @@ partial void ProcessGPUClusterServiceListResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: "/v1/compute/clusters", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: "/compute/clusters", + baseUri: ResolveBaseUri( + servers: s_GPUClusterServiceListServers, + defaultBaseUrl: "https://api.together.ai/v1")); __pathBuilder .AddOptionalParameter("projectId", projectId) ; @@ -177,7 +210,7 @@ partial void ProcessGPUClusterServiceListResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GPUClusterServiceList", methodName: "GPUClusterServiceListAsync", - pathTemplate: "\"/v1/compute/clusters\"", + pathTemplate: "\"/compute/clusters\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -211,7 +244,7 @@ partial void ProcessGPUClusterServiceListResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GPUClusterServiceList", methodName: "GPUClusterServiceListAsync", - pathTemplate: "\"/v1/compute/clusters\"", + pathTemplate: "\"/compute/clusters\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -252,7 +285,7 @@ partial void ProcessGPUClusterServiceListResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GPUClusterServiceList", methodName: "GPUClusterServiceListAsync", - pathTemplate: "\"/v1/compute/clusters\"", + pathTemplate: "\"/compute/clusters\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -300,7 +333,7 @@ partial void ProcessGPUClusterServiceListResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GPUClusterServiceList", methodName: "GPUClusterServiceListAsync", - pathTemplate: "\"/v1/compute/clusters\"", + pathTemplate: "\"/compute/clusters\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -322,7 +355,7 @@ partial void ProcessGPUClusterServiceListResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GPUClusterServiceList", methodName: "GPUClusterServiceListAsync", - pathTemplate: "\"/v1/compute/clusters\"", + pathTemplate: "\"/compute/clusters\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.GPUClusterServiceClient.GPUClusterServiceUpdate.g.cs b/src/libs/Together/Generated/Together.GPUClusterServiceClient.GPUClusterServiceUpdate.g.cs index 5b2605ee..b8294b0d 100644 --- a/src/libs/Together/Generated/Together.GPUClusterServiceClient.GPUClusterServiceUpdate.g.cs +++ b/src/libs/Together/Generated/Together.GPUClusterServiceClient.GPUClusterServiceUpdate.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class GPUClusterServiceClient { + private static readonly global::Together.AutoSDKServer[] s_GPUClusterServiceUpdateServers = 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_GPUClusterServiceUpdateSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -54,6 +67,12 @@ partial void ProcessGPUClusterServiceUpdateResponseContent( /// 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()
+ /// cluster = client.beta.clusters.update("cluster_id", cluster_type="KUBERNETES", num_gpus=24)
+ /// print(cluster) + ///
public async global::System.Threading.Tasks.Task GPUClusterServiceUpdateAsync( string clusterId, @@ -82,6 +101,12 @@ partial void ProcessGPUClusterServiceUpdateResponseContent( /// 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()
+ /// cluster = client.beta.clusters.update("cluster_id", cluster_type="KUBERNETES", num_gpus=24)
+ /// print(cluster) + ///
public async global::System.Threading.Tasks.Task> GPUClusterServiceUpdateAsResponseAsync( string clusterId, @@ -122,8 +147,10 @@ partial void ProcessGPUClusterServiceUpdateResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v1/compute/clusters/{clusterId}", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/compute/clusters/{clusterId}", + baseUri: ResolveBaseUri( + servers: s_GPUClusterServiceUpdateServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -190,7 +217,7 @@ partial void ProcessGPUClusterServiceUpdateResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GPUClusterServiceUpdate", methodName: "GPUClusterServiceUpdateAsync", - pathTemplate: "$\"/v1/compute/clusters/{clusterId}\"", + pathTemplate: "$\"/compute/clusters/{clusterId}\"", httpMethod: "PUT", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -224,7 +251,7 @@ partial void ProcessGPUClusterServiceUpdateResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GPUClusterServiceUpdate", methodName: "GPUClusterServiceUpdateAsync", - pathTemplate: "$\"/v1/compute/clusters/{clusterId}\"", + pathTemplate: "$\"/compute/clusters/{clusterId}\"", httpMethod: "PUT", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -265,7 +292,7 @@ partial void ProcessGPUClusterServiceUpdateResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GPUClusterServiceUpdate", methodName: "GPUClusterServiceUpdateAsync", - pathTemplate: "$\"/v1/compute/clusters/{clusterId}\"", + pathTemplate: "$\"/compute/clusters/{clusterId}\"", httpMethod: "PUT", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -313,7 +340,7 @@ partial void ProcessGPUClusterServiceUpdateResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GPUClusterServiceUpdate", methodName: "GPUClusterServiceUpdateAsync", - pathTemplate: "$\"/v1/compute/clusters/{clusterId}\"", + pathTemplate: "$\"/compute/clusters/{clusterId}\"", httpMethod: "PUT", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -335,7 +362,7 @@ partial void ProcessGPUClusterServiceUpdateResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GPUClusterServiceUpdate", methodName: "GPUClusterServiceUpdateAsync", - pathTemplate: "$\"/v1/compute/clusters/{clusterId}\"", + pathTemplate: "$\"/compute/clusters/{clusterId}\"", httpMethod: "PUT", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.GPUClusterServiceClient.g.cs b/src/libs/Together/Generated/Together.GPUClusterServiceClient.g.cs index 288a03e3..4750b44f 100644 --- a/src/libs/Together/Generated/Together.GPUClusterServiceClient.g.cs +++ b/src/libs/Together/Generated/Together.GPUClusterServiceClient.g.cs @@ -12,7 +12,7 @@ public sealed partial class GPUClusterServiceClient : global::Together.IGPUClust /// /// Default environment for APIs /// - public const string DefaultBaseUrl = "https://api.together.ai/"; + public const string DefaultBaseUrl = "https://api.together.ai/v1"; private bool _disposeHttpClient = true; @@ -20,7 +20,7 @@ public sealed partial class GPUClusterServiceClient : global::Together.IGPUClust 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; } @@ -53,6 +53,34 @@ public sealed partial class GPUClusterServiceClient : global::Together.IGPUClust } + + 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 GPUClusterServiceClient. /// If no httpClient is provided, a new one will be created. @@ -151,5 +179,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.Hardware.JsonSerializerContext.g.cs b/src/libs/Together/Generated/Together.Hardware.JsonSerializerContext.g.cs new file mode 100644 index 00000000..d91ed6c6 --- /dev/null +++ b/src/libs/Together/Generated/Together.Hardware.JsonSerializerContext.g.cs @@ -0,0 +1,109 @@ + +#nullable enable + +namespace Together +{ /// + /// + /// + public sealed partial class HardwareSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext + { + private static readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver Resolver = new LazyChunkResolver(); + + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + internal static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver TypeInfoResolver => Resolver; + + + private static readonly global::System.Text.Json.JsonSerializerOptions DefaultOptions = CreateDefaultOptions(); + + /// + /// + /// + public static HardwareSourceGenerationContext Default { get; } = new(DefaultOptions); + + private HardwareSourceGenerationContext(global::System.Text.Json.JsonSerializerOptions options) + : base(options) + { + } + + /// + protected override global::System.Text.Json.JsonSerializerOptions? GeneratedSerializerOptions => DefaultOptions; + + /// + public override global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo(global::System.Type type) + { + return Resolver.GetTypeInfo(type, Options); + } + + /// + /// Adds this package's converters to . + /// + /// + /// A converter has to be on the options a chained resolver builds its JsonTypeInfo against, + /// and a context resolves types from every package below it. Each package contributes only + /// what it owns and calls down the chain for the rest, so the family's converter table is + /// written once rather than copied into all of them. + /// + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) + { + global::Together.SourceGenerationContext.AddConverters(options); + } + + private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() + { + var options = new global::System.Text.Json.JsonSerializerOptions + { + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + TypeInfoResolver = Resolver, + }; + AddConverters(options); + + return options; + } + + private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver + { + private readonly object _gate = new(); + private readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[] _resolvers = new global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[1]; + + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo( + global::System.Type type, + global::System.Text.Json.JsonSerializerOptions options) + { + for (var index = 0; index < _resolvers.Length; index++) + { + var typeInfo = GetResolver(index).GetTypeInfo(type, options); + if (typeInfo is not null) + { + return typeInfo; + } + } + + return null; + } + + private global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver GetResolver(int index) + { + var resolver = global::System.Threading.Volatile.Read(ref _resolvers[index]); + if (resolver is not null) + { + return resolver; + } + + lock (_gate) + { + return _resolvers[index] ??= CreateResolver(index); + } + } + + private static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver CreateResolver(int index) + { + return index switch + { + 0 => global::Together.SourceGenerationContext.TypeInfoResolver, + _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), + }; + } + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.HardwareClient.ListHardware.g.cs b/src/libs/Together/Generated/Together.HardwareClient.ListHardware.g.cs new file mode 100644 index 00000000..fd1007e1 --- /dev/null +++ b/src/libs/Together/Generated/Together.HardwareClient.ListHardware.g.cs @@ -0,0 +1,548 @@ + +#nullable enable + +namespace Together +{ + public partial class HardwareClient + { + + private static readonly global::Together.AutoSDKServer[] s_ListHardwareServers = 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_ListHardwareSecurityRequirement0 = + 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_ListHardwareSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_ListHardwareSecurityRequirement0, + }; + partial void PrepareListHardwareArguments( + global::System.Net.Http.HttpClient httpClient, + ref string? model); + partial void PrepareListHardwareRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? model); + partial void ProcessListHardwareResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessListHardwareResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// List available hardware configurations
+ /// Returns a list of available hardware configurations for deploying models. When a model parameter is provided, it returns only hardware configurations compatible with that model, including their current availability status. + ///
+ /// + /// Filter hardware configurations by model compatibility. When provided,
+ /// the response includes availability status for each compatible configuration.
+ /// [See all of Together AI's dedicated models](https://docs.together.ai/docs/dedicated-models)
+ /// Example: deepseek-ai/DeepSeek-R1 + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.endpoints.list_hardware()
+ /// for hardware in response.data:
+ /// print(hardware.id) + ///
+ public async global::System.Threading.Tasks.Task ListHardwareAsync( + string? model = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListHardwareAsResponseAsync( + model: model, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List available hardware configurations
+ /// Returns a list of available hardware configurations for deploying models. When a model parameter is provided, it returns only hardware configurations compatible with that model, including their current availability status. + ///
+ /// + /// Filter hardware configurations by model compatibility. When provided,
+ /// the response includes availability status for each compatible configuration.
+ /// [See all of Together AI's dedicated models](https://docs.together.ai/docs/dedicated-models)
+ /// Example: deepseek-ai/DeepSeek-R1 + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.endpoints.list_hardware()
+ /// for hardware in response.data:
+ /// print(hardware.id) + ///
+ public async global::System.Threading.Tasks.Task> ListHardwareAsResponseAsync( + string? model = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareListHardwareArguments( + httpClient: HttpClient, + model: ref model); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ListHardwareSecurityRequirements, + operationName: "ListHardwareAsync"); + + 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: "/hardware", + baseUri: ResolveBaseUri( + servers: s_ListHardwareServers, + defaultBaseUrl: "https://api.together.ai/v1")); + __pathBuilder + .AddOptionalParameter("model", model) + ; + 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); + PrepareListHardwareRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + model: model); + + 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: "ListHardware", + methodName: "ListHardwareAsync", + pathTemplate: "\"/hardware\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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: "ListHardware", + methodName: "ListHardwareAsync", + pathTemplate: "\"/hardware\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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: "ListHardware", + methodName: "ListHardwareAsync", + pathTemplate: "\"/hardware\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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); + ProcessListHardwareResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListHardware", + methodName: "ListHardwareAsync", + pathTemplate: "\"/hardware\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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: "ListHardware", + methodName: "ListHardwareAsync", + pathTemplate: "\"/hardware\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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 + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + global::Together.ErrorData? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = global::Together.ErrorData.FromJson(__content_403, JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = global::Together.ErrorData.FromJson(__content_403, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal 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); + ProcessListHardwareResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.ListHardwareResponse.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.ListHardwareResponse.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.HardwareClient.g.cs b/src/libs/Together/Generated/Together.HardwareClient.g.cs new file mode 100644 index 00000000..52992a6e --- /dev/null +++ b/src/libs/Together/Generated/Together.HardwareClient.g.cs @@ -0,0 +1,295 @@ + +#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 HardwareClient : global::Together.IHardwareClient, 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; } + + + /// + public global::System.Func CreateIdempotencyKey { get; set; } = () => global::System.Guid.NewGuid().ToString("D"); + + + internal global::Together.AutoSDKServerConfiguration AutoSDKServerConfiguration { get; set; } = new global::Together.AutoSDKServerConfiguration(); + + internal global::System.Lazy? JsonSerializerContextProvider { get; set; } + + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext + { + get => JsonSerializerContextProvider?.Value ?? global::Together.HardwareSourceGenerationContext.Default; + set => JsonSerializerContextProvider = new(() => value); + } + + + + 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 HardwareClient. + /// 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 HardwareClient( + 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 HardwareClient 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 HardwareClient( + 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 HardwareClient. + /// 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 HardwareClient( + 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.HealthCheckService.JsonSerializerContext.g.cs b/src/libs/Together/Generated/Together.HealthCheckService.JsonSerializerContext.g.cs index 0cf6bd10..f96aa1cd 100644 --- a/src/libs/Together/Generated/Together.HealthCheckService.JsonSerializerContext.g.cs +++ b/src/libs/Together/Generated/Together.HealthCheckService.JsonSerializerContext.g.cs @@ -2,46 +2,7 @@ #nullable enable namespace Together -{ - /// - /// - /// - [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( - DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull - )] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ListPassiveHealthCheckAlertsResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.PassiveHealthCheckAlert))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.PHCAnnotation))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.XidDetail))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.SlurmNodeUnavailableDetail))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.PassiveHealthCheckAlertSeverity), TypeInfoPropertyName = "PassiveHealthCheckAlertSeverity2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.XidEvent))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.HealthCheckServiceListPassiveHealthCheckAlertsStatus), TypeInfoPropertyName = "HealthCheckServiceListPassiveHealthCheckAlertsStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.HealthCheckServiceListPassiveHealthCheckAlertsSeverityFilterItem), TypeInfoPropertyName = "HealthCheckServiceListPassiveHealthCheckAlertsSeverityFilterItem2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.HealthCheckServiceListPassiveHealthCheckAlertsOrderBy), TypeInfoPropertyName = "HealthCheckServiceListPassiveHealthCheckAlertsOrderBy2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.PassiveHealthCheckAlertSeverity?), TypeInfoPropertyName = "NullablePassiveHealthCheckAlertSeverity2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.HealthCheckServiceListPassiveHealthCheckAlertsStatus?), TypeInfoPropertyName = "NullableHealthCheckServiceListPassiveHealthCheckAlertsStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.HealthCheckServiceListPassiveHealthCheckAlertsSeverityFilterItem?), TypeInfoPropertyName = "NullableHealthCheckServiceListPassiveHealthCheckAlertsSeverityFilterItem2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.HealthCheckServiceListPassiveHealthCheckAlertsOrderBy?), TypeInfoPropertyName = "NullableHealthCheckServiceListPassiveHealthCheckAlertsOrderBy2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - internal sealed partial class HealthCheckServiceSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext - { - } - /// +{ /// /// /// public sealed partial class HealthCheckServiceSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext @@ -85,26 +46,7 @@ private HealthCheckServiceSourceGenerationContext(global::System.Text.Json.JsonS [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) { - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter, global::System.Collections.Generic.IList>()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter>()); - options.Converters.Add(new global::Together.JsonConverters.UnixTimestampJsonConverter()); - options.Converters.Add(new LazyEnumJsonConverterFactory()); + global::Together.SourceGenerationContext.AddConverters(options); } private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() @@ -119,76 +61,6 @@ public static void AddConverters(global::System.Text.Json.JsonSerializerOptions return options; } - - private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Serialization.JsonConverterFactory - { - public override bool CanConvert(global::System.Type typeToConvert) - { - return - typeToConvert == typeof(global::Together.PassiveHealthCheckAlertSeverity) - - || typeToConvert == typeof(global::Together.PassiveHealthCheckAlertSeverity?) - - || typeToConvert == typeof(global::Together.HealthCheckServiceListPassiveHealthCheckAlertsStatus) - - || typeToConvert == typeof(global::Together.HealthCheckServiceListPassiveHealthCheckAlertsStatus?) - - || typeToConvert == typeof(global::Together.HealthCheckServiceListPassiveHealthCheckAlertsSeverityFilterItem) - - || typeToConvert == typeof(global::Together.HealthCheckServiceListPassiveHealthCheckAlertsSeverityFilterItem?) - - || typeToConvert == typeof(global::Together.HealthCheckServiceListPassiveHealthCheckAlertsOrderBy) - - || typeToConvert == typeof(global::Together.HealthCheckServiceListPassiveHealthCheckAlertsOrderBy?); - } - - public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - if (typeToConvert == typeof(global::Together.PassiveHealthCheckAlertSeverity)) - { - return new global::Together.JsonConverters.PassiveHealthCheckAlertSeverityJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.PassiveHealthCheckAlertSeverity?)) - { - return new global::Together.JsonConverters.PassiveHealthCheckAlertSeverityNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.HealthCheckServiceListPassiveHealthCheckAlertsStatus)) - { - return new global::Together.JsonConverters.HealthCheckServiceListPassiveHealthCheckAlertsStatusJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.HealthCheckServiceListPassiveHealthCheckAlertsStatus?)) - { - return new global::Together.JsonConverters.HealthCheckServiceListPassiveHealthCheckAlertsStatusNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.HealthCheckServiceListPassiveHealthCheckAlertsSeverityFilterItem)) - { - return new global::Together.JsonConverters.HealthCheckServiceListPassiveHealthCheckAlertsSeverityFilterItemJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.HealthCheckServiceListPassiveHealthCheckAlertsSeverityFilterItem?)) - { - return new global::Together.JsonConverters.HealthCheckServiceListPassiveHealthCheckAlertsSeverityFilterItemNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.HealthCheckServiceListPassiveHealthCheckAlertsOrderBy)) - { - return new global::Together.JsonConverters.HealthCheckServiceListPassiveHealthCheckAlertsOrderByJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.HealthCheckServiceListPassiveHealthCheckAlertsOrderBy?)) - { - return new global::Together.JsonConverters.HealthCheckServiceListPassiveHealthCheckAlertsOrderByNullableJsonConverter(); - } - throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); - } - } - private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver { private readonly object _gate = new(); @@ -228,7 +100,7 @@ private sealed class LazyChunkResolver : global::System.Text.Json.Serialization. { return index switch { - 0 => new HealthCheckServiceSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), + 0 => global::Together.SourceGenerationContext.TypeInfoResolver, _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), }; } diff --git a/src/libs/Together/Generated/Together.HealthCheckServiceClient.HealthCheckServiceListPassiveHealthCheckAlerts.g.cs b/src/libs/Together/Generated/Together.HealthCheckServiceClient.HealthCheckServiceListPassiveHealthCheckAlerts.g.cs index 9619096a..9dd0ef45 100644 --- a/src/libs/Together/Generated/Together.HealthCheckServiceClient.HealthCheckServiceListPassiveHealthCheckAlerts.g.cs +++ b/src/libs/Together/Generated/Together.HealthCheckServiceClient.HealthCheckServiceListPassiveHealthCheckAlerts.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class HealthCheckServiceClient { + private static readonly global::Together.AutoSDKServer[] s_HealthCheckServiceListPassiveHealthCheckAlertsServers = 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_HealthCheckServiceListPassiveHealthCheckAlertsSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -197,8 +210,10 @@ partial void ProcessHealthCheckServiceListPassiveHealthCheckAlertsResponseConten { var __pathBuilder = new global::Together.PathBuilder( - path: "/v1/compute/passive_health_check_alerts", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: "/compute/passive_health_check_alerts", + baseUri: ResolveBaseUri( + servers: s_HealthCheckServiceListPassiveHealthCheckAlertsServers, + defaultBaseUrl: "https://api.together.ai/v1")); __pathBuilder .AddOptionalParameter("intent_id", intentId) .AddOptionalParameter("instance_id", instanceId) @@ -275,7 +290,7 @@ partial void ProcessHealthCheckServiceListPassiveHealthCheckAlertsResponseConten context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "HealthCheckServiceListPassiveHealthCheckAlerts", methodName: "HealthCheckServiceListPassiveHealthCheckAlertsAsync", - pathTemplate: "\"/v1/compute/passive_health_check_alerts\"", + pathTemplate: "\"/compute/passive_health_check_alerts\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -309,7 +324,7 @@ partial void ProcessHealthCheckServiceListPassiveHealthCheckAlertsResponseConten context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "HealthCheckServiceListPassiveHealthCheckAlerts", methodName: "HealthCheckServiceListPassiveHealthCheckAlertsAsync", - pathTemplate: "\"/v1/compute/passive_health_check_alerts\"", + pathTemplate: "\"/compute/passive_health_check_alerts\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -350,7 +365,7 @@ partial void ProcessHealthCheckServiceListPassiveHealthCheckAlertsResponseConten context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "HealthCheckServiceListPassiveHealthCheckAlerts", methodName: "HealthCheckServiceListPassiveHealthCheckAlertsAsync", - pathTemplate: "\"/v1/compute/passive_health_check_alerts\"", + pathTemplate: "\"/compute/passive_health_check_alerts\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -398,7 +413,7 @@ partial void ProcessHealthCheckServiceListPassiveHealthCheckAlertsResponseConten context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "HealthCheckServiceListPassiveHealthCheckAlerts", methodName: "HealthCheckServiceListPassiveHealthCheckAlertsAsync", - pathTemplate: "\"/v1/compute/passive_health_check_alerts\"", + pathTemplate: "\"/compute/passive_health_check_alerts\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -420,7 +435,7 @@ partial void ProcessHealthCheckServiceListPassiveHealthCheckAlertsResponseConten context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "HealthCheckServiceListPassiveHealthCheckAlerts", methodName: "HealthCheckServiceListPassiveHealthCheckAlertsAsync", - pathTemplate: "\"/v1/compute/passive_health_check_alerts\"", + pathTemplate: "\"/compute/passive_health_check_alerts\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.HealthCheckServiceClient.g.cs b/src/libs/Together/Generated/Together.HealthCheckServiceClient.g.cs index 313c38a2..13b5c870 100644 --- a/src/libs/Together/Generated/Together.HealthCheckServiceClient.g.cs +++ b/src/libs/Together/Generated/Together.HealthCheckServiceClient.g.cs @@ -12,7 +12,7 @@ public sealed partial class HealthCheckServiceClient : global::Together.IHealthC /// /// Default environment for APIs /// - public const string DefaultBaseUrl = "https://api.together.ai/"; + public const string DefaultBaseUrl = "https://api.together.ai/v1"; private bool _disposeHttpClient = true; @@ -20,7 +20,7 @@ public sealed partial class HealthCheckServiceClient : global::Together.IHealthC 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; } @@ -53,6 +53,34 @@ public sealed partial class HealthCheckServiceClient : global::Together.IHealthC } + + 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 HealthCheckServiceClient. /// If no httpClient is provided, a new one will be created. @@ -151,5 +179,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.IABExperimentServiceClient.ABExperimentServiceCreateABExperiment.g.cs b/src/libs/Together/Generated/Together.IABExperimentServiceClient.ABExperimentServiceCreateABExperiment.g.cs index d89715ad..92ea4644 100644 --- a/src/libs/Together/Generated/Together.IABExperimentServiceClient.ABExperimentServiceCreateABExperiment.g.cs +++ b/src/libs/Together/Generated/Together.IABExperimentServiceClient.ABExperimentServiceCreateABExperiment.g.cs @@ -18,6 +18,29 @@ public partial interface IABExperimentServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// experiment = client.beta.endpoints.ab_experiments.create(
+ /// "ep_abc123",
+ /// project_id=project_id,
+ /// name="new-config-test",
+ /// members=[
+ /// {
+ /// "deployment_id": "dep_abc123",
+ /// "role": "AB_EXPERIMENT_MEMBER_ROLE_CONTROL",
+ /// "percent": 90,
+ /// },
+ /// {
+ /// "deployment_id": "dep_def456",
+ /// "role": "AB_EXPERIMENT_MEMBER_ROLE_VARIANT",
+ /// "percent": 10,
+ /// },
+ /// ],
+ /// )
+ /// print(experiment.id) + ///
global::System.Threading.Tasks.Task ABExperimentServiceCreateABExperimentAsync( string projectId, string endpointId, @@ -39,6 +62,29 @@ public partial interface IABExperimentServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// experiment = client.beta.endpoints.ab_experiments.create(
+ /// "ep_abc123",
+ /// project_id=project_id,
+ /// name="new-config-test",
+ /// members=[
+ /// {
+ /// "deployment_id": "dep_abc123",
+ /// "role": "AB_EXPERIMENT_MEMBER_ROLE_CONTROL",
+ /// "percent": 90,
+ /// },
+ /// {
+ /// "deployment_id": "dep_def456",
+ /// "role": "AB_EXPERIMENT_MEMBER_ROLE_VARIANT",
+ /// "percent": 10,
+ /// },
+ /// ],
+ /// )
+ /// print(experiment.id) + ///
global::System.Threading.Tasks.Task> ABExperimentServiceCreateABExperimentAsResponseAsync( string projectId, string endpointId, diff --git a/src/libs/Together/Generated/Together.IABExperimentServiceClient.ABExperimentServiceDeleteABExperiment.g.cs b/src/libs/Together/Generated/Together.IABExperimentServiceClient.ABExperimentServiceDeleteABExperiment.g.cs index 3291afc0..bbbe3b94 100644 --- a/src/libs/Together/Generated/Together.IABExperimentServiceClient.ABExperimentServiceDeleteABExperiment.g.cs +++ b/src/libs/Together/Generated/Together.IABExperimentServiceClient.ABExperimentServiceDeleteABExperiment.g.cs @@ -23,6 +23,16 @@ public partial interface IABExperimentServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// client.beta.endpoints.ab_experiments.delete(
+ /// "abx_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// ) + ///
global::System.Threading.Tasks.Task ABExperimentServiceDeleteABExperimentAsync( string projectId, string endpointId, @@ -49,6 +59,16 @@ public partial interface IABExperimentServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// client.beta.endpoints.ab_experiments.delete(
+ /// "abx_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// ) + ///
global::System.Threading.Tasks.Task> ABExperimentServiceDeleteABExperimentAsResponseAsync( string projectId, string endpointId, diff --git a/src/libs/Together/Generated/Together.IABExperimentServiceClient.ABExperimentServiceGetABExperiment.g.cs b/src/libs/Together/Generated/Together.IABExperimentServiceClient.ABExperimentServiceGetABExperiment.g.cs index 7d88529f..8edb6e91 100644 --- a/src/libs/Together/Generated/Together.IABExperimentServiceClient.ABExperimentServiceGetABExperiment.g.cs +++ b/src/libs/Together/Generated/Together.IABExperimentServiceClient.ABExperimentServiceGetABExperiment.g.cs @@ -20,6 +20,17 @@ public partial interface IABExperimentServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// experiment = client.beta.endpoints.ab_experiments.retrieve(
+ /// "abx_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// )
+ /// print(experiment.name, experiment.members) + ///
global::System.Threading.Tasks.Task ABExperimentServiceGetABExperimentAsync( string projectId, string endpointId, @@ -42,6 +53,17 @@ public partial interface IABExperimentServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// experiment = client.beta.endpoints.ab_experiments.retrieve(
+ /// "abx_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// )
+ /// print(experiment.name, experiment.members) + ///
global::System.Threading.Tasks.Task> ABExperimentServiceGetABExperimentAsResponseAsync( string projectId, string endpointId, diff --git a/src/libs/Together/Generated/Together.IABExperimentServiceClient.ABExperimentServiceListABExperiments.g.cs b/src/libs/Together/Generated/Together.IABExperimentServiceClient.ABExperimentServiceListABExperiments.g.cs index 5d65f550..5c15161c 100644 --- a/src/libs/Together/Generated/Together.IABExperimentServiceClient.ABExperimentServiceListABExperiments.g.cs +++ b/src/libs/Together/Generated/Together.IABExperimentServiceClient.ABExperimentServiceListABExperiments.g.cs @@ -23,6 +23,17 @@ public partial interface IABExperimentServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// experiments = client.beta.endpoints.ab_experiments.list(
+ /// "ep_abc123",
+ /// project_id=project_id,
+ /// )
+ /// for experiment in experiments:
+ /// print(experiment.id, experiment.name) + ///
global::System.Threading.Tasks.Task ABExperimentServiceListABExperimentsAsync( string projectId, string endpointId, @@ -49,6 +60,17 @@ public partial interface IABExperimentServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// experiments = client.beta.endpoints.ab_experiments.list(
+ /// "ep_abc123",
+ /// project_id=project_id,
+ /// )
+ /// for experiment in experiments:
+ /// print(experiment.id, experiment.name) + ///
global::System.Threading.Tasks.Task> ABExperimentServiceListABExperimentsAsResponseAsync( string projectId, string endpointId, diff --git a/src/libs/Together/Generated/Together.IABExperimentServiceClient.ABExperimentServiceUpdateABExperiment.g.cs b/src/libs/Together/Generated/Together.IABExperimentServiceClient.ABExperimentServiceUpdateABExperiment.g.cs index cfa2ac66..06e3d460 100644 --- a/src/libs/Together/Generated/Together.IABExperimentServiceClient.ABExperimentServiceUpdateABExperiment.g.cs +++ b/src/libs/Together/Generated/Together.IABExperimentServiceClient.ABExperimentServiceUpdateABExperiment.g.cs @@ -24,6 +24,30 @@ public partial interface IABExperimentServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// experiment = client.beta.endpoints.ab_experiments.update(
+ /// "abx_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// update_mask="members",
+ /// members=[
+ /// {
+ /// "deployment_id": "dep_abc123",
+ /// "role": "AB_EXPERIMENT_MEMBER_ROLE_CONTROL",
+ /// "percent": 50,
+ /// },
+ /// {
+ /// "deployment_id": "dep_def456",
+ /// "role": "AB_EXPERIMENT_MEMBER_ROLE_VARIANT",
+ /// "percent": 50,
+ /// },
+ /// ],
+ /// )
+ /// print(experiment.members) + ///
global::System.Threading.Tasks.Task ABExperimentServiceUpdateABExperimentAsync( string projectId, string endpointId, @@ -53,6 +77,30 @@ public partial interface IABExperimentServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// experiment = client.beta.endpoints.ab_experiments.update(
+ /// "abx_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// update_mask="members",
+ /// members=[
+ /// {
+ /// "deployment_id": "dep_abc123",
+ /// "role": "AB_EXPERIMENT_MEMBER_ROLE_CONTROL",
+ /// "percent": 50,
+ /// },
+ /// {
+ /// "deployment_id": "dep_def456",
+ /// "role": "AB_EXPERIMENT_MEMBER_ROLE_VARIANT",
+ /// "percent": 50,
+ /// },
+ /// ],
+ /// )
+ /// print(experiment.members) + ///
global::System.Threading.Tasks.Task> ABExperimentServiceUpdateABExperimentAsResponseAsync( string projectId, string endpointId, diff --git a/src/libs/Together/Generated/Together.IAccountClient.Whoami.g.cs b/src/libs/Together/Generated/Together.IAccountClient.Whoami.g.cs index 29bc22a0..6d992367 100644 --- a/src/libs/Together/Generated/Together.IAccountClient.Whoami.g.cs +++ b/src/libs/Together/Generated/Together.IAccountClient.Whoami.g.cs @@ -5,24 +5,36 @@ namespace Together public partial interface IAccountClient { /// - /// Identify the caller
- /// Returns identity information for the authenticated caller. Accepts project API keys and user session JWTs. The response `type` indicates which fields are present.
- /// For project-scoped credentials, `project.slug` can be used with an endpoint slug as `<project_slug>/<endpoint_slug>` to form the `model` value in dedicated endpoint inference calls. + /// 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) + ///
global::System.Threading.Tasks.Task WhoamiAsync( global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// - /// Identify the caller
- /// Returns identity information for the authenticated caller. Accepts project API keys and user session JWTs. The response `type` indicates which fields are present.
- /// For project-scoped credentials, `project.slug` can be used with an endpoint slug as `<project_slug>/<endpoint_slug>` to form the `model` value in dedicated endpoint inference calls. + /// 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) + ///
global::System.Threading.Tasks.Task> WhoamiAsResponseAsync( global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); diff --git a/src/libs/Together/Generated/Together.IAccountClient.g.cs b/src/libs/Together/Generated/Together.IAccountClient.g.cs index 98c2220c..d19701b0 100644 --- a/src/libs/Together/Generated/Together.IAccountClient.g.cs +++ b/src/libs/Together/Generated/Together.IAccountClient.g.cs @@ -19,6 +19,27 @@ public partial interface IAccountClient : global::System.IDisposable ///
public System.Uri? BaseUri { get; } + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers { get; } + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer { get; set; } + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId); + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer(); + /// /// The authorizations to use for the requests. /// diff --git a/src/libs/Together/Generated/Together.IAudioClient.AudioSpeech.g.cs b/src/libs/Together/Generated/Together.IAudioClient.AudioSpeech.g.cs index 0ef9eaec..544f901e 100644 --- a/src/libs/Together/Generated/Together.IAudioClient.AudioSpeech.g.cs +++ b/src/libs/Together/Generated/Together.IAudioClient.AudioSpeech.g.cs @@ -12,6 +12,20 @@ public partial interface IAudioClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.audio.speech.with_streaming_response.create(
+ /// model="cartesia/sonic-2",
+ /// input="The quick brown fox jumps over the lazy dog.",
+ /// voice="laidback woman",
+ /// )
+ /// with response as stream:
+ /// stream.stream_to_file("audio.wav") + ///
global::System.Threading.Tasks.Task AudioSpeechAsync( global::Together.AudioSpeechRequest request, @@ -25,6 +39,20 @@ public partial interface IAudioClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.audio.speech.with_streaming_response.create(
+ /// model="cartesia/sonic-2",
+ /// input="The quick brown fox jumps over the lazy dog.",
+ /// voice="laidback woman",
+ /// )
+ /// with response as stream:
+ /// stream.stream_to_file("audio.wav") + ///
global::System.Threading.Tasks.Task AudioSpeechAsStreamAsync( global::Together.AudioSpeechRequest request, @@ -38,6 +66,20 @@ public partial interface IAudioClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.audio.speech.with_streaming_response.create(
+ /// model="cartesia/sonic-2",
+ /// input="The quick brown fox jumps over the lazy dog.",
+ /// voice="laidback woman",
+ /// )
+ /// with response as stream:
+ /// stream.stream_to_file("audio.wav") + ///
global::System.Threading.Tasks.Task> AudioSpeechAsResponseAsync( global::Together.AudioSpeechRequest request, diff --git a/src/libs/Together/Generated/Together.IAudioClient.AudioSpeechAsEventStream.g.cs b/src/libs/Together/Generated/Together.IAudioClient.AudioSpeechAsEventStream.g.cs index dd98f26b..2864c400 100644 --- a/src/libs/Together/Generated/Together.IAudioClient.AudioSpeechAsEventStream.g.cs +++ b/src/libs/Together/Generated/Together.IAudioClient.AudioSpeechAsEventStream.g.cs @@ -12,6 +12,20 @@ public partial interface IAudioClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.audio.speech.with_streaming_response.create(
+ /// model="cartesia/sonic-2",
+ /// input="The quick brown fox jumps over the lazy dog.",
+ /// voice="laidback woman",
+ /// )
+ /// with response as stream:
+ /// stream.stream_to_file("audio.wav") + ///
global::System.Collections.Generic.IAsyncEnumerable AudioSpeechAsEventStreamAsync( global::Together.AudioSpeechRequest request, diff --git a/src/libs/Together/Generated/Together.IAudioClient.AudioTranscriptions.g.cs b/src/libs/Together/Generated/Together.IAudioClient.AudioTranscriptions.g.cs index ad7efe17..cc55d737 100644 --- a/src/libs/Together/Generated/Together.IAudioClient.AudioTranscriptions.g.cs +++ b/src/libs/Together/Generated/Together.IAudioClient.AudioTranscriptions.g.cs @@ -12,6 +12,19 @@ public partial interface IAudioClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// import os
+ /// from together import Together
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// file = open("audio.wav", "rb")
+ /// response = client.audio.transcriptions.create(
+ /// model="openai/whisper-large-v3",
+ /// file=file,
+ /// )
+ /// print(response.text) + ///
global::System.Threading.Tasks.Task AudioTranscriptionsAsync( global::Together.AudioTranscriptionRequest request, @@ -25,6 +38,19 @@ public partial interface IAudioClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// import os
+ /// from together import Together
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// file = open("audio.wav", "rb")
+ /// response = client.audio.transcriptions.create(
+ /// model="openai/whisper-large-v3",
+ /// file=file,
+ /// )
+ /// print(response.text) + ///
global::System.Threading.Tasks.Task> AudioTranscriptionsAsResponseAsync( global::Together.AudioTranscriptionRequest request, diff --git a/src/libs/Together/Generated/Together.IAudioClient.AudioTranslations.g.cs b/src/libs/Together/Generated/Together.IAudioClient.AudioTranslations.g.cs index fb0d8cbd..03ac5a29 100644 --- a/src/libs/Together/Generated/Together.IAudioClient.AudioTranslations.g.cs +++ b/src/libs/Together/Generated/Together.IAudioClient.AudioTranslations.g.cs @@ -12,6 +12,20 @@ public partial interface IAudioClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// file = open("audio.wav", "rb")
+ /// response = client.audio.translations.create(
+ /// model="openai/whisper-large-v3",
+ /// file=file,
+ /// language="es",
+ /// )
+ /// print(response.text) + ///
global::System.Threading.Tasks.Task AudioTranslationsAsync( global::Together.AudioTranslationRequest request, @@ -25,6 +39,20 @@ public partial interface IAudioClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// file = open("audio.wav", "rb")
+ /// response = client.audio.translations.create(
+ /// model="openai/whisper-large-v3",
+ /// file=file,
+ /// language="es",
+ /// )
+ /// print(response.text) + ///
global::System.Threading.Tasks.Task> AudioTranslationsAsResponseAsync( global::Together.AudioTranslationRequest request, diff --git a/src/libs/Together/Generated/Together.IAudioClient.RealtimeTranscription.g.cs b/src/libs/Together/Generated/Together.IAudioClient.RealtimeTranscription.g.cs index 31a44ff3..295b0daf 100644 --- a/src/libs/Together/Generated/Together.IAudioClient.RealtimeTranscription.g.cs +++ b/src/libs/Together/Generated/Together.IAudioClient.RealtimeTranscription.g.cs @@ -136,6 +136,54 @@ public partial interface IAudioClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// import asyncio
+ /// import websockets
+ /// import json
+ /// import base64
+ /// import os
+ /// async def transcribe_audio():
+ /// api_key = os.environ.get("TOGETHER_API_KEY")
+ /// url = "wss://api.together.ai/v1/realtime?model=openai/whisper-large-v3&input_audio_format=pcm_s16le_16000"
+ /// headers = {
+ /// "Authorization": f"Bearer {api_key}"
+ /// }
+ /// async with websockets.connect(url, additional_headers=headers) as ws:
+ /// # audio.wav must be 16 kHz, 16-bit mono PCM to match input_audio_format
+ /// with open("audio.wav", "rb") as f:
+ /// audio_data = f.read()
+ /// # Send audio in chunks with delay to simulate real-time
+ /// chunk_size = 8192
+ /// bytes_per_second = 16000 * 2 # 16kHz * 2 bytes (16-bit)
+ /// delay_per_chunk = chunk_size / bytes_per_second
+ /// for i in range(0, len(audio_data), chunk_size):
+ /// chunk = audio_data[i:i+chunk_size]
+ /// base64_chunk = base64.b64encode(chunk).decode('utf-8')
+ /// await ws.send(json.dumps({
+ /// "type": "input_audio_buffer.append",
+ /// "audio": base64_chunk
+ /// }))
+ /// # Simulate real-time streaming
+ /// if i + chunk_size < len(audio_data):
+ /// await asyncio.sleep(delay_per_chunk)
+ /// # Commit the audio buffer
+ /// await ws.send(json.dumps({
+ /// "type": "input_audio_buffer.commit"
+ /// }))
+ /// # Receive transcription results
+ /// async for message in ws:
+ /// data = json.loads(message)
+ /// if data["type"] == "conversation.item.input_audio_transcription.delta":
+ /// print(f"Partial: {data['delta']}")
+ /// elif data["type"] == "conversation.item.input_audio_transcription.completed":
+ /// print(f"Final: {data['transcript']}")
+ /// break
+ /// elif data["type"] == "conversation.item.input_audio_transcription.failed":
+ /// error = data.get("error", {})
+ /// print(f"Error: {error.get('message')}")
+ /// break
+ /// asyncio.run(transcribe_audio()) + ///
global::System.Threading.Tasks.Task RealtimeTranscriptionAsync( string model, global::Together.RealtimeTranscriptionInputAudioFormat inputAudioFormat = global::Together.RealtimeTranscriptionInputAudioFormat.PcmS16le16000, @@ -273,6 +321,54 @@ public partial interface IAudioClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// import asyncio
+ /// import websockets
+ /// import json
+ /// import base64
+ /// import os
+ /// async def transcribe_audio():
+ /// api_key = os.environ.get("TOGETHER_API_KEY")
+ /// url = "wss://api.together.ai/v1/realtime?model=openai/whisper-large-v3&input_audio_format=pcm_s16le_16000"
+ /// headers = {
+ /// "Authorization": f"Bearer {api_key}"
+ /// }
+ /// async with websockets.connect(url, additional_headers=headers) as ws:
+ /// # audio.wav must be 16 kHz, 16-bit mono PCM to match input_audio_format
+ /// with open("audio.wav", "rb") as f:
+ /// audio_data = f.read()
+ /// # Send audio in chunks with delay to simulate real-time
+ /// chunk_size = 8192
+ /// bytes_per_second = 16000 * 2 # 16kHz * 2 bytes (16-bit)
+ /// delay_per_chunk = chunk_size / bytes_per_second
+ /// for i in range(0, len(audio_data), chunk_size):
+ /// chunk = audio_data[i:i+chunk_size]
+ /// base64_chunk = base64.b64encode(chunk).decode('utf-8')
+ /// await ws.send(json.dumps({
+ /// "type": "input_audio_buffer.append",
+ /// "audio": base64_chunk
+ /// }))
+ /// # Simulate real-time streaming
+ /// if i + chunk_size < len(audio_data):
+ /// await asyncio.sleep(delay_per_chunk)
+ /// # Commit the audio buffer
+ /// await ws.send(json.dumps({
+ /// "type": "input_audio_buffer.commit"
+ /// }))
+ /// # Receive transcription results
+ /// async for message in ws:
+ /// data = json.loads(message)
+ /// if data["type"] == "conversation.item.input_audio_transcription.delta":
+ /// print(f"Partial: {data['delta']}")
+ /// elif data["type"] == "conversation.item.input_audio_transcription.completed":
+ /// print(f"Final: {data['transcript']}")
+ /// break
+ /// elif data["type"] == "conversation.item.input_audio_transcription.failed":
+ /// error = data.get("error", {})
+ /// print(f"Error: {error.get('message')}")
+ /// break
+ /// asyncio.run(transcribe_audio()) + ///
global::System.Threading.Tasks.Task RealtimeTranscriptionAsResponseAsync( string model, global::Together.RealtimeTranscriptionInputAudioFormat inputAudioFormat = global::Together.RealtimeTranscriptionInputAudioFormat.PcmS16le16000, diff --git a/src/libs/Together/Generated/Together.IAudioClient.RealtimeTts.g.cs b/src/libs/Together/Generated/Together.IAudioClient.RealtimeTts.g.cs index a9e592d2..1e351ae2 100644 --- a/src/libs/Together/Generated/Together.IAudioClient.RealtimeTts.g.cs +++ b/src/libs/Together/Generated/Together.IAudioClient.RealtimeTts.g.cs @@ -129,6 +129,69 @@ public partial interface IAudioClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// import asyncio
+ /// import websockets
+ /// import json
+ /// import base64
+ /// import os
+ /// async def generate_speech():
+ /// api_key = os.environ.get("TOGETHER_API_KEY")
+ /// url = "wss://api.together.ai/v1/audio/speech/websocket?model=hexgrad/Kokoro-82M&voice=af_heart"
+ /// headers = {
+ /// "Authorization": f"Bearer {api_key}"
+ /// }
+ /// async with websockets.connect(url, additional_headers=headers) as ws:
+ /// # Wait for session created
+ /// session_msg = await ws.recv()
+ /// session_data = json.loads(session_msg)
+ /// if session_data.get("type") != "session.created":
+ /// print(f"Failed to start session: {session_data}")
+ /// return
+ /// print(f"Session created: {session_data['session']['id']}")
+ /// # Send text for TTS
+ /// text_chunks = [
+ /// "Hello, this is a test.",
+ /// "This is the second sentence.",
+ /// "And this is the final one."
+ /// ]
+ /// async def send_text():
+ /// for chunk in text_chunks:
+ /// await ws.send(json.dumps({
+ /// "type": "input_text_buffer.append",
+ /// "text": chunk
+ /// }))
+ /// await asyncio.sleep(0.5) # Simulate typing
+ /// # Commit to process any remaining text
+ /// await ws.send(json.dumps({
+ /// "type": "input_text_buffer.commit"
+ /// }))
+ /// async def receive_audio():
+ /// audio_data = bytearray()
+ /// async for message in ws:
+ /// data = json.loads(message)
+ /// if data["type"] == "conversation.item.input_text.received":
+ /// print(f"Text received: {data['text']}")
+ /// elif data["type"] == "conversation.item.audio_output.delta":
+ /// # Decode base64 audio chunk
+ /// audio_chunk = base64.b64decode(data['delta'])
+ /// audio_data.extend(audio_chunk)
+ /// print(f"Received audio chunk for item {data['item_id']}")
+ /// elif data["type"] == "conversation.item.audio_output.done":
+ /// print(f"Audio generation complete for item {data['item_id']}")
+ /// break
+ /// elif data["type"] == "conversation.item.tts.failed":
+ /// error = data.get("error", {})
+ /// print(f"Error: {error.get('message')}")
+ /// break
+ /// # Save the raw PCM samples to a file
+ /// with open("output.pcm", "wb") as f:
+ /// f.write(audio_data)
+ /// print("Audio saved to output.pcm")
+ /// # Run send and receive concurrently
+ /// await asyncio.gather(send_text(), receive_audio())
+ /// asyncio.run(generate_speech()) + ///
global::System.Threading.Tasks.Task RealtimeTtsAsync( global::Together.RealtimeTtsModel? model = default, string? voice = default, @@ -261,6 +324,69 @@ public partial interface IAudioClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// import asyncio
+ /// import websockets
+ /// import json
+ /// import base64
+ /// import os
+ /// async def generate_speech():
+ /// api_key = os.environ.get("TOGETHER_API_KEY")
+ /// url = "wss://api.together.ai/v1/audio/speech/websocket?model=hexgrad/Kokoro-82M&voice=af_heart"
+ /// headers = {
+ /// "Authorization": f"Bearer {api_key}"
+ /// }
+ /// async with websockets.connect(url, additional_headers=headers) as ws:
+ /// # Wait for session created
+ /// session_msg = await ws.recv()
+ /// session_data = json.loads(session_msg)
+ /// if session_data.get("type") != "session.created":
+ /// print(f"Failed to start session: {session_data}")
+ /// return
+ /// print(f"Session created: {session_data['session']['id']}")
+ /// # Send text for TTS
+ /// text_chunks = [
+ /// "Hello, this is a test.",
+ /// "This is the second sentence.",
+ /// "And this is the final one."
+ /// ]
+ /// async def send_text():
+ /// for chunk in text_chunks:
+ /// await ws.send(json.dumps({
+ /// "type": "input_text_buffer.append",
+ /// "text": chunk
+ /// }))
+ /// await asyncio.sleep(0.5) # Simulate typing
+ /// # Commit to process any remaining text
+ /// await ws.send(json.dumps({
+ /// "type": "input_text_buffer.commit"
+ /// }))
+ /// async def receive_audio():
+ /// audio_data = bytearray()
+ /// async for message in ws:
+ /// data = json.loads(message)
+ /// if data["type"] == "conversation.item.input_text.received":
+ /// print(f"Text received: {data['text']}")
+ /// elif data["type"] == "conversation.item.audio_output.delta":
+ /// # Decode base64 audio chunk
+ /// audio_chunk = base64.b64decode(data['delta'])
+ /// audio_data.extend(audio_chunk)
+ /// print(f"Received audio chunk for item {data['item_id']}")
+ /// elif data["type"] == "conversation.item.audio_output.done":
+ /// print(f"Audio generation complete for item {data['item_id']}")
+ /// break
+ /// elif data["type"] == "conversation.item.tts.failed":
+ /// error = data.get("error", {})
+ /// print(f"Error: {error.get('message')}")
+ /// break
+ /// # Save the raw PCM samples to a file
+ /// with open("output.pcm", "wb") as f:
+ /// f.write(audio_data)
+ /// print("Audio saved to output.pcm")
+ /// # Run send and receive concurrently
+ /// await asyncio.gather(send_text(), receive_audio())
+ /// asyncio.run(generate_speech()) + ///
global::System.Threading.Tasks.Task RealtimeTtsAsResponseAsync( global::Together.RealtimeTtsModel? model = default, string? voice = default, diff --git a/src/libs/Together/Generated/Together.IAudioClient.g.cs b/src/libs/Together/Generated/Together.IAudioClient.g.cs index 25ee91aa..8eb8c878 100644 --- a/src/libs/Together/Generated/Together.IAudioClient.g.cs +++ b/src/libs/Together/Generated/Together.IAudioClient.g.cs @@ -19,6 +19,27 @@ public partial interface IAudioClient : global::System.IDisposable ///
public System.Uri? BaseUri { get; } + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers { get; } + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer { get; set; } + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId); + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer(); + /// /// The authorizations to use for the requests. /// diff --git a/src/libs/Together/Generated/Together.IBatchesClient.CreateBatches.g.cs b/src/libs/Together/Generated/Together.IBatchesClient.CreateBatches.g.cs index efb9b198..a95f65f7 100644 --- a/src/libs/Together/Generated/Together.IBatchesClient.CreateBatches.g.cs +++ b/src/libs/Together/Generated/Together.IBatchesClient.CreateBatches.g.cs @@ -12,6 +12,15 @@ public partial interface IBatchesClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// batch = client.batches.create(input_file_id="<FILE_ID>", endpoint="/v1/chat/completions")
+ /// print(batch.job) + ///
global::System.Threading.Tasks.Task CreateBatchesAsync( global::Together.CreateBatchRequest request, @@ -25,6 +34,15 @@ public partial interface IBatchesClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// batch = client.batches.create(input_file_id="<FILE_ID>", endpoint="/v1/chat/completions")
+ /// print(batch.job) + ///
global::System.Threading.Tasks.Task> CreateBatchesAsResponseAsync( global::Together.CreateBatchRequest request, diff --git a/src/libs/Together/Generated/Together.IBatchesClient.CreateBatchesByIdCancel.g.cs b/src/libs/Together/Generated/Together.IBatchesClient.CreateBatchesByIdCancel.g.cs index 1c25ffc0..6a32e9f8 100644 --- a/src/libs/Together/Generated/Together.IBatchesClient.CreateBatchesByIdCancel.g.cs +++ b/src/libs/Together/Generated/Together.IBatchesClient.CreateBatchesByIdCancel.g.cs @@ -15,6 +15,15 @@ public partial interface IBatchesClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// batch = client.batches.cancel("<BATCH_ID>")
+ /// print(batch) + ///
global::System.Threading.Tasks.Task CreateBatchesByIdCancelAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -30,6 +39,15 @@ public partial interface IBatchesClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// batch = client.batches.cancel("<BATCH_ID>")
+ /// print(batch) + ///
global::System.Threading.Tasks.Task> CreateBatchesByIdCancelAsResponseAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, diff --git a/src/libs/Together/Generated/Together.IBatchesClient.GetBatches.g.cs b/src/libs/Together/Generated/Together.IBatchesClient.GetBatches.g.cs index 7ce24de5..0e84f3cc 100644 --- a/src/libs/Together/Generated/Together.IBatchesClient.GetBatches.g.cs +++ b/src/libs/Together/Generated/Together.IBatchesClient.GetBatches.g.cs @@ -11,6 +11,16 @@ public partial interface IBatchesClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// batches = client.batches.list()
+ /// for batch in batches:
+ /// print(batch.id) + ///
global::System.Threading.Tasks.Task> GetBatchesAsync( global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); @@ -21,6 +31,16 @@ public partial interface IBatchesClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// batches = client.batches.list()
+ /// for batch in batches:
+ /// print(batch.id) + ///
global::System.Threading.Tasks.Task>> GetBatchesAsResponseAsync( global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); diff --git a/src/libs/Together/Generated/Together.IBatchesClient.GetBatchesById.g.cs b/src/libs/Together/Generated/Together.IBatchesClient.GetBatchesById.g.cs index 58f52af6..734b701c 100644 --- a/src/libs/Together/Generated/Together.IBatchesClient.GetBatchesById.g.cs +++ b/src/libs/Together/Generated/Together.IBatchesClient.GetBatchesById.g.cs @@ -15,6 +15,15 @@ public partial interface IBatchesClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// batch = client.batches.retrieve("<BATCH_ID>")
+ /// print(batch) + ///
global::System.Threading.Tasks.Task GetBatchesByIdAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -30,6 +39,15 @@ public partial interface IBatchesClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// batch = client.batches.retrieve("<BATCH_ID>")
+ /// print(batch) + ///
global::System.Threading.Tasks.Task> GetBatchesByIdAsResponseAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, diff --git a/src/libs/Together/Generated/Together.IBatchesClient.g.cs b/src/libs/Together/Generated/Together.IBatchesClient.g.cs index b84f2381..18a56540 100644 --- a/src/libs/Together/Generated/Together.IBatchesClient.g.cs +++ b/src/libs/Together/Generated/Together.IBatchesClient.g.cs @@ -19,6 +19,27 @@ public partial interface IBatchesClient : global::System.IDisposable /// public System.Uri? BaseUri { get; } + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers { get; } + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer { get; set; } + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId); + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer(); + /// /// The authorizations to use for the requests. /// diff --git a/src/libs/Together/Generated/Together.IBillingClient.GetBillingUsage.g.cs b/src/libs/Together/Generated/Together.IBillingClient.GetBillingUsage.g.cs index 6a7597b1..87e600f0 100644 --- a/src/libs/Together/Generated/Together.IBillingClient.GetBillingUsage.g.cs +++ b/src/libs/Together/Generated/Together.IBillingClient.GetBillingUsage.g.cs @@ -28,6 +28,18 @@ public partial interface IBillingClient /// 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()
+ /// # The SDK has no dedicated method for this endpoint yet, so call it with
+ /// # the client's generic GET helper.
+ /// usage = client.get(
+ /// "/billing/usage",
+ /// cast_to=object,
+ /// options={"params": {"month": "2026-06", "granularity": "day"}},
+ /// )
+ /// print(usage) + ///
global::System.Threading.Tasks.Task GetBillingUsageAsync( string? month = default, string? organizationId = default, @@ -60,6 +72,18 @@ public partial interface IBillingClient /// 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()
+ /// # The SDK has no dedicated method for this endpoint yet, so call it with
+ /// # the client's generic GET helper.
+ /// usage = client.get(
+ /// "/billing/usage",
+ /// cast_to=object,
+ /// options={"params": {"month": "2026-06", "granularity": "day"}},
+ /// )
+ /// print(usage) + ///
global::System.Threading.Tasks.Task> GetBillingUsageAsResponseAsync( string? month = default, string? organizationId = default, diff --git a/src/libs/Together/Generated/Together.IBillingClient.g.cs b/src/libs/Together/Generated/Together.IBillingClient.g.cs index 8abfa7c3..e8067118 100644 --- a/src/libs/Together/Generated/Together.IBillingClient.g.cs +++ b/src/libs/Together/Generated/Together.IBillingClient.g.cs @@ -19,6 +19,27 @@ public partial interface IBillingClient : global::System.IDisposable /// public System.Uri? BaseUri { get; } + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers { get; } + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer { get; set; } + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId); + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer(); + /// /// The authorizations to use for the requests. /// diff --git a/src/libs/Together/Generated/Together.IChatClient.ChatCompletions.g.cs b/src/libs/Together/Generated/Together.IChatClient.ChatCompletions.g.cs index b834b453..4b35cdda 100644 --- a/src/libs/Together/Generated/Together.IChatClient.ChatCompletions.g.cs +++ b/src/libs/Together/Generated/Together.IChatClient.ChatCompletions.g.cs @@ -1,5 +1,7 @@ #nullable enable +#pragma warning disable CS0618 // Type or member is obsolete + namespace Together { public partial interface IChatClient @@ -12,6 +14,22 @@ public partial interface IChatClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.chat.completions.create(
+ /// model="Qwen/Qwen3.5-9B",
+ /// messages=[
+ /// {"role": "system", "content": "You are a helpful assistant."},
+ /// {"role": "user", "content": "What are some fun things to do in New York?"},
+ /// ],
+ /// reasoning={"enabled": False},
+ /// )
+ /// print(response.choices[0].message.content) + ///
global::System.Threading.Tasks.Task ChatCompletionsAsync( global::Together.ChatCompletionRequest request, @@ -25,6 +43,22 @@ public partial interface IChatClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.chat.completions.create(
+ /// model="Qwen/Qwen3.5-9B",
+ /// messages=[
+ /// {"role": "system", "content": "You are a helpful assistant."},
+ /// {"role": "user", "content": "What are some fun things to do in New York?"},
+ /// ],
+ /// reasoning={"enabled": False},
+ /// )
+ /// print(response.choices[0].message.content) + ///
global::System.Threading.Tasks.Task> ChatCompletionsAsResponseAsync( global::Together.ChatCompletionRequest request, diff --git a/src/libs/Together/Generated/Together.IChatClient.ChatCompletionsAsStream.g.cs b/src/libs/Together/Generated/Together.IChatClient.ChatCompletionsAsStream.g.cs index a236c9d5..bc5e0ca9 100644 --- a/src/libs/Together/Generated/Together.IChatClient.ChatCompletionsAsStream.g.cs +++ b/src/libs/Together/Generated/Together.IChatClient.ChatCompletionsAsStream.g.cs @@ -1,5 +1,7 @@ #nullable enable +#pragma warning disable CS0618 // Type or member is obsolete + namespace Together { public partial interface IChatClient @@ -12,6 +14,22 @@ public partial interface IChatClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.chat.completions.create(
+ /// model="Qwen/Qwen3.5-9B",
+ /// messages=[
+ /// {"role": "system", "content": "You are a helpful assistant."},
+ /// {"role": "user", "content": "What are some fun things to do in New York?"},
+ /// ],
+ /// reasoning={"enabled": False},
+ /// )
+ /// print(response.choices[0].message.content) + ///
global::System.Collections.Generic.IAsyncEnumerable ChatCompletionsAsStreamAsync( global::Together.ChatCompletionRequest request, diff --git a/src/libs/Together/Generated/Together.IChatClient.g.cs b/src/libs/Together/Generated/Together.IChatClient.g.cs index ceeb64c6..cd0fb1e1 100644 --- a/src/libs/Together/Generated/Together.IChatClient.g.cs +++ b/src/libs/Together/Generated/Together.IChatClient.g.cs @@ -19,6 +19,27 @@ public partial interface IChatClient : global::System.IDisposable /// public System.Uri? BaseUri { get; } + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers { get; } + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer { get; set; } + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId); + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer(); + /// /// The authorizations to use for the requests. /// diff --git a/src/libs/Together/Generated/Together.ICodeInterpreterClient.SessionsList.g.cs b/src/libs/Together/Generated/Together.ICodeInterpreterClient.SessionsList.g.cs new file mode 100644 index 00000000..855d7df2 --- /dev/null +++ b/src/libs/Together/Generated/Together.ICodeInterpreterClient.SessionsList.g.cs @@ -0,0 +1,48 @@ +#nullable enable + +namespace Together +{ + public partial interface ICodeInterpreterClient + { + /// + /// List active sessions
+ /// Lists all your currently active sessions. + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.code_interpreter.sessions.list()
+ /// for session in response.data.sessions:
+ /// print(session.id) + ///
+ global::System.Threading.Tasks.Task SessionsListAsync( + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List active sessions
+ /// Lists all your currently active sessions. + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.code_interpreter.sessions.list()
+ /// for session in response.data.sessions:
+ /// print(session.id) + ///
+ global::System.Threading.Tasks.Task> SessionsListAsResponseAsync( + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.ICodeInterpreterClient.TciExecute.g.cs b/src/libs/Together/Generated/Together.ICodeInterpreterClient.TciExecute.g.cs new file mode 100644 index 00000000..dd44a16e --- /dev/null +++ b/src/libs/Together/Generated/Together.ICodeInterpreterClient.TciExecute.g.cs @@ -0,0 +1,90 @@ +#nullable enable + +namespace Together +{ + public partial interface ICodeInterpreterClient + { + /// + /// Execute code
+ /// Executes the given code snippet and returns the output. Without a session_id, a new session is created to run the code. If you pass a valid session_id, the code runs in that session. This is useful for running multiple code snippets in the same environment, because dependencies and similar things are persisted
+ /// between calls to the same session. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.code_interpreter.execute(
+ /// code="print('Hello world!')",
+ /// language="python",
+ /// )
+ /// print(response.data.outputs[0].data); + ///
+ global::System.Threading.Tasks.Task TciExecuteAsync( + + global::Together.ExecuteRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Execute code
+ /// Executes the given code snippet and returns the output. Without a session_id, a new session is created to run the code. If you pass a valid session_id, the code runs in that session. This is useful for running multiple code snippets in the same environment, because dependencies and similar things are persisted
+ /// between calls to the same session. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.code_interpreter.execute(
+ /// code="print('Hello world!')",
+ /// language="python",
+ /// )
+ /// print(response.data.outputs[0].data); + ///
+ global::System.Threading.Tasks.Task> TciExecuteAsResponseAsync( + + global::Together.ExecuteRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Execute code
+ /// Executes the given code snippet and returns the output. Without a session_id, a new session is created to run the code. If you pass a valid session_id, the code runs in that session. This is useful for running multiple code snippets in the same environment, because dependencies and similar things are persisted
+ /// between calls to the same session. + ///
+ /// + /// Code snippet to execute.
+ /// Example: print('Hello, world!') + /// + /// + /// Files to upload to the session. If present, files are uploaded before executing the given code. + /// + /// + /// Programming language for the code to execute. Currently only supports Python.
+ /// Default Value: python + /// + /// + /// Identifier of the current session. Used to make follow-up calls. Returns an error if the session does not belong to the caller or has expired.
+ /// Example: ses_abcDEF123 + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task TciExecuteAsync( + string code, + global::System.Collections.Generic.IList? files = default, + global::Together.ExecuteRequestLanguage language = global::Together.ExecuteRequestLanguage.Python, + string? sessionId = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.ICodeInterpreterClient.g.cs b/src/libs/Together/Generated/Together.ICodeInterpreterClient.g.cs new file mode 100644 index 00000000..e84b13fb --- /dev/null +++ b/src/libs/Together/Generated/Together.ICodeInterpreterClient.g.cs @@ -0,0 +1,73 @@ + +#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 partial interface ICodeInterpreterClient : global::System.IDisposable + { + /// + /// The HttpClient instance. + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + /// The base URL for the API. + /// + public System.Uri? BaseUri { get; } + + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers { get; } + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer { get; set; } + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId); + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer(); + + /// + /// The authorizations to use for the requests. + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + /// Gets or sets a value indicating whether the response content should be read as a string. + /// True by default in debug builds, false otherwise. + /// When false, successful responses are deserialized directly from the response stream for better performance. + /// Error responses are always read as strings regardless of this setting, + /// ensuring is populated. + /// + public bool ReadResponseAsString { get; set; } + /// + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// + public global::Together.AutoSDKClientOptions Options { get; } + + /// + /// Creates idempotency keys for generated idempotent requests when the caller does not provide one. + /// + public global::System.Func CreateIdempotencyKey { get; set; } + + /// + /// + /// + global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } + + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.ICompletionClient.Completions.g.cs b/src/libs/Together/Generated/Together.ICompletionClient.Completions.g.cs index 7c7e224b..d0014857 100644 --- a/src/libs/Together/Generated/Together.ICompletionClient.Completions.g.cs +++ b/src/libs/Together/Generated/Together.ICompletionClient.Completions.g.cs @@ -12,6 +12,19 @@ public partial interface ICompletionClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.completions.create(
+ /// model="Qwen/Qwen3.5-9B",
+ /// prompt="The largest city in France is",
+ /// max_tokens=1
+ /// )
+ /// print(response.choices[0].text) + ///
global::System.Threading.Tasks.Task CompletionsAsync( global::Together.CompletionRequest request, @@ -25,6 +38,19 @@ public partial interface ICompletionClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.completions.create(
+ /// model="Qwen/Qwen3.5-9B",
+ /// prompt="The largest city in France is",
+ /// max_tokens=1
+ /// )
+ /// print(response.choices[0].text) + ///
global::System.Threading.Tasks.Task> CompletionsAsResponseAsync( global::Together.CompletionRequest request, diff --git a/src/libs/Together/Generated/Together.ICompletionClient.CompletionsAsStream.g.cs b/src/libs/Together/Generated/Together.ICompletionClient.CompletionsAsStream.g.cs index 4f0bb8aa..d8cc8fe5 100644 --- a/src/libs/Together/Generated/Together.ICompletionClient.CompletionsAsStream.g.cs +++ b/src/libs/Together/Generated/Together.ICompletionClient.CompletionsAsStream.g.cs @@ -12,6 +12,19 @@ public partial interface ICompletionClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.completions.create(
+ /// model="Qwen/Qwen3.5-9B",
+ /// prompt="The largest city in France is",
+ /// max_tokens=1
+ /// )
+ /// print(response.choices[0].text) + ///
global::System.Collections.Generic.IAsyncEnumerable CompletionsAsStreamAsync( global::Together.CompletionRequest request, diff --git a/src/libs/Together/Generated/Together.ICompletionClient.g.cs b/src/libs/Together/Generated/Together.ICompletionClient.g.cs index bde6a450..aee1f098 100644 --- a/src/libs/Together/Generated/Together.ICompletionClient.g.cs +++ b/src/libs/Together/Generated/Together.ICompletionClient.g.cs @@ -19,6 +19,27 @@ public partial interface ICompletionClient : global::System.IDisposable /// public System.Uri? BaseUri { get; } + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers { get; } + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer { get; set; } + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId); + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer(); + /// /// The authorizations to use for the requests. /// diff --git a/src/libs/Together/Generated/Together.IConfigServiceClient.ConfigServiceGetProjectConfig.g.cs b/src/libs/Together/Generated/Together.IConfigServiceClient.ConfigServiceGetProjectConfig.g.cs index 89426334..6c044824 100644 --- a/src/libs/Together/Generated/Together.IConfigServiceClient.ConfigServiceGetProjectConfig.g.cs +++ b/src/libs/Together/Generated/Together.IConfigServiceClient.ConfigServiceGetProjectConfig.g.cs @@ -17,6 +17,16 @@ public partial interface IConfigServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// config = client.beta.models.configs.retrieve(
+ /// "cr_abc123",
+ /// project_id=project_id,
+ /// )
+ /// print(config.id, config.reference_model) + ///
global::System.Threading.Tasks.Task ConfigServiceGetProjectConfigAsync( string projectId, string id, @@ -35,6 +45,16 @@ public partial interface IConfigServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// config = client.beta.models.configs.retrieve(
+ /// "cr_abc123",
+ /// project_id=project_id,
+ /// )
+ /// print(config.id, config.reference_model) + ///
global::System.Threading.Tasks.Task> ConfigServiceGetProjectConfigAsResponseAsync( string projectId, string id, diff --git a/src/libs/Together/Generated/Together.IConfigServiceClient.ConfigServiceListProjectConfigs.g.cs b/src/libs/Together/Generated/Together.IConfigServiceClient.ConfigServiceListProjectConfigs.g.cs index 0b214487..caf8ffe1 100644 --- a/src/libs/Together/Generated/Together.IConfigServiceClient.ConfigServiceListProjectConfigs.g.cs +++ b/src/libs/Together/Generated/Together.IConfigServiceClient.ConfigServiceListProjectConfigs.g.cs @@ -26,6 +26,20 @@ public partial interface IConfigServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// # Configurations are listed per model. A supported model's base_model is
+ /// # the resource name to pass as reference_model.
+ /// model = client.beta.models.retrieve_supported("arch_abc123")
+ /// configs = client.beta.models.configs.list(
+ /// project_id=project_id,
+ /// reference_model=model.base_model,
+ /// )
+ /// for config in configs:
+ /// print(config.id, config.reference_model) + ///
global::System.Threading.Tasks.Task ConfigServiceListProjectConfigsAsync( string projectId, string? referenceModelId = default, @@ -56,6 +70,20 @@ public partial interface IConfigServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// # Configurations are listed per model. A supported model's base_model is
+ /// # the resource name to pass as reference_model.
+ /// model = client.beta.models.retrieve_supported("arch_abc123")
+ /// configs = client.beta.models.configs.list(
+ /// project_id=project_id,
+ /// reference_model=model.base_model,
+ /// )
+ /// for config in configs:
+ /// print(config.id, config.reference_model) + ///
global::System.Threading.Tasks.Task> ConfigServiceListProjectConfigsAsResponseAsync( string projectId, string? referenceModelId = default, diff --git a/src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceAddAdapter.g.cs b/src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceAddAdapter.g.cs index 848242fe..dfe08ff0 100644 --- a/src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceAddAdapter.g.cs +++ b/src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceAddAdapter.g.cs @@ -21,6 +21,18 @@ public partial interface IDeploymentServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// adapter = client.beta.endpoints.adapters.create(
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// deployment_id="dep_abc123",
+ /// adapter_model_id="ml_abc123",
+ /// )
+ /// print(adapter) + ///
global::System.Threading.Tasks.Task DeploymentServiceAddAdapterAsync( string projectId, string endpointId, @@ -46,6 +58,18 @@ public partial interface IDeploymentServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// adapter = client.beta.endpoints.adapters.create(
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// deployment_id="dep_abc123",
+ /// adapter_model_id="ml_abc123",
+ /// )
+ /// print(adapter) + ///
global::System.Threading.Tasks.Task> DeploymentServiceAddAdapterAsResponseAsync( string projectId, string endpointId, diff --git a/src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceCreateDeployment.g.cs b/src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceCreateDeployment.g.cs index edaee555..962dcc64 100644 --- a/src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceCreateDeployment.g.cs +++ b/src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceCreateDeployment.g.cs @@ -21,6 +21,20 @@ public partial interface IDeploymentServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// deployment = client.beta.endpoints.deployments.create(
+ /// "ep_abc123",
+ /// project_id=project_id,
+ /// name="prod",
+ /// model=f"projects/{project_id}/models/ml_abc123",
+ /// config=f"projects/{project_id}/configs/cr_abc123",
+ /// autoscaling={"min_replicas": 1, "max_replicas": 2},
+ /// )
+ /// print(deployment.id, deployment.status) + ///
global::System.Threading.Tasks.Task DeploymentServiceCreateDeploymentAsync( string projectId, string endpointId, @@ -46,6 +60,20 @@ public partial interface IDeploymentServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// deployment = client.beta.endpoints.deployments.create(
+ /// "ep_abc123",
+ /// project_id=project_id,
+ /// name="prod",
+ /// model=f"projects/{project_id}/models/ml_abc123",
+ /// config=f"projects/{project_id}/configs/cr_abc123",
+ /// autoscaling={"min_replicas": 1, "max_replicas": 2},
+ /// )
+ /// print(deployment.id, deployment.status) + ///
global::System.Threading.Tasks.Task> DeploymentServiceCreateDeploymentAsResponseAsync( string projectId, string endpointId, diff --git a/src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceDeleteDeployment.g.cs b/src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceDeleteDeployment.g.cs index 04aac32a..c0f66c3b 100644 --- a/src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceDeleteDeployment.g.cs +++ b/src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceDeleteDeployment.g.cs @@ -23,6 +23,16 @@ public partial interface IDeploymentServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// client.beta.endpoints.deployments.delete(
+ /// "dep_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// ) + ///
global::System.Threading.Tasks.Task DeploymentServiceDeleteDeploymentAsync( string projectId, string endpointId, @@ -49,6 +59,16 @@ public partial interface IDeploymentServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// client.beta.endpoints.deployments.delete(
+ /// "dep_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// ) + ///
global::System.Threading.Tasks.Task> DeploymentServiceDeleteDeploymentAsResponseAsync( string projectId, string endpointId, diff --git a/src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceGetAdapter.g.cs b/src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceGetAdapter.g.cs index 7de2988f..ea561c87 100644 --- a/src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceGetAdapter.g.cs +++ b/src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceGetAdapter.g.cs @@ -6,7 +6,7 @@ public partial interface IDeploymentServiceClient { /// /// Get a deployment adapter
- /// Gets an adapter attachment by its `dad_` id and returns its per-cluster load state. + /// Gets an attached adapter and its per-cluster load state. ///
/// /// Project identifier. @@ -18,11 +18,23 @@ public partial interface IDeploymentServiceClient /// Deployment identifier. /// /// - /// Adapter attachment `dad_` id from a prior add, update, get, or list response. + /// Adapter model identifier. /// /// 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()
+ /// project_id = client.whoami().project_id
+ /// adapter = client.beta.endpoints.adapters.retrieve(
+ /// "dad_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// deployment_id="dep_abc123",
+ /// )
+ /// print(adapter) + ///
global::System.Threading.Tasks.Task DeploymentServiceGetAdapterAsync( string projectId, string endpointId, @@ -32,7 +44,7 @@ public partial interface IDeploymentServiceClient global::System.Threading.CancellationToken cancellationToken = default); /// /// Get a deployment adapter
- /// Gets an adapter attachment by its `dad_` id and returns its per-cluster load state. + /// Gets an attached adapter and its per-cluster load state. ///
/// /// Project identifier. @@ -44,11 +56,23 @@ public partial interface IDeploymentServiceClient /// Deployment identifier. /// /// - /// Adapter attachment `dad_` id from a prior add, update, get, or list response. + /// Adapter model identifier. /// /// 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()
+ /// project_id = client.whoami().project_id
+ /// adapter = client.beta.endpoints.adapters.retrieve(
+ /// "dad_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// deployment_id="dep_abc123",
+ /// )
+ /// print(adapter) + ///
global::System.Threading.Tasks.Task> DeploymentServiceGetAdapterAsResponseAsync( string projectId, string endpointId, diff --git a/src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceGetDeployment.g.cs b/src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceGetDeployment.g.cs index 81bf102a..4dad882a 100644 --- a/src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceGetDeployment.g.cs +++ b/src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceGetDeployment.g.cs @@ -20,6 +20,17 @@ public partial interface IDeploymentServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// deployment = client.beta.endpoints.deployments.retrieve(
+ /// "dep_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// )
+ /// print(deployment.name, deployment.status) + ///
global::System.Threading.Tasks.Task DeploymentServiceGetDeploymentAsync( string projectId, string endpointId, @@ -42,6 +53,17 @@ public partial interface IDeploymentServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// deployment = client.beta.endpoints.deployments.retrieve(
+ /// "dep_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// )
+ /// print(deployment.name, deployment.status) + ///
global::System.Threading.Tasks.Task> DeploymentServiceGetDeploymentAsResponseAsync( string projectId, string endpointId, diff --git a/src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceListAdapters.g.cs b/src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceListAdapters.g.cs index 397ec97c..c74049b3 100644 --- a/src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceListAdapters.g.cs +++ b/src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceListAdapters.g.cs @@ -26,6 +26,18 @@ public partial interface IDeploymentServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// adapters = client.beta.endpoints.adapters.list(
+ /// endpoint_id="ep_abc123",
+ /// deployment_id="dep_abc123",
+ /// project_id=project_id,
+ /// )
+ /// for adapter in adapters:
+ /// print(adapter.id, adapter.adapter_model_id) + ///
global::System.Threading.Tasks.Task DeploymentServiceListAdaptersAsync( string projectId, string endpointId, @@ -56,6 +68,18 @@ public partial interface IDeploymentServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// adapters = client.beta.endpoints.adapters.list(
+ /// endpoint_id="ep_abc123",
+ /// deployment_id="dep_abc123",
+ /// project_id=project_id,
+ /// )
+ /// for adapter in adapters:
+ /// print(adapter.id, adapter.adapter_model_id) + ///
global::System.Threading.Tasks.Task> DeploymentServiceListAdaptersAsResponseAsync( string projectId, string endpointId, diff --git a/src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceListDeployments.g.cs b/src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceListDeployments.g.cs index c241737f..3d3d5bb1 100644 --- a/src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceListDeployments.g.cs +++ b/src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceListDeployments.g.cs @@ -29,6 +29,17 @@ public partial interface IDeploymentServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// deployments = client.beta.endpoints.deployments.list(
+ /// "ep_abc123",
+ /// project_id=project_id,
+ /// )
+ /// for deployment in deployments:
+ /// print(deployment.id, deployment.name, deployment.status) + ///
global::System.Threading.Tasks.Task DeploymentServiceListDeploymentsAsync( string projectId, string endpointId, @@ -63,6 +74,17 @@ public partial interface IDeploymentServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// deployments = client.beta.endpoints.deployments.list(
+ /// "ep_abc123",
+ /// project_id=project_id,
+ /// )
+ /// for deployment in deployments:
+ /// print(deployment.id, deployment.name, deployment.status) + ///
global::System.Threading.Tasks.Task> DeploymentServiceListDeploymentsAsResponseAsync( string projectId, string endpointId, diff --git a/src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceRemoveAdapter.g.cs b/src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceRemoveAdapter.g.cs index e544dd84..58cd20d5 100644 --- a/src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceRemoveAdapter.g.cs +++ b/src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceRemoveAdapter.g.cs @@ -6,7 +6,7 @@ public partial interface IDeploymentServiceClient { /// /// Remove a deployment adapter
- /// Detaches an adapter attachment by its `dad_` id using its row-level etag for optimistic concurrency. + /// Detaches an adapter from a deployment using its row-level etag for optimistic concurrency. ///
/// /// Project identifier. @@ -18,7 +18,7 @@ public partial interface IDeploymentServiceClient /// Deployment identifier. /// /// - /// Adapter attachment `dad_` id from a prior add, update, get, or list response. + /// 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. @@ -26,6 +26,25 @@ public partial interface IDeploymentServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// # Read the attachment first: removing it requires its current etag.
+ /// adapter = client.beta.endpoints.adapters.retrieve(
+ /// "dad_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// deployment_id="dep_abc123",
+ /// )
+ /// client.beta.endpoints.adapters.delete(
+ /// "dad_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// deployment_id="dep_abc123",
+ /// etag=adapter.etag,
+ /// ) + ///
global::System.Threading.Tasks.Task DeploymentServiceRemoveAdapterAsync( string projectId, string endpointId, @@ -36,7 +55,7 @@ public partial interface IDeploymentServiceClient global::System.Threading.CancellationToken cancellationToken = default); /// /// Remove a deployment adapter
- /// Detaches an adapter attachment by its `dad_` id using its row-level etag for optimistic concurrency. + /// Detaches an adapter from a deployment using its row-level etag for optimistic concurrency. ///
/// /// Project identifier. @@ -48,7 +67,7 @@ public partial interface IDeploymentServiceClient /// Deployment identifier. /// /// - /// Adapter attachment `dad_` id from a prior add, update, get, or list response. + /// 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. @@ -56,6 +75,25 @@ public partial interface IDeploymentServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// # Read the attachment first: removing it requires its current etag.
+ /// adapter = client.beta.endpoints.adapters.retrieve(
+ /// "dad_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// deployment_id="dep_abc123",
+ /// )
+ /// client.beta.endpoints.adapters.delete(
+ /// "dad_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// deployment_id="dep_abc123",
+ /// etag=adapter.etag,
+ /// ) + ///
global::System.Threading.Tasks.Task> DeploymentServiceRemoveAdapterAsResponseAsync( string projectId, string endpointId, diff --git a/src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceUpdateAdapter.g.cs b/src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceUpdateAdapter.g.cs index 83833b3f..c74618c5 100644 --- a/src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceUpdateAdapter.g.cs +++ b/src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceUpdateAdapter.g.cs @@ -6,7 +6,7 @@ public partial interface IDeploymentServiceClient { /// /// Update a deployment adapter
- /// Updates the pinned revision of an adapter attachment by its `dad_` id using its row-level etag for optimistic concurrency. + /// Updates the pinned revision of an attached adapter using its row-level etag for optimistic concurrency. ///
/// /// Project identifier. @@ -18,12 +18,33 @@ public partial interface IDeploymentServiceClient /// Deployment identifier. /// /// - /// Adapter attachment `dad_` id from a prior add, update, get, or list response. + /// Adapter model identifier. /// /// /// 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()
+ /// project_id = client.whoami().project_id
+ /// # Read the attachment first: updating it requires its current etag.
+ /// adapter = client.beta.endpoints.adapters.retrieve(
+ /// "dad_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// deployment_id="dep_abc123",
+ /// )
+ /// updated = client.beta.endpoints.adapters.update(
+ /// "dad_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// deployment_id="dep_abc123",
+ /// adapter_revision_id="rv_abc123",
+ /// etag=adapter.etag,
+ /// )
+ /// print(updated) + ///
global::System.Threading.Tasks.Task DeploymentServiceUpdateAdapterAsync( string projectId, string endpointId, @@ -35,7 +56,7 @@ public partial interface IDeploymentServiceClient global::System.Threading.CancellationToken cancellationToken = default); /// /// Update a deployment adapter
- /// Updates the pinned revision of an adapter attachment by its `dad_` id using its row-level etag for optimistic concurrency. + /// Updates the pinned revision of an attached adapter using its row-level etag for optimistic concurrency. ///
/// /// Project identifier. @@ -47,12 +68,33 @@ public partial interface IDeploymentServiceClient /// Deployment identifier. /// /// - /// Adapter attachment `dad_` id from a prior add, update, get, or list response. + /// Adapter model identifier. /// /// /// 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()
+ /// project_id = client.whoami().project_id
+ /// # Read the attachment first: updating it requires its current etag.
+ /// adapter = client.beta.endpoints.adapters.retrieve(
+ /// "dad_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// deployment_id="dep_abc123",
+ /// )
+ /// updated = client.beta.endpoints.adapters.update(
+ /// "dad_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// deployment_id="dep_abc123",
+ /// adapter_revision_id="rv_abc123",
+ /// etag=adapter.etag,
+ /// )
+ /// print(updated) + ///
global::System.Threading.Tasks.Task> DeploymentServiceUpdateAdapterAsResponseAsync( string projectId, string endpointId, @@ -64,7 +106,7 @@ public partial interface IDeploymentServiceClient global::System.Threading.CancellationToken cancellationToken = default); /// /// Update a deployment adapter
- /// Updates the pinned revision of an adapter attachment by its `dad_` id using its row-level etag for optimistic concurrency. + /// Updates the pinned revision of an attached adapter using its row-level etag for optimistic concurrency. ///
/// /// Project identifier. @@ -76,7 +118,7 @@ public partial interface IDeploymentServiceClient /// Deployment identifier. /// /// - /// Adapter attachment `dad_` id from a prior add, update, get, or list response. + /// Adapter model identifier. /// /// /// New adapter revision to pin. diff --git a/src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceUpdateDeployment.g.cs b/src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceUpdateDeployment.g.cs index 2c4f2388..35d8db61 100644 --- a/src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceUpdateDeployment.g.cs +++ b/src/libs/Together/Generated/Together.IDeploymentServiceClient.DeploymentServiceUpdateDeployment.g.cs @@ -24,6 +24,28 @@ public partial interface IDeploymentServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// deployment = client.beta.endpoints.deployments.update(
+ /// "dep_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// autoscaling={
+ /// "min_replicas": 1,
+ /// "max_replicas": 4,
+ /// "scaling_metrics": [
+ /// {
+ /// "name": "gpu_utilization",
+ /// "target": 70,
+ /// "type": "METRIC_TARGET_TYPE_UTILIZATION",
+ /// }
+ /// ],
+ /// },
+ /// )
+ /// print(deployment.autoscaling) + ///
global::System.Threading.Tasks.Task DeploymentServiceUpdateDeploymentAsync( string projectId, string endpointId, @@ -53,6 +75,28 @@ public partial interface IDeploymentServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// deployment = client.beta.endpoints.deployments.update(
+ /// "dep_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// autoscaling={
+ /// "min_replicas": 1,
+ /// "max_replicas": 4,
+ /// "scaling_metrics": [
+ /// {
+ /// "name": "gpu_utilization",
+ /// "target": 70,
+ /// "type": "METRIC_TARGET_TYPE_UTILIZATION",
+ /// }
+ /// ],
+ /// },
+ /// )
+ /// print(deployment.autoscaling) + ///
global::System.Threading.Tasks.Task> DeploymentServiceUpdateDeploymentAsResponseAsync( string projectId, string endpointId, diff --git a/src/libs/Together/Generated/Together.IDeploymentsClient.CreateDeployments.g.cs b/src/libs/Together/Generated/Together.IDeploymentsClient.CreateDeployments.g.cs index c5ce0fad..e2aed2de 100644 --- a/src/libs/Together/Generated/Together.IDeploymentsClient.CreateDeployments.g.cs +++ b/src/libs/Together/Generated/Together.IDeploymentsClient.CreateDeployments.g.cs @@ -12,6 +12,16 @@ public partial interface IDeploymentsClient /// 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()
+ /// deployment = client.beta.jig.deploy(
+ /// name="my-deployment",
+ /// gpu_type="h100-80gb",
+ /// image="registry.together.ai/proj_abcdefg1234567890/my-image:latest"
+ /// )
+ /// print(deployment) + ///
global::System.Threading.Tasks.Task CreateDeploymentsAsync( global::Together.CreateDeploymentRequest request, @@ -25,6 +35,16 @@ public partial interface IDeploymentsClient /// 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()
+ /// deployment = client.beta.jig.deploy(
+ /// name="my-deployment",
+ /// gpu_type="h100-80gb",
+ /// image="registry.together.ai/proj_abcdefg1234567890/my-image:latest"
+ /// )
+ /// print(deployment) + ///
global::System.Threading.Tasks.Task> CreateDeploymentsAsResponseAsync( global::Together.CreateDeploymentRequest request, diff --git a/src/libs/Together/Generated/Together.IDeploymentsClient.DeleteDeploymentsById.g.cs b/src/libs/Together/Generated/Together.IDeploymentsClient.DeleteDeploymentsById.g.cs index 942d6067..0cbe2631 100644 --- a/src/libs/Together/Generated/Together.IDeploymentsClient.DeleteDeploymentsById.g.cs +++ b/src/libs/Together/Generated/Together.IDeploymentsClient.DeleteDeploymentsById.g.cs @@ -14,6 +14,12 @@ public partial interface IDeploymentsClient /// 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()
+ /// deployment = client.beta.jig.destroy("my-deployment")
+ /// print(deployment) + ///
global::System.Threading.Tasks.Task DeleteDeploymentsByIdAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -28,6 +34,12 @@ public partial interface IDeploymentsClient /// 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()
+ /// deployment = client.beta.jig.destroy("my-deployment")
+ /// print(deployment) + ///
global::System.Threading.Tasks.Task> DeleteDeploymentsByIdAsResponseAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, diff --git a/src/libs/Together/Generated/Together.IDeploymentsClient.EditDeploymentsById.g.cs b/src/libs/Together/Generated/Together.IDeploymentsClient.EditDeploymentsById.g.cs index 09434479..fbfc1fa1 100644 --- a/src/libs/Together/Generated/Together.IDeploymentsClient.EditDeploymentsById.g.cs +++ b/src/libs/Together/Generated/Together.IDeploymentsClient.EditDeploymentsById.g.cs @@ -15,6 +15,12 @@ public partial interface IDeploymentsClient /// 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()
+ /// deployment = client.beta.jig.update("my-deployment", gpu_count=2)
+ /// print(deployment) + ///
global::System.Threading.Tasks.Task EditDeploymentsByIdAsync( string id, @@ -32,6 +38,12 @@ public partial interface IDeploymentsClient /// 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()
+ /// deployment = client.beta.jig.update("my-deployment", gpu_count=2)
+ /// print(deployment) + ///
global::System.Threading.Tasks.Task> EditDeploymentsByIdAsResponseAsync( string id, diff --git a/src/libs/Together/Generated/Together.IDeploymentsClient.GetDeployments.g.cs b/src/libs/Together/Generated/Together.IDeploymentsClient.GetDeployments.g.cs index 753b0769..3c8e1847 100644 --- a/src/libs/Together/Generated/Together.IDeploymentsClient.GetDeployments.g.cs +++ b/src/libs/Together/Generated/Together.IDeploymentsClient.GetDeployments.g.cs @@ -11,6 +11,12 @@ public partial interface IDeploymentsClient /// 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()
+ /// deployments = client.beta.jig.list()
+ /// print(deployments) + ///
global::System.Threading.Tasks.Task GetDeploymentsAsync( global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); @@ -21,6 +27,12 @@ public partial interface IDeploymentsClient /// 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()
+ /// deployments = client.beta.jig.list()
+ /// print(deployments) + ///
global::System.Threading.Tasks.Task> GetDeploymentsAsResponseAsync( global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); diff --git a/src/libs/Together/Generated/Together.IDeploymentsClient.GetDeploymentsById.g.cs b/src/libs/Together/Generated/Together.IDeploymentsClient.GetDeploymentsById.g.cs index d6b58663..f982ca4b 100644 --- a/src/libs/Together/Generated/Together.IDeploymentsClient.GetDeploymentsById.g.cs +++ b/src/libs/Together/Generated/Together.IDeploymentsClient.GetDeploymentsById.g.cs @@ -14,6 +14,12 @@ public partial interface IDeploymentsClient /// 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()
+ /// deployment = client.beta.jig.retrieve("my-deployment")
+ /// print(deployment) + ///
global::System.Threading.Tasks.Task GetDeploymentsByIdAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -28,6 +34,12 @@ public partial interface IDeploymentsClient /// 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()
+ /// deployment = client.beta.jig.retrieve("my-deployment")
+ /// print(deployment) + ///
global::System.Threading.Tasks.Task> GetDeploymentsByIdAsResponseAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, diff --git a/src/libs/Together/Generated/Together.IDeploymentsClient.GetDeploymentsByIdLogs.g.cs b/src/libs/Together/Generated/Together.IDeploymentsClient.GetDeploymentsByIdLogs.g.cs index 24a5e49d..47a78b7f 100644 --- a/src/libs/Together/Generated/Together.IDeploymentsClient.GetDeploymentsByIdLogs.g.cs +++ b/src/libs/Together/Generated/Together.IDeploymentsClient.GetDeploymentsByIdLogs.g.cs @@ -23,6 +23,12 @@ public partial interface IDeploymentsClient /// 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()
+ /// logs = client.beta.jig.retrieve_logs("my-deployment")
+ /// print(logs) + ///
global::System.Threading.Tasks.Task GetDeploymentsByIdLogsAsync( string id, string? replicaId = default, @@ -49,6 +55,12 @@ public partial interface IDeploymentsClient /// 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()
+ /// logs = client.beta.jig.retrieve_logs("my-deployment")
+ /// print(logs) + ///
global::System.Threading.Tasks.Task> GetDeploymentsByIdLogsAsResponseAsync( string id, string? replicaId = default, diff --git a/src/libs/Together/Generated/Together.IDeploymentsClient.g.cs b/src/libs/Together/Generated/Together.IDeploymentsClient.g.cs index 3587d06b..a2de365b 100644 --- a/src/libs/Together/Generated/Together.IDeploymentsClient.g.cs +++ b/src/libs/Together/Generated/Together.IDeploymentsClient.g.cs @@ -19,6 +19,27 @@ public partial interface IDeploymentsClient : global::System.IDisposable /// public System.Uri? BaseUri { get; } + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers { get; } + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer { get; set; } + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId); + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer(); + /// /// The authorizations to use for the requests. /// diff --git a/src/libs/Together/Generated/Together.IDeploymentsStorageClient.g.cs b/src/libs/Together/Generated/Together.IDeploymentsStorageClient.g.cs index 91ee6ebd..1b1333ee 100644 --- a/src/libs/Together/Generated/Together.IDeploymentsStorageClient.g.cs +++ b/src/libs/Together/Generated/Together.IDeploymentsStorageClient.g.cs @@ -19,6 +19,27 @@ public partial interface IDeploymentsStorageClient : global::System.IDisposable /// public System.Uri? BaseUri { get; } + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers { get; } + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer { get; set; } + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId); + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer(); + /// /// The authorizations to use for the requests. /// diff --git a/src/libs/Together/Generated/Together.IDeploymentsVolumesClient.CreateDeploymentsStorageVolumes.g.cs b/src/libs/Together/Generated/Together.IDeploymentsVolumesClient.CreateDeploymentsStorageVolumes.g.cs index 0266983f..2ec7c19c 100644 --- a/src/libs/Together/Generated/Together.IDeploymentsVolumesClient.CreateDeploymentsStorageVolumes.g.cs +++ b/src/libs/Together/Generated/Together.IDeploymentsVolumesClient.CreateDeploymentsStorageVolumes.g.cs @@ -12,6 +12,18 @@ public partial interface IDeploymentsVolumesClient /// 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()
+ /// # Files uploaded under source_prefix are loaded into the volume.
+ /// # `tg beta jig volumes create` uploads them and creates the volume for you.
+ /// volume = client.beta.jig.volumes.create(
+ /// name="my-volume",
+ /// type="readOnly",
+ /// content={"type": "files", "source_prefix": "my-volume/0"},
+ /// )
+ /// print(volume.id) + ///
global::System.Threading.Tasks.Task CreateDeploymentsStorageVolumesAsync( global::Together.CreateVolumeRequest request, @@ -25,6 +37,18 @@ public partial interface IDeploymentsVolumesClient /// 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()
+ /// # Files uploaded under source_prefix are loaded into the volume.
+ /// # `tg beta jig volumes create` uploads them and creates the volume for you.
+ /// volume = client.beta.jig.volumes.create(
+ /// name="my-volume",
+ /// type="readOnly",
+ /// content={"type": "files", "source_prefix": "my-volume/0"},
+ /// )
+ /// print(volume.id) + ///
global::System.Threading.Tasks.Task> CreateDeploymentsStorageVolumesAsResponseAsync( global::Together.CreateVolumeRequest request, diff --git a/src/libs/Together/Generated/Together.IDeploymentsVolumesClient.GetDeploymentsStorageVolumes.g.cs b/src/libs/Together/Generated/Together.IDeploymentsVolumesClient.GetDeploymentsStorageVolumes.g.cs index de9b75b7..1f6f40f8 100644 --- a/src/libs/Together/Generated/Together.IDeploymentsVolumesClient.GetDeploymentsStorageVolumes.g.cs +++ b/src/libs/Together/Generated/Together.IDeploymentsVolumesClient.GetDeploymentsStorageVolumes.g.cs @@ -11,6 +11,12 @@ public partial interface IDeploymentsVolumesClient /// 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()
+ /// volumes = client.beta.jig.volumes.list()
+ /// print(volumes) + ///
global::System.Threading.Tasks.Task GetDeploymentsStorageVolumesAsync( global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); @@ -21,6 +27,12 @@ public partial interface IDeploymentsVolumesClient /// 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()
+ /// volumes = client.beta.jig.volumes.list()
+ /// print(volumes) + ///
global::System.Threading.Tasks.Task> GetDeploymentsStorageVolumesAsResponseAsync( global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); diff --git a/src/libs/Together/Generated/Together.IDeploymentsVolumesClient.g.cs b/src/libs/Together/Generated/Together.IDeploymentsVolumesClient.g.cs index e65f7ad3..bc041a09 100644 --- a/src/libs/Together/Generated/Together.IDeploymentsVolumesClient.g.cs +++ b/src/libs/Together/Generated/Together.IDeploymentsVolumesClient.g.cs @@ -19,6 +19,27 @@ public partial interface IDeploymentsVolumesClient : global::System.IDisposable /// public System.Uri? BaseUri { get; } + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers { get; } + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer { get; set; } + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId); + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer(); + /// /// The authorizations to use for the requests. /// diff --git a/src/libs/Together/Generated/Together.IEmbeddingsClient.Embeddings.g.cs b/src/libs/Together/Generated/Together.IEmbeddingsClient.Embeddings.g.cs index a4cbec1b..021d6200 100644 --- a/src/libs/Together/Generated/Together.IEmbeddingsClient.Embeddings.g.cs +++ b/src/libs/Together/Generated/Together.IEmbeddingsClient.Embeddings.g.cs @@ -12,6 +12,18 @@ public partial interface IEmbeddingsClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.embeddings.create(
+ /// model="BAAI/bge-large-en-v1.5",
+ /// input="New York City",
+ /// )
+ /// print(response.data[0].embedding) + ///
global::System.Threading.Tasks.Task EmbeddingsAsync( global::Together.EmbeddingsRequest request, @@ -25,6 +37,18 @@ public partial interface IEmbeddingsClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.embeddings.create(
+ /// model="BAAI/bge-large-en-v1.5",
+ /// input="New York City",
+ /// )
+ /// print(response.data[0].embedding) + ///
global::System.Threading.Tasks.Task> EmbeddingsAsResponseAsync( global::Together.EmbeddingsRequest request, diff --git a/src/libs/Together/Generated/Together.IEmbeddingsClient.g.cs b/src/libs/Together/Generated/Together.IEmbeddingsClient.g.cs index 5c539543..75fed39f 100644 --- a/src/libs/Together/Generated/Together.IEmbeddingsClient.g.cs +++ b/src/libs/Together/Generated/Together.IEmbeddingsClient.g.cs @@ -19,6 +19,27 @@ public partial interface IEmbeddingsClient : global::System.IDisposable /// public System.Uri? BaseUri { get; } + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers { get; } + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer { get; set; } + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId); + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer(); + /// /// The authorizations to use for the requests. /// diff --git a/src/libs/Together/Generated/Together.IEndpointServiceClient.EndpointServiceCreateEndpoint.g.cs b/src/libs/Together/Generated/Together.IEndpointServiceClient.EndpointServiceCreateEndpoint.g.cs index 87fd7b34..ddbb8703 100644 --- a/src/libs/Together/Generated/Together.IEndpointServiceClient.EndpointServiceCreateEndpoint.g.cs +++ b/src/libs/Together/Generated/Together.IEndpointServiceClient.EndpointServiceCreateEndpoint.g.cs @@ -15,6 +15,16 @@ public partial interface IEndpointServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// endpoint = client.beta.endpoints.create(
+ /// project_id=project_id,
+ /// name="my-endpoint",
+ /// )
+ /// print(endpoint.id, endpoint.name) + ///
global::System.Threading.Tasks.Task EndpointServiceCreateEndpointAsync( string projectId, @@ -32,6 +42,16 @@ public partial interface IEndpointServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// endpoint = client.beta.endpoints.create(
+ /// project_id=project_id,
+ /// name="my-endpoint",
+ /// )
+ /// print(endpoint.id, endpoint.name) + ///
global::System.Threading.Tasks.Task> EndpointServiceCreateEndpointAsResponseAsync( string projectId, diff --git a/src/libs/Together/Generated/Together.IEndpointServiceClient.EndpointServiceDeleteEndpoint.g.cs b/src/libs/Together/Generated/Together.IEndpointServiceClient.EndpointServiceDeleteEndpoint.g.cs index 15457e1d..ea235f60 100644 --- a/src/libs/Together/Generated/Together.IEndpointServiceClient.EndpointServiceDeleteEndpoint.g.cs +++ b/src/libs/Together/Generated/Together.IEndpointServiceClient.EndpointServiceDeleteEndpoint.g.cs @@ -20,6 +20,12 @@ public partial interface IEndpointServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// client.beta.endpoints.delete("ep_abc123", project_id=project_id) + ///
global::System.Threading.Tasks.Task EndpointServiceDeleteEndpointAsync( string projectId, string id, @@ -42,6 +48,12 @@ public partial interface IEndpointServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// client.beta.endpoints.delete("ep_abc123", project_id=project_id) + ///
global::System.Threading.Tasks.Task> EndpointServiceDeleteEndpointAsResponseAsync( string projectId, string id, diff --git a/src/libs/Together/Generated/Together.IEndpointServiceClient.EndpointServiceGetEndpoint.g.cs b/src/libs/Together/Generated/Together.IEndpointServiceClient.EndpointServiceGetEndpoint.g.cs index 72042fc7..50a9aa9c 100644 --- a/src/libs/Together/Generated/Together.IEndpointServiceClient.EndpointServiceGetEndpoint.g.cs +++ b/src/libs/Together/Generated/Together.IEndpointServiceClient.EndpointServiceGetEndpoint.g.cs @@ -17,6 +17,16 @@ public partial interface IEndpointServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// endpoint = client.beta.endpoints.retrieve(
+ /// "ep_abc123",
+ /// project_id=project_id,
+ /// )
+ /// print(endpoint.name, endpoint.traffic_split) + ///
global::System.Threading.Tasks.Task EndpointServiceGetEndpointAsync( string projectId, string id, @@ -35,6 +45,16 @@ public partial interface IEndpointServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// endpoint = client.beta.endpoints.retrieve(
+ /// "ep_abc123",
+ /// project_id=project_id,
+ /// )
+ /// print(endpoint.name, endpoint.traffic_split) + ///
global::System.Threading.Tasks.Task> EndpointServiceGetEndpointAsResponseAsync( string projectId, string id, diff --git a/src/libs/Together/Generated/Together.IEndpointServiceClient.EndpointServiceGetEndpointAnalytics.g.cs b/src/libs/Together/Generated/Together.IEndpointServiceClient.EndpointServiceGetEndpointAnalytics.g.cs index 39d0f164..9c032d01 100644 --- a/src/libs/Together/Generated/Together.IEndpointServiceClient.EndpointServiceGetEndpointAnalytics.g.cs +++ b/src/libs/Together/Generated/Together.IEndpointServiceClient.EndpointServiceGetEndpointAnalytics.g.cs @@ -32,6 +32,18 @@ public partial interface IEndpointServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// analytics = client.beta.endpoints.analytics(
+ /// "ep_abc123",
+ /// project_id=project_id,
+ /// start_time="2026-10-01T00:00:00Z",
+ /// end_time="2026-10-02T00:00:00Z",
+ /// )
+ /// print(analytics) + ///
global::System.Threading.Tasks.Task EndpointServiceGetEndpointAnalyticsAsync( string projectId, string id, @@ -70,6 +82,18 @@ public partial interface IEndpointServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// analytics = client.beta.endpoints.analytics(
+ /// "ep_abc123",
+ /// project_id=project_id,
+ /// start_time="2026-10-01T00:00:00Z",
+ /// end_time="2026-10-02T00:00:00Z",
+ /// )
+ /// print(analytics) + ///
global::System.Threading.Tasks.Task> EndpointServiceGetEndpointAnalyticsAsResponseAsync( string projectId, string id, diff --git a/src/libs/Together/Generated/Together.IEndpointServiceClient.EndpointServiceListEndpointEvents.g.cs b/src/libs/Together/Generated/Together.IEndpointServiceClient.EndpointServiceListEndpointEvents.g.cs index 6b28f367..ed3f25b9 100644 --- a/src/libs/Together/Generated/Together.IEndpointServiceClient.EndpointServiceListEndpointEvents.g.cs +++ b/src/libs/Together/Generated/Together.IEndpointServiceClient.EndpointServiceListEndpointEvents.g.cs @@ -44,6 +44,18 @@ public partial interface IEndpointServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// events = client.beta.endpoints.list_events(
+ /// "ep_abc123",
+ /// project_id=project_id,
+ /// min_level="LEVEL_WARN",
+ /// )
+ /// for event in events:
+ /// print(event) + ///
global::System.Threading.Tasks.Task EndpointServiceListEndpointEventsAsync( string projectId, string id, @@ -98,6 +110,18 @@ public partial interface IEndpointServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// events = client.beta.endpoints.list_events(
+ /// "ep_abc123",
+ /// project_id=project_id,
+ /// min_level="LEVEL_WARN",
+ /// )
+ /// for event in events:
+ /// print(event) + ///
global::System.Threading.Tasks.Task> EndpointServiceListEndpointEventsAsResponseAsync( string projectId, string id, diff --git a/src/libs/Together/Generated/Together.IEndpointServiceClient.EndpointServiceListEndpoints.g.cs b/src/libs/Together/Generated/Together.IEndpointServiceClient.EndpointServiceListEndpoints.g.cs index 3f261bb4..f6fdf9f9 100644 --- a/src/libs/Together/Generated/Together.IEndpointServiceClient.EndpointServiceListEndpoints.g.cs +++ b/src/libs/Together/Generated/Together.IEndpointServiceClient.EndpointServiceListEndpoints.g.cs @@ -27,6 +27,13 @@ public partial interface IEndpointServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// for endpoint in client.beta.endpoints.list(project_id=project_id):
+ /// print(endpoint.id, endpoint.name) + ///
global::System.Threading.Tasks.Task EndpointServiceListEndpointsAsync( string projectId, int? limit = default, @@ -58,6 +65,13 @@ public partial interface IEndpointServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// for endpoint in client.beta.endpoints.list(project_id=project_id):
+ /// print(endpoint.id, endpoint.name) + ///
global::System.Threading.Tasks.Task> EndpointServiceListEndpointsAsResponseAsync( string projectId, int? limit = default, diff --git a/src/libs/Together/Generated/Together.IEndpointServiceClient.EndpointServiceListOrganizationEndpoints.g.cs b/src/libs/Together/Generated/Together.IEndpointServiceClient.EndpointServiceListOrganizationEndpoints.g.cs index 3d4c1437..e46e1f59 100644 --- a/src/libs/Together/Generated/Together.IEndpointServiceClient.EndpointServiceListOrganizationEndpoints.g.cs +++ b/src/libs/Together/Generated/Together.IEndpointServiceClient.EndpointServiceListOrganizationEndpoints.g.cs @@ -26,6 +26,13 @@ public partial interface IEndpointServiceClient /// 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()
+ /// organization_id = client.whoami().organization_id
+ /// for endpoint in client.beta.endpoints.list_org_scoped(organization_id):
+ /// print(endpoint.id, endpoint.name) + ///
global::System.Threading.Tasks.Task EndpointServiceListOrganizationEndpointsAsync( string organizationId, int? limit = default, @@ -56,6 +63,13 @@ public partial interface IEndpointServiceClient /// 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()
+ /// organization_id = client.whoami().organization_id
+ /// for endpoint in client.beta.endpoints.list_org_scoped(organization_id):
+ /// print(endpoint.id, endpoint.name) + ///
global::System.Threading.Tasks.Task> EndpointServiceListOrganizationEndpointsAsResponseAsync( string organizationId, int? limit = default, diff --git a/src/libs/Together/Generated/Together.IEndpointServiceClient.EndpointServiceUpdateEndpoint.g.cs b/src/libs/Together/Generated/Together.IEndpointServiceClient.EndpointServiceUpdateEndpoint.g.cs index 75e990a9..bf0f65a0 100644 --- a/src/libs/Together/Generated/Together.IEndpointServiceClient.EndpointServiceUpdateEndpoint.g.cs +++ b/src/libs/Together/Generated/Together.IEndpointServiceClient.EndpointServiceUpdateEndpoint.g.cs @@ -21,6 +21,17 @@ public partial interface IEndpointServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// endpoint = client.beta.endpoints.update(
+ /// "ep_abc123",
+ /// project_id=project_id,
+ /// traffic_split=[{"deployment_id": "dep_abc123", "weight": 1}],
+ /// )
+ /// print(endpoint.traffic_split) + ///
global::System.Threading.Tasks.Task EndpointServiceUpdateEndpointAsync( string projectId, string id, @@ -46,6 +57,17 @@ public partial interface IEndpointServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// endpoint = client.beta.endpoints.update(
+ /// "ep_abc123",
+ /// project_id=project_id,
+ /// traffic_split=[{"deployment_id": "dep_abc123", "weight": 1}],
+ /// )
+ /// print(endpoint.traffic_split) + ///
global::System.Threading.Tasks.Task> EndpointServiceUpdateEndpointAsResponseAsync( string projectId, string id, diff --git a/src/libs/Together/Generated/Together.IEndpoints2Client.AvailabilityZones.g.cs b/src/libs/Together/Generated/Together.IEndpoints2Client.AvailabilityZones.g.cs new file mode 100644 index 00000000..a21e8282 --- /dev/null +++ b/src/libs/Together/Generated/Together.IEndpoints2Client.AvailabilityZones.g.cs @@ -0,0 +1,46 @@ +#nullable enable + +namespace Together +{ + public partial interface IEndpoints2Client + { + /// + /// List all available availability zones
+ /// List all available availability zones. + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.endpoints.list_avzones()
+ /// print(response.avzones) + ///
+ global::System.Threading.Tasks.Task AvailabilityZonesAsync( + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List all available availability zones
+ /// List all available availability zones. + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.endpoints.list_avzones()
+ /// print(response.avzones) + ///
+ global::System.Threading.Tasks.Task> AvailabilityZonesAsResponseAsync( + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IEndpoints2Client.g.cs b/src/libs/Together/Generated/Together.IEndpoints2Client.g.cs new file mode 100644 index 00000000..3aab174f --- /dev/null +++ b/src/libs/Together/Generated/Together.IEndpoints2Client.g.cs @@ -0,0 +1,73 @@ + +#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 partial interface IEndpoints2Client : global::System.IDisposable + { + /// + /// The HttpClient instance. + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + /// The base URL for the API. + /// + public System.Uri? BaseUri { get; } + + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers { get; } + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer { get; set; } + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId); + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer(); + + /// + /// The authorizations to use for the requests. + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + /// Gets or sets a value indicating whether the response content should be read as a string. + /// True by default in debug builds, false otherwise. + /// When false, successful responses are deserialized directly from the response stream for better performance. + /// Error responses are always read as strings regardless of this setting, + /// ensuring is populated. + /// + public bool ReadResponseAsString { get; set; } + /// + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// + public global::Together.AutoSDKClientOptions Options { get; } + + /// + /// Creates idempotency keys for generated idempotent requests when the caller does not provide one. + /// + public global::System.Func CreateIdempotencyKey { get; set; } + + /// + /// + /// + global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } + + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IEndpointsClient.AddAdapter.g.cs b/src/libs/Together/Generated/Together.IEndpointsClient.AddAdapter.g.cs new file mode 100644 index 00000000..3fd2e6ec --- /dev/null +++ b/src/libs/Together/Generated/Together.IEndpointsClient.AddAdapter.g.cs @@ -0,0 +1,91 @@ +#nullable enable + +namespace Together +{ + public partial interface IEndpointsClient + { + /// + /// Add a LoRA adapter to an endpoint
+ /// Adds a LoRA adapter model to a dedicated endpoint. After this call,
+ /// inference requests to the adapter model name will be routed to the
+ /// specified endpoint. The endpoint must have LoRA enabled, and the
+ /// adapter's base model must be compatible with the endpoint's model.
+ /// The endpoint name prefix in model_id must match the resolved endpoint. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// result = client.endpoints.adapters.add(
+ /// "<ENDPOINT_ID>",
+ /// model_id="username/my-endpoint-name:username/my-adapter-model",
+ /// )
+ /// print(result.api_model_id) + ///
+ global::System.Threading.Tasks.Task AddAdapterAsync( + string endpointId, + + global::Together.AddAdapterRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Add a LoRA adapter to an endpoint
+ /// Adds a LoRA adapter model to a dedicated endpoint. After this call,
+ /// inference requests to the adapter model name will be routed to the
+ /// specified endpoint. The endpoint must have LoRA enabled, and the
+ /// adapter's base model must be compatible with the endpoint's model.
+ /// The endpoint name prefix in model_id must match the resolved endpoint. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// result = client.endpoints.adapters.add(
+ /// "<ENDPOINT_ID>",
+ /// model_id="username/my-endpoint-name:username/my-adapter-model",
+ /// )
+ /// print(result.api_model_id) + ///
+ global::System.Threading.Tasks.Task> AddAdapterAsResponseAsync( + string endpointId, + + global::Together.AddAdapterRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Add a LoRA adapter to an endpoint
+ /// Adds a LoRA adapter model to a dedicated endpoint. After this call,
+ /// inference requests to the adapter model name will be routed to the
+ /// specified endpoint. The endpoint must have LoRA enabled, and the
+ /// adapter's base model must be compatible with the endpoint's model.
+ /// The endpoint name prefix in model_id must match the resolved endpoint. + ///
+ /// + /// + /// Combined identifier in format "endpoint_name:adapter_model_name".
+ /// Example: username/Meta-Llama-3.1-8B-Instruct-def456:username/my-adapter-abc123 + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task AddAdapterAsync( + string endpointId, + string modelId, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IEndpointsClient.CreateEndpoint.g.cs b/src/libs/Together/Generated/Together.IEndpointsClient.CreateEndpoint.g.cs new file mode 100644 index 00000000..3acfd80b --- /dev/null +++ b/src/libs/Together/Generated/Together.IEndpointsClient.CreateEndpoint.g.cs @@ -0,0 +1,117 @@ +#nullable enable + +#pragma warning disable CS0618 // Type or member is obsolete + +namespace Together +{ + public partial interface IEndpointsClient + { + /// + /// Create a dedicated endpoint
+ /// Creates a new dedicated endpoint for serving models. The endpoint starts automatically after creation. You can deploy any supported model on hardware configurations that meet the model's requirements. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// endpoint = client.endpoints.create(
+ /// model="Qwen/Qwen3.5-9B-FP8",
+ /// hardware="1x_nvidia_h100_80gb_sxm",
+ /// autoscaling={
+ /// "min_replicas": 2,
+ /// "max_replicas": 5,
+ /// }
+ /// )
+ /// print(endpoint.id) + ///
+ global::System.Threading.Tasks.Task CreateEndpointAsync( + + global::Together.CreateEndpointRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create a dedicated endpoint
+ /// Creates a new dedicated endpoint for serving models. The endpoint starts automatically after creation. You can deploy any supported model on hardware configurations that meet the model's requirements. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// endpoint = client.endpoints.create(
+ /// model="Qwen/Qwen3.5-9B-FP8",
+ /// hardware="1x_nvidia_h100_80gb_sxm",
+ /// autoscaling={
+ /// "min_replicas": 2,
+ /// "max_replicas": 5,
+ /// }
+ /// )
+ /// print(endpoint.id) + ///
+ global::System.Threading.Tasks.Task> CreateEndpointAsResponseAsync( + + global::Together.CreateEndpointRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create a dedicated endpoint
+ /// Creates a new dedicated endpoint for serving models. The endpoint starts automatically after creation. You can deploy any supported model on hardware configurations that meet the model's requirements. + ///
+ /// + /// A human-readable name for the endpoint
+ /// Example: My Llama3 70b endpoint + /// + /// + /// The model to deploy on this endpoint
+ /// Example: deepseek-ai/DeepSeek-R1 + /// + /// + /// The hardware configuration to use for this endpoint
+ /// Example: 1x_nvidia_a100_80gb_sxm + /// + /// + /// Configuration for automatic scaling of the endpoint + /// + /// + /// Whether to disable speculative decoding for this endpoint
+ /// Default Value: false + /// + /// + /// The desired state of the endpoint
+ /// Default Value: STARTED
+ /// Example: STARTED + /// + /// + /// The number of minutes of inactivity after which the endpoint stops automatically. Set to null, omit, or set to 0 to disable automatic timeout.
+ /// Example: 60 + /// + /// + /// Create the endpoint in a specified availability zone (e.g., us-central-4b) + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task CreateEndpointAsync( + string model, + string hardware, + global::Together.Autoscaling autoscaling, + string? displayName = default, + bool? disableSpeculativeDecoding = default, + global::Together.CreateEndpointRequestState? state = default, + int? inactiveTimeout = default, + string? availabilityZone = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IEndpointsClient.DeleteEndpoint.g.cs b/src/libs/Together/Generated/Together.IEndpointsClient.DeleteEndpoint.g.cs new file mode 100644 index 00000000..6fd0f39f --- /dev/null +++ b/src/libs/Together/Generated/Together.IEndpointsClient.DeleteEndpoint.g.cs @@ -0,0 +1,56 @@ +#nullable enable + +namespace Together +{ + public partial interface IEndpointsClient + { + /// + /// Delete endpoint
+ /// Permanently deletes an endpoint. This action cannot be undone. + ///
+ /// + /// The ID of the endpoint to delete
+ /// Example: endpoint-d23901de-ef8f-44bf-b3e7-de9c1ca8f2d7 + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// endpoint = client.endpoints.delete("<ENDPOINT_ID>")
+ /// print(endpoint) + ///
+ global::System.Threading.Tasks.Task DeleteEndpointAsync( + string endpointId, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete endpoint
+ /// Permanently deletes an endpoint. This action cannot be undone. + ///
+ /// + /// The ID of the endpoint to delete
+ /// Example: endpoint-d23901de-ef8f-44bf-b3e7-de9c1ca8f2d7 + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// endpoint = client.endpoints.delete("<ENDPOINT_ID>")
+ /// print(endpoint) + ///
+ global::System.Threading.Tasks.Task DeleteEndpointAsResponseAsync( + string endpointId, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IEndpointsClient.GetEndpoint.g.cs b/src/libs/Together/Generated/Together.IEndpointsClient.GetEndpoint.g.cs new file mode 100644 index 00000000..4e58e0d0 --- /dev/null +++ b/src/libs/Together/Generated/Together.IEndpointsClient.GetEndpoint.g.cs @@ -0,0 +1,56 @@ +#nullable enable + +namespace Together +{ + public partial interface IEndpointsClient + { + /// + /// Get endpoint by ID
+ /// Retrieves details about a specific endpoint, including its current state, configuration, and scaling settings. + ///
+ /// + /// The ID of the endpoint to retrieve
+ /// Example: endpoint-d23901de-ef8f-44bf-b3e7-de9c1ca8f2d7 + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// endpoint = client.endpoints.retrieve("<ENDPOINT_ID>")
+ /// print(endpoint.id) + ///
+ global::System.Threading.Tasks.Task GetEndpointAsync( + string endpointId, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get endpoint by ID
+ /// Retrieves details about a specific endpoint, including its current state, configuration, and scaling settings. + ///
+ /// + /// The ID of the endpoint to retrieve
+ /// Example: endpoint-d23901de-ef8f-44bf-b3e7-de9c1ca8f2d7 + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// endpoint = client.endpoints.retrieve("<ENDPOINT_ID>")
+ /// print(endpoint.id) + ///
+ global::System.Threading.Tasks.Task> GetEndpointAsResponseAsync( + string endpointId, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IEndpointsClient.ListAdapters.g.cs b/src/libs/Together/Generated/Together.IEndpointsClient.ListAdapters.g.cs new file mode 100644 index 00000000..8673014e --- /dev/null +++ b/src/libs/Together/Generated/Together.IEndpointsClient.ListAdapters.g.cs @@ -0,0 +1,52 @@ +#nullable enable + +namespace Together +{ + public partial interface IEndpointsClient + { + /// + /// List adapters on an endpoint
+ /// Returns all LoRA adapters bound to the specified dedicated endpoint. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// adapters = client.endpoints.adapters.list("<ENDPOINT_ID>")
+ /// for adapter in adapters.data or []:
+ /// print(adapter.api_model_id, adapter.adapter_name, adapter.endpoint_name) + ///
+ global::System.Threading.Tasks.Task ListAdaptersAsync( + string endpointId, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List adapters on an endpoint
+ /// Returns all LoRA adapters bound to the specified dedicated endpoint. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// adapters = client.endpoints.adapters.list("<ENDPOINT_ID>")
+ /// for adapter in adapters.data or []:
+ /// print(adapter.api_model_id, adapter.adapter_name, adapter.endpoint_name) + ///
+ global::System.Threading.Tasks.Task> ListAdaptersAsResponseAsync( + string endpointId, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IEndpointsClient.ListEndpoints.g.cs b/src/libs/Together/Generated/Together.IEndpointsClient.ListEndpoints.g.cs new file mode 100644 index 00000000..9b7d6402 --- /dev/null +++ b/src/libs/Together/Generated/Together.IEndpointsClient.ListEndpoints.g.cs @@ -0,0 +1,72 @@ +#nullable enable + +namespace Together +{ + public partial interface IEndpointsClient + { + /// + /// List all endpoints
+ /// Returns a list of all endpoints associated with your account. You can filter the results by type (dedicated or serverless). + ///
+ /// + /// Filter endpoints by type + /// + /// + /// Filter endpoints by usage type + /// + /// + /// If true, return only endpoints owned by the caller + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.endpoints.list()
+ /// for endpoint in response.data:
+ /// print(endpoint.id) + ///
+ global::System.Threading.Tasks.Task ListEndpointsAsync( + global::Together.ListEndpointsType? type = default, + global::Together.ListEndpointsUsageType? usageType = default, + bool? mine = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List all endpoints
+ /// Returns a list of all endpoints associated with your account. You can filter the results by type (dedicated or serverless). + ///
+ /// + /// Filter endpoints by type + /// + /// + /// Filter endpoints by usage type + /// + /// + /// If true, return only endpoints owned by the caller + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.endpoints.list()
+ /// for endpoint in response.data:
+ /// print(endpoint.id) + ///
+ global::System.Threading.Tasks.Task> ListEndpointsAsResponseAsync( + global::Together.ListEndpointsType? type = default, + global::Together.ListEndpointsUsageType? usageType = default, + bool? mine = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IEndpointsClient.RemoveAdapter.g.cs b/src/libs/Together/Generated/Together.IEndpointsClient.RemoveAdapter.g.cs new file mode 100644 index 00000000..34895090 --- /dev/null +++ b/src/libs/Together/Generated/Together.IEndpointsClient.RemoveAdapter.g.cs @@ -0,0 +1,79 @@ +#nullable enable + +namespace Together +{ + public partial interface IEndpointsClient + { + /// + /// Remove a LoRA adapter from an endpoint
+ /// Removes the routing rule that binds an adapter to an endpoint.
+ /// The adapter must be currently bound to this specific endpoint. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// client.endpoints.adapters.remove(
+ /// "<ENDPOINT_ID>",
+ /// model_id="username/my-endpoint-name:username/my-adapter-model",
+ /// ) + ///
+ global::System.Threading.Tasks.Task RemoveAdapterAsync( + string endpointId, + + global::Together.RemoveAdapterRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Remove a LoRA adapter from an endpoint
+ /// Removes the routing rule that binds an adapter to an endpoint.
+ /// The adapter must be currently bound to this specific endpoint. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// client.endpoints.adapters.remove(
+ /// "<ENDPOINT_ID>",
+ /// model_id="username/my-endpoint-name:username/my-adapter-model",
+ /// ) + ///
+ global::System.Threading.Tasks.Task> RemoveAdapterAsResponseAsync( + string endpointId, + + global::Together.RemoveAdapterRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Remove a LoRA adapter from an endpoint
+ /// Removes the routing rule that binds an adapter to an endpoint.
+ /// The adapter must be currently bound to this specific endpoint. + ///
+ /// + /// + /// Combined identifier in format "endpoint_name:adapter_model_name". + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task RemoveAdapterAsync( + string endpointId, + string modelId, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IEndpointsClient.UpdateEndpoint.g.cs b/src/libs/Together/Generated/Together.IEndpointsClient.UpdateEndpoint.g.cs new file mode 100644 index 00000000..67f679d8 --- /dev/null +++ b/src/libs/Together/Generated/Together.IEndpointsClient.UpdateEndpoint.g.cs @@ -0,0 +1,102 @@ +#nullable enable + +namespace Together +{ + public partial interface IEndpointsClient + { + /// + /// Update endpoint, this can also be used to start or stop a dedicated endpoint
+ /// Updates an existing endpoint's configuration. You can modify the display name, autoscaling settings, or change the endpoint's state (start/stop). + ///
+ /// + /// The ID of the endpoint to update
+ /// Example: endpoint-d23901de-ef8f-44bf-b3e7-de9c1ca8f2d7 + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// endpoint = client.endpoints.update(
+ /// "<ENDPOINT_ID>",
+ /// state="STOPPED"
+ /// )
+ /// print(endpoint) + ///
+ global::System.Threading.Tasks.Task UpdateEndpointAsync( + string endpointId, + + global::Together.UpdateEndpointRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update endpoint, this can also be used to start or stop a dedicated endpoint
+ /// Updates an existing endpoint's configuration. You can modify the display name, autoscaling settings, or change the endpoint's state (start/stop). + ///
+ /// + /// The ID of the endpoint to update
+ /// Example: endpoint-d23901de-ef8f-44bf-b3e7-de9c1ca8f2d7 + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// endpoint = client.endpoints.update(
+ /// "<ENDPOINT_ID>",
+ /// state="STOPPED"
+ /// )
+ /// print(endpoint) + ///
+ global::System.Threading.Tasks.Task> UpdateEndpointAsResponseAsync( + string endpointId, + + global::Together.UpdateEndpointRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update endpoint, this can also be used to start or stop a dedicated endpoint
+ /// Updates an existing endpoint's configuration. You can modify the display name, autoscaling settings, or change the endpoint's state (start/stop). + ///
+ /// + /// The ID of the endpoint to update
+ /// Example: endpoint-d23901de-ef8f-44bf-b3e7-de9c1ca8f2d7 + /// + /// + /// A human-readable name for the endpoint
+ /// Example: My Llama3 70b endpoint + /// + /// + /// The desired state of the endpoint
+ /// Example: STARTED + /// + /// + /// New autoscaling configuration for the endpoint + /// + /// + /// The number of minutes of inactivity after which the endpoint stops automatically. Set to 0 to disable automatic timeout.
+ /// Example: 60 + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task UpdateEndpointAsync( + string endpointId, + string? displayName = default, + global::Together.UpdateEndpointRequestState? state = default, + global::Together.Autoscaling? autoscaling = default, + int? inactiveTimeout = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IEndpointsClient.g.cs b/src/libs/Together/Generated/Together.IEndpointsClient.g.cs new file mode 100644 index 00000000..60276bfc --- /dev/null +++ b/src/libs/Together/Generated/Together.IEndpointsClient.g.cs @@ -0,0 +1,73 @@ + +#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 partial interface IEndpointsClient : global::System.IDisposable + { + /// + /// The HttpClient instance. + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + /// The base URL for the API. + /// + public System.Uri? BaseUri { get; } + + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers { get; } + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer { get; set; } + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId); + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer(); + + /// + /// The authorizations to use for the requests. + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + /// Gets or sets a value indicating whether the response content should be read as a string. + /// True by default in debug builds, false otherwise. + /// When false, successful responses are deserialized directly from the response stream for better performance. + /// Error responses are always read as strings regardless of this setting, + /// ensuring is populated. + /// + public bool ReadResponseAsString { get; set; } + /// + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// + public global::Together.AutoSDKClientOptions Options { get; } + + /// + /// Creates idempotency keys for generated idempotent requests when the caller does not provide one. + /// + public global::System.Func CreateIdempotencyKey { get; set; } + + /// + /// + /// + global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } + + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IEvaluationClient.CreateEvaluationJob.g.cs b/src/libs/Together/Generated/Together.IEvaluationClient.CreateEvaluationJob.g.cs index d1195e1e..dba3dda1 100644 --- a/src/libs/Together/Generated/Together.IEvaluationClient.CreateEvaluationJob.g.cs +++ b/src/libs/Together/Generated/Together.IEvaluationClient.CreateEvaluationJob.g.cs @@ -11,6 +11,28 @@ public partial interface IEvaluationClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.evals.create(
+ /// type="classify",
+ /// parameters={
+ /// "judge": {
+ /// "model": "openai/gpt-oss-120b",
+ /// "model_source": "serverless",
+ /// "system_template": "You are an expert evaluator...",
+ /// },
+ /// "input_data_file_path": "<FILE_ID>",
+ /// "labels": ["good", "bad"],
+ /// "pass_labels": ["good"],
+ /// "model_to_evaluate": "Qwen/Qwen3.5-9B",
+ /// },
+ /// )
+ /// print(response.workflow_id) + ///
global::System.Threading.Tasks.Task CreateEvaluationJobAsync( global::Together.EvaluationTypedRequest request, @@ -23,6 +45,28 @@ public partial interface IEvaluationClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.evals.create(
+ /// type="classify",
+ /// parameters={
+ /// "judge": {
+ /// "model": "openai/gpt-oss-120b",
+ /// "model_source": "serverless",
+ /// "system_template": "You are an expert evaluator...",
+ /// },
+ /// "input_data_file_path": "<FILE_ID>",
+ /// "labels": ["good", "bad"],
+ /// "pass_labels": ["good"],
+ /// "model_to_evaluate": "Qwen/Qwen3.5-9B",
+ /// },
+ /// )
+ /// print(response.workflow_id) + ///
global::System.Threading.Tasks.Task> CreateEvaluationJobAsResponseAsync( global::Together.EvaluationTypedRequest request, diff --git a/src/libs/Together/Generated/Together.IEvaluationClient.GetAllEvaluationJobs.g.cs b/src/libs/Together/Generated/Together.IEvaluationClient.GetAllEvaluationJobs.g.cs index a3d95f2e..de65dc2b 100644 --- a/src/libs/Together/Generated/Together.IEvaluationClient.GetAllEvaluationJobs.g.cs +++ b/src/libs/Together/Generated/Together.IEvaluationClient.GetAllEvaluationJobs.g.cs @@ -17,6 +17,16 @@ public partial interface IEvaluationClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.evals.list()
+ /// for job in response:
+ /// print(job.workflow_id) + ///
global::System.Threading.Tasks.Task> GetAllEvaluationJobsAsync( string? status = default, int? limit = default, @@ -35,6 +45,16 @@ public partial interface IEvaluationClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.evals.list()
+ /// for job in response:
+ /// print(job.workflow_id) + ///
global::System.Threading.Tasks.Task>> GetAllEvaluationJobsAsResponseAsync( string? status = default, int? limit = default, diff --git a/src/libs/Together/Generated/Together.IEvaluationClient.GetEvaluationJobDetails.g.cs b/src/libs/Together/Generated/Together.IEvaluationClient.GetEvaluationJobDetails.g.cs index 33c5ef31..4bbad207 100644 --- a/src/libs/Together/Generated/Together.IEvaluationClient.GetEvaluationJobDetails.g.cs +++ b/src/libs/Together/Generated/Together.IEvaluationClient.GetEvaluationJobDetails.g.cs @@ -13,6 +13,15 @@ public partial interface IEvaluationClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.evals.retrieve('<EVALUATION_ID>')
+ /// print(response) + ///
global::System.Threading.Tasks.Task GetEvaluationJobDetailsAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -26,6 +35,15 @@ public partial interface IEvaluationClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.evals.retrieve('<EVALUATION_ID>')
+ /// print(response) + ///
global::System.Threading.Tasks.Task> GetEvaluationJobDetailsAsResponseAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, diff --git a/src/libs/Together/Generated/Together.IEvaluationClient.GetEvaluationJobStatusAndResults.g.cs b/src/libs/Together/Generated/Together.IEvaluationClient.GetEvaluationJobStatusAndResults.g.cs index 2698cbc8..b1d6fae8 100644 --- a/src/libs/Together/Generated/Together.IEvaluationClient.GetEvaluationJobStatusAndResults.g.cs +++ b/src/libs/Together/Generated/Together.IEvaluationClient.GetEvaluationJobStatusAndResults.g.cs @@ -13,6 +13,16 @@ public partial interface IEvaluationClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.evals.status('<EVALUATION_ID>')
+ /// print(response.status)
+ /// print(response.results) + ///
global::System.Threading.Tasks.Task GetEvaluationJobStatusAndResultsAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -26,6 +36,16 @@ public partial interface IEvaluationClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.evals.status('<EVALUATION_ID>')
+ /// print(response.status)
+ /// print(response.results) + ///
global::System.Threading.Tasks.Task> GetEvaluationJobStatusAndResultsAsResponseAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, diff --git a/src/libs/Together/Generated/Together.IEvaluationClient.GetModelList.g.cs b/src/libs/Together/Generated/Together.IEvaluationClient.GetModelList.g.cs index 43bda01b..e267b2eb 100644 --- a/src/libs/Together/Generated/Together.IEvaluationClient.GetModelList.g.cs +++ b/src/libs/Together/Generated/Together.IEvaluationClient.GetModelList.g.cs @@ -14,6 +14,18 @@ public partial interface IEvaluationClient /// 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()
+ /// # The SDK has no dedicated method for this endpoint yet, so call it with
+ /// # the client's generic GET helper.
+ /// models = client.get(
+ /// "/evaluation/model-list",
+ /// cast_to=object,
+ /// options={"params": {"model_source": "serverless"}},
+ /// )
+ /// print(models) + ///
global::System.Threading.Tasks.Task GetModelListAsync( string? modelSource = default, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -28,6 +40,18 @@ public partial interface IEvaluationClient /// 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()
+ /// # The SDK has no dedicated method for this endpoint yet, so call it with
+ /// # the client's generic GET helper.
+ /// models = client.get(
+ /// "/evaluation/model-list",
+ /// cast_to=object,
+ /// options={"params": {"model_source": "serverless"}},
+ /// )
+ /// print(models) + ///
global::System.Threading.Tasks.Task> GetModelListAsResponseAsync( string? modelSource = default, global::Together.AutoSDKRequestOptions? requestOptions = default, diff --git a/src/libs/Together/Generated/Together.IEvaluationClient.g.cs b/src/libs/Together/Generated/Together.IEvaluationClient.g.cs index ee6181cd..06aac2b2 100644 --- a/src/libs/Together/Generated/Together.IEvaluationClient.g.cs +++ b/src/libs/Together/Generated/Together.IEvaluationClient.g.cs @@ -19,6 +19,27 @@ public partial interface IEvaluationClient : global::System.IDisposable /// public System.Uri? BaseUri { get; } + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers { get; } + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer { get; set; } + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId); + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer(); + /// /// The authorizations to use for the requests. /// diff --git a/src/libs/Together/Generated/Together.IFilesClient.CreateFilesUpload.g.cs b/src/libs/Together/Generated/Together.IFilesClient.CreateFilesUpload.g.cs index 8b0ecbc1..84b618ac 100644 --- a/src/libs/Together/Generated/Together.IFilesClient.CreateFilesUpload.g.cs +++ b/src/libs/Together/Generated/Together.IFilesClient.CreateFilesUpload.g.cs @@ -12,6 +12,17 @@ public partial interface IFilesClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// current_dir = os.path.dirname(os.path.abspath(__file__))
+ /// file_path = os.path.join(current_dir, "data.jsonl")
+ /// file = client.files.upload(file=file_path)
+ /// print(file.id) + ///
global::System.Threading.Tasks.Task CreateFilesUploadAsync( global::Together.CreateFilesUploadRequest request, @@ -25,6 +36,17 @@ public partial interface IFilesClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// current_dir = os.path.dirname(os.path.abspath(__file__))
+ /// file_path = os.path.join(current_dir, "data.jsonl")
+ /// file = client.files.upload(file=file_path)
+ /// print(file.id) + ///
global::System.Threading.Tasks.Task> CreateFilesUploadAsResponseAsync( global::Together.CreateFilesUploadRequest request, @@ -84,6 +106,17 @@ public partial interface IFilesClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// current_dir = os.path.dirname(os.path.abspath(__file__))
+ /// file_path = os.path.join(current_dir, "data.jsonl")
+ /// file = client.files.upload(file=file_path)
+ /// print(file.id) + ///
global::System.Threading.Tasks.Task CreateFilesUploadAsync( global::Together.FilePurpose purpose, string fileName, @@ -114,6 +147,17 @@ public partial interface IFilesClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// current_dir = os.path.dirname(os.path.abspath(__file__))
+ /// file_path = os.path.join(current_dir, "data.jsonl")
+ /// file = client.files.upload(file=file_path)
+ /// print(file.id) + ///
global::System.Threading.Tasks.Task> CreateFilesUploadAsResponseAsync( global::Together.FilePurpose purpose, string fileName, diff --git a/src/libs/Together/Generated/Together.IFilesClient.DeleteFilesById.g.cs b/src/libs/Together/Generated/Together.IFilesClient.DeleteFilesById.g.cs index 298e9656..a2e14634 100644 --- a/src/libs/Together/Generated/Together.IFilesClient.DeleteFilesById.g.cs +++ b/src/libs/Together/Generated/Together.IFilesClient.DeleteFilesById.g.cs @@ -14,6 +14,15 @@ public partial interface IFilesClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.files.delete(id="<FILE_ID>")
+ /// print(response) + ///
global::System.Threading.Tasks.Task DeleteFilesByIdAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -28,6 +37,15 @@ public partial interface IFilesClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.files.delete(id="<FILE_ID>")
+ /// print(response) + ///
global::System.Threading.Tasks.Task> DeleteFilesByIdAsResponseAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, diff --git a/src/libs/Together/Generated/Together.IFilesClient.GetFiles.g.cs b/src/libs/Together/Generated/Together.IFilesClient.GetFiles.g.cs index 24666f99..4c5be719 100644 --- a/src/libs/Together/Generated/Together.IFilesClient.GetFiles.g.cs +++ b/src/libs/Together/Generated/Together.IFilesClient.GetFiles.g.cs @@ -11,6 +11,16 @@ public partial interface IFilesClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.files.list()
+ /// for file in response.data:
+ /// print(file.id) + ///
global::System.Threading.Tasks.Task GetFilesAsync( global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); @@ -21,6 +31,16 @@ public partial interface IFilesClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.files.list()
+ /// for file in response.data:
+ /// print(file.id) + ///
global::System.Threading.Tasks.Task> GetFilesAsResponseAsync( global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); diff --git a/src/libs/Together/Generated/Together.IFilesClient.GetFilesById.g.cs b/src/libs/Together/Generated/Together.IFilesClient.GetFilesById.g.cs index aa2e07e9..91085573 100644 --- a/src/libs/Together/Generated/Together.IFilesClient.GetFilesById.g.cs +++ b/src/libs/Together/Generated/Together.IFilesClient.GetFilesById.g.cs @@ -14,6 +14,15 @@ public partial interface IFilesClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// file = client.files.retrieve(id="<FILE_ID>")
+ /// print(file) + ///
global::System.Threading.Tasks.Task GetFilesByIdAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -28,6 +37,15 @@ public partial interface IFilesClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// file = client.files.retrieve(id="<FILE_ID>")
+ /// print(file) + ///
global::System.Threading.Tasks.Task> GetFilesByIdAsResponseAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, diff --git a/src/libs/Together/Generated/Together.IFilesClient.GetFilesByIdContent.g.cs b/src/libs/Together/Generated/Together.IFilesClient.GetFilesByIdContent.g.cs index bbb265fb..28da4f3b 100644 --- a/src/libs/Together/Generated/Together.IFilesClient.GetFilesByIdContent.g.cs +++ b/src/libs/Together/Generated/Together.IFilesClient.GetFilesByIdContent.g.cs @@ -14,6 +14,16 @@ public partial interface IFilesClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// with client.files.with_streaming_response.content(id="<FILE_ID>") as response:
+ /// for line in response.iter_lines():
+ /// print(line) + ///
global::System.Threading.Tasks.Task GetFilesByIdContentAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -28,6 +38,16 @@ public partial interface IFilesClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// with client.files.with_streaming_response.content(id="<FILE_ID>") as response:
+ /// for line in response.iter_lines():
+ /// print(line) + ///
global::System.Threading.Tasks.Task GetFilesByIdContentAsStreamAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -42,6 +62,16 @@ public partial interface IFilesClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// with client.files.with_streaming_response.content(id="<FILE_ID>") as response:
+ /// for line in response.iter_lines():
+ /// print(line) + ///
global::System.Threading.Tasks.Task> GetFilesByIdContentAsResponseAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, diff --git a/src/libs/Together/Generated/Together.IFilesClient.g.cs b/src/libs/Together/Generated/Together.IFilesClient.g.cs index 6779cdbf..5eaff8c5 100644 --- a/src/libs/Together/Generated/Together.IFilesClient.g.cs +++ b/src/libs/Together/Generated/Together.IFilesClient.g.cs @@ -19,6 +19,27 @@ public partial interface IFilesClient : global::System.IDisposable /// public System.Uri? BaseUri { get; } + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers { get; } + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer { get; set; } + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId); + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer(); + /// /// The authorizations to use for the requests. /// diff --git a/src/libs/Together/Generated/Together.IFineTuningClient.CreateFineTunes.g.cs b/src/libs/Together/Generated/Together.IFineTuningClient.CreateFineTunes.g.cs index 4cd773a0..a0c848b9 100644 --- a/src/libs/Together/Generated/Together.IFineTuningClient.CreateFineTunes.g.cs +++ b/src/libs/Together/Generated/Together.IFineTuningClient.CreateFineTunes.g.cs @@ -1,5 +1,7 @@ #nullable enable +#pragma warning disable CS0618 // Type or member is obsolete + namespace Together { public partial interface IFineTuningClient @@ -12,6 +14,18 @@ public partial interface IFineTuningClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.fine_tuning.create(
+ /// model="meta-llama/Meta-Llama-3.1-8B-Instruct-Reference",
+ /// training_file="<FILE_ID>"
+ /// )
+ /// print(response) + ///
global::System.Threading.Tasks.Task CreateFineTunesAsync( global::Together.CreateFineTunesRequest request, @@ -25,6 +39,18 @@ public partial interface IFineTuningClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.fine_tuning.create(
+ /// model="meta-llama/Meta-Llama-3.1-8B-Instruct-Reference",
+ /// training_file="<FILE_ID>"
+ /// )
+ /// print(response) + ///
global::System.Threading.Tasks.Task> CreateFineTunesAsResponseAsync( global::Together.CreateFineTunesRequest request, diff --git a/src/libs/Together/Generated/Together.IFineTuningClient.CreateFineTunesByIdCancel.g.cs b/src/libs/Together/Generated/Together.IFineTuningClient.CreateFineTunesByIdCancel.g.cs index 58901494..ae425451 100644 --- a/src/libs/Together/Generated/Together.IFineTuningClient.CreateFineTunesByIdCancel.g.cs +++ b/src/libs/Together/Generated/Together.IFineTuningClient.CreateFineTunesByIdCancel.g.cs @@ -14,6 +14,15 @@ public partial interface IFineTuningClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.fine_tuning.cancel(id="<JOB_ID>")
+ /// print(response) + ///
global::System.Threading.Tasks.Task CreateFineTunesByIdCancelAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -28,6 +37,15 @@ public partial interface IFineTuningClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.fine_tuning.cancel(id="<JOB_ID>")
+ /// print(response) + ///
global::System.Threading.Tasks.Task> CreateFineTunesByIdCancelAsResponseAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, diff --git a/src/libs/Together/Generated/Together.IFineTuningClient.CreateFineTunesEstimatePrice.g.cs b/src/libs/Together/Generated/Together.IFineTuningClient.CreateFineTunesEstimatePrice.g.cs index b92e0c50..0c5a187e 100644 --- a/src/libs/Together/Generated/Together.IFineTuningClient.CreateFineTunesEstimatePrice.g.cs +++ b/src/libs/Together/Generated/Together.IFineTuningClient.CreateFineTunesEstimatePrice.g.cs @@ -12,6 +12,18 @@ public partial interface IFineTuningClient /// 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()
+ /// estimate = client.fine_tuning.estimate_price(
+ /// training_file="<FILE_ID>",
+ /// model="meta-llama/Meta-Llama-3.1-8B-Instruct-Reference",
+ /// n_epochs=3,
+ /// training_method={"method": "sft", "train_on_inputs": "auto"},
+ /// training_type={"type": "Lora", "lora_r": 8, "lora_alpha": 16},
+ /// )
+ /// print(estimate) + ///
global::System.Threading.Tasks.Task> CreateFineTunesEstimatePriceAsync( global::Together.CreateFineTunesEstimatePriceRequest request, @@ -25,6 +37,18 @@ public partial interface IFineTuningClient /// 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()
+ /// estimate = client.fine_tuning.estimate_price(
+ /// training_file="<FILE_ID>",
+ /// model="meta-llama/Meta-Llama-3.1-8B-Instruct-Reference",
+ /// n_epochs=3,
+ /// training_method={"method": "sft", "train_on_inputs": "auto"},
+ /// training_type={"type": "Lora", "lora_r": 8, "lora_alpha": 16},
+ /// )
+ /// print(estimate) + ///
global::System.Threading.Tasks.Task>> CreateFineTunesEstimatePriceAsResponseAsync( global::Together.CreateFineTunesEstimatePriceRequest request, diff --git a/src/libs/Together/Generated/Together.IFineTuningClient.CreateFineTunesPreview.g.cs b/src/libs/Together/Generated/Together.IFineTuningClient.CreateFineTunesPreview.g.cs index 3997f46e..f5c267af 100644 --- a/src/libs/Together/Generated/Together.IFineTuningClient.CreateFineTunesPreview.g.cs +++ b/src/libs/Together/Generated/Together.IFineTuningClient.CreateFineTunesPreview.g.cs @@ -12,6 +12,15 @@ public partial interface IFineTuningClient /// 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()
+ /// preview = client.fine_tuning.preview(
+ /// model="meta-llama/Meta-Llama-3.1-8B-Instruct-Reference",
+ /// training_file="<FILE_ID>",
+ /// )
+ /// print(preview) + ///
global::System.Threading.Tasks.Task CreateFineTunesPreviewAsync( global::Together.FineTunePreviewRequest request, @@ -25,6 +34,15 @@ public partial interface IFineTuningClient /// 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()
+ /// preview = client.fine_tuning.preview(
+ /// model="meta-llama/Meta-Llama-3.1-8B-Instruct-Reference",
+ /// training_file="<FILE_ID>",
+ /// )
+ /// print(preview) + ///
global::System.Threading.Tasks.Task> CreateFineTunesPreviewAsResponseAsync( global::Together.FineTunePreviewRequest request, diff --git a/src/libs/Together/Generated/Together.IFineTuningClient.DeleteFineTunesById.g.cs b/src/libs/Together/Generated/Together.IFineTuningClient.DeleteFineTunesById.g.cs index 2c2afd13..a24c8f2b 100644 --- a/src/libs/Together/Generated/Together.IFineTuningClient.DeleteFineTunesById.g.cs +++ b/src/libs/Together/Generated/Together.IFineTuningClient.DeleteFineTunesById.g.cs @@ -11,11 +11,25 @@ public partial interface IFineTuningClient /// /// The ID of the fine-tune job to delete /// + /// + /// Deprecated and unused parameter.
+ /// Default Value: false + /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.fine_tuning.delete(id="<JOB_ID>")
+ /// print(response) + ///
global::System.Threading.Tasks.Task DeleteFineTunesByIdAsync( string id, + bool? force = default, global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// @@ -25,11 +39,25 @@ public partial interface IFineTuningClient /// /// The ID of the fine-tune job to delete /// + /// + /// Deprecated and unused parameter.
+ /// Default Value: false + /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.fine_tuning.delete(id="<JOB_ID>")
+ /// print(response) + ///
global::System.Threading.Tasks.Task> DeleteFineTunesByIdAsResponseAsync( string id, + bool? force = default, global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } diff --git a/src/libs/Together/Generated/Together.IFineTuningClient.GetFineTunes.g.cs b/src/libs/Together/Generated/Together.IFineTuningClient.GetFineTunes.g.cs index dd15161f..4df6f022 100644 --- a/src/libs/Together/Generated/Together.IFineTuningClient.GetFineTunes.g.cs +++ b/src/libs/Together/Generated/Together.IFineTuningClient.GetFineTunes.g.cs @@ -11,6 +11,16 @@ public partial interface IFineTuningClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.fine_tuning.list()
+ /// for fine_tune in response.data:
+ /// print(f"ID: {fine_tune.id}, Status: {fine_tune.status}") + ///
global::System.Threading.Tasks.Task GetFineTunesAsync( global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); @@ -21,6 +31,16 @@ public partial interface IFineTuningClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.fine_tuning.list()
+ /// for fine_tune in response.data:
+ /// print(f"ID: {fine_tune.id}, Status: {fine_tune.status}") + ///
global::System.Threading.Tasks.Task> GetFineTunesAsResponseAsync( global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); diff --git a/src/libs/Together/Generated/Together.IFineTuningClient.GetFineTunesById.g.cs b/src/libs/Together/Generated/Together.IFineTuningClient.GetFineTunesById.g.cs index e2326975..664bafaa 100644 --- a/src/libs/Together/Generated/Together.IFineTuningClient.GetFineTunesById.g.cs +++ b/src/libs/Together/Generated/Together.IFineTuningClient.GetFineTunesById.g.cs @@ -14,6 +14,15 @@ public partial interface IFineTuningClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// fine_tune = client.fine_tuning.retrieve(id="<JOB_ID>")
+ /// print(fine_tune) + ///
global::System.Threading.Tasks.Task GetFineTunesByIdAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -28,6 +37,15 @@ public partial interface IFineTuningClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// fine_tune = client.fine_tuning.retrieve(id="<JOB_ID>")
+ /// print(fine_tune) + ///
global::System.Threading.Tasks.Task> GetFineTunesByIdAsResponseAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, diff --git a/src/libs/Together/Generated/Together.IFineTuningClient.GetFineTunesByIdCheckpoints.g.cs b/src/libs/Together/Generated/Together.IFineTuningClient.GetFineTunesByIdCheckpoints.g.cs index ea54c6fa..439886a0 100644 --- a/src/libs/Together/Generated/Together.IFineTuningClient.GetFineTunesByIdCheckpoints.g.cs +++ b/src/libs/Together/Generated/Together.IFineTuningClient.GetFineTunesByIdCheckpoints.g.cs @@ -14,6 +14,15 @@ public partial interface IFineTuningClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// checkpoints = client.fine_tuning.list_checkpoints(id="<JOB_ID>")
+ /// print(checkpoints) + ///
global::System.Threading.Tasks.Task GetFineTunesByIdCheckpointsAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -28,6 +37,15 @@ public partial interface IFineTuningClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// checkpoints = client.fine_tuning.list_checkpoints(id="<JOB_ID>")
+ /// print(checkpoints) + ///
global::System.Threading.Tasks.Task> GetFineTunesByIdCheckpointsAsResponseAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, diff --git a/src/libs/Together/Generated/Together.IFineTuningClient.GetFineTunesByIdDownloadTokenizedDataset.g.cs b/src/libs/Together/Generated/Together.IFineTuningClient.GetFineTunesByIdDownloadTokenizedDataset.g.cs index 645d597e..8c22ac57 100644 --- a/src/libs/Together/Generated/Together.IFineTuningClient.GetFineTunesByIdDownloadTokenizedDataset.g.cs +++ b/src/libs/Together/Generated/Together.IFineTuningClient.GetFineTunesByIdDownloadTokenizedDataset.g.cs @@ -14,6 +14,19 @@ public partial interface IFineTuningClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// tokenized_dataset = client.fine_tuning.retrieve_tokenized_dataset(
+ /// id="<JOB_ID>",
+ /// )
+ /// print(tokenized_dataset.url)
+ /// print(tokenized_dataset.filename)
+ /// print(tokenized_dataset.size) + ///
global::System.Threading.Tasks.Task GetFineTunesByIdDownloadTokenizedDatasetAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -28,6 +41,19 @@ public partial interface IFineTuningClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// tokenized_dataset = client.fine_tuning.retrieve_tokenized_dataset(
+ /// id="<JOB_ID>",
+ /// )
+ /// print(tokenized_dataset.url)
+ /// print(tokenized_dataset.filename)
+ /// print(tokenized_dataset.size) + ///
global::System.Threading.Tasks.Task> GetFineTunesByIdDownloadTokenizedDatasetAsResponseAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, diff --git a/src/libs/Together/Generated/Together.IFineTuningClient.GetFineTunesByIdEvents.g.cs b/src/libs/Together/Generated/Together.IFineTuningClient.GetFineTunesByIdEvents.g.cs index cfc707e8..5fccc8ee 100644 --- a/src/libs/Together/Generated/Together.IFineTuningClient.GetFineTunesByIdEvents.g.cs +++ b/src/libs/Together/Generated/Together.IFineTuningClient.GetFineTunesByIdEvents.g.cs @@ -14,6 +14,16 @@ public partial interface IFineTuningClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.fine_tuning.list_events(id="<JOB_ID>")
+ /// for event in response.data:
+ /// print(event) + ///
global::System.Threading.Tasks.Task GetFineTunesByIdEventsAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -28,6 +38,16 @@ public partial interface IFineTuningClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.fine_tuning.list_events(id="<JOB_ID>")
+ /// for event in response.data:
+ /// print(event) + ///
global::System.Threading.Tasks.Task> GetFineTunesByIdEventsAsResponseAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, diff --git a/src/libs/Together/Generated/Together.IFineTuningClient.GetFineTunesByIdMetrics.g.cs b/src/libs/Together/Generated/Together.IFineTuningClient.GetFineTunesByIdMetrics.g.cs index 045daf96..fb7a5418 100644 --- a/src/libs/Together/Generated/Together.IFineTuningClient.GetFineTunesByIdMetrics.g.cs +++ b/src/libs/Together/Generated/Together.IFineTuningClient.GetFineTunesByIdMetrics.g.cs @@ -19,6 +19,16 @@ public partial interface IFineTuningClient /// 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()
+ /// metrics = client.fine_tuning.list_metrics(
+ /// "<JOB_ID>",
+ /// global_step_from=0,
+ /// global_step_to=500,
+ /// )
+ /// print(metrics) + ///
global::System.Threading.Tasks.Task GetFineTunesByIdMetricsAsync( string id, int? globalStepFrom = default, @@ -43,6 +53,16 @@ public partial interface IFineTuningClient /// 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()
+ /// metrics = client.fine_tuning.list_metrics(
+ /// "<JOB_ID>",
+ /// global_step_from=0,
+ /// global_step_to=500,
+ /// )
+ /// print(metrics) + ///
global::System.Threading.Tasks.Task> GetFineTunesByIdMetricsAsResponseAsync( string id, int? globalStepFrom = default, diff --git a/src/libs/Together/Generated/Together.IFineTuningClient.GetFineTunesModelsLimits.g.cs b/src/libs/Together/Generated/Together.IFineTuningClient.GetFineTunesModelsLimits.g.cs index 895d4dc4..9c97c46b 100644 --- a/src/libs/Together/Generated/Together.IFineTuningClient.GetFineTunesModelsLimits.g.cs +++ b/src/libs/Together/Generated/Together.IFineTuningClient.GetFineTunesModelsLimits.g.cs @@ -14,6 +14,14 @@ public partial interface IFineTuningClient /// 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()
+ /// limits = client.fine_tuning.model_limits(
+ /// model_name="meta-llama/Meta-Llama-3.1-8B-Instruct-Reference",
+ /// )
+ /// print(limits) + ///
global::System.Threading.Tasks.Task GetFineTunesModelsLimitsAsync( string modelName, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -28,6 +36,14 @@ public partial interface IFineTuningClient /// 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()
+ /// limits = client.fine_tuning.model_limits(
+ /// model_name="meta-llama/Meta-Llama-3.1-8B-Instruct-Reference",
+ /// )
+ /// print(limits) + ///
global::System.Threading.Tasks.Task> GetFineTunesModelsLimitsAsResponseAsync( string modelName, global::Together.AutoSDKRequestOptions? requestOptions = default, diff --git a/src/libs/Together/Generated/Together.IFineTuningClient.GetFineTunesModelsSupported.g.cs b/src/libs/Together/Generated/Together.IFineTuningClient.GetFineTunesModelsSupported.g.cs index ee141f4c..4b02ef28 100644 --- a/src/libs/Together/Generated/Together.IFineTuningClient.GetFineTunesModelsSupported.g.cs +++ b/src/libs/Together/Generated/Together.IFineTuningClient.GetFineTunesModelsSupported.g.cs @@ -11,6 +11,14 @@ public partial interface IFineTuningClient /// 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()
+ /// # The SDK has no dedicated method for this endpoint yet, so call it with
+ /// # the client's generic GET helper.
+ /// models = client.get("/fine-tunes/models/supported", cast_to=object)
+ /// print(models) + ///
global::System.Threading.Tasks.Task GetFineTunesModelsSupportedAsync( global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); @@ -21,6 +29,14 @@ public partial interface IFineTuningClient /// 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()
+ /// # The SDK has no dedicated method for this endpoint yet, so call it with
+ /// # the client's generic GET helper.
+ /// models = client.get("/fine-tunes/models/supported", cast_to=object)
+ /// print(models) + ///
global::System.Threading.Tasks.Task> GetFineTunesModelsSupportedAsResponseAsync( global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); diff --git a/src/libs/Together/Generated/Together.IFineTuningClient.GetFinetuneDownload.g.cs b/src/libs/Together/Generated/Together.IFineTuningClient.GetFinetuneDownload.g.cs index 5f2ada83..f629dea0 100644 --- a/src/libs/Together/Generated/Together.IFineTuningClient.GetFinetuneDownload.g.cs +++ b/src/libs/Together/Generated/Together.IFineTuningClient.GetFinetuneDownload.g.cs @@ -20,6 +20,18 @@ public partial interface IFineTuningClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// # Using `with_streaming_response` gives you control to do what you want with the response.
+ /// stream = client.fine_tuning.with_streaming_response.content(ft_id="<JOB_ID>")
+ /// with stream as response:
+ /// for line in response.iter_lines():
+ /// print(line) + ///
global::System.Threading.Tasks.Task GetFinetuneDownloadAsync( string ftId, int? checkpointStep = default, @@ -42,6 +54,18 @@ public partial interface IFineTuningClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// # Using `with_streaming_response` gives you control to do what you want with the response.
+ /// stream = client.fine_tuning.with_streaming_response.content(ft_id="<JOB_ID>")
+ /// with stream as response:
+ /// for line in response.iter_lines():
+ /// print(line) + ///
global::System.Threading.Tasks.Task GetFinetuneDownloadAsStreamAsync( string ftId, int? checkpointStep = default, @@ -64,6 +88,18 @@ public partial interface IFineTuningClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// # Using `with_streaming_response` gives you control to do what you want with the response.
+ /// stream = client.fine_tuning.with_streaming_response.content(ft_id="<JOB_ID>")
+ /// with stream as response:
+ /// for line in response.iter_lines():
+ /// print(line) + ///
global::System.Threading.Tasks.Task> GetFinetuneDownloadAsResponseAsync( string ftId, int? checkpointStep = default, diff --git a/src/libs/Together/Generated/Together.IFineTuningClient.g.cs b/src/libs/Together/Generated/Together.IFineTuningClient.g.cs index 649ade47..26ab85c2 100644 --- a/src/libs/Together/Generated/Together.IFineTuningClient.g.cs +++ b/src/libs/Together/Generated/Together.IFineTuningClient.g.cs @@ -19,6 +19,27 @@ public partial interface IFineTuningClient : global::System.IDisposable ///
public System.Uri? BaseUri { get; } + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers { get; } + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer { get; set; } + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId); + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer(); + /// /// The authorizations to use for the requests. /// diff --git a/src/libs/Together/Generated/Together.IGPUClusterServiceClient.GPUClusterServiceCreate.g.cs b/src/libs/Together/Generated/Together.IGPUClusterServiceClient.GPUClusterServiceCreate.g.cs index 2f4875e5..b5f118ef 100644 --- a/src/libs/Together/Generated/Together.IGPUClusterServiceClient.GPUClusterServiceCreate.g.cs +++ b/src/libs/Together/Generated/Together.IGPUClusterServiceClient.GPUClusterServiceCreate.g.cs @@ -15,6 +15,20 @@ public partial interface IGPUClusterServiceClient /// 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()
+ /// response = client.beta.clusters.create(
+ /// cluster_name="my-gpu-cluster",
+ /// region="us-central-8",
+ /// gpu_type="H100_SXM",
+ /// num_gpus=8,
+ /// nvidia_driver_version="560",
+ /// cuda_version="12.6",
+ /// billint_type="ON_DEMAND",
+ /// )
+ /// print(response.cluster_id) + ///
global::System.Threading.Tasks.Task GPUClusterServiceCreateAsync( global::Together.GPUClusterCreateRequest request, @@ -31,6 +45,20 @@ public partial interface IGPUClusterServiceClient /// 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()
+ /// response = client.beta.clusters.create(
+ /// cluster_name="my-gpu-cluster",
+ /// region="us-central-8",
+ /// gpu_type="H100_SXM",
+ /// num_gpus=8,
+ /// nvidia_driver_version="560",
+ /// cuda_version="12.6",
+ /// billint_type="ON_DEMAND",
+ /// )
+ /// print(response.cluster_id) + ///
global::System.Threading.Tasks.Task> GPUClusterServiceCreateAsResponseAsync( global::Together.GPUClusterCreateRequest request, diff --git a/src/libs/Together/Generated/Together.IGPUClusterServiceClient.GPUClusterServiceDelete.g.cs b/src/libs/Together/Generated/Together.IGPUClusterServiceClient.GPUClusterServiceDelete.g.cs index 78d1bf3c..b1336434 100644 --- a/src/libs/Together/Generated/Together.IGPUClusterServiceClient.GPUClusterServiceDelete.g.cs +++ b/src/libs/Together/Generated/Together.IGPUClusterServiceClient.GPUClusterServiceDelete.g.cs @@ -14,6 +14,12 @@ public partial interface IGPUClusterServiceClient /// 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()
+ /// cluster = client.beta.clusters.delete("cluster_id")
+ /// print(cluster) + ///
global::System.Threading.Tasks.Task GPUClusterServiceDeleteAsync( string clusterId, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -28,6 +34,12 @@ public partial interface IGPUClusterServiceClient /// 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()
+ /// cluster = client.beta.clusters.delete("cluster_id")
+ /// print(cluster) + ///
global::System.Threading.Tasks.Task> GPUClusterServiceDeleteAsResponseAsync( string clusterId, global::Together.AutoSDKRequestOptions? requestOptions = default, diff --git a/src/libs/Together/Generated/Together.IGPUClusterServiceClient.GPUClusterServiceGet.g.cs b/src/libs/Together/Generated/Together.IGPUClusterServiceClient.GPUClusterServiceGet.g.cs index 1562146a..2a6cc9be 100644 --- a/src/libs/Together/Generated/Together.IGPUClusterServiceClient.GPUClusterServiceGet.g.cs +++ b/src/libs/Together/Generated/Together.IGPUClusterServiceClient.GPUClusterServiceGet.g.cs @@ -14,6 +14,12 @@ public partial interface IGPUClusterServiceClient /// 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()
+ /// cluster = client.beta.clusters.retrieve("cluster_id")
+ /// print(cluster) + ///
global::System.Threading.Tasks.Task GPUClusterServiceGetAsync( string clusterId, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -28,6 +34,12 @@ public partial interface IGPUClusterServiceClient /// 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()
+ /// cluster = client.beta.clusters.retrieve("cluster_id")
+ /// print(cluster) + ///
global::System.Threading.Tasks.Task> GPUClusterServiceGetAsResponseAsync( string clusterId, global::Together.AutoSDKRequestOptions? requestOptions = default, diff --git a/src/libs/Together/Generated/Together.IGPUClusterServiceClient.GPUClusterServiceList.g.cs b/src/libs/Together/Generated/Together.IGPUClusterServiceClient.GPUClusterServiceList.g.cs index ccd69988..1e5d8e14 100644 --- a/src/libs/Together/Generated/Together.IGPUClusterServiceClient.GPUClusterServiceList.g.cs +++ b/src/libs/Together/Generated/Together.IGPUClusterServiceClient.GPUClusterServiceList.g.cs @@ -16,6 +16,15 @@ public partial interface IGPUClusterServiceClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.beta.clusters.list()
+ /// print(response.clusters) + ///
global::System.Threading.Tasks.Task GPUClusterServiceListAsync( string? projectId = default, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -32,6 +41,15 @@ public partial interface IGPUClusterServiceClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.beta.clusters.list()
+ /// print(response.clusters) + ///
global::System.Threading.Tasks.Task> GPUClusterServiceListAsResponseAsync( string? projectId = default, global::Together.AutoSDKRequestOptions? requestOptions = default, diff --git a/src/libs/Together/Generated/Together.IGPUClusterServiceClient.GPUClusterServiceUpdate.g.cs b/src/libs/Together/Generated/Together.IGPUClusterServiceClient.GPUClusterServiceUpdate.g.cs index eda914ce..049b7290 100644 --- a/src/libs/Together/Generated/Together.IGPUClusterServiceClient.GPUClusterServiceUpdate.g.cs +++ b/src/libs/Together/Generated/Together.IGPUClusterServiceClient.GPUClusterServiceUpdate.g.cs @@ -15,6 +15,12 @@ public partial interface IGPUClusterServiceClient /// 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()
+ /// cluster = client.beta.clusters.update("cluster_id", cluster_type="KUBERNETES", num_gpus=24)
+ /// print(cluster) + ///
global::System.Threading.Tasks.Task GPUClusterServiceUpdateAsync( string clusterId, @@ -32,6 +38,12 @@ public partial interface IGPUClusterServiceClient /// 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()
+ /// cluster = client.beta.clusters.update("cluster_id", cluster_type="KUBERNETES", num_gpus=24)
+ /// print(cluster) + ///
global::System.Threading.Tasks.Task> GPUClusterServiceUpdateAsResponseAsync( string clusterId, diff --git a/src/libs/Together/Generated/Together.IGPUClusterServiceClient.g.cs b/src/libs/Together/Generated/Together.IGPUClusterServiceClient.g.cs index 06446570..2ca7fb24 100644 --- a/src/libs/Together/Generated/Together.IGPUClusterServiceClient.g.cs +++ b/src/libs/Together/Generated/Together.IGPUClusterServiceClient.g.cs @@ -19,6 +19,27 @@ public partial interface IGPUClusterServiceClient : global::System.IDisposable /// public System.Uri? BaseUri { get; } + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers { get; } + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer { get; set; } + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId); + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer(); + /// /// The authorizations to use for the requests. /// diff --git a/src/libs/Together/Generated/Together.IHardwareClient.ListHardware.g.cs b/src/libs/Together/Generated/Together.IHardwareClient.ListHardware.g.cs new file mode 100644 index 00000000..d7fb941d --- /dev/null +++ b/src/libs/Together/Generated/Together.IHardwareClient.ListHardware.g.cs @@ -0,0 +1,62 @@ +#nullable enable + +namespace Together +{ + public partial interface IHardwareClient + { + /// + /// List available hardware configurations
+ /// Returns a list of available hardware configurations for deploying models. When a model parameter is provided, it returns only hardware configurations compatible with that model, including their current availability status. + ///
+ /// + /// Filter hardware configurations by model compatibility. When provided,
+ /// the response includes availability status for each compatible configuration.
+ /// [See all of Together AI's dedicated models](https://docs.together.ai/docs/dedicated-models)
+ /// Example: deepseek-ai/DeepSeek-R1 + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.endpoints.list_hardware()
+ /// for hardware in response.data:
+ /// print(hardware.id) + ///
+ global::System.Threading.Tasks.Task ListHardwareAsync( + string? model = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List available hardware configurations
+ /// Returns a list of available hardware configurations for deploying models. When a model parameter is provided, it returns only hardware configurations compatible with that model, including their current availability status. + ///
+ /// + /// Filter hardware configurations by model compatibility. When provided,
+ /// the response includes availability status for each compatible configuration.
+ /// [See all of Together AI's dedicated models](https://docs.together.ai/docs/dedicated-models)
+ /// Example: deepseek-ai/DeepSeek-R1 + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.endpoints.list_hardware()
+ /// for hardware in response.data:
+ /// print(hardware.id) + ///
+ global::System.Threading.Tasks.Task> ListHardwareAsResponseAsync( + string? model = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IHardwareClient.g.cs b/src/libs/Together/Generated/Together.IHardwareClient.g.cs new file mode 100644 index 00000000..71052cc0 --- /dev/null +++ b/src/libs/Together/Generated/Together.IHardwareClient.g.cs @@ -0,0 +1,73 @@ + +#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 partial interface IHardwareClient : global::System.IDisposable + { + /// + /// The HttpClient instance. + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + /// The base URL for the API. + /// + public System.Uri? BaseUri { get; } + + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers { get; } + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer { get; set; } + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId); + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer(); + + /// + /// The authorizations to use for the requests. + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + /// Gets or sets a value indicating whether the response content should be read as a string. + /// True by default in debug builds, false otherwise. + /// When false, successful responses are deserialized directly from the response stream for better performance. + /// Error responses are always read as strings regardless of this setting, + /// ensuring is populated. + /// + public bool ReadResponseAsString { get; set; } + /// + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// + public global::Together.AutoSDKClientOptions Options { get; } + + /// + /// Creates idempotency keys for generated idempotent requests when the caller does not provide one. + /// + public global::System.Func CreateIdempotencyKey { get; set; } + + /// + /// + /// + global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } + + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IHealthCheckServiceClient.g.cs b/src/libs/Together/Generated/Together.IHealthCheckServiceClient.g.cs index 5699bf72..6f692f7f 100644 --- a/src/libs/Together/Generated/Together.IHealthCheckServiceClient.g.cs +++ b/src/libs/Together/Generated/Together.IHealthCheckServiceClient.g.cs @@ -19,6 +19,27 @@ public partial interface IHealthCheckServiceClient : global::System.IDisposable /// public System.Uri? BaseUri { get; } + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers { get; } + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer { get; set; } + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId); + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer(); + /// /// The authorizations to use for the requests. /// diff --git a/src/libs/Together/Generated/Together.IImagesClient.CreateImagesGenerations.g.cs b/src/libs/Together/Generated/Together.IImagesClient.CreateImagesGenerations.g.cs index 25dbbd17..c747aae3 100644 --- a/src/libs/Together/Generated/Together.IImagesClient.CreateImagesGenerations.g.cs +++ b/src/libs/Together/Generated/Together.IImagesClient.CreateImagesGenerations.g.cs @@ -12,6 +12,18 @@ public partial interface IImagesClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.images.generate(
+ /// model="black-forest-labs/FLUX.2-dev",
+ /// prompt="A cartoon of an astronaut riding a horse on the moon",
+ /// )
+ /// print(response.data[0].url) + ///
global::System.Threading.Tasks.Task CreateImagesGenerationsAsync( global::Together.CreateImagesGenerationsRequest request, @@ -25,6 +37,18 @@ public partial interface IImagesClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.images.generate(
+ /// model="black-forest-labs/FLUX.2-dev",
+ /// prompt="A cartoon of an astronaut riding a horse on the moon",
+ /// )
+ /// print(response.data[0].url) + ///
global::System.Threading.Tasks.Task> CreateImagesGenerationsAsResponseAsync( global::Together.CreateImagesGenerationsRequest request, diff --git a/src/libs/Together/Generated/Together.IImagesClient.g.cs b/src/libs/Together/Generated/Together.IImagesClient.g.cs index de75de61..8bbc4e8c 100644 --- a/src/libs/Together/Generated/Together.IImagesClient.g.cs +++ b/src/libs/Together/Generated/Together.IImagesClient.g.cs @@ -19,6 +19,27 @@ public partial interface IImagesClient : global::System.IDisposable /// public System.Uri? BaseUri { get; } + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers { get; } + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer { get; set; } + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId); + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer(); + /// /// The authorizations to use for the requests. /// diff --git a/src/libs/Together/Generated/Together.IInstanceClusterAddOnServiceClient.g.cs b/src/libs/Together/Generated/Together.IInstanceClusterAddOnServiceClient.g.cs index 2bacd58f..6b944715 100644 --- a/src/libs/Together/Generated/Together.IInstanceClusterAddOnServiceClient.g.cs +++ b/src/libs/Together/Generated/Together.IInstanceClusterAddOnServiceClient.g.cs @@ -19,6 +19,27 @@ public partial interface IInstanceClusterAddOnServiceClient : global::System.IDi /// public System.Uri? BaseUri { get; } + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers { get; } + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer { get; set; } + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId); + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer(); + /// /// The authorizations to use for the requests. /// diff --git a/src/libs/Together/Generated/Together.IInstanceTypeServiceClient.InstanceTypeServiceGetInferenceInstanceType.g.cs b/src/libs/Together/Generated/Together.IInstanceTypeServiceClient.InstanceTypeServiceGetInferenceInstanceType.g.cs index 8fb65e5f..9bf9fc04 100644 --- a/src/libs/Together/Generated/Together.IInstanceTypeServiceClient.InstanceTypeServiceGetInferenceInstanceType.g.cs +++ b/src/libs/Together/Generated/Together.IInstanceTypeServiceClient.InstanceTypeServiceGetInferenceInstanceType.g.cs @@ -14,6 +14,12 @@ public partial interface IInstanceTypeServiceClient /// 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()
+ /// instance_type = client.beta.endpoints.hardware.retrieve("ins_abc123")
+ /// print(instance_type.name, instance_type.regions) + ///
global::System.Threading.Tasks.Task InstanceTypeServiceGetInferenceInstanceTypeAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -28,6 +34,12 @@ public partial interface IInstanceTypeServiceClient /// 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()
+ /// instance_type = client.beta.endpoints.hardware.retrieve("ins_abc123")
+ /// print(instance_type.name, instance_type.regions) + ///
global::System.Threading.Tasks.Task> InstanceTypeServiceGetInferenceInstanceTypeAsResponseAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, diff --git a/src/libs/Together/Generated/Together.IInstanceTypeServiceClient.InstanceTypeServiceListInferenceInstanceTypes.g.cs b/src/libs/Together/Generated/Together.IInstanceTypeServiceClient.InstanceTypeServiceListInferenceInstanceTypes.g.cs index 27061ac8..f3ce1d28 100644 --- a/src/libs/Together/Generated/Together.IInstanceTypeServiceClient.InstanceTypeServiceListInferenceInstanceTypes.g.cs +++ b/src/libs/Together/Generated/Together.IInstanceTypeServiceClient.InstanceTypeServiceListInferenceInstanceTypes.g.cs @@ -11,6 +11,13 @@ public partial interface IInstanceTypeServiceClient /// 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()
+ /// instance_types = client.beta.endpoints.hardware.list()
+ /// for instance_type in instance_types.data:
+ /// print(instance_type.name, instance_type.price_cents_per_hour) + ///
global::System.Threading.Tasks.Task InstanceTypeServiceListInferenceInstanceTypesAsync( global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); @@ -21,6 +28,13 @@ public partial interface IInstanceTypeServiceClient /// 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()
+ /// instance_types = client.beta.endpoints.hardware.list()
+ /// for instance_type in instance_types.data:
+ /// print(instance_type.name, instance_type.price_cents_per_hour) + ///
global::System.Threading.Tasks.Task> InstanceTypeServiceListInferenceInstanceTypesAsResponseAsync( global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); diff --git a/src/libs/Together/Generated/Together.IJobsClient.GetJob.g.cs b/src/libs/Together/Generated/Together.IJobsClient.GetJob.g.cs new file mode 100644 index 00000000..463a9f13 --- /dev/null +++ b/src/libs/Together/Generated/Together.IJobsClient.GetJob.g.cs @@ -0,0 +1,50 @@ +#nullable enable + +namespace Together +{ + public partial interface IJobsClient + { + /// + /// Get job status
+ /// Get the status of a specific job + ///
+ /// + /// The ID of the job to retrieve
+ /// Example: job-a15dad11-8d8e-4007-97c5-a211304de284 + /// + /// 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()
+ /// status = client.models.uploads.status("<JOB_ID>")
+ /// print(status) + ///
+ global::System.Threading.Tasks.Task GetJobAsync( + string jobId, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get job status
+ /// Get the status of a specific job + ///
+ /// + /// The ID of the job to retrieve
+ /// Example: job-a15dad11-8d8e-4007-97c5-a211304de284 + /// + /// 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()
+ /// status = client.models.uploads.status("<JOB_ID>")
+ /// print(status) + ///
+ global::System.Threading.Tasks.Task> GetJobAsResponseAsync( + string jobId, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IJobsClient.ListJobs.g.cs b/src/libs/Together/Generated/Together.IJobsClient.ListJobs.g.cs new file mode 100644 index 00000000..0163437e --- /dev/null +++ b/src/libs/Together/Generated/Together.IJobsClient.ListJobs.g.cs @@ -0,0 +1,44 @@ +#nullable enable + +namespace Together +{ + public partial interface IJobsClient + { + /// + /// List all jobs
+ /// List all jobs and their statuses + ///
+ /// 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()
+ /// # The SDK has no dedicated method for this endpoint yet, so call it with
+ /// # the client's generic GET helper.
+ /// jobs = client.get("/jobs", cast_to=object)
+ /// print(jobs) + ///
+ global::System.Threading.Tasks.Task ListJobsAsync( + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List all jobs
+ /// List all jobs and their statuses + ///
+ /// 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()
+ /// # The SDK has no dedicated method for this endpoint yet, so call it with
+ /// # the client's generic GET helper.
+ /// jobs = client.get("/jobs", cast_to=object)
+ /// print(jobs) + ///
+ global::System.Threading.Tasks.Task> ListJobsAsResponseAsync( + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IJobsClient.g.cs b/src/libs/Together/Generated/Together.IJobsClient.g.cs new file mode 100644 index 00000000..ee96c3c7 --- /dev/null +++ b/src/libs/Together/Generated/Together.IJobsClient.g.cs @@ -0,0 +1,73 @@ + +#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 partial interface IJobsClient : global::System.IDisposable + { + /// + /// The HttpClient instance. + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + /// The base URL for the API. + /// + public System.Uri? BaseUri { get; } + + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers { get; } + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer { get; set; } + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId); + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer(); + + /// + /// The authorizations to use for the requests. + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + /// Gets or sets a value indicating whether the response content should be read as a string. + /// True by default in debug builds, false otherwise. + /// When false, successful responses are deserialized directly from the response stream for better performance. + /// Error responses are always read as strings regardless of this setting, + /// ensuring is populated. + /// + public bool ReadResponseAsString { get; set; } + /// + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// + public global::Together.AutoSDKClientOptions Options { get; } + + /// + /// Creates idempotency keys for generated idempotent requests when the caller does not provide one. + /// + public global::System.Func CreateIdempotencyKey { get; set; } + + /// + /// + /// + global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } + + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IModelsClient.Models.g.cs b/src/libs/Together/Generated/Together.IModelsClient.Models.g.cs new file mode 100644 index 00000000..aa54d94e --- /dev/null +++ b/src/libs/Together/Generated/Together.IModelsClient.Models.g.cs @@ -0,0 +1,56 @@ +#nullable enable + +namespace Together +{ + public partial interface IModelsClient + { + /// + /// List all models
+ /// Lists all of Together's open-source models and metadata including pricing, chat template, and context. + ///
+ /// + /// Filter models to only return dedicated models + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// models = client.models.list()
+ /// for model in models:
+ /// print(model.id) + ///
+ global::System.Threading.Tasks.Task> ModelsAsync( + bool? dedicated = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List all models
+ /// Lists all of Together's open-source models and metadata including pricing, chat template, and context. + ///
+ /// + /// Filter models to only return dedicated models + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// models = client.models.list()
+ /// for model in models:
+ /// print(model.id) + ///
+ global::System.Threading.Tasks.Task>> ModelsAsResponseAsync( + bool? dedicated = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IModelsClient.UploadModel.g.cs b/src/libs/Together/Generated/Together.IModelsClient.UploadModel.g.cs new file mode 100644 index 00000000..6eec8596 --- /dev/null +++ b/src/libs/Together/Generated/Together.IModelsClient.UploadModel.g.cs @@ -0,0 +1,104 @@ +#nullable enable + +namespace Together +{ + public partial interface IModelsClient + { + /// + /// Upload a custom model or adapter
+ /// Upload a custom model or adapter from Hugging Face or S3 + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.models.upload(
+ /// model_name="My-Fine-Tuned-Model",
+ /// model_source="https://ml-models.s3.us-west-2.amazonaws.com/models/my-fine-tuned-model.tar.gz",
+ /// )
+ /// print(response.data.job_id) + ///
+ global::System.Threading.Tasks.Task UploadModelAsync( + + global::Together.ModelUploadRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Upload a custom model or adapter
+ /// Upload a custom model or adapter from Hugging Face or S3 + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.models.upload(
+ /// model_name="My-Fine-Tuned-Model",
+ /// model_source="https://ml-models.s3.us-west-2.amazonaws.com/models/my-fine-tuned-model.tar.gz",
+ /// )
+ /// print(response.data.job_id) + ///
+ global::System.Threading.Tasks.Task> UploadModelAsResponseAsync( + + global::Together.ModelUploadRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Upload a custom model or adapter
+ /// Upload a custom model or adapter from Hugging Face or S3 + ///
+ /// + /// The name to give to your uploaded model
+ /// Example: Qwen2.5-72B-Instruct + /// + /// + /// The source location of the model (Hugging Face repo or S3 path)
+ /// Example: unsloth/Qwen2.5-72B-Instruct + /// + /// + /// Whether the model is a full model or an adapter
+ /// Default Value: model
+ /// Example: model + /// + /// + /// Hugging Face token (if uploading from Hugging Face)
+ /// Example: hf_examplehuggingfacetoken + /// + /// + /// A description of your model
+ /// Example: Finetuned Qwen2.5-72B-Instruct by Unsloth + /// + /// + /// The base model to use for an adapter if setting it to run against a serverless pool. Only used for model_type `adapter`.
+ /// Example: Qwen/Qwen2.5-72B-Instruct + /// + /// + /// The lora pool to use for an adapter if setting it to run against, say, a dedicated pool. Only used for model_type `adapter`.
+ /// Example: my_username/Qwen2.5-72B-Instruct-lora + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task UploadModelAsync( + string modelName, + string modelSource, + global::Together.ModelUploadRequestModelType? modelType = default, + string? hfToken = default, + string? description = default, + string? baseModel = default, + string? loraModel = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IModelsClient.g.cs b/src/libs/Together/Generated/Together.IModelsClient.g.cs new file mode 100644 index 00000000..a7dc2dbf --- /dev/null +++ b/src/libs/Together/Generated/Together.IModelsClient.g.cs @@ -0,0 +1,73 @@ + +#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 partial interface IModelsClient : global::System.IDisposable + { + /// + /// The HttpClient instance. + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + /// The base URL for the API. + /// + public System.Uri? BaseUri { get; } + + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers { get; } + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer { get; set; } + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId); + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer(); + + /// + /// The authorizations to use for the requests. + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + /// Gets or sets a value indicating whether the response content should be read as a string. + /// True by default in debug builds, false otherwise. + /// When false, successful responses are deserialized directly from the response stream for better performance. + /// Error responses are always read as strings regardless of this setting, + /// ensuring is populated. + /// + public bool ReadResponseAsString { get; set; } + /// + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// + public global::Together.AutoSDKClientOptions Options { get; } + + /// + /// Creates idempotency keys for generated idempotent requests when the caller does not provide one. + /// + public global::System.Func CreateIdempotencyKey { get; set; } + + /// + /// + /// + global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } + + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.IPlacementProfileServiceClient.PlacementProfileServiceGetPlacementProfile.g.cs b/src/libs/Together/Generated/Together.IPlacementProfileServiceClient.PlacementProfileServiceGetPlacementProfile.g.cs index 56ee544b..90893700 100644 --- a/src/libs/Together/Generated/Together.IPlacementProfileServiceClient.PlacementProfileServiceGetPlacementProfile.g.cs +++ b/src/libs/Together/Generated/Together.IPlacementProfileServiceClient.PlacementProfileServiceGetPlacementProfile.g.cs @@ -17,6 +17,16 @@ public partial interface IPlacementProfileServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// profile = client.beta.endpoints.placement_profiles.retrieve(
+ /// "pp_abc123",
+ /// project_id=project_id,
+ /// )
+ /// print(profile.name) + ///
global::System.Threading.Tasks.Task PlacementProfileServiceGetPlacementProfileAsync( string projectId, string id, @@ -35,6 +45,16 @@ public partial interface IPlacementProfileServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// profile = client.beta.endpoints.placement_profiles.retrieve(
+ /// "pp_abc123",
+ /// project_id=project_id,
+ /// )
+ /// print(profile.name) + ///
global::System.Threading.Tasks.Task> PlacementProfileServiceGetPlacementProfileAsResponseAsync( string projectId, string id, diff --git a/src/libs/Together/Generated/Together.IPlacementProfileServiceClient.PlacementProfileServiceListPlacementProfiles.g.cs b/src/libs/Together/Generated/Together.IPlacementProfileServiceClient.PlacementProfileServiceListPlacementProfiles.g.cs index 2eacf5b3..c2178771 100644 --- a/src/libs/Together/Generated/Together.IPlacementProfileServiceClient.PlacementProfileServiceListPlacementProfiles.g.cs +++ b/src/libs/Together/Generated/Together.IPlacementProfileServiceClient.PlacementProfileServiceListPlacementProfiles.g.cs @@ -20,6 +20,16 @@ public partial interface IPlacementProfileServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// profiles = client.beta.endpoints.placement_profiles.list(
+ /// project_id=project_id,
+ /// )
+ /// for profile in profiles:
+ /// print(profile.id, profile.name) + ///
global::System.Threading.Tasks.Task PlacementProfileServiceListPlacementProfilesAsync( string projectId, int? limit = default, @@ -42,6 +52,16 @@ public partial interface IPlacementProfileServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// profiles = client.beta.endpoints.placement_profiles.list(
+ /// project_id=project_id,
+ /// )
+ /// for profile in profiles:
+ /// print(profile.id, profile.name) + ///
global::System.Threading.Tasks.Task> PlacementProfileServiceListPlacementProfilesAsResponseAsync( string projectId, int? limit = default, diff --git a/src/libs/Together/Generated/Together.IProjectsClient.ListProjects.g.cs b/src/libs/Together/Generated/Together.IProjectsClient.ListProjects.g.cs index 898dee5b..2b2d76d5 100644 --- a/src/libs/Together/Generated/Together.IProjectsClient.ListProjects.g.cs +++ b/src/libs/Together/Generated/Together.IProjectsClient.ListProjects.g.cs @@ -17,6 +17,12 @@ public partial interface IProjectsClient /// 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()
+ /// for project in client.projects.list():
+ /// print(project.id, project.name, project.slug) + ///
global::System.Threading.Tasks.Task ListProjectsAsync( int? limit = default, string? after = default, @@ -35,6 +41,12 @@ public partial interface IProjectsClient /// 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()
+ /// for project in client.projects.list():
+ /// print(project.id, project.name, project.slug) + ///
global::System.Threading.Tasks.Task> ListProjectsAsResponseAsync( int? limit = default, string? after = default, diff --git a/src/libs/Together/Generated/Together.IProjectsClient.g.cs b/src/libs/Together/Generated/Together.IProjectsClient.g.cs index c3fd683e..974bdbaa 100644 --- a/src/libs/Together/Generated/Together.IProjectsClient.g.cs +++ b/src/libs/Together/Generated/Together.IProjectsClient.g.cs @@ -19,6 +19,27 @@ public partial interface IProjectsClient : global::System.IDisposable /// public System.Uri? BaseUri { get; } + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers { get; } + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer { get; set; } + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId); + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer(); + /// /// The authorizations to use for the requests. /// diff --git a/src/libs/Together/Generated/Together.IQueueClient.CancelQueueJob.g.cs b/src/libs/Together/Generated/Together.IQueueClient.CancelQueueJob.g.cs index 1726b987..83602a95 100644 --- a/src/libs/Together/Generated/Together.IQueueClient.CancelQueueJob.g.cs +++ b/src/libs/Together/Generated/Together.IQueueClient.CancelQueueJob.g.cs @@ -15,6 +15,15 @@ public partial interface IQueueClient /// 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()
+ /// job = client.beta.jig.queue.cancel(
+ /// model="my-deployment",
+ /// request_id="req_abc123",
+ /// )
+ /// print(job.status) + ///
global::System.Threading.Tasks.Task CancelQueueJobAsync( global::Together.QueueCancelRequest request, @@ -31,6 +40,15 @@ public partial interface IQueueClient /// 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()
+ /// job = client.beta.jig.queue.cancel(
+ /// model="my-deployment",
+ /// request_id="req_abc123",
+ /// )
+ /// print(job.status) + ///
global::System.Threading.Tasks.Task> CancelQueueJobAsResponseAsync( global::Together.QueueCancelRequest request, diff --git a/src/libs/Together/Generated/Together.IQueueClient.ClearQueue.g.cs b/src/libs/Together/Generated/Together.IQueueClient.ClearQueue.g.cs index 29516bca..361273ff 100644 --- a/src/libs/Together/Generated/Together.IQueueClient.ClearQueue.g.cs +++ b/src/libs/Together/Generated/Together.IQueueClient.ClearQueue.g.cs @@ -12,6 +12,12 @@ public partial interface IQueueClient /// 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()
+ /// result = client.beta.jig.queue.clear(model="my-deployment")
+ /// print(result) + ///
global::System.Threading.Tasks.Task ClearQueueAsync( global::Together.QueueClearRequest request, @@ -25,6 +31,12 @@ public partial interface IQueueClient /// 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()
+ /// result = client.beta.jig.queue.clear(model="my-deployment")
+ /// print(result) + ///
global::System.Threading.Tasks.Task> ClearQueueAsResponseAsync( global::Together.QueueClearRequest request, diff --git a/src/libs/Together/Generated/Together.IQueueClient.GetQueueJobStatus.g.cs b/src/libs/Together/Generated/Together.IQueueClient.GetQueueJobStatus.g.cs index ddbc5e50..bc35e877 100644 --- a/src/libs/Together/Generated/Together.IQueueClient.GetQueueJobStatus.g.cs +++ b/src/libs/Together/Generated/Together.IQueueClient.GetQueueJobStatus.g.cs @@ -17,6 +17,15 @@ public partial interface IQueueClient /// 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()
+ /// job = client.beta.jig.queue.retrieve(
+ /// model="my-deployment",
+ /// request_id="req_abc123",
+ /// )
+ /// print(job.status) + ///
global::System.Threading.Tasks.Task GetQueueJobStatusAsync( string requestId, string model, @@ -35,6 +44,15 @@ public partial interface IQueueClient /// 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()
+ /// job = client.beta.jig.queue.retrieve(
+ /// model="my-deployment",
+ /// request_id="req_abc123",
+ /// )
+ /// print(job.status) + ///
global::System.Threading.Tasks.Task> GetQueueJobStatusAsResponseAsync( string requestId, string model, diff --git a/src/libs/Together/Generated/Together.IQueueClient.GetQueueMetrics.g.cs b/src/libs/Together/Generated/Together.IQueueClient.GetQueueMetrics.g.cs index 4a19c1fa..ab760563 100644 --- a/src/libs/Together/Generated/Together.IQueueClient.GetQueueMetrics.g.cs +++ b/src/libs/Together/Generated/Together.IQueueClient.GetQueueMetrics.g.cs @@ -14,6 +14,12 @@ public partial interface IQueueClient /// 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()
+ /// metrics = client.beta.jig.queue.metrics(model="my-deployment")
+ /// print(metrics) + ///
global::System.Threading.Tasks.Task GetQueueMetricsAsync( string model, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -28,6 +34,12 @@ public partial interface IQueueClient /// 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()
+ /// metrics = client.beta.jig.queue.metrics(model="my-deployment")
+ /// print(metrics) + ///
global::System.Threading.Tasks.Task> GetQueueMetricsAsResponseAsync( string model, global::Together.AutoSDKRequestOptions? requestOptions = default, diff --git a/src/libs/Together/Generated/Together.IQueueClient.SubmitQueueJob.g.cs b/src/libs/Together/Generated/Together.IQueueClient.SubmitQueueJob.g.cs index 31931478..613b18a9 100644 --- a/src/libs/Together/Generated/Together.IQueueClient.SubmitQueueJob.g.cs +++ b/src/libs/Together/Generated/Together.IQueueClient.SubmitQueueJob.g.cs @@ -15,6 +15,16 @@ public partial interface IQueueClient /// 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()
+ /// job = client.beta.jig.queue.submit(
+ /// model="my-deployment",
+ /// payload={"prompt": "A cat playing piano"},
+ /// priority=1,
+ /// )
+ /// print(job.request_id) + ///
global::System.Threading.Tasks.Task SubmitQueueJobAsync( global::Together.QueueJobRequest request, @@ -31,6 +41,16 @@ public partial interface IQueueClient /// 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()
+ /// job = client.beta.jig.queue.submit(
+ /// model="my-deployment",
+ /// payload={"prompt": "A cat playing piano"},
+ /// priority=1,
+ /// )
+ /// print(job.request_id) + ///
global::System.Threading.Tasks.Task> SubmitQueueJobAsResponseAsync( global::Together.QueueJobRequest request, diff --git a/src/libs/Together/Generated/Together.IQueueClient.g.cs b/src/libs/Together/Generated/Together.IQueueClient.g.cs index 9b796b07..05e543b8 100644 --- a/src/libs/Together/Generated/Together.IQueueClient.g.cs +++ b/src/libs/Together/Generated/Together.IQueueClient.g.cs @@ -19,6 +19,27 @@ public partial interface IQueueClient : global::System.IDisposable /// public System.Uri? BaseUri { get; } + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers { get; } + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer { get; set; } + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId); + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer(); + /// /// The authorizations to use for the requests. /// diff --git a/src/libs/Together/Generated/Together.IRegionServiceClient.RegionServiceList.g.cs b/src/libs/Together/Generated/Together.IRegionServiceClient.RegionServiceList.g.cs index 3591602b..738c7097 100644 --- a/src/libs/Together/Generated/Together.IRegionServiceClient.RegionServiceList.g.cs +++ b/src/libs/Together/Generated/Together.IRegionServiceClient.RegionServiceList.g.cs @@ -10,6 +10,12 @@ public partial interface IRegionServiceClient /// 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()
+ /// regions = client.beta.clusters.list_regions()
+ /// print(regions) + ///
global::System.Threading.Tasks.Task RegionServiceListAsync( global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); @@ -19,6 +25,12 @@ public partial interface IRegionServiceClient /// 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()
+ /// regions = client.beta.clusters.list_regions()
+ /// print(regions) + ///
global::System.Threading.Tasks.Task> RegionServiceListAsResponseAsync( global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); diff --git a/src/libs/Together/Generated/Together.IRegionServiceClient.g.cs b/src/libs/Together/Generated/Together.IRegionServiceClient.g.cs index b814ecb6..77d821ed 100644 --- a/src/libs/Together/Generated/Together.IRegionServiceClient.g.cs +++ b/src/libs/Together/Generated/Together.IRegionServiceClient.g.cs @@ -19,6 +19,27 @@ public partial interface IRegionServiceClient : global::System.IDisposable /// public System.Uri? BaseUri { get; } + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers { get; } + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer { get; set; } + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId); + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer(); + /// /// The authorizations to use for the requests. /// diff --git a/src/libs/Together/Generated/Together.IRemediationServiceClient.RemediationServiceApproveRemediation.g.cs b/src/libs/Together/Generated/Together.IRemediationServiceClient.RemediationServiceApproveRemediation.g.cs index c6c834d5..13b9ddd5 100644 --- a/src/libs/Together/Generated/Together.IRemediationServiceClient.RemediationServiceApproveRemediation.g.cs +++ b/src/libs/Together/Generated/Together.IRemediationServiceClient.RemediationServiceApproveRemediation.g.cs @@ -18,6 +18,17 @@ public partial interface IRemediationServiceClient /// 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()
+ /// remediation = client.clusters.remediations.approve(
+ /// "<REMEDIATION_ID>",
+ /// cluster_id="<CLUSTER_ID>",
+ /// instance_id="<INSTANCE_ID>",
+ /// comment="Approved after checking the node",
+ /// )
+ /// print(remediation.state) + ///
global::System.Threading.Tasks.Task RemediationServiceApproveRemediationAsync( string clusterId, string instanceId, @@ -40,6 +51,17 @@ public partial interface IRemediationServiceClient /// 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()
+ /// remediation = client.clusters.remediations.approve(
+ /// "<REMEDIATION_ID>",
+ /// cluster_id="<CLUSTER_ID>",
+ /// instance_id="<INSTANCE_ID>",
+ /// comment="Approved after checking the node",
+ /// )
+ /// print(remediation.state) + ///
global::System.Threading.Tasks.Task> RemediationServiceApproveRemediationAsResponseAsync( string clusterId, string instanceId, diff --git a/src/libs/Together/Generated/Together.IRemediationServiceClient.RemediationServiceCancelRemediation.g.cs b/src/libs/Together/Generated/Together.IRemediationServiceClient.RemediationServiceCancelRemediation.g.cs index 11e1426b..3731de69 100644 --- a/src/libs/Together/Generated/Together.IRemediationServiceClient.RemediationServiceCancelRemediation.g.cs +++ b/src/libs/Together/Generated/Together.IRemediationServiceClient.RemediationServiceCancelRemediation.g.cs @@ -20,6 +20,16 @@ public partial interface IRemediationServiceClient /// 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()
+ /// remediation = client.clusters.remediations.cancel(
+ /// "<REMEDIATION_ID>",
+ /// cluster_id="<CLUSTER_ID>",
+ /// instance_id="<INSTANCE_ID>",
+ /// )
+ /// print(remediation.state) + ///
global::System.Threading.Tasks.Task RemediationServiceCancelRemediationAsync( string clusterId, string instanceId, @@ -42,6 +52,16 @@ public partial interface IRemediationServiceClient /// 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()
+ /// remediation = client.clusters.remediations.cancel(
+ /// "<REMEDIATION_ID>",
+ /// cluster_id="<CLUSTER_ID>",
+ /// instance_id="<INSTANCE_ID>",
+ /// )
+ /// print(remediation.state) + ///
global::System.Threading.Tasks.Task> RemediationServiceCancelRemediationAsResponseAsync( string clusterId, string instanceId, diff --git a/src/libs/Together/Generated/Together.IRemediationServiceClient.RemediationServiceCreateRemediation.g.cs b/src/libs/Together/Generated/Together.IRemediationServiceClient.RemediationServiceCreateRemediation.g.cs index 6353443b..6d505732 100644 --- a/src/libs/Together/Generated/Together.IRemediationServiceClient.RemediationServiceCreateRemediation.g.cs +++ b/src/libs/Together/Generated/Together.IRemediationServiceClient.RemediationServiceCreateRemediation.g.cs @@ -20,6 +20,17 @@ public partial interface IRemediationServiceClient /// 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()
+ /// remediation = client.clusters.remediations.create(
+ /// "<INSTANCE_ID>",
+ /// cluster_id="<CLUSTER_ID>",
+ /// mode="REMEDIATION_MODE_VM_ONLY",
+ /// reason="Repeated GPU Xid errors",
+ /// )
+ /// print(remediation.id, remediation.state) + ///
global::System.Threading.Tasks.Task RemediationServiceCreateRemediationAsync( string clusterId, string instanceId, @@ -44,6 +55,17 @@ public partial interface IRemediationServiceClient /// 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()
+ /// remediation = client.clusters.remediations.create(
+ /// "<INSTANCE_ID>",
+ /// cluster_id="<CLUSTER_ID>",
+ /// mode="REMEDIATION_MODE_VM_ONLY",
+ /// reason="Repeated GPU Xid errors",
+ /// )
+ /// print(remediation.id, remediation.state) + ///
global::System.Threading.Tasks.Task> RemediationServiceCreateRemediationAsResponseAsync( string clusterId, string instanceId, diff --git a/src/libs/Together/Generated/Together.IRemediationServiceClient.RemediationServiceGetRemediation.g.cs b/src/libs/Together/Generated/Together.IRemediationServiceClient.RemediationServiceGetRemediation.g.cs index 653ca05d..78e4a57a 100644 --- a/src/libs/Together/Generated/Together.IRemediationServiceClient.RemediationServiceGetRemediation.g.cs +++ b/src/libs/Together/Generated/Together.IRemediationServiceClient.RemediationServiceGetRemediation.g.cs @@ -13,6 +13,16 @@ public partial interface IRemediationServiceClient /// 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()
+ /// remediation = client.clusters.remediations.retrieve(
+ /// "<REMEDIATION_ID>",
+ /// cluster_id="<CLUSTER_ID>",
+ /// instance_id="<INSTANCE_ID>",
+ /// )
+ /// print(remediation.state) + ///
global::System.Threading.Tasks.Task RemediationServiceGetRemediationAsync( string clusterId, string instanceId, @@ -28,6 +38,16 @@ public partial interface IRemediationServiceClient /// 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()
+ /// remediation = client.clusters.remediations.retrieve(
+ /// "<REMEDIATION_ID>",
+ /// cluster_id="<CLUSTER_ID>",
+ /// instance_id="<INSTANCE_ID>",
+ /// )
+ /// print(remediation.state) + ///
global::System.Threading.Tasks.Task> RemediationServiceGetRemediationAsResponseAsync( string clusterId, string instanceId, diff --git a/src/libs/Together/Generated/Together.IRemediationServiceClient.RemediationServiceListRemediations.g.cs b/src/libs/Together/Generated/Together.IRemediationServiceClient.RemediationServiceListRemediations.g.cs index fa22fb15..97161b9a 100644 --- a/src/libs/Together/Generated/Together.IRemediationServiceClient.RemediationServiceListRemediations.g.cs +++ b/src/libs/Together/Generated/Together.IRemediationServiceClient.RemediationServiceListRemediations.g.cs @@ -43,6 +43,17 @@ public partial interface IRemediationServiceClient /// 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()
+ /// # Pass "-" as the instance ID to list remediations across the cluster.
+ /// response = client.clusters.remediations.list(
+ /// "-",
+ /// cluster_id="<CLUSTER_ID>",
+ /// )
+ /// for remediation in response.remediations or []:
+ /// print(remediation.id, remediation.instance_id, remediation.state) + ///
global::System.Threading.Tasks.Task RemediationServiceListRemediationsAsync( string clusterId, string instanceId, @@ -93,6 +104,17 @@ public partial interface IRemediationServiceClient /// 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()
+ /// # Pass "-" as the instance ID to list remediations across the cluster.
+ /// response = client.clusters.remediations.list(
+ /// "-",
+ /// cluster_id="<CLUSTER_ID>",
+ /// )
+ /// for remediation in response.remediations or []:
+ /// print(remediation.id, remediation.instance_id, remediation.state) + ///
global::System.Threading.Tasks.Task> RemediationServiceListRemediationsAsResponseAsync( string clusterId, string instanceId, diff --git a/src/libs/Together/Generated/Together.IRemediationServiceClient.RemediationServiceRejectRemediation.g.cs b/src/libs/Together/Generated/Together.IRemediationServiceClient.RemediationServiceRejectRemediation.g.cs index 19e92980..05e340c8 100644 --- a/src/libs/Together/Generated/Together.IRemediationServiceClient.RemediationServiceRejectRemediation.g.cs +++ b/src/libs/Together/Generated/Together.IRemediationServiceClient.RemediationServiceRejectRemediation.g.cs @@ -18,6 +18,17 @@ public partial interface IRemediationServiceClient /// 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()
+ /// remediation = client.clusters.remediations.reject(
+ /// "<REMEDIATION_ID>",
+ /// cluster_id="<CLUSTER_ID>",
+ /// instance_id="<INSTANCE_ID>",
+ /// comment="Node recovered on its own",
+ /// )
+ /// print(remediation.state) + ///
global::System.Threading.Tasks.Task RemediationServiceRejectRemediationAsync( string clusterId, string instanceId, @@ -40,6 +51,17 @@ public partial interface IRemediationServiceClient /// 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()
+ /// remediation = client.clusters.remediations.reject(
+ /// "<REMEDIATION_ID>",
+ /// cluster_id="<CLUSTER_ID>",
+ /// instance_id="<INSTANCE_ID>",
+ /// comment="Node recovered on its own",
+ /// )
+ /// print(remediation.state) + ///
global::System.Threading.Tasks.Task> RemediationServiceRejectRemediationAsResponseAsync( string clusterId, string instanceId, diff --git a/src/libs/Together/Generated/Together.IRemediationServiceClient.g.cs b/src/libs/Together/Generated/Together.IRemediationServiceClient.g.cs index 4734afe6..2066692a 100644 --- a/src/libs/Together/Generated/Together.IRemediationServiceClient.g.cs +++ b/src/libs/Together/Generated/Together.IRemediationServiceClient.g.cs @@ -19,6 +19,27 @@ public partial interface IRemediationServiceClient : global::System.IDisposable /// public System.Uri? BaseUri { get; } + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers { get; } + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer { get; set; } + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId); + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer(); + /// /// The authorizations to use for the requests. /// diff --git a/src/libs/Together/Generated/Together.IRerankClient.Rerank.g.cs b/src/libs/Together/Generated/Together.IRerankClient.Rerank.g.cs index 7bcb24fc..7ab5cf59 100644 --- a/src/libs/Together/Generated/Together.IRerankClient.Rerank.g.cs +++ b/src/libs/Together/Generated/Together.IRerankClient.Rerank.g.cs @@ -12,6 +12,40 @@ public partial interface IRerankClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// documents = [
+ /// {
+ /// "title": "Llama",
+ /// "text": "The llama is a domesticated South American camelid, widely used as a meat and pack animal by Andean cultures since the pre-Columbian era."
+ /// },
+ /// {
+ /// "title": "Panda",
+ /// "text": "The giant panda (Ailuropoda melanoleuca), also known as the panda bear or simply panda, is a bear species endemic to China."
+ /// },
+ /// {
+ /// "title": "Guanaco",
+ /// "text": "The guanaco is a camelid native to South America, closely related to the llama. Guanacos are one of two wild South American camelids; the other species is the vicuña, which lives at higher elevations."
+ /// },
+ /// {
+ /// "title": "Wild Bactrian camel",
+ /// "text": "The wild Bactrian camel (Camelus ferus) is an endangered species of camel endemic to Northwest China and southwestern Mongolia."
+ /// }
+ /// ]
+ /// response = client.rerank.create(
+ /// model="mixedbread-ai/mxbai-rerank-large-v2",
+ /// query="What animals can I find near Peru?",
+ /// documents=documents,
+ /// )
+ /// for result in response.results:
+ /// print(f"Rank: {result.index + 1}")
+ /// print(f"Title: {documents[result.index]['title']}")
+ /// print(f"Text: {documents[result.index]['text']}") + ///
global::System.Threading.Tasks.Task RerankAsync( global::Together.RerankRequest request, @@ -25,6 +59,40 @@ public partial interface IRerankClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// documents = [
+ /// {
+ /// "title": "Llama",
+ /// "text": "The llama is a domesticated South American camelid, widely used as a meat and pack animal by Andean cultures since the pre-Columbian era."
+ /// },
+ /// {
+ /// "title": "Panda",
+ /// "text": "The giant panda (Ailuropoda melanoleuca), also known as the panda bear or simply panda, is a bear species endemic to China."
+ /// },
+ /// {
+ /// "title": "Guanaco",
+ /// "text": "The guanaco is a camelid native to South America, closely related to the llama. Guanacos are one of two wild South American camelids; the other species is the vicuña, which lives at higher elevations."
+ /// },
+ /// {
+ /// "title": "Wild Bactrian camel",
+ /// "text": "The wild Bactrian camel (Camelus ferus) is an endangered species of camel endemic to Northwest China and southwestern Mongolia."
+ /// }
+ /// ]
+ /// response = client.rerank.create(
+ /// model="mixedbread-ai/mxbai-rerank-large-v2",
+ /// query="What animals can I find near Peru?",
+ /// documents=documents,
+ /// )
+ /// for result in response.results:
+ /// print(f"Rank: {result.index + 1}")
+ /// print(f"Title: {documents[result.index]['title']}")
+ /// print(f"Text: {documents[result.index]['text']}") + ///
global::System.Threading.Tasks.Task> RerankAsResponseAsync( global::Together.RerankRequest request, diff --git a/src/libs/Together/Generated/Together.IRerankClient.g.cs b/src/libs/Together/Generated/Together.IRerankClient.g.cs index 6cf234bf..37a64536 100644 --- a/src/libs/Together/Generated/Together.IRerankClient.g.cs +++ b/src/libs/Together/Generated/Together.IRerankClient.g.cs @@ -19,6 +19,27 @@ public partial interface IRerankClient : global::System.IDisposable /// public System.Uri? BaseUri { get; } + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers { get; } + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer { get; set; } + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId); + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer(); + /// /// The authorizations to use for the requests. /// diff --git a/src/libs/Together/Generated/Together.IRlClient.CreateInferenceCheckpoint.g.cs b/src/libs/Together/Generated/Together.IRlClient.CreateInferenceCheckpoint.g.cs index 55604e96..b22a9529 100644 --- a/src/libs/Together/Generated/Together.IRlClient.CreateInferenceCheckpoint.g.cs +++ b/src/libs/Together/Generated/Together.IRlClient.CreateInferenceCheckpoint.g.cs @@ -17,6 +17,16 @@ public partial interface IRlClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// import uuid
+ /// from together import Together
+ /// client = Together()
+ /// operation = client.post_training.operations.create_inference_checkpoint(
+ /// "<SESSION_ID>",
+ /// idempotency_key=str(uuid.uuid4()),
+ /// )
+ /// print(operation.id, operation.status) + ///
global::System.Threading.Tasks.Task CreateInferenceCheckpointAsync( string sessionId, string? idempotencyKey = default, @@ -35,6 +45,16 @@ public partial interface IRlClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// import uuid
+ /// from together import Together
+ /// client = Together()
+ /// operation = client.post_training.operations.create_inference_checkpoint(
+ /// "<SESSION_ID>",
+ /// idempotency_key=str(uuid.uuid4()),
+ /// )
+ /// print(operation.id, operation.status) + ///
global::System.Threading.Tasks.Task> CreateInferenceCheckpointAsResponseAsync( string sessionId, string? idempotencyKey = default, diff --git a/src/libs/Together/Generated/Together.IRlClient.CreateModelResources.g.cs b/src/libs/Together/Generated/Together.IRlClient.CreateModelResources.g.cs index d92f3009..49684b0d 100644 --- a/src/libs/Together/Generated/Together.IRlClient.CreateModelResources.g.cs +++ b/src/libs/Together/Generated/Together.IRlClient.CreateModelResources.g.cs @@ -12,6 +12,16 @@ public partial interface IRlClient /// 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()
+ /// resource = client.post_training.model_resources.create(
+ /// base_model="Qwen/Qwen3.5-9B",
+ /// lora_enabled=True,
+ /// compute_config={"gpu_type": "H100-80GB", "num_generator_replicas": 1},
+ /// )
+ /// print(resource.id, resource.status) + ///
global::System.Threading.Tasks.Task CreateModelResourcesAsync( global::Together.RlCreateModelResourcesRequest request, @@ -25,6 +35,16 @@ public partial interface IRlClient /// 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()
+ /// resource = client.post_training.model_resources.create(
+ /// base_model="Qwen/Qwen3.5-9B",
+ /// lora_enabled=True,
+ /// compute_config={"gpu_type": "H100-80GB", "num_generator_replicas": 1},
+ /// )
+ /// print(resource.id, resource.status) + ///
global::System.Threading.Tasks.Task> CreateModelResourcesAsResponseAsync( global::Together.RlCreateModelResourcesRequest request, diff --git a/src/libs/Together/Generated/Together.IRlClient.CreateTrainingCheckpoint.g.cs b/src/libs/Together/Generated/Together.IRlClient.CreateTrainingCheckpoint.g.cs index e9cd2cbb..1cd2ce79 100644 --- a/src/libs/Together/Generated/Together.IRlClient.CreateTrainingCheckpoint.g.cs +++ b/src/libs/Together/Generated/Together.IRlClient.CreateTrainingCheckpoint.g.cs @@ -17,6 +17,16 @@ public partial interface IRlClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// import uuid
+ /// from together import Together
+ /// client = Together()
+ /// operation = client.post_training.operations.create_training_checkpoint(
+ /// "<SESSION_ID>",
+ /// idempotency_key=str(uuid.uuid4()),
+ /// )
+ /// print(operation.id, operation.status) + ///
global::System.Threading.Tasks.Task CreateTrainingCheckpointAsync( string sessionId, string? idempotencyKey = default, @@ -35,6 +45,16 @@ public partial interface IRlClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// import uuid
+ /// from together import Together
+ /// client = Together()
+ /// operation = client.post_training.operations.create_training_checkpoint(
+ /// "<SESSION_ID>",
+ /// idempotency_key=str(uuid.uuid4()),
+ /// )
+ /// print(operation.id, operation.status) + ///
global::System.Threading.Tasks.Task> CreateTrainingCheckpointAsResponseAsync( string sessionId, string? idempotencyKey = default, diff --git a/src/libs/Together/Generated/Together.IRlClient.CustomForwardBackward.g.cs b/src/libs/Together/Generated/Together.IRlClient.CustomForwardBackward.g.cs index 5b3a1fae..217ec60b 100644 --- a/src/libs/Together/Generated/Together.IRlClient.CustomForwardBackward.g.cs +++ b/src/libs/Together/Generated/Together.IRlClient.CustomForwardBackward.g.cs @@ -18,6 +18,34 @@ public partial interface IRlClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// import uuid
+ /// from together import Together
+ /// client = Together()
+ /// # One gradient per sample: d(loss)/d(logprob) for each target token.
+ /// operation = client.post_training.operations.custom_forward_backward(
+ /// "<SESSION_ID>",
+ /// idempotency_key=str(uuid.uuid4()),
+ /// gradients=[{"data": [0.0, 0.0, -0.5, -0.5], "dtype": "D_TYPE_FLOAT32"}],
+ /// samples=[
+ /// {
+ /// "model_input": {
+ /// "chunks": [
+ /// {"encoded_text": {"tokens": [791, 6864, 315, 9822]}}
+ /// ]
+ /// },
+ /// "loss_fn_inputs": {
+ /// "target_tokens": {
+ /// "data": [6864, 315, 9822, 374],
+ /// "dtype": "int64",
+ /// },
+ /// "weights": {"data": [0.0, 0.0, 1.0, 1.0], "dtype": "float32"},
+ /// },
+ /// }
+ /// ],
+ /// )
+ /// print(operation.id, operation.status) + ///
global::System.Threading.Tasks.Task CustomForwardBackwardAsync( string sessionId, @@ -39,6 +67,34 @@ public partial interface IRlClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// import uuid
+ /// from together import Together
+ /// client = Together()
+ /// # One gradient per sample: d(loss)/d(logprob) for each target token.
+ /// operation = client.post_training.operations.custom_forward_backward(
+ /// "<SESSION_ID>",
+ /// idempotency_key=str(uuid.uuid4()),
+ /// gradients=[{"data": [0.0, 0.0, -0.5, -0.5], "dtype": "D_TYPE_FLOAT32"}],
+ /// samples=[
+ /// {
+ /// "model_input": {
+ /// "chunks": [
+ /// {"encoded_text": {"tokens": [791, 6864, 315, 9822]}}
+ /// ]
+ /// },
+ /// "loss_fn_inputs": {
+ /// "target_tokens": {
+ /// "data": [6864, 315, 9822, 374],
+ /// "dtype": "int64",
+ /// },
+ /// "weights": {"data": [0.0, 0.0, 1.0, 1.0], "dtype": "float32"},
+ /// },
+ /// }
+ /// ],
+ /// )
+ /// print(operation.id, operation.status) + ///
global::System.Threading.Tasks.Task> CustomForwardBackwardAsResponseAsync( string sessionId, diff --git a/src/libs/Together/Generated/Together.IRlClient.DownloadCheckpoint.g.cs b/src/libs/Together/Generated/Together.IRlClient.DownloadCheckpoint.g.cs index cb101f30..ba2819a5 100644 --- a/src/libs/Together/Generated/Together.IRlClient.DownloadCheckpoint.g.cs +++ b/src/libs/Together/Generated/Together.IRlClient.DownloadCheckpoint.g.cs @@ -18,6 +18,15 @@ public partial interface IRlClient /// 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()
+ /// download = client.post_training.checkpoints.download(
+ /// "<CHECKPOINT_ID>",
+ /// variant="CHECKPOINT_VARIANT_ADAPTER",
+ /// )
+ /// print(download) + ///
global::System.Threading.Tasks.Task DownloadCheckpointAsync( string id, global::Together.RlCheckpointVariant variant = global::Together.RlCheckpointVariant.CheckpointVariantUnspecified, @@ -37,6 +46,15 @@ public partial interface IRlClient /// 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()
+ /// download = client.post_training.checkpoints.download(
+ /// "<CHECKPOINT_ID>",
+ /// variant="CHECKPOINT_VARIANT_ADAPTER",
+ /// )
+ /// print(download) + ///
global::System.Threading.Tasks.Task> DownloadCheckpointAsResponseAsync( string id, global::Together.RlCheckpointVariant variant = global::Together.RlCheckpointVariant.CheckpointVariantUnspecified, diff --git a/src/libs/Together/Generated/Together.IRlClient.EstimateModelResourcesCost.g.cs b/src/libs/Together/Generated/Together.IRlClient.EstimateModelResourcesCost.g.cs index a183ae98..2ea8529e 100644 --- a/src/libs/Together/Generated/Together.IRlClient.EstimateModelResourcesCost.g.cs +++ b/src/libs/Together/Generated/Together.IRlClient.EstimateModelResourcesCost.g.cs @@ -12,6 +12,16 @@ public partial interface IRlClient /// 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()
+ /// estimate = client.post_training.model_resources.estimate_cost(
+ /// base_model="Qwen/Qwen3.5-9B",
+ /// lora_enabled=True,
+ /// compute_config={"gpu_type": "H100-80GB", "num_generator_replicas": 1},
+ /// )
+ /// print(estimate) + ///
global::System.Threading.Tasks.Task EstimateModelResourcesCostAsync( global::Together.RlCreateModelResourcesRequest request, @@ -25,6 +35,16 @@ public partial interface IRlClient /// 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()
+ /// estimate = client.post_training.model_resources.estimate_cost(
+ /// base_model="Qwen/Qwen3.5-9B",
+ /// lora_enabled=True,
+ /// compute_config={"gpu_type": "H100-80GB", "num_generator_replicas": 1},
+ /// )
+ /// print(estimate) + ///
global::System.Threading.Tasks.Task> EstimateModelResourcesCostAsResponseAsync( global::Together.RlCreateModelResourcesRequest request, diff --git a/src/libs/Together/Generated/Together.IRlClient.ForwardBackward.g.cs b/src/libs/Together/Generated/Together.IRlClient.ForwardBackward.g.cs index 32f82d8e..80342d47 100644 --- a/src/libs/Together/Generated/Together.IRlClient.ForwardBackward.g.cs +++ b/src/libs/Together/Generated/Together.IRlClient.ForwardBackward.g.cs @@ -18,6 +18,34 @@ public partial interface IRlClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// import uuid
+ /// from together import Together
+ /// client = Together()
+ /// # Token IDs come from the base model's tokenizer.
+ /// operation = client.post_training.operations.forward_backward(
+ /// "<SESSION_ID>",
+ /// idempotency_key=str(uuid.uuid4()),
+ /// loss={"type": "LOSS_TYPE_CROSS_ENTROPY"},
+ /// samples=[
+ /// {
+ /// "model_input": {
+ /// "chunks": [
+ /// {"encoded_text": {"tokens": [791, 6864, 315, 9822]}}
+ /// ]
+ /// },
+ /// "loss_fn_inputs": {
+ /// "target_tokens": {
+ /// "data": [6864, 315, 9822, 374],
+ /// "dtype": "int64",
+ /// },
+ /// "weights": {"data": [0.0, 0.0, 1.0, 1.0], "dtype": "float32"},
+ /// },
+ /// }
+ /// ],
+ /// )
+ /// print(operation.id, operation.status) + ///
global::System.Threading.Tasks.Task ForwardBackwardAsync( string sessionId, @@ -39,6 +67,34 @@ public partial interface IRlClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// import uuid
+ /// from together import Together
+ /// client = Together()
+ /// # Token IDs come from the base model's tokenizer.
+ /// operation = client.post_training.operations.forward_backward(
+ /// "<SESSION_ID>",
+ /// idempotency_key=str(uuid.uuid4()),
+ /// loss={"type": "LOSS_TYPE_CROSS_ENTROPY"},
+ /// samples=[
+ /// {
+ /// "model_input": {
+ /// "chunks": [
+ /// {"encoded_text": {"tokens": [791, 6864, 315, 9822]}}
+ /// ]
+ /// },
+ /// "loss_fn_inputs": {
+ /// "target_tokens": {
+ /// "data": [6864, 315, 9822, 374],
+ /// "dtype": "int64",
+ /// },
+ /// "weights": {"data": [0.0, 0.0, 1.0, 1.0], "dtype": "float32"},
+ /// },
+ /// }
+ /// ],
+ /// )
+ /// print(operation.id, operation.status) + ///
global::System.Threading.Tasks.Task> ForwardBackwardAsResponseAsync( string sessionId, diff --git a/src/libs/Together/Generated/Together.IRlClient.GetCheckpoint.g.cs b/src/libs/Together/Generated/Together.IRlClient.GetCheckpoint.g.cs index fb069fb6..455f23b4 100644 --- a/src/libs/Together/Generated/Together.IRlClient.GetCheckpoint.g.cs +++ b/src/libs/Together/Generated/Together.IRlClient.GetCheckpoint.g.cs @@ -14,6 +14,12 @@ public partial interface IRlClient /// 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()
+ /// checkpoint = client.post_training.checkpoints.retrieve("<CHECKPOINT_ID>")
+ /// print(checkpoint.type, checkpoint.base_model, checkpoint.lora_rank) + ///
global::System.Threading.Tasks.Task GetCheckpointAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -28,6 +34,12 @@ public partial interface IRlClient /// 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()
+ /// checkpoint = client.post_training.checkpoints.retrieve("<CHECKPOINT_ID>")
+ /// print(checkpoint.type, checkpoint.base_model, checkpoint.lora_rank) + ///
global::System.Threading.Tasks.Task> GetCheckpointAsResponseAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, diff --git a/src/libs/Together/Generated/Together.IRlClient.GetCustomForwardBackwardOperation.g.cs b/src/libs/Together/Generated/Together.IRlClient.GetCustomForwardBackwardOperation.g.cs index 0f12ca27..0c8347c6 100644 --- a/src/libs/Together/Generated/Together.IRlClient.GetCustomForwardBackwardOperation.g.cs +++ b/src/libs/Together/Generated/Together.IRlClient.GetCustomForwardBackwardOperation.g.cs @@ -17,6 +17,15 @@ public partial interface IRlClient /// 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()
+ /// operation = client.post_training.operations.retrieve_custom_forward_backward(
+ /// "<OPERATION_ID>",
+ /// session_id="<SESSION_ID>",
+ /// )
+ /// print(operation.status) + ///
global::System.Threading.Tasks.Task GetCustomForwardBackwardOperationAsync( string sessionId, string operationId, @@ -35,6 +44,15 @@ public partial interface IRlClient /// 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()
+ /// operation = client.post_training.operations.retrieve_custom_forward_backward(
+ /// "<OPERATION_ID>",
+ /// session_id="<SESSION_ID>",
+ /// )
+ /// print(operation.status) + ///
global::System.Threading.Tasks.Task> GetCustomForwardBackwardOperationAsResponseAsync( string sessionId, string operationId, diff --git a/src/libs/Together/Generated/Together.IRlClient.GetForwardBackwardOperation.g.cs b/src/libs/Together/Generated/Together.IRlClient.GetForwardBackwardOperation.g.cs index 5729088e..2d8f5d2c 100644 --- a/src/libs/Together/Generated/Together.IRlClient.GetForwardBackwardOperation.g.cs +++ b/src/libs/Together/Generated/Together.IRlClient.GetForwardBackwardOperation.g.cs @@ -17,6 +17,15 @@ public partial interface IRlClient /// 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()
+ /// operation = client.post_training.operations.retrieve_forward_backward(
+ /// "<OPERATION_ID>",
+ /// session_id="<SESSION_ID>",
+ /// )
+ /// print(operation.status) + ///
global::System.Threading.Tasks.Task GetForwardBackwardOperationAsync( string sessionId, string operationId, @@ -35,6 +44,15 @@ public partial interface IRlClient /// 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()
+ /// operation = client.post_training.operations.retrieve_forward_backward(
+ /// "<OPERATION_ID>",
+ /// session_id="<SESSION_ID>",
+ /// )
+ /// print(operation.status) + ///
global::System.Threading.Tasks.Task> GetForwardBackwardOperationAsResponseAsync( string sessionId, string operationId, diff --git a/src/libs/Together/Generated/Together.IRlClient.GetInferenceCheckpointOperation.g.cs b/src/libs/Together/Generated/Together.IRlClient.GetInferenceCheckpointOperation.g.cs index 7e5f8d39..a4459399 100644 --- a/src/libs/Together/Generated/Together.IRlClient.GetInferenceCheckpointOperation.g.cs +++ b/src/libs/Together/Generated/Together.IRlClient.GetInferenceCheckpointOperation.g.cs @@ -17,6 +17,15 @@ public partial interface IRlClient /// 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()
+ /// operation = client.post_training.operations.retrieve_inference_checkpoint(
+ /// "<OPERATION_ID>",
+ /// session_id="<SESSION_ID>",
+ /// )
+ /// print(operation.status) + ///
global::System.Threading.Tasks.Task GetInferenceCheckpointOperationAsync( string sessionId, string operationId, @@ -35,6 +44,15 @@ public partial interface IRlClient /// 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()
+ /// operation = client.post_training.operations.retrieve_inference_checkpoint(
+ /// "<OPERATION_ID>",
+ /// session_id="<SESSION_ID>",
+ /// )
+ /// print(operation.status) + ///
global::System.Threading.Tasks.Task> GetInferenceCheckpointOperationAsResponseAsync( string sessionId, string operationId, diff --git a/src/libs/Together/Generated/Together.IRlClient.GetModelResources.g.cs b/src/libs/Together/Generated/Together.IRlClient.GetModelResources.g.cs index daa8fb1c..c1032c5a 100644 --- a/src/libs/Together/Generated/Together.IRlClient.GetModelResources.g.cs +++ b/src/libs/Together/Generated/Together.IRlClient.GetModelResources.g.cs @@ -14,6 +14,14 @@ public partial interface IRlClient /// 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()
+ /// resource = client.post_training.model_resources.retrieve(
+ /// "<MODEL_RESOURCES_ID>",
+ /// )
+ /// print(resource.status, resource.compute_config) + ///
global::System.Threading.Tasks.Task GetModelResourcesAsync( string modelResourcesId, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -28,6 +36,14 @@ public partial interface IRlClient /// 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()
+ /// resource = client.post_training.model_resources.retrieve(
+ /// "<MODEL_RESOURCES_ID>",
+ /// )
+ /// print(resource.status, resource.compute_config) + ///
global::System.Threading.Tasks.Task> GetModelResourcesAsResponseAsync( string modelResourcesId, global::Together.AutoSDKRequestOptions? requestOptions = default, diff --git a/src/libs/Together/Generated/Together.IRlClient.GetOptimStepOperation.g.cs b/src/libs/Together/Generated/Together.IRlClient.GetOptimStepOperation.g.cs index 5355286c..02d94cd9 100644 --- a/src/libs/Together/Generated/Together.IRlClient.GetOptimStepOperation.g.cs +++ b/src/libs/Together/Generated/Together.IRlClient.GetOptimStepOperation.g.cs @@ -17,6 +17,15 @@ public partial interface IRlClient /// 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()
+ /// operation = client.post_training.operations.retrieve_optim_step(
+ /// "<OPERATION_ID>",
+ /// session_id="<SESSION_ID>",
+ /// )
+ /// print(operation.status) + ///
global::System.Threading.Tasks.Task GetOptimStepOperationAsync( string sessionId, string operationId, @@ -35,6 +44,15 @@ public partial interface IRlClient /// 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()
+ /// operation = client.post_training.operations.retrieve_optim_step(
+ /// "<OPERATION_ID>",
+ /// session_id="<SESSION_ID>",
+ /// )
+ /// print(operation.status) + ///
global::System.Threading.Tasks.Task> GetOptimStepOperationAsResponseAsync( string sessionId, string operationId, diff --git a/src/libs/Together/Generated/Together.IRlClient.GetSample.g.cs b/src/libs/Together/Generated/Together.IRlClient.GetSample.g.cs index c6df5d55..90da0114 100644 --- a/src/libs/Together/Generated/Together.IRlClient.GetSample.g.cs +++ b/src/libs/Together/Generated/Together.IRlClient.GetSample.g.cs @@ -17,6 +17,15 @@ public partial interface IRlClient /// 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()
+ /// operation = client.post_training.operations.retrieve_sample(
+ /// "<OPERATION_ID>",
+ /// session_id="<SESSION_ID>",
+ /// )
+ /// print(operation.status) + ///
global::System.Threading.Tasks.Task GetSampleAsync( string sessionId, string operationId, @@ -35,6 +44,15 @@ public partial interface IRlClient /// 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()
+ /// operation = client.post_training.operations.retrieve_sample(
+ /// "<OPERATION_ID>",
+ /// session_id="<SESSION_ID>",
+ /// )
+ /// print(operation.status) + ///
global::System.Threading.Tasks.Task> GetSampleAsResponseAsync( string sessionId, string operationId, diff --git a/src/libs/Together/Generated/Together.IRlClient.GetTrainingCheckpointOperation.g.cs b/src/libs/Together/Generated/Together.IRlClient.GetTrainingCheckpointOperation.g.cs index 3c707f65..79bd3d06 100644 --- a/src/libs/Together/Generated/Together.IRlClient.GetTrainingCheckpointOperation.g.cs +++ b/src/libs/Together/Generated/Together.IRlClient.GetTrainingCheckpointOperation.g.cs @@ -17,6 +17,15 @@ public partial interface IRlClient /// 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()
+ /// operation = client.post_training.operations.retrieve_training_checkpoint(
+ /// "<OPERATION_ID>",
+ /// session_id="<SESSION_ID>",
+ /// )
+ /// print(operation.status) + ///
global::System.Threading.Tasks.Task GetTrainingCheckpointOperationAsync( string sessionId, string operationId, @@ -35,6 +44,15 @@ public partial interface IRlClient /// 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()
+ /// operation = client.post_training.operations.retrieve_training_checkpoint(
+ /// "<OPERATION_ID>",
+ /// session_id="<SESSION_ID>",
+ /// )
+ /// print(operation.status) + ///
global::System.Threading.Tasks.Task> GetTrainingCheckpointOperationAsResponseAsync( string sessionId, string operationId, diff --git a/src/libs/Together/Generated/Together.IRlClient.GetTrainingSession.g.cs b/src/libs/Together/Generated/Together.IRlClient.GetTrainingSession.g.cs index 6724c357..a77d55a0 100644 --- a/src/libs/Together/Generated/Together.IRlClient.GetTrainingSession.g.cs +++ b/src/libs/Together/Generated/Together.IRlClient.GetTrainingSession.g.cs @@ -14,6 +14,12 @@ public partial interface IRlClient /// 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()
+ /// session = client.post_training.sessions.retrieve("<SESSION_ID>")
+ /// print(session.status) + ///
global::System.Threading.Tasks.Task GetTrainingSessionAsync( string sessionId, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -28,6 +34,12 @@ public partial interface IRlClient /// 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()
+ /// session = client.post_training.sessions.retrieve("<SESSION_ID>")
+ /// print(session.status) + ///
global::System.Threading.Tasks.Task> GetTrainingSessionAsResponseAsync( string sessionId, global::Together.AutoSDKRequestOptions? requestOptions = default, diff --git a/src/libs/Together/Generated/Together.IRlClient.GetWeightsSyncOperation.g.cs b/src/libs/Together/Generated/Together.IRlClient.GetWeightsSyncOperation.g.cs index beb49884..1f47030a 100644 --- a/src/libs/Together/Generated/Together.IRlClient.GetWeightsSyncOperation.g.cs +++ b/src/libs/Together/Generated/Together.IRlClient.GetWeightsSyncOperation.g.cs @@ -17,6 +17,15 @@ public partial interface IRlClient /// 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()
+ /// operation = client.post_training.operations.retrieve_weights_sync(
+ /// "<OPERATION_ID>",
+ /// session_id="<SESSION_ID>",
+ /// )
+ /// print(operation.status) + ///
global::System.Threading.Tasks.Task GetWeightsSyncOperationAsync( string sessionId, string operationId, @@ -35,6 +44,15 @@ public partial interface IRlClient /// 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()
+ /// operation = client.post_training.operations.retrieve_weights_sync(
+ /// "<OPERATION_ID>",
+ /// session_id="<SESSION_ID>",
+ /// )
+ /// print(operation.status) + ///
global::System.Threading.Tasks.Task> GetWeightsSyncOperationAsResponseAsync( string sessionId, string operationId, diff --git a/src/libs/Together/Generated/Together.IRlClient.ListCheckpoints.g.cs b/src/libs/Together/Generated/Together.IRlClient.ListCheckpoints.g.cs index 44daefc8..f8842572 100644 --- a/src/libs/Together/Generated/Together.IRlClient.ListCheckpoints.g.cs +++ b/src/libs/Together/Generated/Together.IRlClient.ListCheckpoints.g.cs @@ -27,6 +27,16 @@ public partial interface IRlClient /// 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()
+ /// checkpoints = client.post_training.checkpoints.list(
+ /// session_id="<SESSION_ID>",
+ /// type="CHECKPOINT_TYPE_TRAINING",
+ /// )
+ /// for checkpoint in checkpoints.data:
+ /// print(checkpoint.id, checkpoint.step) + ///
global::System.Threading.Tasks.Task ListCheckpointsAsync( string? sessionId = default, string? baseModel = default, @@ -58,6 +68,16 @@ public partial interface IRlClient /// 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()
+ /// checkpoints = client.post_training.checkpoints.list(
+ /// session_id="<SESSION_ID>",
+ /// type="CHECKPOINT_TYPE_TRAINING",
+ /// )
+ /// for checkpoint in checkpoints.data:
+ /// print(checkpoint.id, checkpoint.step) + ///
global::System.Threading.Tasks.Task> ListCheckpointsAsResponseAsync( string? sessionId = default, string? baseModel = default, diff --git a/src/libs/Together/Generated/Together.IRlClient.ListModelResources.g.cs b/src/libs/Together/Generated/Together.IRlClient.ListModelResources.g.cs index 2c394c28..361ee316 100644 --- a/src/libs/Together/Generated/Together.IRlClient.ListModelResources.g.cs +++ b/src/libs/Together/Generated/Together.IRlClient.ListModelResources.g.cs @@ -24,6 +24,15 @@ public partial interface IRlClient /// 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()
+ /// resources = client.post_training.model_resources.list(
+ /// status=["MODEL_RESOURCES_STATUS_READY"],
+ /// )
+ /// for resource in resources.data:
+ /// print(resource.id, resource.base_model, resource.status) + ///
global::System.Threading.Tasks.Task ListModelResourcesAsync( global::System.Collections.Generic.IList? status = default, int? limit = default, @@ -51,6 +60,15 @@ public partial interface IRlClient /// 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()
+ /// resources = client.post_training.model_resources.list(
+ /// status=["MODEL_RESOURCES_STATUS_READY"],
+ /// )
+ /// for resource in resources.data:
+ /// print(resource.id, resource.base_model, resource.status) + ///
global::System.Threading.Tasks.Task> ListModelResourcesAsResponseAsync( global::System.Collections.Generic.IList? status = default, int? limit = default, diff --git a/src/libs/Together/Generated/Together.IRlClient.ListSupportedModels.g.cs b/src/libs/Together/Generated/Together.IRlClient.ListSupportedModels.g.cs index e48b4a67..563089bc 100644 --- a/src/libs/Together/Generated/Together.IRlClient.ListSupportedModels.g.cs +++ b/src/libs/Together/Generated/Together.IRlClient.ListSupportedModels.g.cs @@ -11,6 +11,13 @@ public partial interface IRlClient /// 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()
+ /// supported = client.post_training.supported_models.get()
+ /// for model in supported.data:
+ /// print(model.base_model) + ///
global::System.Threading.Tasks.Task ListSupportedModelsAsync( global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); @@ -21,6 +28,13 @@ public partial interface IRlClient /// 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()
+ /// supported = client.post_training.supported_models.get()
+ /// for model in supported.data:
+ /// print(model.base_model) + ///
global::System.Threading.Tasks.Task> ListSupportedModelsAsResponseAsync( global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); diff --git a/src/libs/Together/Generated/Together.IRlClient.ListTrainingSessions.g.cs b/src/libs/Together/Generated/Together.IRlClient.ListTrainingSessions.g.cs index ef42ba7d..d4c05cbc 100644 --- a/src/libs/Together/Generated/Together.IRlClient.ListTrainingSessions.g.cs +++ b/src/libs/Together/Generated/Together.IRlClient.ListTrainingSessions.g.cs @@ -27,6 +27,15 @@ public partial interface IRlClient /// 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()
+ /// sessions = client.post_training.sessions.list(
+ /// model_resources_id="<MODEL_RESOURCES_ID>",
+ /// )
+ /// for session in sessions.data or []:
+ /// print(session.id, session.status) + ///
global::System.Threading.Tasks.Task ListTrainingSessionsAsync( global::System.Collections.Generic.IList? status = default, int? limit = default, @@ -58,6 +67,15 @@ public partial interface IRlClient /// 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()
+ /// sessions = client.post_training.sessions.list(
+ /// model_resources_id="<MODEL_RESOURCES_ID>",
+ /// )
+ /// for session in sessions.data or []:
+ /// print(session.id, session.status) + ///
global::System.Threading.Tasks.Task> ListTrainingSessionsAsResponseAsync( global::System.Collections.Generic.IList? status = default, int? limit = default, diff --git a/src/libs/Together/Generated/Together.IRlClient.OptimStep.g.cs b/src/libs/Together/Generated/Together.IRlClient.OptimStep.g.cs index 6c525bc4..71de9c21 100644 --- a/src/libs/Together/Generated/Together.IRlClient.OptimStep.g.cs +++ b/src/libs/Together/Generated/Together.IRlClient.OptimStep.g.cs @@ -18,6 +18,17 @@ public partial interface IRlClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// import uuid
+ /// from together import Together
+ /// client = Together()
+ /// operation = client.post_training.operations.optim_step(
+ /// "<SESSION_ID>",
+ /// idempotency_key=str(uuid.uuid4()),
+ /// adam_params={"learning_rate": 1e-5},
+ /// )
+ /// print(operation.id, operation.status) + ///
global::System.Threading.Tasks.Task OptimStepAsync( string sessionId, @@ -39,6 +50,17 @@ public partial interface IRlClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// import uuid
+ /// from together import Together
+ /// client = Together()
+ /// operation = client.post_training.operations.optim_step(
+ /// "<SESSION_ID>",
+ /// idempotency_key=str(uuid.uuid4()),
+ /// adam_params={"learning_rate": 1e-5},
+ /// )
+ /// print(operation.id, operation.status) + ///
global::System.Threading.Tasks.Task> OptimStepAsResponseAsync( string sessionId, diff --git a/src/libs/Together/Generated/Together.IRlClient.Sample.g.cs b/src/libs/Together/Generated/Together.IRlClient.Sample.g.cs index 300cf2ef..b8f2e122 100644 --- a/src/libs/Together/Generated/Together.IRlClient.Sample.g.cs +++ b/src/libs/Together/Generated/Together.IRlClient.Sample.g.cs @@ -18,6 +18,22 @@ public partial interface IRlClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// import uuid
+ /// from together import Together
+ /// client = Together()
+ /// # Token IDs come from the base model's tokenizer.
+ /// operation = client.post_training.operations.sample(
+ /// "<SESSION_ID>",
+ /// idempotency_key=str(uuid.uuid4()),
+ /// model_inputs=[
+ /// {"chunks": [{"encoded_text": {"tokens": [791, 6864, 315, 9822]}}]}
+ /// ],
+ /// num_samples=4,
+ /// sampling_params={"max_tokens": 256, "temperature": 1.0},
+ /// )
+ /// print(operation.id, operation.status) + ///
global::System.Threading.Tasks.Task SampleAsync( string sessionId, @@ -39,6 +55,22 @@ public partial interface IRlClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// import uuid
+ /// from together import Together
+ /// client = Together()
+ /// # Token IDs come from the base model's tokenizer.
+ /// operation = client.post_training.operations.sample(
+ /// "<SESSION_ID>",
+ /// idempotency_key=str(uuid.uuid4()),
+ /// model_inputs=[
+ /// {"chunks": [{"encoded_text": {"tokens": [791, 6864, 315, 9822]}}]}
+ /// ],
+ /// num_samples=4,
+ /// sampling_params={"max_tokens": 256, "temperature": 1.0},
+ /// )
+ /// print(operation.id, operation.status) + ///
global::System.Threading.Tasks.Task> SampleAsResponseAsync( string sessionId, diff --git a/src/libs/Together/Generated/Together.IRlClient.StartTrainingSession.g.cs b/src/libs/Together/Generated/Together.IRlClient.StartTrainingSession.g.cs index fabbf9ac..de99f196 100644 --- a/src/libs/Together/Generated/Together.IRlClient.StartTrainingSession.g.cs +++ b/src/libs/Together/Generated/Together.IRlClient.StartTrainingSession.g.cs @@ -12,6 +12,16 @@ public partial interface IRlClient /// 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()
+ /// session = client.post_training.sessions.create(
+ /// model_resources_id="<MODEL_RESOURCES_ID>",
+ /// display_name="grpo-math",
+ /// lora_config={"rank": 32},
+ /// )
+ /// print(session.id, session.status) + ///
global::System.Threading.Tasks.Task StartTrainingSessionAsync( global::Together.RlStartTrainingSessionRequest request, @@ -25,6 +35,16 @@ public partial interface IRlClient /// 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()
+ /// session = client.post_training.sessions.create(
+ /// model_resources_id="<MODEL_RESOURCES_ID>",
+ /// display_name="grpo-math",
+ /// lora_config={"rank": 32},
+ /// )
+ /// print(session.id, session.status) + ///
global::System.Threading.Tasks.Task> StartTrainingSessionAsResponseAsync( global::Together.RlStartTrainingSessionRequest request, diff --git a/src/libs/Together/Generated/Together.IRlClient.StopModelResources.g.cs b/src/libs/Together/Generated/Together.IRlClient.StopModelResources.g.cs index 1c761694..4074d2b8 100644 --- a/src/libs/Together/Generated/Together.IRlClient.StopModelResources.g.cs +++ b/src/libs/Together/Generated/Together.IRlClient.StopModelResources.g.cs @@ -18,6 +18,12 @@ public partial interface IRlClient /// 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()
+ /// resource = client.post_training.model_resources.stop("<MODEL_RESOURCES_ID>")
+ /// print(resource.status) + ///
global::System.Threading.Tasks.Task StopModelResourcesAsync( string modelResourcesId, bool? force = default, @@ -37,6 +43,12 @@ public partial interface IRlClient /// 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()
+ /// resource = client.post_training.model_resources.stop("<MODEL_RESOURCES_ID>")
+ /// print(resource.status) + ///
global::System.Threading.Tasks.Task> StopModelResourcesAsResponseAsync( string modelResourcesId, bool? force = default, diff --git a/src/libs/Together/Generated/Together.IRlClient.StopTrainingSession.g.cs b/src/libs/Together/Generated/Together.IRlClient.StopTrainingSession.g.cs index 4f5f7786..234b5190 100644 --- a/src/libs/Together/Generated/Together.IRlClient.StopTrainingSession.g.cs +++ b/src/libs/Together/Generated/Together.IRlClient.StopTrainingSession.g.cs @@ -14,6 +14,12 @@ public partial interface IRlClient /// 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()
+ /// session = client.post_training.sessions.stop("<SESSION_ID>")
+ /// print(session.status) + ///
global::System.Threading.Tasks.Task StopTrainingSessionAsync( string sessionId, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -28,6 +34,12 @@ public partial interface IRlClient /// 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()
+ /// session = client.post_training.sessions.stop("<SESSION_ID>")
+ /// print(session.status) + ///
global::System.Threading.Tasks.Task> StopTrainingSessionAsResponseAsync( string sessionId, global::Together.AutoSDKRequestOptions? requestOptions = default, diff --git a/src/libs/Together/Generated/Together.IRlClient.UpdateTrainingSession.g.cs b/src/libs/Together/Generated/Together.IRlClient.UpdateTrainingSession.g.cs index 367f481a..5fc3c473 100644 --- a/src/libs/Together/Generated/Together.IRlClient.UpdateTrainingSession.g.cs +++ b/src/libs/Together/Generated/Together.IRlClient.UpdateTrainingSession.g.cs @@ -15,6 +15,15 @@ public partial interface IRlClient /// 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()
+ /// session = client.post_training.sessions.update(
+ /// "<SESSION_ID>",
+ /// display_name="grpo-math-run-2",
+ /// )
+ /// print(session.display_name) + ///
global::System.Threading.Tasks.Task UpdateTrainingSessionAsync( string sessionId, @@ -32,6 +41,15 @@ public partial interface IRlClient /// 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()
+ /// session = client.post_training.sessions.update(
+ /// "<SESSION_ID>",
+ /// display_name="grpo-math-run-2",
+ /// )
+ /// print(session.display_name) + ///
global::System.Threading.Tasks.Task> UpdateTrainingSessionAsResponseAsync( string sessionId, diff --git a/src/libs/Together/Generated/Together.IRlClient.WeightsSync.g.cs b/src/libs/Together/Generated/Together.IRlClient.WeightsSync.g.cs index dd375aa0..0ede5e44 100644 --- a/src/libs/Together/Generated/Together.IRlClient.WeightsSync.g.cs +++ b/src/libs/Together/Generated/Together.IRlClient.WeightsSync.g.cs @@ -18,6 +18,17 @@ public partial interface IRlClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// import uuid
+ /// from together import Together
+ /// client = Together()
+ /// operation = client.post_training.operations.weights_sync(
+ /// "<SESSION_ID>",
+ /// idempotency_key=str(uuid.uuid4()),
+ /// weight_sync_type="WEIGHT_SYNC_TYPE_SYNCHRONOUS",
+ /// )
+ /// print(operation.id, operation.status) + ///
global::System.Threading.Tasks.Task WeightsSyncAsync( string sessionId, @@ -39,6 +50,17 @@ public partial interface IRlClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// import uuid
+ /// from together import Together
+ /// client = Together()
+ /// operation = client.post_training.operations.weights_sync(
+ /// "<SESSION_ID>",
+ /// idempotency_key=str(uuid.uuid4()),
+ /// weight_sync_type="WEIGHT_SYNC_TYPE_SYNCHRONOUS",
+ /// )
+ /// print(operation.id, operation.status) + ///
global::System.Threading.Tasks.Task> WeightsSyncAsResponseAsync( string sessionId, diff --git a/src/libs/Together/Generated/Together.IRlClient.g.cs b/src/libs/Together/Generated/Together.IRlClient.g.cs index df386ce7..a937c7ce 100644 --- a/src/libs/Together/Generated/Together.IRlClient.g.cs +++ b/src/libs/Together/Generated/Together.IRlClient.g.cs @@ -19,6 +19,27 @@ public partial interface IRlClient : global::System.IDisposable /// public System.Uri? BaseUri { get; } + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers { get; } + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer { get; set; } + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId); + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer(); + /// /// The authorizations to use for the requests. /// diff --git a/src/libs/Together/Generated/Together.IRolloutServiceClient.RolloutServiceCancelRollout.g.cs b/src/libs/Together/Generated/Together.IRolloutServiceClient.RolloutServiceCancelRollout.g.cs index 0cb304a3..1770ba2a 100644 --- a/src/libs/Together/Generated/Together.IRolloutServiceClient.RolloutServiceCancelRollout.g.cs +++ b/src/libs/Together/Generated/Together.IRolloutServiceClient.RolloutServiceCancelRollout.g.cs @@ -21,6 +21,18 @@ public partial interface IRolloutServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// rollout = client.beta.endpoints.rollouts.cancel(
+ /// "rol_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// reason="Latency regression on the target",
+ /// )
+ /// print(rollout.id, rollout.state) + ///
global::System.Threading.Tasks.Task RolloutServiceCancelRolloutAsync( string projectId, string endpointId, @@ -46,6 +58,18 @@ public partial interface IRolloutServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// rollout = client.beta.endpoints.rollouts.cancel(
+ /// "rol_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// reason="Latency regression on the target",
+ /// )
+ /// print(rollout.id, rollout.state) + ///
global::System.Threading.Tasks.Task> RolloutServiceCancelRolloutAsResponseAsync( string projectId, string endpointId, diff --git a/src/libs/Together/Generated/Together.IRolloutServiceClient.RolloutServiceCreateRollout.g.cs b/src/libs/Together/Generated/Together.IRolloutServiceClient.RolloutServiceCreateRollout.g.cs index 96ed2c0c..553c8a8c 100644 --- a/src/libs/Together/Generated/Together.IRolloutServiceClient.RolloutServiceCreateRollout.g.cs +++ b/src/libs/Together/Generated/Together.IRolloutServiceClient.RolloutServiceCreateRollout.g.cs @@ -18,6 +18,34 @@ public partial interface IRolloutServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// rollout = client.beta.endpoints.rollouts.create(
+ /// "ep_abc123",
+ /// project_id=project_id,
+ /// source_deployment_id="dep_abc123",
+ /// target_deployment_id="dep_def456",
+ /// canary={
+ /// "steps": [{"traffic": 25}, {"traffic": 50}, {"traffic": 100}],
+ /// "step_interval": "300s",
+ /// },
+ /// metrics=[
+ /// {
+ /// "name": "router_latency",
+ /// "stat": "METRIC_STAT_TYPE_PERCENTILE",
+ /// "percentile": 95,
+ /// "threshold_check": {
+ /// "value": 30000,
+ /// "operator": "THRESHOLD_OPERATOR_LT",
+ /// },
+ /// "window": "300s",
+ /// }
+ /// ],
+ /// )
+ /// print(rollout.id, rollout.state) + ///
global::System.Threading.Tasks.Task RolloutServiceCreateRolloutAsync( string projectId, string endpointId, @@ -39,6 +67,34 @@ public partial interface IRolloutServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// rollout = client.beta.endpoints.rollouts.create(
+ /// "ep_abc123",
+ /// project_id=project_id,
+ /// source_deployment_id="dep_abc123",
+ /// target_deployment_id="dep_def456",
+ /// canary={
+ /// "steps": [{"traffic": 25}, {"traffic": 50}, {"traffic": 100}],
+ /// "step_interval": "300s",
+ /// },
+ /// metrics=[
+ /// {
+ /// "name": "router_latency",
+ /// "stat": "METRIC_STAT_TYPE_PERCENTILE",
+ /// "percentile": 95,
+ /// "threshold_check": {
+ /// "value": 30000,
+ /// "operator": "THRESHOLD_OPERATOR_LT",
+ /// },
+ /// "window": "300s",
+ /// }
+ /// ],
+ /// )
+ /// print(rollout.id, rollout.state) + ///
global::System.Threading.Tasks.Task> RolloutServiceCreateRolloutAsResponseAsync( string projectId, string endpointId, diff --git a/src/libs/Together/Generated/Together.IRolloutServiceClient.RolloutServiceDeleteRollout.g.cs b/src/libs/Together/Generated/Together.IRolloutServiceClient.RolloutServiceDeleteRollout.g.cs index dca0a263..ed6acc91 100644 --- a/src/libs/Together/Generated/Together.IRolloutServiceClient.RolloutServiceDeleteRollout.g.cs +++ b/src/libs/Together/Generated/Together.IRolloutServiceClient.RolloutServiceDeleteRollout.g.cs @@ -23,6 +23,16 @@ public partial interface IRolloutServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// client.beta.endpoints.rollouts.delete(
+ /// "rol_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// ) + ///
global::System.Threading.Tasks.Task RolloutServiceDeleteRolloutAsync( string projectId, string endpointId, @@ -49,6 +59,16 @@ public partial interface IRolloutServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// client.beta.endpoints.rollouts.delete(
+ /// "rol_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// ) + ///
global::System.Threading.Tasks.Task> RolloutServiceDeleteRolloutAsResponseAsync( string projectId, string endpointId, diff --git a/src/libs/Together/Generated/Together.IRolloutServiceClient.RolloutServiceGetRollout.g.cs b/src/libs/Together/Generated/Together.IRolloutServiceClient.RolloutServiceGetRollout.g.cs index c86a3e66..4ce2aa88 100644 --- a/src/libs/Together/Generated/Together.IRolloutServiceClient.RolloutServiceGetRollout.g.cs +++ b/src/libs/Together/Generated/Together.IRolloutServiceClient.RolloutServiceGetRollout.g.cs @@ -20,6 +20,17 @@ public partial interface IRolloutServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// rollout = client.beta.endpoints.rollouts.retrieve(
+ /// "rol_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// )
+ /// print(rollout.id, rollout.state) + ///
global::System.Threading.Tasks.Task RolloutServiceGetRolloutAsync( string projectId, string endpointId, @@ -42,6 +53,17 @@ public partial interface IRolloutServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// rollout = client.beta.endpoints.rollouts.retrieve(
+ /// "rol_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// )
+ /// print(rollout.id, rollout.state) + ///
global::System.Threading.Tasks.Task> RolloutServiceGetRolloutAsResponseAsync( string projectId, string endpointId, diff --git a/src/libs/Together/Generated/Together.IRolloutServiceClient.RolloutServiceListRollouts.g.cs b/src/libs/Together/Generated/Together.IRolloutServiceClient.RolloutServiceListRollouts.g.cs index 2e9e1255..a2bff748 100644 --- a/src/libs/Together/Generated/Together.IRolloutServiceClient.RolloutServiceListRollouts.g.cs +++ b/src/libs/Together/Generated/Together.IRolloutServiceClient.RolloutServiceListRollouts.g.cs @@ -26,6 +26,17 @@ public partial interface IRolloutServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// rollouts = client.beta.endpoints.rollouts.list(
+ /// "ep_abc123",
+ /// project_id=project_id,
+ /// )
+ /// for rollout in rollouts:
+ /// print(rollout.id, rollout.state) + ///
global::System.Threading.Tasks.Task RolloutServiceListRolloutsAsync( string projectId, string endpointId, @@ -56,6 +67,17 @@ public partial interface IRolloutServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// rollouts = client.beta.endpoints.rollouts.list(
+ /// "ep_abc123",
+ /// project_id=project_id,
+ /// )
+ /// for rollout in rollouts:
+ /// print(rollout.id, rollout.state) + ///
global::System.Threading.Tasks.Task> RolloutServiceListRolloutsAsResponseAsync( string projectId, string endpointId, diff --git a/src/libs/Together/Generated/Together.IRolloutServiceClient.RolloutServicePauseRollout.g.cs b/src/libs/Together/Generated/Together.IRolloutServiceClient.RolloutServicePauseRollout.g.cs index fd0e3c35..d31bfe06 100644 --- a/src/libs/Together/Generated/Together.IRolloutServiceClient.RolloutServicePauseRollout.g.cs +++ b/src/libs/Together/Generated/Together.IRolloutServiceClient.RolloutServicePauseRollout.g.cs @@ -21,6 +21,18 @@ public partial interface IRolloutServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// rollout = client.beta.endpoints.rollouts.pause(
+ /// "rol_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// reason="Investigating a latency regression",
+ /// )
+ /// print(rollout.id, rollout.state) + ///
global::System.Threading.Tasks.Task RolloutServicePauseRolloutAsync( string projectId, string endpointId, @@ -46,6 +58,18 @@ public partial interface IRolloutServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// rollout = client.beta.endpoints.rollouts.pause(
+ /// "rol_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// reason="Investigating a latency regression",
+ /// )
+ /// print(rollout.id, rollout.state) + ///
global::System.Threading.Tasks.Task> RolloutServicePauseRolloutAsResponseAsync( string projectId, string endpointId, diff --git a/src/libs/Together/Generated/Together.IRolloutServiceClient.RolloutServicePreviewRolloutDefaults.g.cs b/src/libs/Together/Generated/Together.IRolloutServiceClient.RolloutServicePreviewRolloutDefaults.g.cs index 932245e4..16204d9d 100644 --- a/src/libs/Together/Generated/Together.IRolloutServiceClient.RolloutServicePreviewRolloutDefaults.g.cs +++ b/src/libs/Together/Generated/Together.IRolloutServiceClient.RolloutServicePreviewRolloutDefaults.g.cs @@ -18,6 +18,21 @@ public partial interface IRolloutServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// # Returns the values a create request would use for unset fields,
+ /// # without creating a rollout.
+ /// defaults = client.beta.endpoints.rollouts.preview_defaults(
+ /// "ep_abc123",
+ /// project_id=project_id,
+ /// source_deployment_id="dep_abc123",
+ /// target_deployment_id="dep_def456",
+ /// canary={"steps": [{"traffic": 25}, {"traffic": 100}]},
+ /// )
+ /// print(defaults) + ///
global::System.Threading.Tasks.Task RolloutServicePreviewRolloutDefaultsAsync( string projectId, string endpointId, @@ -39,6 +54,21 @@ public partial interface IRolloutServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// # Returns the values a create request would use for unset fields,
+ /// # without creating a rollout.
+ /// defaults = client.beta.endpoints.rollouts.preview_defaults(
+ /// "ep_abc123",
+ /// project_id=project_id,
+ /// source_deployment_id="dep_abc123",
+ /// target_deployment_id="dep_def456",
+ /// canary={"steps": [{"traffic": 25}, {"traffic": 100}]},
+ /// )
+ /// print(defaults) + ///
global::System.Threading.Tasks.Task> RolloutServicePreviewRolloutDefaultsAsResponseAsync( string projectId, string endpointId, diff --git a/src/libs/Together/Generated/Together.IRolloutServiceClient.RolloutServicePromoteRollout.g.cs b/src/libs/Together/Generated/Together.IRolloutServiceClient.RolloutServicePromoteRollout.g.cs index 346d8e78..5f9548f1 100644 --- a/src/libs/Together/Generated/Together.IRolloutServiceClient.RolloutServicePromoteRollout.g.cs +++ b/src/libs/Together/Generated/Together.IRolloutServiceClient.RolloutServicePromoteRollout.g.cs @@ -21,6 +21,17 @@ public partial interface IRolloutServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// rollout = client.beta.endpoints.rollouts.promote(
+ /// "rol_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// )
+ /// print(rollout.id, rollout.state) + ///
global::System.Threading.Tasks.Task RolloutServicePromoteRolloutAsync( string projectId, string endpointId, @@ -46,6 +57,17 @@ public partial interface IRolloutServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// rollout = client.beta.endpoints.rollouts.promote(
+ /// "rol_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// )
+ /// print(rollout.id, rollout.state) + ///
global::System.Threading.Tasks.Task> RolloutServicePromoteRolloutAsResponseAsync( string projectId, string endpointId, diff --git a/src/libs/Together/Generated/Together.IRolloutServiceClient.RolloutServiceResumeRollout.g.cs b/src/libs/Together/Generated/Together.IRolloutServiceClient.RolloutServiceResumeRollout.g.cs index ce6f7c1f..4f85f761 100644 --- a/src/libs/Together/Generated/Together.IRolloutServiceClient.RolloutServiceResumeRollout.g.cs +++ b/src/libs/Together/Generated/Together.IRolloutServiceClient.RolloutServiceResumeRollout.g.cs @@ -21,6 +21,17 @@ public partial interface IRolloutServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// rollout = client.beta.endpoints.rollouts.resume(
+ /// "rol_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// )
+ /// print(rollout.id, rollout.state) + ///
global::System.Threading.Tasks.Task RolloutServiceResumeRolloutAsync( string projectId, string endpointId, @@ -46,6 +57,17 @@ public partial interface IRolloutServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// rollout = client.beta.endpoints.rollouts.resume(
+ /// "rol_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// )
+ /// print(rollout.id, rollout.state) + ///
global::System.Threading.Tasks.Task> RolloutServiceResumeRolloutAsResponseAsync( string projectId, string endpointId, diff --git a/src/libs/Together/Generated/Together.IRolloutServiceClient.RolloutServiceStartRollout.g.cs b/src/libs/Together/Generated/Together.IRolloutServiceClient.RolloutServiceStartRollout.g.cs index 4637d1d4..c2ea363d 100644 --- a/src/libs/Together/Generated/Together.IRolloutServiceClient.RolloutServiceStartRollout.g.cs +++ b/src/libs/Together/Generated/Together.IRolloutServiceClient.RolloutServiceStartRollout.g.cs @@ -20,6 +20,17 @@ public partial interface IRolloutServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// rollout = client.beta.endpoints.rollouts.start(
+ /// "rol_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// )
+ /// print(rollout.id, rollout.state) + ///
global::System.Threading.Tasks.Task RolloutServiceStartRolloutAsync( string projectId, string endpointId, @@ -42,6 +53,17 @@ public partial interface IRolloutServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// rollout = client.beta.endpoints.rollouts.start(
+ /// "rol_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// )
+ /// print(rollout.id, rollout.state) + ///
global::System.Threading.Tasks.Task> RolloutServiceStartRolloutAsResponseAsync( string projectId, string endpointId, diff --git a/src/libs/Together/Generated/Together.ISecretsClient.CreateDeploymentsSecrets.g.cs b/src/libs/Together/Generated/Together.ISecretsClient.CreateDeploymentsSecrets.g.cs index 41f6b7dc..9e6b9b38 100644 --- a/src/libs/Together/Generated/Together.ISecretsClient.CreateDeploymentsSecrets.g.cs +++ b/src/libs/Together/Generated/Together.ISecretsClient.CreateDeploymentsSecrets.g.cs @@ -12,6 +12,11 @@ public partial interface ISecretsClient /// 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()
+ /// client.beta.jig.secrets.create(name="my-secret", value="my-value") + ///
global::System.Threading.Tasks.Task CreateDeploymentsSecretsAsync( global::Together.CreateSecretRequest request, @@ -25,6 +30,11 @@ public partial interface ISecretsClient /// 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()
+ /// client.beta.jig.secrets.create(name="my-secret", value="my-value") + ///
global::System.Threading.Tasks.Task> CreateDeploymentsSecretsAsResponseAsync( global::Together.CreateSecretRequest request, diff --git a/src/libs/Together/Generated/Together.ISecretsClient.DeleteDeploymentsSecretsById.g.cs b/src/libs/Together/Generated/Together.ISecretsClient.DeleteDeploymentsSecretsById.g.cs index e1289912..e47dfb2e 100644 --- a/src/libs/Together/Generated/Together.ISecretsClient.DeleteDeploymentsSecretsById.g.cs +++ b/src/libs/Together/Generated/Together.ISecretsClient.DeleteDeploymentsSecretsById.g.cs @@ -14,6 +14,11 @@ public partial interface ISecretsClient /// 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()
+ /// client.beta.jig.secrets.delete("my-secret") + ///
global::System.Threading.Tasks.Task DeleteDeploymentsSecretsByIdAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -28,6 +33,11 @@ public partial interface ISecretsClient /// 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()
+ /// client.beta.jig.secrets.delete("my-secret") + ///
global::System.Threading.Tasks.Task> DeleteDeploymentsSecretsByIdAsResponseAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, diff --git a/src/libs/Together/Generated/Together.ISecretsClient.EditDeploymentsSecretsById.g.cs b/src/libs/Together/Generated/Together.ISecretsClient.EditDeploymentsSecretsById.g.cs index e3d0cbf8..36575239 100644 --- a/src/libs/Together/Generated/Together.ISecretsClient.EditDeploymentsSecretsById.g.cs +++ b/src/libs/Together/Generated/Together.ISecretsClient.EditDeploymentsSecretsById.g.cs @@ -15,6 +15,11 @@ public partial interface ISecretsClient /// 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()
+ /// client.beta.jig.secrets.update("my-secret", value="my-new-value") + ///
global::System.Threading.Tasks.Task EditDeploymentsSecretsByIdAsync( string id, @@ -32,6 +37,11 @@ public partial interface ISecretsClient /// 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()
+ /// client.beta.jig.secrets.update("my-secret", value="my-new-value") + ///
global::System.Threading.Tasks.Task> EditDeploymentsSecretsByIdAsResponseAsync( string id, diff --git a/src/libs/Together/Generated/Together.ISecretsClient.GetDeploymentsSecrets.g.cs b/src/libs/Together/Generated/Together.ISecretsClient.GetDeploymentsSecrets.g.cs index 07b4bd7d..d2524e98 100644 --- a/src/libs/Together/Generated/Together.ISecretsClient.GetDeploymentsSecrets.g.cs +++ b/src/libs/Together/Generated/Together.ISecretsClient.GetDeploymentsSecrets.g.cs @@ -11,6 +11,12 @@ public partial interface ISecretsClient /// 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()
+ /// secrets = client.beta.jig.secrets.list()
+ /// print(secrets) + ///
global::System.Threading.Tasks.Task GetDeploymentsSecretsAsync( global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); @@ -21,6 +27,12 @@ public partial interface ISecretsClient /// 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()
+ /// secrets = client.beta.jig.secrets.list()
+ /// print(secrets) + ///
global::System.Threading.Tasks.Task> GetDeploymentsSecretsAsResponseAsync( global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); diff --git a/src/libs/Together/Generated/Together.ISecretsClient.GetDeploymentsSecretsById.g.cs b/src/libs/Together/Generated/Together.ISecretsClient.GetDeploymentsSecretsById.g.cs index b5d0377c..3a08295a 100644 --- a/src/libs/Together/Generated/Together.ISecretsClient.GetDeploymentsSecretsById.g.cs +++ b/src/libs/Together/Generated/Together.ISecretsClient.GetDeploymentsSecretsById.g.cs @@ -14,6 +14,12 @@ public partial interface ISecretsClient /// 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()
+ /// secret = client.beta.jig.secrets.retrieve("my-secret")
+ /// print(secret) + ///
global::System.Threading.Tasks.Task GetDeploymentsSecretsByIdAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -28,6 +34,12 @@ public partial interface ISecretsClient /// 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()
+ /// secret = client.beta.jig.secrets.retrieve("my-secret")
+ /// print(secret) + ///
global::System.Threading.Tasks.Task> GetDeploymentsSecretsByIdAsResponseAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, diff --git a/src/libs/Together/Generated/Together.ISecretsClient.g.cs b/src/libs/Together/Generated/Together.ISecretsClient.g.cs index 842a787c..032c3c28 100644 --- a/src/libs/Together/Generated/Together.ISecretsClient.g.cs +++ b/src/libs/Together/Generated/Together.ISecretsClient.g.cs @@ -19,6 +19,27 @@ public partial interface ISecretsClient : global::System.IDisposable /// public System.Uri? BaseUri { get; } + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers { get; } + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer { get; set; } + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId); + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer(); + /// /// The authorizations to use for the requests. /// diff --git a/src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceCreateShadowExperiment.g.cs b/src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceCreateShadowExperiment.g.cs index 4c9c498d..a2e3fbc6 100644 --- a/src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceCreateShadowExperiment.g.cs +++ b/src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceCreateShadowExperiment.g.cs @@ -18,6 +18,22 @@ public partial interface IShadowExperimentServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// # Mirror 10% of the endpoint's requests to the candidate deployment.
+ /// experiment = client.beta.endpoints.shadow_experiments.create(
+ /// "ep_abc123",
+ /// project_id=project_id,
+ /// name="candidate-shadow",
+ /// source={"endpoint": {"sampling": {"uniform": {"rate": 0.1}}}},
+ /// targets=[
+ /// {"name": "candidate", "target_deployment_id": "dep_def456"},
+ /// ],
+ /// )
+ /// print(experiment.id) + ///
global::System.Threading.Tasks.Task ShadowExperimentServiceCreateShadowExperimentAsync( string projectId, string endpointId, @@ -39,6 +55,22 @@ public partial interface IShadowExperimentServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// # Mirror 10% of the endpoint's requests to the candidate deployment.
+ /// experiment = client.beta.endpoints.shadow_experiments.create(
+ /// "ep_abc123",
+ /// project_id=project_id,
+ /// name="candidate-shadow",
+ /// source={"endpoint": {"sampling": {"uniform": {"rate": 0.1}}}},
+ /// targets=[
+ /// {"name": "candidate", "target_deployment_id": "dep_def456"},
+ /// ],
+ /// )
+ /// print(experiment.id) + ///
global::System.Threading.Tasks.Task> ShadowExperimentServiceCreateShadowExperimentAsResponseAsync( string projectId, string endpointId, diff --git a/src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceCreateTarget.g.cs b/src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceCreateTarget.g.cs index 3ee02db6..d5f794a5 100644 --- a/src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceCreateTarget.g.cs +++ b/src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceCreateTarget.g.cs @@ -21,6 +21,19 @@ public partial interface IShadowExperimentServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// target = client.beta.endpoints.shadow_experiments.targets.create(
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// experiment_id="exp_abc123",
+ /// name="candidate-2",
+ /// target_deployment_id="dep_ghi789",
+ /// )
+ /// print(target.id) + ///
global::System.Threading.Tasks.Task ShadowExperimentServiceCreateTargetAsync( string projectId, string endpointId, @@ -46,6 +59,19 @@ public partial interface IShadowExperimentServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// target = client.beta.endpoints.shadow_experiments.targets.create(
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// experiment_id="exp_abc123",
+ /// name="candidate-2",
+ /// target_deployment_id="dep_ghi789",
+ /// )
+ /// print(target.id) + ///
global::System.Threading.Tasks.Task> ShadowExperimentServiceCreateTargetAsResponseAsync( string projectId, string endpointId, diff --git a/src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceDeleteShadowExperiment.g.cs b/src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceDeleteShadowExperiment.g.cs index 42817051..14cf1fbc 100644 --- a/src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceDeleteShadowExperiment.g.cs +++ b/src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceDeleteShadowExperiment.g.cs @@ -23,6 +23,16 @@ public partial interface IShadowExperimentServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// client.beta.endpoints.shadow_experiments.delete(
+ /// "exp_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// ) + ///
global::System.Threading.Tasks.Task ShadowExperimentServiceDeleteShadowExperimentAsync( string projectId, string endpointId, @@ -49,6 +59,16 @@ public partial interface IShadowExperimentServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// client.beta.endpoints.shadow_experiments.delete(
+ /// "exp_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// ) + ///
global::System.Threading.Tasks.Task> ShadowExperimentServiceDeleteShadowExperimentAsResponseAsync( string projectId, string endpointId, diff --git a/src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceDeleteTarget.g.cs b/src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceDeleteTarget.g.cs index c9914254..ee54752f 100644 --- a/src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceDeleteTarget.g.cs +++ b/src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceDeleteTarget.g.cs @@ -26,6 +26,17 @@ public partial interface IShadowExperimentServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// client.beta.endpoints.shadow_experiments.targets.delete(
+ /// "tgt_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// experiment_id="exp_abc123",
+ /// ) + ///
global::System.Threading.Tasks.Task ShadowExperimentServiceDeleteTargetAsync( string projectId, string endpointId, @@ -56,6 +67,17 @@ public partial interface IShadowExperimentServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// client.beta.endpoints.shadow_experiments.targets.delete(
+ /// "tgt_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// experiment_id="exp_abc123",
+ /// ) + ///
global::System.Threading.Tasks.Task> ShadowExperimentServiceDeleteTargetAsResponseAsync( string projectId, string endpointId, diff --git a/src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceGetShadowExperiment.g.cs b/src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceGetShadowExperiment.g.cs index 842029a2..47345eff 100644 --- a/src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceGetShadowExperiment.g.cs +++ b/src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceGetShadowExperiment.g.cs @@ -20,6 +20,17 @@ public partial interface IShadowExperimentServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// experiment = client.beta.endpoints.shadow_experiments.retrieve(
+ /// "exp_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// )
+ /// print(experiment.name, experiment.targets) + ///
global::System.Threading.Tasks.Task ShadowExperimentServiceGetShadowExperimentAsync( string projectId, string endpointId, @@ -42,6 +53,17 @@ public partial interface IShadowExperimentServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// experiment = client.beta.endpoints.shadow_experiments.retrieve(
+ /// "exp_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// )
+ /// print(experiment.name, experiment.targets) + ///
global::System.Threading.Tasks.Task> ShadowExperimentServiceGetShadowExperimentAsResponseAsync( string projectId, string endpointId, diff --git a/src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceGetTarget.g.cs b/src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceGetTarget.g.cs index 465b49ce..9d8e54bd 100644 --- a/src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceGetTarget.g.cs +++ b/src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceGetTarget.g.cs @@ -23,6 +23,18 @@ public partial interface IShadowExperimentServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// target = client.beta.endpoints.shadow_experiments.targets.retrieve(
+ /// "tgt_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// experiment_id="exp_abc123",
+ /// )
+ /// print(target.name, target.target_deployment_id) + ///
global::System.Threading.Tasks.Task ShadowExperimentServiceGetTargetAsync( string projectId, string endpointId, @@ -49,6 +61,18 @@ public partial interface IShadowExperimentServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// target = client.beta.endpoints.shadow_experiments.targets.retrieve(
+ /// "tgt_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// experiment_id="exp_abc123",
+ /// )
+ /// print(target.name, target.target_deployment_id) + ///
global::System.Threading.Tasks.Task> ShadowExperimentServiceGetTargetAsResponseAsync( string projectId, string endpointId, diff --git a/src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceListShadowExperiments.g.cs b/src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceListShadowExperiments.g.cs index c947d080..b9acd34c 100644 --- a/src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceListShadowExperiments.g.cs +++ b/src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceListShadowExperiments.g.cs @@ -26,6 +26,18 @@ public partial interface IShadowExperimentServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// experiments = client.beta.endpoints.shadow_experiments.list(
+ /// "ep_abc123",
+ /// project_id=project_id,
+ /// include_targets=True,
+ /// )
+ /// for experiment in experiments:
+ /// print(experiment.id, experiment.name) + ///
global::System.Threading.Tasks.Task ShadowExperimentServiceListShadowExperimentsAsync( string projectId, string endpointId, @@ -56,6 +68,18 @@ public partial interface IShadowExperimentServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// experiments = client.beta.endpoints.shadow_experiments.list(
+ /// "ep_abc123",
+ /// project_id=project_id,
+ /// include_targets=True,
+ /// )
+ /// for experiment in experiments:
+ /// print(experiment.id, experiment.name) + ///
global::System.Threading.Tasks.Task> ShadowExperimentServiceListShadowExperimentsAsResponseAsync( string projectId, string endpointId, diff --git a/src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceListTargets.g.cs b/src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceListTargets.g.cs index 0353f48e..90f6b60f 100644 --- a/src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceListTargets.g.cs +++ b/src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceListTargets.g.cs @@ -26,6 +26,18 @@ public partial interface IShadowExperimentServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// targets = client.beta.endpoints.shadow_experiments.targets.list(
+ /// endpoint_id="ep_abc123",
+ /// experiment_id="exp_abc123",
+ /// project_id=project_id,
+ /// )
+ /// for target in targets:
+ /// print(target.id, target.name, target.target_deployment_id) + ///
global::System.Threading.Tasks.Task ShadowExperimentServiceListTargetsAsync( string projectId, string endpointId, @@ -56,6 +68,18 @@ public partial interface IShadowExperimentServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// targets = client.beta.endpoints.shadow_experiments.targets.list(
+ /// endpoint_id="ep_abc123",
+ /// experiment_id="exp_abc123",
+ /// project_id=project_id,
+ /// )
+ /// for target in targets:
+ /// print(target.id, target.name, target.target_deployment_id) + ///
global::System.Threading.Tasks.Task> ShadowExperimentServiceListTargetsAsResponseAsync( string projectId, string endpointId, diff --git a/src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceUpdateShadowExperiment.g.cs b/src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceUpdateShadowExperiment.g.cs index dc54374a..16181b5b 100644 --- a/src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceUpdateShadowExperiment.g.cs +++ b/src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceUpdateShadowExperiment.g.cs @@ -24,6 +24,19 @@ public partial interface IShadowExperimentServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// experiment = client.beta.endpoints.shadow_experiments.update(
+ /// "exp_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// update_mask="description",
+ /// description="Compare the FP8 config against production",
+ /// )
+ /// print(experiment.description) + ///
global::System.Threading.Tasks.Task ShadowExperimentServiceUpdateShadowExperimentAsync( string projectId, string endpointId, @@ -53,6 +66,19 @@ public partial interface IShadowExperimentServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// experiment = client.beta.endpoints.shadow_experiments.update(
+ /// "exp_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// update_mask="description",
+ /// description="Compare the FP8 config against production",
+ /// )
+ /// print(experiment.description) + ///
global::System.Threading.Tasks.Task> ShadowExperimentServiceUpdateShadowExperimentAsResponseAsync( string projectId, string endpointId, diff --git a/src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceUpdateTarget.g.cs b/src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceUpdateTarget.g.cs index 0fe834d9..bdf72c6a 100644 --- a/src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceUpdateTarget.g.cs +++ b/src/libs/Together/Generated/Together.IShadowExperimentServiceClient.ShadowExperimentServiceUpdateTarget.g.cs @@ -27,6 +27,20 @@ public partial interface IShadowExperimentServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// target = client.beta.endpoints.shadow_experiments.targets.update(
+ /// "tgt_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// experiment_id="exp_abc123",
+ /// update_mask="name",
+ /// name="candidate-fp8",
+ /// )
+ /// print(target.name) + ///
global::System.Threading.Tasks.Task ShadowExperimentServiceUpdateTargetAsync( string projectId, string endpointId, @@ -60,6 +74,20 @@ public partial interface IShadowExperimentServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// target = client.beta.endpoints.shadow_experiments.targets.update(
+ /// "tgt_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// experiment_id="exp_abc123",
+ /// update_mask="name",
+ /// name="candidate-fp8",
+ /// )
+ /// print(target.name) + ///
global::System.Threading.Tasks.Task> ShadowExperimentServiceUpdateTargetAsResponseAsync( string projectId, string endpointId, diff --git a/src/libs/Together/Generated/Together.IShapingClient.CancelShapingJob.g.cs b/src/libs/Together/Generated/Together.IShapingClient.CancelShapingJob.g.cs index 796a6a93..7b6015e9 100644 --- a/src/libs/Together/Generated/Together.IShapingClient.CancelShapingJob.g.cs +++ b/src/libs/Together/Generated/Together.IShapingClient.CancelShapingJob.g.cs @@ -14,6 +14,12 @@ public partial interface IShapingClient /// 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()
+ /// job = client.post_training.prepare_for_fp4_inference.cancel("<JOB_ID>")
+ /// print(job.status) + ///
global::System.Threading.Tasks.Task CancelShapingJobAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -28,6 +34,12 @@ public partial interface IShapingClient /// 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()
+ /// job = client.post_training.prepare_for_fp4_inference.cancel("<JOB_ID>")
+ /// print(job.status) + ///
global::System.Threading.Tasks.Task> CancelShapingJobAsResponseAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, diff --git a/src/libs/Together/Generated/Together.IShapingClient.CreateQuantizationJob.g.cs b/src/libs/Together/Generated/Together.IShapingClient.CreateQuantizationJob.g.cs index ca60dfb7..7fdeccc1 100644 --- a/src/libs/Together/Generated/Together.IShapingClient.CreateQuantizationJob.g.cs +++ b/src/libs/Together/Generated/Together.IShapingClient.CreateQuantizationJob.g.cs @@ -6,12 +6,23 @@ public partial interface IShapingClient { /// /// Prepare a fine-tuned model for FP4 inference
- /// Prepares a fine-tuned model for FP4 inference: an adapter is merged into its base model and the result quantized to FP4; a full model is quantized as it is. The model is resolved when the request is made, so a request naming a model that does not exist in the project, was not produced by fine-tuning, has no base model, or uses an unsupported base model is rejected with 400 rather than accepted and failed later. The request names the model by `model_object_id` (the deprecated `adapter_object_id` is still accepted). The run is priced before it is created, and a project that cannot cover it is answered 402. + /// Merges a fine-tuned adapter into its base model and prepares the result for FP4 inference. The adapter is resolved when the request is made, so a request naming a model that does not exist in the project, is not an adapter, was not produced by fine-tuning, has no base model to merge into, or uses an unsupported base model is rejected with 400 rather than accepted and failed later. The run is priced before it is created, and a project that cannot cover it is answered 402. ///
/// /// 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()
+ /// job = client.post_training.prepare_for_fp4_inference.create(
+ /// inputs={
+ /// "adapter_object_id": "ml_abc123",
+ /// "adapter_revision_id": "rv_abc123",
+ /// },
+ /// )
+ /// print(job.id, job.status) + ///
global::System.Threading.Tasks.Task CreateQuantizationJobAsync( global::Together.QuantizationRequest request, @@ -19,12 +30,23 @@ public partial interface IShapingClient global::System.Threading.CancellationToken cancellationToken = default); /// /// Prepare a fine-tuned model for FP4 inference
- /// Prepares a fine-tuned model for FP4 inference: an adapter is merged into its base model and the result quantized to FP4; a full model is quantized as it is. The model is resolved when the request is made, so a request naming a model that does not exist in the project, was not produced by fine-tuning, has no base model, or uses an unsupported base model is rejected with 400 rather than accepted and failed later. The request names the model by `model_object_id` (the deprecated `adapter_object_id` is still accepted). The run is priced before it is created, and a project that cannot cover it is answered 402. + /// Merges a fine-tuned adapter into its base model and prepares the result for FP4 inference. The adapter is resolved when the request is made, so a request naming a model that does not exist in the project, is not an adapter, was not produced by fine-tuning, has no base model to merge into, or uses an unsupported base model is rejected with 400 rather than accepted and failed later. The run is priced before it is created, and a project that cannot cover it is answered 402. ///
/// /// 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()
+ /// job = client.post_training.prepare_for_fp4_inference.create(
+ /// inputs={
+ /// "adapter_object_id": "ml_abc123",
+ /// "adapter_revision_id": "rv_abc123",
+ /// },
+ /// )
+ /// print(job.id, job.status) + ///
global::System.Threading.Tasks.Task> CreateQuantizationJobAsResponseAsync( global::Together.QuantizationRequest request, @@ -32,11 +54,11 @@ public partial interface IShapingClient global::System.Threading.CancellationToken cancellationToken = default); /// /// Prepare a fine-tuned model for FP4 inference
- /// Prepares a fine-tuned model for FP4 inference: an adapter is merged into its base model and the result quantized to FP4; a full model is quantized as it is. The model is resolved when the request is made, so a request naming a model that does not exist in the project, was not produced by fine-tuning, has no base model, or uses an unsupported base model is rejected with 400 rather than accepted and failed later. The request names the model by `model_object_id` (the deprecated `adapter_object_id` is still accepted). The run is priced before it is created, and a project that cannot cover it is answered 402. + /// Merges a fine-tuned adapter into its base model and prepares the result for FP4 inference. The adapter is resolved when the request is made, so a request naming a model that does not exist in the project, is not an adapter, was not produced by fine-tuning, has no base model to merge into, or uses an unsupported base model is rejected with 400 rather than accepted and failed later. The run is priced before it is created, and a project that cannot cover it is answered 402. ///
/// - /// Inputs naming the fine-tuned model to prepare.
- /// Example: {"model_object_id":"ml_CeG3fF6pyEViU8dE8pk7R","model_revision_id":"rv_CeG3faPBj2ABwbAaHPTmx","calibration_file_id":"file-5f1b0c7a-2d19-4a3e-9c60-8ab41c2f7d35"} + /// Adapter inputs to prepare.
+ /// Example: {"adapter_object_id":"ml_CeG3fF6pyEViU8dE8pk7R","adapter_revision_id":"rv_CeG3faPBj2ABwbAaHPTmx","calibration_file_id":"file-5f1b0c7a-2d19-4a3e-9c60-8ab41c2f7d35"} /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with diff --git a/src/libs/Together/Generated/Together.IShapingClient.EstimateQuantizationJob.g.cs b/src/libs/Together/Generated/Together.IShapingClient.EstimateQuantizationJob.g.cs index d578b806..76af8bc9 100644 --- a/src/libs/Together/Generated/Together.IShapingClient.EstimateQuantizationJob.g.cs +++ b/src/libs/Together/Generated/Together.IShapingClient.EstimateQuantizationJob.g.cs @@ -6,12 +6,23 @@ public partial interface IShapingClient { /// /// Estimate FP4 preparation cost
- /// Reports the price and expected wall-clock time for preparing the model named by `model_object_id` or the deprecated `adapter_object_id` without creating a job. The request body is the same as POST /shaping/prepare-for-fp4-inference, so a caller can price exactly the job it is about to submit. + /// Reports the price and expected wall-clock time for preparing the named adapter without creating a job. The request body is the same as POST /shaping/prepare-for-fp4-inference, so a caller can price exactly the job it is about to submit. ///
/// /// 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()
+ /// estimate = client.post_training.prepare_for_fp4_inference.estimate_cost(
+ /// inputs={
+ /// "adapter_object_id": "ml_abc123",
+ /// "adapter_revision_id": "rv_abc123",
+ /// },
+ /// )
+ /// print(estimate.price_usd, estimate.time_hours, estimate.allowed_to_proceed) + ///
global::System.Threading.Tasks.Task EstimateQuantizationJobAsync( global::Together.QuantizationRequest request, @@ -19,12 +30,23 @@ public partial interface IShapingClient global::System.Threading.CancellationToken cancellationToken = default); /// /// Estimate FP4 preparation cost
- /// Reports the price and expected wall-clock time for preparing the model named by `model_object_id` or the deprecated `adapter_object_id` without creating a job. The request body is the same as POST /shaping/prepare-for-fp4-inference, so a caller can price exactly the job it is about to submit. + /// Reports the price and expected wall-clock time for preparing the named adapter without creating a job. The request body is the same as POST /shaping/prepare-for-fp4-inference, so a caller can price exactly the job it is about to submit. ///
/// /// 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()
+ /// estimate = client.post_training.prepare_for_fp4_inference.estimate_cost(
+ /// inputs={
+ /// "adapter_object_id": "ml_abc123",
+ /// "adapter_revision_id": "rv_abc123",
+ /// },
+ /// )
+ /// print(estimate.price_usd, estimate.time_hours, estimate.allowed_to_proceed) + ///
global::System.Threading.Tasks.Task> EstimateQuantizationJobAsResponseAsync( global::Together.QuantizationRequest request, @@ -32,11 +54,11 @@ public partial interface IShapingClient global::System.Threading.CancellationToken cancellationToken = default); /// /// Estimate FP4 preparation cost
- /// Reports the price and expected wall-clock time for preparing the model named by `model_object_id` or the deprecated `adapter_object_id` without creating a job. The request body is the same as POST /shaping/prepare-for-fp4-inference, so a caller can price exactly the job it is about to submit. + /// Reports the price and expected wall-clock time for preparing the named adapter without creating a job. The request body is the same as POST /shaping/prepare-for-fp4-inference, so a caller can price exactly the job it is about to submit. ///
/// - /// Inputs naming the fine-tuned model to prepare.
- /// Example: {"model_object_id":"ml_CeG3fF6pyEViU8dE8pk7R","model_revision_id":"rv_CeG3faPBj2ABwbAaHPTmx","calibration_file_id":"file-5f1b0c7a-2d19-4a3e-9c60-8ab41c2f7d35"} + /// Adapter inputs to prepare.
+ /// Example: {"adapter_object_id":"ml_CeG3fF6pyEViU8dE8pk7R","adapter_revision_id":"rv_CeG3faPBj2ABwbAaHPTmx","calibration_file_id":"file-5f1b0c7a-2d19-4a3e-9c60-8ab41c2f7d35"} /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with diff --git a/src/libs/Together/Generated/Together.IShapingClient.GetShapingEvents.g.cs b/src/libs/Together/Generated/Together.IShapingClient.GetShapingEvents.g.cs index 8f373ed1..5c35c28c 100644 --- a/src/libs/Together/Generated/Together.IShapingClient.GetShapingEvents.g.cs +++ b/src/libs/Together/Generated/Together.IShapingClient.GetShapingEvents.g.cs @@ -14,6 +14,15 @@ public partial interface IShapingClient /// 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()
+ /// events = client.post_training.prepare_for_fp4_inference.list_events(
+ /// "<JOB_ID>",
+ /// )
+ /// for event in events.data:
+ /// print(event) + ///
global::System.Threading.Tasks.Task GetShapingEventsAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -28,6 +37,15 @@ public partial interface IShapingClient /// 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()
+ /// events = client.post_training.prepare_for_fp4_inference.list_events(
+ /// "<JOB_ID>",
+ /// )
+ /// for event in events.data:
+ /// print(event) + ///
global::System.Threading.Tasks.Task> GetShapingEventsAsResponseAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, diff --git a/src/libs/Together/Generated/Together.IShapingClient.GetShapingJob.g.cs b/src/libs/Together/Generated/Together.IShapingClient.GetShapingJob.g.cs index 6e52e16b..f9854961 100644 --- a/src/libs/Together/Generated/Together.IShapingClient.GetShapingJob.g.cs +++ b/src/libs/Together/Generated/Together.IShapingClient.GetShapingJob.g.cs @@ -14,6 +14,12 @@ public partial interface IShapingClient /// 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()
+ /// job = client.post_training.prepare_for_fp4_inference.retrieve("<JOB_ID>")
+ /// print(job.status) + ///
global::System.Threading.Tasks.Task GetShapingJobAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -28,6 +34,12 @@ public partial interface IShapingClient /// 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()
+ /// job = client.post_training.prepare_for_fp4_inference.retrieve("<JOB_ID>")
+ /// print(job.status) + ///
global::System.Threading.Tasks.Task> GetShapingJobAsResponseAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, diff --git a/src/libs/Together/Generated/Together.IShapingClient.ListShapingJobs.g.cs b/src/libs/Together/Generated/Together.IShapingClient.ListShapingJobs.g.cs index c9544c47..fb9200ef 100644 --- a/src/libs/Together/Generated/Together.IShapingClient.ListShapingJobs.g.cs +++ b/src/libs/Together/Generated/Together.IShapingClient.ListShapingJobs.g.cs @@ -11,6 +11,13 @@ public partial interface IShapingClient /// 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()
+ /// jobs = client.post_training.prepare_for_fp4_inference.list()
+ /// for job in jobs.data:
+ /// print(job.id, job.status) + ///
global::System.Threading.Tasks.Task ListShapingJobsAsync( global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); @@ -21,6 +28,13 @@ public partial interface IShapingClient /// 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()
+ /// jobs = client.post_training.prepare_for_fp4_inference.list()
+ /// for job in jobs.data:
+ /// print(job.id, job.status) + ///
global::System.Threading.Tasks.Task> ListShapingJobsAsResponseAsync( global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); diff --git a/src/libs/Together/Generated/Together.IShapingClient.g.cs b/src/libs/Together/Generated/Together.IShapingClient.g.cs index e95d26a5..c422cf2f 100644 --- a/src/libs/Together/Generated/Together.IShapingClient.g.cs +++ b/src/libs/Together/Generated/Together.IShapingClient.g.cs @@ -19,6 +19,27 @@ public partial interface IShapingClient : global::System.IDisposable /// public System.Uri? BaseUri { get; } + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers { get; } + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer { get; set; } + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId); + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer(); + /// /// The authorizations to use for the requests. /// diff --git a/src/libs/Together/Generated/Together.ISharedVolumeServiceClient.SharedVolumeServiceCreate.g.cs b/src/libs/Together/Generated/Together.ISharedVolumeServiceClient.SharedVolumeServiceCreate.g.cs index a7aa1975..798c0105 100644 --- a/src/libs/Together/Generated/Together.ISharedVolumeServiceClient.SharedVolumeServiceCreate.g.cs +++ b/src/libs/Together/Generated/Together.ISharedVolumeServiceClient.SharedVolumeServiceCreate.g.cs @@ -14,6 +14,15 @@ public partial interface ISharedVolumeServiceClient /// 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()
+ /// volume = client.beta.clusters.storage.create(
+ /// volume_name="my-shared-volume",
+ /// size_tib=2,
+ /// region="us-west-2"
+ /// ) + ///
global::System.Threading.Tasks.Task SharedVolumeServiceCreateAsync( global::Together.GPUClustersSharedVolumeCreateRequest request, @@ -29,6 +38,15 @@ public partial interface ISharedVolumeServiceClient /// 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()
+ /// volume = client.beta.clusters.storage.create(
+ /// volume_name="my-shared-volume",
+ /// size_tib=2,
+ /// region="us-west-2"
+ /// ) + ///
global::System.Threading.Tasks.Task> SharedVolumeServiceCreateAsResponseAsync( global::Together.GPUClustersSharedVolumeCreateRequest request, @@ -56,7 +74,7 @@ public partial interface ISharedVolumeServiceClient /// Project ID that will own the volume. When omitted, the caller's default project is used. /// /// - /// Cluster ID to place the volume on the same infrastructure as that GPU cluster. + /// Cluster ID to pin the volume to the same substrate as that GPU cluster. /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with diff --git a/src/libs/Together/Generated/Together.ISharedVolumeServiceClient.SharedVolumeServiceDelete.g.cs b/src/libs/Together/Generated/Together.ISharedVolumeServiceClient.SharedVolumeServiceDelete.g.cs index 7f768afa..8d4e8c66 100644 --- a/src/libs/Together/Generated/Together.ISharedVolumeServiceClient.SharedVolumeServiceDelete.g.cs +++ b/src/libs/Together/Generated/Together.ISharedVolumeServiceClient.SharedVolumeServiceDelete.g.cs @@ -14,6 +14,12 @@ public partial interface ISharedVolumeServiceClient /// 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()
+ /// volume = client.beta.clusters.storage.delete("volume_id")
+ /// print(volume) + ///
global::System.Threading.Tasks.Task SharedVolumeServiceDeleteAsync( string volumeId, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -28,6 +34,12 @@ public partial interface ISharedVolumeServiceClient /// 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()
+ /// volume = client.beta.clusters.storage.delete("volume_id")
+ /// print(volume) + ///
global::System.Threading.Tasks.Task> SharedVolumeServiceDeleteAsResponseAsync( string volumeId, global::Together.AutoSDKRequestOptions? requestOptions = default, diff --git a/src/libs/Together/Generated/Together.ISharedVolumeServiceClient.SharedVolumeServiceGet.g.cs b/src/libs/Together/Generated/Together.ISharedVolumeServiceClient.SharedVolumeServiceGet.g.cs index bddc3a18..56226dcc 100644 --- a/src/libs/Together/Generated/Together.ISharedVolumeServiceClient.SharedVolumeServiceGet.g.cs +++ b/src/libs/Together/Generated/Together.ISharedVolumeServiceClient.SharedVolumeServiceGet.g.cs @@ -14,6 +14,12 @@ public partial interface ISharedVolumeServiceClient /// 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()
+ /// volume = client.beta.clusters.storage.retrieve("volume_id")
+ /// print(volume) + ///
global::System.Threading.Tasks.Task SharedVolumeServiceGetAsync( string volumeId, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -28,6 +34,12 @@ public partial interface ISharedVolumeServiceClient /// 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()
+ /// volume = client.beta.clusters.storage.retrieve("volume_id")
+ /// print(volume) + ///
global::System.Threading.Tasks.Task> SharedVolumeServiceGetAsResponseAsync( string volumeId, global::Together.AutoSDKRequestOptions? requestOptions = default, diff --git a/src/libs/Together/Generated/Together.ISharedVolumeServiceClient.SharedVolumeServiceList.g.cs b/src/libs/Together/Generated/Together.ISharedVolumeServiceClient.SharedVolumeServiceList.g.cs index 3d0e7803..2b184fe0 100644 --- a/src/libs/Together/Generated/Together.ISharedVolumeServiceClient.SharedVolumeServiceList.g.cs +++ b/src/libs/Together/Generated/Together.ISharedVolumeServiceClient.SharedVolumeServiceList.g.cs @@ -16,6 +16,12 @@ public partial interface ISharedVolumeServiceClient /// 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()
+ /// volumes = client.beta.clusters.storage.list()
+ /// print(volumes) + ///
global::System.Threading.Tasks.Task SharedVolumeServiceListAsync( string? projectId = default, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -32,6 +38,12 @@ public partial interface ISharedVolumeServiceClient /// 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()
+ /// volumes = client.beta.clusters.storage.list()
+ /// print(volumes) + ///
global::System.Threading.Tasks.Task> SharedVolumeServiceListAsResponseAsync( string? projectId = default, global::Together.AutoSDKRequestOptions? requestOptions = default, diff --git a/src/libs/Together/Generated/Together.ISharedVolumeServiceClient.SharedVolumeServiceUpdate.g.cs b/src/libs/Together/Generated/Together.ISharedVolumeServiceClient.SharedVolumeServiceUpdate.g.cs index 326ba4df..b3deec36 100644 --- a/src/libs/Together/Generated/Together.ISharedVolumeServiceClient.SharedVolumeServiceUpdate.g.cs +++ b/src/libs/Together/Generated/Together.ISharedVolumeServiceClient.SharedVolumeServiceUpdate.g.cs @@ -12,6 +12,15 @@ public partial interface ISharedVolumeServiceClient /// 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()
+ /// volume = client.beta.clusters.storage.update(
+ /// volume_id="12345-67890-12345-67890",
+ /// size_tib=3
+ /// )
+ /// print(volume) + ///
global::System.Threading.Tasks.Task SharedVolumeServiceUpdateAsync( global::Together.GPUClustersSharedVolumeUpdateRequest request, @@ -25,6 +34,15 @@ public partial interface ISharedVolumeServiceClient /// 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()
+ /// volume = client.beta.clusters.storage.update(
+ /// volume_id="12345-67890-12345-67890",
+ /// size_tib=3
+ /// )
+ /// print(volume) + ///
global::System.Threading.Tasks.Task> SharedVolumeServiceUpdateAsResponseAsync( global::Together.GPUClustersSharedVolumeUpdateRequest request, diff --git a/src/libs/Together/Generated/Together.ISharedVolumeServiceClient.g.cs b/src/libs/Together/Generated/Together.ISharedVolumeServiceClient.g.cs index 6e603324..ecdec596 100644 --- a/src/libs/Together/Generated/Together.ISharedVolumeServiceClient.g.cs +++ b/src/libs/Together/Generated/Together.ISharedVolumeServiceClient.g.cs @@ -19,6 +19,27 @@ public partial interface ISharedVolumeServiceClient : global::System.IDisposable /// public System.Uri? BaseUri { get; } + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers { get; } + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer { get; set; } + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId); + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer(); + /// /// The authorizations to use for the requests. /// diff --git a/src/libs/Together/Generated/Together.ISupportedModelsServiceClient.SupportedModelsServiceGetSupportedModel.g.cs b/src/libs/Together/Generated/Together.ISupportedModelsServiceClient.SupportedModelsServiceGetSupportedModel.g.cs index 3a76dff5..df5077c7 100644 --- a/src/libs/Together/Generated/Together.ISupportedModelsServiceClient.SupportedModelsServiceGetSupportedModel.g.cs +++ b/src/libs/Together/Generated/Together.ISupportedModelsServiceClient.SupportedModelsServiceGetSupportedModel.g.cs @@ -14,6 +14,12 @@ public partial interface ISupportedModelsServiceClient /// 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()
+ /// model = client.beta.models.retrieve_supported("arch_abc123")
+ /// print(model.name, model.deployment_profiles) + ///
global::System.Threading.Tasks.Task SupportedModelsServiceGetSupportedModelAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -28,6 +34,12 @@ public partial interface ISupportedModelsServiceClient /// 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()
+ /// model = client.beta.models.retrieve_supported("arch_abc123")
+ /// print(model.name, model.deployment_profiles) + ///
global::System.Threading.Tasks.Task> SupportedModelsServiceGetSupportedModelAsResponseAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, diff --git a/src/libs/Together/Generated/Together.ISupportedModelsServiceClient.SupportedModelsServiceListSupportedModels.g.cs b/src/libs/Together/Generated/Together.ISupportedModelsServiceClient.SupportedModelsServiceListSupportedModels.g.cs index 5986aca1..3a88c47a 100644 --- a/src/libs/Together/Generated/Together.ISupportedModelsServiceClient.SupportedModelsServiceListSupportedModels.g.cs +++ b/src/libs/Together/Generated/Together.ISupportedModelsServiceClient.SupportedModelsServiceListSupportedModels.g.cs @@ -29,6 +29,13 @@ public partial interface ISupportedModelsServiceClient /// 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()
+ /// models = client.beta.models.list_supported(product="PRODUCT_DEDICATED")
+ /// for model in models:
+ /// print(model.id, model.name) + ///
global::System.Threading.Tasks.Task SupportedModelsServiceListSupportedModelsAsync( global::Together.SupportedModelsServiceListSupportedModelsModality? modality = default, global::Together.SupportedModelsServiceListSupportedModelsProduct? product = default, @@ -63,6 +70,13 @@ public partial interface ISupportedModelsServiceClient /// 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()
+ /// models = client.beta.models.list_supported(product="PRODUCT_DEDICATED")
+ /// for model in models:
+ /// print(model.id, model.name) + ///
global::System.Threading.Tasks.Task> SupportedModelsServiceListSupportedModelsAsResponseAsync( global::Together.SupportedModelsServiceListSupportedModelsModality? modality = default, global::Together.SupportedModelsServiceListSupportedModelsProduct? product = default, diff --git a/src/libs/Together/Generated/Together.ITogetherClient.g.cs b/src/libs/Together/Generated/Together.ITogetherClient.g.cs index fc2731b6..4be80f92 100644 --- a/src/libs/Together/Generated/Together.ITogetherClient.g.cs +++ b/src/libs/Together/Generated/Together.ITogetherClient.g.cs @@ -100,6 +100,11 @@ public partial interface ITogetherClient : global::System.IDisposable /// public ChatClient Chat { get; } + /// + /// + /// + public CodeInterpreterClient CodeInterpreter { get; } + /// /// /// @@ -140,6 +145,16 @@ public partial interface ITogetherClient : global::System.IDisposable /// public EndpointServiceClient EndpointService { get; } + /// + /// + /// + public EndpointsClient Endpoints { get; } + + /// + /// + /// + public Endpoints2Client Endpoints2 { get; } + /// /// /// @@ -160,6 +175,11 @@ public partial interface ITogetherClient : global::System.IDisposable /// public GPUClusterServiceClient GPUClusterService { get; } + /// + /// + /// + public HardwareClient Hardware { get; } + /// /// /// @@ -180,6 +200,16 @@ public partial interface ITogetherClient : global::System.IDisposable /// public InstanceTypeServiceClient InstanceTypeService { get; } + /// + /// + /// + public JobsClient Jobs { get; } + + /// + /// + /// + public ModelsClient Models { get; } + /// /// /// diff --git a/src/libs/Together/Generated/Together.IVideoClient.CreateVideo.g.cs b/src/libs/Together/Generated/Together.IVideoClient.CreateVideo.g.cs index 6d7520b8..485db5b2 100644 --- a/src/libs/Together/Generated/Together.IVideoClient.CreateVideo.g.cs +++ b/src/libs/Together/Generated/Together.IVideoClient.CreateVideo.g.cs @@ -1,5 +1,7 @@ #nullable enable +#pragma warning disable CS0618 // Type or member is obsolete + namespace Together { public partial interface IVideoClient @@ -12,6 +14,18 @@ public partial interface IVideoClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.videos.create(
+ /// model="minimax/video-01-director",
+ /// prompt="A cartoon of an astronaut riding a horse on the moon"
+ /// )
+ /// print(response.id) + ///
global::System.Threading.Tasks.Task CreateVideoAsync( global::Together.CreateVideoBody request, @@ -25,6 +39,18 @@ public partial interface IVideoClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.videos.create(
+ /// model="minimax/video-01-director",
+ /// prompt="A cartoon of an astronaut riding a horse on the moon"
+ /// )
+ /// print(response.id) + ///
global::System.Threading.Tasks.Task> CreateVideoAsResponseAsync( global::Together.CreateVideoBody request, diff --git a/src/libs/Together/Generated/Together.IVideoClient.RetrieveVideo.g.cs b/src/libs/Together/Generated/Together.IVideoClient.RetrieveVideo.g.cs index 421f5504..6b94a9f9 100644 --- a/src/libs/Together/Generated/Together.IVideoClient.RetrieveVideo.g.cs +++ b/src/libs/Together/Generated/Together.IVideoClient.RetrieveVideo.g.cs @@ -14,6 +14,15 @@ public partial interface IVideoClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.videos.retrieve("<VIDEO_ID>")
+ /// print(response.status) + ///
global::System.Threading.Tasks.Task RetrieveVideoAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -28,6 +37,15 @@ public partial interface IVideoClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.videos.retrieve("<VIDEO_ID>")
+ /// print(response.status) + ///
global::System.Threading.Tasks.Task> RetrieveVideoAsResponseAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, diff --git a/src/libs/Together/Generated/Together.IVoicesClient.FetchVoices.g.cs b/src/libs/Together/Generated/Together.IVoicesClient.FetchVoices.g.cs index 0cff2084..90ef9327 100644 --- a/src/libs/Together/Generated/Together.IVoicesClient.FetchVoices.g.cs +++ b/src/libs/Together/Generated/Together.IVoicesClient.FetchVoices.g.cs @@ -11,6 +11,15 @@ public partial interface IVoicesClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.audio.voices.list()
+ /// print(response.data) + ///
global::System.Threading.Tasks.Task FetchVoicesAsync( global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); @@ -21,6 +30,15 @@ public partial interface IVoicesClient /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.audio.voices.list()
+ /// print(response.data) + ///
global::System.Threading.Tasks.Task> FetchVoicesAsResponseAsync( global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); diff --git a/src/libs/Together/Generated/Together.IVoicesClient.g.cs b/src/libs/Together/Generated/Together.IVoicesClient.g.cs index 64adadd9..4d43c4fc 100644 --- a/src/libs/Together/Generated/Together.IVoicesClient.g.cs +++ b/src/libs/Together/Generated/Together.IVoicesClient.g.cs @@ -19,6 +19,27 @@ public partial interface IVoicesClient : global::System.IDisposable /// public System.Uri? BaseUri { get; } + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers { get; } + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer { get; set; } + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId); + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer(); + /// /// The authorizations to use for the requests. /// diff --git a/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceCreateModel.g.cs b/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceCreateModel.g.cs index 0e1b4451..9cf47f52 100644 --- a/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceCreateModel.g.cs +++ b/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceCreateModel.g.cs @@ -15,6 +15,18 @@ public partial interface IVolumeServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// model = client.beta.models.create(
+ /// project_id=project_id,
+ /// type="adapter",
+ /// name="my-lora-adapter",
+ /// base_model_id="ml_abc123",
+ /// )
+ /// print(model.id) + ///
global::System.Threading.Tasks.Task VolumeServiceCreateModelAsync( string projectId, @@ -32,6 +44,18 @@ public partial interface IVolumeServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// model = client.beta.models.create(
+ /// project_id=project_id,
+ /// type="adapter",
+ /// name="my-lora-adapter",
+ /// base_model_id="ml_abc123",
+ /// )
+ /// print(model.id) + ///
global::System.Threading.Tasks.Task> VolumeServiceCreateModelAsResponseAsync( string projectId, diff --git a/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceCreateRemoteModelUpload.g.cs b/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceCreateRemoteModelUpload.g.cs index 2345a18d..f7fbc16b 100644 --- a/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceCreateRemoteModelUpload.g.cs +++ b/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceCreateRemoteModelUpload.g.cs @@ -15,6 +15,17 @@ public partial interface IVolumeServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// job = client.beta.models.remote_uploads.create(
+ /// project_id=project_id,
+ /// model_id="ml_abc123",
+ /// remote_url="https://huggingface.co/your-org/your-adapter",
+ /// )
+ /// print(job) + ///
global::System.Threading.Tasks.Task VolumeServiceCreateRemoteModelUploadAsync( string projectId, @@ -32,6 +43,17 @@ public partial interface IVolumeServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// job = client.beta.models.remote_uploads.create(
+ /// project_id=project_id,
+ /// model_id="ml_abc123",
+ /// remote_url="https://huggingface.co/your-org/your-adapter",
+ /// )
+ /// print(job) + ///
global::System.Threading.Tasks.Task> VolumeServiceCreateRemoteModelUploadAsResponseAsync( string projectId, diff --git a/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceDeleteModel.g.cs b/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceDeleteModel.g.cs index 7e0011b8..d4b6a3a7 100644 --- a/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceDeleteModel.g.cs +++ b/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceDeleteModel.g.cs @@ -17,6 +17,12 @@ public partial interface IVolumeServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// client.beta.models.delete("ml_abc123", project_id=project_id) + ///
global::System.Threading.Tasks.Task VolumeServiceDeleteModelAsync( string projectId, string id, @@ -35,6 +41,12 @@ public partial interface IVolumeServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// client.beta.models.delete("ml_abc123", project_id=project_id) + ///
global::System.Threading.Tasks.Task> VolumeServiceDeleteModelAsResponseAsync( string projectId, string id, diff --git a/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceGetModel.g.cs b/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceGetModel.g.cs index 38827559..a3940f9f 100644 --- a/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceGetModel.g.cs +++ b/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceGetModel.g.cs @@ -17,6 +17,13 @@ public partial interface IVolumeServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// model = client.beta.models.retrieve("ml_abc123", project_id=project_id)
+ /// print(model.id, model.name) + ///
global::System.Threading.Tasks.Task VolumeServiceGetModelAsync( string projectId, string id, @@ -35,6 +42,13 @@ public partial interface IVolumeServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// model = client.beta.models.retrieve("ml_abc123", project_id=project_id)
+ /// print(model.id, model.name) + ///
global::System.Threading.Tasks.Task> VolumeServiceGetModelAsResponseAsync( string projectId, string id, diff --git a/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceGetRemoteModelUpload.g.cs b/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceGetRemoteModelUpload.g.cs index 803e12a8..8e8a12f8 100644 --- a/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceGetRemoteModelUpload.g.cs +++ b/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceGetRemoteModelUpload.g.cs @@ -17,6 +17,16 @@ public partial interface IVolumeServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// job = client.beta.models.remote_uploads.retrieve(
+ /// "job_abc123",
+ /// project_id=project_id,
+ /// )
+ /// print(job) + ///
global::System.Threading.Tasks.Task VolumeServiceGetRemoteModelUploadAsync( string projectId, string id, @@ -35,6 +45,16 @@ public partial interface IVolumeServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// job = client.beta.models.remote_uploads.retrieve(
+ /// "job_abc123",
+ /// project_id=project_id,
+ /// )
+ /// print(job) + ///
global::System.Threading.Tasks.Task> VolumeServiceGetRemoteModelUploadAsResponseAsync( string projectId, string id, diff --git a/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceGetRevisionByModelType.g.cs b/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceGetRevisionByModelType.g.cs index 8ca7f16d..4798059b 100644 --- a/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceGetRevisionByModelType.g.cs +++ b/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceGetRevisionByModelType.g.cs @@ -20,6 +20,19 @@ public partial interface IVolumeServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// # The SDK has no dedicated method for this endpoint yet, so call it with
+ /// # the client's generic GET helper.
+ /// url = (
+ /// f"https://api.together.ai/v2/projects/{project_id}"
+ /// "/models/ml_abc123/revisions/rv_abc123"
+ /// )
+ /// revision = client.get(url, cast_to=object)
+ /// print(revision) + ///
global::System.Threading.Tasks.Task VolumeServiceGetRevisionByModelTypeAsync( string projectId, string id, @@ -42,6 +55,19 @@ public partial interface IVolumeServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// # The SDK has no dedicated method for this endpoint yet, so call it with
+ /// # the client's generic GET helper.
+ /// url = (
+ /// f"https://api.together.ai/v2/projects/{project_id}"
+ /// "/models/ml_abc123/revisions/rv_abc123"
+ /// )
+ /// revision = client.get(url, cast_to=object)
+ /// print(revision) + ///
global::System.Threading.Tasks.Task> VolumeServiceGetRevisionByModelTypeAsResponseAsync( string projectId, string id, diff --git a/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceListModelFiles.g.cs b/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceListModelFiles.g.cs index f4a50181..53d4f1cc 100644 --- a/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceListModelFiles.g.cs +++ b/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceListModelFiles.g.cs @@ -20,6 +20,13 @@ public partial interface IVolumeServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// files = client.beta.models.list_files("ml_abc123", project_id=project_id)
+ /// print(files) + ///
global::System.Threading.Tasks.Task VolumeServiceListModelFilesAsync( string projectId, string id, @@ -42,6 +49,13 @@ public partial interface IVolumeServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// files = client.beta.models.list_files("ml_abc123", project_id=project_id)
+ /// print(files) + ///
global::System.Threading.Tasks.Task> VolumeServiceListModelFilesAsResponseAsync( string projectId, string id, diff --git a/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceListModelRevisions.g.cs b/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceListModelRevisions.g.cs index bf016dbe..2d90c871 100644 --- a/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceListModelRevisions.g.cs +++ b/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceListModelRevisions.g.cs @@ -17,6 +17,16 @@ public partial interface IVolumeServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// revisions = client.beta.models.list_revisions(
+ /// "ml_abc123",
+ /// project_id=project_id,
+ /// )
+ /// print(revisions) + ///
global::System.Threading.Tasks.Task VolumeServiceListModelRevisionsAsync( string projectId, string id, @@ -35,6 +45,16 @@ public partial interface IVolumeServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// revisions = client.beta.models.list_revisions(
+ /// "ml_abc123",
+ /// project_id=project_id,
+ /// )
+ /// print(revisions) + ///
global::System.Threading.Tasks.Task> VolumeServiceListModelRevisionsAsResponseAsync( string projectId, string id, diff --git a/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceListModels.g.cs b/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceListModels.g.cs index 9c7b0169..8074a470 100644 --- a/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceListModels.g.cs +++ b/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceListModels.g.cs @@ -26,6 +26,13 @@ public partial interface IVolumeServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// for model in client.beta.models.list(project_id=project_id):
+ /// print(model.id, model.name) + ///
global::System.Threading.Tasks.Task VolumeServiceListModelsAsync( string projectId, global::Together.VolumeServiceListModelsVisibility? visibility = default, @@ -56,6 +63,13 @@ public partial interface IVolumeServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// for model in client.beta.models.list(project_id=project_id):
+ /// print(model.id, model.name) + ///
global::System.Threading.Tasks.Task> VolumeServiceListModelsAsResponseAsync( string projectId, global::Together.VolumeServiceListModelsVisibility? visibility = default, diff --git a/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceListOrganizationModels.g.cs b/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceListOrganizationModels.g.cs index 05db782d..e6eb7f2a 100644 --- a/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceListOrganizationModels.g.cs +++ b/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceListOrganizationModels.g.cs @@ -20,6 +20,13 @@ public partial interface IVolumeServiceClient /// 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()
+ /// organization_id = client.whoami().organization_id
+ /// for model in client.beta.models.list_org_scoped(organization_id):
+ /// print(model.id, model.name) + ///
global::System.Threading.Tasks.Task VolumeServiceListOrganizationModelsAsync( string organizationId, int? limit = default, @@ -42,6 +49,13 @@ public partial interface IVolumeServiceClient /// 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()
+ /// organization_id = client.whoami().organization_id
+ /// for model in client.beta.models.list_org_scoped(organization_id):
+ /// print(model.id, model.name) + ///
global::System.Threading.Tasks.Task> VolumeServiceListOrganizationModelsAsResponseAsync( string organizationId, int? limit = default, diff --git a/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceListRemoteModelUploadEvents.g.cs b/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceListRemoteModelUploadEvents.g.cs index 31b68346..f723b8bf 100644 --- a/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceListRemoteModelUploadEvents.g.cs +++ b/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceListRemoteModelUploadEvents.g.cs @@ -23,6 +23,16 @@ public partial interface IVolumeServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// events = client.beta.models.remote_uploads.events(
+ /// "job_abc123",
+ /// project_id=project_id,
+ /// )
+ /// print(events) + ///
global::System.Threading.Tasks.Task VolumeServiceListRemoteModelUploadEventsAsync( string projectId, string id, @@ -49,6 +59,16 @@ public partial interface IVolumeServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// events = client.beta.models.remote_uploads.events(
+ /// "job_abc123",
+ /// project_id=project_id,
+ /// )
+ /// print(events) + ///
global::System.Threading.Tasks.Task> VolumeServiceListRemoteModelUploadEventsAsResponseAsync( string projectId, string id, diff --git a/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceListRemoteModelUploads.g.cs b/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceListRemoteModelUploads.g.cs index f00bca14..71cf31e0 100644 --- a/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceListRemoteModelUploads.g.cs +++ b/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceListRemoteModelUploads.g.cs @@ -20,6 +20,13 @@ public partial interface IVolumeServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// for job in client.beta.models.remote_uploads.list(project_id=project_id):
+ /// print(job.id, job.status) + ///
global::System.Threading.Tasks.Task VolumeServiceListRemoteModelUploadsAsync( string projectId, int? limit = default, @@ -42,6 +49,13 @@ public partial interface IVolumeServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// for job in client.beta.models.remote_uploads.list(project_id=project_id):
+ /// print(job.id, job.status) + ///
global::System.Threading.Tasks.Task> VolumeServiceListRemoteModelUploadsAsResponseAsync( string projectId, int? limit = default, diff --git a/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceUpdateModel.g.cs b/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceUpdateModel.g.cs index 917ec2a3..b0dc27ff 100644 --- a/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceUpdateModel.g.cs +++ b/src/libs/Together/Generated/Together.IVolumeServiceClient.VolumeServiceUpdateModel.g.cs @@ -21,6 +21,18 @@ public partial interface IVolumeServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// model = client.beta.models.update(
+ /// "ml_abc123",
+ /// project_id=project_id,
+ /// update_mask="description",
+ /// description="LoRA adapter for support-ticket triage",
+ /// )
+ /// print(model.description) + ///
global::System.Threading.Tasks.Task VolumeServiceUpdateModelAsync( string projectId, string id, @@ -46,6 +58,18 @@ public partial interface IVolumeServiceClient /// 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()
+ /// project_id = client.whoami().project_id
+ /// model = client.beta.models.update(
+ /// "ml_abc123",
+ /// project_id=project_id,
+ /// update_mask="description",
+ /// description="LoRA adapter for support-ticket triage",
+ /// )
+ /// print(model.description) + ///
global::System.Threading.Tasks.Task> VolumeServiceUpdateModelAsResponseAsync( string projectId, string id, diff --git a/src/libs/Together/Generated/Together.IVolumesClient.DeleteDeploymentsStorageVolumesById.g.cs b/src/libs/Together/Generated/Together.IVolumesClient.DeleteDeploymentsStorageVolumesById.g.cs index ae8ed19f..beceda51 100644 --- a/src/libs/Together/Generated/Together.IVolumesClient.DeleteDeploymentsStorageVolumesById.g.cs +++ b/src/libs/Together/Generated/Together.IVolumesClient.DeleteDeploymentsStorageVolumesById.g.cs @@ -14,6 +14,11 @@ public partial interface IVolumesClient /// 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()
+ /// client.beta.jig.volumes.delete("my-volume") + ///
global::System.Threading.Tasks.Task DeleteDeploymentsStorageVolumesByIdAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -28,6 +33,11 @@ public partial interface IVolumesClient /// 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()
+ /// client.beta.jig.volumes.delete("my-volume") + ///
global::System.Threading.Tasks.Task> DeleteDeploymentsStorageVolumesByIdAsResponseAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, diff --git a/src/libs/Together/Generated/Together.IVolumesClient.EditDeploymentsStorageVolumesById.g.cs b/src/libs/Together/Generated/Together.IVolumesClient.EditDeploymentsStorageVolumesById.g.cs index 3851fb34..a3d8b88d 100644 --- a/src/libs/Together/Generated/Together.IVolumesClient.EditDeploymentsStorageVolumesById.g.cs +++ b/src/libs/Together/Generated/Together.IVolumesClient.EditDeploymentsStorageVolumesById.g.cs @@ -15,6 +15,17 @@ public partial interface IVolumesClient /// 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()
+ /// # Point the volume at a new version of its files. The CLI's
+ /// # `tg beta jig volumes update` uploads the files and makes this call for you.
+ /// volume = client.beta.jig.volumes.update(
+ /// "my-volume",
+ /// content={"type": "files", "source_prefix": "my-volume/1"},
+ /// )
+ /// print(volume.current_version) + ///
global::System.Threading.Tasks.Task EditDeploymentsStorageVolumesByIdAsync( string id, @@ -32,6 +43,17 @@ public partial interface IVolumesClient /// 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()
+ /// # Point the volume at a new version of its files. The CLI's
+ /// # `tg beta jig volumes update` uploads the files and makes this call for you.
+ /// volume = client.beta.jig.volumes.update(
+ /// "my-volume",
+ /// content={"type": "files", "source_prefix": "my-volume/1"},
+ /// )
+ /// print(volume.current_version) + ///
global::System.Threading.Tasks.Task> EditDeploymentsStorageVolumesByIdAsResponseAsync( string id, diff --git a/src/libs/Together/Generated/Together.IVolumesClient.GetDeploymentsStorageVolumesById.g.cs b/src/libs/Together/Generated/Together.IVolumesClient.GetDeploymentsStorageVolumesById.g.cs index e553bca8..59678a59 100644 --- a/src/libs/Together/Generated/Together.IVolumesClient.GetDeploymentsStorageVolumesById.g.cs +++ b/src/libs/Together/Generated/Together.IVolumesClient.GetDeploymentsStorageVolumesById.g.cs @@ -17,6 +17,12 @@ public partial interface IVolumesClient /// 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()
+ /// volume = client.beta.jig.volumes.retrieve("my-volume")
+ /// print(volume) + ///
global::System.Threading.Tasks.Task GetDeploymentsStorageVolumesByIdAsync( string id, int? version = default, @@ -35,6 +41,12 @@ public partial interface IVolumesClient /// 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()
+ /// volume = client.beta.jig.volumes.retrieve("my-volume")
+ /// print(volume) + ///
global::System.Threading.Tasks.Task> GetDeploymentsStorageVolumesByIdAsResponseAsync( string id, int? version = default, diff --git a/src/libs/Together/Generated/Together.IVolumesClient.g.cs b/src/libs/Together/Generated/Together.IVolumesClient.g.cs index 745eb93f..309e99ac 100644 --- a/src/libs/Together/Generated/Together.IVolumesClient.g.cs +++ b/src/libs/Together/Generated/Together.IVolumesClient.g.cs @@ -19,6 +19,27 @@ public partial interface IVolumesClient : global::System.IDisposable /// public System.Uri? BaseUri { get; } + + /// + /// The server options available for this client. + /// + public global::System.Collections.Generic.IReadOnlyList AvailableServers { get; } + + /// + /// The currently selected server for this client, if any. + /// + public global::Together.AutoSDKServer? SelectedServer { get; set; } + + /// + /// Selects one of the generated server options by id. + /// + public bool TrySelectServer(string serverId); + + /// + /// Clears the currently selected server. + /// + public void ClearSelectedServer(); + /// /// The authorizations to use for the requests. /// diff --git a/src/libs/Together/Generated/Together.Images.JsonSerializerContext.g.cs b/src/libs/Together/Generated/Together.Images.JsonSerializerContext.g.cs index bda5738e..4c7182c5 100644 --- a/src/libs/Together/Generated/Together.Images.JsonSerializerContext.g.cs +++ b/src/libs/Together/Generated/Together.Images.JsonSerializerContext.g.cs @@ -2,56 +2,7 @@ #nullable enable namespace Together -{ - /// - /// - /// - [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( - DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull - )] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(double))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ImageResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DataItem), TypeInfoPropertyName = "DataItem2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ImageResponseDataB64))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ImageResponseDataUrl))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ImageResponseDataItemDiscriminator))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ImageResponseDataItemDiscriminatorType), TypeInfoPropertyName = "ImageResponseDataItemDiscriminatorType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ImageResponseDataB64Type), TypeInfoPropertyName = "ImageResponseDataB64Type2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ImageResponseDataUrlType), TypeInfoPropertyName = "ImageResponseDataUrlType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateImagesGenerationsRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AnyOf), TypeInfoPropertyName = "AnyOfCreateImagesGenerationsRequestModelString2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateImagesGenerationsRequestModel), TypeInfoPropertyName = "CreateImagesGenerationsRequestModel2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateImagesGenerationsRequestResponseFormat), TypeInfoPropertyName = "CreateImagesGenerationsRequestResponseFormat2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateImagesGenerationsRequestOutputFormat), TypeInfoPropertyName = "CreateImagesGenerationsRequestOutputFormat2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateImagesGenerationsRequestImageLora))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(double?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DataItem?), TypeInfoPropertyName = "NullableDataItem2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ImageResponseDataItemDiscriminatorType?), TypeInfoPropertyName = "NullableImageResponseDataItemDiscriminatorType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ImageResponseDataB64Type?), TypeInfoPropertyName = "NullableImageResponseDataB64Type2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ImageResponseDataUrlType?), TypeInfoPropertyName = "NullableImageResponseDataUrlType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AnyOf?), TypeInfoPropertyName = "NullableAnyOfCreateImagesGenerationsRequestModelString2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateImagesGenerationsRequestModel?), TypeInfoPropertyName = "NullableCreateImagesGenerationsRequestModel2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateImagesGenerationsRequestResponseFormat?), TypeInfoPropertyName = "NullableCreateImagesGenerationsRequestResponseFormat2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateImagesGenerationsRequestOutputFormat?), TypeInfoPropertyName = "NullableCreateImagesGenerationsRequestOutputFormat2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - internal sealed partial class ImagesSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext - { - } - /// +{ /// /// /// public sealed partial class ImagesSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext @@ -95,28 +46,7 @@ private ImagesSourceGenerationContext(global::System.Text.Json.JsonSerializerOpt [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) { - options.Converters.Add(new global::Together.JsonConverters.DataItemJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter, global::System.Collections.Generic.IList>()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter>()); - options.Converters.Add(new global::Together.JsonConverters.AnyOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.UnixTimestampJsonConverter()); - options.Converters.Add(new LazyEnumJsonConverterFactory()); + global::Together.SourceGenerationContext.AddConverters(options); } private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() @@ -131,104 +61,6 @@ public static void AddConverters(global::System.Text.Json.JsonSerializerOptions return options; } - - private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Serialization.JsonConverterFactory - { - public override bool CanConvert(global::System.Type typeToConvert) - { - return - typeToConvert == typeof(global::Together.ImageResponseDataItemDiscriminatorType) - - || typeToConvert == typeof(global::Together.ImageResponseDataItemDiscriminatorType?) - - || typeToConvert == typeof(global::Together.ImageResponseDataB64Type) - - || typeToConvert == typeof(global::Together.ImageResponseDataB64Type?) - - || typeToConvert == typeof(global::Together.ImageResponseDataUrlType) - - || typeToConvert == typeof(global::Together.ImageResponseDataUrlType?) - - || typeToConvert == typeof(global::Together.CreateImagesGenerationsRequestModel) - - || typeToConvert == typeof(global::Together.CreateImagesGenerationsRequestModel?) - - || typeToConvert == typeof(global::Together.CreateImagesGenerationsRequestResponseFormat) - - || typeToConvert == typeof(global::Together.CreateImagesGenerationsRequestResponseFormat?) - - || typeToConvert == typeof(global::Together.CreateImagesGenerationsRequestOutputFormat) - - || typeToConvert == typeof(global::Together.CreateImagesGenerationsRequestOutputFormat?); - } - - public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - if (typeToConvert == typeof(global::Together.ImageResponseDataItemDiscriminatorType)) - { - return new global::Together.JsonConverters.ImageResponseDataItemDiscriminatorTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.ImageResponseDataItemDiscriminatorType?)) - { - return new global::Together.JsonConverters.ImageResponseDataItemDiscriminatorTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.ImageResponseDataB64Type)) - { - return new global::Together.JsonConverters.ImageResponseDataB64TypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.ImageResponseDataB64Type?)) - { - return new global::Together.JsonConverters.ImageResponseDataB64TypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.ImageResponseDataUrlType)) - { - return new global::Together.JsonConverters.ImageResponseDataUrlTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.ImageResponseDataUrlType?)) - { - return new global::Together.JsonConverters.ImageResponseDataUrlTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.CreateImagesGenerationsRequestModel)) - { - return new global::Together.JsonConverters.CreateImagesGenerationsRequestModelJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.CreateImagesGenerationsRequestModel?)) - { - return new global::Together.JsonConverters.CreateImagesGenerationsRequestModelNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.CreateImagesGenerationsRequestResponseFormat)) - { - return new global::Together.JsonConverters.CreateImagesGenerationsRequestResponseFormatJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.CreateImagesGenerationsRequestResponseFormat?)) - { - return new global::Together.JsonConverters.CreateImagesGenerationsRequestResponseFormatNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.CreateImagesGenerationsRequestOutputFormat)) - { - return new global::Together.JsonConverters.CreateImagesGenerationsRequestOutputFormatJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.CreateImagesGenerationsRequestOutputFormat?)) - { - return new global::Together.JsonConverters.CreateImagesGenerationsRequestOutputFormatNullableJsonConverter(); - } - throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); - } - } - private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver { private readonly object _gate = new(); @@ -268,7 +100,7 @@ private sealed class LazyChunkResolver : global::System.Text.Json.Serialization. { return index switch { - 0 => new ImagesSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), + 0 => global::Together.SourceGenerationContext.TypeInfoResolver, _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), }; } diff --git a/src/libs/Together/Generated/Together.ImagesClient.CreateImagesGenerations.g.cs b/src/libs/Together/Generated/Together.ImagesClient.CreateImagesGenerations.g.cs index 0c75d062..27eecbb1 100644 --- a/src/libs/Together/Generated/Together.ImagesClient.CreateImagesGenerations.g.cs +++ b/src/libs/Together/Generated/Together.ImagesClient.CreateImagesGenerations.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class ImagesClient { + private static readonly global::Together.AutoSDKServer[] s_CreateImagesGenerationsServers = 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_CreateImagesGenerationsSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -49,6 +62,18 @@ partial void ProcessCreateImagesGenerationsResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.images.generate(
+ /// model="black-forest-labs/FLUX.2-dev",
+ /// prompt="A cartoon of an astronaut riding a horse on the moon",
+ /// )
+ /// print(response.data[0].url) + ///
public async global::System.Threading.Tasks.Task CreateImagesGenerationsAsync( global::Together.CreateImagesGenerationsRequest request, @@ -72,6 +97,18 @@ partial void ProcessCreateImagesGenerationsResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.images.generate(
+ /// model="black-forest-labs/FLUX.2-dev",
+ /// prompt="A cartoon of an astronaut riding a horse on the moon",
+ /// )
+ /// print(response.data[0].url) + ///
public async global::System.Threading.Tasks.Task> CreateImagesGenerationsAsResponseAsync( global::Together.CreateImagesGenerationsRequest request, @@ -110,8 +147,10 @@ partial void ProcessCreateImagesGenerationsResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: "/v1/images/generations", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: "/images/generations", + baseUri: ResolveBaseUri( + servers: s_CreateImagesGenerationsServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -177,7 +216,7 @@ partial void ProcessCreateImagesGenerationsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "createImagesGenerations", methodName: "CreateImagesGenerationsAsync", - pathTemplate: "\"/v1/images/generations\"", + pathTemplate: "\"/images/generations\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -211,7 +250,7 @@ partial void ProcessCreateImagesGenerationsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "createImagesGenerations", methodName: "CreateImagesGenerationsAsync", - pathTemplate: "\"/v1/images/generations\"", + pathTemplate: "\"/images/generations\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -252,7 +291,7 @@ partial void ProcessCreateImagesGenerationsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "createImagesGenerations", methodName: "CreateImagesGenerationsAsync", - pathTemplate: "\"/v1/images/generations\"", + pathTemplate: "\"/images/generations\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -300,7 +339,7 @@ partial void ProcessCreateImagesGenerationsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "createImagesGenerations", methodName: "CreateImagesGenerationsAsync", - pathTemplate: "\"/v1/images/generations\"", + pathTemplate: "\"/images/generations\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -322,7 +361,7 @@ partial void ProcessCreateImagesGenerationsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "createImagesGenerations", methodName: "CreateImagesGenerationsAsync", - pathTemplate: "\"/v1/images/generations\"", + pathTemplate: "\"/images/generations\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.ImagesClient.g.cs b/src/libs/Together/Generated/Together.ImagesClient.g.cs index 12f4bf90..d85787fe 100644 --- a/src/libs/Together/Generated/Together.ImagesClient.g.cs +++ b/src/libs/Together/Generated/Together.ImagesClient.g.cs @@ -12,7 +12,7 @@ public sealed partial class ImagesClient : global::Together.IImagesClient, globa /// /// Default environment for APIs /// - public const string DefaultBaseUrl = "https://api.together.ai/"; + public const string DefaultBaseUrl = "https://api.together.ai/v1"; private bool _disposeHttpClient = true; @@ -20,7 +20,7 @@ public sealed partial class ImagesClient : global::Together.IImagesClient, globa 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; } @@ -53,6 +53,34 @@ public sealed partial class ImagesClient : global::Together.IImagesClient, globa } + + 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 ImagesClient. /// If no httpClient is provided, a new one will be created. @@ -151,5 +179,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.InstanceClusterAddOnService.JsonSerializerContext.g.cs b/src/libs/Together/Generated/Together.InstanceClusterAddOnService.JsonSerializerContext.g.cs index d9561ef7..1bad8055 100644 --- a/src/libs/Together/Generated/Together.InstanceClusterAddOnService.JsonSerializerContext.g.cs +++ b/src/libs/Together/Generated/Together.InstanceClusterAddOnService.JsonSerializerContext.g.cs @@ -2,43 +2,7 @@ #nullable enable namespace Together -{ - /// - /// - /// - [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( - DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull - )] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AddOnInfo))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AddOnConfig))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DashboardConfig))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.IngressConfig))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.TorchpassConfig))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.SlurmWebConfig))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.HeadlampConfig))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AddOnState))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DashboardState))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.IngressState))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.TorchpassState))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.SlurmWebState))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.HeadlampState))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ClusterAddOnCreateRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ClusterAddOnDeleteResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ClusterAddOnUpdateRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ClusterAddOnsListResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - internal sealed partial class InstanceClusterAddOnServiceSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext - { - } - /// +{ /// /// /// public sealed partial class InstanceClusterAddOnServiceSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext @@ -82,25 +46,7 @@ private InstanceClusterAddOnServiceSourceGenerationContext(global::System.Text.J [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) { - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter, global::System.Collections.Generic.IList>()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter>()); - options.Converters.Add(new global::Together.JsonConverters.UnixTimestampJsonConverter()); + global::Together.SourceGenerationContext.AddConverters(options); } private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() @@ -154,7 +100,7 @@ private sealed class LazyChunkResolver : global::System.Text.Json.Serialization. { return index switch { - 0 => new InstanceClusterAddOnServiceSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), + 0 => global::Together.SourceGenerationContext.TypeInfoResolver, _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), }; } diff --git a/src/libs/Together/Generated/Together.InstanceClusterAddOnServiceClient.InstanceClusterAddOnServiceCreate.g.cs b/src/libs/Together/Generated/Together.InstanceClusterAddOnServiceClient.InstanceClusterAddOnServiceCreate.g.cs index d5e83f99..d1be984c 100644 --- a/src/libs/Together/Generated/Together.InstanceClusterAddOnServiceClient.InstanceClusterAddOnServiceCreate.g.cs +++ b/src/libs/Together/Generated/Together.InstanceClusterAddOnServiceClient.InstanceClusterAddOnServiceCreate.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class InstanceClusterAddOnServiceClient { + private static readonly global::Together.AutoSDKServer[] s_InstanceClusterAddOnServiceCreateServers = 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_InstanceClusterAddOnServiceCreateSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -120,8 +133,10 @@ partial void ProcessInstanceClusterAddOnServiceCreateResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v1/compute/clusters/{clusterId}/addons", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/compute/clusters/{clusterId}/addons", + baseUri: ResolveBaseUri( + servers: s_InstanceClusterAddOnServiceCreateServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -188,7 +203,7 @@ partial void ProcessInstanceClusterAddOnServiceCreateResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "InstanceClusterAddOnServiceCreate", methodName: "InstanceClusterAddOnServiceCreateAsync", - pathTemplate: "$\"/v1/compute/clusters/{clusterId}/addons\"", + pathTemplate: "$\"/compute/clusters/{clusterId}/addons\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -222,7 +237,7 @@ partial void ProcessInstanceClusterAddOnServiceCreateResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "InstanceClusterAddOnServiceCreate", methodName: "InstanceClusterAddOnServiceCreateAsync", - pathTemplate: "$\"/v1/compute/clusters/{clusterId}/addons\"", + pathTemplate: "$\"/compute/clusters/{clusterId}/addons\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -263,7 +278,7 @@ partial void ProcessInstanceClusterAddOnServiceCreateResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "InstanceClusterAddOnServiceCreate", methodName: "InstanceClusterAddOnServiceCreateAsync", - pathTemplate: "$\"/v1/compute/clusters/{clusterId}/addons\"", + pathTemplate: "$\"/compute/clusters/{clusterId}/addons\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -311,7 +326,7 @@ partial void ProcessInstanceClusterAddOnServiceCreateResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "InstanceClusterAddOnServiceCreate", methodName: "InstanceClusterAddOnServiceCreateAsync", - pathTemplate: "$\"/v1/compute/clusters/{clusterId}/addons\"", + pathTemplate: "$\"/compute/clusters/{clusterId}/addons\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -333,7 +348,7 @@ partial void ProcessInstanceClusterAddOnServiceCreateResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "InstanceClusterAddOnServiceCreate", methodName: "InstanceClusterAddOnServiceCreateAsync", - pathTemplate: "$\"/v1/compute/clusters/{clusterId}/addons\"", + pathTemplate: "$\"/compute/clusters/{clusterId}/addons\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.InstanceClusterAddOnServiceClient.InstanceClusterAddOnServiceDelete.g.cs b/src/libs/Together/Generated/Together.InstanceClusterAddOnServiceClient.InstanceClusterAddOnServiceDelete.g.cs index c70f3348..09bffea9 100644 --- a/src/libs/Together/Generated/Together.InstanceClusterAddOnServiceClient.InstanceClusterAddOnServiceDelete.g.cs +++ b/src/libs/Together/Generated/Together.InstanceClusterAddOnServiceClient.InstanceClusterAddOnServiceDelete.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class InstanceClusterAddOnServiceClient { + private static readonly global::Together.AutoSDKServer[] s_InstanceClusterAddOnServiceDeleteServers = 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_InstanceClusterAddOnServiceDeleteSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -119,8 +132,10 @@ partial void ProcessInstanceClusterAddOnServiceDeleteResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v1/compute/clusters/{clusterId}/addons/{addonId}", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/compute/clusters/{clusterId}/addons/{addonId}", + baseUri: ResolveBaseUri( + servers: s_InstanceClusterAddOnServiceDeleteServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -181,7 +196,7 @@ partial void ProcessInstanceClusterAddOnServiceDeleteResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "InstanceClusterAddOnServiceDelete", methodName: "InstanceClusterAddOnServiceDeleteAsync", - pathTemplate: "$\"/v1/compute/clusters/{clusterId}/addons/{addonId}\"", + pathTemplate: "$\"/compute/clusters/{clusterId}/addons/{addonId}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -215,7 +230,7 @@ partial void ProcessInstanceClusterAddOnServiceDeleteResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "InstanceClusterAddOnServiceDelete", methodName: "InstanceClusterAddOnServiceDeleteAsync", - pathTemplate: "$\"/v1/compute/clusters/{clusterId}/addons/{addonId}\"", + pathTemplate: "$\"/compute/clusters/{clusterId}/addons/{addonId}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -256,7 +271,7 @@ partial void ProcessInstanceClusterAddOnServiceDeleteResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "InstanceClusterAddOnServiceDelete", methodName: "InstanceClusterAddOnServiceDeleteAsync", - pathTemplate: "$\"/v1/compute/clusters/{clusterId}/addons/{addonId}\"", + pathTemplate: "$\"/compute/clusters/{clusterId}/addons/{addonId}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -304,7 +319,7 @@ partial void ProcessInstanceClusterAddOnServiceDeleteResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "InstanceClusterAddOnServiceDelete", methodName: "InstanceClusterAddOnServiceDeleteAsync", - pathTemplate: "$\"/v1/compute/clusters/{clusterId}/addons/{addonId}\"", + pathTemplate: "$\"/compute/clusters/{clusterId}/addons/{addonId}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -326,7 +341,7 @@ partial void ProcessInstanceClusterAddOnServiceDeleteResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "InstanceClusterAddOnServiceDelete", methodName: "InstanceClusterAddOnServiceDeleteAsync", - pathTemplate: "$\"/v1/compute/clusters/{clusterId}/addons/{addonId}\"", + pathTemplate: "$\"/compute/clusters/{clusterId}/addons/{addonId}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.InstanceClusterAddOnServiceClient.InstanceClusterAddOnServiceGet.g.cs b/src/libs/Together/Generated/Together.InstanceClusterAddOnServiceClient.InstanceClusterAddOnServiceGet.g.cs index ab2fe196..62d31519 100644 --- a/src/libs/Together/Generated/Together.InstanceClusterAddOnServiceClient.InstanceClusterAddOnServiceGet.g.cs +++ b/src/libs/Together/Generated/Together.InstanceClusterAddOnServiceClient.InstanceClusterAddOnServiceGet.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class InstanceClusterAddOnServiceClient { + private static readonly global::Together.AutoSDKServer[] s_InstanceClusterAddOnServiceGetServers = 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_InstanceClusterAddOnServiceGetSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -119,8 +132,10 @@ partial void ProcessInstanceClusterAddOnServiceGetResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v1/compute/clusters/{clusterId}/addons/{addonId}", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/compute/clusters/{clusterId}/addons/{addonId}", + baseUri: ResolveBaseUri( + servers: s_InstanceClusterAddOnServiceGetServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -181,7 +196,7 @@ partial void ProcessInstanceClusterAddOnServiceGetResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "InstanceClusterAddOnServiceGet", methodName: "InstanceClusterAddOnServiceGetAsync", - pathTemplate: "$\"/v1/compute/clusters/{clusterId}/addons/{addonId}\"", + pathTemplate: "$\"/compute/clusters/{clusterId}/addons/{addonId}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -215,7 +230,7 @@ partial void ProcessInstanceClusterAddOnServiceGetResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "InstanceClusterAddOnServiceGet", methodName: "InstanceClusterAddOnServiceGetAsync", - pathTemplate: "$\"/v1/compute/clusters/{clusterId}/addons/{addonId}\"", + pathTemplate: "$\"/compute/clusters/{clusterId}/addons/{addonId}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -256,7 +271,7 @@ partial void ProcessInstanceClusterAddOnServiceGetResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "InstanceClusterAddOnServiceGet", methodName: "InstanceClusterAddOnServiceGetAsync", - pathTemplate: "$\"/v1/compute/clusters/{clusterId}/addons/{addonId}\"", + pathTemplate: "$\"/compute/clusters/{clusterId}/addons/{addonId}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -304,7 +319,7 @@ partial void ProcessInstanceClusterAddOnServiceGetResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "InstanceClusterAddOnServiceGet", methodName: "InstanceClusterAddOnServiceGetAsync", - pathTemplate: "$\"/v1/compute/clusters/{clusterId}/addons/{addonId}\"", + pathTemplate: "$\"/compute/clusters/{clusterId}/addons/{addonId}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -326,7 +341,7 @@ partial void ProcessInstanceClusterAddOnServiceGetResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "InstanceClusterAddOnServiceGet", methodName: "InstanceClusterAddOnServiceGetAsync", - pathTemplate: "$\"/v1/compute/clusters/{clusterId}/addons/{addonId}\"", + pathTemplate: "$\"/compute/clusters/{clusterId}/addons/{addonId}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.InstanceClusterAddOnServiceClient.InstanceClusterAddOnServiceList.g.cs b/src/libs/Together/Generated/Together.InstanceClusterAddOnServiceClient.InstanceClusterAddOnServiceList.g.cs index 499d2dc2..b1a42714 100644 --- a/src/libs/Together/Generated/Together.InstanceClusterAddOnServiceClient.InstanceClusterAddOnServiceList.g.cs +++ b/src/libs/Together/Generated/Together.InstanceClusterAddOnServiceClient.InstanceClusterAddOnServiceList.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class InstanceClusterAddOnServiceClient { + private static readonly global::Together.AutoSDKServer[] s_InstanceClusterAddOnServiceListServers = 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_InstanceClusterAddOnServiceListSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -107,8 +120,10 @@ partial void ProcessInstanceClusterAddOnServiceListResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v1/compute/clusters/{clusterId}/addons", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/compute/clusters/{clusterId}/addons", + baseUri: ResolveBaseUri( + servers: s_InstanceClusterAddOnServiceListServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -168,7 +183,7 @@ partial void ProcessInstanceClusterAddOnServiceListResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "InstanceClusterAddOnServiceList", methodName: "InstanceClusterAddOnServiceListAsync", - pathTemplate: "$\"/v1/compute/clusters/{clusterId}/addons\"", + pathTemplate: "$\"/compute/clusters/{clusterId}/addons\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -202,7 +217,7 @@ partial void ProcessInstanceClusterAddOnServiceListResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "InstanceClusterAddOnServiceList", methodName: "InstanceClusterAddOnServiceListAsync", - pathTemplate: "$\"/v1/compute/clusters/{clusterId}/addons\"", + pathTemplate: "$\"/compute/clusters/{clusterId}/addons\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -243,7 +258,7 @@ partial void ProcessInstanceClusterAddOnServiceListResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "InstanceClusterAddOnServiceList", methodName: "InstanceClusterAddOnServiceListAsync", - pathTemplate: "$\"/v1/compute/clusters/{clusterId}/addons\"", + pathTemplate: "$\"/compute/clusters/{clusterId}/addons\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -291,7 +306,7 @@ partial void ProcessInstanceClusterAddOnServiceListResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "InstanceClusterAddOnServiceList", methodName: "InstanceClusterAddOnServiceListAsync", - pathTemplate: "$\"/v1/compute/clusters/{clusterId}/addons\"", + pathTemplate: "$\"/compute/clusters/{clusterId}/addons\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -313,7 +328,7 @@ partial void ProcessInstanceClusterAddOnServiceListResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "InstanceClusterAddOnServiceList", methodName: "InstanceClusterAddOnServiceListAsync", - pathTemplate: "$\"/v1/compute/clusters/{clusterId}/addons\"", + pathTemplate: "$\"/compute/clusters/{clusterId}/addons\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.InstanceClusterAddOnServiceClient.InstanceClusterAddOnServiceUpdate.g.cs b/src/libs/Together/Generated/Together.InstanceClusterAddOnServiceClient.InstanceClusterAddOnServiceUpdate.g.cs index f5cd9417..5cc17f57 100644 --- a/src/libs/Together/Generated/Together.InstanceClusterAddOnServiceClient.InstanceClusterAddOnServiceUpdate.g.cs +++ b/src/libs/Together/Generated/Together.InstanceClusterAddOnServiceClient.InstanceClusterAddOnServiceUpdate.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class InstanceClusterAddOnServiceClient { + private static readonly global::Together.AutoSDKServer[] s_InstanceClusterAddOnServiceUpdateServers = 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_InstanceClusterAddOnServiceUpdateSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -132,8 +145,10 @@ partial void ProcessInstanceClusterAddOnServiceUpdateResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v1/compute/clusters/{clusterId}/addons/{addonId}", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/compute/clusters/{clusterId}/addons/{addonId}", + baseUri: ResolveBaseUri( + servers: s_InstanceClusterAddOnServiceUpdateServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -201,7 +216,7 @@ partial void ProcessInstanceClusterAddOnServiceUpdateResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "InstanceClusterAddOnServiceUpdate", methodName: "InstanceClusterAddOnServiceUpdateAsync", - pathTemplate: "$\"/v1/compute/clusters/{clusterId}/addons/{addonId}\"", + pathTemplate: "$\"/compute/clusters/{clusterId}/addons/{addonId}\"", httpMethod: "PUT", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -235,7 +250,7 @@ partial void ProcessInstanceClusterAddOnServiceUpdateResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "InstanceClusterAddOnServiceUpdate", methodName: "InstanceClusterAddOnServiceUpdateAsync", - pathTemplate: "$\"/v1/compute/clusters/{clusterId}/addons/{addonId}\"", + pathTemplate: "$\"/compute/clusters/{clusterId}/addons/{addonId}\"", httpMethod: "PUT", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -276,7 +291,7 @@ partial void ProcessInstanceClusterAddOnServiceUpdateResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "InstanceClusterAddOnServiceUpdate", methodName: "InstanceClusterAddOnServiceUpdateAsync", - pathTemplate: "$\"/v1/compute/clusters/{clusterId}/addons/{addonId}\"", + pathTemplate: "$\"/compute/clusters/{clusterId}/addons/{addonId}\"", httpMethod: "PUT", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -324,7 +339,7 @@ partial void ProcessInstanceClusterAddOnServiceUpdateResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "InstanceClusterAddOnServiceUpdate", methodName: "InstanceClusterAddOnServiceUpdateAsync", - pathTemplate: "$\"/v1/compute/clusters/{clusterId}/addons/{addonId}\"", + pathTemplate: "$\"/compute/clusters/{clusterId}/addons/{addonId}\"", httpMethod: "PUT", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -346,7 +361,7 @@ partial void ProcessInstanceClusterAddOnServiceUpdateResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "InstanceClusterAddOnServiceUpdate", methodName: "InstanceClusterAddOnServiceUpdateAsync", - pathTemplate: "$\"/v1/compute/clusters/{clusterId}/addons/{addonId}\"", + pathTemplate: "$\"/compute/clusters/{clusterId}/addons/{addonId}\"", httpMethod: "PUT", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.InstanceClusterAddOnServiceClient.g.cs b/src/libs/Together/Generated/Together.InstanceClusterAddOnServiceClient.g.cs index 18f3cb95..c0ed8d5a 100644 --- a/src/libs/Together/Generated/Together.InstanceClusterAddOnServiceClient.g.cs +++ b/src/libs/Together/Generated/Together.InstanceClusterAddOnServiceClient.g.cs @@ -12,7 +12,7 @@ public sealed partial class InstanceClusterAddOnServiceClient : global::Together /// /// Default environment for APIs /// - public const string DefaultBaseUrl = "https://api.together.ai/"; + public const string DefaultBaseUrl = "https://api.together.ai/v1"; private bool _disposeHttpClient = true; @@ -20,7 +20,7 @@ public sealed partial class InstanceClusterAddOnServiceClient : global::Together 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; } @@ -53,6 +53,34 @@ public sealed partial class InstanceClusterAddOnServiceClient : global::Together } + + 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 InstanceClusterAddOnServiceClient. /// If no httpClient is provided, a new one will be created. @@ -151,5 +179,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.InstanceTypeService.JsonSerializerContext.g.cs b/src/libs/Together/Generated/Together.InstanceTypeService.JsonSerializerContext.g.cs index ced6168e..e48e04fd 100644 --- a/src/libs/Together/Generated/Together.InstanceTypeService.JsonSerializerContext.g.cs +++ b/src/libs/Together/Generated/Together.InstanceTypeService.JsonSerializerContext.g.cs @@ -2,42 +2,7 @@ #nullable enable namespace Together -{ - /// - /// - /// - [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( - DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull - )] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeListInferenceInstanceTypesResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeInferenceInstanceType))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeCompliancePolicy))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeRegion))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeHeadroom))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeComplianceAvailability))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeHeadroomRelation), TypeInfoPropertyName = "DeHeadroomRelation2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ErrorData))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ErrorDataError))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeHeadroomRelation?), TypeInfoPropertyName = "NullableDeHeadroomRelation2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - internal sealed partial class InstanceTypeServiceSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext - { - } - /// +{ /// /// /// public sealed partial class InstanceTypeServiceSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext @@ -81,26 +46,7 @@ private InstanceTypeServiceSourceGenerationContext(global::System.Text.Json.Json [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) { - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter, global::System.Collections.Generic.IList>()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter>()); - options.Converters.Add(new global::Together.JsonConverters.UnixTimestampJsonConverter()); - options.Converters.Add(new LazyEnumJsonConverterFactory()); + global::Together.SourceGenerationContext.AddConverters(options); } private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() @@ -115,34 +61,6 @@ public static void AddConverters(global::System.Text.Json.JsonSerializerOptions return options; } - - private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Serialization.JsonConverterFactory - { - public override bool CanConvert(global::System.Type typeToConvert) - { - return - typeToConvert == typeof(global::Together.DeHeadroomRelation) - - || typeToConvert == typeof(global::Together.DeHeadroomRelation?); - } - - public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - if (typeToConvert == typeof(global::Together.DeHeadroomRelation)) - { - return new global::Together.JsonConverters.DeHeadroomRelationJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeHeadroomRelation?)) - { - return new global::Together.JsonConverters.DeHeadroomRelationNullableJsonConverter(); - } - throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); - } - } - private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver { private readonly object _gate = new(); @@ -182,7 +100,7 @@ private sealed class LazyChunkResolver : global::System.Text.Json.Serialization. { return index switch { - 0 => new InstanceTypeServiceSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), + 0 => global::Together.SourceGenerationContext.TypeInfoResolver, _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), }; } diff --git a/src/libs/Together/Generated/Together.InstanceTypeServiceClient.InstanceTypeServiceGetInferenceInstanceType.g.cs b/src/libs/Together/Generated/Together.InstanceTypeServiceClient.InstanceTypeServiceGetInferenceInstanceType.g.cs index 94a8ea4f..777f4dba 100644 --- a/src/libs/Together/Generated/Together.InstanceTypeServiceClient.InstanceTypeServiceGetInferenceInstanceType.g.cs +++ b/src/libs/Together/Generated/Together.InstanceTypeServiceClient.InstanceTypeServiceGetInferenceInstanceType.g.cs @@ -6,6 +6,14 @@ namespace Together public partial class InstanceTypeServiceClient { + private static readonly global::Together.AutoSDKServer[] s_InstanceTypeServiceGetInferenceInstanceTypeServers = 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_InstanceTypeServiceGetInferenceInstanceTypeSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -51,6 +59,12 @@ partial void ProcessInstanceTypeServiceGetInferenceInstanceTypeResponseContent( /// 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()
+ /// instance_type = client.beta.endpoints.hardware.retrieve("ins_abc123")
+ /// print(instance_type.name, instance_type.regions) + ///
public async global::System.Threading.Tasks.Task InstanceTypeServiceGetInferenceInstanceTypeAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -74,6 +88,12 @@ partial void ProcessInstanceTypeServiceGetInferenceInstanceTypeResponseContent( /// 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()
+ /// instance_type = client.beta.endpoints.hardware.retrieve("ins_abc123")
+ /// print(instance_type.name, instance_type.regions) + ///
public async global::System.Threading.Tasks.Task> InstanceTypeServiceGetInferenceInstanceTypeAsResponseAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -109,8 +129,10 @@ partial void ProcessInstanceTypeServiceGetInferenceInstanceTypeResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v2/public/inference-instance-types/{id}", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/public/inference-instance-types/{id}", + baseUri: ResolveBaseUri( + servers: s_InstanceTypeServiceGetInferenceInstanceTypeServers, + defaultBaseUrl: "https://api.together.ai/v2")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -170,7 +192,7 @@ partial void ProcessInstanceTypeServiceGetInferenceInstanceTypeResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "InstanceTypeServiceGetInferenceInstanceType", methodName: "InstanceTypeServiceGetInferenceInstanceTypeAsync", - pathTemplate: "$\"/v2/public/inference-instance-types/{id}\"", + pathTemplate: "$\"/public/inference-instance-types/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -204,7 +226,7 @@ partial void ProcessInstanceTypeServiceGetInferenceInstanceTypeResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "InstanceTypeServiceGetInferenceInstanceType", methodName: "InstanceTypeServiceGetInferenceInstanceTypeAsync", - pathTemplate: "$\"/v2/public/inference-instance-types/{id}\"", + pathTemplate: "$\"/public/inference-instance-types/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -245,7 +267,7 @@ partial void ProcessInstanceTypeServiceGetInferenceInstanceTypeResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "InstanceTypeServiceGetInferenceInstanceType", methodName: "InstanceTypeServiceGetInferenceInstanceTypeAsync", - pathTemplate: "$\"/v2/public/inference-instance-types/{id}\"", + pathTemplate: "$\"/public/inference-instance-types/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -293,7 +315,7 @@ partial void ProcessInstanceTypeServiceGetInferenceInstanceTypeResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "InstanceTypeServiceGetInferenceInstanceType", methodName: "InstanceTypeServiceGetInferenceInstanceTypeAsync", - pathTemplate: "$\"/v2/public/inference-instance-types/{id}\"", + pathTemplate: "$\"/public/inference-instance-types/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -315,7 +337,7 @@ partial void ProcessInstanceTypeServiceGetInferenceInstanceTypeResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "InstanceTypeServiceGetInferenceInstanceType", methodName: "InstanceTypeServiceGetInferenceInstanceTypeAsync", - pathTemplate: "$\"/v2/public/inference-instance-types/{id}\"", + pathTemplate: "$\"/public/inference-instance-types/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.InstanceTypeServiceClient.InstanceTypeServiceListInferenceInstanceTypes.g.cs b/src/libs/Together/Generated/Together.InstanceTypeServiceClient.InstanceTypeServiceListInferenceInstanceTypes.g.cs index c8b35d66..6c671ba0 100644 --- a/src/libs/Together/Generated/Together.InstanceTypeServiceClient.InstanceTypeServiceListInferenceInstanceTypes.g.cs +++ b/src/libs/Together/Generated/Together.InstanceTypeServiceClient.InstanceTypeServiceListInferenceInstanceTypes.g.cs @@ -6,6 +6,14 @@ namespace Together public partial class InstanceTypeServiceClient { + private static readonly global::Together.AutoSDKServer[] s_InstanceTypeServiceListInferenceInstanceTypesServers = 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_InstanceTypeServiceListInferenceInstanceTypesSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -46,6 +54,13 @@ partial void ProcessInstanceTypeServiceListInferenceInstanceTypesResponseContent /// 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()
+ /// instance_types = client.beta.endpoints.hardware.list()
+ /// for instance_type in instance_types.data:
+ /// print(instance_type.name, instance_type.price_cents_per_hour) + ///
public async global::System.Threading.Tasks.Task InstanceTypeServiceListInferenceInstanceTypesAsync( global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -64,6 +79,13 @@ partial void ProcessInstanceTypeServiceListInferenceInstanceTypesResponseContent /// 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()
+ /// instance_types = client.beta.endpoints.hardware.list()
+ /// for instance_type in instance_types.data:
+ /// print(instance_type.name, instance_type.price_cents_per_hour) + ///
public async global::System.Threading.Tasks.Task> InstanceTypeServiceListInferenceInstanceTypesAsResponseAsync( global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -97,8 +119,10 @@ partial void ProcessInstanceTypeServiceListInferenceInstanceTypesResponseContent { var __pathBuilder = new global::Together.PathBuilder( - path: "/v2/public/inference-instance-types", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: "/public/inference-instance-types", + baseUri: ResolveBaseUri( + servers: s_InstanceTypeServiceListInferenceInstanceTypesServers, + defaultBaseUrl: "https://api.together.ai/v2")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -157,7 +181,7 @@ partial void ProcessInstanceTypeServiceListInferenceInstanceTypesResponseContent context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "InstanceTypeServiceListInferenceInstanceTypes", methodName: "InstanceTypeServiceListInferenceInstanceTypesAsync", - pathTemplate: "\"/v2/public/inference-instance-types\"", + pathTemplate: "\"/public/inference-instance-types\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -191,7 +215,7 @@ partial void ProcessInstanceTypeServiceListInferenceInstanceTypesResponseContent context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "InstanceTypeServiceListInferenceInstanceTypes", methodName: "InstanceTypeServiceListInferenceInstanceTypesAsync", - pathTemplate: "\"/v2/public/inference-instance-types\"", + pathTemplate: "\"/public/inference-instance-types\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -232,7 +256,7 @@ partial void ProcessInstanceTypeServiceListInferenceInstanceTypesResponseContent context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "InstanceTypeServiceListInferenceInstanceTypes", methodName: "InstanceTypeServiceListInferenceInstanceTypesAsync", - pathTemplate: "\"/v2/public/inference-instance-types\"", + pathTemplate: "\"/public/inference-instance-types\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -280,7 +304,7 @@ partial void ProcessInstanceTypeServiceListInferenceInstanceTypesResponseContent context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "InstanceTypeServiceListInferenceInstanceTypes", methodName: "InstanceTypeServiceListInferenceInstanceTypesAsync", - pathTemplate: "\"/v2/public/inference-instance-types\"", + pathTemplate: "\"/public/inference-instance-types\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -302,7 +326,7 @@ partial void ProcessInstanceTypeServiceListInferenceInstanceTypesResponseContent context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "InstanceTypeServiceListInferenceInstanceTypes", methodName: "InstanceTypeServiceListInferenceInstanceTypesAsync", - pathTemplate: "\"/v2/public/inference-instance-types\"", + pathTemplate: "\"/public/inference-instance-types\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.InstanceTypeServiceClient.g.cs b/src/libs/Together/Generated/Together.InstanceTypeServiceClient.g.cs index e7066dc1..52834708 100644 --- a/src/libs/Together/Generated/Together.InstanceTypeServiceClient.g.cs +++ b/src/libs/Together/Generated/Together.InstanceTypeServiceClient.g.cs @@ -10,9 +10,9 @@ namespace Together public sealed partial class InstanceTypeServiceClient : global::Together.IInstanceTypeServiceClient, global::System.IDisposable { /// - /// Default environment for APIs + /// /// - public const string DefaultBaseUrl = "https://api.together.ai/"; + public const string DefaultBaseUrl = "https://api.together.ai/v2"; private bool _disposeHttpClient = true; @@ -151,5 +151,36 @@ 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.Jobs.JsonSerializerContext.g.cs b/src/libs/Together/Generated/Together.Jobs.JsonSerializerContext.g.cs new file mode 100644 index 00000000..51e6b6c2 --- /dev/null +++ b/src/libs/Together/Generated/Together.Jobs.JsonSerializerContext.g.cs @@ -0,0 +1,109 @@ + +#nullable enable + +namespace Together +{ /// + /// + /// + public sealed partial class JobsSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext + { + private static readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver Resolver = new LazyChunkResolver(); + + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + internal static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver TypeInfoResolver => Resolver; + + + private static readonly global::System.Text.Json.JsonSerializerOptions DefaultOptions = CreateDefaultOptions(); + + /// + /// + /// + public static JobsSourceGenerationContext Default { get; } = new(DefaultOptions); + + private JobsSourceGenerationContext(global::System.Text.Json.JsonSerializerOptions options) + : base(options) + { + } + + /// + protected override global::System.Text.Json.JsonSerializerOptions? GeneratedSerializerOptions => DefaultOptions; + + /// + public override global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo(global::System.Type type) + { + return Resolver.GetTypeInfo(type, Options); + } + + /// + /// Adds this package's converters to . + /// + /// + /// A converter has to be on the options a chained resolver builds its JsonTypeInfo against, + /// and a context resolves types from every package below it. Each package contributes only + /// what it owns and calls down the chain for the rest, so the family's converter table is + /// written once rather than copied into all of them. + /// + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) + { + global::Together.SourceGenerationContext.AddConverters(options); + } + + private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() + { + var options = new global::System.Text.Json.JsonSerializerOptions + { + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + TypeInfoResolver = Resolver, + }; + AddConverters(options); + + return options; + } + + private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver + { + private readonly object _gate = new(); + private readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[] _resolvers = new global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[1]; + + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo( + global::System.Type type, + global::System.Text.Json.JsonSerializerOptions options) + { + for (var index = 0; index < _resolvers.Length; index++) + { + var typeInfo = GetResolver(index).GetTypeInfo(type, options); + if (typeInfo is not null) + { + return typeInfo; + } + } + + return null; + } + + private global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver GetResolver(int index) + { + var resolver = global::System.Threading.Volatile.Read(ref _resolvers[index]); + if (resolver is not null) + { + return resolver; + } + + lock (_gate) + { + return _resolvers[index] ??= CreateResolver(index); + } + } + + private static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver CreateResolver(int index) + { + return index switch + { + 0 => global::Together.SourceGenerationContext.TypeInfoResolver, + _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), + }; + } + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.JobsClient.GetJob.g.cs b/src/libs/Together/Generated/Together.JobsClient.GetJob.g.cs new file mode 100644 index 00000000..92930e28 --- /dev/null +++ b/src/libs/Together/Generated/Together.JobsClient.GetJob.g.cs @@ -0,0 +1,459 @@ + +#nullable enable + +namespace Together +{ + public partial class JobsClient + { + + private static readonly global::Together.AutoSDKServer[] s_GetJobServers = 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_GetJobSecurityRequirement0 = + 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_GetJobSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_GetJobSecurityRequirement0, + }; + partial void PrepareGetJobArguments( + global::System.Net.Http.HttpClient httpClient, + ref string jobId); + partial void PrepareGetJobRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string jobId); + partial void ProcessGetJobResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessGetJobResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Get job status
+ /// Get the status of a specific job + ///
+ /// + /// The ID of the job to retrieve
+ /// Example: job-a15dad11-8d8e-4007-97c5-a211304de284 + /// + /// 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()
+ /// status = client.models.uploads.status("<JOB_ID>")
+ /// print(status) + ///
+ public async global::System.Threading.Tasks.Task GetJobAsync( + string jobId, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetJobAsResponseAsync( + jobId: jobId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get job status
+ /// Get the status of a specific job + ///
+ /// + /// The ID of the job to retrieve
+ /// Example: job-a15dad11-8d8e-4007-97c5-a211304de284 + /// + /// 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()
+ /// status = client.models.uploads.status("<JOB_ID>")
+ /// print(status) + ///
+ public async global::System.Threading.Tasks.Task> GetJobAsResponseAsync( + string jobId, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareGetJobArguments( + httpClient: HttpClient, + jobId: ref jobId); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_GetJobSecurityRequirements, + operationName: "GetJobAsync"); + + 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: $"/jobs/{jobId}", + baseUri: ResolveBaseUri( + servers: s_GetJobServers, + 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); + PrepareGetJobRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + jobId: jobId); + + 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: "GetJob", + methodName: "GetJobAsync", + pathTemplate: "$\"/jobs/{jobId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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: "GetJob", + methodName: "GetJobAsync", + pathTemplate: "$\"/jobs/{jobId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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: "GetJob", + methodName: "GetJobAsync", + pathTemplate: "$\"/jobs/{jobId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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); + ProcessGetJobResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetJob", + methodName: "GetJobAsync", + pathTemplate: "$\"/jobs/{jobId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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: "GetJob", + methodName: "GetJobAsync", + pathTemplate: "$\"/jobs/{jobId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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); + } + + 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); + ProcessGetJobResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.JobInfoSuccessResponse.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.JobInfoSuccessResponse.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.JobsClient.ListJobs.g.cs b/src/libs/Together/Generated/Together.JobsClient.ListJobs.g.cs new file mode 100644 index 00000000..60cfe88a --- /dev/null +++ b/src/libs/Together/Generated/Together.JobsClient.ListJobs.g.cs @@ -0,0 +1,448 @@ + +#nullable enable + +namespace Together +{ + public partial class JobsClient + { + + private static readonly global::Together.AutoSDKServer[] s_ListJobsServers = 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_ListJobsSecurityRequirement0 = + 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_ListJobsSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_ListJobsSecurityRequirement0, + }; + partial void PrepareListJobsArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareListJobsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessListJobsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessListJobsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// List all jobs
+ /// List all jobs and their statuses + ///
+ /// 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()
+ /// # The SDK has no dedicated method for this endpoint yet, so call it with
+ /// # the client's generic GET helper.
+ /// jobs = client.get("/jobs", cast_to=object)
+ /// print(jobs) + ///
+ public async global::System.Threading.Tasks.Task ListJobsAsync( + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListJobsAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List all jobs
+ /// List all jobs and their statuses + ///
+ /// 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()
+ /// # The SDK has no dedicated method for this endpoint yet, so call it with
+ /// # the client's generic GET helper.
+ /// jobs = client.get("/jobs", cast_to=object)
+ /// print(jobs) + ///
+ public async global::System.Threading.Tasks.Task> ListJobsAsResponseAsync( + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareListJobsArguments( + httpClient: HttpClient); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ListJobsSecurityRequirements, + operationName: "ListJobsAsync"); + + 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: "/jobs", + baseUri: ResolveBaseUri( + servers: s_ListJobsServers, + 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); + PrepareListJobsRequest( + 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: "ListJobs", + methodName: "ListJobsAsync", + pathTemplate: "\"/jobs\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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: "ListJobs", + methodName: "ListJobsAsync", + pathTemplate: "\"/jobs\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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: "ListJobs", + methodName: "ListJobsAsync", + pathTemplate: "\"/jobs\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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); + ProcessListJobsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListJobs", + methodName: "ListJobsAsync", + pathTemplate: "\"/jobs\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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: "ListJobs", + methodName: "ListJobsAsync", + pathTemplate: "\"/jobs\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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); + } + + 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); + ProcessListJobsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.JobsInfoSuccessResponse.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.JobsInfoSuccessResponse.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.JobsClient.g.cs b/src/libs/Together/Generated/Together.JobsClient.g.cs new file mode 100644 index 00000000..e65f0873 --- /dev/null +++ b/src/libs/Together/Generated/Together.JobsClient.g.cs @@ -0,0 +1,295 @@ + +#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 JobsClient : global::Together.IJobsClient, 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; } + + + /// + public global::System.Func CreateIdempotencyKey { get; set; } = () => global::System.Guid.NewGuid().ToString("D"); + + + internal global::Together.AutoSDKServerConfiguration AutoSDKServerConfiguration { get; set; } = new global::Together.AutoSDKServerConfiguration(); + + internal global::System.Lazy? JsonSerializerContextProvider { get; set; } + + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext + { + get => JsonSerializerContextProvider?.Value ?? global::Together.JobsSourceGenerationContext.Default; + set => JsonSerializerContextProvider = new(() => value); + } + + + + 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 JobsClient. + /// 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 JobsClient( + 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 JobsClient 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 JobsClient( + 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 JobsClient. + /// 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 JobsClient( + 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.JsonConverters.ChatCompletionFunctionMessageParamRole.g.cs b/src/libs/Together/Generated/Together.JsonConverters.ChatCompletionFunctionMessageParamRole.g.cs new file mode 100644 index 00000000..18de2a3f --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.ChatCompletionFunctionMessageParamRole.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class ChatCompletionFunctionMessageParamRoleJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.ChatCompletionFunctionMessageParamRole Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.ChatCompletionFunctionMessageParamRoleExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.ChatCompletionFunctionMessageParamRole)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.ChatCompletionFunctionMessageParamRole); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.ChatCompletionFunctionMessageParamRole value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.ChatCompletionFunctionMessageParamRoleExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.ChatCompletionFunctionMessageParamRoleNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.ChatCompletionFunctionMessageParamRoleNullable.g.cs new file mode 100644 index 00000000..03e3e062 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.ChatCompletionFunctionMessageParamRoleNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class ChatCompletionFunctionMessageParamRoleNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.ChatCompletionFunctionMessageParamRole? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.ChatCompletionFunctionMessageParamRoleExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.ChatCompletionFunctionMessageParamRole)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.ChatCompletionFunctionMessageParamRole?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.ChatCompletionFunctionMessageParamRole? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.ChatCompletionFunctionMessageParamRoleExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.ChatCompletionMessageParam.g.cs b/src/libs/Together/Generated/Together.JsonConverters.ChatCompletionMessageParam.g.cs index 19b75f81..bef49ca8 100644 --- a/src/libs/Together/Generated/Together.JsonConverters.ChatCompletionMessageParam.g.cs +++ b/src/libs/Together/Generated/Together.JsonConverters.ChatCompletionMessageParam.g.cs @@ -23,6 +23,13 @@ public class ChatCompletionMessageParamJsonConverter : global::System.Text.Json. foreach (var __jsonProp in __jsonDocument.RootElement.EnumerateObject()) { __jsonProps.Add(__jsonProp.Name); + if (__jsonProp.Value.ValueKind == global::System.Text.Json.JsonValueKind.Object) + { + foreach (var __nestedJsonProp in __jsonProp.Value.EnumerateObject()) + { + __jsonProps.Add(__jsonProp.Name + "." + __nestedJsonProp.Name); + } + } } } @@ -37,6 +44,9 @@ public class ChatCompletionMessageParamJsonConverter : global::System.Text.Json. if (__jsonProps.Contains("role")) __score1++; var __score2 = 0; if (__jsonProps.Contains("content")) __score2++; + if (__jsonProps.Contains("function_call")) __score2++; + if (__jsonProps.Contains("function_call.arguments")) __score2++; + if (__jsonProps.Contains("function_call.name")) __score2++; if (__jsonProps.Contains("name")) __score2++; if (__jsonProps.Contains("reasoning")) __score2++; if (__jsonProps.Contains("reasoning_content")) __score2++; @@ -47,17 +57,23 @@ public class ChatCompletionMessageParamJsonConverter : global::System.Text.Json. if (__jsonProps.Contains("name")) __score3++; if (__jsonProps.Contains("role")) __score3++; if (__jsonProps.Contains("tool_call_id")) __score3++; + var __score4 = 0; + if (__jsonProps.Contains("content")) __score4++; + if (__jsonProps.Contains("name")) __score4++; + if (__jsonProps.Contains("role")) __score4++; var __bestScore = 0; var __bestIndex = -1; if (__score0 > __bestScore) { __bestScore = __score0; __bestIndex = 0; } if (__score1 > __bestScore) { __bestScore = __score1; __bestIndex = 1; } if (__score2 > __bestScore) { __bestScore = __score2; __bestIndex = 2; } if (__score3 > __bestScore) { __bestScore = __score3; __bestIndex = 3; } + if (__score4 > __bestScore) { __bestScore = __score4; __bestIndex = 4; } global::Together.ChatCompletionSystemMessageParam? system = default; global::Together.ChatCompletionUserMessageParam? user = default; global::Together.ChatCompletionAssistantMessageParam? assistant = default; global::Together.ChatCompletionToolMessageParam? tool = default; + global::Together.ChatCompletionFunctionMessageParam? function = default; if (__bestIndex >= 0) { if (__bestIndex == 0) @@ -136,9 +152,28 @@ public class ChatCompletionMessageParamJsonConverter : global::System.Text.Json. // Legacy enum converters signal an incompatible JSON token with this exception. } } + else if (__bestIndex == 4) + { + try + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Together.ChatCompletionFunctionMessageParam), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Together.ChatCompletionFunctionMessageParam).Name}"); + function = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + catch (global::System.ArgumentOutOfRangeException __enumTokenException) when (__enumTokenException.ParamName == "reader") + { + // Legacy enum converters signal an incompatible JSON token with this exception. + } + } } - if (system == null && user == null && assistant == null && tool == null) + if (system == null && user == null && assistant == null && tool == null && function == null) { try { @@ -159,7 +194,7 @@ public class ChatCompletionMessageParamJsonConverter : global::System.Text.Json. } } - if (system == null && user == null && assistant == null && tool == null) + if (system == null && user == null && assistant == null && tool == null && function == null) { try { @@ -180,7 +215,7 @@ public class ChatCompletionMessageParamJsonConverter : global::System.Text.Json. } } - if (system == null && user == null && assistant == null && tool == null) + if (system == null && user == null && assistant == null && tool == null && function == null) { try { @@ -201,7 +236,7 @@ public class ChatCompletionMessageParamJsonConverter : global::System.Text.Json. } } - if (system == null && user == null && assistant == null && tool == null) + if (system == null && user == null && assistant == null && tool == null && function == null) { try { @@ -222,6 +257,27 @@ public class ChatCompletionMessageParamJsonConverter : global::System.Text.Json. } } + if (system == null && user == null && assistant == null && tool == null && function == null) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Together.ChatCompletionFunctionMessageParam), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Together.ChatCompletionFunctionMessageParam).Name}"); + function = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + catch (global::System.ArgumentOutOfRangeException __enumTokenException) when (__enumTokenException.ParamName == "reader") + { + // Legacy enum converters signal an incompatible JSON token with this exception. + } + } + var __value = new global::Together.ChatCompletionMessageParam( system, @@ -229,7 +285,9 @@ public class ChatCompletionMessageParamJsonConverter : global::System.Text.Json. assistant, - tool + tool, + + function ); return __value; @@ -268,6 +326,12 @@ public override void Write( throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Together.ChatCompletionToolMessageParam).Name}"); global::System.Text.Json.JsonSerializer.Serialize(writer, value.PickTool(), typeInfo); } + else if (value.IsFunction) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Together.ChatCompletionFunctionMessageParam), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Together.ChatCompletionFunctionMessageParam).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.PickFunction(), typeInfo); + } } } } \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.JsonConverters.CreateEndpointRequestState.g.cs b/src/libs/Together/Generated/Together.JsonConverters.CreateEndpointRequestState.g.cs new file mode 100644 index 00000000..8f880987 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.CreateEndpointRequestState.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class CreateEndpointRequestStateJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.CreateEndpointRequestState Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.CreateEndpointRequestStateExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.CreateEndpointRequestState)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.CreateEndpointRequestState); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.CreateEndpointRequestState value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.CreateEndpointRequestStateExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.CreateEndpointRequestStateNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.CreateEndpointRequestStateNullable.g.cs new file mode 100644 index 00000000..5e4d8eb1 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.CreateEndpointRequestStateNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class CreateEndpointRequestStateNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.CreateEndpointRequestState? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.CreateEndpointRequestStateExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.CreateEndpointRequestState)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.CreateEndpointRequestState?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.CreateEndpointRequestState? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.CreateEndpointRequestStateExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.CreateFineTunesRequestTrainOnInputs.g.cs b/src/libs/Together/Generated/Together.JsonConverters.CreateFineTunesRequestTrainOnInputs.g.cs new file mode 100644 index 00000000..0e7ca73f --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.CreateFineTunesRequestTrainOnInputs.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class CreateFineTunesRequestTrainOnInputsJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.CreateFineTunesRequestTrainOnInputs Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.CreateFineTunesRequestTrainOnInputsExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.CreateFineTunesRequestTrainOnInputs)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.CreateFineTunesRequestTrainOnInputs); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.CreateFineTunesRequestTrainOnInputs value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.CreateFineTunesRequestTrainOnInputsExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.CreateFineTunesRequestTrainOnInputsNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.CreateFineTunesRequestTrainOnInputsNullable.g.cs new file mode 100644 index 00000000..35876b48 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.CreateFineTunesRequestTrainOnInputsNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class CreateFineTunesRequestTrainOnInputsNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.CreateFineTunesRequestTrainOnInputs? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.CreateFineTunesRequestTrainOnInputsExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.CreateFineTunesRequestTrainOnInputs)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.CreateFineTunesRequestTrainOnInputs?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.CreateFineTunesRequestTrainOnInputs? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.CreateFineTunesRequestTrainOnInputsExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.WhoamiProjectApiKeyType.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DedicatedEndpointState.g.cs similarity index 67% rename from src/libs/Together/Generated/Together.JsonConverters.WhoamiProjectApiKeyType.g.cs rename to src/libs/Together/Generated/Together.JsonConverters.DedicatedEndpointState.g.cs index 065bd147..133126cc 100644 --- a/src/libs/Together/Generated/Together.JsonConverters.WhoamiProjectApiKeyType.g.cs +++ b/src/libs/Together/Generated/Together.JsonConverters.DedicatedEndpointState.g.cs @@ -3,10 +3,10 @@ namespace Together.JsonConverters { /// - public sealed class WhoamiProjectApiKeyTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class DedicatedEndpointStateJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::Together.WhoamiProjectApiKeyType Read( + public override global::Together.DedicatedEndpointState Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class WhoamiProjectApiKeyTypeJsonConverter : global::System.Text.J var stringValue = reader.GetString(); if (stringValue != null) { - return global::Together.WhoamiProjectApiKeyTypeExtensions.ToEnum(stringValue) ?? default; + return global::Together.DedicatedEndpointStateExtensions.ToEnum(stringValue) ?? default; } break; @@ -26,11 +26,11 @@ public sealed class WhoamiProjectApiKeyTypeJsonConverter : global::System.Text.J case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::Together.WhoamiProjectApiKeyType)numValue; + return (global::Together.DedicatedEndpointState)numValue; } case global::System.Text.Json.JsonTokenType.Null: { - return default(global::Together.WhoamiProjectApiKeyType); + return default(global::Together.DedicatedEndpointState); } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -42,12 +42,12 @@ public sealed class WhoamiProjectApiKeyTypeJsonConverter : global::System.Text.J /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::Together.WhoamiProjectApiKeyType value, + global::Together.DedicatedEndpointState value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - writer.WriteStringValue(global::Together.WhoamiProjectApiKeyTypeExtensions.ToValueString(value)); + writer.WriteStringValue(global::Together.DedicatedEndpointStateExtensions.ToValueString(value)); } } } diff --git a/src/libs/Together/Generated/Together.JsonConverters.WhoamiProjectApiKeyTypeNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DedicatedEndpointStateNullable.g.cs similarity index 69% rename from src/libs/Together/Generated/Together.JsonConverters.WhoamiProjectApiKeyTypeNullable.g.cs rename to src/libs/Together/Generated/Together.JsonConverters.DedicatedEndpointStateNullable.g.cs index 41fd04c7..03c971f3 100644 --- a/src/libs/Together/Generated/Together.JsonConverters.WhoamiProjectApiKeyTypeNullable.g.cs +++ b/src/libs/Together/Generated/Together.JsonConverters.DedicatedEndpointStateNullable.g.cs @@ -3,10 +3,10 @@ namespace Together.JsonConverters { /// - public sealed class WhoamiProjectApiKeyTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class DedicatedEndpointStateNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::Together.WhoamiProjectApiKeyType? Read( + public override global::Together.DedicatedEndpointState? Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class WhoamiProjectApiKeyTypeNullableJsonConverter : global::Syste var stringValue = reader.GetString(); if (stringValue != null) { - return global::Together.WhoamiProjectApiKeyTypeExtensions.ToEnum(stringValue); + return global::Together.DedicatedEndpointStateExtensions.ToEnum(stringValue); } break; @@ -26,11 +26,11 @@ public sealed class WhoamiProjectApiKeyTypeNullableJsonConverter : global::Syste case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::Together.WhoamiProjectApiKeyType)numValue; + return (global::Together.DedicatedEndpointState)numValue; } case global::System.Text.Json.JsonTokenType.Null: { - return default(global::Together.WhoamiProjectApiKeyType?); + return default(global::Together.DedicatedEndpointState?); } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -42,7 +42,7 @@ public sealed class WhoamiProjectApiKeyTypeNullableJsonConverter : global::Syste /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::Together.WhoamiProjectApiKeyType? value, + global::Together.DedicatedEndpointState? value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); @@ -53,7 +53,7 @@ public override void Write( } else { - writer.WriteStringValue(global::Together.WhoamiProjectApiKeyTypeExtensions.ToValueString(value.Value)); + writer.WriteStringValue(global::Together.DedicatedEndpointStateExtensions.ToValueString(value.Value)); } } } diff --git a/src/libs/Together/Generated/Together.JsonConverters.DedicatedEndpointType.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DedicatedEndpointType.g.cs new file mode 100644 index 00000000..ca162f54 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DedicatedEndpointType.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DedicatedEndpointTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DedicatedEndpointType Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DedicatedEndpointTypeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DedicatedEndpointType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DedicatedEndpointType); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DedicatedEndpointType value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.DedicatedEndpointTypeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DedicatedEndpointTypeNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DedicatedEndpointTypeNullable.g.cs new file mode 100644 index 00000000..60ef51f6 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DedicatedEndpointTypeNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DedicatedEndpointTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DedicatedEndpointType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DedicatedEndpointTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DedicatedEndpointType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DedicatedEndpointType?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DedicatedEndpointType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.DedicatedEndpointTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DisplayorExecuteOutputType.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DisplayorExecuteOutputType.g.cs new file mode 100644 index 00000000..9ea9bcee --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DisplayorExecuteOutputType.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DisplayorExecuteOutputTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DisplayorExecuteOutputType Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DisplayorExecuteOutputTypeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DisplayorExecuteOutputType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DisplayorExecuteOutputType); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DisplayorExecuteOutputType value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.DisplayorExecuteOutputTypeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.DisplayorExecuteOutputTypeNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.DisplayorExecuteOutputTypeNullable.g.cs new file mode 100644 index 00000000..7449f101 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.DisplayorExecuteOutputTypeNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class DisplayorExecuteOutputTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.DisplayorExecuteOutputType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.DisplayorExecuteOutputTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.DisplayorExecuteOutputType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.DisplayorExecuteOutputType?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.DisplayorExecuteOutputType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.DisplayorExecuteOutputTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.Error.g.cs b/src/libs/Together/Generated/Together.JsonConverters.Error.g.cs new file mode 100644 index 00000000..ac2f1ef1 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.Error.g.cs @@ -0,0 +1,178 @@ +#nullable enable +#pragma warning disable CS0618 // Type or member is obsolete + +namespace Together.JsonConverters +{ + /// + public class ErrorJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.Error Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + options = options ?? throw new global::System.ArgumentNullException(nameof(options)); + var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); + + + using var __jsonDocument = global::System.Text.Json.JsonDocument.ParseValue(ref reader); + var __rawJson = __jsonDocument.RootElement.GetRawText(); + var __jsonProps = new global::System.Collections.Generic.HashSet(); + if (__jsonDocument.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Object) + { + foreach (var __jsonProp in __jsonDocument.RootElement.EnumerateObject()) + { + __jsonProps.Add(__jsonProp.Name); + } + } + + var __score0 = 0; + { + var __ti = typeInfoResolver.GetTypeInfo(typeof(string), options); + if (__ti != null && __ti.Kind == global::System.Text.Json.Serialization.Metadata.JsonTypeInfoKind.Object) + { + foreach (var __prop in __ti.Properties) + { + if (__jsonProps.Contains(__prop.Name)) __score0++; + } + } + } + var __score1 = 0; + { + var __ti = typeInfoResolver.GetTypeInfo(typeof(object), options); + if (__ti != null && __ti.Kind == global::System.Text.Json.Serialization.Metadata.JsonTypeInfoKind.Object) + { + foreach (var __prop in __ti.Properties) + { + if (__jsonProps.Contains(__prop.Name)) __score1++; + } + } + } + var __bestScore = 0; + var __bestIndex = -1; + if (__score0 > __bestScore) { __bestScore = __score0; __bestIndex = 0; } + if (__score1 > __bestScore) { __bestScore = __score1; __bestIndex = 1; } + + string? errorVariant1 = default; + object? errorVariant2 = default; + if (__bestIndex >= 0) + { + if (__bestIndex == 0) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(string), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(string).Name}"); + errorVariant1 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + catch (global::System.ArgumentOutOfRangeException __enumTokenException) when (__enumTokenException.ParamName == "reader") + { + // Legacy enum converters signal an incompatible JSON token with this exception. + } + } + + else if (__bestIndex == 1) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(object), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(object).Name}"); + errorVariant2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + catch (global::System.ArgumentOutOfRangeException __enumTokenException) when (__enumTokenException.ParamName == "reader") + { + // Legacy enum converters signal an incompatible JSON token with this exception. + } + } + } + + if (errorVariant1 == null && errorVariant2 == null) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(string), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(string).Name}"); + errorVariant1 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + catch (global::System.ArgumentOutOfRangeException __enumTokenException) when (__enumTokenException.ParamName == "reader") + { + // Legacy enum converters signal an incompatible JSON token with this exception. + } + } + + if (errorVariant1 == null && errorVariant2 == null) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(object), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(object).Name}"); + errorVariant2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + catch (global::System.ArgumentOutOfRangeException __enumTokenException) when (__enumTokenException.ParamName == "reader") + { + // Legacy enum converters signal an incompatible JSON token with this exception. + } + } + + var __value = new global::Together.Error( + errorVariant1, + + errorVariant2 + ); + + return __value; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.Error value, + global::System.Text.Json.JsonSerializerOptions options) + { + options = options ?? throw new global::System.ArgumentNullException(nameof(options)); + var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); + + if (value.IsErrorVariant1) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(string), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(string).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.PickErrorVariant1(), typeInfo); + } + else if (value.IsErrorVariant2) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(object), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(object).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.PickErrorVariant2(), typeInfo); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.JsonConverters.WhoamiOrgApiKeyType.g.cs b/src/libs/Together/Generated/Together.JsonConverters.ErrorOutputType.g.cs similarity index 68% rename from src/libs/Together/Generated/Together.JsonConverters.WhoamiOrgApiKeyType.g.cs rename to src/libs/Together/Generated/Together.JsonConverters.ErrorOutputType.g.cs index 1900fa26..fc9417e8 100644 --- a/src/libs/Together/Generated/Together.JsonConverters.WhoamiOrgApiKeyType.g.cs +++ b/src/libs/Together/Generated/Together.JsonConverters.ErrorOutputType.g.cs @@ -3,10 +3,10 @@ namespace Together.JsonConverters { /// - public sealed class WhoamiOrgApiKeyTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class ErrorOutputTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::Together.WhoamiOrgApiKeyType Read( + public override global::Together.ErrorOutputType Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class WhoamiOrgApiKeyTypeJsonConverter : global::System.Text.Json. var stringValue = reader.GetString(); if (stringValue != null) { - return global::Together.WhoamiOrgApiKeyTypeExtensions.ToEnum(stringValue) ?? default; + return global::Together.ErrorOutputTypeExtensions.ToEnum(stringValue) ?? default; } break; @@ -26,11 +26,11 @@ public sealed class WhoamiOrgApiKeyTypeJsonConverter : global::System.Text.Json. case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::Together.WhoamiOrgApiKeyType)numValue; + return (global::Together.ErrorOutputType)numValue; } case global::System.Text.Json.JsonTokenType.Null: { - return default(global::Together.WhoamiOrgApiKeyType); + return default(global::Together.ErrorOutputType); } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -42,12 +42,12 @@ public sealed class WhoamiOrgApiKeyTypeJsonConverter : global::System.Text.Json. /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::Together.WhoamiOrgApiKeyType value, + global::Together.ErrorOutputType value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - writer.WriteStringValue(global::Together.WhoamiOrgApiKeyTypeExtensions.ToValueString(value)); + writer.WriteStringValue(global::Together.ErrorOutputTypeExtensions.ToValueString(value)); } } } diff --git a/src/libs/Together/Generated/Together.JsonConverters.WhoamiOrgApiKeyTypeNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.ErrorOutputTypeNullable.g.cs similarity index 70% rename from src/libs/Together/Generated/Together.JsonConverters.WhoamiOrgApiKeyTypeNullable.g.cs rename to src/libs/Together/Generated/Together.JsonConverters.ErrorOutputTypeNullable.g.cs index da09fe03..052909de 100644 --- a/src/libs/Together/Generated/Together.JsonConverters.WhoamiOrgApiKeyTypeNullable.g.cs +++ b/src/libs/Together/Generated/Together.JsonConverters.ErrorOutputTypeNullable.g.cs @@ -3,10 +3,10 @@ namespace Together.JsonConverters { /// - public sealed class WhoamiOrgApiKeyTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class ErrorOutputTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::Together.WhoamiOrgApiKeyType? Read( + public override global::Together.ErrorOutputType? Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class WhoamiOrgApiKeyTypeNullableJsonConverter : global::System.Te var stringValue = reader.GetString(); if (stringValue != null) { - return global::Together.WhoamiOrgApiKeyTypeExtensions.ToEnum(stringValue); + return global::Together.ErrorOutputTypeExtensions.ToEnum(stringValue); } break; @@ -26,11 +26,11 @@ public sealed class WhoamiOrgApiKeyTypeNullableJsonConverter : global::System.Te case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::Together.WhoamiOrgApiKeyType)numValue; + return (global::Together.ErrorOutputType)numValue; } case global::System.Text.Json.JsonTokenType.Null: { - return default(global::Together.WhoamiOrgApiKeyType?); + return default(global::Together.ErrorOutputType?); } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -42,7 +42,7 @@ public sealed class WhoamiOrgApiKeyTypeNullableJsonConverter : global::System.Te /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::Together.WhoamiOrgApiKeyType? value, + global::Together.ErrorOutputType? value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); @@ -53,7 +53,7 @@ public override void Write( } else { - writer.WriteStringValue(global::Together.WhoamiOrgApiKeyTypeExtensions.ToValueString(value.Value)); + writer.WriteStringValue(global::Together.ErrorOutputTypeExtensions.ToValueString(value.Value)); } } } diff --git a/src/libs/Together/Generated/Together.JsonConverters.ExecuteRequestFileEncoding.g.cs b/src/libs/Together/Generated/Together.JsonConverters.ExecuteRequestFileEncoding.g.cs new file mode 100644 index 00000000..1f063499 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.ExecuteRequestFileEncoding.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class ExecuteRequestFileEncodingJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.ExecuteRequestFileEncoding Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.ExecuteRequestFileEncodingExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.ExecuteRequestFileEncoding)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.ExecuteRequestFileEncoding); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.ExecuteRequestFileEncoding value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.ExecuteRequestFileEncodingExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.ExecuteRequestFileEncodingNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.ExecuteRequestFileEncodingNullable.g.cs new file mode 100644 index 00000000..2638ed64 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.ExecuteRequestFileEncodingNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class ExecuteRequestFileEncodingNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.ExecuteRequestFileEncoding? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.ExecuteRequestFileEncodingExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.ExecuteRequestFileEncoding)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.ExecuteRequestFileEncoding?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.ExecuteRequestFileEncoding? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.ExecuteRequestFileEncodingExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.ExecuteRequestLanguage.g.cs b/src/libs/Together/Generated/Together.JsonConverters.ExecuteRequestLanguage.g.cs new file mode 100644 index 00000000..6e770c2c --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.ExecuteRequestLanguage.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class ExecuteRequestLanguageJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.ExecuteRequestLanguage Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.ExecuteRequestLanguageExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.ExecuteRequestLanguage)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.ExecuteRequestLanguage); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.ExecuteRequestLanguage value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.ExecuteRequestLanguageExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.ExecuteRequestLanguageNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.ExecuteRequestLanguageNullable.g.cs new file mode 100644 index 00000000..ea91c737 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.ExecuteRequestLanguageNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class ExecuteRequestLanguageNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.ExecuteRequestLanguage? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.ExecuteRequestLanguageExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.ExecuteRequestLanguage)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.ExecuteRequestLanguage?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.ExecuteRequestLanguage? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.ExecuteRequestLanguageExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.ExecuteResponse.g.cs b/src/libs/Together/Generated/Together.JsonConverters.ExecuteResponse.g.cs new file mode 100644 index 00000000..b9608285 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.ExecuteResponse.g.cs @@ -0,0 +1,169 @@ +#nullable enable +#pragma warning disable CS0618 // Type or member is obsolete + +namespace Together.JsonConverters +{ + /// + public class ExecuteResponseJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.ExecuteResponse Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + options = options ?? throw new global::System.ArgumentNullException(nameof(options)); + var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); + + using var __jsonDocument = global::System.Text.Json.JsonDocument.ParseValue(ref reader); + var __rawJson = __jsonDocument.RootElement.GetRawText(); + var __jsonProps = new global::System.Collections.Generic.HashSet(); + if (__jsonDocument.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Object) + { + foreach (var __jsonProp in __jsonDocument.RootElement.EnumerateObject()) + { + __jsonProps.Add(__jsonProp.Name); + if (__jsonProp.Value.ValueKind == global::System.Text.Json.JsonValueKind.Object) + { + foreach (var __nestedJsonProp in __jsonProp.Value.EnumerateObject()) + { + __jsonProps.Add(__jsonProp.Name + "." + __nestedJsonProp.Name); + } + } + + } + } + + var __score0 = 0; + if (__jsonProps.Contains("data")) __score0++; + if (__jsonProps.Contains("data.outputs")) __score0++; + if (__jsonProps.Contains("data.session_id")) __score0++; + if (__jsonProps.Contains("data.status")) __score0++; + if (__jsonProps.Contains("errors")) __score0++; + var __score1 = 0; + if (__jsonProps.Contains("data")) __score1++; + if (__jsonProps.Contains("errors")) __score1++; + var __bestScore = 0; + var __bestIndex = -1; + if (__score0 > __bestScore) { __bestScore = __score0; __bestIndex = 0; } + if (__score1 > __bestScore) { __bestScore = __score1; __bestIndex = 1; } + + global::Together.ExecuteResponseSuccessfulExecution? successfulExecution = default; + global::Together.ExecuteResponseFailedExecution? failedExecution = default; + if (__bestIndex >= 0) + { + if (__bestIndex == 0) + { + try + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Together.ExecuteResponseSuccessfulExecution), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Together.ExecuteResponseSuccessfulExecution).Name}"); + successfulExecution = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + catch (global::System.ArgumentOutOfRangeException __enumTokenException) when (__enumTokenException.ParamName == "reader") + { + // Legacy enum converters signal an incompatible JSON token with this exception. + } + } + else if (__bestIndex == 1) + { + try + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Together.ExecuteResponseFailedExecution), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Together.ExecuteResponseFailedExecution).Name}"); + failedExecution = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + catch (global::System.ArgumentOutOfRangeException __enumTokenException) when (__enumTokenException.ParamName == "reader") + { + // Legacy enum converters signal an incompatible JSON token with this exception. + } + } + } + + if (successfulExecution == null && failedExecution == null) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Together.ExecuteResponseSuccessfulExecution), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Together.ExecuteResponseSuccessfulExecution).Name}"); + successfulExecution = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + catch (global::System.ArgumentOutOfRangeException __enumTokenException) when (__enumTokenException.ParamName == "reader") + { + // Legacy enum converters signal an incompatible JSON token with this exception. + } + } + + if (successfulExecution == null && failedExecution == null) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Together.ExecuteResponseFailedExecution), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Together.ExecuteResponseFailedExecution).Name}"); + failedExecution = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + catch (global::System.ArgumentOutOfRangeException __enumTokenException) when (__enumTokenException.ParamName == "reader") + { + // Legacy enum converters signal an incompatible JSON token with this exception. + } + } + + var __value = new global::Together.ExecuteResponse( + successfulExecution, + + failedExecution + ); + + return __value; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.ExecuteResponse value, + global::System.Text.Json.JsonSerializerOptions options) + { + options = options ?? throw new global::System.ArgumentNullException(nameof(options)); + var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); + + if (value.IsSuccessfulExecution) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Together.ExecuteResponseSuccessfulExecution), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Together.ExecuteResponseSuccessfulExecution).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.PickSuccessfulExecution(), typeInfo); + } + else if (value.IsFailedExecution) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Together.ExecuteResponseFailedExecution), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Together.ExecuteResponseFailedExecution).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.PickFailedExecution(), typeInfo); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.JsonConverters.ExecuteResponseSuccessfulExecutionDataOutputDiscriminatorType.g.cs b/src/libs/Together/Generated/Together.JsonConverters.ExecuteResponseSuccessfulExecutionDataOutputDiscriminatorType.g.cs new file mode 100644 index 00000000..f6b86987 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.ExecuteResponseSuccessfulExecutionDataOutputDiscriminatorType.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class ExecuteResponseSuccessfulExecutionDataOutputDiscriminatorTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.ExecuteResponseSuccessfulExecutionDataOutputDiscriminatorType Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.ExecuteResponseSuccessfulExecutionDataOutputDiscriminatorTypeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.ExecuteResponseSuccessfulExecutionDataOutputDiscriminatorType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.ExecuteResponseSuccessfulExecutionDataOutputDiscriminatorType); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.ExecuteResponseSuccessfulExecutionDataOutputDiscriminatorType value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.ExecuteResponseSuccessfulExecutionDataOutputDiscriminatorTypeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.ExecuteResponseSuccessfulExecutionDataOutputDiscriminatorTypeNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.ExecuteResponseSuccessfulExecutionDataOutputDiscriminatorTypeNullable.g.cs new file mode 100644 index 00000000..ddab38cd --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.ExecuteResponseSuccessfulExecutionDataOutputDiscriminatorTypeNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class ExecuteResponseSuccessfulExecutionDataOutputDiscriminatorTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.ExecuteResponseSuccessfulExecutionDataOutputDiscriminatorType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.ExecuteResponseSuccessfulExecutionDataOutputDiscriminatorTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.ExecuteResponseSuccessfulExecutionDataOutputDiscriminatorType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.ExecuteResponseSuccessfulExecutionDataOutputDiscriminatorType?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.ExecuteResponseSuccessfulExecutionDataOutputDiscriminatorType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.ExecuteResponseSuccessfulExecutionDataOutputDiscriminatorTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputType.g.cs b/src/libs/Together/Generated/Together.JsonConverters.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputType.g.cs new file mode 100644 index 00000000..7031d8d2 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputType.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputType Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputTypeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputType); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputType value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputTypeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputTypeNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputTypeNullable.g.cs new file mode 100644 index 00000000..8b3942dd --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputTypeNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputType?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.ExecuteResponseSuccessfulExecutionDataOutputErrorOutputType.g.cs b/src/libs/Together/Generated/Together.JsonConverters.ExecuteResponseSuccessfulExecutionDataOutputErrorOutputType.g.cs new file mode 100644 index 00000000..74113e6d --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.ExecuteResponseSuccessfulExecutionDataOutputErrorOutputType.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class ExecuteResponseSuccessfulExecutionDataOutputErrorOutputTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.ExecuteResponseSuccessfulExecutionDataOutputErrorOutputType Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.ExecuteResponseSuccessfulExecutionDataOutputErrorOutputTypeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.ExecuteResponseSuccessfulExecutionDataOutputErrorOutputType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.ExecuteResponseSuccessfulExecutionDataOutputErrorOutputType); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.ExecuteResponseSuccessfulExecutionDataOutputErrorOutputType value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.ExecuteResponseSuccessfulExecutionDataOutputErrorOutputTypeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.ExecuteResponseSuccessfulExecutionDataOutputErrorOutputTypeNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.ExecuteResponseSuccessfulExecutionDataOutputErrorOutputTypeNullable.g.cs new file mode 100644 index 00000000..0a8b90d5 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.ExecuteResponseSuccessfulExecutionDataOutputErrorOutputTypeNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class ExecuteResponseSuccessfulExecutionDataOutputErrorOutputTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.ExecuteResponseSuccessfulExecutionDataOutputErrorOutputType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.ExecuteResponseSuccessfulExecutionDataOutputErrorOutputTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.ExecuteResponseSuccessfulExecutionDataOutputErrorOutputType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.ExecuteResponseSuccessfulExecutionDataOutputErrorOutputType?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.ExecuteResponseSuccessfulExecutionDataOutputErrorOutputType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.ExecuteResponseSuccessfulExecutionDataOutputErrorOutputTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.ExecuteResponseSuccessfulExecutionDataOutputStreamOutputType.g.cs b/src/libs/Together/Generated/Together.JsonConverters.ExecuteResponseSuccessfulExecutionDataOutputStreamOutputType.g.cs new file mode 100644 index 00000000..c060ea8e --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.ExecuteResponseSuccessfulExecutionDataOutputStreamOutputType.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class ExecuteResponseSuccessfulExecutionDataOutputStreamOutputTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.ExecuteResponseSuccessfulExecutionDataOutputStreamOutputType Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.ExecuteResponseSuccessfulExecutionDataOutputStreamOutputTypeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.ExecuteResponseSuccessfulExecutionDataOutputStreamOutputType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.ExecuteResponseSuccessfulExecutionDataOutputStreamOutputType); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.ExecuteResponseSuccessfulExecutionDataOutputStreamOutputType value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.ExecuteResponseSuccessfulExecutionDataOutputStreamOutputTypeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.ExecuteResponseSuccessfulExecutionDataOutputStreamOutputTypeNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.ExecuteResponseSuccessfulExecutionDataOutputStreamOutputTypeNullable.g.cs new file mode 100644 index 00000000..31a9f666 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.ExecuteResponseSuccessfulExecutionDataOutputStreamOutputTypeNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class ExecuteResponseSuccessfulExecutionDataOutputStreamOutputTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.ExecuteResponseSuccessfulExecutionDataOutputStreamOutputType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.ExecuteResponseSuccessfulExecutionDataOutputStreamOutputTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.ExecuteResponseSuccessfulExecutionDataOutputStreamOutputType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.ExecuteResponseSuccessfulExecutionDataOutputStreamOutputType?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.ExecuteResponseSuccessfulExecutionDataOutputStreamOutputType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.ExecuteResponseSuccessfulExecutionDataOutputStreamOutputTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.ExecuteResponseSuccessfulExecutionDataStatus.g.cs b/src/libs/Together/Generated/Together.JsonConverters.ExecuteResponseSuccessfulExecutionDataStatus.g.cs new file mode 100644 index 00000000..e8910b93 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.ExecuteResponseSuccessfulExecutionDataStatus.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class ExecuteResponseSuccessfulExecutionDataStatusJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.ExecuteResponseSuccessfulExecutionDataStatus Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.ExecuteResponseSuccessfulExecutionDataStatusExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.ExecuteResponseSuccessfulExecutionDataStatus)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.ExecuteResponseSuccessfulExecutionDataStatus); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.ExecuteResponseSuccessfulExecutionDataStatus value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.ExecuteResponseSuccessfulExecutionDataStatusExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.ExecuteResponseSuccessfulExecutionDataStatusNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.ExecuteResponseSuccessfulExecutionDataStatusNullable.g.cs new file mode 100644 index 00000000..c36dbef4 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.ExecuteResponseSuccessfulExecutionDataStatusNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class ExecuteResponseSuccessfulExecutionDataStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.ExecuteResponseSuccessfulExecutionDataStatus? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.ExecuteResponseSuccessfulExecutionDataStatusExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.ExecuteResponseSuccessfulExecutionDataStatus)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.ExecuteResponseSuccessfulExecutionDataStatus?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.ExecuteResponseSuccessfulExecutionDataStatus? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.ExecuteResponseSuccessfulExecutionDataStatusExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.HardwareAvailabilityStatus.g.cs b/src/libs/Together/Generated/Together.JsonConverters.HardwareAvailabilityStatus.g.cs new file mode 100644 index 00000000..97252e16 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.HardwareAvailabilityStatus.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class HardwareAvailabilityStatusJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.HardwareAvailabilityStatus Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.HardwareAvailabilityStatusExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.HardwareAvailabilityStatus)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.HardwareAvailabilityStatus); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.HardwareAvailabilityStatus value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.HardwareAvailabilityStatusExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.HardwareAvailabilityStatusNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.HardwareAvailabilityStatusNullable.g.cs new file mode 100644 index 00000000..d2fe32da --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.HardwareAvailabilityStatusNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class HardwareAvailabilityStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.HardwareAvailabilityStatus? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.HardwareAvailabilityStatusExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.HardwareAvailabilityStatus)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.HardwareAvailabilityStatus?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.HardwareAvailabilityStatus? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.HardwareAvailabilityStatusExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.InterpreterOutput.g.cs b/src/libs/Together/Generated/Together.JsonConverters.InterpreterOutput.g.cs new file mode 100644 index 00000000..34ffc316 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.InterpreterOutput.g.cs @@ -0,0 +1,233 @@ +#nullable enable +#pragma warning disable CS0618 // Type or member is obsolete + +namespace Together.JsonConverters +{ + /// + public class InterpreterOutputJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.InterpreterOutput Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + options = options ?? throw new global::System.ArgumentNullException(nameof(options)); + var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); + + using var __jsonDocument = global::System.Text.Json.JsonDocument.ParseValue(ref reader); + var __rawJson = __jsonDocument.RootElement.GetRawText(); + var __jsonProps = new global::System.Collections.Generic.HashSet(); + if (__jsonDocument.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Object) + { + foreach (var __jsonProp in __jsonDocument.RootElement.EnumerateObject()) + { + __jsonProps.Add(__jsonProp.Name); + if (__jsonProp.Value.ValueKind == global::System.Text.Json.JsonValueKind.Object) + { + foreach (var __nestedJsonProp in __jsonProp.Value.EnumerateObject()) + { + __jsonProps.Add(__jsonProp.Name + "." + __nestedJsonProp.Name); + } + } + + } + } + + var __score0 = 0; + if (__jsonProps.Contains("data")) __score0++; + if (__jsonProps.Contains("type")) __score0++; + var __score1 = 0; + if (__jsonProps.Contains("data")) __score1++; + if (__jsonProps.Contains("type")) __score1++; + var __score2 = 0; + if (__jsonProps.Contains("data")) __score2++; + if (__jsonProps.Contains("data.application/geo+json")) __score2++; + if (__jsonProps.Contains("data.application/javascript")) __score2++; + if (__jsonProps.Contains("data.application/json")) __score2++; + if (__jsonProps.Contains("data.application/pdf")) __score2++; + if (__jsonProps.Contains("data.application/vnd.vega.v5+json")) __score2++; + if (__jsonProps.Contains("data.application/vnd.vegalite.v4+json")) __score2++; + if (__jsonProps.Contains("data.image/gif")) __score2++; + if (__jsonProps.Contains("data.image/jpeg")) __score2++; + if (__jsonProps.Contains("data.image/png")) __score2++; + if (__jsonProps.Contains("data.image/svg+xml")) __score2++; + if (__jsonProps.Contains("data.text/html")) __score2++; + if (__jsonProps.Contains("data.text/latex")) __score2++; + if (__jsonProps.Contains("data.text/markdown")) __score2++; + if (__jsonProps.Contains("data.text/plain")) __score2++; + if (__jsonProps.Contains("type")) __score2++; + var __bestScore = 0; + var __bestIndex = -1; + if (__score0 > __bestScore) { __bestScore = __score0; __bestIndex = 0; } + if (__score1 > __bestScore) { __bestScore = __score1; __bestIndex = 1; } + if (__score2 > __bestScore) { __bestScore = __score2; __bestIndex = 2; } + + global::Together.InterpreterOutputStreamOutput? streamOutput = default; + global::Together.InterpreterOutputErrorOutput? error = default; + global::Together.InterpreterOutputDisplayorExecuteOutput? displayorExecuteOutput = default; + if (__bestIndex >= 0) + { + if (__bestIndex == 0) + { + try + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Together.InterpreterOutputStreamOutput), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Together.InterpreterOutputStreamOutput).Name}"); + streamOutput = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + catch (global::System.ArgumentOutOfRangeException __enumTokenException) when (__enumTokenException.ParamName == "reader") + { + // Legacy enum converters signal an incompatible JSON token with this exception. + } + } + else if (__bestIndex == 1) + { + try + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Together.InterpreterOutputErrorOutput), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Together.InterpreterOutputErrorOutput).Name}"); + error = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + catch (global::System.ArgumentOutOfRangeException __enumTokenException) when (__enumTokenException.ParamName == "reader") + { + // Legacy enum converters signal an incompatible JSON token with this exception. + } + } + else if (__bestIndex == 2) + { + try + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Together.InterpreterOutputDisplayorExecuteOutput), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Together.InterpreterOutputDisplayorExecuteOutput).Name}"); + displayorExecuteOutput = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + catch (global::System.ArgumentOutOfRangeException __enumTokenException) when (__enumTokenException.ParamName == "reader") + { + // Legacy enum converters signal an incompatible JSON token with this exception. + } + } + } + + if (streamOutput == null && error == null && displayorExecuteOutput == null) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Together.InterpreterOutputStreamOutput), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Together.InterpreterOutputStreamOutput).Name}"); + streamOutput = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + catch (global::System.ArgumentOutOfRangeException __enumTokenException) when (__enumTokenException.ParamName == "reader") + { + // Legacy enum converters signal an incompatible JSON token with this exception. + } + } + + if (streamOutput == null && error == null && displayorExecuteOutput == null) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Together.InterpreterOutputErrorOutput), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Together.InterpreterOutputErrorOutput).Name}"); + error = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + catch (global::System.ArgumentOutOfRangeException __enumTokenException) when (__enumTokenException.ParamName == "reader") + { + // Legacy enum converters signal an incompatible JSON token with this exception. + } + } + + if (streamOutput == null && error == null && displayorExecuteOutput == null) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Together.InterpreterOutputDisplayorExecuteOutput), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Together.InterpreterOutputDisplayorExecuteOutput).Name}"); + displayorExecuteOutput = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + catch (global::System.ArgumentOutOfRangeException __enumTokenException) when (__enumTokenException.ParamName == "reader") + { + // Legacy enum converters signal an incompatible JSON token with this exception. + } + } + + var __value = new global::Together.InterpreterOutput( + streamOutput, + + error, + + displayorExecuteOutput + ); + + return __value; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.InterpreterOutput value, + global::System.Text.Json.JsonSerializerOptions options) + { + options = options ?? throw new global::System.ArgumentNullException(nameof(options)); + var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); + + if (value.IsStreamOutput) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Together.InterpreterOutputStreamOutput), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Together.InterpreterOutputStreamOutput).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.PickStreamOutput(), typeInfo); + } + else if (value.IsError) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Together.InterpreterOutputErrorOutput), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Together.InterpreterOutputErrorOutput).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.PickError(), typeInfo); + } + else if (value.IsDisplayorExecuteOutput) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Together.InterpreterOutputDisplayorExecuteOutput), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Together.InterpreterOutputDisplayorExecuteOutput).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.PickDisplayorExecuteOutput(), typeInfo); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.JsonConverters.InterpreterOutputDiscriminatorType.g.cs b/src/libs/Together/Generated/Together.JsonConverters.InterpreterOutputDiscriminatorType.g.cs new file mode 100644 index 00000000..e2d810a3 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.InterpreterOutputDiscriminatorType.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class InterpreterOutputDiscriminatorTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.InterpreterOutputDiscriminatorType Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.InterpreterOutputDiscriminatorTypeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.InterpreterOutputDiscriminatorType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.InterpreterOutputDiscriminatorType); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.InterpreterOutputDiscriminatorType value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.InterpreterOutputDiscriminatorTypeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.InterpreterOutputDiscriminatorTypeNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.InterpreterOutputDiscriminatorTypeNullable.g.cs new file mode 100644 index 00000000..fd917d73 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.InterpreterOutputDiscriminatorTypeNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class InterpreterOutputDiscriminatorTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.InterpreterOutputDiscriminatorType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.InterpreterOutputDiscriminatorTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.InterpreterOutputDiscriminatorType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.InterpreterOutputDiscriminatorType?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.InterpreterOutputDiscriminatorType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.InterpreterOutputDiscriminatorTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.InterpreterOutputDisplayorExecuteOutputType.g.cs b/src/libs/Together/Generated/Together.JsonConverters.InterpreterOutputDisplayorExecuteOutputType.g.cs new file mode 100644 index 00000000..76a023bf --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.InterpreterOutputDisplayorExecuteOutputType.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class InterpreterOutputDisplayorExecuteOutputTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.InterpreterOutputDisplayorExecuteOutputType Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.InterpreterOutputDisplayorExecuteOutputTypeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.InterpreterOutputDisplayorExecuteOutputType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.InterpreterOutputDisplayorExecuteOutputType); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.InterpreterOutputDisplayorExecuteOutputType value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.InterpreterOutputDisplayorExecuteOutputTypeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.InterpreterOutputDisplayorExecuteOutputTypeNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.InterpreterOutputDisplayorExecuteOutputTypeNullable.g.cs new file mode 100644 index 00000000..4275f347 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.InterpreterOutputDisplayorExecuteOutputTypeNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class InterpreterOutputDisplayorExecuteOutputTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.InterpreterOutputDisplayorExecuteOutputType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.InterpreterOutputDisplayorExecuteOutputTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.InterpreterOutputDisplayorExecuteOutputType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.InterpreterOutputDisplayorExecuteOutputType?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.InterpreterOutputDisplayorExecuteOutputType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.InterpreterOutputDisplayorExecuteOutputTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.WhoamiResponseDiscriminatorType.g.cs b/src/libs/Together/Generated/Together.JsonConverters.InterpreterOutputErrorOutputType.g.cs similarity index 64% rename from src/libs/Together/Generated/Together.JsonConverters.WhoamiResponseDiscriminatorType.g.cs rename to src/libs/Together/Generated/Together.JsonConverters.InterpreterOutputErrorOutputType.g.cs index dd9472d6..7d9df3f8 100644 --- a/src/libs/Together/Generated/Together.JsonConverters.WhoamiResponseDiscriminatorType.g.cs +++ b/src/libs/Together/Generated/Together.JsonConverters.InterpreterOutputErrorOutputType.g.cs @@ -3,10 +3,10 @@ namespace Together.JsonConverters { /// - public sealed class WhoamiResponseDiscriminatorTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class InterpreterOutputErrorOutputTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::Together.WhoamiResponseDiscriminatorType Read( + public override global::Together.InterpreterOutputErrorOutputType Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class WhoamiResponseDiscriminatorTypeJsonConverter : global::Syste var stringValue = reader.GetString(); if (stringValue != null) { - return global::Together.WhoamiResponseDiscriminatorTypeExtensions.ToEnum(stringValue) ?? default; + return global::Together.InterpreterOutputErrorOutputTypeExtensions.ToEnum(stringValue) ?? default; } break; @@ -26,11 +26,11 @@ public sealed class WhoamiResponseDiscriminatorTypeJsonConverter : global::Syste case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::Together.WhoamiResponseDiscriminatorType)numValue; + return (global::Together.InterpreterOutputErrorOutputType)numValue; } case global::System.Text.Json.JsonTokenType.Null: { - return default(global::Together.WhoamiResponseDiscriminatorType); + return default(global::Together.InterpreterOutputErrorOutputType); } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -42,12 +42,12 @@ public sealed class WhoamiResponseDiscriminatorTypeJsonConverter : global::Syste /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::Together.WhoamiResponseDiscriminatorType value, + global::Together.InterpreterOutputErrorOutputType value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - writer.WriteStringValue(global::Together.WhoamiResponseDiscriminatorTypeExtensions.ToValueString(value)); + writer.WriteStringValue(global::Together.InterpreterOutputErrorOutputTypeExtensions.ToValueString(value)); } } } diff --git a/src/libs/Together/Generated/Together.JsonConverters.InterpreterOutputErrorOutputTypeNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.InterpreterOutputErrorOutputTypeNullable.g.cs new file mode 100644 index 00000000..024c48df --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.InterpreterOutputErrorOutputTypeNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class InterpreterOutputErrorOutputTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.InterpreterOutputErrorOutputType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.InterpreterOutputErrorOutputTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.InterpreterOutputErrorOutputType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.InterpreterOutputErrorOutputType?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.InterpreterOutputErrorOutputType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.InterpreterOutputErrorOutputTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.InterpreterOutputStreamOutputType.g.cs b/src/libs/Together/Generated/Together.JsonConverters.InterpreterOutputStreamOutputType.g.cs new file mode 100644 index 00000000..d181e78a --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.InterpreterOutputStreamOutputType.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class InterpreterOutputStreamOutputTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.InterpreterOutputStreamOutputType Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.InterpreterOutputStreamOutputTypeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.InterpreterOutputStreamOutputType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.InterpreterOutputStreamOutputType); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.InterpreterOutputStreamOutputType value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.InterpreterOutputStreamOutputTypeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.WhoamiResponseDiscriminatorTypeNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.InterpreterOutputStreamOutputTypeNullable.g.cs similarity index 66% rename from src/libs/Together/Generated/Together.JsonConverters.WhoamiResponseDiscriminatorTypeNullable.g.cs rename to src/libs/Together/Generated/Together.JsonConverters.InterpreterOutputStreamOutputTypeNullable.g.cs index ae083cab..de8debef 100644 --- a/src/libs/Together/Generated/Together.JsonConverters.WhoamiResponseDiscriminatorTypeNullable.g.cs +++ b/src/libs/Together/Generated/Together.JsonConverters.InterpreterOutputStreamOutputTypeNullable.g.cs @@ -3,10 +3,10 @@ namespace Together.JsonConverters { /// - public sealed class WhoamiResponseDiscriminatorTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class InterpreterOutputStreamOutputTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::Together.WhoamiResponseDiscriminatorType? Read( + public override global::Together.InterpreterOutputStreamOutputType? Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class WhoamiResponseDiscriminatorTypeNullableJsonConverter : globa var stringValue = reader.GetString(); if (stringValue != null) { - return global::Together.WhoamiResponseDiscriminatorTypeExtensions.ToEnum(stringValue); + return global::Together.InterpreterOutputStreamOutputTypeExtensions.ToEnum(stringValue); } break; @@ -26,11 +26,11 @@ public sealed class WhoamiResponseDiscriminatorTypeNullableJsonConverter : globa case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::Together.WhoamiResponseDiscriminatorType)numValue; + return (global::Together.InterpreterOutputStreamOutputType)numValue; } case global::System.Text.Json.JsonTokenType.Null: { - return default(global::Together.WhoamiResponseDiscriminatorType?); + return default(global::Together.InterpreterOutputStreamOutputType?); } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -42,7 +42,7 @@ public sealed class WhoamiResponseDiscriminatorTypeNullableJsonConverter : globa /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::Together.WhoamiResponseDiscriminatorType? value, + global::Together.InterpreterOutputStreamOutputType? value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); @@ -53,7 +53,7 @@ public override void Write( } else { - writer.WriteStringValue(global::Together.WhoamiResponseDiscriminatorTypeExtensions.ToValueString(value.Value)); + writer.WriteStringValue(global::Together.InterpreterOutputStreamOutputTypeExtensions.ToValueString(value.Value)); } } } diff --git a/src/libs/Together/Generated/Together.JsonConverters.JobInfoSuccessResponseStatus.g.cs b/src/libs/Together/Generated/Together.JsonConverters.JobInfoSuccessResponseStatus.g.cs new file mode 100644 index 00000000..bdf74b39 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.JobInfoSuccessResponseStatus.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class JobInfoSuccessResponseStatusJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.JobInfoSuccessResponseStatus Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.JobInfoSuccessResponseStatusExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.JobInfoSuccessResponseStatus)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.JobInfoSuccessResponseStatus); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.JobInfoSuccessResponseStatus value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.JobInfoSuccessResponseStatusExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.JobInfoSuccessResponseStatusNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.JobInfoSuccessResponseStatusNullable.g.cs new file mode 100644 index 00000000..92cb5947 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.JobInfoSuccessResponseStatusNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class JobInfoSuccessResponseStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.JobInfoSuccessResponseStatus? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.JobInfoSuccessResponseStatusExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.JobInfoSuccessResponseStatus)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.JobInfoSuccessResponseStatus?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.JobInfoSuccessResponseStatus? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.JobInfoSuccessResponseStatusExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.WhoamiUserJwtType.g.cs b/src/libs/Together/Generated/Together.JsonConverters.ListEndpointState.g.cs similarity index 71% rename from src/libs/Together/Generated/Together.JsonConverters.WhoamiUserJwtType.g.cs rename to src/libs/Together/Generated/Together.JsonConverters.ListEndpointState.g.cs index 51a68568..ddeab625 100644 --- a/src/libs/Together/Generated/Together.JsonConverters.WhoamiUserJwtType.g.cs +++ b/src/libs/Together/Generated/Together.JsonConverters.ListEndpointState.g.cs @@ -3,10 +3,10 @@ namespace Together.JsonConverters { /// - public sealed class WhoamiUserJwtTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class ListEndpointStateJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::Together.WhoamiUserJwtType Read( + public override global::Together.ListEndpointState Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class WhoamiUserJwtTypeJsonConverter : global::System.Text.Json.Se var stringValue = reader.GetString(); if (stringValue != null) { - return global::Together.WhoamiUserJwtTypeExtensions.ToEnum(stringValue) ?? default; + return global::Together.ListEndpointStateExtensions.ToEnum(stringValue) ?? default; } break; @@ -26,11 +26,11 @@ public sealed class WhoamiUserJwtTypeJsonConverter : global::System.Text.Json.Se case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::Together.WhoamiUserJwtType)numValue; + return (global::Together.ListEndpointState)numValue; } case global::System.Text.Json.JsonTokenType.Null: { - return default(global::Together.WhoamiUserJwtType); + return default(global::Together.ListEndpointState); } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -42,12 +42,12 @@ public sealed class WhoamiUserJwtTypeJsonConverter : global::System.Text.Json.Se /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::Together.WhoamiUserJwtType value, + global::Together.ListEndpointState value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - writer.WriteStringValue(global::Together.WhoamiUserJwtTypeExtensions.ToValueString(value)); + writer.WriteStringValue(global::Together.ListEndpointStateExtensions.ToValueString(value)); } } } diff --git a/src/libs/Together/Generated/Together.JsonConverters.WhoamiUserJwtTypeNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.ListEndpointStateNullable.g.cs similarity index 75% rename from src/libs/Together/Generated/Together.JsonConverters.WhoamiUserJwtTypeNullable.g.cs rename to src/libs/Together/Generated/Together.JsonConverters.ListEndpointStateNullable.g.cs index 9cc384c2..e13aba2a 100644 --- a/src/libs/Together/Generated/Together.JsonConverters.WhoamiUserJwtTypeNullable.g.cs +++ b/src/libs/Together/Generated/Together.JsonConverters.ListEndpointStateNullable.g.cs @@ -3,10 +3,10 @@ namespace Together.JsonConverters { /// - public sealed class WhoamiUserJwtTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class ListEndpointStateNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::Together.WhoamiUserJwtType? Read( + public override global::Together.ListEndpointState? Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class WhoamiUserJwtTypeNullableJsonConverter : global::System.Text var stringValue = reader.GetString(); if (stringValue != null) { - return global::Together.WhoamiUserJwtTypeExtensions.ToEnum(stringValue); + return global::Together.ListEndpointStateExtensions.ToEnum(stringValue); } break; @@ -26,11 +26,11 @@ public sealed class WhoamiUserJwtTypeNullableJsonConverter : global::System.Text case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::Together.WhoamiUserJwtType)numValue; + return (global::Together.ListEndpointState)numValue; } case global::System.Text.Json.JsonTokenType.Null: { - return default(global::Together.WhoamiUserJwtType?); + return default(global::Together.ListEndpointState?); } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -42,7 +42,7 @@ public sealed class WhoamiUserJwtTypeNullableJsonConverter : global::System.Text /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::Together.WhoamiUserJwtType? value, + global::Together.ListEndpointState? value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); @@ -53,7 +53,7 @@ public override void Write( } else { - writer.WriteStringValue(global::Together.WhoamiUserJwtTypeExtensions.ToValueString(value.Value)); + writer.WriteStringValue(global::Together.ListEndpointStateExtensions.ToValueString(value.Value)); } } } diff --git a/src/libs/Together/Generated/Together.JsonConverters.WhoamiUserOrgJwtType.g.cs b/src/libs/Together/Generated/Together.JsonConverters.ListEndpointType.g.cs similarity index 68% rename from src/libs/Together/Generated/Together.JsonConverters.WhoamiUserOrgJwtType.g.cs rename to src/libs/Together/Generated/Together.JsonConverters.ListEndpointType.g.cs index bca2d034..c5265fdf 100644 --- a/src/libs/Together/Generated/Together.JsonConverters.WhoamiUserOrgJwtType.g.cs +++ b/src/libs/Together/Generated/Together.JsonConverters.ListEndpointType.g.cs @@ -3,10 +3,10 @@ namespace Together.JsonConverters { /// - public sealed class WhoamiUserOrgJwtTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class ListEndpointTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::Together.WhoamiUserOrgJwtType Read( + public override global::Together.ListEndpointType Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class WhoamiUserOrgJwtTypeJsonConverter : global::System.Text.Json var stringValue = reader.GetString(); if (stringValue != null) { - return global::Together.WhoamiUserOrgJwtTypeExtensions.ToEnum(stringValue) ?? default; + return global::Together.ListEndpointTypeExtensions.ToEnum(stringValue) ?? default; } break; @@ -26,11 +26,11 @@ public sealed class WhoamiUserOrgJwtTypeJsonConverter : global::System.Text.Json case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::Together.WhoamiUserOrgJwtType)numValue; + return (global::Together.ListEndpointType)numValue; } case global::System.Text.Json.JsonTokenType.Null: { - return default(global::Together.WhoamiUserOrgJwtType); + return default(global::Together.ListEndpointType); } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -42,12 +42,12 @@ public sealed class WhoamiUserOrgJwtTypeJsonConverter : global::System.Text.Json /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::Together.WhoamiUserOrgJwtType value, + global::Together.ListEndpointType value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - writer.WriteStringValue(global::Together.WhoamiUserOrgJwtTypeExtensions.ToValueString(value)); + writer.WriteStringValue(global::Together.ListEndpointTypeExtensions.ToValueString(value)); } } } diff --git a/src/libs/Together/Generated/Together.JsonConverters.ListEndpointTypeNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.ListEndpointTypeNullable.g.cs new file mode 100644 index 00000000..b6103fc3 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.ListEndpointTypeNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class ListEndpointTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.ListEndpointType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.ListEndpointTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.ListEndpointType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.ListEndpointType?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.ListEndpointType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.ListEndpointTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.ListEndpointsType.g.cs b/src/libs/Together/Generated/Together.JsonConverters.ListEndpointsType.g.cs new file mode 100644 index 00000000..a4e1ea6b --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.ListEndpointsType.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class ListEndpointsTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.ListEndpointsType Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.ListEndpointsTypeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.ListEndpointsType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.ListEndpointsType); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.ListEndpointsType value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.ListEndpointsTypeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.WhoamiUserOrgJwtTypeNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.ListEndpointsTypeNullable.g.cs similarity index 70% rename from src/libs/Together/Generated/Together.JsonConverters.WhoamiUserOrgJwtTypeNullable.g.cs rename to src/libs/Together/Generated/Together.JsonConverters.ListEndpointsTypeNullable.g.cs index d4aa38d6..e252c262 100644 --- a/src/libs/Together/Generated/Together.JsonConverters.WhoamiUserOrgJwtTypeNullable.g.cs +++ b/src/libs/Together/Generated/Together.JsonConverters.ListEndpointsTypeNullable.g.cs @@ -3,10 +3,10 @@ namespace Together.JsonConverters { /// - public sealed class WhoamiUserOrgJwtTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class ListEndpointsTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::Together.WhoamiUserOrgJwtType? Read( + public override global::Together.ListEndpointsType? Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class WhoamiUserOrgJwtTypeNullableJsonConverter : global::System.T var stringValue = reader.GetString(); if (stringValue != null) { - return global::Together.WhoamiUserOrgJwtTypeExtensions.ToEnum(stringValue); + return global::Together.ListEndpointsTypeExtensions.ToEnum(stringValue); } break; @@ -26,11 +26,11 @@ public sealed class WhoamiUserOrgJwtTypeNullableJsonConverter : global::System.T case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::Together.WhoamiUserOrgJwtType)numValue; + return (global::Together.ListEndpointsType)numValue; } case global::System.Text.Json.JsonTokenType.Null: { - return default(global::Together.WhoamiUserOrgJwtType?); + return default(global::Together.ListEndpointsType?); } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -42,7 +42,7 @@ public sealed class WhoamiUserOrgJwtTypeNullableJsonConverter : global::System.T /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::Together.WhoamiUserOrgJwtType? value, + global::Together.ListEndpointsType? value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); @@ -53,7 +53,7 @@ public override void Write( } else { - writer.WriteStringValue(global::Together.WhoamiUserOrgJwtTypeExtensions.ToValueString(value.Value)); + writer.WriteStringValue(global::Together.ListEndpointsTypeExtensions.ToValueString(value.Value)); } } } diff --git a/src/libs/Together/Generated/Together.JsonConverters.ListEndpointsUsageType.g.cs b/src/libs/Together/Generated/Together.JsonConverters.ListEndpointsUsageType.g.cs new file mode 100644 index 00000000..544fcb21 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.ListEndpointsUsageType.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class ListEndpointsUsageTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.ListEndpointsUsageType Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.ListEndpointsUsageTypeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.ListEndpointsUsageType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.ListEndpointsUsageType); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.ListEndpointsUsageType value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.ListEndpointsUsageTypeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.ListEndpointsUsageTypeNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.ListEndpointsUsageTypeNullable.g.cs new file mode 100644 index 00000000..3c0a082f --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.ListEndpointsUsageTypeNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class ListEndpointsUsageTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.ListEndpointsUsageType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.ListEndpointsUsageTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.ListEndpointsUsageType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.ListEndpointsUsageType?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.ListEndpointsUsageType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.ListEndpointsUsageTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.ModelInfoType.g.cs b/src/libs/Together/Generated/Together.JsonConverters.ModelInfoType.g.cs new file mode 100644 index 00000000..81c79bee --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.ModelInfoType.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class ModelInfoTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.ModelInfoType Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.ModelInfoTypeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.ModelInfoType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.ModelInfoType); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.ModelInfoType value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.ModelInfoTypeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.ModelInfoTypeNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.ModelInfoTypeNullable.g.cs new file mode 100644 index 00000000..d011b381 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.ModelInfoTypeNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class ModelInfoTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.ModelInfoType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.ModelInfoTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.ModelInfoType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.ModelInfoType?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.ModelInfoType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.ModelInfoTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.WhoamiUserOrgProjectJwtType.g.cs b/src/libs/Together/Generated/Together.JsonConverters.ModelUploadRequestModelType.g.cs similarity index 69% rename from src/libs/Together/Generated/Together.JsonConverters.WhoamiUserOrgProjectJwtType.g.cs rename to src/libs/Together/Generated/Together.JsonConverters.ModelUploadRequestModelType.g.cs index a154b3e1..1ceca38c 100644 --- a/src/libs/Together/Generated/Together.JsonConverters.WhoamiUserOrgProjectJwtType.g.cs +++ b/src/libs/Together/Generated/Together.JsonConverters.ModelUploadRequestModelType.g.cs @@ -3,10 +3,10 @@ namespace Together.JsonConverters { /// - public sealed class WhoamiUserOrgProjectJwtTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class ModelUploadRequestModelTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::Together.WhoamiUserOrgProjectJwtType Read( + public override global::Together.ModelUploadRequestModelType Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class WhoamiUserOrgProjectJwtTypeJsonConverter : global::System.Te var stringValue = reader.GetString(); if (stringValue != null) { - return global::Together.WhoamiUserOrgProjectJwtTypeExtensions.ToEnum(stringValue) ?? default; + return global::Together.ModelUploadRequestModelTypeExtensions.ToEnum(stringValue) ?? default; } break; @@ -26,11 +26,11 @@ public sealed class WhoamiUserOrgProjectJwtTypeJsonConverter : global::System.Te case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::Together.WhoamiUserOrgProjectJwtType)numValue; + return (global::Together.ModelUploadRequestModelType)numValue; } case global::System.Text.Json.JsonTokenType.Null: { - return default(global::Together.WhoamiUserOrgProjectJwtType); + return default(global::Together.ModelUploadRequestModelType); } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -42,12 +42,12 @@ public sealed class WhoamiUserOrgProjectJwtTypeJsonConverter : global::System.Te /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::Together.WhoamiUserOrgProjectJwtType value, + global::Together.ModelUploadRequestModelType value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - writer.WriteStringValue(global::Together.WhoamiUserOrgProjectJwtTypeExtensions.ToValueString(value)); + writer.WriteStringValue(global::Together.ModelUploadRequestModelTypeExtensions.ToValueString(value)); } } } diff --git a/src/libs/Together/Generated/Together.JsonConverters.WhoamiUserOrgProjectJwtTypeNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.ModelUploadRequestModelTypeNullable.g.cs similarity index 71% rename from src/libs/Together/Generated/Together.JsonConverters.WhoamiUserOrgProjectJwtTypeNullable.g.cs rename to src/libs/Together/Generated/Together.JsonConverters.ModelUploadRequestModelTypeNullable.g.cs index e71056ac..89e77b5f 100644 --- a/src/libs/Together/Generated/Together.JsonConverters.WhoamiUserOrgProjectJwtTypeNullable.g.cs +++ b/src/libs/Together/Generated/Together.JsonConverters.ModelUploadRequestModelTypeNullable.g.cs @@ -3,10 +3,10 @@ namespace Together.JsonConverters { /// - public sealed class WhoamiUserOrgProjectJwtTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + public sealed class ModelUploadRequestModelTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter { /// - public override global::Together.WhoamiUserOrgProjectJwtType? Read( + public override global::Together.ModelUploadRequestModelType? Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -18,7 +18,7 @@ public sealed class WhoamiUserOrgProjectJwtTypeNullableJsonConverter : global::S var stringValue = reader.GetString(); if (stringValue != null) { - return global::Together.WhoamiUserOrgProjectJwtTypeExtensions.ToEnum(stringValue); + return global::Together.ModelUploadRequestModelTypeExtensions.ToEnum(stringValue); } break; @@ -26,11 +26,11 @@ public sealed class WhoamiUserOrgProjectJwtTypeNullableJsonConverter : global::S case global::System.Text.Json.JsonTokenType.Number: { var numValue = reader.GetInt32(); - return (global::Together.WhoamiUserOrgProjectJwtType)numValue; + return (global::Together.ModelUploadRequestModelType)numValue; } case global::System.Text.Json.JsonTokenType.Null: { - return default(global::Together.WhoamiUserOrgProjectJwtType?); + return default(global::Together.ModelUploadRequestModelType?); } default: throw new global::System.ArgumentOutOfRangeException(nameof(reader)); @@ -42,7 +42,7 @@ public sealed class WhoamiUserOrgProjectJwtTypeNullableJsonConverter : global::S /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::Together.WhoamiUserOrgProjectJwtType? value, + global::Together.ModelUploadRequestModelType? value, global::System.Text.Json.JsonSerializerOptions options) { writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); @@ -53,7 +53,7 @@ public override void Write( } else { - writer.WriteStringValue(global::Together.WhoamiUserOrgProjectJwtTypeExtensions.ToValueString(value.Value)); + writer.WriteStringValue(global::Together.ModelUploadRequestModelTypeExtensions.ToValueString(value.Value)); } } } diff --git a/src/libs/Together/Generated/Together.JsonConverters.OutputsItem.g.cs b/src/libs/Together/Generated/Together.JsonConverters.OutputsItem.g.cs new file mode 100644 index 00000000..21609834 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.OutputsItem.g.cs @@ -0,0 +1,233 @@ +#nullable enable +#pragma warning disable CS0618 // Type or member is obsolete + +namespace Together.JsonConverters +{ + /// + public class OutputsItemJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.OutputsItem Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + options = options ?? throw new global::System.ArgumentNullException(nameof(options)); + var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); + + using var __jsonDocument = global::System.Text.Json.JsonDocument.ParseValue(ref reader); + var __rawJson = __jsonDocument.RootElement.GetRawText(); + var __jsonProps = new global::System.Collections.Generic.HashSet(); + if (__jsonDocument.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Object) + { + foreach (var __jsonProp in __jsonDocument.RootElement.EnumerateObject()) + { + __jsonProps.Add(__jsonProp.Name); + if (__jsonProp.Value.ValueKind == global::System.Text.Json.JsonValueKind.Object) + { + foreach (var __nestedJsonProp in __jsonProp.Value.EnumerateObject()) + { + __jsonProps.Add(__jsonProp.Name + "." + __nestedJsonProp.Name); + } + } + + } + } + + var __score0 = 0; + if (__jsonProps.Contains("data")) __score0++; + if (__jsonProps.Contains("type")) __score0++; + var __score1 = 0; + if (__jsonProps.Contains("data")) __score1++; + if (__jsonProps.Contains("type")) __score1++; + var __score2 = 0; + if (__jsonProps.Contains("data")) __score2++; + if (__jsonProps.Contains("data.application/geo+json")) __score2++; + if (__jsonProps.Contains("data.application/javascript")) __score2++; + if (__jsonProps.Contains("data.application/json")) __score2++; + if (__jsonProps.Contains("data.application/pdf")) __score2++; + if (__jsonProps.Contains("data.application/vnd.vega.v5+json")) __score2++; + if (__jsonProps.Contains("data.application/vnd.vegalite.v4+json")) __score2++; + if (__jsonProps.Contains("data.image/gif")) __score2++; + if (__jsonProps.Contains("data.image/jpeg")) __score2++; + if (__jsonProps.Contains("data.image/png")) __score2++; + if (__jsonProps.Contains("data.image/svg+xml")) __score2++; + if (__jsonProps.Contains("data.text/html")) __score2++; + if (__jsonProps.Contains("data.text/latex")) __score2++; + if (__jsonProps.Contains("data.text/markdown")) __score2++; + if (__jsonProps.Contains("data.text/plain")) __score2++; + if (__jsonProps.Contains("type")) __score2++; + var __bestScore = 0; + var __bestIndex = -1; + if (__score0 > __bestScore) { __bestScore = __score0; __bestIndex = 0; } + if (__score1 > __bestScore) { __bestScore = __score1; __bestIndex = 1; } + if (__score2 > __bestScore) { __bestScore = __score2; __bestIndex = 2; } + + global::Together.ExecuteResponseSuccessfulExecutionDataOutputStreamOutput? streamOutput = default; + global::Together.ExecuteResponseSuccessfulExecutionDataOutputErrorOutput? error = default; + global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutput? displayorExecuteOutput = default; + if (__bestIndex >= 0) + { + if (__bestIndex == 0) + { + try + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Together.ExecuteResponseSuccessfulExecutionDataOutputStreamOutput), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Together.ExecuteResponseSuccessfulExecutionDataOutputStreamOutput).Name}"); + streamOutput = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + catch (global::System.ArgumentOutOfRangeException __enumTokenException) when (__enumTokenException.ParamName == "reader") + { + // Legacy enum converters signal an incompatible JSON token with this exception. + } + } + else if (__bestIndex == 1) + { + try + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Together.ExecuteResponseSuccessfulExecutionDataOutputErrorOutput), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Together.ExecuteResponseSuccessfulExecutionDataOutputErrorOutput).Name}"); + error = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + catch (global::System.ArgumentOutOfRangeException __enumTokenException) when (__enumTokenException.ParamName == "reader") + { + // Legacy enum converters signal an incompatible JSON token with this exception. + } + } + else if (__bestIndex == 2) + { + try + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutput), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutput).Name}"); + displayorExecuteOutput = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + catch (global::System.ArgumentOutOfRangeException __enumTokenException) when (__enumTokenException.ParamName == "reader") + { + // Legacy enum converters signal an incompatible JSON token with this exception. + } + } + } + + if (streamOutput == null && error == null && displayorExecuteOutput == null) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Together.ExecuteResponseSuccessfulExecutionDataOutputStreamOutput), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Together.ExecuteResponseSuccessfulExecutionDataOutputStreamOutput).Name}"); + streamOutput = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + catch (global::System.ArgumentOutOfRangeException __enumTokenException) when (__enumTokenException.ParamName == "reader") + { + // Legacy enum converters signal an incompatible JSON token with this exception. + } + } + + if (streamOutput == null && error == null && displayorExecuteOutput == null) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Together.ExecuteResponseSuccessfulExecutionDataOutputErrorOutput), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Together.ExecuteResponseSuccessfulExecutionDataOutputErrorOutput).Name}"); + error = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + catch (global::System.ArgumentOutOfRangeException __enumTokenException) when (__enumTokenException.ParamName == "reader") + { + // Legacy enum converters signal an incompatible JSON token with this exception. + } + } + + if (streamOutput == null && error == null && displayorExecuteOutput == null) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutput), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutput).Name}"); + displayorExecuteOutput = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + catch (global::System.ArgumentOutOfRangeException __enumTokenException) when (__enumTokenException.ParamName == "reader") + { + // Legacy enum converters signal an incompatible JSON token with this exception. + } + } + + var __value = new global::Together.OutputsItem( + streamOutput, + + error, + + displayorExecuteOutput + ); + + return __value; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.OutputsItem value, + global::System.Text.Json.JsonSerializerOptions options) + { + options = options ?? throw new global::System.ArgumentNullException(nameof(options)); + var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); + + if (value.IsStreamOutput) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Together.ExecuteResponseSuccessfulExecutionDataOutputStreamOutput), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Together.ExecuteResponseSuccessfulExecutionDataOutputStreamOutput).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.PickStreamOutput(), typeInfo); + } + else if (value.IsError) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Together.ExecuteResponseSuccessfulExecutionDataOutputErrorOutput), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Together.ExecuteResponseSuccessfulExecutionDataOutputErrorOutput).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.PickError(), typeInfo); + } + else if (value.IsDisplayorExecuteOutput) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutput), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutput).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.PickDisplayorExecuteOutput(), typeInfo); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.JsonConverters.SessionListResponse.g.cs b/src/libs/Together/Generated/Together.JsonConverters.SessionListResponse.g.cs new file mode 100644 index 00000000..55c9e46e --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.SessionListResponse.g.cs @@ -0,0 +1,116 @@ +#nullable enable +#pragma warning disable CS0618 // Type or member is obsolete + +namespace Together.JsonConverters +{ + /// + public class SessionListResponseJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.SessionListResponse Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + options = options ?? throw new global::System.ArgumentNullException(nameof(options)); + var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); + + using var __jsonDocument = global::System.Text.Json.JsonDocument.ParseValue(ref reader); + var __rawJson = __jsonDocument.RootElement.GetRawText(); + + global::Together.SessionListResponseResponse? response = default; + try + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Together.SessionListResponseResponse), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Together.SessionListResponseResponse).Name}"); + response = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + catch (global::System.ArgumentOutOfRangeException __enumTokenException) when (__enumTokenException.ParamName == "reader") + { + // Legacy enum converters signal an incompatible JSON token with this exception. + } + + global::Together.SessionListResponseVariant2? sessionListResponseVariant2 = default; + try + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Together.SessionListResponseVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Together.SessionListResponseVariant2).Name}"); + sessionListResponseVariant2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + catch (global::System.ArgumentOutOfRangeException __enumTokenException) when (__enumTokenException.ParamName == "reader") + { + // Legacy enum converters signal an incompatible JSON token with this exception. + } + var __value = new global::Together.SessionListResponse( + response, + + sessionListResponseVariant2 + ); + + return __value; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.SessionListResponse value, + global::System.Text.Json.JsonSerializerOptions options) + { + options = options ?? throw new global::System.ArgumentNullException(nameof(options)); + var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); + + + writer.WriteStartObject(); + var __writtenPropertyNames = new global::System.Collections.Generic.HashSet(global::System.StringComparer.Ordinal); + if (value.IsResponse) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Together.SessionListResponseResponse), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Together.SessionListResponseResponse).Name}"); + var __element0 = global::System.Text.Json.JsonSerializer.SerializeToElement(value.PickResponse(), typeInfo); + if (__element0.ValueKind != global::System.Text.Json.JsonValueKind.Object) + { + throw new global::System.Text.Json.JsonException("AllOf values must serialize as JSON objects."); + } + + foreach (var __property in __element0.EnumerateObject()) + { + if (__writtenPropertyNames.Add(__property.Name)) + { + __property.WriteTo(writer); + } + } + } + if (value.IsSessionListResponseVariant2) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Together.SessionListResponseVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Together.SessionListResponseVariant2).Name}"); + var __element1 = global::System.Text.Json.JsonSerializer.SerializeToElement(value.PickSessionListResponseVariant2(), typeInfo); + if (__element1.ValueKind != global::System.Text.Json.JsonValueKind.Object) + { + throw new global::System.Text.Json.JsonException("AllOf values must serialize as JSON objects."); + } + + foreach (var __property in __element1.EnumerateObject()) + { + if (__writtenPropertyNames.Add(__property.Name)) + { + __property.WriteTo(writer); + } + } + } + writer.WriteEndObject(); + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.JsonConverters.StreamOutputType.g.cs b/src/libs/Together/Generated/Together.JsonConverters.StreamOutputType.g.cs new file mode 100644 index 00000000..ac290b87 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.StreamOutputType.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class StreamOutputTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.StreamOutputType Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.StreamOutputTypeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.StreamOutputType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.StreamOutputType); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.StreamOutputType value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.StreamOutputTypeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.StreamOutputTypeNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.StreamOutputTypeNullable.g.cs new file mode 100644 index 00000000..f70dc1d7 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.StreamOutputTypeNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class StreamOutputTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.StreamOutputType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.StreamOutputTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.StreamOutputType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.StreamOutputType?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.StreamOutputType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.StreamOutputTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.UpdateEndpointRequestState.g.cs b/src/libs/Together/Generated/Together.JsonConverters.UpdateEndpointRequestState.g.cs new file mode 100644 index 00000000..30097041 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.UpdateEndpointRequestState.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class UpdateEndpointRequestStateJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.UpdateEndpointRequestState Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.UpdateEndpointRequestStateExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.UpdateEndpointRequestState)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.UpdateEndpointRequestState); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.UpdateEndpointRequestState value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Together.UpdateEndpointRequestStateExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.UpdateEndpointRequestStateNullable.g.cs b/src/libs/Together/Generated/Together.JsonConverters.UpdateEndpointRequestStateNullable.g.cs new file mode 100644 index 00000000..27d5bf99 --- /dev/null +++ b/src/libs/Together/Generated/Together.JsonConverters.UpdateEndpointRequestStateNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Together.JsonConverters +{ + /// + public sealed class UpdateEndpointRequestStateNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Together.UpdateEndpointRequestState? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Together.UpdateEndpointRequestStateExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Together.UpdateEndpointRequestState)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Together.UpdateEndpointRequestState?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Together.UpdateEndpointRequestState? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Together.UpdateEndpointRequestStateExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Together/Generated/Together.JsonConverters.WhoamiResponse.g.cs b/src/libs/Together/Generated/Together.JsonConverters.WhoamiResponse.g.cs deleted file mode 100644 index 7ef0a2ae..00000000 --- a/src/libs/Together/Generated/Together.JsonConverters.WhoamiResponse.g.cs +++ /dev/null @@ -1,117 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 // Type or member is obsolete - -namespace Together.JsonConverters -{ - /// - public class WhoamiResponseJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::Together.WhoamiResponse Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - options = options ?? throw new global::System.ArgumentNullException(nameof(options)); - var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); - - - var readerCopy = reader; - var discriminatorTypeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Together.WhoamiResponseDiscriminator), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Together.WhoamiResponseDiscriminator)}"); - var discriminator = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, discriminatorTypeInfo); - - global::Together.WhoamiProjectApiKey? projectApiKey = default; - if (discriminator?.Type == global::Together.WhoamiResponseDiscriminatorType.ProjectApiKey) - { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Together.WhoamiProjectApiKey), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Together.WhoamiProjectApiKey)}"); - projectApiKey = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); - } - global::Together.WhoamiOrgApiKey? orgApiKey = default; - if (discriminator?.Type == global::Together.WhoamiResponseDiscriminatorType.OrgApiKey) - { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Together.WhoamiOrgApiKey), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Together.WhoamiOrgApiKey)}"); - orgApiKey = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); - } - global::Together.WhoamiUserJwt? userJwt = default; - if (discriminator?.Type == global::Together.WhoamiResponseDiscriminatorType.UserJwt) - { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Together.WhoamiUserJwt), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Together.WhoamiUserJwt)}"); - userJwt = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); - } - global::Together.WhoamiUserOrgJwt? userOrgJwt = default; - if (discriminator?.Type == global::Together.WhoamiResponseDiscriminatorType.UserOrgJwt) - { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Together.WhoamiUserOrgJwt), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Together.WhoamiUserOrgJwt)}"); - userOrgJwt = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); - } - global::Together.WhoamiUserOrgProjectJwt? userOrgProjectJwt = default; - if (discriminator?.Type == global::Together.WhoamiResponseDiscriminatorType.UserOrgProjectJwt) - { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Together.WhoamiUserOrgProjectJwt), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Together.WhoamiUserOrgProjectJwt)}"); - userOrgProjectJwt = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); - } - - var __value = new global::Together.WhoamiResponse( - discriminator?.Type, - projectApiKey, - - orgApiKey, - - userJwt, - - userOrgJwt, - - userOrgProjectJwt - ); - - return __value; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::Together.WhoamiResponse value, - global::System.Text.Json.JsonSerializerOptions options) - { - options = options ?? throw new global::System.ArgumentNullException(nameof(options)); - var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); - - if (value.IsProjectApiKey) - { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Together.WhoamiProjectApiKey), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Together.WhoamiProjectApiKey).Name}"); - global::System.Text.Json.JsonSerializer.Serialize(writer, value.PickProjectApiKey(), typeInfo); - } - else if (value.IsOrgApiKey) - { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Together.WhoamiOrgApiKey), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Together.WhoamiOrgApiKey).Name}"); - global::System.Text.Json.JsonSerializer.Serialize(writer, value.PickOrgApiKey(), typeInfo); - } - else if (value.IsUserJwt) - { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Together.WhoamiUserJwt), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Together.WhoamiUserJwt).Name}"); - global::System.Text.Json.JsonSerializer.Serialize(writer, value.PickUserJwt(), typeInfo); - } - else if (value.IsUserOrgJwt) - { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Together.WhoamiUserOrgJwt), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Together.WhoamiUserOrgJwt).Name}"); - global::System.Text.Json.JsonSerializer.Serialize(writer, value.PickUserOrgJwt(), typeInfo); - } - else if (value.IsUserOrgProjectJwt) - { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Together.WhoamiUserOrgProjectJwt), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Together.WhoamiUserOrgProjectJwt).Name}"); - global::System.Text.Json.JsonSerializer.Serialize(writer, value.PickUserOrgProjectJwt(), typeInfo); - } - } - } -} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.JsonSerializerContext.g.cs b/src/libs/Together/Generated/Together.JsonSerializerContext.g.cs index 9c163e0a..e5ca67cb 100644 --- a/src/libs/Together/Generated/Together.JsonSerializerContext.g.cs +++ b/src/libs/Together/Generated/Together.JsonSerializerContext.g.cs @@ -298,9 +298,7 @@ namespace Together [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlModelResourcesStatus), TypeInfoPropertyName = "RlModelResourcesStatus2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlModelResources))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlModelResourcesError))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlModelResourcesStatusDetails))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlOptimizerConfig))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(long))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlModelResourcesErrorCode), TypeInfoPropertyName = "RlModelResourcesErrorCode2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlCreateModelResourcesRequest))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlModelResourcesEstimateCostResponse))] @@ -392,6 +390,7 @@ namespace Together [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlCheckpointVariant), TypeInfoPropertyName = "RlCheckpointVariant2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlCheckpointFile))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf), TypeInfoPropertyName = "OneOfStringInt642")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(long))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlCheckpointDownloadResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ErrorResponse))] @@ -494,6 +493,7 @@ namespace Together [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ModelVoices))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ModelVoicesVoice))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ListAvailibilityZonesResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RerankRequest))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AnyOf), TypeInfoPropertyName = "AnyOfRerankRequestModelString2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RerankRequestModel), TypeInfoPropertyName = "RerankRequestModel2")] @@ -546,11 +546,17 @@ internal sealed partial class SourceGenerationContextChunk0 : global::System.Tex [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CompletionChoiceDeltaRole), TypeInfoPropertyName = "CompletionChoiceDeltaRole2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ToolChoice2))] + #pragma warning disable CS0618 // This registration names a deprecated API model. + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CompletionChoiceDeltaFunctionCall))] + #pragma warning restore CS0618 [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionChoicesDataItem))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionMessage))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AllOf), TypeInfoPropertyName = "AllOfObjectLogprobsPart2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionMessageRole), TypeInfoPropertyName = "ChatCompletionMessageRole2")] + #pragma warning disable CS0618 // This registration names a deprecated API model. + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionMessageFunctionCall))] + #pragma warning restore CS0618 [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionTool))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionToolType), TypeInfoPropertyName = "ChatCompletionToolType2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionToolFunction))] @@ -581,6 +587,9 @@ internal sealed partial class SourceGenerationContextChunk0 : global::System.Tex [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionUserMessageParam))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionAssistantMessageParam))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionToolMessageParam))] + #pragma warning disable CS0618 // This registration names a deprecated API model. + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionFunctionMessageParam))] + #pragma warning restore CS0618 [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionSystemMessageParamRole), TypeInfoPropertyName = "ChatCompletionSystemMessageParamRole2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionUserMessageContent), TypeInfoPropertyName = "ChatCompletionUserMessageContent2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionUserMessageParamRole), TypeInfoPropertyName = "ChatCompletionUserMessageParamRole2")] @@ -600,6 +609,12 @@ internal sealed partial class SourceGenerationContextChunk0 : global::System.Tex [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemInputAudioInputAudio))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemInputAudioInputAudioFormat), TypeInfoPropertyName = "ChatCompletionUserMessageContentMultimodalItemInputAudioInputAudioFormat2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionAssistantMessageParamRole), TypeInfoPropertyName = "ChatCompletionAssistantMessageParamRole2")] + #pragma warning disable CS0618 // This registration names a deprecated API model. + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionAssistantMessageParamFunctionCall))] + #pragma warning restore CS0618 + #pragma warning disable CS0618 // This registration names a deprecated API model. + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionFunctionMessageParamRole), TypeInfoPropertyName = "ChatCompletionFunctionMessageParamRole2")] + #pragma warning restore CS0618 [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionToolMessageParamRole), TypeInfoPropertyName = "ChatCompletionToolMessageParamRole2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] @@ -610,6 +625,9 @@ internal sealed partial class SourceGenerationContextChunk0 : global::System.Tex [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionChunkChoice))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionChunkChoiceDelta))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionChunkChoiceDeltaRole), TypeInfoPropertyName = "ChatCompletionChunkChoiceDeltaRole2")] + #pragma warning disable CS0618 // This registration names a deprecated API model. + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionChunkChoiceDeltaFunctionCall))] + #pragma warning restore CS0618 [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioSpeechRequest))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AnyOf), TypeInfoPropertyName = "AnyOfAudioSpeechRequestModelString2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioSpeechRequestModel), TypeInfoPropertyName = "AudioSpeechRequestModel2")] @@ -652,6 +670,9 @@ internal sealed partial class SourceGenerationContextChunk0 : global::System.Tex [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionChoice))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionChoiceDelta))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionChoiceDeltaRole), TypeInfoPropertyName = "ChatCompletionChoiceDeltaRole2")] + #pragma warning disable CS0618 // This registration names a deprecated API model. + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionChoiceDeltaFunctionCall))] + #pragma warning restore CS0618 [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.EmbeddingsRequest))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AnyOf), TypeInfoPropertyName = "AnyOfEmbeddingsRequestModelString2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.EmbeddingsRequestModel), TypeInfoPropertyName = "EmbeddingsRequestModel2")] @@ -659,6 +680,14 @@ internal sealed partial class SourceGenerationContextChunk0 : global::System.Tex [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.EmbeddingsResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.EmbeddingsResponseDataItem))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ModelInfo))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ModelInfoType), TypeInfoPropertyName = "ModelInfoType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.Pricing))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ModelUploadRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ModelUploadRequestModelType), TypeInfoPropertyName = "ModelUploadRequestModelType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ModelUploadSuccessResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ModelUploadSuccessResponseData))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ImageResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DataItem), TypeInfoPropertyName = "DataItem2")] @@ -668,6 +697,13 @@ internal sealed partial class SourceGenerationContextChunk0 : global::System.Tex [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ImageResponseDataItemDiscriminatorType), TypeInfoPropertyName = "ImageResponseDataItemDiscriminatorType2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ImageResponseDataB64Type), TypeInfoPropertyName = "ImageResponseDataB64Type2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ImageResponseDataUrlType), TypeInfoPropertyName = "ImageResponseDataUrlType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.JobInfoSuccessResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.JobInfoSuccessResponseStatus), TypeInfoPropertyName = "JobInfoSuccessResponseStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.JobInfoSuccessResponseStatusUpdate))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.JobInfoSuccessResponseArgs))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.JobsInfoSuccessResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ToolsPartFunction))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ToolChoiceType), TypeInfoPropertyName = "ToolChoiceType2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ToolChoiceFunction))] @@ -752,6 +788,68 @@ internal sealed partial class SourceGenerationContextChunk0 : global::System.Tex [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf), TypeInfoPropertyName = "OneOfLinearLRSchedulerArgsCosineLRSchedulerArgs2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.LinearLRSchedulerArgs))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CosineLRSchedulerArgs))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.Autoscaling))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.HardwareSpec))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.EndpointPricing))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.HardwareAvailability))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.HardwareAvailabilityStatus), TypeInfoPropertyName = "HardwareAvailabilityStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.HardwareWithStatus))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateEndpointRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateEndpointRequestState), TypeInfoPropertyName = "CreateEndpointRequestState2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DedicatedEndpoint))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DedicatedEndpointType), TypeInfoPropertyName = "DedicatedEndpointType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DedicatedEndpointState), TypeInfoPropertyName = "DedicatedEndpointState2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ListEndpoint))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ListEndpointType), TypeInfoPropertyName = "ListEndpointType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ListEndpointState), TypeInfoPropertyName = "ListEndpointState2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DisplayorExecuteOutput))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DisplayorExecuteOutputData))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DisplayorExecuteOutputType), TypeInfoPropertyName = "DisplayorExecuteOutputType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.Error), TypeInfoPropertyName = "Error2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ErrorOutput))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ErrorOutputType), TypeInfoPropertyName = "ErrorOutputType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ExecuteRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ExecuteRequestFile))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ExecuteRequestFileEncoding), TypeInfoPropertyName = "ExecuteRequestFileEncoding2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ExecuteRequestLanguage), TypeInfoPropertyName = "ExecuteRequestLanguage2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ExecuteResponse), TypeInfoPropertyName = "ExecuteResponse2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ExecuteResponseSuccessfulExecution))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ExecuteResponseSuccessfulExecutionData))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OutputsItem), TypeInfoPropertyName = "OutputsItem2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ExecuteResponseSuccessfulExecutionDataOutputStreamOutput))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ExecuteResponseSuccessfulExecutionDataOutputStreamOutputType), TypeInfoPropertyName = "ExecuteResponseSuccessfulExecutionDataOutputStreamOutputType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ExecuteResponseSuccessfulExecutionDataOutputErrorOutput))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ExecuteResponseSuccessfulExecutionDataOutputErrorOutputType), TypeInfoPropertyName = "ExecuteResponseSuccessfulExecutionDataOutputErrorOutputType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutput))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputData))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputType), TypeInfoPropertyName = "ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ExecuteResponseSuccessfulExecutionDataOutputDiscriminator))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ExecuteResponseSuccessfulExecutionDataOutputDiscriminatorType), TypeInfoPropertyName = "ExecuteResponseSuccessfulExecutionDataOutputDiscriminatorType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ExecuteResponseSuccessfulExecutionDataStatus), TypeInfoPropertyName = "ExecuteResponseSuccessfulExecutionDataStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ExecuteResponseFailedExecution))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList>))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf), TypeInfoPropertyName = "OneOfStringObject2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.InterpreterOutput), TypeInfoPropertyName = "InterpreterOutput2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.InterpreterOutputStreamOutput))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.InterpreterOutputStreamOutputType), TypeInfoPropertyName = "InterpreterOutputStreamOutputType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.InterpreterOutputErrorOutput))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.InterpreterOutputErrorOutputType), TypeInfoPropertyName = "InterpreterOutputErrorOutputType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.InterpreterOutputDisplayorExecuteOutput))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.InterpreterOutputDisplayorExecuteOutputData))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.InterpreterOutputDisplayorExecuteOutputType), TypeInfoPropertyName = "InterpreterOutputDisplayorExecuteOutputType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.InterpreterOutputDiscriminator))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.InterpreterOutputDiscriminatorType), TypeInfoPropertyName = "InterpreterOutputDiscriminatorType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.Response))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.SessionListResponse), TypeInfoPropertyName = "SessionListResponse2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.SessionListResponseResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.SessionListResponseVariant2))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.SessionListResponseVariant2Data))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.SessionListResponseVariant2DataSession))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.StreamOutput))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.StreamOutputType), TypeInfoPropertyName = "StreamOutputType2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateBatchRequest))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateBatchRequestEndpoint), TypeInfoPropertyName = "CreateBatchRequestEndpoint2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.BatchErrorResponse))] @@ -786,11 +884,13 @@ internal sealed partial class SourceGenerationContextChunk0 : global::System.Tex [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateVideoBody))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.VideoOutputFormat), TypeInfoPropertyName = "VideoOutputFormat2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.VideoMedia))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.VideoStatus), TypeInfoPropertyName = "VideoStatus2")] + #pragma warning disable CS0618 // This registration names a deprecated API model. + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + #pragma warning restore CS0618 [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.VideoFrameImageInput))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.VideoStatus), TypeInfoPropertyName = "VideoStatus2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AnyOf), TypeInfoPropertyName = "AnyOfDoubleVideoFrameImageInputFrame2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.VideoFrameImageInputFrame), TypeInfoPropertyName = "VideoFrameImageInputFrame2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.VideoRef))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf), TypeInfoPropertyName = "OneOfStringVideoRef2")] @@ -871,23 +971,7 @@ internal sealed partial class SourceGenerationContextChunk0 : global::System.Tex [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.QueueJobResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.QueueJobStatusResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.QueueJobStatusResponseStatus), TypeInfoPropertyName = "QueueJobStatusResponseStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.WhoamiApiKey))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.WhoamiOrganization))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.WhoamiProject))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.WhoamiUser))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.WhoamiProjectApiKey))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.WhoamiProjectApiKeyType), TypeInfoPropertyName = "WhoamiProjectApiKeyType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.WhoamiOrgApiKey))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.WhoamiOrgApiKeyType), TypeInfoPropertyName = "WhoamiOrgApiKeyType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.WhoamiUserJwt))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.WhoamiUserJwtType), TypeInfoPropertyName = "WhoamiUserJwtType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.WhoamiUserOrgJwt))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.WhoamiUserOrgJwtType), TypeInfoPropertyName = "WhoamiUserOrgJwtType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.WhoamiUserOrgProjectJwt))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.WhoamiUserOrgProjectJwtType), TypeInfoPropertyName = "WhoamiUserOrgProjectJwtType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.WhoamiResponse), TypeInfoPropertyName = "WhoamiResponse2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.WhoamiResponseDiscriminator))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.WhoamiResponseDiscriminatorType), TypeInfoPropertyName = "WhoamiResponseDiscriminatorType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.WhoamiResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.Project))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ListProjectsResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] @@ -907,8 +991,16 @@ internal sealed partial class SourceGenerationContextChunk0 : global::System.Tex [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateFineTunesRequest))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf), TypeInfoPropertyName = "OneOfInt32CreateFineTunesRequestBatchSize2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateFineTunesRequestBatchSize), TypeInfoPropertyName = "CreateFineTunesRequestBatchSize2")] + #pragma warning disable CS0618 // This registration names a deprecated API model. + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf), TypeInfoPropertyName = "OneOfBooleanCreateFineTunesRequestTrainOnInputs2")] + #pragma warning restore CS0618 + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateFineTunesRequestTrainOnInputs), TypeInfoPropertyName = "CreateFineTunesRequestTrainOnInputs2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AnyOf), TypeInfoPropertyName = "AnyOfFullTrainingTypeLoRATrainingType2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateFineTunesEstimatePriceRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.UpdateEndpointRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.UpdateEndpointRequestState), TypeInfoPropertyName = "UpdateEndpointRequestState2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AddAdapterRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RemoveAdapterRequest))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RolloutServiceListRolloutsFilter), TypeInfoPropertyName = "RolloutServiceListRolloutsFilter2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.EndpointServiceListEndpointEventsMinLevel), TypeInfoPropertyName = "EndpointServiceListEndpointEventsMinLevel2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] @@ -919,6 +1011,8 @@ internal sealed partial class SourceGenerationContextChunk0 : global::System.Tex [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.SupportedModelsServiceListSupportedModelsAdapterMode), TypeInfoPropertyName = "SupportedModelsServiceListSupportedModelsAdapterMode2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GetFinetuneDownloadCheckpoint), TypeInfoPropertyName = "GetFinetuneDownloadCheckpoint2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RealtimeTtsModel), TypeInfoPropertyName = "RealtimeTtsModel2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ListEndpointsType), TypeInfoPropertyName = "ListEndpointsType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ListEndpointsUsageType), TypeInfoPropertyName = "ListEndpointsUsageType2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RealtimeTranscriptionInputAudioFormat), TypeInfoPropertyName = "RealtimeTranscriptionInputAudioFormat2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ListModelResourcesStatu), TypeInfoPropertyName = "ListModelResourcesStatu2")] @@ -943,10 +1037,33 @@ internal sealed partial class SourceGenerationContextChunk0 : global::System.Tex [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf), TypeInfoPropertyName = "OneOfFineTunePreviewMessageErrorFineTunePreviewDetailError2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GetFineTunesMetricsResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList>))] + internal sealed partial class SourceGenerationContextChunk1 : global::System.Text.Json.Serialization.JsonSerializerContext + { + } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull + )] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList>), TypeInfoPropertyName = "ChatCompletionUserMessageContentMultimodalItemInputAudio_9a6c1a339fc4e5a1")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf), TypeInfoPropertyName = "ChatCompletionUserMessageContentMultimodalItemInputAudio_e050a39467d446fd")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf?), TypeInfoPropertyName = "ChatCompletionUserMessageContentMultimodalItemInputAudio_f38c2c0c365e74fc")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List>), TypeInfoPropertyName = "ChatCompletionUserMessageContentMultimodalItemInputAudio_6724b54fa98b04fd")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GetFineTunesModelsSupportedResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GetFineTunesModelsSupportedResponseDetailedModel))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GetFineTunesModelsLimitsResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ListEndpointsResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AddAdapterResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ListAdaptersResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ListAdaptersResponseDataItem))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RemoveAdapterResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ListHardwareResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GetModelListResponse))] @@ -1019,21 +1136,6 @@ internal sealed partial class SourceGenerationContextChunk0 : global::System.Tex [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlComputeConfigGpuType?), TypeInfoPropertyName = "NullableRlComputeConfigGpuType2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlComputeConfigCreateRequestGpuType?), TypeInfoPropertyName = "NullableRlComputeConfigCreateRequestGpuType2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlModelResourcesStatus?), TypeInfoPropertyName = "NullableRlModelResourcesStatus2")] - internal sealed partial class SourceGenerationContextChunk1 : global::System.Text.Json.Serialization.JsonSerializerContext - { - } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( - DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull - )] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList>), TypeInfoPropertyName = "ChatCompletionUserMessageContentMultimodalItemInputAudio_9a6c1a339fc4e5a1")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf), TypeInfoPropertyName = "ChatCompletionUserMessageContentMultimodalItemInputAudio_e050a39467d446fd")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf?), TypeInfoPropertyName = "ChatCompletionUserMessageContentMultimodalItemInputAudio_f38c2c0c365e74fc")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List>), TypeInfoPropertyName = "ChatCompletionUserMessageContentMultimodalItemInputAudio_6724b54fa98b04fd")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(long?))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlModelResourcesErrorCode?), TypeInfoPropertyName = "NullableRlModelResourcesErrorCode2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlSupportedModelComputeConfigGpuType?), TypeInfoPropertyName = "NullableRlSupportedModelComputeConfigGpuType2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlSupportedModelDefaultGpuType?), TypeInfoPropertyName = "NullableRlSupportedModelDefaultGpuType2")] @@ -1052,6 +1154,7 @@ internal sealed partial class SourceGenerationContextChunk1 : global::System.Tex [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlCheckpointType?), TypeInfoPropertyName = "NullableRlCheckpointType2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlCheckpointVariant?), TypeInfoPropertyName = "NullableRlCheckpointVariant2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf?), TypeInfoPropertyName = "NullableOneOfStringInt642")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(long?))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GPUClusterCreateRequest?), TypeInfoPropertyName = "NullableGPUClusterCreateRequest2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GPUClusterCreateRequestNvidiaVersion?), TypeInfoPropertyName = "NullableGPUClusterCreateRequestNvidiaVersion2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GPUClusterCreateRequestLegacyNvidia?), TypeInfoPropertyName = "NullableGPUClusterCreateRequestLegacyNvidia2")] @@ -1110,6 +1213,9 @@ internal sealed partial class SourceGenerationContextChunk1 : global::System.Tex [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemInputAudioType?), TypeInfoPropertyName = "NullableChatCompletionUserMessageContentMultimodalItemInputAudioType2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionUserMessageContentMultimodalItemInputAudioInputAudioFormat?), TypeInfoPropertyName = "NullableChatCompletionUserMessageContentMultimodalItemInputAudioInputAudioFormat2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionAssistantMessageParamRole?), TypeInfoPropertyName = "NullableChatCompletionAssistantMessageParamRole2")] + #pragma warning disable CS0618 // This registration names a deprecated API model. + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionFunctionMessageParamRole?), TypeInfoPropertyName = "NullableChatCompletionFunctionMessageParamRole2")] + #pragma warning restore CS0618 [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionToolMessageParamRole?), TypeInfoPropertyName = "NullableChatCompletionToolMessageParamRole2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionStream?), TypeInfoPropertyName = "NullableChatCompletionStream2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ChatCompletionChunkChoiceDeltaRole?), TypeInfoPropertyName = "NullableChatCompletionChunkChoiceDeltaRole2")] @@ -1136,10 +1242,13 @@ internal sealed partial class SourceGenerationContextChunk1 : global::System.Tex [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AnyOf?), TypeInfoPropertyName = "NullableAnyOfEmbeddingsRequestModelString2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.EmbeddingsRequestModel?), TypeInfoPropertyName = "NullableEmbeddingsRequestModel2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf>?), TypeInfoPropertyName = "NullableOneOfStringIListString2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ModelInfoType?), TypeInfoPropertyName = "NullableModelInfoType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ModelUploadRequestModelType?), TypeInfoPropertyName = "NullableModelUploadRequestModelType2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DataItem?), TypeInfoPropertyName = "NullableDataItem2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ImageResponseDataItemDiscriminatorType?), TypeInfoPropertyName = "NullableImageResponseDataItemDiscriminatorType2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ImageResponseDataB64Type?), TypeInfoPropertyName = "NullableImageResponseDataB64Type2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ImageResponseDataUrlType?), TypeInfoPropertyName = "NullableImageResponseDataUrlType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.JobInfoSuccessResponseStatus?), TypeInfoPropertyName = "NullableJobInfoSuccessResponseStatus2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ToolChoiceType?), TypeInfoPropertyName = "NullableToolChoiceType2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FilePurpose?), TypeInfoPropertyName = "NullableFilePurpose2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FileType?), TypeInfoPropertyName = "NullableFileType2")] @@ -1172,6 +1281,32 @@ internal sealed partial class SourceGenerationContextChunk1 : global::System.Tex [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.TrainingMethodDPOMethod?), TypeInfoPropertyName = "NullableTrainingMethodDPOMethod2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.LRSchedulerLrSchedulerType?), TypeInfoPropertyName = "NullableLRSchedulerLrSchedulerType2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf?), TypeInfoPropertyName = "NullableOneOfLinearLRSchedulerArgsCosineLRSchedulerArgs2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.HardwareAvailabilityStatus?), TypeInfoPropertyName = "NullableHardwareAvailabilityStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateEndpointRequestState?), TypeInfoPropertyName = "NullableCreateEndpointRequestState2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DedicatedEndpointType?), TypeInfoPropertyName = "NullableDedicatedEndpointType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DedicatedEndpointState?), TypeInfoPropertyName = "NullableDedicatedEndpointState2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ListEndpointType?), TypeInfoPropertyName = "NullableListEndpointType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ListEndpointState?), TypeInfoPropertyName = "NullableListEndpointState2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DisplayorExecuteOutputType?), TypeInfoPropertyName = "NullableDisplayorExecuteOutputType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.Error?), TypeInfoPropertyName = "NullableError2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ErrorOutputType?), TypeInfoPropertyName = "NullableErrorOutputType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ExecuteRequestFileEncoding?), TypeInfoPropertyName = "NullableExecuteRequestFileEncoding2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ExecuteRequestLanguage?), TypeInfoPropertyName = "NullableExecuteRequestLanguage2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ExecuteResponse?), TypeInfoPropertyName = "NullableExecuteResponse2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OutputsItem?), TypeInfoPropertyName = "NullableOutputsItem2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ExecuteResponseSuccessfulExecutionDataOutputStreamOutputType?), TypeInfoPropertyName = "NullableExecuteResponseSuccessfulExecutionDataOutputStreamOutputType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ExecuteResponseSuccessfulExecutionDataOutputErrorOutputType?), TypeInfoPropertyName = "NullableExecuteResponseSuccessfulExecutionDataOutputErrorOutputType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputType?), TypeInfoPropertyName = "NullableExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ExecuteResponseSuccessfulExecutionDataOutputDiscriminatorType?), TypeInfoPropertyName = "NullableExecuteResponseSuccessfulExecutionDataOutputDiscriminatorType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ExecuteResponseSuccessfulExecutionDataStatus?), TypeInfoPropertyName = "NullableExecuteResponseSuccessfulExecutionDataStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf?), TypeInfoPropertyName = "NullableOneOfStringObject2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.InterpreterOutput?), TypeInfoPropertyName = "NullableInterpreterOutput2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.InterpreterOutputStreamOutputType?), TypeInfoPropertyName = "NullableInterpreterOutputStreamOutputType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.InterpreterOutputErrorOutputType?), TypeInfoPropertyName = "NullableInterpreterOutputErrorOutputType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.InterpreterOutputDisplayorExecuteOutputType?), TypeInfoPropertyName = "NullableInterpreterOutputDisplayorExecuteOutputType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.InterpreterOutputDiscriminatorType?), TypeInfoPropertyName = "NullableInterpreterOutputDiscriminatorType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.SessionListResponse?), TypeInfoPropertyName = "NullableSessionListResponse2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.StreamOutputType?), TypeInfoPropertyName = "NullableStreamOutputType2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateBatchRequestEndpoint?), TypeInfoPropertyName = "NullableCreateBatchRequestEndpoint2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.BatchJobStatus?), TypeInfoPropertyName = "NullableBatchJobStatus2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.EvaluationTypedRequestType?), TypeInfoPropertyName = "NullableEvaluationTypedRequestType2")] @@ -1209,20 +1344,18 @@ internal sealed partial class SourceGenerationContextChunk1 : global::System.Tex [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.VolumeContentType?), TypeInfoPropertyName = "NullableVolumeContentType2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.QueueCancelResponseStatus?), TypeInfoPropertyName = "NullableQueueCancelResponseStatus2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.QueueJobStatusResponseStatus?), TypeInfoPropertyName = "NullableQueueJobStatusResponseStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.WhoamiProjectApiKeyType?), TypeInfoPropertyName = "NullableWhoamiProjectApiKeyType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.WhoamiOrgApiKeyType?), TypeInfoPropertyName = "NullableWhoamiOrgApiKeyType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.WhoamiUserJwtType?), TypeInfoPropertyName = "NullableWhoamiUserJwtType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.WhoamiUserOrgJwtType?), TypeInfoPropertyName = "NullableWhoamiUserOrgJwtType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.WhoamiUserOrgProjectJwtType?), TypeInfoPropertyName = "NullableWhoamiUserOrgProjectJwtType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.WhoamiResponse?), TypeInfoPropertyName = "NullableWhoamiResponse2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.WhoamiResponseDiscriminatorType?), TypeInfoPropertyName = "NullableWhoamiResponseDiscriminatorType2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AnyOf?), TypeInfoPropertyName = "NullableAnyOfCreateImagesGenerationsRequestModelString2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateImagesGenerationsRequestModel?), TypeInfoPropertyName = "NullableCreateImagesGenerationsRequestModel2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateImagesGenerationsRequestResponseFormat?), TypeInfoPropertyName = "NullableCreateImagesGenerationsRequestResponseFormat2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateImagesGenerationsRequestOutputFormat?), TypeInfoPropertyName = "NullableCreateImagesGenerationsRequestOutputFormat2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf?), TypeInfoPropertyName = "NullableOneOfInt32CreateFineTunesRequestBatchSize2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateFineTunesRequestBatchSize?), TypeInfoPropertyName = "NullableCreateFineTunesRequestBatchSize2")] + #pragma warning disable CS0618 // This registration names a deprecated API model. + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf?), TypeInfoPropertyName = "NullableOneOfBooleanCreateFineTunesRequestTrainOnInputs2")] + #pragma warning restore CS0618 + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateFineTunesRequestTrainOnInputs?), TypeInfoPropertyName = "NullableCreateFineTunesRequestTrainOnInputs2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AnyOf?), TypeInfoPropertyName = "NullableAnyOfFullTrainingTypeLoRATrainingType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.UpdateEndpointRequestState?), TypeInfoPropertyName = "NullableUpdateEndpointRequestState2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RolloutServiceListRolloutsFilter?), TypeInfoPropertyName = "NullableRolloutServiceListRolloutsFilter2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.EndpointServiceListEndpointEventsMinLevel?), TypeInfoPropertyName = "NullableEndpointServiceListEndpointEventsMinLevel2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.EndpointServiceListEndpointEventsSourceKind?), TypeInfoPropertyName = "NullableEndpointServiceListEndpointEventsSourceKind2")] @@ -1232,6 +1365,8 @@ internal sealed partial class SourceGenerationContextChunk1 : global::System.Tex [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.SupportedModelsServiceListSupportedModelsAdapterMode?), TypeInfoPropertyName = "NullableSupportedModelsServiceListSupportedModelsAdapterMode2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GetFinetuneDownloadCheckpoint?), TypeInfoPropertyName = "NullableGetFinetuneDownloadCheckpoint2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RealtimeTtsModel?), TypeInfoPropertyName = "NullableRealtimeTtsModel2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ListEndpointsType?), TypeInfoPropertyName = "NullableListEndpointsType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ListEndpointsUsageType?), TypeInfoPropertyName = "NullableListEndpointsUsageType2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RealtimeTranscriptionInputAudioFormat?), TypeInfoPropertyName = "NullableRealtimeTranscriptionInputAudioFormat2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ListModelResourcesStatu?), TypeInfoPropertyName = "NullableListModelResourcesStatu2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ListTrainingSessionsStatu?), TypeInfoPropertyName = "NullableListTrainingSessionsStatu2")] @@ -1357,7 +1492,10 @@ internal sealed partial class SourceGenerationContextChunk1 : global::System.Tex [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf>))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] @@ -1366,6 +1504,10 @@ internal sealed partial class SourceGenerationContextChunk1 : global::System.Tex [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List>))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] @@ -1391,6 +1533,9 @@ internal sealed partial class SourceGenerationContextChunk1 : global::System.Tex [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List>))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] internal sealed partial class SourceGenerationContextChunk2 : global::System.Text.Json.Serialization.JsonSerializerContext @@ -1448,8 +1593,12 @@ internal static void AddConverters(global::System.Text.Json.JsonSerializerOption options.Converters.Add(new global::Together.JsonConverters.DataItemJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.QuantizationJobJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.QuantizationEventJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.ErrorJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.ExecuteResponseJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.OutputsItemJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.InterpreterOutputJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.SessionListResponseJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.EvaluationModelOrStringJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.WhoamiResponseJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); @@ -1490,6 +1639,9 @@ internal static void AddConverters(global::System.Text.Json.JsonSerializerOption options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); @@ -1503,6 +1655,7 @@ internal static void AddConverters(global::System.Text.Json.JsonSerializerOption options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.AnyOfJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); + options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.AnyOfJsonConverter()); options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); @@ -1992,6 +2145,10 @@ public override bool CanConvert(global::System.Type typeToConvert) || typeToConvert == typeof(global::Together.ChatCompletionAssistantMessageParamRole?) + || typeToConvert == typeof(global::Together.ChatCompletionFunctionMessageParamRole) + + || typeToConvert == typeof(global::Together.ChatCompletionFunctionMessageParamRole?) + || typeToConvert == typeof(global::Together.ChatCompletionToolMessageParamRole) || typeToConvert == typeof(global::Together.ChatCompletionToolMessageParamRole?) @@ -2056,6 +2213,14 @@ public override bool CanConvert(global::System.Type typeToConvert) || typeToConvert == typeof(global::Together.EmbeddingsRequestModel?) + || typeToConvert == typeof(global::Together.ModelInfoType) + + || typeToConvert == typeof(global::Together.ModelInfoType?) + + || typeToConvert == typeof(global::Together.ModelUploadRequestModelType) + + || typeToConvert == typeof(global::Together.ModelUploadRequestModelType?) + || typeToConvert == typeof(global::Together.ImageResponseDataItemDiscriminatorType) || typeToConvert == typeof(global::Together.ImageResponseDataItemDiscriminatorType?) @@ -2068,6 +2233,10 @@ public override bool CanConvert(global::System.Type typeToConvert) || typeToConvert == typeof(global::Together.ImageResponseDataUrlType?) + || typeToConvert == typeof(global::Together.JobInfoSuccessResponseStatus) + + || typeToConvert == typeof(global::Together.JobInfoSuccessResponseStatus?) + || typeToConvert == typeof(global::Together.ToolChoiceType) || typeToConvert == typeof(global::Together.ToolChoiceType?) @@ -2160,6 +2329,86 @@ public override bool CanConvert(global::System.Type typeToConvert) || typeToConvert == typeof(global::Together.LRSchedulerLrSchedulerType?) + || typeToConvert == typeof(global::Together.HardwareAvailabilityStatus) + + || typeToConvert == typeof(global::Together.HardwareAvailabilityStatus?) + + || typeToConvert == typeof(global::Together.CreateEndpointRequestState) + + || typeToConvert == typeof(global::Together.CreateEndpointRequestState?) + + || typeToConvert == typeof(global::Together.DedicatedEndpointType) + + || typeToConvert == typeof(global::Together.DedicatedEndpointType?) + + || typeToConvert == typeof(global::Together.DedicatedEndpointState) + + || typeToConvert == typeof(global::Together.DedicatedEndpointState?) + + || typeToConvert == typeof(global::Together.ListEndpointType) + + || typeToConvert == typeof(global::Together.ListEndpointType?) + + || typeToConvert == typeof(global::Together.ListEndpointState) + + || typeToConvert == typeof(global::Together.ListEndpointState?) + + || typeToConvert == typeof(global::Together.DisplayorExecuteOutputType) + + || typeToConvert == typeof(global::Together.DisplayorExecuteOutputType?) + + || typeToConvert == typeof(global::Together.ErrorOutputType) + + || typeToConvert == typeof(global::Together.ErrorOutputType?) + + || typeToConvert == typeof(global::Together.ExecuteRequestFileEncoding) + + || typeToConvert == typeof(global::Together.ExecuteRequestFileEncoding?) + + || typeToConvert == typeof(global::Together.ExecuteRequestLanguage) + + || typeToConvert == typeof(global::Together.ExecuteRequestLanguage?) + + || typeToConvert == typeof(global::Together.ExecuteResponseSuccessfulExecutionDataOutputStreamOutputType) + + || typeToConvert == typeof(global::Together.ExecuteResponseSuccessfulExecutionDataOutputStreamOutputType?) + + || typeToConvert == typeof(global::Together.ExecuteResponseSuccessfulExecutionDataOutputErrorOutputType) + + || typeToConvert == typeof(global::Together.ExecuteResponseSuccessfulExecutionDataOutputErrorOutputType?) + + || typeToConvert == typeof(global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputType) + + || typeToConvert == typeof(global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputType?) + + || typeToConvert == typeof(global::Together.ExecuteResponseSuccessfulExecutionDataOutputDiscriminatorType) + + || typeToConvert == typeof(global::Together.ExecuteResponseSuccessfulExecutionDataOutputDiscriminatorType?) + + || typeToConvert == typeof(global::Together.ExecuteResponseSuccessfulExecutionDataStatus) + + || typeToConvert == typeof(global::Together.ExecuteResponseSuccessfulExecutionDataStatus?) + + || typeToConvert == typeof(global::Together.InterpreterOutputStreamOutputType) + + || typeToConvert == typeof(global::Together.InterpreterOutputStreamOutputType?) + + || typeToConvert == typeof(global::Together.InterpreterOutputErrorOutputType) + + || typeToConvert == typeof(global::Together.InterpreterOutputErrorOutputType?) + + || typeToConvert == typeof(global::Together.InterpreterOutputDisplayorExecuteOutputType) + + || typeToConvert == typeof(global::Together.InterpreterOutputDisplayorExecuteOutputType?) + + || typeToConvert == typeof(global::Together.InterpreterOutputDiscriminatorType) + + || typeToConvert == typeof(global::Together.InterpreterOutputDiscriminatorType?) + + || typeToConvert == typeof(global::Together.StreamOutputType) + + || typeToConvert == typeof(global::Together.StreamOutputType?) + || typeToConvert == typeof(global::Together.CreateBatchRequestEndpoint) || typeToConvert == typeof(global::Together.CreateBatchRequestEndpoint?) @@ -2276,30 +2525,6 @@ public override bool CanConvert(global::System.Type typeToConvert) || typeToConvert == typeof(global::Together.QueueJobStatusResponseStatus?) - || typeToConvert == typeof(global::Together.WhoamiProjectApiKeyType) - - || typeToConvert == typeof(global::Together.WhoamiProjectApiKeyType?) - - || typeToConvert == typeof(global::Together.WhoamiOrgApiKeyType) - - || typeToConvert == typeof(global::Together.WhoamiOrgApiKeyType?) - - || typeToConvert == typeof(global::Together.WhoamiUserJwtType) - - || typeToConvert == typeof(global::Together.WhoamiUserJwtType?) - - || typeToConvert == typeof(global::Together.WhoamiUserOrgJwtType) - - || typeToConvert == typeof(global::Together.WhoamiUserOrgJwtType?) - - || typeToConvert == typeof(global::Together.WhoamiUserOrgProjectJwtType) - - || typeToConvert == typeof(global::Together.WhoamiUserOrgProjectJwtType?) - - || typeToConvert == typeof(global::Together.WhoamiResponseDiscriminatorType) - - || typeToConvert == typeof(global::Together.WhoamiResponseDiscriminatorType?) - || typeToConvert == typeof(global::Together.CreateImagesGenerationsRequestModel) || typeToConvert == typeof(global::Together.CreateImagesGenerationsRequestModel?) @@ -2316,6 +2541,14 @@ public override bool CanConvert(global::System.Type typeToConvert) || typeToConvert == typeof(global::Together.CreateFineTunesRequestBatchSize?) + || typeToConvert == typeof(global::Together.CreateFineTunesRequestTrainOnInputs) + + || typeToConvert == typeof(global::Together.CreateFineTunesRequestTrainOnInputs?) + + || typeToConvert == typeof(global::Together.UpdateEndpointRequestState) + + || typeToConvert == typeof(global::Together.UpdateEndpointRequestState?) + || typeToConvert == typeof(global::Together.RolloutServiceListRolloutsFilter) || typeToConvert == typeof(global::Together.RolloutServiceListRolloutsFilter?) @@ -2352,6 +2585,14 @@ public override bool CanConvert(global::System.Type typeToConvert) || typeToConvert == typeof(global::Together.RealtimeTtsModel?) + || typeToConvert == typeof(global::Together.ListEndpointsType) + + || typeToConvert == typeof(global::Together.ListEndpointsType?) + + || typeToConvert == typeof(global::Together.ListEndpointsUsageType) + + || typeToConvert == typeof(global::Together.ListEndpointsUsageType?) + || typeToConvert == typeof(global::Together.RealtimeTranscriptionInputAudioFormat) || typeToConvert == typeof(global::Together.RealtimeTranscriptionInputAudioFormat?) @@ -3559,6 +3800,16 @@ public override bool CanConvert(global::System.Type typeToConvert) return new global::Together.JsonConverters.ChatCompletionAssistantMessageParamRoleNullableJsonConverter(); } + if (typeToConvert == typeof(global::Together.ChatCompletionFunctionMessageParamRole)) + { + return new global::Together.JsonConverters.ChatCompletionFunctionMessageParamRoleJsonConverter(); + } + + if (typeToConvert == typeof(global::Together.ChatCompletionFunctionMessageParamRole?)) + { + return new global::Together.JsonConverters.ChatCompletionFunctionMessageParamRoleNullableJsonConverter(); + } + if (typeToConvert == typeof(global::Together.ChatCompletionToolMessageParamRole)) { return new global::Together.JsonConverters.ChatCompletionToolMessageParamRoleJsonConverter(); @@ -3719,6 +3970,26 @@ public override bool CanConvert(global::System.Type typeToConvert) return new global::Together.JsonConverters.EmbeddingsRequestModelNullableJsonConverter(); } + if (typeToConvert == typeof(global::Together.ModelInfoType)) + { + return new global::Together.JsonConverters.ModelInfoTypeJsonConverter(); + } + + if (typeToConvert == typeof(global::Together.ModelInfoType?)) + { + return new global::Together.JsonConverters.ModelInfoTypeNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::Together.ModelUploadRequestModelType)) + { + return new global::Together.JsonConverters.ModelUploadRequestModelTypeJsonConverter(); + } + + if (typeToConvert == typeof(global::Together.ModelUploadRequestModelType?)) + { + return new global::Together.JsonConverters.ModelUploadRequestModelTypeNullableJsonConverter(); + } + if (typeToConvert == typeof(global::Together.ImageResponseDataItemDiscriminatorType)) { return new global::Together.JsonConverters.ImageResponseDataItemDiscriminatorTypeJsonConverter(); @@ -3749,6 +4020,16 @@ public override bool CanConvert(global::System.Type typeToConvert) return new global::Together.JsonConverters.ImageResponseDataUrlTypeNullableJsonConverter(); } + if (typeToConvert == typeof(global::Together.JobInfoSuccessResponseStatus)) + { + return new global::Together.JsonConverters.JobInfoSuccessResponseStatusJsonConverter(); + } + + if (typeToConvert == typeof(global::Together.JobInfoSuccessResponseStatus?)) + { + return new global::Together.JsonConverters.JobInfoSuccessResponseStatusNullableJsonConverter(); + } + if (typeToConvert == typeof(global::Together.ToolChoiceType)) { return new global::Together.JsonConverters.ToolChoiceTypeJsonConverter(); @@ -3979,6 +4260,206 @@ public override bool CanConvert(global::System.Type typeToConvert) return new global::Together.JsonConverters.LRSchedulerLrSchedulerTypeNullableJsonConverter(); } + if (typeToConvert == typeof(global::Together.HardwareAvailabilityStatus)) + { + return new global::Together.JsonConverters.HardwareAvailabilityStatusJsonConverter(); + } + + if (typeToConvert == typeof(global::Together.HardwareAvailabilityStatus?)) + { + return new global::Together.JsonConverters.HardwareAvailabilityStatusNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::Together.CreateEndpointRequestState)) + { + return new global::Together.JsonConverters.CreateEndpointRequestStateJsonConverter(); + } + + if (typeToConvert == typeof(global::Together.CreateEndpointRequestState?)) + { + return new global::Together.JsonConverters.CreateEndpointRequestStateNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::Together.DedicatedEndpointType)) + { + return new global::Together.JsonConverters.DedicatedEndpointTypeJsonConverter(); + } + + if (typeToConvert == typeof(global::Together.DedicatedEndpointType?)) + { + return new global::Together.JsonConverters.DedicatedEndpointTypeNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::Together.DedicatedEndpointState)) + { + return new global::Together.JsonConverters.DedicatedEndpointStateJsonConverter(); + } + + if (typeToConvert == typeof(global::Together.DedicatedEndpointState?)) + { + return new global::Together.JsonConverters.DedicatedEndpointStateNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::Together.ListEndpointType)) + { + return new global::Together.JsonConverters.ListEndpointTypeJsonConverter(); + } + + if (typeToConvert == typeof(global::Together.ListEndpointType?)) + { + return new global::Together.JsonConverters.ListEndpointTypeNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::Together.ListEndpointState)) + { + return new global::Together.JsonConverters.ListEndpointStateJsonConverter(); + } + + if (typeToConvert == typeof(global::Together.ListEndpointState?)) + { + return new global::Together.JsonConverters.ListEndpointStateNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::Together.DisplayorExecuteOutputType)) + { + return new global::Together.JsonConverters.DisplayorExecuteOutputTypeJsonConverter(); + } + + if (typeToConvert == typeof(global::Together.DisplayorExecuteOutputType?)) + { + return new global::Together.JsonConverters.DisplayorExecuteOutputTypeNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::Together.ErrorOutputType)) + { + return new global::Together.JsonConverters.ErrorOutputTypeJsonConverter(); + } + + if (typeToConvert == typeof(global::Together.ErrorOutputType?)) + { + return new global::Together.JsonConverters.ErrorOutputTypeNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::Together.ExecuteRequestFileEncoding)) + { + return new global::Together.JsonConverters.ExecuteRequestFileEncodingJsonConverter(); + } + + if (typeToConvert == typeof(global::Together.ExecuteRequestFileEncoding?)) + { + return new global::Together.JsonConverters.ExecuteRequestFileEncodingNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::Together.ExecuteRequestLanguage)) + { + return new global::Together.JsonConverters.ExecuteRequestLanguageJsonConverter(); + } + + if (typeToConvert == typeof(global::Together.ExecuteRequestLanguage?)) + { + return new global::Together.JsonConverters.ExecuteRequestLanguageNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::Together.ExecuteResponseSuccessfulExecutionDataOutputStreamOutputType)) + { + return new global::Together.JsonConverters.ExecuteResponseSuccessfulExecutionDataOutputStreamOutputTypeJsonConverter(); + } + + if (typeToConvert == typeof(global::Together.ExecuteResponseSuccessfulExecutionDataOutputStreamOutputType?)) + { + return new global::Together.JsonConverters.ExecuteResponseSuccessfulExecutionDataOutputStreamOutputTypeNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::Together.ExecuteResponseSuccessfulExecutionDataOutputErrorOutputType)) + { + return new global::Together.JsonConverters.ExecuteResponseSuccessfulExecutionDataOutputErrorOutputTypeJsonConverter(); + } + + if (typeToConvert == typeof(global::Together.ExecuteResponseSuccessfulExecutionDataOutputErrorOutputType?)) + { + return new global::Together.JsonConverters.ExecuteResponseSuccessfulExecutionDataOutputErrorOutputTypeNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputType)) + { + return new global::Together.JsonConverters.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputTypeJsonConverter(); + } + + if (typeToConvert == typeof(global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputType?)) + { + return new global::Together.JsonConverters.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputTypeNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::Together.ExecuteResponseSuccessfulExecutionDataOutputDiscriminatorType)) + { + return new global::Together.JsonConverters.ExecuteResponseSuccessfulExecutionDataOutputDiscriminatorTypeJsonConverter(); + } + + if (typeToConvert == typeof(global::Together.ExecuteResponseSuccessfulExecutionDataOutputDiscriminatorType?)) + { + return new global::Together.JsonConverters.ExecuteResponseSuccessfulExecutionDataOutputDiscriminatorTypeNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::Together.ExecuteResponseSuccessfulExecutionDataStatus)) + { + return new global::Together.JsonConverters.ExecuteResponseSuccessfulExecutionDataStatusJsonConverter(); + } + + if (typeToConvert == typeof(global::Together.ExecuteResponseSuccessfulExecutionDataStatus?)) + { + return new global::Together.JsonConverters.ExecuteResponseSuccessfulExecutionDataStatusNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::Together.InterpreterOutputStreamOutputType)) + { + return new global::Together.JsonConverters.InterpreterOutputStreamOutputTypeJsonConverter(); + } + + if (typeToConvert == typeof(global::Together.InterpreterOutputStreamOutputType?)) + { + return new global::Together.JsonConverters.InterpreterOutputStreamOutputTypeNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::Together.InterpreterOutputErrorOutputType)) + { + return new global::Together.JsonConverters.InterpreterOutputErrorOutputTypeJsonConverter(); + } + + if (typeToConvert == typeof(global::Together.InterpreterOutputErrorOutputType?)) + { + return new global::Together.JsonConverters.InterpreterOutputErrorOutputTypeNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::Together.InterpreterOutputDisplayorExecuteOutputType)) + { + return new global::Together.JsonConverters.InterpreterOutputDisplayorExecuteOutputTypeJsonConverter(); + } + + if (typeToConvert == typeof(global::Together.InterpreterOutputDisplayorExecuteOutputType?)) + { + return new global::Together.JsonConverters.InterpreterOutputDisplayorExecuteOutputTypeNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::Together.InterpreterOutputDiscriminatorType)) + { + return new global::Together.JsonConverters.InterpreterOutputDiscriminatorTypeJsonConverter(); + } + + if (typeToConvert == typeof(global::Together.InterpreterOutputDiscriminatorType?)) + { + return new global::Together.JsonConverters.InterpreterOutputDiscriminatorTypeNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::Together.StreamOutputType)) + { + return new global::Together.JsonConverters.StreamOutputTypeJsonConverter(); + } + + if (typeToConvert == typeof(global::Together.StreamOutputType?)) + { + return new global::Together.JsonConverters.StreamOutputTypeNullableJsonConverter(); + } + if (typeToConvert == typeof(global::Together.CreateBatchRequestEndpoint)) { return new global::Together.JsonConverters.CreateBatchRequestEndpointJsonConverter(); @@ -4269,66 +4750,6 @@ public override bool CanConvert(global::System.Type typeToConvert) return new global::Together.JsonConverters.QueueJobStatusResponseStatusNullableJsonConverter(); } - if (typeToConvert == typeof(global::Together.WhoamiProjectApiKeyType)) - { - return new global::Together.JsonConverters.WhoamiProjectApiKeyTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.WhoamiProjectApiKeyType?)) - { - return new global::Together.JsonConverters.WhoamiProjectApiKeyTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.WhoamiOrgApiKeyType)) - { - return new global::Together.JsonConverters.WhoamiOrgApiKeyTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.WhoamiOrgApiKeyType?)) - { - return new global::Together.JsonConverters.WhoamiOrgApiKeyTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.WhoamiUserJwtType)) - { - return new global::Together.JsonConverters.WhoamiUserJwtTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.WhoamiUserJwtType?)) - { - return new global::Together.JsonConverters.WhoamiUserJwtTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.WhoamiUserOrgJwtType)) - { - return new global::Together.JsonConverters.WhoamiUserOrgJwtTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.WhoamiUserOrgJwtType?)) - { - return new global::Together.JsonConverters.WhoamiUserOrgJwtTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.WhoamiUserOrgProjectJwtType)) - { - return new global::Together.JsonConverters.WhoamiUserOrgProjectJwtTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.WhoamiUserOrgProjectJwtType?)) - { - return new global::Together.JsonConverters.WhoamiUserOrgProjectJwtTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.WhoamiResponseDiscriminatorType)) - { - return new global::Together.JsonConverters.WhoamiResponseDiscriminatorTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.WhoamiResponseDiscriminatorType?)) - { - return new global::Together.JsonConverters.WhoamiResponseDiscriminatorTypeNullableJsonConverter(); - } - if (typeToConvert == typeof(global::Together.CreateImagesGenerationsRequestModel)) { return new global::Together.JsonConverters.CreateImagesGenerationsRequestModelJsonConverter(); @@ -4369,6 +4790,26 @@ public override bool CanConvert(global::System.Type typeToConvert) return new global::Together.JsonConverters.CreateFineTunesRequestBatchSizeNullableJsonConverter(); } + if (typeToConvert == typeof(global::Together.CreateFineTunesRequestTrainOnInputs)) + { + return new global::Together.JsonConverters.CreateFineTunesRequestTrainOnInputsJsonConverter(); + } + + if (typeToConvert == typeof(global::Together.CreateFineTunesRequestTrainOnInputs?)) + { + return new global::Together.JsonConverters.CreateFineTunesRequestTrainOnInputsNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::Together.UpdateEndpointRequestState)) + { + return new global::Together.JsonConverters.UpdateEndpointRequestStateJsonConverter(); + } + + if (typeToConvert == typeof(global::Together.UpdateEndpointRequestState?)) + { + return new global::Together.JsonConverters.UpdateEndpointRequestStateNullableJsonConverter(); + } + if (typeToConvert == typeof(global::Together.RolloutServiceListRolloutsFilter)) { return new global::Together.JsonConverters.RolloutServiceListRolloutsFilterJsonConverter(); @@ -4459,6 +4900,26 @@ public override bool CanConvert(global::System.Type typeToConvert) return new global::Together.JsonConverters.RealtimeTtsModelNullableJsonConverter(); } + if (typeToConvert == typeof(global::Together.ListEndpointsType)) + { + return new global::Together.JsonConverters.ListEndpointsTypeJsonConverter(); + } + + if (typeToConvert == typeof(global::Together.ListEndpointsType?)) + { + return new global::Together.JsonConverters.ListEndpointsTypeNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::Together.ListEndpointsUsageType)) + { + return new global::Together.JsonConverters.ListEndpointsUsageTypeJsonConverter(); + } + + if (typeToConvert == typeof(global::Together.ListEndpointsUsageType?)) + { + return new global::Together.JsonConverters.ListEndpointsUsageTypeNullableJsonConverter(); + } + if (typeToConvert == typeof(global::Together.RealtimeTranscriptionInputAudioFormat)) { return new global::Together.JsonConverters.RealtimeTranscriptionInputAudioFormatJsonConverter(); diff --git a/src/libs/Together/Generated/Together.JsonSerializerContextTypes.g.cs b/src/libs/Together/Generated/Together.JsonSerializerContextTypes.g.cs index 8c254f84..c6f619df 100644 --- a/src/libs/Together/Generated/Together.JsonSerializerContextTypes.g.cs +++ b/src/libs/Together/Generated/Together.JsonSerializerContextTypes.g.cs @@ -1161,787 +1161,787 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::Together.RlModelResourcesStatusDetails? Type282 { get; set; } + public global::Together.RlOptimizerConfig? Type282 { get; set; } /// /// /// - public global::Together.RlOptimizerConfig? Type283 { get; set; } + public global::Together.RlModelResourcesErrorCode? Type283 { get; set; } /// /// /// - public long? Type284 { get; set; } + public global::Together.RlCreateModelResourcesRequest? Type284 { get; set; } /// /// /// - public global::Together.RlModelResourcesErrorCode? Type285 { get; set; } + public global::Together.RlModelResourcesEstimateCostResponse? Type285 { get; set; } /// /// /// - public global::Together.RlCreateModelResourcesRequest? Type286 { get; set; } + public global::Together.RlModelResourcesListResponse? Type286 { get; set; } /// /// /// - public global::Together.RlModelResourcesEstimateCostResponse? Type287 { get; set; } + public global::System.Collections.Generic.IList? Type287 { get; set; } /// /// /// - public global::Together.RlModelResourcesListResponse? Type288 { get; set; } + public global::Together.RlModelTrainerConfig? Type288 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type289 { get; set; } + public global::Together.RlModelSamplingDefaults? Type289 { get; set; } /// /// /// - public global::Together.RlModelTrainerConfig? Type290 { get; set; } + public global::Together.RlModelGeneratorConfig? Type290 { get; set; } /// /// /// - public global::Together.RlModelSamplingDefaults? Type291 { get; set; } + public global::Together.RlSupportedModelComputeConfig? Type291 { get; set; } /// /// /// - public global::Together.RlModelGeneratorConfig? Type292 { get; set; } + public global::Together.RlSupportedModelComputeConfigGpuType? Type292 { get; set; } /// /// /// - public global::Together.RlSupportedModelComputeConfig? Type293 { get; set; } + public global::Together.RlSupportedModel? Type293 { get; set; } /// /// /// - public global::Together.RlSupportedModelComputeConfigGpuType? Type294 { get; set; } + public global::Together.RlSupportedModelDefaultGpuType? Type294 { get; set; } /// /// /// - public global::Together.RlSupportedModel? Type295 { get; set; } + public global::System.Collections.Generic.IList? Type295 { get; set; } /// /// /// - public global::Together.RlSupportedModelDefaultGpuType? Type296 { get; set; } + public global::System.Collections.Generic.IList>? Type296 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type297 { get; set; } + public global::Together.RlDType? Type297 { get; set; } /// /// /// - public global::System.Collections.Generic.IList>? Type298 { get; set; } + public global::Together.RlLossType? Type298 { get; set; } /// /// /// - public global::Together.RlDType? Type299 { get; set; } + public global::Together.RlCrossEntropyLossParams? Type299 { get; set; } /// /// /// - public global::Together.RlLossType? Type300 { get; set; } + public global::Together.RlGRPOLossParams? Type300 { get; set; } /// /// /// - public global::Together.RlCrossEntropyLossParams? Type301 { get; set; } + public float? Type301 { get; set; } /// /// /// - public global::Together.RlGRPOLossParams? Type302 { get; set; } + public global::Together.RlGRPOLossAggregationType? Type302 { get; set; } /// /// /// - public float? Type303 { get; set; } + public global::Together.RlGRPOLossRatioType? Type303 { get; set; } /// /// /// - public global::Together.RlGRPOLossAggregationType? Type304 { get; set; } + public global::Together.RlPPOLossParams? Type304 { get; set; } /// /// /// - public global::Together.RlGRPOLossRatioType? Type305 { get; set; } + public global::Together.RlCISPOLossParams? Type305 { get; set; } /// /// /// - public global::Together.RlPPOLossParams? Type306 { get; set; } + public global::Together.RlDROLossParams? Type306 { get; set; } /// /// /// - public global::Together.RlCISPOLossParams? Type307 { get; set; } + public global::Together.RlDPPOLossParams? Type307 { get; set; } /// /// /// - public global::Together.RlDROLossParams? Type308 { get; set; } + public global::Together.RlLossFnOutput? Type308 { get; set; } /// /// /// - public global::Together.RlDPPOLossParams? Type309 { get; set; } + public global::System.Collections.Generic.Dictionary? Type309 { get; set; } /// /// /// - public global::Together.RlLossFnOutput? Type310 { get; set; } + public global::Together.RlTensorData? Type310 { get; set; } /// /// /// - public global::System.Collections.Generic.Dictionary? Type311 { get; set; } + public global::System.Collections.Generic.IList? Type311 { get; set; } /// /// /// - public global::Together.RlTensorData? Type312 { get; set; } + public global::Together.RlTensorDataDtype? Type312 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type313 { get; set; } + public global::System.Collections.Generic.IList? Type313 { get; set; } /// /// /// - public global::Together.RlTensorDataDtype? Type314 { get; set; } + public global::Together.RlPolicyVersionSegment? Type314 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type315 { get; set; } + public global::Together.RlPromptTopLogprobs? Type315 { get; set; } /// /// /// - public global::Together.RlPolicyVersionSegment? Type316 { get; set; } + public global::Together.RlOptimStepOperation? Type316 { get; set; } /// /// /// - public global::Together.RlPromptTopLogprobs? Type317 { get; set; } + public global::Together.RlTrainingOperationStatus? Type317 { get; set; } /// /// /// - public global::Together.RlOptimStepOperation? Type318 { get; set; } + public global::Together.RlOptimStepResult? Type318 { get; set; } /// /// /// - public global::Together.RlTrainingOperationStatus? Type319 { get; set; } + public global::Together.RlTrainingOperationError? Type319 { get; set; } /// /// /// - public global::Together.RlOptimStepResult? Type320 { get; set; } + public global::Together.RlWeightsSyncOperation? Type320 { get; set; } /// /// /// - public global::Together.RlTrainingOperationError? Type321 { get; set; } + public global::Together.RlWeightsSyncResult? Type321 { get; set; } /// /// /// - public global::Together.RlWeightsSyncOperation? Type322 { get; set; } + public global::Together.RlSampleOperation? Type322 { get; set; } /// /// /// - public global::Together.RlWeightsSyncResult? Type323 { get; set; } + public global::Together.RlSampleBatchResult? Type323 { get; set; } /// /// /// - public global::Together.RlSampleOperation? Type324 { get; set; } + public global::System.Collections.Generic.IList? Type324 { get; set; } /// /// /// - public global::Together.RlSampleBatchResult? Type325 { get; set; } + public global::Together.RlSampleResult? Type325 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type326 { get; set; } + public global::System.Collections.Generic.IList? Type326 { get; set; } /// /// /// - public global::Together.RlSampleResult? Type327 { get; set; } + public global::Together.RlSampledSequence? Type327 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type328 { get; set; } + public global::System.Collections.Generic.IList? Type328 { get; set; } /// /// /// - public global::Together.RlSampledSequence? Type329 { get; set; } + public global::System.Collections.Generic.IList? Type329 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type330 { get; set; } + public global::Together.RlStopReason? Type330 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type331 { get; set; } + public global::Together.RlForwardBackwardOperation? Type331 { get; set; } /// /// /// - public global::Together.RlStopReason? Type332 { get; set; } + public global::Together.RlForwardBackwardResult? Type332 { get; set; } /// /// /// - public global::Together.RlForwardBackwardOperation? Type333 { get; set; } + public global::System.Collections.Generic.IList? Type333 { get; set; } /// /// /// - public global::Together.RlForwardBackwardResult? Type334 { get; set; } + public global::Together.RlCustomForwardBackwardBody? Type334 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type335 { get; set; } + public global::System.Collections.Generic.IList? Type335 { get; set; } /// /// /// - public global::Together.RlCustomForwardBackwardBody? Type336 { get; set; } + public global::Together.RlTargetLogprobGradients? Type336 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type337 { get; set; } + public global::Together.RlCustomForwardBackwardOperation? Type337 { get; set; } /// /// /// - public global::Together.RlTargetLogprobGradients? Type338 { get; set; } + public global::Together.RlCustomForwardBackwardResult? Type338 { get; set; } /// /// /// - public global::Together.RlCustomForwardBackwardOperation? Type339 { get; set; } + public global::Together.RlTrainingOperationErrorCode? Type339 { get; set; } /// /// /// - public global::Together.RlCustomForwardBackwardResult? Type340 { get; set; } + public global::Together.RlStartTrainingSessionRequest? Type340 { get; set; } /// /// /// - public global::Together.RlTrainingOperationErrorCode? Type341 { get; set; } + public global::Together.RlLoraConfig? Type341 { get; set; } /// /// /// - public global::Together.RlStartTrainingSessionRequest? Type342 { get; set; } + public global::Together.RlTrainingSessionMetadata? Type342 { get; set; } /// /// /// - public global::Together.RlLoraConfig? Type343 { get; set; } + public global::Together.RlUpdateTrainingSessionRequest? Type343 { get; set; } /// /// /// - public global::Together.RlTrainingSessionMetadata? Type344 { get; set; } + public global::Together.RlTrainingSessionStatus? Type344 { get; set; } /// /// /// - public global::Together.RlUpdateTrainingSessionRequest? Type345 { get; set; } + public global::Together.RlTrainingSessionError? Type345 { get; set; } /// /// /// - public global::Together.RlTrainingSessionStatus? Type346 { get; set; } + public global::Together.RlTrainingSessionErrorCode? Type346 { get; set; } /// /// /// - public global::Together.RlTrainingSessionError? Type347 { get; set; } + public global::Together.RlWandbMetadata? Type347 { get; set; } /// /// /// - public global::Together.RlTrainingSessionErrorCode? Type348 { get; set; } + public global::Together.RlSessionPolicyState? Type348 { get; set; } /// /// /// - public global::Together.RlWandbMetadata? Type349 { get; set; } + public global::Together.RlTrainingSession? Type349 { get; set; } /// /// /// - public global::Together.RlSessionPolicyState? Type350 { get; set; } + public global::System.Collections.Generic.IList? Type350 { get; set; } /// /// /// - public global::Together.RlTrainingSession? Type351 { get; set; } + public global::Together.RlInferenceCheckpoint? Type351 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type352 { get; set; } + public global::System.Collections.Generic.IList? Type352 { get; set; } /// /// /// - public global::Together.RlInferenceCheckpoint? Type353 { get; set; } + public global::Together.RlTrainingCheckpoint? Type353 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type354 { get; set; } + public global::Together.RlTrainingSessionsListResponse? Type354 { get; set; } /// /// /// - public global::Together.RlTrainingCheckpoint? Type355 { get; set; } + public global::System.Collections.Generic.IList? Type355 { get; set; } /// /// /// - public global::Together.RlTrainingSessionsListResponse? Type356 { get; set; } + public global::Together.RlSupportedModelsListResponse? Type356 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type357 { get; set; } + public global::System.Collections.Generic.IList? Type357 { get; set; } /// /// /// - public global::Together.RlSupportedModelsListResponse? Type358 { get; set; } + public global::Together.RlAdamConfig? Type358 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type359 { get; set; } + public global::Together.RlMuonConfig? Type359 { get; set; } /// /// /// - public global::Together.RlAdamConfig? Type360 { get; set; } + public global::Together.RlMuonScalingStrategy? Type360 { get; set; } /// /// /// - public global::Together.RlMuonConfig? Type361 { get; set; } + public global::Together.RlInferenceCheckpointOperation? Type361 { get; set; } /// /// /// - public global::Together.RlMuonScalingStrategy? Type362 { get; set; } + public global::Together.RlInferenceCheckpointResult? Type362 { get; set; } /// /// /// - public global::Together.RlInferenceCheckpointOperation? Type363 { get; set; } + public global::Together.RlInferenceCheckpointRegistration? Type363 { get; set; } /// /// /// - public global::Together.RlInferenceCheckpointResult? Type364 { get; set; } + public global::Together.RlModelRegistryArtifact? Type364 { get; set; } /// /// /// - public global::Together.RlInferenceCheckpointRegistration? Type365 { get; set; } + public global::Together.RlTrainingCheckpointResult? Type365 { get; set; } /// /// /// - public global::Together.RlModelRegistryArtifact? Type366 { get; set; } + public global::Together.RlTrainingCheckpointOperation? Type366 { get; set; } /// /// /// - public global::Together.RlTrainingCheckpointResult? Type367 { get; set; } + public global::Together.RlCheckpointsListResponse? Type367 { get; set; } /// /// /// - public global::Together.RlTrainingCheckpointOperation? Type368 { get; set; } + public global::System.Collections.Generic.IList? Type368 { get; set; } /// /// /// - public global::Together.RlCheckpointsListResponse? Type369 { get; set; } + public global::Together.RlCheckpoint? Type369 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type370 { get; set; } + public global::Together.RlCheckpointType? Type370 { get; set; } /// /// /// - public global::Together.RlCheckpoint? Type371 { get; set; } + public global::Together.RlCheckpointVariant? Type371 { get; set; } /// /// /// - public global::Together.RlCheckpointType? Type372 { get; set; } + public global::Together.RlCheckpointFile? Type372 { get; set; } /// /// /// - public global::Together.RlCheckpointVariant? Type373 { get; set; } + public global::Together.OneOf? Type373 { get; set; } /// /// /// - public global::Together.RlCheckpointFile? Type374 { get; set; } + public long? Type374 { get; set; } /// /// /// - public global::Together.OneOf? Type375 { get; set; } + public global::Together.RlCheckpointDownloadResponse? Type375 { get; set; } /// /// /// - public global::Together.RlCheckpointDownloadResponse? Type376 { get; set; } + public global::System.Collections.Generic.IList? Type376 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type377 { get; set; } + public global::Together.ErrorResponse? Type377 { get; set; } /// /// /// - public global::Together.ErrorResponse? Type378 { get; set; } + public global::Together.GPUClusterControlPlaneNode? Type378 { get; set; } /// /// /// - public global::Together.GPUClusterControlPlaneNode? Type379 { get; set; } + public global::System.Collections.Generic.IList? Type379 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type380 { get; set; } + public global::Together.NodePhaseTransition? Type380 { get; set; } /// /// /// - public global::Together.NodePhaseTransition? Type381 { get; set; } + public global::Together.GPUClusterCreateRequest? Type381 { get; set; } /// /// /// - public global::Together.GPUClusterCreateRequest? Type382 { get; set; } + public global::Together.GPUClusterCreateRequestNvidiaVersion? Type382 { get; set; } /// /// /// - public global::Together.GPUClusterCreateRequestNvidiaVersion? Type383 { get; set; } + public global::Together.GPUClusterCreateRequestLegacyNvidia? Type383 { get; set; } /// /// /// - public global::Together.GPUClusterCreateRequestLegacyNvidia? Type384 { get; set; } + public global::Together.GPUClusterCreateRequestCommon? Type384 { get; set; } /// /// /// - public global::Together.GPUClusterCreateRequestCommon? Type385 { get; set; } + public global::Together.GPUClusterCreateRequestCommonClusterType? Type385 { get; set; } /// /// /// - public global::Together.GPUClusterCreateRequestCommonClusterType? Type386 { get; set; } + public global::Together.GPUClusterCreateRequestCommonGpuType? Type386 { get; set; } /// /// /// - public global::Together.GPUClusterCreateRequestCommonGpuType? Type387 { get; set; } + public global::Together.GPUClustersSharedVolumeCreateRequest? Type387 { get; set; } /// /// /// - public global::Together.GPUClustersSharedVolumeCreateRequest? Type388 { get; set; } + public global::Together.GPUClusterCreateRequestCommonBillingType? Type388 { get; set; } /// /// /// - public global::Together.GPUClusterCreateRequestCommonBillingType? Type389 { get; set; } + public global::Together.OIDCConfig? Type389 { get; set; } /// /// /// - public global::Together.OIDCConfig? Type390 { get; set; } + public global::Together.AcceptanceTestsParams? Type390 { get; set; } /// /// /// - public global::Together.AcceptanceTestsParams? Type391 { get; set; } + public global::Together.InstanceClusterConfig? Type391 { get; set; } /// /// /// - public global::Together.InstanceClusterConfig? Type392 { get; set; } + public global::System.Collections.Generic.IList? Type392 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type393 { get; set; } + public global::Together.AddOnCreateRequest? Type393 { get; set; } /// /// /// - public global::Together.AddOnCreateRequest? Type394 { get; set; } + public global::Together.GPUClusterGPUWorkerNode? Type394 { get; set; } /// /// /// - public global::Together.GPUClusterGPUWorkerNode? Type395 { get; set; } + public global::Together.Remediation? Type395 { get; set; } /// /// /// - public global::Together.Remediation? Type396 { get; set; } + public global::Together.GPUClusterInfo? Type396 { get; set; } /// /// /// - public global::Together.GPUClusterInfo? Type397 { get; set; } + public global::Together.GPUClusterInfoClusterType? Type397 { get; set; } /// /// /// - public global::Together.GPUClusterInfoClusterType? Type398 { get; set; } + public global::Together.GPUClusterInfoGpuType? Type398 { get; set; } /// /// /// - public global::Together.GPUClusterInfoGpuType? Type399 { get; set; } + public global::System.Collections.Generic.IList? Type399 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type400 { get; set; } + public global::Together.GPUClusterVolume? Type400 { get; set; } /// /// /// - public global::Together.GPUClusterVolume? Type401 { get; set; } + public global::Together.GPUClusterInfoStatus? Type401 { get; set; } /// /// /// - public global::Together.GPUClusterInfoStatus? Type402 { get; set; } + public global::System.Collections.Generic.IList? Type402 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type403 { get; set; } + public global::System.Collections.Generic.IList? Type403 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type404 { get; set; } + public global::System.Collections.Generic.IList? Type404 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type405 { get; set; } + public global::Together.ClusterPhaseTransition? Type405 { get; set; } /// /// /// - public global::Together.ClusterPhaseTransition? Type406 { get; set; } + public global::Together.GPUClusterInfoBillingType? Type406 { get; set; } /// /// /// - public global::Together.GPUClusterInfoBillingType? Type407 { get; set; } + public global::System.Collections.Generic.IList? Type407 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type408 { get; set; } + public global::Together.AddOnInfo? Type408 { get; set; } /// /// /// - public global::Together.AddOnInfo? Type409 { get; set; } + public global::System.Collections.Generic.IList? Type409 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type410 { get; set; } + public global::Together.GPUClusterNodeLifecycleEvent? Type410 { get; set; } /// /// /// - public global::Together.GPUClusterNodeLifecycleEvent? Type411 { get; set; } + public global::Together.GPUClusterUpdateRequest? Type411 { get; set; } /// /// /// - public global::Together.GPUClusterUpdateRequest? Type412 { get; set; } + public global::Together.GPUClusterUpdateRequestClusterType? Type412 { get; set; } /// /// /// - public global::Together.GPUClusterUpdateRequestClusterType? Type413 { get; set; } + public global::System.Collections.Generic.IList? Type413 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type414 { get; set; } + public global::Together.AddOnUpdateRequest? Type414 { get; set; } /// /// /// - public global::Together.AddOnUpdateRequest? Type415 { get; set; } + public global::Together.GPUClusters? Type415 { get; set; } /// /// /// - public global::Together.GPUClusters? Type416 { get; set; } + public global::System.Collections.Generic.IList? Type416 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type417 { get; set; } + public global::Together.InstanceTypesResponse? Type417 { get; set; } /// /// /// - public global::Together.InstanceTypesResponse? Type418 { get; set; } + public global::System.Collections.Generic.IList? Type418 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type419 { get; set; } + public global::Together.InstanceTypesResponseType? Type419 { get; set; } /// /// /// - public global::Together.InstanceTypesResponseType? Type420 { get; set; } + public global::Together.RegionListResponse? Type420 { get; set; } /// /// /// - public global::Together.RegionListResponse? Type421 { get; set; } + public global::System.Collections.Generic.IList? Type421 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type422 { get; set; } + public global::Together.RegionListResponseRegion? Type422 { get; set; } /// /// /// - public global::Together.RegionListResponseRegion? Type423 { get; set; } + public global::System.Collections.Generic.IList? Type423 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type424 { get; set; } + public global::Together.ClusterDriverVersionInfo? Type424 { get; set; } /// /// /// - public global::Together.ClusterDriverVersionInfo? Type425 { get; set; } + public global::Together.AcceptanceTestsParamsDcgmDiagLevel? Type425 { get; set; } /// /// /// - public global::Together.AcceptanceTestsParamsDcgmDiagLevel? Type426 { get; set; } + public global::Together.AddOnConfig? Type426 { get; set; } /// /// /// - public global::Together.AddOnConfig? Type427 { get; set; } + public global::Together.DashboardConfig? Type427 { get; set; } /// /// /// - public global::Together.DashboardConfig? Type428 { get; set; } + public global::Together.IngressConfig? Type428 { get; set; } /// /// /// - public global::Together.IngressConfig? Type429 { get; set; } + public global::Together.TorchpassConfig? Type429 { get; set; } /// /// /// - public global::Together.TorchpassConfig? Type430 { get; set; } + public global::Together.SlurmWebConfig? Type430 { get; set; } /// /// /// - public global::Together.SlurmWebConfig? Type431 { get; set; } + public global::Together.HeadlampConfig? Type431 { get; set; } /// /// /// - public global::Together.HeadlampConfig? Type432 { get; set; } + public global::Together.AddOnState? Type432 { get; set; } /// /// /// - public global::Together.AddOnState? Type433 { get; set; } + public global::Together.DashboardState? Type433 { get; set; } /// /// /// - public global::Together.DashboardState? Type434 { get; set; } + public global::Together.IngressState? Type434 { get; set; } /// /// /// - public global::Together.IngressState? Type435 { get; set; } + public global::Together.TorchpassState? Type435 { get; set; } /// /// /// - public global::Together.TorchpassState? Type436 { get; set; } + public global::Together.SlurmWebState? Type436 { get; set; } /// /// /// - public global::Together.SlurmWebState? Type437 { get; set; } + public global::Together.HeadlampState? Type437 { get; set; } /// /// /// - public global::Together.HeadlampState? Type438 { get; set; } + public global::Together.CommentBody? Type438 { get; set; } /// /// /// - public global::Together.CommentBody? Type439 { get; set; } + public global::Together.ApproveRemediationRequest? Type439 { get; set; } /// /// /// - public global::Together.ApproveRemediationRequest? Type440 { get; set; } + public global::Together.ApproveRemediationRequestMode? Type440 { get; set; } /// /// /// - public global::Together.ApproveRemediationRequestMode? Type441 { get; set; } + public global::Together.ClusterAddOnCreateRequest? Type441 { get; set; } /// /// /// - public global::Together.ClusterAddOnCreateRequest? Type442 { get; set; } + public global::Together.ClusterAddOnDeleteResponse? Type442 { get; set; } /// /// /// - public global::Together.ClusterAddOnDeleteResponse? Type443 { get; set; } + public global::Together.ClusterAddOnUpdateRequest? Type443 { get; set; } /// /// /// - public global::Together.ClusterAddOnUpdateRequest? Type444 { get; set; } + public global::Together.ClusterAddOnsListResponse? Type444 { get; set; } /// /// /// - public global::Together.ClusterAddOnsListResponse? Type445 { get; set; } + public global::Together.ClusterIngressConfig? Type445 { get; set; } /// /// /// - public global::Together.ClusterIngressConfig? Type446 { get; set; } + public global::Together.ClusterPhaseTransitionPhase? Type446 { get; set; } /// /// /// - public global::Together.ClusterPhaseTransitionPhase? Type447 { get; set; } + public global::Together.GPUClusterDeleteResponse? Type447 { get; set; } /// /// /// - public global::Together.GPUClusterDeleteResponse? Type448 { get; set; } + public global::Together.InstanceClusterConfigLoadBalancer? Type448 { get; set; } /// /// /// - public global::Together.InstanceClusterConfigLoadBalancer? Type449 { get; set; } + public global::Together.SlurmStartupScripts? Type449 { get; set; } /// /// /// - public global::Together.SlurmStartupScripts? Type450 { get; set; } + public global::Together.ObservabilityConfig? Type450 { get; set; } /// /// /// - public global::Together.ObservabilityConfig? Type451 { get; set; } + public global::Together.ListRemediationsResponse? Type451 { get; set; } /// /// /// - public global::Together.ListRemediationsResponse? Type452 { get; set; } + public global::System.Collections.Generic.IList? Type452 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type453 { get; set; } + public global::Together.NodePhaseTransitionPhase? Type453 { get; set; } /// /// /// - public global::Together.NodePhaseTransitionPhase? Type454 { get; set; } + public global::Together.ListPassiveHealthCheckAlertsResponse? Type454 { get; set; } /// /// /// - public global::Together.ListPassiveHealthCheckAlertsResponse? Type455 { get; set; } + public global::System.Collections.Generic.IList? Type455 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type456 { get; set; } + public global::Together.PassiveHealthCheckAlert? Type456 { get; set; } /// /// /// - public global::Together.PassiveHealthCheckAlert? Type457 { get; set; } + public global::Together.PHCAnnotation? Type457 { get; set; } /// /// /// - public global::Together.PHCAnnotation? Type458 { get; set; } + public global::Together.XidDetail? Type458 { get; set; } /// /// /// - public global::Together.XidDetail? Type459 { get; set; } + public global::Together.SlurmNodeUnavailableDetail? Type459 { get; set; } /// /// /// - public global::Together.SlurmNodeUnavailableDetail? Type460 { get; set; } + public global::Together.PassiveHealthCheckAlertSeverity? Type460 { get; set; } /// /// /// - public global::Together.PassiveHealthCheckAlertSeverity? Type461 { get; set; } + public global::Together.RemediationMode? Type461 { get; set; } /// /// /// - public global::Together.RemediationMode? Type462 { get; set; } + public global::Together.RemediationTrigger? Type462 { get; set; } /// /// /// - public global::Together.RemediationTrigger? Type463 { get; set; } + public global::Together.RemediationState? Type463 { get; set; } /// /// /// - public global::Together.RemediationState? Type464 { get; set; } + public global::Together.GPUClustersSharedVolumeDeleteResponse? Type464 { get; set; } /// /// /// - public global::Together.GPUClustersSharedVolumeDeleteResponse? Type465 { get; set; } + public global::Together.GPUClustersSharedVolume? Type465 { get; set; } /// /// /// - public global::Together.GPUClustersSharedVolume? Type466 { get; set; } + public global::Together.GPUClustersSharedVolumeStatus? Type466 { get; set; } /// /// /// - public global::Together.GPUClustersSharedVolumeStatus? Type467 { get; set; } + public global::Together.GPUClustersSharedVolumeUpdateRequest? Type467 { get; set; } /// /// /// - public global::Together.GPUClustersSharedVolumeUpdateRequest? Type468 { get; set; } + public global::Together.GPUClustersSharedVolumes? Type468 { get; set; } /// /// /// - public global::Together.GPUClustersSharedVolumes? Type469 { get; set; } + public global::System.Collections.Generic.IList? Type469 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type470 { get; set; } + public global::System.Collections.Generic.IList? Type470 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type471 { get; set; } + public global::Together.XidEvent? Type471 { get; set; } /// /// /// - public global::Together.XidEvent? Type472 { get; set; } + public global::Together.ListVoicesResponse? Type472 { get; set; } /// /// /// - public global::Together.ListVoicesResponse? Type473 { get; set; } + public global::System.Collections.Generic.IList? Type473 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type474 { get; set; } + public global::Together.ModelVoices? Type474 { get; set; } /// /// /// - public global::Together.ModelVoices? Type475 { get; set; } + public global::System.Collections.Generic.IList? Type475 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type476 { get; set; } + public global::Together.ModelVoicesVoice? Type476 { get; set; } /// /// /// - public global::Together.ModelVoicesVoice? Type477 { get; set; } + public global::Together.ListAvailibilityZonesResponse? Type477 { get; set; } /// /// /// @@ -2097,1631 +2097,1971 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::System.Collections.Generic.IList? Type516 { get; set; } + public global::Together.CompletionChoiceDeltaFunctionCall? Type516 { get; set; } /// /// /// - public global::Together.ChatCompletionChoicesDataItem? Type517 { get; set; } + public global::System.Collections.Generic.IList? Type517 { get; set; } /// /// /// - public global::Together.ChatCompletionMessage? Type518 { get; set; } + public global::Together.ChatCompletionChoicesDataItem? Type518 { get; set; } /// /// /// - public global::Together.AllOf? Type519 { get; set; } + public global::Together.ChatCompletionMessage? Type519 { get; set; } /// /// /// - public global::Together.ChatCompletionMessageRole? Type520 { get; set; } + public global::Together.AllOf? Type520 { get; set; } /// /// /// - public global::Together.ChatCompletionTool? Type521 { get; set; } + public global::Together.ChatCompletionMessageRole? Type521 { get; set; } /// /// /// - public global::Together.ChatCompletionToolType? Type522 { get; set; } + public global::Together.ChatCompletionMessageFunctionCall? Type522 { get; set; } /// /// /// - public global::Together.ChatCompletionToolFunction? Type523 { get; set; } + public global::Together.ChatCompletionTool? Type523 { get; set; } /// /// /// - public global::Together.ChatCompletionRequest? Type524 { get; set; } + public global::Together.ChatCompletionToolType? Type524 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type525 { get; set; } + public global::Together.ChatCompletionToolFunction? Type525 { get; set; } /// /// /// - public global::Together.ChatCompletionMessageParam? Type526 { get; set; } + public global::Together.ChatCompletionRequest? Type526 { get; set; } /// /// /// - public global::Together.ChatCompletionRequestContextLengthExceededBehavior? Type527 { get; set; } + public global::System.Collections.Generic.IList? Type527 { get; set; } /// /// /// - public global::Together.OneOf? Type528 { get; set; } + public global::Together.ChatCompletionMessageParam? Type528 { get; set; } /// /// /// - public global::Together.ChatCompletionRequestFunctionCallEnum? Type529 { get; set; } + public global::Together.ChatCompletionRequestContextLengthExceededBehavior? Type529 { get; set; } /// /// /// - public global::Together.ChatCompletionRequestFunctionCallEnum2? Type530 { get; set; } + public global::Together.OneOf? Type530 { get; set; } /// /// /// - public global::Together.ResponseFormat? Type531 { get; set; } + public global::Together.ChatCompletionRequestFunctionCallEnum? Type531 { get; set; } /// /// /// - public global::Together.ResponseFormatText? Type532 { get; set; } + public global::Together.ChatCompletionRequestFunctionCallEnum2? Type532 { get; set; } /// /// /// - public global::Together.ResponseFormatJsonSchema? Type533 { get; set; } + public global::Together.ResponseFormat? Type533 { get; set; } /// /// /// - public global::Together.ResponseFormatJsonObject? Type534 { get; set; } + public global::Together.ResponseFormatText? Type534 { get; set; } /// /// /// - public global::Together.ChatCompletionRequestResponseFormatDiscriminator? Type535 { get; set; } + public global::Together.ResponseFormatJsonSchema? Type535 { get; set; } /// /// /// - public global::Together.ChatCompletionRequestResponseFormatDiscriminatorType? Type536 { get; set; } + public global::Together.ResponseFormatJsonObject? Type536 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type537 { get; set; } + public global::Together.ChatCompletionRequestResponseFormatDiscriminator? Type537 { get; set; } /// /// /// - public global::Together.ToolsPart? Type538 { get; set; } + public global::Together.ChatCompletionRequestResponseFormatDiscriminatorType? Type538 { get; set; } /// /// /// - public global::Together.OneOf? Type539 { get; set; } + public global::System.Collections.Generic.IList? Type539 { get; set; } /// /// /// - public global::Together.ChatCompletionRequestReasoningEffort? Type540 { get; set; } + public global::Together.ToolsPart? Type540 { get; set; } /// /// /// - public global::Together.ChatCompletionRequestReasoning? Type541 { get; set; } + public global::Together.OneOf? Type541 { get; set; } /// /// /// - public global::Together.ResponseFormatTextType? Type542 { get; set; } + public global::Together.ChatCompletionRequestReasoningEffort? Type542 { get; set; } /// /// /// - public global::Together.ResponseFormatJsonObjectType? Type543 { get; set; } + public global::Together.ChatCompletionRequestReasoning? Type543 { get; set; } /// /// /// - public global::Together.ResponseFormatJsonSchemaType? Type544 { get; set; } + public global::Together.ResponseFormatTextType? Type544 { get; set; } /// /// /// - public global::Together.ResponseFormatJsonSchemaJsonSchema? Type545 { get; set; } + public global::Together.ResponseFormatJsonObjectType? Type545 { get; set; } /// /// /// - public global::Together.ResponseFormatJsonSchemaSchema? Type546 { get; set; } + public global::Together.ResponseFormatJsonSchemaType? Type546 { get; set; } /// /// /// - public global::Together.ChatCompletionSystemMessageParam? Type547 { get; set; } + public global::Together.ResponseFormatJsonSchemaJsonSchema? Type547 { get; set; } /// /// /// - public global::Together.ChatCompletionUserMessageParam? Type548 { get; set; } + public global::Together.ResponseFormatJsonSchemaSchema? Type548 { get; set; } /// /// /// - public global::Together.ChatCompletionAssistantMessageParam? Type549 { get; set; } + public global::Together.ChatCompletionSystemMessageParam? Type549 { get; set; } /// /// /// - public global::Together.ChatCompletionToolMessageParam? Type550 { get; set; } + public global::Together.ChatCompletionUserMessageParam? Type550 { get; set; } /// /// /// - public global::Together.ChatCompletionSystemMessageParamRole? Type551 { get; set; } + public global::Together.ChatCompletionAssistantMessageParam? Type551 { get; set; } /// /// /// - public global::Together.ChatCompletionUserMessageContent? Type552 { get; set; } + public global::Together.ChatCompletionToolMessageParam? Type552 { get; set; } /// /// /// - public global::Together.ChatCompletionUserMessageParamRole? Type553 { get; set; } + public global::Together.ChatCompletionFunctionMessageParam? Type553 { get; set; } /// /// /// - public global::Together.ChatCompletionUserMessageContentMultimodalItemVariant1? Type554 { get; set; } + public global::Together.ChatCompletionSystemMessageParamRole? Type554 { get; set; } /// /// /// - public global::Together.ChatCompletionUserMessageContentMultimodalItemVariant1Type? Type555 { get; set; } + public global::Together.ChatCompletionUserMessageContent? Type555 { get; set; } /// /// /// - public global::Together.ChatCompletionUserMessageContentMultimodalItemVariant2? Type556 { get; set; } + public global::Together.ChatCompletionUserMessageParamRole? Type556 { get; set; } /// /// /// - public global::Together.ChatCompletionUserMessageContentMultimodalItemVariant2Type? Type557 { get; set; } + public global::Together.ChatCompletionUserMessageContentMultimodalItemVariant1? Type557 { get; set; } /// /// /// - public global::Together.ChatCompletionUserMessageContentMultimodalItemVariant2ImageUrl? Type558 { get; set; } + public global::Together.ChatCompletionUserMessageContentMultimodalItemVariant1Type? Type558 { get; set; } /// /// /// - public global::Together.ChatCompletionUserMessageContentMultimodalItemVideo? Type559 { get; set; } + public global::Together.ChatCompletionUserMessageContentMultimodalItemVariant2? Type559 { get; set; } /// /// /// - public global::Together.ChatCompletionUserMessageContentMultimodalItemVideoType? Type560 { get; set; } + public global::Together.ChatCompletionUserMessageContentMultimodalItemVariant2Type? Type560 { get; set; } /// /// /// - public global::Together.ChatCompletionUserMessageContentMultimodalItemVideoVideoUrl? Type561 { get; set; } + public global::Together.ChatCompletionUserMessageContentMultimodalItemVariant2ImageUrl? Type561 { get; set; } /// /// /// - public global::Together.ChatCompletionUserMessageContentMultimodalItemAudio? Type562 { get; set; } + public global::Together.ChatCompletionUserMessageContentMultimodalItemVideo? Type562 { get; set; } /// /// /// - public global::Together.ChatCompletionUserMessageContentMultimodalItemAudioType? Type563 { get; set; } + public global::Together.ChatCompletionUserMessageContentMultimodalItemVideoType? Type563 { get; set; } /// /// /// - public global::Together.ChatCompletionUserMessageContentMultimodalItemAudioAudioUrl? Type564 { get; set; } + public global::Together.ChatCompletionUserMessageContentMultimodalItemVideoVideoUrl? Type564 { get; set; } /// /// /// - public global::Together.ChatCompletionUserMessageContentMultimodalItemInputAudio? Type565 { get; set; } + public global::Together.ChatCompletionUserMessageContentMultimodalItemAudio? Type565 { get; set; } /// /// /// - public global::Together.ChatCompletionUserMessageContentMultimodalItemInputAudioType? Type566 { get; set; } + public global::Together.ChatCompletionUserMessageContentMultimodalItemAudioType? Type566 { get; set; } /// /// /// - public global::Together.ChatCompletionUserMessageContentMultimodalItemInputAudioInputAudio? Type567 { get; set; } + public global::Together.ChatCompletionUserMessageContentMultimodalItemAudioAudioUrl? Type567 { get; set; } /// /// /// - public global::Together.ChatCompletionUserMessageContentMultimodalItemInputAudioInputAudioFormat? Type568 { get; set; } + public global::Together.ChatCompletionUserMessageContentMultimodalItemInputAudio? Type568 { get; set; } /// /// /// - public global::Together.ChatCompletionAssistantMessageParamRole? Type569 { get; set; } + public global::Together.ChatCompletionUserMessageContentMultimodalItemInputAudioType? Type569 { get; set; } /// /// /// - public global::Together.ChatCompletionToolMessageParamRole? Type570 { get; set; } + public global::Together.ChatCompletionUserMessageContentMultimodalItemInputAudioInputAudio? Type570 { get; set; } /// /// /// - public global::Together.ChatCompletionResponse? Type571 { get; set; } + public global::Together.ChatCompletionUserMessageContentMultimodalItemInputAudioInputAudioFormat? Type571 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type572 { get; set; } + public global::Together.ChatCompletionAssistantMessageParamRole? Type572 { get; set; } /// /// /// - public global::Together.ChatCompletionStream? Type573 { get; set; } + public global::Together.ChatCompletionAssistantMessageParamFunctionCall? Type573 { get; set; } /// /// /// - public global::Together.ChatCompletionEvent? Type574 { get; set; } + public global::Together.ChatCompletionFunctionMessageParamRole? Type574 { get; set; } /// /// /// - public global::Together.ChatCompletionChunk? Type575 { get; set; } + public global::Together.ChatCompletionToolMessageParamRole? Type575 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type576 { get; set; } + public global::Together.ChatCompletionResponse? Type576 { get; set; } /// /// /// - public global::Together.ChatCompletionChunkChoice? Type577 { get; set; } + public global::System.Collections.Generic.IList? Type577 { get; set; } /// /// /// - public global::Together.ChatCompletionChunkChoiceDelta? Type578 { get; set; } + public global::Together.ChatCompletionStream? Type578 { get; set; } /// /// /// - public global::Together.ChatCompletionChunkChoiceDeltaRole? Type579 { get; set; } + public global::Together.ChatCompletionEvent? Type579 { get; set; } /// /// /// - public global::Together.AudioSpeechRequest? Type580 { get; set; } + public global::Together.ChatCompletionChunk? Type580 { get; set; } /// /// /// - public global::Together.AnyOf? Type581 { get; set; } + public global::System.Collections.Generic.IList? Type581 { get; set; } /// /// /// - public global::Together.AudioSpeechRequestModel? Type582 { get; set; } + public global::Together.ChatCompletionChunkChoice? Type582 { get; set; } /// /// /// - public global::Together.AudioSpeechRequestResponseFormat? Type583 { get; set; } + public global::Together.ChatCompletionChunkChoiceDelta? Type583 { get; set; } /// /// /// - public global::Together.AudioSpeechRequestResponseEncoding? Type584 { get; set; } + public global::Together.ChatCompletionChunkChoiceDeltaRole? Type584 { get; set; } /// /// /// - public global::Together.AudioSpeechRequestExtraParams? Type585 { get; set; } + public global::Together.ChatCompletionChunkChoiceDeltaFunctionCall? Type585 { get; set; } /// /// /// - public global::Together.AudioTranscriptionRequest? Type586 { get; set; } + public global::Together.AudioSpeechRequest? Type586 { get; set; } /// /// /// - public global::Together.OneOf? Type587 { get; set; } + public global::Together.AnyOf? Type587 { get; set; } /// /// /// - public byte[]? Type588 { get; set; } + public global::Together.AudioSpeechRequestModel? Type588 { get; set; } /// /// /// - public global::Together.AudioTranscriptionRequestModel? Type589 { get; set; } + public global::Together.AudioSpeechRequestResponseFormat? Type589 { get; set; } /// /// /// - public global::Together.AudioTranscriptionRequestResponseFormat? Type590 { get; set; } + public global::Together.AudioSpeechRequestResponseEncoding? Type590 { get; set; } /// /// /// - public global::Together.OneOf>? Type591 { get; set; } + public global::Together.AudioSpeechRequestExtraParams? Type591 { get; set; } /// /// /// - public global::Together.AudioTranscriptionRequestTimestampGranularities? Type592 { get; set; } + public global::Together.AudioTranscriptionRequest? Type592 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type593 { get; set; } + public global::Together.OneOf? Type593 { get; set; } /// /// /// - public global::Together.AudioTranscriptionRequestTimestampGranularitie? Type594 { get; set; } + public byte[]? Type594 { get; set; } /// /// /// - public global::Together.AudioTranscriptionResponse? Type595 { get; set; } + public global::Together.AudioTranscriptionRequestModel? Type595 { get; set; } /// /// /// - public global::Together.AudioTranscriptionJsonResponse? Type596 { get; set; } + public global::Together.AudioTranscriptionRequestResponseFormat? Type596 { get; set; } /// /// /// - public global::Together.AudioTranscriptionVerboseJsonResponse? Type597 { get; set; } + public global::Together.OneOf>? Type597 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type598 { get; set; } + public global::Together.AudioTranscriptionRequestTimestampGranularities? Type598 { get; set; } /// /// /// - public global::Together.AudioTranscriptionSegment? Type599 { get; set; } + public global::System.Collections.Generic.IList? Type599 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type600 { get; set; } + public global::Together.AudioTranscriptionRequestTimestampGranularitie? Type600 { get; set; } /// /// /// - public global::Together.AudioTranscriptionWord? Type601 { get; set; } + public global::Together.AudioTranscriptionResponse? Type601 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type602 { get; set; } + public global::Together.AudioTranscriptionJsonResponse? Type602 { get; set; } /// /// /// - public global::Together.AudioTranscriptionSpeakerSegment? Type603 { get; set; } + public global::Together.AudioTranscriptionVerboseJsonResponse? Type603 { get; set; } /// /// /// - public global::Together.AudioTranslationRequest? Type604 { get; set; } + public global::System.Collections.Generic.IList? Type604 { get; set; } /// /// /// - public global::Together.AudioTranslationRequestModel? Type605 { get; set; } + public global::Together.AudioTranscriptionSegment? Type605 { get; set; } /// /// /// - public global::Together.AudioTranslationRequestResponseFormat? Type606 { get; set; } + public global::System.Collections.Generic.IList? Type606 { get; set; } /// /// /// - public global::Together.OneOf>? Type607 { get; set; } + public global::Together.AudioTranscriptionWord? Type607 { get; set; } /// /// /// - public global::Together.AudioTranslationRequestTimestampGranularities? Type608 { get; set; } + public global::System.Collections.Generic.IList? Type608 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type609 { get; set; } + public global::Together.AudioTranscriptionSpeakerSegment? Type609 { get; set; } /// /// /// - public global::Together.AudioTranslationRequestTimestampGranularitie? Type610 { get; set; } + public global::Together.AudioTranslationRequest? Type610 { get; set; } /// /// /// - public global::Together.AudioTranslationResponse? Type611 { get; set; } + public global::Together.AudioTranslationRequestModel? Type611 { get; set; } /// /// /// - public global::Together.AudioTranslationJsonResponse? Type612 { get; set; } + public global::Together.AudioTranslationRequestResponseFormat? Type612 { get; set; } /// /// /// - public global::Together.AudioTranslationVerboseJsonResponse? Type613 { get; set; } + public global::Together.OneOf>? Type613 { get; set; } /// /// /// - public global::Together.AudioSpeechStreamResponse? Type614 { get; set; } + public global::Together.AudioTranslationRequestTimestampGranularities? Type614 { get; set; } /// /// /// - public global::Together.AudioSpeechStreamEvent? Type615 { get; set; } + public global::System.Collections.Generic.IList? Type615 { get; set; } /// /// /// - public global::Together.AudioSpeechStreamChunk? Type616 { get; set; } + public global::Together.AudioTranslationRequestTimestampGranularitie? Type616 { get; set; } /// /// /// - public global::Together.StreamSentinelData? Type617 { get; set; } + public global::Together.AudioTranslationResponse? Type617 { get; set; } /// /// /// - public global::Together.ChatCompletionToken? Type618 { get; set; } + public global::Together.AudioTranslationJsonResponse? Type618 { get; set; } /// /// /// - public global::Together.ChatCompletionChoice? Type619 { get; set; } + public global::Together.AudioTranslationVerboseJsonResponse? Type619 { get; set; } /// /// /// - public global::Together.ChatCompletionChoiceDelta? Type620 { get; set; } + public global::Together.AudioSpeechStreamResponse? Type620 { get; set; } /// /// /// - public global::Together.ChatCompletionChoiceDeltaRole? Type621 { get; set; } + public global::Together.AudioSpeechStreamEvent? Type621 { get; set; } /// /// /// - public global::Together.EmbeddingsRequest? Type622 { get; set; } + public global::Together.AudioSpeechStreamChunk? Type622 { get; set; } /// /// /// - public global::Together.AnyOf? Type623 { get; set; } + public global::Together.StreamSentinelData? Type623 { get; set; } /// /// /// - public global::Together.EmbeddingsRequestModel? Type624 { get; set; } + public global::Together.ChatCompletionToken? Type624 { get; set; } /// /// /// - public global::Together.OneOf>? Type625 { get; set; } + public global::Together.ChatCompletionChoice? Type625 { get; set; } /// /// /// - public global::Together.EmbeddingsResponse? Type626 { get; set; } + public global::Together.ChatCompletionChoiceDelta? Type626 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type627 { get; set; } + public global::Together.ChatCompletionChoiceDeltaRole? Type627 { get; set; } /// /// /// - public global::Together.EmbeddingsResponseDataItem? Type628 { get; set; } + public global::Together.ChatCompletionChoiceDeltaFunctionCall? Type628 { get; set; } /// /// /// - public global::Together.ImageResponse? Type629 { get; set; } + public global::Together.EmbeddingsRequest? Type629 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type630 { get; set; } + public global::Together.AnyOf? Type630 { get; set; } /// /// /// - public global::Together.DataItem? Type631 { get; set; } + public global::Together.EmbeddingsRequestModel? Type631 { get; set; } /// /// /// - public global::Together.ImageResponseDataB64? Type632 { get; set; } + public global::Together.OneOf>? Type632 { get; set; } /// /// /// - public global::Together.ImageResponseDataUrl? Type633 { get; set; } + public global::Together.EmbeddingsResponse? Type633 { get; set; } /// /// /// - public global::Together.ImageResponseDataItemDiscriminator? Type634 { get; set; } + public global::System.Collections.Generic.IList? Type634 { get; set; } /// /// /// - public global::Together.ImageResponseDataItemDiscriminatorType? Type635 { get; set; } + public global::Together.EmbeddingsResponseDataItem? Type635 { get; set; } /// /// /// - public global::Together.ImageResponseDataB64Type? Type636 { get; set; } + public global::System.Collections.Generic.IList? Type636 { get; set; } /// /// /// - public global::Together.ImageResponseDataUrlType? Type637 { get; set; } + public global::Together.ModelInfo? Type637 { get; set; } /// /// /// - public global::Together.ToolsPartFunction? Type638 { get; set; } + public global::Together.ModelInfoType? Type638 { get; set; } /// /// /// - public global::Together.ToolChoiceType? Type639 { get; set; } + public global::Together.Pricing? Type639 { get; set; } /// /// /// - public global::Together.ToolChoiceFunction? Type640 { get; set; } + public global::Together.ModelUploadRequest? Type640 { get; set; } /// /// /// - public global::Together.FileResponse? Type641 { get; set; } + public global::Together.ModelUploadRequestModelType? Type641 { get; set; } /// /// /// - public global::Together.FilePurpose? Type642 { get; set; } + public global::Together.ModelUploadSuccessResponse? Type642 { get; set; } /// /// /// - public global::Together.FileType? Type643 { get; set; } + public global::Together.ModelUploadSuccessResponseData? Type643 { get; set; } /// /// /// - public global::Together.FileProcessingStatus? Type644 { get; set; } + public global::Together.ImageResponse? Type644 { get; set; } /// /// /// - public global::Together.FileValidationReport? Type645 { get; set; } + public global::System.Collections.Generic.IList? Type645 { get; set; } /// /// /// - public global::Together.FileValidationReportErrorType? Type646 { get; set; } + public global::Together.DataItem? Type646 { get; set; } /// /// /// - public global::Together.FileList? Type647 { get; set; } + public global::Together.ImageResponseDataB64? Type647 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type648 { get; set; } + public global::Together.ImageResponseDataUrl? Type648 { get; set; } /// /// /// - public global::Together.FileDeleteResponse? Type649 { get; set; } + public global::Together.ImageResponseDataItemDiscriminator? Type649 { get; set; } /// /// /// - public global::Together.FinetuneResponse? Type650 { get; set; } + public global::Together.ImageResponseDataItemDiscriminatorType? Type650 { get; set; } /// /// /// - public global::System.Guid? Type651 { get; set; } + public global::Together.ImageResponseDataB64Type? Type651 { get; set; } /// /// /// - public global::Together.OneOf? Type652 { get; set; } + public global::Together.ImageResponseDataUrlType? Type652 { get; set; } /// /// /// - public global::Together.FinetuneResponseBatchSize? Type653 { get; set; } + public global::Together.JobInfoSuccessResponse? Type653 { get; set; } /// /// /// - public global::Together.LRScheduler? Type654 { get; set; } + public global::Together.JobInfoSuccessResponseStatus? Type654 { get; set; } /// /// /// - public global::Together.OneOf? Type655 { get; set; } + public global::System.Collections.Generic.IList? Type655 { get; set; } /// /// /// - public global::Together.FinetuneResponseTrainOnInputs? Type656 { get; set; } + public global::Together.JobInfoSuccessResponseStatusUpdate? Type656 { get; set; } /// /// /// - public global::Together.OneOf? Type657 { get; set; } + public global::Together.JobInfoSuccessResponseArgs? Type657 { get; set; } /// /// /// - public global::Together.TrainingMethodSFT? Type658 { get; set; } + public global::Together.JobsInfoSuccessResponse? Type658 { get; set; } /// /// /// - public global::Together.TrainingMethodDPO? Type659 { get; set; } + public global::System.Collections.Generic.IList? Type659 { get; set; } /// /// /// - public global::Together.OneOf? Type660 { get; set; } + public global::Together.ToolsPartFunction? Type660 { get; set; } /// /// /// - public global::Together.FullTrainingType? Type661 { get; set; } + public global::Together.ToolChoiceType? Type661 { get; set; } /// /// /// - public global::Together.LoRATrainingType? Type662 { get; set; } + public global::Together.ToolChoiceFunction? Type662 { get; set; } /// /// /// - public global::Together.MultimodalParams? Type663 { get; set; } + public global::Together.FileResponse? Type663 { get; set; } /// /// /// - public global::Together.FinetuneJobStatus? Type664 { get; set; } + public global::Together.FilePurpose? Type664 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type665 { get; set; } + public global::Together.FileType? Type665 { get; set; } /// /// /// - public global::Together.FineTuneEvent? Type666 { get; set; } + public global::Together.FileProcessingStatus? Type666 { get; set; } /// /// /// - public global::Together.FineTuneProgress? Type667 { get; set; } + public global::Together.FileValidationReport? Type667 { get; set; } /// /// /// - public global::Together.FinetuneResponseTruncated? Type668 { get; set; } + public global::Together.FileValidationReportErrorType? Type668 { get; set; } /// /// /// - public global::Together.FinetuneDeleteResponse? Type669 { get; set; } + public global::Together.FileList? Type669 { get; set; } /// /// /// - public global::Together.FineTunePreviewRequest? Type670 { get; set; } + public global::System.Collections.Generic.IList? Type670 { get; set; } /// /// /// - public global::Together.FineTunePreviewRequestTrainingMethod? Type671 { get; set; } + public global::Together.FileDeleteResponse? Type671 { get; set; } /// /// /// - public global::Together.FineTunePreviewResponse? Type672 { get; set; } + public global::Together.FinetuneResponse? Type672 { get; set; } /// /// /// - public global::Together.FineTunePreviewResponseDatasetFormat? Type673 { get; set; } + public global::System.Guid? Type673 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type674 { get; set; } + public global::Together.OneOf? Type674 { get; set; } /// /// /// - public global::Together.FineTunePreviewRow? Type675 { get; set; } + public global::Together.FinetuneResponseBatchSize? Type675 { get; set; } /// /// /// - public global::System.Collections.Generic.IList>? Type676 { get; set; } + public global::Together.LRScheduler? Type676 { get; set; } /// /// /// - public global::Together.FineTunePreviewMessageError? Type677 { get; set; } + public global::Together.OneOf? Type677 { get; set; } /// /// /// - public global::Together.FineTunePreviewDetailError? Type678 { get; set; } + public global::Together.FinetuneResponseTrainOnInputs? Type678 { get; set; } /// /// /// - public global::Together.FineTuneModelLimits? Type679 { get; set; } + public global::Together.OneOf? Type679 { get; set; } /// /// /// - public global::Together.FineTuneModelLimitsFullTraining? Type680 { get; set; } + public global::Together.TrainingMethodSFT? Type680 { get; set; } /// /// /// - public global::Together.FineTuneModelLimitsLoraTraining? Type681 { get; set; } + public global::Together.TrainingMethodDPO? Type681 { get; set; } /// /// /// - public global::Together.FinetuneEventLevels? Type682 { get; set; } + public global::Together.OneOf? Type682 { get; set; } /// /// /// - public global::Together.FinetuneEventType? Type683 { get; set; } + public global::Together.FullTrainingType? Type683 { get; set; } /// /// /// - public global::Together.FinetuneTruncatedList? Type684 { get; set; } + public global::Together.LoRATrainingType? Type684 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type685 { get; set; } + public global::Together.MultimodalParams? Type685 { get; set; } /// /// /// - public global::Together.FinetuneListEvents? Type686 { get; set; } + public global::Together.FinetuneJobStatus? Type686 { get; set; } /// /// /// - public global::Together.FineTuneTokenizedDatasetRetrieveResponse? Type687 { get; set; } + public global::System.Collections.Generic.IList? Type687 { get; set; } /// /// /// - public global::Together.FinetuneListCheckpoints? Type688 { get; set; } + public global::Together.FineTuneEvent? Type688 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type689 { get; set; } + public global::Together.FineTuneProgress? Type689 { get; set; } /// /// /// - public global::Together.FineTuneCheckpoint? Type690 { get; set; } + public global::Together.FinetuneResponseTruncated? Type690 { get; set; } /// /// /// - public global::Together.FineTuneCheckpointCheckpoint? Type691 { get; set; } + public global::Together.FinetuneDeleteResponse? Type691 { get; set; } /// /// /// - public global::Together.ShapingJobType? Type692 { get; set; } + public global::Together.FineTunePreviewRequest? Type692 { get; set; } /// /// /// - public global::Together.ShapingJobStatus? Type693 { get; set; } + public global::Together.FineTunePreviewRequestTrainingMethod? Type693 { get; set; } /// /// /// - public global::Together.EventLevel? Type694 { get; set; } + public global::Together.FineTunePreviewResponse? Type694 { get; set; } /// /// /// - public global::Together.BaseShapingJob? Type695 { get; set; } + public global::Together.FineTunePreviewResponseDatasetFormat? Type695 { get; set; } /// /// /// - public global::Together.QuantizationRequest? Type696 { get; set; } + public global::System.Collections.Generic.IList? Type696 { get; set; } /// /// /// - public global::Together.QuantizationPipelineInputs? Type697 { get; set; } + public global::Together.FineTunePreviewRow? Type697 { get; set; } /// /// /// - public global::Together.QuantizationEstimate? Type698 { get; set; } + public global::System.Collections.Generic.IList>? Type698 { get; set; } /// /// /// - public global::Together.QuantizationPipelineConfiguration? Type699 { get; set; } + public global::Together.FineTunePreviewMessageError? Type699 { get; set; } /// /// /// - public global::Together.QuantizationPipelineSpec? Type700 { get; set; } + public global::Together.FineTunePreviewDetailError? Type700 { get; set; } /// /// /// - public global::Together.QuantizationResults? Type701 { get; set; } + public global::Together.FineTuneModelLimits? Type701 { get; set; } /// /// /// - public global::Together.QuantizationJob? Type702 { get; set; } + public global::Together.FineTuneModelLimitsFullTraining? Type702 { get; set; } /// /// /// - public global::Together.QuantizationJobVariant2? Type703 { get; set; } + public global::Together.FineTuneModelLimitsLoraTraining? Type703 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type704 { get; set; } + public global::Together.FinetuneEventLevels? Type704 { get; set; } /// /// /// - public global::Together.QuantizationEvent? Type705 { get; set; } + public global::Together.FinetuneEventType? Type705 { get; set; } /// /// /// - public global::Together.BaseShapingEvent? Type706 { get; set; } + public global::Together.FinetuneTruncatedList? Type706 { get; set; } /// /// /// - public global::Together.QuantizationEventVariant2? Type707 { get; set; } + public global::System.Collections.Generic.IList? Type707 { get; set; } /// /// /// - public global::Together.QuantizationEventVariant2Type? Type708 { get; set; } + public global::Together.FinetuneListEvents? Type708 { get; set; } /// /// /// - public global::Together.EventsList? Type709 { get; set; } + public global::Together.FineTuneTokenizedDatasetRetrieveResponse? Type709 { get; set; } /// /// /// - public global::Together.ShapingJobsList? Type710 { get; set; } + public global::Together.FinetuneListCheckpoints? Type710 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type711 { get; set; } + public global::System.Collections.Generic.IList? Type711 { get; set; } /// /// /// - public global::Together.FullTrainingTypeType? Type712 { get; set; } + public global::Together.FineTuneCheckpoint? Type712 { get; set; } /// /// /// - public global::Together.LoRATrainingTypeType? Type713 { get; set; } + public global::Together.FineTuneCheckpointCheckpoint? Type713 { get; set; } /// /// /// - public global::Together.TrainingMethodSFTMethod? Type714 { get; set; } + public global::Together.ShapingJobType? Type714 { get; set; } /// /// /// - public global::Together.OneOf? Type715 { get; set; } + public global::Together.ShapingJobStatus? Type715 { get; set; } /// /// /// - public global::Together.TrainingMethodSFTTrainOnInputs? Type716 { get; set; } + public global::Together.EventLevel? Type716 { get; set; } /// /// /// - public global::Together.TrainingMethodDPOMethod? Type717 { get; set; } + public global::Together.BaseShapingJob? Type717 { get; set; } /// /// /// - public global::Together.LRSchedulerLrSchedulerType? Type718 { get; set; } + public global::Together.QuantizationRequest? Type718 { get; set; } /// /// /// - public global::Together.OneOf? Type719 { get; set; } + public global::Together.QuantizationPipelineInputs? Type719 { get; set; } /// /// /// - public global::Together.LinearLRSchedulerArgs? Type720 { get; set; } + public global::Together.QuantizationEstimate? Type720 { get; set; } /// /// /// - public global::Together.CosineLRSchedulerArgs? Type721 { get; set; } + public global::Together.QuantizationPipelineConfiguration? Type721 { get; set; } /// /// /// - public global::Together.CreateBatchRequest? Type722 { get; set; } + public global::Together.QuantizationPipelineSpec? Type722 { get; set; } /// /// /// - public global::Together.CreateBatchRequestEndpoint? Type723 { get; set; } + public global::Together.QuantizationResults? Type723 { get; set; } /// /// /// - public global::Together.BatchErrorResponse? Type724 { get; set; } + public global::Together.QuantizationJob? Type724 { get; set; } /// /// /// - public global::Together.BatchJobWithWarning? Type725 { get; set; } + public global::Together.QuantizationJobVariant2? Type725 { get; set; } /// /// /// - public global::Together.BatchJob? Type726 { get; set; } + public global::System.Collections.Generic.IList? Type726 { get; set; } /// /// /// - public global::Together.BatchJobStatus? Type727 { get; set; } + public global::Together.QuantizationEvent? Type727 { get; set; } /// /// /// - public global::Together.EvaluationTypedRequest? Type728 { get; set; } + public global::Together.BaseShapingEvent? Type728 { get; set; } /// /// /// - public global::Together.EvaluationTypedRequestType? Type729 { get; set; } + public global::Together.QuantizationEventVariant2? Type729 { get; set; } /// /// /// - public global::Together.OneOf? Type730 { get; set; } + public global::Together.QuantizationEventVariant2Type? Type730 { get; set; } /// /// /// - public global::Together.EvaluationClassifyParameters? Type731 { get; set; } + public global::Together.EventsList? Type731 { get; set; } /// /// /// - public global::Together.EvaluationScoreParameters? Type732 { get; set; } + public global::Together.ShapingJobsList? Type732 { get; set; } /// /// /// - public global::Together.EvaluationCompareParameters? Type733 { get; set; } + public global::System.Collections.Generic.IList? Type733 { get; set; } /// /// /// - public global::Together.EvaluationJudgeModelConfig? Type734 { get; set; } + public global::Together.FullTrainingTypeType? Type734 { get; set; } /// /// /// - public global::Together.EvaluationModelOrString? Type735 { get; set; } + public global::Together.LoRATrainingTypeType? Type735 { get; set; } /// /// /// - public global::Together.OneOf? Type736 { get; set; } + public global::Together.TrainingMethodSFTMethod? Type736 { get; set; } /// /// /// - public global::Together.EvaluationModelRequest? Type737 { get; set; } + public global::Together.OneOf? Type737 { get; set; } /// /// /// - public global::Together.EvaluationJudgeModelConfigModelSource? Type738 { get; set; } + public global::Together.TrainingMethodSFTTrainOnInputs? Type738 { get; set; } /// /// /// - public global::Together.EvaluationModelRequestModelSource? Type739 { get; set; } + public global::Together.TrainingMethodDPOMethod? Type739 { get; set; } /// /// /// - public global::Together.EvaluationResponse? Type740 { get; set; } + public global::Together.LRSchedulerLrSchedulerType? Type740 { get; set; } /// /// /// - public global::Together.EvaluationResponseStatus? Type741 { get; set; } + public global::Together.OneOf? Type741 { get; set; } /// /// /// - public global::Together.EvaluationJob? Type742 { get; set; } + public global::Together.LinearLRSchedulerArgs? Type742 { get; set; } /// /// /// - public global::Together.EvaluationJobType? Type743 { get; set; } + public global::Together.CosineLRSchedulerArgs? Type743 { get; set; } /// /// /// - public global::Together.EvaluationJobStatus? Type744 { get; set; } + public global::Together.Autoscaling? Type744 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type745 { get; set; } + public global::Together.HardwareSpec? Type745 { get; set; } /// /// /// - public global::Together.EvaluationJobStatusUpdate? Type746 { get; set; } + public global::Together.EndpointPricing? Type746 { get; set; } /// /// /// - public global::Together.OneOf? Type747 { get; set; } + public global::Together.HardwareAvailability? Type747 { get; set; } /// /// /// - public global::Together.EvaluationClassifyResults? Type748 { get; set; } + public global::Together.HardwareAvailabilityStatus? Type748 { get; set; } /// /// /// - public global::Together.EvaluationScoreResults? Type749 { get; set; } + public global::Together.HardwareWithStatus? Type749 { get; set; } /// /// /// - public global::Together.EvaluationCompareResults? Type750 { get; set; } + public global::Together.CreateEndpointRequest? Type750 { get; set; } /// /// /// - public global::Together.EvaluationJobResults? Type751 { get; set; } + public global::Together.CreateEndpointRequestState? Type751 { get; set; } /// /// /// - public global::Together.EvaluationScoreResultsAggregatedScores? Type752 { get; set; } + public global::Together.DedicatedEndpoint? Type752 { get; set; } /// /// /// - public global::Together.CreateVideoBody? Type753 { get; set; } + public global::Together.DedicatedEndpointType? Type753 { get; set; } /// /// /// - public global::Together.VideoOutputFormat? Type754 { get; set; } + public global::Together.DedicatedEndpointState? Type754 { get; set; } /// /// /// - public global::Together.VideoMedia? Type755 { get; set; } + public global::Together.ListEndpoint? Type755 { get; set; } /// /// /// - public global::Together.VideoStatus? Type756 { get; set; } + public global::Together.ListEndpointType? Type756 { get; set; } /// /// /// - public global::Together.VideoFrameImageInput? Type757 { get; set; } + public global::Together.ListEndpointState? Type757 { get; set; } /// /// /// - public global::Together.AnyOf? Type758 { get; set; } + public global::Together.DisplayorExecuteOutput? Type758 { get; set; } /// /// /// - public global::Together.VideoFrameImageInputFrame? Type759 { get; set; } + public global::Together.DisplayorExecuteOutputData? Type759 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type760 { get; set; } + public global::Together.DisplayorExecuteOutputType? Type760 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type761 { get; set; } + public global::Together.Error? Type761 { get; set; } /// /// /// - public global::Together.VideoRef? Type762 { get; set; } + public global::Together.ErrorOutput? Type762 { get; set; } /// /// /// - public global::Together.OneOf? Type763 { get; set; } + public global::Together.ErrorOutputType? Type763 { get; set; } /// /// /// - public global::System.Collections.Generic.IList>? Type764 { get; set; } + public global::Together.ExecuteRequest? Type764 { get; set; } /// /// /// - public global::Together.OneOf? Type765 { get; set; } + public global::System.Collections.Generic.IList? Type765 { get; set; } /// /// /// - public global::Together.AudioRef? Type766 { get; set; } + public global::Together.ExecuteRequestFile? Type766 { get; set; } /// /// /// - public global::Together.VideoJob? Type767 { get; set; } + public global::Together.ExecuteRequestFileEncoding? Type767 { get; set; } /// /// /// - public global::Together.VideoJobError? Type768 { get; set; } + public global::Together.ExecuteRequestLanguage? Type768 { get; set; } /// /// /// - public global::Together.VideoJobOutputs? Type769 { get; set; } + public global::Together.ExecuteResponse? Type769 { get; set; } /// /// /// - public global::Together.ContainerStatus? Type770 { get; set; } + public global::Together.ExecuteResponseSuccessfulExecution? Type770 { get; set; } /// /// /// - public global::Together.SignedURLResponse? Type771 { get; set; } + public global::Together.ExecuteResponseSuccessfulExecutionData? Type771 { get; set; } /// /// /// - public global::Together.CreateDeploymentRequest? Type772 { get; set; } + public global::System.Collections.Generic.IList? Type772 { get; set; } /// /// /// - public global::Together.OneOf? Type773 { get; set; } + public global::Together.OutputsItem? Type773 { get; set; } /// /// /// - public global::Together.HTTPAutoscalingConfig? Type774 { get; set; } + public global::Together.ExecuteResponseSuccessfulExecutionDataOutputStreamOutput? Type774 { get; set; } /// /// /// - public global::Together.QueueAutoscalingConfig? Type775 { get; set; } + public global::Together.ExecuteResponseSuccessfulExecutionDataOutputStreamOutputType? Type775 { get; set; } /// /// /// - public global::Together.CustomMetricAutoscalingConfig? Type776 { get; set; } + public global::Together.ExecuteResponseSuccessfulExecutionDataOutputErrorOutput? Type776 { get; set; } /// /// /// - public global::Together.CreateDeploymentRequestCapacityType? Type777 { get; set; } + public global::Together.ExecuteResponseSuccessfulExecutionDataOutputErrorOutputType? Type777 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type778 { get; set; } + public global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutput? Type778 { get; set; } /// /// /// - public global::Together.EnvironmentVariable? Type779 { get; set; } + public global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputData? Type779 { get; set; } /// /// /// - public global::Together.CreateDeploymentRequestGpuType? Type780 { get; set; } + public global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputType? Type780 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type781 { get; set; } + public global::Together.ExecuteResponseSuccessfulExecutionDataOutputDiscriminator? Type781 { get; set; } /// /// /// - public global::Together.ModelMount? Type782 { get; set; } + public global::Together.ExecuteResponseSuccessfulExecutionDataOutputDiscriminatorType? Type782 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type783 { get; set; } + public global::Together.ExecuteResponseSuccessfulExecutionDataStatus? Type783 { get; set; } /// /// /// - public global::Together.VolumeMount? Type784 { get; set; } + public global::Together.ExecuteResponseFailedExecution? Type784 { get; set; } /// /// /// - public global::Together.CreateSecretRequest? Type785 { get; set; } + public global::System.Collections.Generic.IList>? Type785 { get; set; } /// /// /// - public global::Together.CreateVolumeRequest? Type786 { get; set; } + public global::Together.OneOf? Type786 { get; set; } /// /// /// - public global::Together.VolumeContentRequest? Type787 { get; set; } + public global::Together.InterpreterOutput? Type787 { get; set; } /// /// /// - public global::Together.VolumeType? Type788 { get; set; } + public global::Together.InterpreterOutputStreamOutput? Type788 { get; set; } /// /// /// - public global::Together.DeploymentListResponse? Type789 { get; set; } + public global::Together.InterpreterOutputStreamOutputType? Type789 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type790 { get; set; } + public global::Together.InterpreterOutputErrorOutput? Type790 { get; set; } /// /// /// - public global::Together.DeploymentResponseItem? Type791 { get; set; } + public global::Together.InterpreterOutputErrorOutputType? Type791 { get; set; } /// /// /// - public global::Together.DeploymentLogs? Type792 { get; set; } + public global::Together.InterpreterOutputDisplayorExecuteOutput? Type792 { get; set; } /// /// /// - public global::Together.DeploymentResponseItemCapacityType? Type793 { get; set; } + public global::Together.InterpreterOutputDisplayorExecuteOutputData? Type793 { get; set; } /// /// /// - public global::Together.DeploymentResponseItemGpuType? Type794 { get; set; } + public global::Together.InterpreterOutputDisplayorExecuteOutputType? Type794 { get; set; } /// /// /// - public global::System.Collections.Generic.Dictionary? Type795 { get; set; } + public global::Together.InterpreterOutputDiscriminator? Type795 { get; set; } /// /// /// - public global::Together.ReplicaEvent? Type796 { get; set; } + public global::Together.InterpreterOutputDiscriminatorType? Type796 { get; set; } /// /// /// - public global::Together.DeploymentStatus? Type797 { get; set; } + public global::Together.Response? Type797 { get; set; } /// /// /// - public global::Together.RevisionDetailResponse? Type798 { get; set; } + public global::Together.SessionListResponse? Type798 { get; set; } /// /// /// - public global::Together.RevisionDetailResponseCapacityType? Type799 { get; set; } + public global::Together.SessionListResponseResponse? Type799 { get; set; } /// /// /// - public global::Together.RevisionEventItem? Type800 { get; set; } + public global::Together.SessionListResponseVariant2? Type800 { get; set; } /// /// /// - public global::Together.RevisionEventItemAction? Type801 { get; set; } + public global::Together.SessionListResponseVariant2Data? Type801 { get; set; } /// /// /// - public global::Together.RevisionEventListResponse? Type802 { get; set; } + public global::System.Collections.Generic.IList? Type802 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type803 { get; set; } + public global::Together.SessionListResponseVariant2DataSession? Type803 { get; set; } /// /// /// - public global::Together.RollbackDeploymentRequest? Type804 { get; set; } + public global::Together.StreamOutput? Type804 { get; set; } /// /// /// - public global::Together.HTTPAutoscalingConfigMetric? Type805 { get; set; } + public global::Together.StreamOutputType? Type805 { get; set; } /// /// /// - public global::Together.QueueAutoscalingConfigMetric? Type806 { get; set; } + public global::Together.CreateBatchRequest? Type806 { get; set; } /// /// /// - public global::Together.CustomMetricAutoscalingConfigMetric? Type807 { get; set; } + public global::Together.CreateBatchRequestEndpoint? Type807 { get; set; } /// /// /// - public global::Together.KubernetesEvent? Type808 { get; set; } + public global::Together.BatchErrorResponse? Type808 { get; set; } /// /// /// - public global::Together.ListSecretsResponse? Type809 { get; set; } + public global::Together.BatchJobWithWarning? Type809 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type810 { get; set; } + public global::Together.BatchJob? Type810 { get; set; } /// /// /// - public global::Together.SecretResponseItem? Type811 { get; set; } + public global::Together.BatchJobStatus? Type811 { get; set; } /// /// /// - public global::Together.ListVolumesResponse? Type812 { get; set; } + public global::Together.EvaluationTypedRequest? Type812 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type813 { get; set; } + public global::Together.EvaluationTypedRequestType? Type813 { get; set; } /// /// /// - public global::Together.VolumeResponseItem? Type814 { get; set; } + public global::Together.OneOf? Type814 { get; set; } /// /// /// - public global::Together.UpdateDeploymentRequest? Type815 { get; set; } + public global::Together.EvaluationClassifyParameters? Type815 { get; set; } /// /// /// - public global::Together.UpdateDeploymentRequestCapacityType? Type816 { get; set; } + public global::Together.EvaluationScoreParameters? Type816 { get; set; } /// /// /// - public global::Together.UpdateDeploymentRequestGpuType? Type817 { get; set; } + public global::Together.EvaluationCompareParameters? Type817 { get; set; } /// /// /// - public global::Together.UpdateSecretRequest? Type818 { get; set; } + public global::Together.EvaluationJudgeModelConfig? Type818 { get; set; } /// /// /// - public global::Together.UpdateVolumeRequest? Type819 { get; set; } + public global::Together.EvaluationModelOrString? Type819 { get; set; } /// /// /// - public global::Together.VolumeContent? Type820 { get; set; } + public global::Together.OneOf? Type820 { get; set; } /// /// /// - public global::Together.VolumeStatus? Type821 { get; set; } + public global::Together.EvaluationModelRequest? Type821 { get; set; } /// /// /// - public global::System.Collections.Generic.Dictionary? Type822 { get; set; } + public global::Together.EvaluationJudgeModelConfigModelSource? Type822 { get; set; } /// /// /// - public global::Together.VersionHistoryItem? Type823 { get; set; } + public global::Together.EvaluationModelRequestModelSource? Type823 { get; set; } /// /// /// - public global::Together.VolumeOrigin? Type824 { get; set; } + public global::Together.EvaluationResponse? Type824 { get; set; } /// /// /// - public global::Together.VolumeContentRequestType? Type825 { get; set; } + public global::Together.EvaluationResponseStatus? Type825 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type826 { get; set; } + public global::Together.EvaluationJob? Type826 { get; set; } /// /// /// - public global::Together.FileInfo? Type827 { get; set; } + public global::Together.EvaluationJobType? Type827 { get; set; } /// /// /// - public global::Together.VolumeContentType? Type828 { get; set; } + public global::Together.EvaluationJobStatus? Type828 { get; set; } /// /// /// - public global::Together.S3Origin? Type829 { get; set; } + public global::System.Collections.Generic.IList? Type829 { get; set; } /// /// /// - public global::Together.QueueError? Type830 { get; set; } + public global::Together.EvaluationJobStatusUpdate? Type830 { get; set; } /// /// /// - public global::Together.QueueMetricsResponse? Type831 { get; set; } + public global::Together.OneOf? Type831 { get; set; } /// /// /// - public global::Together.QueueCancelRequest? Type832 { get; set; } + public global::Together.EvaluationClassifyResults? Type832 { get; set; } /// /// /// - public global::Together.QueueCancelResponse? Type833 { get; set; } + public global::Together.EvaluationScoreResults? Type833 { get; set; } /// /// /// - public global::Together.QueueCancelResponseStatus? Type834 { get; set; } + public global::Together.EvaluationCompareResults? Type834 { get; set; } /// /// /// - public global::Together.QueueClearRequest? Type835 { get; set; } + public global::Together.EvaluationJobResults? Type835 { get; set; } /// /// /// - public global::Together.QueueClearResponse? Type836 { get; set; } + public global::Together.EvaluationScoreResultsAggregatedScores? Type836 { get; set; } /// /// /// - public global::Together.QueueJobRequest? Type837 { get; set; } + public global::Together.CreateVideoBody? Type837 { get; set; } /// /// /// - public global::Together.QueueJobResponse? Type838 { get; set; } + public global::Together.VideoOutputFormat? Type838 { get; set; } /// /// /// - public global::Together.QueueJobStatusResponse? Type839 { get; set; } + public global::Together.VideoMedia? Type839 { get; set; } /// /// /// - public global::Together.QueueJobStatusResponseStatus? Type840 { get; set; } + public global::System.Collections.Generic.IList? Type840 { get; set; } /// /// /// - public global::Together.WhoamiApiKey? Type841 { get; set; } + public global::Together.VideoFrameImageInput? Type841 { get; set; } /// /// /// - public global::Together.WhoamiOrganization? Type842 { get; set; } + public global::Together.VideoStatus? Type842 { get; set; } /// /// /// - public global::Together.WhoamiProject? Type843 { get; set; } + public global::Together.AnyOf? Type843 { get; set; } /// /// /// - public global::Together.WhoamiUser? Type844 { get; set; } + public global::Together.VideoFrameImageInputFrame? Type844 { get; set; } /// /// /// - public global::Together.WhoamiProjectApiKey? Type845 { get; set; } + public global::System.Collections.Generic.IList? Type845 { get; set; } /// /// /// - public global::Together.WhoamiProjectApiKeyType? Type846 { get; set; } + public global::Together.VideoRef? Type846 { get; set; } /// /// /// - public global::Together.WhoamiOrgApiKey? Type847 { get; set; } + public global::Together.OneOf? Type847 { get; set; } /// /// /// - public global::Together.WhoamiOrgApiKeyType? Type848 { get; set; } + public global::System.Collections.Generic.IList>? Type848 { get; set; } /// /// /// - public global::Together.WhoamiUserJwt? Type849 { get; set; } + public global::Together.OneOf? Type849 { get; set; } /// /// /// - public global::Together.WhoamiUserJwtType? Type850 { get; set; } + public global::Together.AudioRef? Type850 { get; set; } /// /// /// - public global::Together.WhoamiUserOrgJwt? Type851 { get; set; } + public global::Together.VideoJob? Type851 { get; set; } /// /// /// - public global::Together.WhoamiUserOrgJwtType? Type852 { get; set; } + public global::Together.VideoJobError? Type852 { get; set; } /// /// /// - public global::Together.WhoamiUserOrgProjectJwt? Type853 { get; set; } + public global::Together.VideoJobOutputs? Type853 { get; set; } /// /// /// - public global::Together.WhoamiUserOrgProjectJwtType? Type854 { get; set; } + public global::Together.ContainerStatus? Type854 { get; set; } /// /// /// - public global::Together.WhoamiResponse? Type855 { get; set; } + public global::Together.SignedURLResponse? Type855 { get; set; } /// /// /// - public global::Together.WhoamiResponseDiscriminator? Type856 { get; set; } + public global::Together.CreateDeploymentRequest? Type856 { get; set; } /// /// /// - public global::Together.WhoamiResponseDiscriminatorType? Type857 { get; set; } + public global::Together.OneOf? Type857 { get; set; } /// /// /// - public global::Together.Project? Type858 { get; set; } + public global::Together.HTTPAutoscalingConfig? Type858 { get; set; } /// /// /// - public global::Together.ListProjectsResponse? Type859 { get; set; } + public global::Together.QueueAutoscalingConfig? Type859 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type860 { get; set; } + public global::Together.CustomMetricAutoscalingConfig? Type860 { get; set; } /// /// /// - public global::Together.BillingUsageReport? Type861 { get; set; } + public global::Together.CreateDeploymentRequestCapacityType? Type861 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type862 { get; set; } + public global::System.Collections.Generic.IList? Type862 { get; set; } /// /// /// - public global::Together.BillingUsageWindow? Type863 { get; set; } + public global::Together.EnvironmentVariable? Type863 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type864 { get; set; } + public global::Together.CreateDeploymentRequestGpuType? Type864 { get; set; } /// /// /// - public global::Together.BillingUsageLineItem? Type865 { get; set; } + public global::System.Collections.Generic.IList? Type865 { get; set; } /// /// /// - public global::Together.CreateImagesGenerationsRequest? Type866 { get; set; } + public global::Together.ModelMount? Type866 { get; set; } /// /// /// - public global::Together.AnyOf? Type867 { get; set; } + public global::System.Collections.Generic.IList? Type867 { get; set; } /// /// /// - public global::Together.CreateImagesGenerationsRequestModel? Type868 { get; set; } + public global::Together.VolumeMount? Type868 { get; set; } /// /// /// - public global::Together.CreateImagesGenerationsRequestResponseFormat? Type869 { get; set; } + public global::Together.CreateSecretRequest? Type869 { get; set; } /// /// /// - public global::Together.CreateImagesGenerationsRequestOutputFormat? Type870 { get; set; } + public global::Together.CreateVolumeRequest? Type870 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type871 { get; set; } + public global::Together.VolumeContentRequest? Type871 { get; set; } /// /// /// - public global::Together.CreateImagesGenerationsRequestImageLora? Type872 { get; set; } + public global::Together.VolumeType? Type872 { get; set; } /// /// /// - public global::Together.CreateFilesUploadRequest? Type873 { get; set; } + public global::Together.DeploymentListResponse? Type873 { get; set; } /// /// /// - public global::Together.CreateFineTunesRequest? Type874 { get; set; } + public global::System.Collections.Generic.IList? Type874 { get; set; } /// /// /// - public global::Together.OneOf? Type875 { get; set; } + public global::Together.DeploymentResponseItem? Type875 { get; set; } /// /// /// - public global::Together.CreateFineTunesRequestBatchSize? Type876 { get; set; } + public global::Together.DeploymentLogs? Type876 { get; set; } /// /// /// - public global::Together.AnyOf? Type877 { get; set; } + public global::Together.DeploymentResponseItemCapacityType? Type877 { get; set; } /// /// /// - public global::Together.CreateFineTunesEstimatePriceRequest? Type878 { get; set; } + public global::Together.DeploymentResponseItemGpuType? Type878 { get; set; } /// /// /// - public global::Together.RolloutServiceListRolloutsFilter? Type879 { get; set; } + public global::System.Collections.Generic.Dictionary? Type879 { get; set; } /// /// /// - public global::Together.EndpointServiceListEndpointEventsMinLevel? Type880 { get; set; } + public global::Together.ReplicaEvent? Type880 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type881 { get; set; } + public global::Together.DeploymentStatus? Type881 { get; set; } /// /// /// - public global::Together.EndpointServiceListEndpointEventsSourceKind? Type882 { get; set; } + public global::Together.RevisionDetailResponse? Type882 { get; set; } /// /// /// - public global::Together.VolumeServiceListModelsVisibility? Type883 { get; set; } + public global::Together.RevisionDetailResponseCapacityType? Type883 { get; set; } /// /// /// - public global::Together.SupportedModelsServiceListSupportedModelsModality? Type884 { get; set; } + public global::Together.RevisionEventItem? Type884 { get; set; } /// /// /// - public global::Together.SupportedModelsServiceListSupportedModelsProduct? Type885 { get; set; } + public global::Together.RevisionEventItemAction? Type885 { get; set; } /// /// /// - public global::Together.SupportedModelsServiceListSupportedModelsAdapterMode? Type886 { get; set; } + public global::Together.RevisionEventListResponse? Type886 { get; set; } /// /// /// - public global::Together.GetFinetuneDownloadCheckpoint? Type887 { get; set; } + public global::System.Collections.Generic.IList? Type887 { get; set; } /// /// /// - public global::Together.RealtimeTtsModel? Type888 { get; set; } + public global::Together.RollbackDeploymentRequest? Type888 { get; set; } /// /// /// - public global::Together.RealtimeTranscriptionInputAudioFormat? Type889 { get; set; } + public global::Together.HTTPAutoscalingConfigMetric? Type889 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type890 { get; set; } + public global::Together.QueueAutoscalingConfigMetric? Type890 { get; set; } /// /// /// - public global::Together.ListModelResourcesStatu? Type891 { get; set; } + public global::Together.CustomMetricAutoscalingConfigMetric? Type891 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type892 { get; set; } + public global::Together.KubernetesEvent? Type892 { get; set; } /// /// /// - public global::Together.ListTrainingSessionsStatu? Type893 { get; set; } + public global::Together.ListSecretsResponse? Type893 { get; set; } /// /// /// - public global::Together.ListCheckpointsType? Type894 { get; set; } + public global::System.Collections.Generic.IList? Type894 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type895 { get; set; } + public global::Together.SecretResponseItem? Type895 { get; set; } /// /// /// - public global::Together.RemediationServiceListRemediationsStateItem? Type896 { get; set; } + public global::Together.ListVolumesResponse? Type896 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type897 { get; set; } + public global::System.Collections.Generic.IList? Type897 { get; set; } /// /// /// - public global::Together.RemediationServiceListRemediationsTriggerItem? Type898 { get; set; } + public global::Together.VolumeResponseItem? Type898 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type899 { get; set; } + public global::Together.UpdateDeploymentRequest? Type899 { get; set; } /// /// /// - public global::Together.RemediationServiceListRemediationsModeItem? Type900 { get; set; } + public global::Together.UpdateDeploymentRequestCapacityType? Type900 { get; set; } /// /// /// - public global::Together.HealthCheckServiceListPassiveHealthCheckAlertsStatus? Type901 { get; set; } + public global::Together.UpdateDeploymentRequestGpuType? Type901 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type902 { get; set; } + public global::Together.UpdateSecretRequest? Type902 { get; set; } /// /// /// - public global::Together.HealthCheckServiceListPassiveHealthCheckAlertsSeverityFilterItem? Type903 { get; set; } + public global::Together.UpdateVolumeRequest? Type903 { get; set; } /// /// /// - public global::Together.HealthCheckServiceListPassiveHealthCheckAlertsOrderBy? Type904 { get; set; } + public global::Together.VolumeContent? Type904 { get; set; } /// /// /// - public global::Together.GetBillingUsageGranularity? Type905 { get; set; } + public global::Together.VolumeStatus? Type905 { get; set; } /// /// /// - public global::Together.OneOf? Type906 { get; set; } + public global::System.Collections.Generic.Dictionary? Type906 { get; set; } /// /// /// - public global::Together.CreateFineTunesEstimatePriceResponseVariant1? Type907 { get; set; } + public global::Together.VersionHistoryItem? Type907 { get; set; } /// /// /// - public global::Together.CreateFineTunesEstimatePriceResponseVariant2? Type908 { get; set; } + public global::Together.VolumeOrigin? Type908 { get; set; } /// /// /// - public global::Together.CreateFineTunesEstimatePriceResponseVariant2UnavailableReason? Type909 { get; set; } + public global::Together.VolumeContentRequestType? Type909 { get; set; } /// /// /// - public global::Together.OneOf? Type910 { get; set; } + public global::System.Collections.Generic.IList? Type910 { get; set; } /// /// /// - public global::Together.GetFineTunesMetricsResponse? Type911 { get; set; } + public global::Together.FileInfo? Type911 { get; set; } /// /// /// - public global::System.Collections.Generic.IList>? Type912 { get; set; } + public global::Together.VolumeContentType? Type912 { get; set; } /// /// /// - public global::Together.GetFineTunesModelsSupportedResponse? Type913 { get; set; } + public global::Together.S3Origin? Type913 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type914 { get; set; } + public global::Together.QueueError? Type914 { get; set; } /// /// /// - public global::Together.GetFineTunesModelsSupportedResponseDetailedModel? Type915 { get; set; } + public global::Together.QueueMetricsResponse? Type915 { get; set; } /// /// /// - public global::Together.GetFineTunesModelsLimitsResponse? Type916 { get; set; } + public global::Together.QueueCancelRequest? Type916 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type917 { get; set; } + public global::Together.QueueCancelResponse? Type917 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type918 { get; set; } + public global::Together.QueueCancelResponseStatus? Type918 { get; set; } /// /// /// - public global::Together.GetModelListResponse? Type919 { get; set; } + public global::Together.QueueClearRequest? Type919 { get; set; } /// /// /// - public global::Together.GetEvaluationJobStatusAndResultsResponse? Type920 { get; set; } + public global::Together.QueueClearResponse? Type920 { get; set; } /// /// /// - public global::Together.GetEvaluationJobStatusAndResultsResponseStatus? Type921 { get; set; } + public global::Together.QueueJobRequest? Type921 { get; set; } /// /// /// - public global::Together.OneOf? Type922 { get; set; } + public global::Together.QueueJobResponse? Type922 { get; set; } + /// + /// + /// + public global::Together.QueueJobStatusResponse? Type923 { get; set; } + /// + /// + /// + public global::Together.QueueJobStatusResponseStatus? Type924 { get; set; } + /// + /// + /// + public global::Together.WhoamiResponse? Type925 { get; set; } + /// + /// + /// + public global::Together.Project? Type926 { get; set; } + /// + /// + /// + public global::Together.ListProjectsResponse? Type927 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type928 { get; set; } + /// + /// + /// + public global::Together.BillingUsageReport? Type929 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type930 { get; set; } + /// + /// + /// + public global::Together.BillingUsageWindow? Type931 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type932 { get; set; } + /// + /// + /// + public global::Together.BillingUsageLineItem? Type933 { get; set; } + /// + /// + /// + public global::Together.CreateImagesGenerationsRequest? Type934 { get; set; } + /// + /// + /// + public global::Together.AnyOf? Type935 { get; set; } + /// + /// + /// + public global::Together.CreateImagesGenerationsRequestModel? Type936 { get; set; } + /// + /// + /// + public global::Together.CreateImagesGenerationsRequestResponseFormat? Type937 { get; set; } + /// + /// + /// + public global::Together.CreateImagesGenerationsRequestOutputFormat? Type938 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type939 { get; set; } + /// + /// + /// + public global::Together.CreateImagesGenerationsRequestImageLora? Type940 { get; set; } + /// + /// + /// + public global::Together.CreateFilesUploadRequest? Type941 { get; set; } + /// + /// + /// + public global::Together.CreateFineTunesRequest? Type942 { get; set; } + /// + /// + /// + public global::Together.OneOf? Type943 { get; set; } + /// + /// + /// + public global::Together.CreateFineTunesRequestBatchSize? Type944 { get; set; } + /// + /// + /// + public global::Together.OneOf? Type945 { get; set; } + /// + /// + /// + public global::Together.CreateFineTunesRequestTrainOnInputs? Type946 { get; set; } + /// + /// + /// + public global::Together.AnyOf? Type947 { get; set; } + /// + /// + /// + public global::Together.CreateFineTunesEstimatePriceRequest? Type948 { get; set; } + /// + /// + /// + public global::Together.UpdateEndpointRequest? Type949 { get; set; } + /// + /// + /// + public global::Together.UpdateEndpointRequestState? Type950 { get; set; } + /// + /// + /// + public global::Together.AddAdapterRequest? Type951 { get; set; } + /// + /// + /// + public global::Together.RemoveAdapterRequest? Type952 { get; set; } + /// + /// + /// + public global::Together.RolloutServiceListRolloutsFilter? Type953 { get; set; } + /// + /// + /// + public global::Together.EndpointServiceListEndpointEventsMinLevel? Type954 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type955 { get; set; } + /// + /// + /// + public global::Together.EndpointServiceListEndpointEventsSourceKind? Type956 { get; set; } + /// + /// + /// + public global::Together.VolumeServiceListModelsVisibility? Type957 { get; set; } + /// + /// + /// + public global::Together.SupportedModelsServiceListSupportedModelsModality? Type958 { get; set; } + /// + /// + /// + public global::Together.SupportedModelsServiceListSupportedModelsProduct? Type959 { get; set; } + /// + /// + /// + public global::Together.SupportedModelsServiceListSupportedModelsAdapterMode? Type960 { get; set; } + /// + /// + /// + public global::Together.GetFinetuneDownloadCheckpoint? Type961 { get; set; } + /// + /// + /// + public global::Together.RealtimeTtsModel? Type962 { get; set; } + /// + /// + /// + public global::Together.ListEndpointsType? Type963 { get; set; } + /// + /// + /// + public global::Together.ListEndpointsUsageType? Type964 { get; set; } + /// + /// + /// + public global::Together.RealtimeTranscriptionInputAudioFormat? Type965 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type966 { get; set; } + /// + /// + /// + public global::Together.ListModelResourcesStatu? Type967 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type968 { get; set; } + /// + /// + /// + public global::Together.ListTrainingSessionsStatu? Type969 { get; set; } + /// + /// + /// + public global::Together.ListCheckpointsType? Type970 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type971 { get; set; } + /// + /// + /// + public global::Together.RemediationServiceListRemediationsStateItem? Type972 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type973 { get; set; } + /// + /// + /// + public global::Together.RemediationServiceListRemediationsTriggerItem? Type974 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type975 { get; set; } + /// + /// + /// + public global::Together.RemediationServiceListRemediationsModeItem? Type976 { get; set; } + /// + /// + /// + public global::Together.HealthCheckServiceListPassiveHealthCheckAlertsStatus? Type977 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type978 { get; set; } + /// + /// + /// + public global::Together.HealthCheckServiceListPassiveHealthCheckAlertsSeverityFilterItem? Type979 { get; set; } + /// + /// + /// + public global::Together.HealthCheckServiceListPassiveHealthCheckAlertsOrderBy? Type980 { get; set; } + /// + /// + /// + public global::Together.GetBillingUsageGranularity? Type981 { get; set; } + /// + /// + /// + public global::Together.OneOf? Type982 { get; set; } + /// + /// + /// + public global::Together.CreateFineTunesEstimatePriceResponseVariant1? Type983 { get; set; } + /// + /// + /// + public global::Together.CreateFineTunesEstimatePriceResponseVariant2? Type984 { get; set; } + /// + /// + /// + public global::Together.CreateFineTunesEstimatePriceResponseVariant2UnavailableReason? Type985 { get; set; } + /// + /// + /// + public global::Together.OneOf? Type986 { get; set; } + /// + /// + /// + public global::Together.GetFineTunesMetricsResponse? Type987 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList>? Type988 { get; set; } + /// + /// + /// + public global::Together.GetFineTunesModelsSupportedResponse? Type989 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type990 { get; set; } + /// + /// + /// + public global::Together.GetFineTunesModelsSupportedResponseDetailedModel? Type991 { get; set; } + /// + /// + /// + public global::Together.GetFineTunesModelsLimitsResponse? Type992 { get; set; } + /// + /// + /// + public global::Together.ListEndpointsResponse? Type993 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type994 { get; set; } + /// + /// + /// + public global::Together.AddAdapterResponse? Type995 { get; set; } + /// + /// + /// + public global::Together.ListAdaptersResponse? Type996 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type997 { get; set; } + /// + /// + /// + public global::Together.ListAdaptersResponseDataItem? Type998 { get; set; } + /// + /// + /// + public global::Together.RemoveAdapterResponse? Type999 { get; set; } + /// + /// + /// + public global::Together.ListHardwareResponse? Type1000 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type1001 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type1002 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type1003 { get; set; } + /// + /// + /// + public global::Together.GetModelListResponse? Type1004 { get; set; } + /// + /// + /// + public global::Together.GetEvaluationJobStatusAndResultsResponse? Type1005 { get; set; } + /// + /// + /// + public global::Together.GetEvaluationJobStatusAndResultsResponseStatus? Type1006 { get; set; } + /// + /// + /// + public global::Together.OneOf? Type1007 { get; set; } /// /// @@ -4166,146 +4506,186 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::System.Collections.Generic.List? ListType110 { get; set; } + public global::System.Collections.Generic.List? ListType110 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType111 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType112 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType113 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType114 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType115 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType116 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List>? ListType117 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType118 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType119 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType120 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType111 { get; set; } + public global::System.Collections.Generic.List? ListType121 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType112 { get; set; } + public global::System.Collections.Generic.List? ListType122 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType113 { get; set; } + public global::System.Collections.Generic.List? ListType123 { get; set; } /// /// /// - public global::System.Collections.Generic.List>? ListType114 { get; set; } + public global::System.Collections.Generic.List>? ListType124 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType115 { get; set; } + public global::System.Collections.Generic.List? ListType125 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType116 { get; set; } + public global::System.Collections.Generic.List? ListType126 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType117 { get; set; } + public global::System.Collections.Generic.List? ListType127 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType118 { get; set; } + public global::System.Collections.Generic.List? ListType128 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType119 { get; set; } + public global::System.Collections.Generic.List>? ListType129 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType120 { get; set; } + public global::System.Collections.Generic.List? ListType130 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType121 { get; set; } + public global::System.Collections.Generic.List? ListType131 { get; set; } /// /// /// - public global::System.Collections.Generic.List>? ListType122 { get; set; } + public global::System.Collections.Generic.List? ListType132 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType123 { get; set; } + public global::System.Collections.Generic.List? ListType133 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType124 { get; set; } + public global::System.Collections.Generic.List? ListType134 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType125 { get; set; } + public global::System.Collections.Generic.List? ListType135 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType126 { get; set; } + public global::System.Collections.Generic.List? ListType136 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType127 { get; set; } + public global::System.Collections.Generic.List? ListType137 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType128 { get; set; } + public global::System.Collections.Generic.List? ListType138 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType129 { get; set; } + public global::System.Collections.Generic.List? ListType139 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType130 { get; set; } + public global::System.Collections.Generic.List? ListType140 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType131 { get; set; } + public global::System.Collections.Generic.List? ListType141 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType132 { get; set; } + public global::System.Collections.Generic.List? ListType142 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType133 { get; set; } + public global::System.Collections.Generic.List? ListType143 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType134 { get; set; } + public global::System.Collections.Generic.List? ListType144 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType135 { get; set; } + public global::System.Collections.Generic.List? ListType145 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType136 { get; set; } + public global::System.Collections.Generic.List? ListType146 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType137 { get; set; } + public global::System.Collections.Generic.List? ListType147 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType138 { get; set; } + public global::System.Collections.Generic.List? ListType148 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType139 { get; set; } + public global::System.Collections.Generic.List>? ListType149 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType140 { get; set; } + public global::System.Collections.Generic.List? ListType150 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType141 { get; set; } + public global::System.Collections.Generic.List? ListType151 { get; set; } /// /// /// - public global::System.Collections.Generic.List>? ListType142 { get; set; } + public global::System.Collections.Generic.List? ListType152 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType143 { get; set; } + public global::System.Collections.Generic.List? ListType153 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType144 { get; set; } + public global::System.Collections.Generic.List? ListType154 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType145 { get; set; } + public global::System.Collections.Generic.List? ListType155 { get; set; } } } \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.AddAdapterRequest.Json.g.cs b/src/libs/Together/Generated/Together.Models.AddAdapterRequest.Json.g.cs new file mode 100644 index 00000000..4566c4dd --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.AddAdapterRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class AddAdapterRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + 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); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.AddAdapterRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.AddAdapterRequest), + jsonSerializerContext) as global::Together.AddAdapterRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.AddAdapterRequest? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.AddAdapterRequest? FromJson( + 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); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.AddAdapterRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.AddAdapterRequest; + } + + /// + /// 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.Models.AddAdapterRequest.g.cs b/src/libs/Together/Generated/Together.Models.AddAdapterRequest.g.cs new file mode 100644 index 00000000..9af5cf16 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.AddAdapterRequest.g.cs @@ -0,0 +1,50 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class AddAdapterRequest + { + /// + /// Combined identifier in format "endpoint_name:adapter_model_name".
+ /// Example: username/Meta-Llama-3.1-8B-Instruct-def456:username/my-adapter-abc123 + ///
+ /// username/Meta-Llama-3.1-8B-Instruct-def456:username/my-adapter-abc123 + [global::System.Text.Json.Serialization.JsonPropertyName("model_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string ModelId { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Combined identifier in format "endpoint_name:adapter_model_name".
+ /// Example: username/Meta-Llama-3.1-8B-Instruct-def456:username/my-adapter-abc123 + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public AddAdapterRequest( + string modelId) + { + this.ModelId = modelId ?? throw new global::System.ArgumentNullException(nameof(modelId)); + } + + /// + /// Initializes a new instance of the class. + /// + public AddAdapterRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.WhoamiOrganization.Json.g.cs b/src/libs/Together/Generated/Together.Models.AddAdapterResponse.Json.g.cs similarity index 88% rename from src/libs/Together/Generated/Together.Models.WhoamiOrganization.Json.g.cs rename to src/libs/Together/Generated/Together.Models.AddAdapterResponse.Json.g.cs index d0a0b993..c98e9ff3 100644 --- a/src/libs/Together/Generated/Together.Models.WhoamiOrganization.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.AddAdapterResponse.Json.g.cs @@ -2,7 +2,7 @@ namespace Together { - public sealed partial class WhoamiOrganization + public sealed partial class AddAdapterResponse { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -47,20 +47,20 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::Together.WhoamiOrganization? FromJson( + public static global::Together.AddAdapterResponse? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::Together.WhoamiOrganization), - jsonSerializerContext) as global::Together.WhoamiOrganization; + typeof(global::Together.AddAdapterResponse), + jsonSerializerContext) as global::Together.AddAdapterResponse; } /// /// Deserializes a JSON string using the generated default JsonSerializerContext. /// - public static global::Together.WhoamiOrganization? FromJson( + public static global::Together.AddAdapterResponse? FromJson( string json) { return FromJson( @@ -75,7 +75,7 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::Together.WhoamiOrganization? FromJson( + public static global::Together.AddAdapterResponse? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -86,7 +86,7 @@ public string ToJson( global::Together.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -94,20 +94,20 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, - typeof(global::Together.WhoamiOrganization), - jsonSerializerContext).ConfigureAwait(false)) as global::Together.WhoamiOrganization; + typeof(global::Together.AddAdapterResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.AddAdapterResponse; } /// /// Deserializes a JSON stream using the generated default JsonSerializerContext. /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream) { return FromJsonStreamAsync( @@ -122,7 +122,7 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -133,7 +133,7 @@ public string ToJson( global::Together.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.DeserializeAsync( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/Together/Generated/Together.Models.AddAdapterResponse.g.cs b/src/libs/Together/Generated/Together.Models.AddAdapterResponse.g.cs new file mode 100644 index 00000000..c34ea295 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.AddAdapterResponse.g.cs @@ -0,0 +1,44 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class AddAdapterResponse + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("model_id")] + public string? ModelId { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public AddAdapterResponse( + string? modelId) + { + this.ModelId = modelId; + } + + /// + /// Initializes a new instance of the class. + /// + public AddAdapterResponse() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.WhoamiApiKey.Json.g.cs b/src/libs/Together/Generated/Together.Models.Autoscaling.Json.g.cs similarity index 89% rename from src/libs/Together/Generated/Together.Models.WhoamiApiKey.Json.g.cs rename to src/libs/Together/Generated/Together.Models.Autoscaling.Json.g.cs index fc130570..4c1f1e22 100644 --- a/src/libs/Together/Generated/Together.Models.WhoamiApiKey.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.Autoscaling.Json.g.cs @@ -2,7 +2,7 @@ namespace Together { - public sealed partial class WhoamiApiKey + public sealed partial class Autoscaling { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -47,20 +47,20 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::Together.WhoamiApiKey? FromJson( + public static global::Together.Autoscaling? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::Together.WhoamiApiKey), - jsonSerializerContext) as global::Together.WhoamiApiKey; + typeof(global::Together.Autoscaling), + jsonSerializerContext) as global::Together.Autoscaling; } /// /// Deserializes a JSON string using the generated default JsonSerializerContext. /// - public static global::Together.WhoamiApiKey? FromJson( + public static global::Together.Autoscaling? FromJson( string json) { return FromJson( @@ -75,7 +75,7 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::Together.WhoamiApiKey? FromJson( + public static global::Together.Autoscaling? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -86,7 +86,7 @@ public string ToJson( global::Together.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -94,20 +94,20 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, - typeof(global::Together.WhoamiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::Together.WhoamiApiKey; + typeof(global::Together.Autoscaling), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.Autoscaling; } /// /// Deserializes a JSON stream using the generated default JsonSerializerContext. /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream) { return FromJsonStreamAsync( @@ -122,7 +122,7 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -133,7 +133,7 @@ public string ToJson( global::Together.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.DeserializeAsync( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/Together/Generated/Together.Models.Autoscaling.g.cs b/src/libs/Together/Generated/Together.Models.Autoscaling.g.cs new file mode 100644 index 00000000..3966eb7b --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.Autoscaling.g.cs @@ -0,0 +1,59 @@ + +#nullable enable + +namespace Together +{ + /// + /// Configuration for automatic scaling of replicas based on demand. + /// + public sealed partial class Autoscaling + { + /// + /// The minimum number of replicas to maintain, even when there is no load + /// + [global::System.Text.Json.Serialization.JsonPropertyName("min_replicas")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int MinReplicas { get; set; } + + /// + /// The maximum number of replicas to scale up to under load + /// + [global::System.Text.Json.Serialization.JsonPropertyName("max_replicas")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int MaxReplicas { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The minimum number of replicas to maintain, even when there is no load + /// + /// + /// The maximum number of replicas to scale up to under load + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public Autoscaling( + int minReplicas, + int maxReplicas) + { + this.MinReplicas = minReplicas; + this.MaxReplicas = maxReplicas; + } + + /// + /// Initializes a new instance of the class. + /// + public Autoscaling() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.ChatCompletionAssistantMessageParam.g.cs b/src/libs/Together/Generated/Together.Models.ChatCompletionAssistantMessageParam.g.cs index 17b2b118..264c16a5 100644 --- a/src/libs/Together/Generated/Together.Models.ChatCompletionAssistantMessageParam.g.cs +++ b/src/libs/Together/Generated/Together.Models.ChatCompletionAssistantMessageParam.g.cs @@ -1,4 +1,6 @@ +#pragma warning disable CS0618 // Type or member is obsolete + #nullable enable namespace Together @@ -33,6 +35,13 @@ public sealed partial class ChatCompletionAssistantMessageParam [global::System.Text.Json.Serialization.JsonPropertyName("tool_calls")] public global::System.Collections.Generic.IList? ToolCalls { get; set; } + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("function_call")] + [global::System.Obsolete("This property marked as deprecated.")] + public global::Together.ChatCompletionAssistantMessageParamFunctionCall? FunctionCall { get; set; } + /// /// /// diff --git a/src/libs/Together/Generated/Together.Models.ChatCompletionAssistantMessageParamFunctionCall.Json.g.cs b/src/libs/Together/Generated/Together.Models.ChatCompletionAssistantMessageParamFunctionCall.Json.g.cs new file mode 100644 index 00000000..86884774 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ChatCompletionAssistantMessageParamFunctionCall.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class ChatCompletionAssistantMessageParamFunctionCall + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + 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); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.ChatCompletionAssistantMessageParamFunctionCall? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.ChatCompletionAssistantMessageParamFunctionCall), + jsonSerializerContext) as global::Together.ChatCompletionAssistantMessageParamFunctionCall; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ChatCompletionAssistantMessageParamFunctionCall? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.ChatCompletionAssistantMessageParamFunctionCall? FromJson( + 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); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.ChatCompletionAssistantMessageParamFunctionCall), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.ChatCompletionAssistantMessageParamFunctionCall; + } + + /// + /// 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.Models.ChatCompletionAssistantMessageParamFunctionCall.g.cs b/src/libs/Together/Generated/Together.Models.ChatCompletionAssistantMessageParamFunctionCall.g.cs new file mode 100644 index 00000000..1b17106c --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ChatCompletionAssistantMessageParamFunctionCall.g.cs @@ -0,0 +1,58 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + [global::System.Obsolete("This model marked as deprecated.")] + public sealed partial class ChatCompletionAssistantMessageParamFunctionCall + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("arguments")] + [global::System.Text.Json.Serialization.JsonRequired] + [global::System.Obsolete("This property marked as deprecated.")] + public required string Arguments { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + [global::System.Text.Json.Serialization.JsonRequired] + [global::System.Obsolete("This property marked as deprecated.")] + public required string Name { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ChatCompletionAssistantMessageParamFunctionCall( + string arguments, + string name) + { + this.Arguments = arguments ?? throw new global::System.ArgumentNullException(nameof(arguments)); + this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); + } + + /// + /// Initializes a new instance of the class. + /// + public ChatCompletionAssistantMessageParamFunctionCall() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.ChatCompletionChoiceDelta.g.cs b/src/libs/Together/Generated/Together.Models.ChatCompletionChoiceDelta.g.cs index d25a9a38..9e74170a 100644 --- a/src/libs/Together/Generated/Together.Models.ChatCompletionChoiceDelta.g.cs +++ b/src/libs/Together/Generated/Together.Models.ChatCompletionChoiceDelta.g.cs @@ -1,4 +1,6 @@ +#pragma warning disable CS0618 // Type or member is obsolete + #nullable enable namespace Together @@ -34,6 +36,13 @@ public sealed partial class ChatCompletionChoiceDelta [global::System.Text.Json.Serialization.JsonPropertyName("tool_calls")] public global::System.Collections.Generic.IList? ToolCalls { get; set; } + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("function_call")] + [global::System.Obsolete("This property marked as deprecated.")] + public global::Together.ChatCompletionChoiceDeltaFunctionCall? FunctionCall { get; set; } + /// /// /// diff --git a/src/libs/Together/Generated/Together.Models.ChatCompletionChoiceDeltaFunctionCall.Json.g.cs b/src/libs/Together/Generated/Together.Models.ChatCompletionChoiceDeltaFunctionCall.Json.g.cs new file mode 100644 index 00000000..5ee63b31 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ChatCompletionChoiceDeltaFunctionCall.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class ChatCompletionChoiceDeltaFunctionCall + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + 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); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.ChatCompletionChoiceDeltaFunctionCall? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.ChatCompletionChoiceDeltaFunctionCall), + jsonSerializerContext) as global::Together.ChatCompletionChoiceDeltaFunctionCall; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ChatCompletionChoiceDeltaFunctionCall? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.ChatCompletionChoiceDeltaFunctionCall? FromJson( + 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); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.ChatCompletionChoiceDeltaFunctionCall), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.ChatCompletionChoiceDeltaFunctionCall; + } + + /// + /// 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.Models.ChatCompletionChoiceDeltaFunctionCall.g.cs b/src/libs/Together/Generated/Together.Models.ChatCompletionChoiceDeltaFunctionCall.g.cs new file mode 100644 index 00000000..cd24afe4 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ChatCompletionChoiceDeltaFunctionCall.g.cs @@ -0,0 +1,58 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + [global::System.Obsolete("This model marked as deprecated.")] + public sealed partial class ChatCompletionChoiceDeltaFunctionCall + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("arguments")] + [global::System.Text.Json.Serialization.JsonRequired] + [global::System.Obsolete("This property marked as deprecated.")] + public required string Arguments { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + [global::System.Text.Json.Serialization.JsonRequired] + [global::System.Obsolete("This property marked as deprecated.")] + public required string Name { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ChatCompletionChoiceDeltaFunctionCall( + string arguments, + string name) + { + this.Arguments = arguments ?? throw new global::System.ArgumentNullException(nameof(arguments)); + this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); + } + + /// + /// Initializes a new instance of the class. + /// + public ChatCompletionChoiceDeltaFunctionCall() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.ChatCompletionChunkChoiceDelta.g.cs b/src/libs/Together/Generated/Together.Models.ChatCompletionChunkChoiceDelta.g.cs index 694b3542..eacede07 100644 --- a/src/libs/Together/Generated/Together.Models.ChatCompletionChunkChoiceDelta.g.cs +++ b/src/libs/Together/Generated/Together.Models.ChatCompletionChunkChoiceDelta.g.cs @@ -1,4 +1,6 @@ +#pragma warning disable CS0618 // Type or member is obsolete + #nullable enable namespace Together @@ -46,6 +48,13 @@ public sealed partial class ChatCompletionChunkChoiceDelta [global::System.Text.Json.Serialization.JsonPropertyName("tool_calls")] public global::System.Collections.Generic.IList? ToolCalls { get; set; } + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("function_call")] + [global::System.Obsolete("This property marked as deprecated.")] + public global::Together.ChatCompletionChunkChoiceDeltaFunctionCall? FunctionCall { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// diff --git a/src/libs/Together/Generated/Together.Models.ChatCompletionChunkChoiceDeltaFunctionCall.Json.g.cs b/src/libs/Together/Generated/Together.Models.ChatCompletionChunkChoiceDeltaFunctionCall.Json.g.cs new file mode 100644 index 00000000..cfa7454e --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ChatCompletionChunkChoiceDeltaFunctionCall.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class ChatCompletionChunkChoiceDeltaFunctionCall + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + 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); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.ChatCompletionChunkChoiceDeltaFunctionCall? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.ChatCompletionChunkChoiceDeltaFunctionCall), + jsonSerializerContext) as global::Together.ChatCompletionChunkChoiceDeltaFunctionCall; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ChatCompletionChunkChoiceDeltaFunctionCall? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.ChatCompletionChunkChoiceDeltaFunctionCall? FromJson( + 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); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.ChatCompletionChunkChoiceDeltaFunctionCall), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.ChatCompletionChunkChoiceDeltaFunctionCall; + } + + /// + /// 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.Models.ChatCompletionChunkChoiceDeltaFunctionCall.g.cs b/src/libs/Together/Generated/Together.Models.ChatCompletionChunkChoiceDeltaFunctionCall.g.cs new file mode 100644 index 00000000..6f3c210b --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ChatCompletionChunkChoiceDeltaFunctionCall.g.cs @@ -0,0 +1,58 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + [global::System.Obsolete("This model marked as deprecated.")] + public sealed partial class ChatCompletionChunkChoiceDeltaFunctionCall + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("arguments")] + [global::System.Text.Json.Serialization.JsonRequired] + [global::System.Obsolete("This property marked as deprecated.")] + public required string Arguments { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + [global::System.Text.Json.Serialization.JsonRequired] + [global::System.Obsolete("This property marked as deprecated.")] + public required string Name { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ChatCompletionChunkChoiceDeltaFunctionCall( + string arguments, + string name) + { + this.Arguments = arguments ?? throw new global::System.ArgumentNullException(nameof(arguments)); + this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); + } + + /// + /// Initializes a new instance of the class. + /// + public ChatCompletionChunkChoiceDeltaFunctionCall() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.ChatCompletionFunctionMessageParam.Json.g.cs b/src/libs/Together/Generated/Together.Models.ChatCompletionFunctionMessageParam.Json.g.cs new file mode 100644 index 00000000..85e4963b --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ChatCompletionFunctionMessageParam.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class ChatCompletionFunctionMessageParam + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + 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); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.ChatCompletionFunctionMessageParam? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.ChatCompletionFunctionMessageParam), + jsonSerializerContext) as global::Together.ChatCompletionFunctionMessageParam; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ChatCompletionFunctionMessageParam? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.ChatCompletionFunctionMessageParam? FromJson( + 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); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.ChatCompletionFunctionMessageParam), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.ChatCompletionFunctionMessageParam; + } + + /// + /// 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.Models.ChatCompletionFunctionMessageParam.g.cs b/src/libs/Together/Generated/Together.Models.ChatCompletionFunctionMessageParam.g.cs new file mode 100644 index 00000000..5947807f --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ChatCompletionFunctionMessageParam.g.cs @@ -0,0 +1,69 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + [global::System.Obsolete("This model marked as deprecated.")] + public sealed partial class ChatCompletionFunctionMessageParam + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("role")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.ChatCompletionFunctionMessageParamRoleJsonConverter))] + [global::System.Obsolete("This property marked as deprecated.")] + public global::Together.ChatCompletionFunctionMessageParamRole Role { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("content")] + [global::System.Text.Json.Serialization.JsonRequired] + [global::System.Obsolete("This property marked as deprecated.")] + public required string Content { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + [global::System.Text.Json.Serialization.JsonRequired] + [global::System.Obsolete("This property marked as deprecated.")] + public required string Name { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ChatCompletionFunctionMessageParam( + string content, + string name, + global::Together.ChatCompletionFunctionMessageParamRole role) + { + this.Role = role; + this.Content = content ?? throw new global::System.ArgumentNullException(nameof(content)); + this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); + } + + /// + /// Initializes a new instance of the class. + /// + public ChatCompletionFunctionMessageParam() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.ChatCompletionFunctionMessageParamRole.g.cs b/src/libs/Together/Generated/Together.Models.ChatCompletionFunctionMessageParamRole.g.cs new file mode 100644 index 00000000..a63cbfb4 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ChatCompletionFunctionMessageParamRole.g.cs @@ -0,0 +1,45 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public enum ChatCompletionFunctionMessageParamRole + { + /// + /// + /// + Function, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class ChatCompletionFunctionMessageParamRoleExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this ChatCompletionFunctionMessageParamRole value) + { + return value switch + { + ChatCompletionFunctionMessageParamRole.Function => "function", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static ChatCompletionFunctionMessageParamRole? ToEnum(string value) + { + return value switch + { + "function" => ChatCompletionFunctionMessageParamRole.Function, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.ChatCompletionMessage.g.cs b/src/libs/Together/Generated/Together.Models.ChatCompletionMessage.g.cs index 02d8f784..fd30778e 100644 --- a/src/libs/Together/Generated/Together.Models.ChatCompletionMessage.g.cs +++ b/src/libs/Together/Generated/Together.Models.ChatCompletionMessage.g.cs @@ -1,4 +1,6 @@ +#pragma warning disable CS0618 // Type or member is obsolete + #nullable enable namespace Together @@ -27,6 +29,13 @@ public sealed partial class ChatCompletionMessage [global::System.Text.Json.Serialization.JsonPropertyName("tool_calls")] public global::System.Collections.Generic.IList? ToolCalls { get; set; } + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("function_call")] + [global::System.Obsolete("This property marked as deprecated.")] + public global::Together.ChatCompletionMessageFunctionCall? FunctionCall { get; set; } + /// /// /// diff --git a/src/libs/Together/Generated/Together.Models.ChatCompletionMessageFunctionCall.Json.g.cs b/src/libs/Together/Generated/Together.Models.ChatCompletionMessageFunctionCall.Json.g.cs new file mode 100644 index 00000000..3e4a6258 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ChatCompletionMessageFunctionCall.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class ChatCompletionMessageFunctionCall + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + 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); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.ChatCompletionMessageFunctionCall? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.ChatCompletionMessageFunctionCall), + jsonSerializerContext) as global::Together.ChatCompletionMessageFunctionCall; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ChatCompletionMessageFunctionCall? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.ChatCompletionMessageFunctionCall? FromJson( + 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); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.ChatCompletionMessageFunctionCall), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.ChatCompletionMessageFunctionCall; + } + + /// + /// 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.Models.WhoamiOrganization.g.cs b/src/libs/Together/Generated/Together.Models.ChatCompletionMessageFunctionCall.g.cs similarity index 57% rename from src/libs/Together/Generated/Together.Models.WhoamiOrganization.g.cs rename to src/libs/Together/Generated/Together.Models.ChatCompletionMessageFunctionCall.g.cs index 053e3653..6ffd0b97 100644 --- a/src/libs/Together/Generated/Together.Models.WhoamiOrganization.g.cs +++ b/src/libs/Together/Generated/Together.Models.ChatCompletionMessageFunctionCall.g.cs @@ -6,20 +6,23 @@ namespace Together /// /// /// - public sealed partial class WhoamiOrganization + [global::System.Obsolete("This model marked as deprecated.")] + public sealed partial class ChatCompletionMessageFunctionCall { /// - /// Organization identifier. + /// /// - [global::System.Text.Json.Serialization.JsonPropertyName("id")] + [global::System.Text.Json.Serialization.JsonPropertyName("arguments")] [global::System.Text.Json.Serialization.JsonRequired] - public required string Id { get; set; } + [global::System.Obsolete("This property marked as deprecated.")] + public required string Arguments { get; set; } /// - /// Organization display name. + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("name")] [global::System.Text.Json.Serialization.JsonRequired] + [global::System.Obsolete("This property marked as deprecated.")] public required string Name { get; set; } /// @@ -29,29 +32,25 @@ public sealed partial class WhoamiOrganization public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - /// - /// Organization identifier. - /// - /// - /// Organization display name. - /// + /// + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif - public WhoamiOrganization( - string id, + public ChatCompletionMessageFunctionCall( + string arguments, string name) { - this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); + this.Arguments = arguments ?? throw new global::System.ArgumentNullException(nameof(arguments)); this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public WhoamiOrganization() + public ChatCompletionMessageFunctionCall() { } diff --git a/src/libs/Together/Generated/Together.Models.ChatCompletionMessageParam.g.cs b/src/libs/Together/Generated/Together.Models.ChatCompletionMessageParam.g.cs index 31a593cf..bbf13e86 100644 --- a/src/libs/Together/Generated/Together.Models.ChatCompletionMessageParam.g.cs +++ b/src/libs/Together/Generated/Together.Models.ChatCompletionMessageParam.g.cs @@ -156,6 +156,43 @@ public bool TryPickTool( public global::Together.ChatCompletionToolMessageParam PickTool() => Tool is { } value ? value : throw new global::System.InvalidOperationException($"Expected union variant 'Tool' but the value was {ToString()}."); + + /// + /// + /// +#if NET6_0_OR_GREATER + public global::Together.ChatCompletionFunctionMessageParam? Function { get; init; } +#else + public global::Together.ChatCompletionFunctionMessageParam? Function { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Function))] +#endif + public bool IsFunction => Function != null; + + /// + /// + /// + public bool TryPickFunction( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Together.ChatCompletionFunctionMessageParam? value) + { + value = Function; + return IsFunction; + } + + /// + /// + /// + public global::Together.ChatCompletionFunctionMessageParam PickFunction() => Function is { } value + ? value + : throw new global::System.InvalidOperationException($"Expected union variant 'Function' but the value was {ToString()}."); /// /// /// @@ -248,6 +285,29 @@ public ChatCompletionMessageParam(global::Together.ChatCompletionToolMessagePara /// public static ChatCompletionMessageParam FromTool(global::Together.ChatCompletionToolMessageParam? value) => new ChatCompletionMessageParam(value); + /// + /// + /// + public static implicit operator ChatCompletionMessageParam(global::Together.ChatCompletionFunctionMessageParam value) => new ChatCompletionMessageParam((global::Together.ChatCompletionFunctionMessageParam?)value); + + /// + /// + /// + public static implicit operator global::Together.ChatCompletionFunctionMessageParam?(ChatCompletionMessageParam @this) => @this.Function; + + /// + /// + /// + public ChatCompletionMessageParam(global::Together.ChatCompletionFunctionMessageParam? value) + { + Function = value; + } + + /// + /// + /// + public static ChatCompletionMessageParam FromFunction(global::Together.ChatCompletionFunctionMessageParam? value) => new ChatCompletionMessageParam(value); + /// /// /// @@ -255,19 +315,22 @@ public ChatCompletionMessageParam( global::Together.ChatCompletionSystemMessageParam? system, global::Together.ChatCompletionUserMessageParam? user, global::Together.ChatCompletionAssistantMessageParam? assistant, - global::Together.ChatCompletionToolMessageParam? tool + global::Together.ChatCompletionToolMessageParam? tool, + global::Together.ChatCompletionFunctionMessageParam? function ) { System = system; User = user; Assistant = assistant; Tool = tool; + Function = function; } /// /// /// public object? Object => + Function as object ?? Tool as object ?? Assistant as object ?? User as object ?? @@ -281,7 +344,8 @@ System as object System?.ToString() ?? User?.ToString() ?? Assistant?.ToString() ?? - Tool?.ToString() + Tool?.ToString() ?? + Function?.ToString() ; /// @@ -289,7 +353,7 @@ System as object /// public bool Validate() { - return IsSystem && !IsUser && !IsAssistant && !IsTool || !IsSystem && IsUser && !IsAssistant && !IsTool || !IsSystem && !IsUser && IsAssistant && !IsTool || !IsSystem && !IsUser && !IsAssistant && IsTool; + return IsSystem && !IsUser && !IsAssistant && !IsTool && !IsFunction || !IsSystem && IsUser && !IsAssistant && !IsTool && !IsFunction || !IsSystem && !IsUser && IsAssistant && !IsTool && !IsFunction || !IsSystem && !IsUser && !IsAssistant && IsTool && !IsFunction || !IsSystem && !IsUser && !IsAssistant && !IsTool && IsFunction; } /// @@ -300,6 +364,7 @@ public bool Validate() global::System.Func? user = null, global::System.Func? assistant = null, global::System.Func? tool = null, + global::System.Func? function = null, bool validate = true) { if (validate) @@ -323,6 +388,10 @@ public bool Validate() { return tool(__value3); } + else if (Function is { } __value4 && function != null) + { + return function(__value4); + } return default(TResult); } @@ -338,6 +407,8 @@ public void Match( global::System.Action? assistant = null, global::System.Action? tool = null, + + global::System.Action? function = null, bool validate = true) { if (validate) @@ -361,6 +432,10 @@ public void Match( { tool?.Invoke(__value3); } + else if (Function is { } __value4) + { + function?.Invoke(__value4); + } } /// @@ -371,6 +446,7 @@ public void Switch( global::System.Action? user = null, global::System.Action? assistant = null, global::System.Action? tool = null, + global::System.Action? function = null, bool validate = true) { if (validate) @@ -394,6 +470,10 @@ public void Switch( { tool?.Invoke(__value3); } + else if (Function is { } __value4) + { + function?.Invoke(__value4); + } } /// @@ -411,6 +491,8 @@ public override int GetHashCode() typeof(global::Together.ChatCompletionAssistantMessageParam), Tool, typeof(global::Together.ChatCompletionToolMessageParam), + Function, + typeof(global::Together.ChatCompletionFunctionMessageParam), }; const int offset = unchecked((int)2166136261); const int prime = 16777619; @@ -430,7 +512,8 @@ public bool Equals(ChatCompletionMessageParam other) global::System.Collections.Generic.EqualityComparer.Default.Equals(System, other.System) && global::System.Collections.Generic.EqualityComparer.Default.Equals(User, other.User) && global::System.Collections.Generic.EqualityComparer.Default.Equals(Assistant, other.Assistant) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(Tool, other.Tool) + global::System.Collections.Generic.EqualityComparer.Default.Equals(Tool, other.Tool) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Function, other.Function) ; } diff --git a/src/libs/Together/Generated/Together.Models.ChatCompletionRequest.g.cs b/src/libs/Together/Generated/Together.Models.ChatCompletionRequest.g.cs index 526469db..761dc58d 100644 --- a/src/libs/Together/Generated/Together.Models.ChatCompletionRequest.g.cs +++ b/src/libs/Together/Generated/Together.Models.ChatCompletionRequest.g.cs @@ -1,4 +1,6 @@ +#pragma warning disable CS0618 // Type or member is obsolete + #nullable enable namespace Together diff --git a/src/libs/Together/Generated/Together.Models.CompletionChoiceDelta.g.cs b/src/libs/Together/Generated/Together.Models.CompletionChoiceDelta.g.cs index 45d033e6..5bf0e519 100644 --- a/src/libs/Together/Generated/Together.Models.CompletionChoiceDelta.g.cs +++ b/src/libs/Together/Generated/Together.Models.CompletionChoiceDelta.g.cs @@ -1,4 +1,6 @@ +#pragma warning disable CS0618 // Type or member is obsolete + #nullable enable namespace Together @@ -46,6 +48,13 @@ public sealed partial class CompletionChoiceDelta [global::System.Text.Json.Serialization.JsonPropertyName("tool_calls")] public global::System.Collections.Generic.IList? ToolCalls { get; set; } + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("function_call")] + [global::System.Obsolete("This property marked as deprecated.")] + public global::Together.CompletionChoiceDeltaFunctionCall? FunctionCall { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// diff --git a/src/libs/Together/Generated/Together.Models.CompletionChoiceDeltaFunctionCall.Json.g.cs b/src/libs/Together/Generated/Together.Models.CompletionChoiceDeltaFunctionCall.Json.g.cs new file mode 100644 index 00000000..6f902a74 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.CompletionChoiceDeltaFunctionCall.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class CompletionChoiceDeltaFunctionCall + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + 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); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.CompletionChoiceDeltaFunctionCall? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.CompletionChoiceDeltaFunctionCall), + jsonSerializerContext) as global::Together.CompletionChoiceDeltaFunctionCall; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.CompletionChoiceDeltaFunctionCall? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.CompletionChoiceDeltaFunctionCall? FromJson( + 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); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.CompletionChoiceDeltaFunctionCall), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.CompletionChoiceDeltaFunctionCall; + } + + /// + /// 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.Models.CompletionChoiceDeltaFunctionCall.g.cs b/src/libs/Together/Generated/Together.Models.CompletionChoiceDeltaFunctionCall.g.cs new file mode 100644 index 00000000..18f29bf9 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.CompletionChoiceDeltaFunctionCall.g.cs @@ -0,0 +1,58 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + [global::System.Obsolete("This model marked as deprecated.")] + public sealed partial class CompletionChoiceDeltaFunctionCall + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("arguments")] + [global::System.Text.Json.Serialization.JsonRequired] + [global::System.Obsolete("This property marked as deprecated.")] + public required string Arguments { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + [global::System.Text.Json.Serialization.JsonRequired] + [global::System.Obsolete("This property marked as deprecated.")] + public required string Name { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public CompletionChoiceDeltaFunctionCall( + string arguments, + string name) + { + this.Arguments = arguments ?? throw new global::System.ArgumentNullException(nameof(arguments)); + this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); + } + + /// + /// Initializes a new instance of the class. + /// + public CompletionChoiceDeltaFunctionCall() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.CreateEndpointRequest.Json.g.cs b/src/libs/Together/Generated/Together.Models.CreateEndpointRequest.Json.g.cs new file mode 100644 index 00000000..3a24d4c3 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.CreateEndpointRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class CreateEndpointRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + 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); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.CreateEndpointRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.CreateEndpointRequest), + jsonSerializerContext) as global::Together.CreateEndpointRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.CreateEndpointRequest? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.CreateEndpointRequest? FromJson( + 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); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.CreateEndpointRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.CreateEndpointRequest; + } + + /// + /// 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.Models.CreateEndpointRequest.g.cs b/src/libs/Together/Generated/Together.Models.CreateEndpointRequest.g.cs new file mode 100644 index 00000000..9ec5c896 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.CreateEndpointRequest.g.cs @@ -0,0 +1,156 @@ + +#pragma warning disable CS0618 // Type or member is obsolete + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class CreateEndpointRequest + { + /// + /// A human-readable name for the endpoint
+ /// Example: My Llama3 70b endpoint + ///
+ /// My Llama3 70b endpoint + [global::System.Text.Json.Serialization.JsonPropertyName("display_name")] + public string? DisplayName { get; set; } + + /// + /// The model to deploy on this endpoint
+ /// Example: deepseek-ai/DeepSeek-R1 + ///
+ /// deepseek-ai/DeepSeek-R1 + [global::System.Text.Json.Serialization.JsonPropertyName("model")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Model { get; set; } + + /// + /// The hardware configuration to use for this endpoint
+ /// Example: 1x_nvidia_a100_80gb_sxm + ///
+ /// 1x_nvidia_a100_80gb_sxm + [global::System.Text.Json.Serialization.JsonPropertyName("hardware")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Hardware { get; set; } + + /// + /// Configuration for automatic scaling of the endpoint + /// + [global::System.Text.Json.Serialization.JsonPropertyName("autoscaling")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.Autoscaling Autoscaling { get; set; } + + /// + /// This parameter is deprecated and no longer has any effect.
+ /// Default Value: false + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("disable_prompt_cache")] + [global::System.Obsolete("This property marked as deprecated.")] + public bool? DisablePromptCache { get; set; } + + /// + /// Whether to disable speculative decoding for this endpoint
+ /// Default Value: false + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("disable_speculative_decoding")] + public bool? DisableSpeculativeDecoding { get; set; } + + /// + /// The desired state of the endpoint
+ /// Default Value: STARTED
+ /// Example: STARTED + ///
+ /// STARTED + [global::System.Text.Json.Serialization.JsonPropertyName("state")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.CreateEndpointRequestStateJsonConverter))] + public global::Together.CreateEndpointRequestState? State { get; set; } + + /// + /// The number of minutes of inactivity after which the endpoint stops automatically. Set to null, omit, or set to 0 to disable automatic timeout.
+ /// Example: 60 + ///
+ /// 60 + [global::System.Text.Json.Serialization.JsonPropertyName("inactive_timeout")] + public int? InactiveTimeout { get; set; } + + /// + /// Create the endpoint in a specified availability zone (e.g., us-central-4b) + /// + [global::System.Text.Json.Serialization.JsonPropertyName("availability_zone")] + public string? AvailabilityZone { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The model to deploy on this endpoint
+ /// Example: deepseek-ai/DeepSeek-R1 + /// + /// + /// The hardware configuration to use for this endpoint
+ /// Example: 1x_nvidia_a100_80gb_sxm + /// + /// + /// Configuration for automatic scaling of the endpoint + /// + /// + /// A human-readable name for the endpoint
+ /// Example: My Llama3 70b endpoint + /// + /// + /// Whether to disable speculative decoding for this endpoint
+ /// Default Value: false + /// + /// + /// The desired state of the endpoint
+ /// Default Value: STARTED
+ /// Example: STARTED + /// + /// + /// The number of minutes of inactivity after which the endpoint stops automatically. Set to null, omit, or set to 0 to disable automatic timeout.
+ /// Example: 60 + /// + /// + /// Create the endpoint in a specified availability zone (e.g., us-central-4b) + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public CreateEndpointRequest( + string model, + string hardware, + global::Together.Autoscaling autoscaling, + string? displayName, + bool? disableSpeculativeDecoding, + global::Together.CreateEndpointRequestState? state, + int? inactiveTimeout, + string? availabilityZone) + { + this.DisplayName = displayName; + this.Model = model ?? throw new global::System.ArgumentNullException(nameof(model)); + this.Hardware = hardware ?? throw new global::System.ArgumentNullException(nameof(hardware)); + this.Autoscaling = autoscaling ?? throw new global::System.ArgumentNullException(nameof(autoscaling)); + this.DisableSpeculativeDecoding = disableSpeculativeDecoding; + this.State = state; + this.InactiveTimeout = inactiveTimeout; + this.AvailabilityZone = availabilityZone; + } + + /// + /// Initializes a new instance of the class. + /// + public CreateEndpointRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.CreateEndpointRequestState.g.cs b/src/libs/Together/Generated/Together.Models.CreateEndpointRequestState.g.cs new file mode 100644 index 00000000..68c6daaf --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.CreateEndpointRequestState.g.cs @@ -0,0 +1,53 @@ + +#nullable enable + +namespace Together +{ + /// + /// The desired state of the endpoint
+ /// Default Value: STARTED
+ /// Example: STARTED + ///
+ public enum CreateEndpointRequestState + { + /// + /// + /// + Started, + /// + /// + /// + Stopped, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class CreateEndpointRequestStateExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this CreateEndpointRequestState value) + { + return value switch + { + CreateEndpointRequestState.Started => "STARTED", + CreateEndpointRequestState.Stopped => "STOPPED", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static CreateEndpointRequestState? ToEnum(string value) + { + return value switch + { + "STARTED" => CreateEndpointRequestState.Started, + "STOPPED" => CreateEndpointRequestState.Stopped, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.CreateFineTunesRequest.g.cs b/src/libs/Together/Generated/Together.Models.CreateFineTunesRequest.g.cs index bc6f415b..f3d1a1ab 100644 --- a/src/libs/Together/Generated/Together.Models.CreateFineTunesRequest.g.cs +++ b/src/libs/Together/Generated/Together.Models.CreateFineTunesRequest.g.cs @@ -1,4 +1,6 @@ +#pragma warning disable CS0618 // Type or member is obsolete + #nullable enable namespace Together @@ -181,6 +183,14 @@ public sealed partial class CreateFineTunesRequest [global::System.Text.Json.Serialization.JsonPropertyName("wandb_entity")] public string? WandbEntity { get; set; } + /// + /// Whether to mask user messages in conversational data or prompts in instruction data.
+ /// Default Value: auto + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("train_on_inputs")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.OneOfJsonConverter))] + public global::Together.OneOf? TrainOnInputs { get; set; } + /// /// The training method to use. 'sft' for Supervised Fine-Tuning or 'dpo' for Direct Preference Optimization. /// diff --git a/src/libs/Together/Generated/Together.Models.WhoamiProjectApiKeyType.g.cs b/src/libs/Together/Generated/Together.Models.CreateFineTunesRequestTrainOnInputs.g.cs similarity index 61% rename from src/libs/Together/Generated/Together.Models.WhoamiProjectApiKeyType.g.cs rename to src/libs/Together/Generated/Together.Models.CreateFineTunesRequestTrainOnInputs.g.cs index 67548f29..c7348a0b 100644 --- a/src/libs/Together/Generated/Together.Models.WhoamiProjectApiKeyType.g.cs +++ b/src/libs/Together/Generated/Together.Models.CreateFineTunesRequestTrainOnInputs.g.cs @@ -4,40 +4,40 @@ namespace Together { /// - /// Always `project_api_key`. + /// /// - public enum WhoamiProjectApiKeyType + public enum CreateFineTunesRequestTrainOnInputs { /// /// /// - ProjectApiKey, + Auto, } /// /// Enum extensions to do fast conversions without the reflection. /// - public static class WhoamiProjectApiKeyTypeExtensions + public static class CreateFineTunesRequestTrainOnInputsExtensions { /// /// Converts an enum to a string. /// - public static string ToValueString(this WhoamiProjectApiKeyType value) + public static string ToValueString(this CreateFineTunesRequestTrainOnInputs value) { return value switch { - WhoamiProjectApiKeyType.ProjectApiKey => "project_api_key", + CreateFineTunesRequestTrainOnInputs.Auto => "auto", _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), }; } /// /// Converts an string to a enum. /// - public static WhoamiProjectApiKeyType? ToEnum(string value) + public static CreateFineTunesRequestTrainOnInputs? ToEnum(string value) { return value switch { - "project_api_key" => WhoamiProjectApiKeyType.ProjectApiKey, + "auto" => CreateFineTunesRequestTrainOnInputs.Auto, _ => null, }; } diff --git a/src/libs/Together/Generated/Together.Models.CreateVideoBody.g.cs b/src/libs/Together/Generated/Together.Models.CreateVideoBody.g.cs index 9dd03617..1bb7c05f 100644 --- a/src/libs/Together/Generated/Together.Models.CreateVideoBody.g.cs +++ b/src/libs/Together/Generated/Together.Models.CreateVideoBody.g.cs @@ -1,4 +1,6 @@ +#pragma warning disable CS0618 // Type or member is obsolete + #nullable enable namespace Together @@ -106,6 +108,22 @@ public sealed partial class CreateVideoBody [global::System.Text.Json.Serialization.JsonPropertyName("media")] public global::Together.VideoMedia? Media { get; set; } + /// + /// Deprecated: use media.frame_images instead. Array of images to guide video generation, similar to keyframes.
+ /// Example: [[{"input_image":"aac49721-1964-481a-ae78-8a4e29b91402","frame":0}, {"input_image":"c00abf5f-6cdb-4642-a01d-1bfff7bc3cf7","frame":48}, {"input_image":"3ad204c3-a9de-4963-8a1a-c3911e3afafe","frame":"last"}]] + ///
+ /// [[{"input_image":"aac49721-1964-481a-ae78-8a4e29b91402","frame":0}, {"input_image":"c00abf5f-6cdb-4642-a01d-1bfff7bc3cf7","frame":48}, {"input_image":"3ad204c3-a9de-4963-8a1a-c3911e3afafe","frame":"last"}]] + [global::System.Text.Json.Serialization.JsonPropertyName("frame_images")] + [global::System.Obsolete("This property marked as deprecated.")] + public global::System.Collections.Generic.IList? FrameImages { get; set; } + + /// + /// Deprecated: use media.reference_images instead. Unlike frame_images which constrain specific timeline positions, reference images guide the general appearance that should appear consistently across the video. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("reference_images")] + [global::System.Obsolete("This property marked as deprecated.")] + public global::System.Collections.Generic.IList? ReferenceImages { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// diff --git a/src/libs/Together/Generated/Together.Models.DeAdapterEntry.g.cs b/src/libs/Together/Generated/Together.Models.DeAdapterEntry.g.cs index f044bb3b..5d74e2f7 100644 --- a/src/libs/Together/Generated/Together.Models.DeAdapterEntry.g.cs +++ b/src/libs/Together/Generated/Together.Models.DeAdapterEntry.g.cs @@ -49,7 +49,7 @@ public sealed partial class DeAdapterEntry public string? DesiredRevision { get; set; } /// - /// Adapter attachment `dad_` id used by get, update, and remove; stale ids never address a replacement after remove and re-add. + /// Row identifier for this adapter attachment; changes if the adapter is removed and re-added. /// [global::System.Text.Json.Serialization.JsonPropertyName("id")] [global::System.Text.Json.Serialization.JsonRequired] @@ -77,7 +77,7 @@ public sealed partial class DeAdapterEntry /// Row-level etag required for UpdateAdapter and RemoveAdapter. /// /// - /// Adapter attachment `dad_` id used by get, update, and remove; stale ids never address a replacement after remove and re-add. + /// Row identifier for this adapter attachment; changes if the adapter is removed and re-added. /// /// /// Resource name of the adapter model, using projects/{projectId}/models/{adapterModelId}. diff --git a/src/libs/Together/Generated/Together.Models.DeSupportedModelDeploymentProfile.g.cs b/src/libs/Together/Generated/Together.Models.DeSupportedModelDeploymentProfile.g.cs index 94a152af..461534dc 100644 --- a/src/libs/Together/Generated/Together.Models.DeSupportedModelDeploymentProfile.g.cs +++ b/src/libs/Together/Generated/Together.Models.DeSupportedModelDeploymentProfile.g.cs @@ -1,4 +1,6 @@ +#pragma warning disable CS0618 // Type or member is obsolete + #nullable enable namespace Together @@ -50,6 +52,13 @@ public sealed partial class DeSupportedModelDeploymentProfile [global::System.Text.Json.Serialization.JsonRequired] public required string Quantization { get; set; } + /// + /// Deprecated. Use `parallelism`. Legacy tensor-parallel shard count for the profile. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("tensorParallelSize")] + [global::System.Obsolete("This property marked as deprecated.")] + public int? TensorParallelSize { get; set; } + /// /// Performance benchmarks for the profile, if available. /// diff --git a/src/libs/Together/Generated/Together.Models.DedicatedEndpoint.Json.g.cs b/src/libs/Together/Generated/Together.Models.DedicatedEndpoint.Json.g.cs new file mode 100644 index 00000000..ae2e2cca --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DedicatedEndpoint.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DedicatedEndpoint + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + 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); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DedicatedEndpoint? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DedicatedEndpoint), + jsonSerializerContext) as global::Together.DedicatedEndpoint; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DedicatedEndpoint? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DedicatedEndpoint? FromJson( + 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); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DedicatedEndpoint), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DedicatedEndpoint; + } + + /// + /// 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.Models.DedicatedEndpoint.g.cs b/src/libs/Together/Generated/Together.Models.DedicatedEndpoint.g.cs new file mode 100644 index 00000000..821c1821 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DedicatedEndpoint.g.cs @@ -0,0 +1,195 @@ + +#nullable enable + +namespace Together +{ + /// + /// Details about a dedicated endpoint deployment + /// + public sealed partial class DedicatedEndpoint + { + /// + /// The object type, which is always `endpoint`. + /// + /// "endpoint" + [global::System.Text.Json.Serialization.JsonPropertyName("object")] + public string Object { get; set; } = "endpoint"; + + /// + /// Unique identifier for the endpoint
+ /// Example: endpoint-d23901de-ef8f-44bf-b3e7-de9c1ca8f2d7 + ///
+ /// endpoint-d23901de-ef8f-44bf-b3e7-de9c1ca8f2d7 + [global::System.Text.Json.Serialization.JsonPropertyName("id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Id { get; set; } + + /// + /// System name for the endpoint
+ /// Example: devuser/deepseek-ai/DeepSeek-R1-a32b82a1 + ///
+ /// devuser/deepseek-ai/DeepSeek-R1-a32b82a1 + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Name { get; set; } + + /// + /// Human-readable name for the endpoint
+ /// Example: My DeepSeek R1 endpoint + ///
+ /// My DeepSeek R1 endpoint + [global::System.Text.Json.Serialization.JsonPropertyName("display_name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string DisplayName { get; set; } + + /// + /// The model deployed on this endpoint
+ /// Example: deepseek-ai/DeepSeek-R1 + ///
+ /// deepseek-ai/DeepSeek-R1 + [global::System.Text.Json.Serialization.JsonPropertyName("model")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Model { get; set; } + + /// + /// The hardware configuration used for this endpoint
+ /// Example: 8x_nvidia_h200_140gb_sxm + ///
+ /// 8x_nvidia_h200_140gb_sxm + [global::System.Text.Json.Serialization.JsonPropertyName("hardware")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Hardware { get; set; } + + /// + /// The type of endpoint
+ /// Example: dedicated + ///
+ /// dedicated + [global::System.Text.Json.Serialization.JsonPropertyName("type")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.DedicatedEndpointTypeJsonConverter))] + public global::Together.DedicatedEndpointType Type { get; set; } + + /// + /// The owner of this endpoint
+ /// Example: devuser + ///
+ /// devuser + [global::System.Text.Json.Serialization.JsonPropertyName("owner")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Owner { get; set; } + + /// + /// Current state of the endpoint
+ /// Example: STARTED + ///
+ /// STARTED + [global::System.Text.Json.Serialization.JsonPropertyName("state")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.DedicatedEndpointStateJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.DedicatedEndpointState State { get; set; } + + /// + /// Configuration for automatic scaling of the endpoint + /// + [global::System.Text.Json.Serialization.JsonPropertyName("autoscaling")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.Autoscaling Autoscaling { get; set; } + + /// + /// Timestamp when the endpoint was created
+ /// Example: 2025-02-04T10:43:55.405Z + ///
+ /// 2025-02-04T10:43:55.405Z + [global::System.Text.Json.Serialization.JsonPropertyName("created_at")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.DateTime CreatedAt { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Unique identifier for the endpoint
+ /// Example: endpoint-d23901de-ef8f-44bf-b3e7-de9c1ca8f2d7 + /// + /// + /// System name for the endpoint
+ /// Example: devuser/deepseek-ai/DeepSeek-R1-a32b82a1 + /// + /// + /// Human-readable name for the endpoint
+ /// Example: My DeepSeek R1 endpoint + /// + /// + /// The model deployed on this endpoint
+ /// Example: deepseek-ai/DeepSeek-R1 + /// + /// + /// The hardware configuration used for this endpoint
+ /// Example: 8x_nvidia_h200_140gb_sxm + /// + /// + /// The owner of this endpoint
+ /// Example: devuser + /// + /// + /// Current state of the endpoint
+ /// Example: STARTED + /// + /// + /// Configuration for automatic scaling of the endpoint + /// + /// + /// Timestamp when the endpoint was created
+ /// Example: 2025-02-04T10:43:55.405Z + /// + /// + /// The type of endpoint
+ /// Example: dedicated + /// + /// + /// The object type, which is always `endpoint`. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DedicatedEndpoint( + string id, + string name, + string displayName, + string model, + string hardware, + string owner, + global::Together.DedicatedEndpointState state, + global::Together.Autoscaling autoscaling, + global::System.DateTime createdAt, + global::Together.DedicatedEndpointType type, + string @object = "endpoint") + { + this.Object = @object; + this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); + this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); + this.DisplayName = displayName ?? throw new global::System.ArgumentNullException(nameof(displayName)); + this.Model = model ?? throw new global::System.ArgumentNullException(nameof(model)); + this.Hardware = hardware ?? throw new global::System.ArgumentNullException(nameof(hardware)); + this.Type = type; + this.Owner = owner ?? throw new global::System.ArgumentNullException(nameof(owner)); + this.State = state; + this.Autoscaling = autoscaling ?? throw new global::System.ArgumentNullException(nameof(autoscaling)); + this.CreatedAt = createdAt; + } + + /// + /// Initializes a new instance of the class. + /// + public DedicatedEndpoint() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.WhoamiUserOrgProjectJwt.Json.g.cs b/src/libs/Together/Generated/Together.Models.DedicatedEndpointObject.Json.g.cs similarity index 88% rename from src/libs/Together/Generated/Together.Models.WhoamiUserOrgProjectJwt.Json.g.cs rename to src/libs/Together/Generated/Together.Models.DedicatedEndpointObject.Json.g.cs index 1e18be0a..39ad9e0b 100644 --- a/src/libs/Together/Generated/Together.Models.WhoamiUserOrgProjectJwt.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.DedicatedEndpointObject.Json.g.cs @@ -2,7 +2,7 @@ namespace Together { - public sealed partial class WhoamiUserOrgProjectJwt + public sealed partial class DedicatedEndpointObject { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -47,20 +47,20 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::Together.WhoamiUserOrgProjectJwt? FromJson( + public static global::Together.DedicatedEndpointObject? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::Together.WhoamiUserOrgProjectJwt), - jsonSerializerContext) as global::Together.WhoamiUserOrgProjectJwt; + typeof(global::Together.DedicatedEndpointObject), + jsonSerializerContext) as global::Together.DedicatedEndpointObject; } /// /// Deserializes a JSON string using the generated default JsonSerializerContext. /// - public static global::Together.WhoamiUserOrgProjectJwt? FromJson( + public static global::Together.DedicatedEndpointObject? FromJson( string json) { return FromJson( @@ -75,7 +75,7 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::Together.WhoamiUserOrgProjectJwt? FromJson( + public static global::Together.DedicatedEndpointObject? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -86,7 +86,7 @@ public string ToJson( global::Together.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -94,20 +94,20 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, - typeof(global::Together.WhoamiUserOrgProjectJwt), - jsonSerializerContext).ConfigureAwait(false)) as global::Together.WhoamiUserOrgProjectJwt; + typeof(global::Together.DedicatedEndpointObject), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DedicatedEndpointObject; } /// /// Deserializes a JSON stream using the generated default JsonSerializerContext. /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream) { return FromJsonStreamAsync( @@ -122,7 +122,7 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -133,7 +133,7 @@ public string ToJson( global::Together.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.DeserializeAsync( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/Together/Generated/Together.Models.DedicatedEndpointObject.g.cs b/src/libs/Together/Generated/Together.Models.DedicatedEndpointObject.g.cs new file mode 100644 index 00000000..91551629 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DedicatedEndpointObject.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Together +{ + /// + /// The object type, which is always `endpoint`. + /// + public sealed partial class DedicatedEndpointObject + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DedicatedEndpointState.g.cs b/src/libs/Together/Generated/Together.Models.DedicatedEndpointState.g.cs new file mode 100644 index 00000000..7c0ab7a3 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DedicatedEndpointState.g.cs @@ -0,0 +1,76 @@ + +#nullable enable + +namespace Together +{ + /// + /// Current state of the endpoint
+ /// Example: STARTED + ///
+ public enum DedicatedEndpointState + { + /// + /// + /// + Error, + /// + /// + /// + Pending, + /// + /// + /// + Started, + /// + /// + /// + Starting, + /// + /// + /// + Stopped, + /// + /// + /// + Stopping, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class DedicatedEndpointStateExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this DedicatedEndpointState value) + { + return value switch + { + DedicatedEndpointState.Error => "ERROR", + DedicatedEndpointState.Pending => "PENDING", + DedicatedEndpointState.Started => "STARTED", + DedicatedEndpointState.Starting => "STARTING", + DedicatedEndpointState.Stopped => "STOPPED", + DedicatedEndpointState.Stopping => "STOPPING", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static DedicatedEndpointState? ToEnum(string value) + { + return value switch + { + "ERROR" => DedicatedEndpointState.Error, + "PENDING" => DedicatedEndpointState.Pending, + "STARTED" => DedicatedEndpointState.Started, + "STARTING" => DedicatedEndpointState.Starting, + "STOPPED" => DedicatedEndpointState.Stopped, + "STOPPING" => DedicatedEndpointState.Stopping, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.WhoamiOrgApiKeyType.g.cs b/src/libs/Together/Generated/Together.Models.DedicatedEndpointType.g.cs similarity index 62% rename from src/libs/Together/Generated/Together.Models.WhoamiOrgApiKeyType.g.cs rename to src/libs/Together/Generated/Together.Models.DedicatedEndpointType.g.cs index fc7984b3..c52bdb15 100644 --- a/src/libs/Together/Generated/Together.Models.WhoamiOrgApiKeyType.g.cs +++ b/src/libs/Together/Generated/Together.Models.DedicatedEndpointType.g.cs @@ -4,40 +4,41 @@ namespace Together { /// - /// Always `org_api_key`. + /// The type of endpoint
+ /// Example: dedicated ///
- public enum WhoamiOrgApiKeyType + public enum DedicatedEndpointType { /// /// /// - OrgApiKey, + Dedicated, } /// /// Enum extensions to do fast conversions without the reflection. /// - public static class WhoamiOrgApiKeyTypeExtensions + public static class DedicatedEndpointTypeExtensions { /// /// Converts an enum to a string. /// - public static string ToValueString(this WhoamiOrgApiKeyType value) + public static string ToValueString(this DedicatedEndpointType value) { return value switch { - WhoamiOrgApiKeyType.OrgApiKey => "org_api_key", + DedicatedEndpointType.Dedicated => "dedicated", _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), }; } /// /// Converts an string to a enum. /// - public static WhoamiOrgApiKeyType? ToEnum(string value) + public static DedicatedEndpointType? ToEnum(string value) { return value switch { - "org_api_key" => WhoamiOrgApiKeyType.OrgApiKey, + "dedicated" => DedicatedEndpointType.Dedicated, _ => null, }; } diff --git a/src/libs/Together/Generated/Together.Models.DisplayorExecuteOutput.Json.g.cs b/src/libs/Together/Generated/Together.Models.DisplayorExecuteOutput.Json.g.cs new file mode 100644 index 00000000..eec4213e --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DisplayorExecuteOutput.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DisplayorExecuteOutput + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + 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); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DisplayorExecuteOutput? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DisplayorExecuteOutput), + jsonSerializerContext) as global::Together.DisplayorExecuteOutput; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DisplayorExecuteOutput? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DisplayorExecuteOutput? FromJson( + 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); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DisplayorExecuteOutput), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DisplayorExecuteOutput; + } + + /// + /// 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.Models.DisplayorExecuteOutput.g.cs b/src/libs/Together/Generated/Together.Models.DisplayorExecuteOutput.g.cs new file mode 100644 index 00000000..1a7d02ef --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DisplayorExecuteOutput.g.cs @@ -0,0 +1,56 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class DisplayorExecuteOutput + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.DisplayorExecuteOutputData Data { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("type")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.DisplayorExecuteOutputTypeJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.DisplayorExecuteOutputType Type { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DisplayorExecuteOutput( + global::Together.DisplayorExecuteOutputData data, + global::Together.DisplayorExecuteOutputType type) + { + this.Data = data ?? throw new global::System.ArgumentNullException(nameof(data)); + this.Type = type; + } + + /// + /// Initializes a new instance of the class. + /// + public DisplayorExecuteOutput() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DisplayorExecuteOutputData.Json.g.cs b/src/libs/Together/Generated/Together.Models.DisplayorExecuteOutputData.Json.g.cs new file mode 100644 index 00000000..ce59be4c --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DisplayorExecuteOutputData.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DisplayorExecuteOutputData + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + 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); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DisplayorExecuteOutputData? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DisplayorExecuteOutputData), + jsonSerializerContext) as global::Together.DisplayorExecuteOutputData; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DisplayorExecuteOutputData? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DisplayorExecuteOutputData? FromJson( + 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); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DisplayorExecuteOutputData), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DisplayorExecuteOutputData; + } + + /// + /// 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.Models.DisplayorExecuteOutputData.g.cs b/src/libs/Together/Generated/Together.Models.DisplayorExecuteOutputData.g.cs new file mode 100644 index 00000000..7ad12ace --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DisplayorExecuteOutputData.g.cs @@ -0,0 +1,161 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class DisplayorExecuteOutputData + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("application/geo+json")] + public object? ApplicationGeoJson { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("application/javascript")] + public string? ApplicationJavascript { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("application/json")] + public object? ApplicationJson { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("application/pdf")] + public byte[]? ApplicationPdf { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("application/vnd.vega.v5+json")] + public object? ApplicationVndVegaV5Json { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("application/vnd.vegalite.v4+json")] + public object? ApplicationVndVegaliteV4Json { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("image/gif")] + public byte[]? ImageGif { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("image/jpeg")] + public byte[]? ImageJpeg { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("image/png")] + public byte[]? ImagePng { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("image/svg+xml")] + public string? ImageSvgXml { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("text/html")] + public string? TextHtml { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("text/latex")] + public string? TextLatex { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("text/markdown")] + public string? TextMarkdown { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("text/plain")] + public string? TextPlain { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DisplayorExecuteOutputData( + object? applicationGeoJson, + string? applicationJavascript, + object? applicationJson, + byte[]? applicationPdf, + object? applicationVndVegaV5Json, + object? applicationVndVegaliteV4Json, + byte[]? imageGif, + byte[]? imageJpeg, + byte[]? imagePng, + string? imageSvgXml, + string? textHtml, + string? textLatex, + string? textMarkdown, + string? textPlain) + { + this.ApplicationGeoJson = applicationGeoJson; + this.ApplicationJavascript = applicationJavascript; + this.ApplicationJson = applicationJson; + this.ApplicationPdf = applicationPdf; + this.ApplicationVndVegaV5Json = applicationVndVegaV5Json; + this.ApplicationVndVegaliteV4Json = applicationVndVegaliteV4Json; + this.ImageGif = imageGif; + this.ImageJpeg = imageJpeg; + this.ImagePng = imagePng; + this.ImageSvgXml = imageSvgXml; + this.TextHtml = textHtml; + this.TextLatex = textLatex; + this.TextMarkdown = textMarkdown; + this.TextPlain = textPlain; + } + + /// + /// Initializes a new instance of the class. + /// + public DisplayorExecuteOutputData() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DisplayorExecuteOutputDataApplicationGeoJson.Json.g.cs b/src/libs/Together/Generated/Together.Models.DisplayorExecuteOutputDataApplicationGeoJson.Json.g.cs new file mode 100644 index 00000000..b9ead604 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DisplayorExecuteOutputDataApplicationGeoJson.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DisplayorExecuteOutputDataApplicationGeoJson + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + 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); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DisplayorExecuteOutputDataApplicationGeoJson? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DisplayorExecuteOutputDataApplicationGeoJson), + jsonSerializerContext) as global::Together.DisplayorExecuteOutputDataApplicationGeoJson; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DisplayorExecuteOutputDataApplicationGeoJson? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DisplayorExecuteOutputDataApplicationGeoJson? FromJson( + 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); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DisplayorExecuteOutputDataApplicationGeoJson), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DisplayorExecuteOutputDataApplicationGeoJson; + } + + /// + /// 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.Models.DisplayorExecuteOutputDataApplicationGeoJson.g.cs b/src/libs/Together/Generated/Together.Models.DisplayorExecuteOutputDataApplicationGeoJson.g.cs new file mode 100644 index 00000000..633ebd3c --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DisplayorExecuteOutputDataApplicationGeoJson.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class DisplayorExecuteOutputDataApplicationGeoJson + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DisplayorExecuteOutputDataApplicationJson.Json.g.cs b/src/libs/Together/Generated/Together.Models.DisplayorExecuteOutputDataApplicationJson.Json.g.cs new file mode 100644 index 00000000..7d05a1b2 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DisplayorExecuteOutputDataApplicationJson.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DisplayorExecuteOutputDataApplicationJson + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + 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); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DisplayorExecuteOutputDataApplicationJson? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DisplayorExecuteOutputDataApplicationJson), + jsonSerializerContext) as global::Together.DisplayorExecuteOutputDataApplicationJson; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DisplayorExecuteOutputDataApplicationJson? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DisplayorExecuteOutputDataApplicationJson? FromJson( + 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); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DisplayorExecuteOutputDataApplicationJson), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DisplayorExecuteOutputDataApplicationJson; + } + + /// + /// 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.Models.DisplayorExecuteOutputDataApplicationJson.g.cs b/src/libs/Together/Generated/Together.Models.DisplayorExecuteOutputDataApplicationJson.g.cs new file mode 100644 index 00000000..ef304eac --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DisplayorExecuteOutputDataApplicationJson.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class DisplayorExecuteOutputDataApplicationJson + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DisplayorExecuteOutputDataApplicationVndVegaV5Json.Json.g.cs b/src/libs/Together/Generated/Together.Models.DisplayorExecuteOutputDataApplicationVndVegaV5Json.Json.g.cs new file mode 100644 index 00000000..4b7df21f --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DisplayorExecuteOutputDataApplicationVndVegaV5Json.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DisplayorExecuteOutputDataApplicationVndVegaV5Json + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + 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); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DisplayorExecuteOutputDataApplicationVndVegaV5Json? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DisplayorExecuteOutputDataApplicationVndVegaV5Json), + jsonSerializerContext) as global::Together.DisplayorExecuteOutputDataApplicationVndVegaV5Json; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DisplayorExecuteOutputDataApplicationVndVegaV5Json? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DisplayorExecuteOutputDataApplicationVndVegaV5Json? FromJson( + 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); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DisplayorExecuteOutputDataApplicationVndVegaV5Json), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DisplayorExecuteOutputDataApplicationVndVegaV5Json; + } + + /// + /// 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.Models.DisplayorExecuteOutputDataApplicationVndVegaV5Json.g.cs b/src/libs/Together/Generated/Together.Models.DisplayorExecuteOutputDataApplicationVndVegaV5Json.g.cs new file mode 100644 index 00000000..a5266b5f --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DisplayorExecuteOutputDataApplicationVndVegaV5Json.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class DisplayorExecuteOutputDataApplicationVndVegaV5Json + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DisplayorExecuteOutputDataApplicationVndVegaliteV4Json.Json.g.cs b/src/libs/Together/Generated/Together.Models.DisplayorExecuteOutputDataApplicationVndVegaliteV4Json.Json.g.cs new file mode 100644 index 00000000..68d67000 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DisplayorExecuteOutputDataApplicationVndVegaliteV4Json.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class DisplayorExecuteOutputDataApplicationVndVegaliteV4Json + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + 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); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.DisplayorExecuteOutputDataApplicationVndVegaliteV4Json? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.DisplayorExecuteOutputDataApplicationVndVegaliteV4Json), + jsonSerializerContext) as global::Together.DisplayorExecuteOutputDataApplicationVndVegaliteV4Json; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.DisplayorExecuteOutputDataApplicationVndVegaliteV4Json? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.DisplayorExecuteOutputDataApplicationVndVegaliteV4Json? FromJson( + 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); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.DisplayorExecuteOutputDataApplicationVndVegaliteV4Json), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.DisplayorExecuteOutputDataApplicationVndVegaliteV4Json; + } + + /// + /// 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.Models.DisplayorExecuteOutputDataApplicationVndVegaliteV4Json.g.cs b/src/libs/Together/Generated/Together.Models.DisplayorExecuteOutputDataApplicationVndVegaliteV4Json.g.cs new file mode 100644 index 00000000..ea130edd --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DisplayorExecuteOutputDataApplicationVndVegaliteV4Json.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class DisplayorExecuteOutputDataApplicationVndVegaliteV4Json + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.DisplayorExecuteOutputType.g.cs b/src/libs/Together/Generated/Together.Models.DisplayorExecuteOutputType.g.cs new file mode 100644 index 00000000..c710cc49 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.DisplayorExecuteOutputType.g.cs @@ -0,0 +1,51 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public enum DisplayorExecuteOutputType + { + /// + /// + /// + DisplayData, + /// + /// + /// + ExecuteResult, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class DisplayorExecuteOutputTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this DisplayorExecuteOutputType value) + { + return value switch + { + DisplayorExecuteOutputType.DisplayData => "display_data", + DisplayorExecuteOutputType.ExecuteResult => "execute_result", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static DisplayorExecuteOutputType? ToEnum(string value) + { + return value switch + { + "display_data" => DisplayorExecuteOutputType.DisplayData, + "execute_result" => DisplayorExecuteOutputType.ExecuteResult, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.WhoamiOrgApiKey.Json.g.cs b/src/libs/Together/Generated/Together.Models.EndpointPricing.Json.g.cs similarity index 89% rename from src/libs/Together/Generated/Together.Models.WhoamiOrgApiKey.Json.g.cs rename to src/libs/Together/Generated/Together.Models.EndpointPricing.Json.g.cs index 7e1d3d12..2635cea6 100644 --- a/src/libs/Together/Generated/Together.Models.WhoamiOrgApiKey.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.EndpointPricing.Json.g.cs @@ -2,7 +2,7 @@ namespace Together { - public sealed partial class WhoamiOrgApiKey + public sealed partial class EndpointPricing { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -47,20 +47,20 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::Together.WhoamiOrgApiKey? FromJson( + public static global::Together.EndpointPricing? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::Together.WhoamiOrgApiKey), - jsonSerializerContext) as global::Together.WhoamiOrgApiKey; + typeof(global::Together.EndpointPricing), + jsonSerializerContext) as global::Together.EndpointPricing; } /// /// Deserializes a JSON string using the generated default JsonSerializerContext. /// - public static global::Together.WhoamiOrgApiKey? FromJson( + public static global::Together.EndpointPricing? FromJson( string json) { return FromJson( @@ -75,7 +75,7 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::Together.WhoamiOrgApiKey? FromJson( + public static global::Together.EndpointPricing? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -86,7 +86,7 @@ public string ToJson( global::Together.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -94,20 +94,20 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, - typeof(global::Together.WhoamiOrgApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::Together.WhoamiOrgApiKey; + typeof(global::Together.EndpointPricing), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.EndpointPricing; } /// /// Deserializes a JSON stream using the generated default JsonSerializerContext. /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream) { return FromJsonStreamAsync( @@ -122,7 +122,7 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -133,7 +133,7 @@ public string ToJson( global::Together.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.DeserializeAsync( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/Together/Generated/Together.Models.WhoamiUser.g.cs b/src/libs/Together/Generated/Together.Models.EndpointPricing.g.cs similarity index 57% rename from src/libs/Together/Generated/Together.Models.WhoamiUser.g.cs rename to src/libs/Together/Generated/Together.Models.EndpointPricing.g.cs index 0286e9a8..59c63442 100644 --- a/src/libs/Together/Generated/Together.Models.WhoamiUser.g.cs +++ b/src/libs/Together/Generated/Together.Models.EndpointPricing.g.cs @@ -4,16 +4,16 @@ namespace Together { /// - /// + /// Pricing details for using an endpoint /// - public sealed partial class WhoamiUser + public sealed partial class EndpointPricing { /// - /// Authenticated user identifier. + /// Cost per minute of endpoint uptime in cents /// - [global::System.Text.Json.Serialization.JsonPropertyName("id")] + [global::System.Text.Json.Serialization.JsonPropertyName("cents_per_minute")] [global::System.Text.Json.Serialization.JsonRequired] - public required string Id { get; set; } + public required double CentsPerMinute { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -22,24 +22,24 @@ public sealed partial class WhoamiUser public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - /// - /// Authenticated user identifier. + /// + /// Cost per minute of endpoint uptime in cents /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif - public WhoamiUser( - string id) + public EndpointPricing( + double centsPerMinute) { - this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); + this.CentsPerMinute = centsPerMinute; } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public WhoamiUser() + public EndpointPricing() { } diff --git a/src/libs/Together/Generated/Together.Models.WhoamiUser.Json.g.cs b/src/libs/Together/Generated/Together.Models.Error.Json.g.cs similarity index 90% rename from src/libs/Together/Generated/Together.Models.WhoamiUser.Json.g.cs rename to src/libs/Together/Generated/Together.Models.Error.Json.g.cs index 3b8c7c83..0ca1a208 100644 --- a/src/libs/Together/Generated/Together.Models.WhoamiUser.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.Error.Json.g.cs @@ -2,7 +2,7 @@ namespace Together { - public sealed partial class WhoamiUser + public readonly partial struct Error { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -47,20 +47,20 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::Together.WhoamiUser? FromJson( + public static global::Together.Error? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::Together.WhoamiUser), - jsonSerializerContext) as global::Together.WhoamiUser; + typeof(global::Together.Error), + jsonSerializerContext) as global::Together.Error?; } /// /// Deserializes a JSON string using the generated default JsonSerializerContext. /// - public static global::Together.WhoamiUser? FromJson( + public static global::Together.Error? FromJson( string json) { return FromJson( @@ -75,7 +75,7 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::Together.WhoamiUser? FromJson( + public static global::Together.Error? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -86,7 +86,7 @@ public string ToJson( global::Together.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -94,20 +94,20 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, - typeof(global::Together.WhoamiUser), - jsonSerializerContext).ConfigureAwait(false)) as global::Together.WhoamiUser; + typeof(global::Together.Error), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.Error?; } /// /// Deserializes a JSON stream using the generated default JsonSerializerContext. /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream) { return FromJsonStreamAsync( @@ -122,7 +122,7 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -133,7 +133,7 @@ public string ToJson( global::Together.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.DeserializeAsync( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/Together/Generated/Together.Models.Error.g.cs b/src/libs/Together/Generated/Together.Models.Error.g.cs new file mode 100644 index 00000000..aec16c5a --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.Error.g.cs @@ -0,0 +1,272 @@ +#pragma warning disable CS0618 // Type or member is obsolete + +#nullable enable + +namespace Together +{ + /// + /// + /// + public readonly partial struct Error : global::System.IEquatable + { + /// + /// + /// +#if NET6_0_OR_GREATER + public string? ErrorVariant1 { get; init; } +#else + public string? ErrorVariant1 { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(ErrorVariant1))] +#endif + public bool IsErrorVariant1 => ErrorVariant1 != null; + + /// + /// + /// + public bool TryPickErrorVariant1( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out string? value) + { + value = ErrorVariant1; + return IsErrorVariant1; + } + + /// + /// + /// + public string PickErrorVariant1() => ErrorVariant1 is { } value + ? value + : throw new global::System.InvalidOperationException($"Expected union variant 'ErrorVariant1' but the value was {ToString()}."); + + /// + /// + /// +#if NET6_0_OR_GREATER + public object? ErrorVariant2 { get; init; } +#else + public object? ErrorVariant2 { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(ErrorVariant2))] +#endif + public bool IsErrorVariant2 => ErrorVariant2 != null; + + /// + /// + /// + public bool TryPickErrorVariant2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out object? value) + { + value = ErrorVariant2; + return IsErrorVariant2; + } + + /// + /// + /// + public object PickErrorVariant2() => ErrorVariant2 is { } value + ? value + : throw new global::System.InvalidOperationException($"Expected union variant 'ErrorVariant2' but the value was {ToString()}."); + /// + /// + /// + public static implicit operator Error(string value) => new Error((string?)value); + + /// + /// + /// + public static implicit operator string?(Error @this) => @this.ErrorVariant1; + + /// + /// + /// + public Error(string? value) + { + ErrorVariant1 = value; + } + + /// + /// + /// + public static Error FromErrorVariant1(string? value) => new Error(value); + + /// + /// + /// + public Error( + string? errorVariant1, + object? errorVariant2 + ) + { + ErrorVariant1 = errorVariant1; + ErrorVariant2 = errorVariant2; + } + + /// + /// + /// + public object? Object => + ErrorVariant2 as object ?? + ErrorVariant1 as object + ; + + /// + /// + /// + public override string? ToString() => + ErrorVariant1?.ToString() ?? + ErrorVariant2?.ToString() + ; + + /// + /// + /// + public bool Validate() + { + return IsErrorVariant1 && !IsErrorVariant2 || !IsErrorVariant1 && IsErrorVariant2; + } + + /// + /// + /// + public TResult? Match( + global::System.Func? errorVariant1 = null, + global::System.Func? errorVariant2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (ErrorVariant1 is { } __value0 && errorVariant1 != null) + { + return errorVariant1(__value0); + } + else if (ErrorVariant2 is { } __value1 && errorVariant2 != null) + { + return errorVariant2(__value1); + } + + return default(TResult); + } + + /// + /// + /// + public void Match( + global::System.Action? errorVariant1 = null, + + global::System.Action? errorVariant2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (ErrorVariant1 is { } __value0) + { + errorVariant1?.Invoke(__value0); + } + else if (ErrorVariant2 is { } __value1) + { + errorVariant2?.Invoke(__value1); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? errorVariant1 = null, + global::System.Action? errorVariant2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (ErrorVariant1 is { } __value0) + { + errorVariant1?.Invoke(__value0); + } + else if (ErrorVariant2 is { } __value1) + { + errorVariant2?.Invoke(__value1); + } + } + + /// + /// + /// + public override int GetHashCode() + { + var fields = new object?[] + { + ErrorVariant1, + typeof(string), + ErrorVariant2, + typeof(object), + }; + const int offset = unchecked((int)2166136261); + const int prime = 16777619; + static int HashCodeAggregator(int hashCode, object? value) => value == null + ? (hashCode ^ 0) * prime + : (hashCode ^ value.GetHashCode()) * prime; + + return global::System.Linq.Enumerable.Aggregate(fields, offset, HashCodeAggregator); + } + + /// + /// + /// + public bool Equals(Error other) + { + return + global::System.Collections.Generic.EqualityComparer.Default.Equals(ErrorVariant1, other.ErrorVariant1) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(ErrorVariant2, other.ErrorVariant2) + ; + } + + /// + /// + /// + public static bool operator ==(Error obj1, Error obj2) + { + return global::System.Collections.Generic.EqualityComparer.Default.Equals(obj1, obj2); + } + + /// + /// + /// + public static bool operator !=(Error obj1, Error obj2) + { + return !(obj1 == obj2); + } + + /// + /// + /// + public override bool Equals(object? obj) + { + return obj is Error o && Equals(o); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.WhoamiProject.Json.g.cs b/src/libs/Together/Generated/Together.Models.ErrorOutput.Json.g.cs similarity index 89% rename from src/libs/Together/Generated/Together.Models.WhoamiProject.Json.g.cs rename to src/libs/Together/Generated/Together.Models.ErrorOutput.Json.g.cs index a35ce33a..1d38f534 100644 --- a/src/libs/Together/Generated/Together.Models.WhoamiProject.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ErrorOutput.Json.g.cs @@ -2,7 +2,7 @@ namespace Together { - public sealed partial class WhoamiProject + public sealed partial class ErrorOutput { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -47,20 +47,20 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::Together.WhoamiProject? FromJson( + public static global::Together.ErrorOutput? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::Together.WhoamiProject), - jsonSerializerContext) as global::Together.WhoamiProject; + typeof(global::Together.ErrorOutput), + jsonSerializerContext) as global::Together.ErrorOutput; } /// /// Deserializes a JSON string using the generated default JsonSerializerContext. /// - public static global::Together.WhoamiProject? FromJson( + public static global::Together.ErrorOutput? FromJson( string json) { return FromJson( @@ -75,7 +75,7 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::Together.WhoamiProject? FromJson( + public static global::Together.ErrorOutput? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -86,7 +86,7 @@ public string ToJson( global::Together.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -94,20 +94,20 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, - typeof(global::Together.WhoamiProject), - jsonSerializerContext).ConfigureAwait(false)) as global::Together.WhoamiProject; + typeof(global::Together.ErrorOutput), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.ErrorOutput; } /// /// Deserializes a JSON stream using the generated default JsonSerializerContext. /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream) { return FromJsonStreamAsync( @@ -122,7 +122,7 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -133,7 +133,7 @@ public string ToJson( global::Together.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.DeserializeAsync( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/Together/Generated/Together.Models.WhoamiUserJwt.g.cs b/src/libs/Together/Generated/Together.Models.ErrorOutput.g.cs similarity index 56% rename from src/libs/Together/Generated/Together.Models.WhoamiUserJwt.g.cs rename to src/libs/Together/Generated/Together.Models.ErrorOutput.g.cs index 8485c81d..148d3931 100644 --- a/src/libs/Together/Generated/Together.Models.WhoamiUserJwt.g.cs +++ b/src/libs/Together/Generated/Together.Models.ErrorOutput.g.cs @@ -4,23 +4,23 @@ namespace Together { /// - /// + /// Errors and exceptions that occurred. If this output type is present, your code did not execute successfully. /// - public sealed partial class WhoamiUserJwt + public sealed partial class ErrorOutput { /// - /// Always `user_jwt`. + /// /// - [global::System.Text.Json.Serialization.JsonPropertyName("type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.WhoamiUserJwtTypeJsonConverter))] - public global::Together.WhoamiUserJwtType Type { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Data { get; set; } /// /// /// - [global::System.Text.Json.Serialization.JsonPropertyName("user")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Together.WhoamiUser User { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("type")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.ErrorOutputTypeJsonConverter))] + public global::Together.ErrorOutputType Type { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -29,27 +29,25 @@ public sealed partial class WhoamiUserJwt public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - /// - /// - /// Always `user_jwt`. - /// + /// + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif - public WhoamiUserJwt( - global::Together.WhoamiUser user, - global::Together.WhoamiUserJwtType type) + public ErrorOutput( + string data, + global::Together.ErrorOutputType type) { + this.Data = data ?? throw new global::System.ArgumentNullException(nameof(data)); this.Type = type; - this.User = user ?? throw new global::System.ArgumentNullException(nameof(user)); } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public WhoamiUserJwt() + public ErrorOutput() { } diff --git a/src/libs/Together/Generated/Together.Models.WhoamiUserJwtType.g.cs b/src/libs/Together/Generated/Together.Models.ErrorOutputType.g.cs similarity index 65% rename from src/libs/Together/Generated/Together.Models.WhoamiUserJwtType.g.cs rename to src/libs/Together/Generated/Together.Models.ErrorOutputType.g.cs index cfd03cdc..3c6b804a 100644 --- a/src/libs/Together/Generated/Together.Models.WhoamiUserJwtType.g.cs +++ b/src/libs/Together/Generated/Together.Models.ErrorOutputType.g.cs @@ -4,40 +4,40 @@ namespace Together { /// - /// Always `user_jwt`. + /// /// - public enum WhoamiUserJwtType + public enum ErrorOutputType { /// /// /// - UserJwt, + Error, } /// /// Enum extensions to do fast conversions without the reflection. /// - public static class WhoamiUserJwtTypeExtensions + public static class ErrorOutputTypeExtensions { /// /// Converts an enum to a string. /// - public static string ToValueString(this WhoamiUserJwtType value) + public static string ToValueString(this ErrorOutputType value) { return value switch { - WhoamiUserJwtType.UserJwt => "user_jwt", + ErrorOutputType.Error => "error", _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), }; } /// /// Converts an string to a enum. /// - public static WhoamiUserJwtType? ToEnum(string value) + public static ErrorOutputType? ToEnum(string value) { return value switch { - "user_jwt" => WhoamiUserJwtType.UserJwt, + "error" => ErrorOutputType.Error, _ => null, }; } diff --git a/src/libs/Together/Generated/Together.Models.WhoamiUserJwt.Json.g.cs b/src/libs/Together/Generated/Together.Models.ErrorVariant2.Json.g.cs similarity index 89% rename from src/libs/Together/Generated/Together.Models.WhoamiUserJwt.Json.g.cs rename to src/libs/Together/Generated/Together.Models.ErrorVariant2.Json.g.cs index 45a21485..aedacaca 100644 --- a/src/libs/Together/Generated/Together.Models.WhoamiUserJwt.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ErrorVariant2.Json.g.cs @@ -2,7 +2,7 @@ namespace Together { - public sealed partial class WhoamiUserJwt + public sealed partial class ErrorVariant2 { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -47,20 +47,20 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::Together.WhoamiUserJwt? FromJson( + public static global::Together.ErrorVariant2? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::Together.WhoamiUserJwt), - jsonSerializerContext) as global::Together.WhoamiUserJwt; + typeof(global::Together.ErrorVariant2), + jsonSerializerContext) as global::Together.ErrorVariant2; } /// /// Deserializes a JSON string using the generated default JsonSerializerContext. /// - public static global::Together.WhoamiUserJwt? FromJson( + public static global::Together.ErrorVariant2? FromJson( string json) { return FromJson( @@ -75,7 +75,7 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::Together.WhoamiUserJwt? FromJson( + public static global::Together.ErrorVariant2? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -86,7 +86,7 @@ public string ToJson( global::Together.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -94,20 +94,20 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, - typeof(global::Together.WhoamiUserJwt), - jsonSerializerContext).ConfigureAwait(false)) as global::Together.WhoamiUserJwt; + typeof(global::Together.ErrorVariant2), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.ErrorVariant2; } /// /// Deserializes a JSON stream using the generated default JsonSerializerContext. /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream) { return FromJsonStreamAsync( @@ -122,7 +122,7 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -133,7 +133,7 @@ public string ToJson( global::Together.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.DeserializeAsync( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/Together/Generated/Together.Models.ErrorVariant2.g.cs b/src/libs/Together/Generated/Together.Models.ErrorVariant2.g.cs new file mode 100644 index 00000000..42c75201 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ErrorVariant2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class ErrorVariant2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.ExecuteRequest.Json.g.cs b/src/libs/Together/Generated/Together.Models.ExecuteRequest.Json.g.cs new file mode 100644 index 00000000..d27f42cb --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ExecuteRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class ExecuteRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + 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); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.ExecuteRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.ExecuteRequest), + jsonSerializerContext) as global::Together.ExecuteRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ExecuteRequest? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.ExecuteRequest? FromJson( + 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); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.ExecuteRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.ExecuteRequest; + } + + /// + /// 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.Models.ExecuteRequest.g.cs b/src/libs/Together/Generated/Together.Models.ExecuteRequest.g.cs new file mode 100644 index 00000000..b9cc3f26 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ExecuteRequest.g.cs @@ -0,0 +1,102 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class ExecuteRequest + { + /// + /// Code snippet to execute.
+ /// Example: print('Hello, world!') + ///
+ /// print('Hello, world!') + [global::System.Text.Json.Serialization.JsonPropertyName("code")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Code { get; set; } + + /// + /// Files to upload to the session. If present, files are uploaded before executing the given code. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("files")] + public global::System.Collections.Generic.IList? Files { get; set; } + + /// + /// Programming language for the code to execute. Currently only supports Python.
+ /// Default Value: python + ///
+ /// global::Together.ExecuteRequestLanguage.Python + [global::System.Text.Json.Serialization.JsonPropertyName("language")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.ExecuteRequestLanguageJsonConverter))] + public global::Together.ExecuteRequestLanguage Language { get; set; } = global::Together.ExecuteRequestLanguage.Python; + + /// + /// Identifier of the current session. Used to make follow-up calls. Returns an error if the session does not belong to the caller or has expired.
+ /// Example: ses_abcDEF123 + ///
+ /// ses_abcDEF123 + [global::System.Text.Json.Serialization.JsonPropertyName("session_id")] + public string? SessionId { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Code snippet to execute.
+ /// Example: print('Hello, world!') + /// + /// + /// Files to upload to the session. If present, files are uploaded before executing the given code. + /// + /// + /// Identifier of the current session. Used to make follow-up calls. Returns an error if the session does not belong to the caller or has expired.
+ /// Example: ses_abcDEF123 + /// + /// + /// Programming language for the code to execute. Currently only supports Python.
+ /// Default Value: python + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ExecuteRequest( + string code, + global::System.Collections.Generic.IList? files, + string? sessionId, + global::Together.ExecuteRequestLanguage language = global::Together.ExecuteRequestLanguage.Python) + { + this.Code = code ?? throw new global::System.ArgumentNullException(nameof(code)); + this.Files = files; + this.Language = language; + this.SessionId = sessionId; + } + + /// + /// Initializes a new instance of the class. + /// + public ExecuteRequest() + { + } + + /// + /// Creates a new from its single non-const required field, + /// hardcoding any const discriminator fields. + /// + public static ExecuteRequest FromCode(string code) + { + return new ExecuteRequest + { + Code = code, + }; + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.ExecuteRequestFile.Json.g.cs b/src/libs/Together/Generated/Together.Models.ExecuteRequestFile.Json.g.cs new file mode 100644 index 00000000..fb2c1bb1 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ExecuteRequestFile.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class ExecuteRequestFile + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + 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); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.ExecuteRequestFile? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.ExecuteRequestFile), + jsonSerializerContext) as global::Together.ExecuteRequestFile; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ExecuteRequestFile? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.ExecuteRequestFile? FromJson( + 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); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.ExecuteRequestFile), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.ExecuteRequestFile; + } + + /// + /// 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.Models.WhoamiProject.g.cs b/src/libs/Together/Generated/Together.Models.ExecuteRequestFile.g.cs similarity index 52% rename from src/libs/Together/Generated/Together.Models.WhoamiProject.g.cs rename to src/libs/Together/Generated/Together.Models.ExecuteRequestFile.g.cs index 6fd90632..47c3a7e4 100644 --- a/src/libs/Together/Generated/Together.Models.WhoamiProject.g.cs +++ b/src/libs/Together/Generated/Together.Models.ExecuteRequestFile.g.cs @@ -6,28 +6,29 @@ namespace Together /// /// /// - public sealed partial class WhoamiProject + public sealed partial class ExecuteRequestFile { /// - /// Project identifier. + /// /// - [global::System.Text.Json.Serialization.JsonPropertyName("id")] + [global::System.Text.Json.Serialization.JsonPropertyName("content")] [global::System.Text.Json.Serialization.JsonRequired] - public required string Id { get; set; } + public required string Content { get; set; } /// - /// Project display name. + /// Encoding of the file content. Use `string` for text files such as code, and `base64` for binary files, such as images. /// - [global::System.Text.Json.Serialization.JsonPropertyName("name")] + [global::System.Text.Json.Serialization.JsonPropertyName("encoding")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.ExecuteRequestFileEncodingJsonConverter))] [global::System.Text.Json.Serialization.JsonRequired] - public required string Name { get; set; } + public required global::Together.ExecuteRequestFileEncoding Encoding { get; set; } /// - /// DNS-friendly project identifier. Used with an endpoint slug as `<project_slug>/<endpoint_slug>` to form the `model` value in dedicated endpoint inference calls. + /// /// - [global::System.Text.Json.Serialization.JsonPropertyName("slug")] + [global::System.Text.Json.Serialization.JsonPropertyName("name")] [global::System.Text.Json.Serialization.JsonRequired] - public required string Slug { get; set; } + public required string Name { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -36,34 +37,30 @@ public sealed partial class WhoamiProject public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - /// - /// Project identifier. - /// - /// - /// Project display name. - /// - /// - /// DNS-friendly project identifier. Used with an endpoint slug as `<project_slug>/<endpoint_slug>` to form the `model` value in dedicated endpoint inference calls. + /// + /// + /// Encoding of the file content. Use `string` for text files such as code, and `base64` for binary files, such as images. /// + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif - public WhoamiProject( - string id, - string name, - string slug) + public ExecuteRequestFile( + string content, + global::Together.ExecuteRequestFileEncoding encoding, + string name) { - this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); + this.Content = content ?? throw new global::System.ArgumentNullException(nameof(content)); + this.Encoding = encoding; this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); - this.Slug = slug ?? throw new global::System.ArgumentNullException(nameof(slug)); } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public WhoamiProject() + public ExecuteRequestFile() { } diff --git a/src/libs/Together/Generated/Together.Models.ExecuteRequestFileEncoding.g.cs b/src/libs/Together/Generated/Together.Models.ExecuteRequestFileEncoding.g.cs new file mode 100644 index 00000000..a42f3501 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ExecuteRequestFileEncoding.g.cs @@ -0,0 +1,51 @@ + +#nullable enable + +namespace Together +{ + /// + /// Encoding of the file content. Use `string` for text files such as code, and `base64` for binary files, such as images. + /// + public enum ExecuteRequestFileEncoding + { + /// + /// + /// + Base64, + /// + /// + /// + String, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class ExecuteRequestFileEncodingExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this ExecuteRequestFileEncoding value) + { + return value switch + { + ExecuteRequestFileEncoding.Base64 => "base64", + ExecuteRequestFileEncoding.String => "string", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static ExecuteRequestFileEncoding? ToEnum(string value) + { + return value switch + { + "base64" => ExecuteRequestFileEncoding.Base64, + "string" => ExecuteRequestFileEncoding.String, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.ExecuteRequestLanguage.g.cs b/src/libs/Together/Generated/Together.Models.ExecuteRequestLanguage.g.cs new file mode 100644 index 00000000..eba348c6 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ExecuteRequestLanguage.g.cs @@ -0,0 +1,46 @@ + +#nullable enable + +namespace Together +{ + /// + /// Programming language for the code to execute. Currently only supports Python.
+ /// Default Value: python + ///
+ public enum ExecuteRequestLanguage + { + /// + /// + /// + Python, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class ExecuteRequestLanguageExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this ExecuteRequestLanguage value) + { + return value switch + { + ExecuteRequestLanguage.Python => "python", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static ExecuteRequestLanguage? ToEnum(string value) + { + return value switch + { + "python" => ExecuteRequestLanguage.Python, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.ExecuteResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.ExecuteResponse.Json.g.cs new file mode 100644 index 00000000..f501a2b0 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ExecuteResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public readonly partial struct ExecuteResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + 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); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.ExecuteResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.ExecuteResponse), + jsonSerializerContext) as global::Together.ExecuteResponse?; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ExecuteResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.ExecuteResponse? FromJson( + 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); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.ExecuteResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.ExecuteResponse?; + } + + /// + /// 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.Models.ExecuteResponse.g.cs b/src/libs/Together/Generated/Together.Models.ExecuteResponse.g.cs new file mode 100644 index 00000000..91f913c5 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ExecuteResponse.g.cs @@ -0,0 +1,295 @@ +#pragma warning disable CS0618 // Type or member is obsolete + +#nullable enable + +namespace Together +{ + /// + /// The result of the execution. If successful, `data` contains the result and `errors` is null. If unsuccessful, `data` is null and `errors` contains the errors. + /// + public readonly partial struct ExecuteResponse : global::System.IEquatable + { + /// + /// + /// +#if NET6_0_OR_GREATER + public global::Together.ExecuteResponseSuccessfulExecution? SuccessfulExecution { get; init; } +#else + public global::Together.ExecuteResponseSuccessfulExecution? SuccessfulExecution { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(SuccessfulExecution))] +#endif + public bool IsSuccessfulExecution => SuccessfulExecution != null; + + /// + /// + /// + public bool TryPickSuccessfulExecution( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Together.ExecuteResponseSuccessfulExecution? value) + { + value = SuccessfulExecution; + return IsSuccessfulExecution; + } + + /// + /// + /// + public global::Together.ExecuteResponseSuccessfulExecution PickSuccessfulExecution() => SuccessfulExecution is { } value + ? value + : throw new global::System.InvalidOperationException($"Expected union variant 'SuccessfulExecution' but the value was {ToString()}."); + + /// + /// + /// +#if NET6_0_OR_GREATER + public global::Together.ExecuteResponseFailedExecution? FailedExecution { get; init; } +#else + public global::Together.ExecuteResponseFailedExecution? FailedExecution { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(FailedExecution))] +#endif + public bool IsFailedExecution => FailedExecution != null; + + /// + /// + /// + public bool TryPickFailedExecution( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Together.ExecuteResponseFailedExecution? value) + { + value = FailedExecution; + return IsFailedExecution; + } + + /// + /// + /// + public global::Together.ExecuteResponseFailedExecution PickFailedExecution() => FailedExecution is { } value + ? value + : throw new global::System.InvalidOperationException($"Expected union variant 'FailedExecution' but the value was {ToString()}."); + /// + /// + /// + public static implicit operator ExecuteResponse(global::Together.ExecuteResponseSuccessfulExecution value) => new ExecuteResponse((global::Together.ExecuteResponseSuccessfulExecution?)value); + + /// + /// + /// + public static implicit operator global::Together.ExecuteResponseSuccessfulExecution?(ExecuteResponse @this) => @this.SuccessfulExecution; + + /// + /// + /// + public ExecuteResponse(global::Together.ExecuteResponseSuccessfulExecution? value) + { + SuccessfulExecution = value; + } + + /// + /// + /// + public static ExecuteResponse FromSuccessfulExecution(global::Together.ExecuteResponseSuccessfulExecution? value) => new ExecuteResponse(value); + + /// + /// + /// + public static implicit operator ExecuteResponse(global::Together.ExecuteResponseFailedExecution value) => new ExecuteResponse((global::Together.ExecuteResponseFailedExecution?)value); + + /// + /// + /// + public static implicit operator global::Together.ExecuteResponseFailedExecution?(ExecuteResponse @this) => @this.FailedExecution; + + /// + /// + /// + public ExecuteResponse(global::Together.ExecuteResponseFailedExecution? value) + { + FailedExecution = value; + } + + /// + /// + /// + public static ExecuteResponse FromFailedExecution(global::Together.ExecuteResponseFailedExecution? value) => new ExecuteResponse(value); + + /// + /// + /// + public ExecuteResponse( + global::Together.ExecuteResponseSuccessfulExecution? successfulExecution, + global::Together.ExecuteResponseFailedExecution? failedExecution + ) + { + SuccessfulExecution = successfulExecution; + FailedExecution = failedExecution; + } + + /// + /// + /// + public object? Object => + FailedExecution as object ?? + SuccessfulExecution as object + ; + + /// + /// + /// + public override string? ToString() => + SuccessfulExecution?.ToString() ?? + FailedExecution?.ToString() + ; + + /// + /// + /// + public bool Validate() + { + return IsSuccessfulExecution && !IsFailedExecution || !IsSuccessfulExecution && IsFailedExecution; + } + + /// + /// + /// + public TResult? Match( + global::System.Func? successfulExecution = null, + global::System.Func? failedExecution = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (SuccessfulExecution is { } __value0 && successfulExecution != null) + { + return successfulExecution(__value0); + } + else if (FailedExecution is { } __value1 && failedExecution != null) + { + return failedExecution(__value1); + } + + return default(TResult); + } + + /// + /// + /// + public void Match( + global::System.Action? successfulExecution = null, + + global::System.Action? failedExecution = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (SuccessfulExecution is { } __value0) + { + successfulExecution?.Invoke(__value0); + } + else if (FailedExecution is { } __value1) + { + failedExecution?.Invoke(__value1); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? successfulExecution = null, + global::System.Action? failedExecution = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (SuccessfulExecution is { } __value0) + { + successfulExecution?.Invoke(__value0); + } + else if (FailedExecution is { } __value1) + { + failedExecution?.Invoke(__value1); + } + } + + /// + /// + /// + public override int GetHashCode() + { + var fields = new object?[] + { + SuccessfulExecution, + typeof(global::Together.ExecuteResponseSuccessfulExecution), + FailedExecution, + typeof(global::Together.ExecuteResponseFailedExecution), + }; + const int offset = unchecked((int)2166136261); + const int prime = 16777619; + static int HashCodeAggregator(int hashCode, object? value) => value == null + ? (hashCode ^ 0) * prime + : (hashCode ^ value.GetHashCode()) * prime; + + return global::System.Linq.Enumerable.Aggregate(fields, offset, HashCodeAggregator); + } + + /// + /// + /// + public bool Equals(ExecuteResponse other) + { + return + global::System.Collections.Generic.EqualityComparer.Default.Equals(SuccessfulExecution, other.SuccessfulExecution) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(FailedExecution, other.FailedExecution) + ; + } + + /// + /// + /// + public static bool operator ==(ExecuteResponse obj1, ExecuteResponse obj2) + { + return global::System.Collections.Generic.EqualityComparer.Default.Equals(obj1, obj2); + } + + /// + /// + /// + public static bool operator !=(ExecuteResponse obj1, ExecuteResponse obj2) + { + return !(obj1 == obj2); + } + + /// + /// + /// + public override bool Equals(object? obj) + { + return obj is ExecuteResponse o && Equals(o); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.ExecuteResponseFailedExecution.Json.g.cs b/src/libs/Together/Generated/Together.Models.ExecuteResponseFailedExecution.Json.g.cs new file mode 100644 index 00000000..a9752870 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ExecuteResponseFailedExecution.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class ExecuteResponseFailedExecution + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + 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); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.ExecuteResponseFailedExecution? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.ExecuteResponseFailedExecution), + jsonSerializerContext) as global::Together.ExecuteResponseFailedExecution; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ExecuteResponseFailedExecution? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.ExecuteResponseFailedExecution? FromJson( + 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); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.ExecuteResponseFailedExecution), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.ExecuteResponseFailedExecution; + } + + /// + /// 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.Models.ExecuteResponseFailedExecution.g.cs b/src/libs/Together/Generated/Together.Models.ExecuteResponseFailedExecution.g.cs new file mode 100644 index 00000000..fc1275c9 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ExecuteResponseFailedExecution.g.cs @@ -0,0 +1,54 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class ExecuteResponseFailedExecution + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + public object? Data { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("errors")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList> Errors { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ExecuteResponseFailedExecution( + global::System.Collections.Generic.IList> errors, + object? data) + { + this.Data = data; + this.Errors = errors ?? throw new global::System.ArgumentNullException(nameof(errors)); + } + + /// + /// Initializes a new instance of the class. + /// + public ExecuteResponseFailedExecution() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.ExecuteResponseFailedExecutionError.Json.g.cs b/src/libs/Together/Generated/Together.Models.ExecuteResponseFailedExecutionError.Json.g.cs new file mode 100644 index 00000000..de46e32c --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ExecuteResponseFailedExecutionError.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class ExecuteResponseFailedExecutionError + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + 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); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.ExecuteResponseFailedExecutionError? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.ExecuteResponseFailedExecutionError), + jsonSerializerContext) as global::Together.ExecuteResponseFailedExecutionError; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ExecuteResponseFailedExecutionError? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.ExecuteResponseFailedExecutionError? FromJson( + 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); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.ExecuteResponseFailedExecutionError), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.ExecuteResponseFailedExecutionError; + } + + /// + /// 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.Models.ExecuteResponseFailedExecutionError.g.cs b/src/libs/Together/Generated/Together.Models.ExecuteResponseFailedExecutionError.g.cs new file mode 100644 index 00000000..ccf76dcf --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ExecuteResponseFailedExecutionError.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class ExecuteResponseFailedExecutionError + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecution.Json.g.cs b/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecution.Json.g.cs new file mode 100644 index 00000000..c274f133 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecution.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class ExecuteResponseSuccessfulExecution + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + 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); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.ExecuteResponseSuccessfulExecution? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.ExecuteResponseSuccessfulExecution), + jsonSerializerContext) as global::Together.ExecuteResponseSuccessfulExecution; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ExecuteResponseSuccessfulExecution? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.ExecuteResponseSuccessfulExecution? FromJson( + 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); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.ExecuteResponseSuccessfulExecution), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.ExecuteResponseSuccessfulExecution; + } + + /// + /// 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.Models.ExecuteResponseSuccessfulExecution.g.cs b/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecution.g.cs new file mode 100644 index 00000000..52c7a137 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecution.g.cs @@ -0,0 +1,54 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class ExecuteResponseSuccessfulExecution + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("errors")] + public object? Errors { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.ExecuteResponseSuccessfulExecutionData Data { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ExecuteResponseSuccessfulExecution( + global::Together.ExecuteResponseSuccessfulExecutionData data, + object? errors) + { + this.Errors = errors; + this.Data = data ?? throw new global::System.ArgumentNullException(nameof(data)); + } + + /// + /// Initializes a new instance of the class. + /// + public ExecuteResponseSuccessfulExecution() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionData.Json.g.cs b/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionData.Json.g.cs new file mode 100644 index 00000000..2d781770 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionData.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class ExecuteResponseSuccessfulExecutionData + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + 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); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.ExecuteResponseSuccessfulExecutionData? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.ExecuteResponseSuccessfulExecutionData), + jsonSerializerContext) as global::Together.ExecuteResponseSuccessfulExecutionData; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ExecuteResponseSuccessfulExecutionData? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.ExecuteResponseSuccessfulExecutionData? FromJson( + 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); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.ExecuteResponseSuccessfulExecutionData), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.ExecuteResponseSuccessfulExecutionData; + } + + /// + /// 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.Models.ExecuteResponseSuccessfulExecutionData.g.cs b/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionData.g.cs new file mode 100644 index 00000000..23ab5ef2 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionData.g.cs @@ -0,0 +1,72 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class ExecuteResponseSuccessfulExecutionData + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("outputs")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Outputs { get; set; } + + /// + /// Identifier of the current session. Used to make follow-up calls.
+ /// Example: ses_abcDEF123 + ///
+ /// ses_abcDEF123 + [global::System.Text.Json.Serialization.JsonPropertyName("session_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string SessionId { get; set; } + + /// + /// Status of the execution. Currently only supports success. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("status")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.ExecuteResponseSuccessfulExecutionDataStatusJsonConverter))] + public global::Together.ExecuteResponseSuccessfulExecutionDataStatus? Status { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// + /// Identifier of the current session. Used to make follow-up calls.
+ /// Example: ses_abcDEF123 + /// + /// + /// Status of the execution. Currently only supports success. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ExecuteResponseSuccessfulExecutionData( + global::System.Collections.Generic.IList outputs, + string sessionId, + global::Together.ExecuteResponseSuccessfulExecutionDataStatus? status) + { + this.Outputs = outputs ?? throw new global::System.ArgumentNullException(nameof(outputs)); + this.SessionId = sessionId ?? throw new global::System.ArgumentNullException(nameof(sessionId)); + this.Status = status; + } + + /// + /// Initializes a new instance of the class. + /// + public ExecuteResponseSuccessfulExecutionData() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputDiscriminator.Json.g.cs b/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputDiscriminator.Json.g.cs new file mode 100644 index 00000000..d7382535 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputDiscriminator.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class ExecuteResponseSuccessfulExecutionDataOutputDiscriminator + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + 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); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.ExecuteResponseSuccessfulExecutionDataOutputDiscriminator? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.ExecuteResponseSuccessfulExecutionDataOutputDiscriminator), + jsonSerializerContext) as global::Together.ExecuteResponseSuccessfulExecutionDataOutputDiscriminator; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ExecuteResponseSuccessfulExecutionDataOutputDiscriminator? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.ExecuteResponseSuccessfulExecutionDataOutputDiscriminator? FromJson( + 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); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.ExecuteResponseSuccessfulExecutionDataOutputDiscriminator), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.ExecuteResponseSuccessfulExecutionDataOutputDiscriminator; + } + + /// + /// 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.Models.ExecuteResponseSuccessfulExecutionDataOutputDiscriminator.g.cs b/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputDiscriminator.g.cs new file mode 100644 index 00000000..4f25652b --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputDiscriminator.g.cs @@ -0,0 +1,45 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class ExecuteResponseSuccessfulExecutionDataOutputDiscriminator + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("type")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.ExecuteResponseSuccessfulExecutionDataOutputDiscriminatorTypeJsonConverter))] + public global::Together.ExecuteResponseSuccessfulExecutionDataOutputDiscriminatorType? Type { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ExecuteResponseSuccessfulExecutionDataOutputDiscriminator( + global::Together.ExecuteResponseSuccessfulExecutionDataOutputDiscriminatorType? type) + { + this.Type = type; + } + + /// + /// Initializes a new instance of the class. + /// + public ExecuteResponseSuccessfulExecutionDataOutputDiscriminator() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputDiscriminatorType.g.cs b/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputDiscriminatorType.g.cs new file mode 100644 index 00000000..dc8ffd1a --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputDiscriminatorType.g.cs @@ -0,0 +1,45 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public enum ExecuteResponseSuccessfulExecutionDataOutputDiscriminatorType + { + /// + /// + /// + Error, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class ExecuteResponseSuccessfulExecutionDataOutputDiscriminatorTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this ExecuteResponseSuccessfulExecutionDataOutputDiscriminatorType value) + { + return value switch + { + ExecuteResponseSuccessfulExecutionDataOutputDiscriminatorType.Error => "error", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static ExecuteResponseSuccessfulExecutionDataOutputDiscriminatorType? ToEnum(string value) + { + return value switch + { + "error" => ExecuteResponseSuccessfulExecutionDataOutputDiscriminatorType.Error, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutput.Json.g.cs b/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutput.Json.g.cs new file mode 100644 index 00000000..ff3e66ed --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutput.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutput + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + 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); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutput? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutput), + jsonSerializerContext) as global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutput; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutput? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutput? FromJson( + 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); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutput), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutput; + } + + /// + /// 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.Models.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutput.g.cs b/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutput.g.cs new file mode 100644 index 00000000..a877acd1 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutput.g.cs @@ -0,0 +1,56 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutput + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputData Data { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("type")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputTypeJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputType Type { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutput( + global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputData data, + global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputType type) + { + this.Data = data ?? throw new global::System.ArgumentNullException(nameof(data)); + this.Type = type; + } + + /// + /// Initializes a new instance of the class. + /// + public ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutput() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputData.Json.g.cs b/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputData.Json.g.cs new file mode 100644 index 00000000..cd602ece --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputData.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputData + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + 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); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputData? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputData), + jsonSerializerContext) as global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputData; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputData? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputData? FromJson( + 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); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputData), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputData; + } + + /// + /// 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.Models.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputData.g.cs b/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputData.g.cs new file mode 100644 index 00000000..e2111b97 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputData.g.cs @@ -0,0 +1,161 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputData + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("application/geo+json")] + public object? ApplicationGeoJson { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("application/javascript")] + public string? ApplicationJavascript { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("application/json")] + public object? ApplicationJson { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("application/pdf")] + public byte[]? ApplicationPdf { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("application/vnd.vega.v5+json")] + public object? ApplicationVndVegaV5Json { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("application/vnd.vegalite.v4+json")] + public object? ApplicationVndVegaliteV4Json { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("image/gif")] + public byte[]? ImageGif { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("image/jpeg")] + public byte[]? ImageJpeg { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("image/png")] + public byte[]? ImagePng { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("image/svg+xml")] + public string? ImageSvgXml { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("text/html")] + public string? TextHtml { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("text/latex")] + public string? TextLatex { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("text/markdown")] + public string? TextMarkdown { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("text/plain")] + public string? TextPlain { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputData( + object? applicationGeoJson, + string? applicationJavascript, + object? applicationJson, + byte[]? applicationPdf, + object? applicationVndVegaV5Json, + object? applicationVndVegaliteV4Json, + byte[]? imageGif, + byte[]? imageJpeg, + byte[]? imagePng, + string? imageSvgXml, + string? textHtml, + string? textLatex, + string? textMarkdown, + string? textPlain) + { + this.ApplicationGeoJson = applicationGeoJson; + this.ApplicationJavascript = applicationJavascript; + this.ApplicationJson = applicationJson; + this.ApplicationPdf = applicationPdf; + this.ApplicationVndVegaV5Json = applicationVndVegaV5Json; + this.ApplicationVndVegaliteV4Json = applicationVndVegaliteV4Json; + this.ImageGif = imageGif; + this.ImageJpeg = imageJpeg; + this.ImagePng = imagePng; + this.ImageSvgXml = imageSvgXml; + this.TextHtml = textHtml; + this.TextLatex = textLatex; + this.TextMarkdown = textMarkdown; + this.TextPlain = textPlain; + } + + /// + /// Initializes a new instance of the class. + /// + public ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputData() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationGeoJson.Json.g.cs b/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationGeoJson.Json.g.cs new file mode 100644 index 00000000..d22cbf4a --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationGeoJson.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationGeoJson + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + 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); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationGeoJson? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationGeoJson), + jsonSerializerContext) as global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationGeoJson; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationGeoJson? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationGeoJson? FromJson( + 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); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationGeoJson), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationGeoJson; + } + + /// + /// 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.Models.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationGeoJson.g.cs b/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationGeoJson.g.cs new file mode 100644 index 00000000..c765e1dc --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationGeoJson.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationGeoJson + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationJson.Json.g.cs b/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationJson.Json.g.cs new file mode 100644 index 00000000..f06d647e --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationJson.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationJson + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + 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); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationJson? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationJson), + jsonSerializerContext) as global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationJson; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationJson? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationJson? FromJson( + 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); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationJson), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationJson; + } + + /// + /// 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.Models.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationJson.g.cs b/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationJson.g.cs new file mode 100644 index 00000000..858bcf74 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationJson.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationJson + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationVndVegaV5Json.Json.g.cs b/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationVndVegaV5Json.Json.g.cs new file mode 100644 index 00000000..b1fe79e3 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationVndVegaV5Json.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationVndVegaV5Json + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + 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); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationVndVegaV5Json? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationVndVegaV5Json), + jsonSerializerContext) as global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationVndVegaV5Json; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationVndVegaV5Json? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationVndVegaV5Json? FromJson( + 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); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationVndVegaV5Json), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationVndVegaV5Json; + } + + /// + /// 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.Models.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationVndVegaV5Json.g.cs b/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationVndVegaV5Json.g.cs new file mode 100644 index 00000000..6918f1f3 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationVndVegaV5Json.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationVndVegaV5Json + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationVndVegaliteV4Json.Json.g.cs b/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationVndVegaliteV4Json.Json.g.cs new file mode 100644 index 00000000..9c935b10 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationVndVegaliteV4Json.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationVndVegaliteV4Json + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + 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); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationVndVegaliteV4Json? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationVndVegaliteV4Json), + jsonSerializerContext) as global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationVndVegaliteV4Json; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationVndVegaliteV4Json? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationVndVegaliteV4Json? FromJson( + 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); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationVndVegaliteV4Json), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationVndVegaliteV4Json; + } + + /// + /// 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.Models.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationVndVegaliteV4Json.g.cs b/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationVndVegaliteV4Json.g.cs new file mode 100644 index 00000000..69342be0 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationVndVegaliteV4Json.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputDataApplicationVndVegaliteV4Json + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputType.g.cs b/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputType.g.cs new file mode 100644 index 00000000..e02ca48a --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputType.g.cs @@ -0,0 +1,51 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public enum ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputType + { + /// + /// + /// + DisplayData, + /// + /// + /// + ExecuteResult, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputType value) + { + return value switch + { + ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputType.DisplayData => "display_data", + ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputType.ExecuteResult => "execute_result", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputType? ToEnum(string value) + { + return value switch + { + "display_data" => ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputType.DisplayData, + "execute_result" => ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutputType.ExecuteResult, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputErrorOutput.Json.g.cs b/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputErrorOutput.Json.g.cs new file mode 100644 index 00000000..d4b83bb6 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputErrorOutput.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class ExecuteResponseSuccessfulExecutionDataOutputErrorOutput + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + 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); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.ExecuteResponseSuccessfulExecutionDataOutputErrorOutput? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.ExecuteResponseSuccessfulExecutionDataOutputErrorOutput), + jsonSerializerContext) as global::Together.ExecuteResponseSuccessfulExecutionDataOutputErrorOutput; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ExecuteResponseSuccessfulExecutionDataOutputErrorOutput? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.ExecuteResponseSuccessfulExecutionDataOutputErrorOutput? FromJson( + 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); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.ExecuteResponseSuccessfulExecutionDataOutputErrorOutput), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.ExecuteResponseSuccessfulExecutionDataOutputErrorOutput; + } + + /// + /// 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.Models.ExecuteResponseSuccessfulExecutionDataOutputErrorOutput.g.cs b/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputErrorOutput.g.cs new file mode 100644 index 00000000..79eb767c --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputErrorOutput.g.cs @@ -0,0 +1,55 @@ + +#nullable enable + +namespace Together +{ + /// + /// Errors and exceptions that occurred. If this output type is present, your code did not execute successfully. + /// + public sealed partial class ExecuteResponseSuccessfulExecutionDataOutputErrorOutput + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Data { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("type")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.ExecuteResponseSuccessfulExecutionDataOutputErrorOutputTypeJsonConverter))] + public global::Together.ExecuteResponseSuccessfulExecutionDataOutputErrorOutputType Type { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ExecuteResponseSuccessfulExecutionDataOutputErrorOutput( + string data, + global::Together.ExecuteResponseSuccessfulExecutionDataOutputErrorOutputType type) + { + this.Data = data ?? throw new global::System.ArgumentNullException(nameof(data)); + this.Type = type; + } + + /// + /// Initializes a new instance of the class. + /// + public ExecuteResponseSuccessfulExecutionDataOutputErrorOutput() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputErrorOutputType.g.cs b/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputErrorOutputType.g.cs new file mode 100644 index 00000000..f098d5e4 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputErrorOutputType.g.cs @@ -0,0 +1,45 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public enum ExecuteResponseSuccessfulExecutionDataOutputErrorOutputType + { + /// + /// + /// + Error, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class ExecuteResponseSuccessfulExecutionDataOutputErrorOutputTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this ExecuteResponseSuccessfulExecutionDataOutputErrorOutputType value) + { + return value switch + { + ExecuteResponseSuccessfulExecutionDataOutputErrorOutputType.Error => "error", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static ExecuteResponseSuccessfulExecutionDataOutputErrorOutputType? ToEnum(string value) + { + return value switch + { + "error" => ExecuteResponseSuccessfulExecutionDataOutputErrorOutputType.Error, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputStreamOutput.Json.g.cs b/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputStreamOutput.Json.g.cs new file mode 100644 index 00000000..6276f4cc --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputStreamOutput.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class ExecuteResponseSuccessfulExecutionDataOutputStreamOutput + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + 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); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.ExecuteResponseSuccessfulExecutionDataOutputStreamOutput? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.ExecuteResponseSuccessfulExecutionDataOutputStreamOutput), + jsonSerializerContext) as global::Together.ExecuteResponseSuccessfulExecutionDataOutputStreamOutput; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ExecuteResponseSuccessfulExecutionDataOutputStreamOutput? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.ExecuteResponseSuccessfulExecutionDataOutputStreamOutput? FromJson( + 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); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.ExecuteResponseSuccessfulExecutionDataOutputStreamOutput), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.ExecuteResponseSuccessfulExecutionDataOutputStreamOutput; + } + + /// + /// 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.Models.ExecuteResponseSuccessfulExecutionDataOutputStreamOutput.g.cs b/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputStreamOutput.g.cs new file mode 100644 index 00000000..6f2ee85f --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputStreamOutput.g.cs @@ -0,0 +1,56 @@ + +#nullable enable + +namespace Together +{ + /// + /// Outputs that were printed to stdout or stderr + /// + public sealed partial class ExecuteResponseSuccessfulExecutionDataOutputStreamOutput + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("type")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.ExecuteResponseSuccessfulExecutionDataOutputStreamOutputTypeJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.ExecuteResponseSuccessfulExecutionDataOutputStreamOutputType Type { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Data { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ExecuteResponseSuccessfulExecutionDataOutputStreamOutput( + global::Together.ExecuteResponseSuccessfulExecutionDataOutputStreamOutputType type, + string data) + { + this.Type = type; + this.Data = data ?? throw new global::System.ArgumentNullException(nameof(data)); + } + + /// + /// Initializes a new instance of the class. + /// + public ExecuteResponseSuccessfulExecutionDataOutputStreamOutput() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputStreamOutputType.g.cs b/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputStreamOutputType.g.cs new file mode 100644 index 00000000..7763327c --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataOutputStreamOutputType.g.cs @@ -0,0 +1,51 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public enum ExecuteResponseSuccessfulExecutionDataOutputStreamOutputType + { + /// + /// + /// + Stderr, + /// + /// + /// + Stdout, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class ExecuteResponseSuccessfulExecutionDataOutputStreamOutputTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this ExecuteResponseSuccessfulExecutionDataOutputStreamOutputType value) + { + return value switch + { + ExecuteResponseSuccessfulExecutionDataOutputStreamOutputType.Stderr => "stderr", + ExecuteResponseSuccessfulExecutionDataOutputStreamOutputType.Stdout => "stdout", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static ExecuteResponseSuccessfulExecutionDataOutputStreamOutputType? ToEnum(string value) + { + return value switch + { + "stderr" => ExecuteResponseSuccessfulExecutionDataOutputStreamOutputType.Stderr, + "stdout" => ExecuteResponseSuccessfulExecutionDataOutputStreamOutputType.Stdout, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataStatus.g.cs b/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataStatus.g.cs new file mode 100644 index 00000000..b64596a1 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ExecuteResponseSuccessfulExecutionDataStatus.g.cs @@ -0,0 +1,45 @@ + +#nullable enable + +namespace Together +{ + /// + /// Status of the execution. Currently only supports success. + /// + public enum ExecuteResponseSuccessfulExecutionDataStatus + { + /// + /// + /// + Success, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class ExecuteResponseSuccessfulExecutionDataStatusExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this ExecuteResponseSuccessfulExecutionDataStatus value) + { + return value switch + { + ExecuteResponseSuccessfulExecutionDataStatus.Success => "success", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static ExecuteResponseSuccessfulExecutionDataStatus? ToEnum(string value) + { + return value switch + { + "success" => ExecuteResponseSuccessfulExecutionDataStatus.Success, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.FileResponse.g.cs b/src/libs/Together/Generated/Together.Models.FileResponse.g.cs index 6308dc4b..c7d96e69 100644 --- a/src/libs/Together/Generated/Together.Models.FileResponse.g.cs +++ b/src/libs/Together/Generated/Together.Models.FileResponse.g.cs @@ -1,4 +1,6 @@ +#pragma warning disable CS0618 // Type or member is obsolete + #nullable enable namespace Together @@ -55,6 +57,13 @@ public sealed partial class FileResponse [global::System.Text.Json.Serialization.JsonRequired] public required global::Together.FilePurpose Purpose { get; set; } + /// + /// Deprecated. Whether file has been fully uploaded. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("Processed")] + [global::System.Text.Json.Serialization.JsonRequired] + public required bool Processed { get; set; } + /// /// The type of the file such as `jsonl`, `csv`, or `parquet`.
/// Default Value: jsonl
@@ -109,6 +118,9 @@ public sealed partial class FileResponse /// The purpose of the file as it was uploaded.
/// Example: fine-tune /// + /// + /// Deprecated. Whether file has been fully uploaded. + /// /// /// The type of the file such as `jsonl`, `csv`, or `parquet`.
/// Default Value: jsonl
@@ -135,6 +147,7 @@ public FileResponse( string filename, long bytes, global::Together.FilePurpose purpose, + bool processed, global::Together.FileType fileType, global::Together.FileProcessingStatus? processingStatus, global::Together.FileValidationReport? validationReport, @@ -146,6 +159,7 @@ public FileResponse( this.Filename = filename ?? throw new global::System.ArgumentNullException(nameof(filename)); this.Bytes = bytes; this.Purpose = purpose; + this.Processed = processed; this.FileType = fileType; this.ProcessingStatus = processingStatus; this.ValidationReport = validationReport; diff --git a/src/libs/Together/Generated/Together.Models.GPUClusterCreateRequestCommon.g.cs b/src/libs/Together/Generated/Together.Models.GPUClusterCreateRequestCommon.g.cs index c3b4f7ab..65d7701e 100644 --- a/src/libs/Together/Generated/Together.Models.GPUClusterCreateRequestCommon.g.cs +++ b/src/libs/Together/Generated/Together.Models.GPUClusterCreateRequestCommon.g.cs @@ -1,4 +1,6 @@ +#pragma warning disable CS0618 // Type or member is obsolete + #nullable enable namespace Together @@ -73,7 +75,15 @@ public sealed partial class GPUClusterCreateRequestCommon public required global::Together.GPUClusterCreateRequestCommonBillingType BillingType { get; set; } /// - /// Maximum number of GPUs to which the cluster can be auto-scaled up. + /// Whether GPU cluster should be auto-scaled based on the workload. By default, it is not auto-scaled.
+ /// Default Value: false + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("auto_scaled")] + [global::System.Obsolete("This property marked as deprecated.")] + public bool? AutoScaled { get; set; } + + /// + /// Maximum number of GPUs to which the cluster can be auto-scaled up. This field is required if auto_scaled is true. /// [global::System.Text.Json.Serialization.JsonPropertyName("auto_scale_max_gpus")] public int? AutoScaleMaxGpus { get; set; } @@ -226,7 +236,7 @@ public sealed partial class GPUClusterCreateRequestCommon /// ID of an existing volume to use with the cluster creation. /// /// - /// Maximum number of GPUs to which the cluster can be auto-scaled up. + /// Maximum number of GPUs to which the cluster can be auto-scaled up. This field is required if auto_scaled is true. /// /// /// Shared memory size in GiB for Slurm cluster. This field is required if cluster_type is SLURM. diff --git a/src/libs/Together/Generated/Together.Models.GPUClusterInfo.g.cs b/src/libs/Together/Generated/Together.Models.GPUClusterInfo.g.cs index a1081b4c..ca6573c2 100644 --- a/src/libs/Together/Generated/Together.Models.GPUClusterInfo.g.cs +++ b/src/libs/Together/Generated/Together.Models.GPUClusterInfo.g.cs @@ -219,7 +219,7 @@ public sealed partial class GPUClusterInfo public global::System.DateTime? FirstReadyAt { get; set; } /// - /// Whether the cluster runs on the Together-managed GPU cluster platform. + /// Whether the cluster is managed inside a substrate environment. /// [global::System.Text.Json.Serialization.JsonPropertyName("is_in_substrate")] public bool? IsInSubstrate { get; set; } @@ -347,7 +347,7 @@ public sealed partial class GPUClusterInfo /// Timestamp when the cluster first reached the Ready phase. /// /// - /// Whether the cluster runs on the Together-managed GPU cluster platform. + /// Whether the cluster is managed inside a substrate environment. /// /// /// Whether the control plane is currently ready. diff --git a/src/libs/Together/Generated/Together.Models.GPUClustersSharedVolumeCreateRequest.g.cs b/src/libs/Together/Generated/Together.Models.GPUClustersSharedVolumeCreateRequest.g.cs index 22a91a42..f41598e5 100644 --- a/src/libs/Together/Generated/Together.Models.GPUClustersSharedVolumeCreateRequest.g.cs +++ b/src/libs/Together/Generated/Together.Models.GPUClustersSharedVolumeCreateRequest.g.cs @@ -42,7 +42,7 @@ public sealed partial class GPUClustersSharedVolumeCreateRequest public string? ProjectId { get; set; } /// - /// Cluster ID to place the volume on the same infrastructure as that GPU cluster. + /// Cluster ID to pin the volume to the same substrate as that GPU cluster. /// [global::System.Text.Json.Serialization.JsonPropertyName("instance_cluster_id")] public string? InstanceClusterId { get; set; } @@ -72,7 +72,7 @@ public sealed partial class GPUClustersSharedVolumeCreateRequest /// Project ID that will own the volume. When omitted, the caller's default project is used. /// /// - /// Cluster ID to place the volume on the same infrastructure as that GPU cluster. + /// Cluster ID to pin the volume to the same substrate as that GPU cluster. /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/libs/Together/Generated/Together.Models.HardwareAvailability.Json.g.cs b/src/libs/Together/Generated/Together.Models.HardwareAvailability.Json.g.cs new file mode 100644 index 00000000..e6b7f659 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.HardwareAvailability.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class HardwareAvailability + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + 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); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.HardwareAvailability? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.HardwareAvailability), + jsonSerializerContext) as global::Together.HardwareAvailability; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.HardwareAvailability? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.HardwareAvailability? FromJson( + 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); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.HardwareAvailability), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.HardwareAvailability; + } + + /// + /// 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.Models.HardwareAvailability.g.cs b/src/libs/Together/Generated/Together.Models.HardwareAvailability.g.cs new file mode 100644 index 00000000..461ea796 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.HardwareAvailability.g.cs @@ -0,0 +1,48 @@ + +#nullable enable + +namespace Together +{ + /// + /// Indicates the current availability status of a hardware configuration + /// + public sealed partial class HardwareAvailability + { + /// + /// The availability status of the hardware configuration + /// + [global::System.Text.Json.Serialization.JsonPropertyName("status")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.HardwareAvailabilityStatusJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.HardwareAvailabilityStatus Status { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The availability status of the hardware configuration + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public HardwareAvailability( + global::Together.HardwareAvailabilityStatus status) + { + this.Status = status; + } + + /// + /// Initializes a new instance of the class. + /// + public HardwareAvailability() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.HardwareAvailabilityStatus.g.cs b/src/libs/Together/Generated/Together.Models.HardwareAvailabilityStatus.g.cs new file mode 100644 index 00000000..f9cd3f75 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.HardwareAvailabilityStatus.g.cs @@ -0,0 +1,57 @@ + +#nullable enable + +namespace Together +{ + /// + /// The availability status of the hardware configuration + /// + public enum HardwareAvailabilityStatus + { + /// + /// + /// + Available, + /// + /// + /// + Insufficient, + /// + /// + /// + Unavailable, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class HardwareAvailabilityStatusExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this HardwareAvailabilityStatus value) + { + return value switch + { + HardwareAvailabilityStatus.Available => "available", + HardwareAvailabilityStatus.Insufficient => "insufficient", + HardwareAvailabilityStatus.Unavailable => "unavailable", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static HardwareAvailabilityStatus? ToEnum(string value) + { + return value switch + { + "available" => HardwareAvailabilityStatus.Available, + "insufficient" => HardwareAvailabilityStatus.Insufficient, + "unavailable" => HardwareAvailabilityStatus.Unavailable, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.HardwareSpec.Json.g.cs b/src/libs/Together/Generated/Together.Models.HardwareSpec.Json.g.cs new file mode 100644 index 00000000..ed41c236 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.HardwareSpec.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class HardwareSpec + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + 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); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.HardwareSpec? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.HardwareSpec), + jsonSerializerContext) as global::Together.HardwareSpec; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.HardwareSpec? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.HardwareSpec? FromJson( + 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); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.HardwareSpec), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.HardwareSpec; + } + + /// + /// 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.Models.HardwareSpec.g.cs b/src/libs/Together/Generated/Together.Models.HardwareSpec.g.cs new file mode 100644 index 00000000..c061c14e --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.HardwareSpec.g.cs @@ -0,0 +1,83 @@ + +#nullable enable + +namespace Together +{ + /// + /// Detailed specifications of a hardware configuration + /// + public sealed partial class HardwareSpec + { + /// + /// The type/model of GPU + /// + [global::System.Text.Json.Serialization.JsonPropertyName("gpu_type")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string GpuType { get; set; } + + /// + /// The GPU interconnect technology + /// + [global::System.Text.Json.Serialization.JsonPropertyName("gpu_link")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string GpuLink { get; set; } + + /// + /// Amount of GPU memory in GB + /// + [global::System.Text.Json.Serialization.JsonPropertyName("gpu_memory")] + [global::System.Text.Json.Serialization.JsonRequired] + public required double GpuMemory { get; set; } + + /// + /// Number of GPUs in this configuration + /// + [global::System.Text.Json.Serialization.JsonPropertyName("gpu_count")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int GpuCount { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The type/model of GPU + /// + /// + /// The GPU interconnect technology + /// + /// + /// Amount of GPU memory in GB + /// + /// + /// Number of GPUs in this configuration + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public HardwareSpec( + string gpuType, + string gpuLink, + double gpuMemory, + int gpuCount) + { + this.GpuType = gpuType ?? throw new global::System.ArgumentNullException(nameof(gpuType)); + this.GpuLink = gpuLink ?? throw new global::System.ArgumentNullException(nameof(gpuLink)); + this.GpuMemory = gpuMemory; + this.GpuCount = gpuCount; + } + + /// + /// Initializes a new instance of the class. + /// + public HardwareSpec() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.HardwareWithStatus.Json.g.cs b/src/libs/Together/Generated/Together.Models.HardwareWithStatus.Json.g.cs new file mode 100644 index 00000000..efb55f6c --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.HardwareWithStatus.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class HardwareWithStatus + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + 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); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.HardwareWithStatus? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.HardwareWithStatus), + jsonSerializerContext) as global::Together.HardwareWithStatus; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.HardwareWithStatus? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.HardwareWithStatus? FromJson( + 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); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.HardwareWithStatus), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.HardwareWithStatus; + } + + /// + /// 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.Models.HardwareWithStatus.g.cs b/src/libs/Together/Generated/Together.Models.HardwareWithStatus.g.cs new file mode 100644 index 00000000..0fa1455a --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.HardwareWithStatus.g.cs @@ -0,0 +1,106 @@ + +#nullable enable + +namespace Together +{ + /// + /// Hardware configuration details with optional availability status + /// + public sealed partial class HardwareWithStatus + { + /// + /// The object type, which is always `hardware`. + /// + /// "hardware" + [global::System.Text.Json.Serialization.JsonPropertyName("object")] + public string Object { get; set; } = "hardware"; + + /// + /// Unique identifier for the hardware configuration + /// + [global::System.Text.Json.Serialization.JsonPropertyName("id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Id { get; set; } + + /// + /// Pricing details for using an endpoint + /// + [global::System.Text.Json.Serialization.JsonPropertyName("pricing")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.EndpointPricing Pricing { get; set; } + + /// + /// Detailed specifications of a hardware configuration + /// + [global::System.Text.Json.Serialization.JsonPropertyName("specs")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.HardwareSpec Specs { get; set; } + + /// + /// Indicates the current availability status of a hardware configuration + /// + [global::System.Text.Json.Serialization.JsonPropertyName("availability")] + public global::Together.HardwareAvailability? Availability { get; set; } + + /// + /// Timestamp of when the hardware status was last updated + /// + [global::System.Text.Json.Serialization.JsonPropertyName("updated_at")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.DateTime UpdatedAt { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Unique identifier for the hardware configuration + /// + /// + /// Pricing details for using an endpoint + /// + /// + /// Detailed specifications of a hardware configuration + /// + /// + /// Timestamp of when the hardware status was last updated + /// + /// + /// Indicates the current availability status of a hardware configuration + /// + /// + /// The object type, which is always `hardware`. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public HardwareWithStatus( + string id, + global::Together.EndpointPricing pricing, + global::Together.HardwareSpec specs, + global::System.DateTime updatedAt, + global::Together.HardwareAvailability? availability, + string @object = "hardware") + { + this.Object = @object; + this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); + this.Pricing = pricing ?? throw new global::System.ArgumentNullException(nameof(pricing)); + this.Specs = specs ?? throw new global::System.ArgumentNullException(nameof(specs)); + this.Availability = availability; + this.UpdatedAt = updatedAt; + } + + /// + /// Initializes a new instance of the class. + /// + public HardwareWithStatus() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.HardwareWithStatusObject.Json.g.cs b/src/libs/Together/Generated/Together.Models.HardwareWithStatusObject.Json.g.cs new file mode 100644 index 00000000..9069bf38 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.HardwareWithStatusObject.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class HardwareWithStatusObject + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + 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); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.HardwareWithStatusObject? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.HardwareWithStatusObject), + jsonSerializerContext) as global::Together.HardwareWithStatusObject; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.HardwareWithStatusObject? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.HardwareWithStatusObject? FromJson( + 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); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.HardwareWithStatusObject), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.HardwareWithStatusObject; + } + + /// + /// 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.Models.HardwareWithStatusObject.g.cs b/src/libs/Together/Generated/Together.Models.HardwareWithStatusObject.g.cs new file mode 100644 index 00000000..06b8dbe8 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.HardwareWithStatusObject.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Together +{ + /// + /// The object type, which is always `hardware`. + /// + public sealed partial class HardwareWithStatusObject + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.InterpreterOutput.Json.g.cs b/src/libs/Together/Generated/Together.Models.InterpreterOutput.Json.g.cs new file mode 100644 index 00000000..fdc3b258 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.InterpreterOutput.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public readonly partial struct InterpreterOutput + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + 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); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.InterpreterOutput? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.InterpreterOutput), + jsonSerializerContext) as global::Together.InterpreterOutput?; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.InterpreterOutput? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.InterpreterOutput? FromJson( + 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); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.InterpreterOutput), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.InterpreterOutput?; + } + + /// + /// 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.Models.InterpreterOutput.g.cs b/src/libs/Together/Generated/Together.Models.InterpreterOutput.g.cs new file mode 100644 index 00000000..5838fce9 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.InterpreterOutput.g.cs @@ -0,0 +1,378 @@ +#pragma warning disable CS0618 // Type or member is obsolete + +#nullable enable + +namespace Together +{ + /// + /// + /// + public readonly partial struct InterpreterOutput : global::System.IEquatable + { + /// + /// Outputs that were printed to stdout or stderr + /// +#if NET6_0_OR_GREATER + public global::Together.InterpreterOutputStreamOutput? StreamOutput { get; init; } +#else + public global::Together.InterpreterOutputStreamOutput? StreamOutput { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(StreamOutput))] +#endif + public bool IsStreamOutput => StreamOutput != null; + + /// + /// + /// + public bool TryPickStreamOutput( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Together.InterpreterOutputStreamOutput? value) + { + value = StreamOutput; + return IsStreamOutput; + } + + /// + /// + /// + public global::Together.InterpreterOutputStreamOutput PickStreamOutput() => StreamOutput is { } value + ? value + : throw new global::System.InvalidOperationException($"Expected union variant 'StreamOutput' but the value was {ToString()}."); + + /// + /// Errors and exceptions that occurred. If this output type is present, your code did not execute successfully. + /// +#if NET6_0_OR_GREATER + public global::Together.InterpreterOutputErrorOutput? Error { get; init; } +#else + public global::Together.InterpreterOutputErrorOutput? Error { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Error))] +#endif + public bool IsError => Error != null; + + /// + /// + /// + public bool TryPickError( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Together.InterpreterOutputErrorOutput? value) + { + value = Error; + return IsError; + } + + /// + /// + /// + public global::Together.InterpreterOutputErrorOutput PickError() => Error is { } value + ? value + : throw new global::System.InvalidOperationException($"Expected union variant 'Error' but the value was {ToString()}."); + + /// + /// + /// +#if NET6_0_OR_GREATER + public global::Together.InterpreterOutputDisplayorExecuteOutput? DisplayorExecuteOutput { get; init; } +#else + public global::Together.InterpreterOutputDisplayorExecuteOutput? DisplayorExecuteOutput { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(DisplayorExecuteOutput))] +#endif + public bool IsDisplayorExecuteOutput => DisplayorExecuteOutput != null; + + /// + /// + /// + public bool TryPickDisplayorExecuteOutput( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Together.InterpreterOutputDisplayorExecuteOutput? value) + { + value = DisplayorExecuteOutput; + return IsDisplayorExecuteOutput; + } + + /// + /// + /// + public global::Together.InterpreterOutputDisplayorExecuteOutput PickDisplayorExecuteOutput() => DisplayorExecuteOutput is { } value + ? value + : throw new global::System.InvalidOperationException($"Expected union variant 'DisplayorExecuteOutput' but the value was {ToString()}."); + /// + /// + /// + public static implicit operator InterpreterOutput(global::Together.InterpreterOutputStreamOutput value) => new InterpreterOutput((global::Together.InterpreterOutputStreamOutput?)value); + + /// + /// + /// + public static implicit operator global::Together.InterpreterOutputStreamOutput?(InterpreterOutput @this) => @this.StreamOutput; + + /// + /// + /// + public InterpreterOutput(global::Together.InterpreterOutputStreamOutput? value) + { + StreamOutput = value; + } + + /// + /// + /// + public static InterpreterOutput FromStreamOutput(global::Together.InterpreterOutputStreamOutput? value) => new InterpreterOutput(value); + + /// + /// + /// + public static implicit operator InterpreterOutput(global::Together.InterpreterOutputErrorOutput value) => new InterpreterOutput((global::Together.InterpreterOutputErrorOutput?)value); + + /// + /// + /// + public static implicit operator global::Together.InterpreterOutputErrorOutput?(InterpreterOutput @this) => @this.Error; + + /// + /// + /// + public InterpreterOutput(global::Together.InterpreterOutputErrorOutput? value) + { + Error = value; + } + + /// + /// + /// + public static InterpreterOutput FromError(global::Together.InterpreterOutputErrorOutput? value) => new InterpreterOutput(value); + + /// + /// + /// + public static implicit operator InterpreterOutput(global::Together.InterpreterOutputDisplayorExecuteOutput value) => new InterpreterOutput((global::Together.InterpreterOutputDisplayorExecuteOutput?)value); + + /// + /// + /// + public static implicit operator global::Together.InterpreterOutputDisplayorExecuteOutput?(InterpreterOutput @this) => @this.DisplayorExecuteOutput; + + /// + /// + /// + public InterpreterOutput(global::Together.InterpreterOutputDisplayorExecuteOutput? value) + { + DisplayorExecuteOutput = value; + } + + /// + /// + /// + public static InterpreterOutput FromDisplayorExecuteOutput(global::Together.InterpreterOutputDisplayorExecuteOutput? value) => new InterpreterOutput(value); + + /// + /// + /// + public InterpreterOutput( + global::Together.InterpreterOutputStreamOutput? streamOutput, + global::Together.InterpreterOutputErrorOutput? error, + global::Together.InterpreterOutputDisplayorExecuteOutput? displayorExecuteOutput + ) + { + StreamOutput = streamOutput; + Error = error; + DisplayorExecuteOutput = displayorExecuteOutput; + } + + /// + /// + /// + public object? Object => + DisplayorExecuteOutput as object ?? + Error as object ?? + StreamOutput as object + ; + + /// + /// + /// + public override string? ToString() => + StreamOutput?.ToString() ?? + Error?.ToString() ?? + DisplayorExecuteOutput?.ToString() + ; + + /// + /// + /// + public bool Validate() + { + return IsStreamOutput && !IsError && !IsDisplayorExecuteOutput || !IsStreamOutput && IsError && !IsDisplayorExecuteOutput || !IsStreamOutput && !IsError && IsDisplayorExecuteOutput; + } + + /// + /// + /// + public TResult? Match( + global::System.Func? streamOutput = null, + global::System.Func? error = null, + global::System.Func? displayorExecuteOutput = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (StreamOutput is { } __value0 && streamOutput != null) + { + return streamOutput(__value0); + } + else if (Error is { } __value1 && error != null) + { + return error(__value1); + } + else if (DisplayorExecuteOutput is { } __value2 && displayorExecuteOutput != null) + { + return displayorExecuteOutput(__value2); + } + + return default(TResult); + } + + /// + /// + /// + public void Match( + global::System.Action? streamOutput = null, + + global::System.Action? error = null, + + global::System.Action? displayorExecuteOutput = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (StreamOutput is { } __value0) + { + streamOutput?.Invoke(__value0); + } + else if (Error is { } __value1) + { + error?.Invoke(__value1); + } + else if (DisplayorExecuteOutput is { } __value2) + { + displayorExecuteOutput?.Invoke(__value2); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? streamOutput = null, + global::System.Action? error = null, + global::System.Action? displayorExecuteOutput = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (StreamOutput is { } __value0) + { + streamOutput?.Invoke(__value0); + } + else if (Error is { } __value1) + { + error?.Invoke(__value1); + } + else if (DisplayorExecuteOutput is { } __value2) + { + displayorExecuteOutput?.Invoke(__value2); + } + } + + /// + /// + /// + public override int GetHashCode() + { + var fields = new object?[] + { + StreamOutput, + typeof(global::Together.InterpreterOutputStreamOutput), + Error, + typeof(global::Together.InterpreterOutputErrorOutput), + DisplayorExecuteOutput, + typeof(global::Together.InterpreterOutputDisplayorExecuteOutput), + }; + const int offset = unchecked((int)2166136261); + const int prime = 16777619; + static int HashCodeAggregator(int hashCode, object? value) => value == null + ? (hashCode ^ 0) * prime + : (hashCode ^ value.GetHashCode()) * prime; + + return global::System.Linq.Enumerable.Aggregate(fields, offset, HashCodeAggregator); + } + + /// + /// + /// + public bool Equals(InterpreterOutput other) + { + return + global::System.Collections.Generic.EqualityComparer.Default.Equals(StreamOutput, other.StreamOutput) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Error, other.Error) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(DisplayorExecuteOutput, other.DisplayorExecuteOutput) + ; + } + + /// + /// + /// + public static bool operator ==(InterpreterOutput obj1, InterpreterOutput obj2) + { + return global::System.Collections.Generic.EqualityComparer.Default.Equals(obj1, obj2); + } + + /// + /// + /// + public static bool operator !=(InterpreterOutput obj1, InterpreterOutput obj2) + { + return !(obj1 == obj2); + } + + /// + /// + /// + public override bool Equals(object? obj) + { + return obj is InterpreterOutput o && Equals(o); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.InterpreterOutputDiscriminator.Json.g.cs b/src/libs/Together/Generated/Together.Models.InterpreterOutputDiscriminator.Json.g.cs new file mode 100644 index 00000000..1d89e4fd --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.InterpreterOutputDiscriminator.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class InterpreterOutputDiscriminator + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + 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); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.InterpreterOutputDiscriminator? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.InterpreterOutputDiscriminator), + jsonSerializerContext) as global::Together.InterpreterOutputDiscriminator; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.InterpreterOutputDiscriminator? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.InterpreterOutputDiscriminator? FromJson( + 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); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.InterpreterOutputDiscriminator), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.InterpreterOutputDiscriminator; + } + + /// + /// 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.Models.WhoamiResponseDiscriminator.g.cs b/src/libs/Together/Generated/Together.Models.InterpreterOutputDiscriminator.g.cs similarity index 61% rename from src/libs/Together/Generated/Together.Models.WhoamiResponseDiscriminator.g.cs rename to src/libs/Together/Generated/Together.Models.InterpreterOutputDiscriminator.g.cs index 0a5696fe..e28f19d4 100644 --- a/src/libs/Together/Generated/Together.Models.WhoamiResponseDiscriminator.g.cs +++ b/src/libs/Together/Generated/Together.Models.InterpreterOutputDiscriminator.g.cs @@ -6,14 +6,14 @@ namespace Together /// /// /// - public sealed partial class WhoamiResponseDiscriminator + public sealed partial class InterpreterOutputDiscriminator { /// /// /// [global::System.Text.Json.Serialization.JsonPropertyName("type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.WhoamiResponseDiscriminatorTypeJsonConverter))] - public global::Together.WhoamiResponseDiscriminatorType? Type { get; set; } + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.InterpreterOutputDiscriminatorTypeJsonConverter))] + public global::Together.InterpreterOutputDiscriminatorType? Type { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -22,22 +22,22 @@ public sealed partial class WhoamiResponseDiscriminator public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif - public WhoamiResponseDiscriminator( - global::Together.WhoamiResponseDiscriminatorType? type) + public InterpreterOutputDiscriminator( + global::Together.InterpreterOutputDiscriminatorType? type) { this.Type = type; } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public WhoamiResponseDiscriminator() + public InterpreterOutputDiscriminator() { } diff --git a/src/libs/Together/Generated/Together.Models.InterpreterOutputDiscriminatorType.g.cs b/src/libs/Together/Generated/Together.Models.InterpreterOutputDiscriminatorType.g.cs new file mode 100644 index 00000000..fa2cb086 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.InterpreterOutputDiscriminatorType.g.cs @@ -0,0 +1,45 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public enum InterpreterOutputDiscriminatorType + { + /// + /// + /// + Error, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class InterpreterOutputDiscriminatorTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this InterpreterOutputDiscriminatorType value) + { + return value switch + { + InterpreterOutputDiscriminatorType.Error => "error", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static InterpreterOutputDiscriminatorType? ToEnum(string value) + { + return value switch + { + "error" => InterpreterOutputDiscriminatorType.Error, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.InterpreterOutputDisplayorExecuteOutput.Json.g.cs b/src/libs/Together/Generated/Together.Models.InterpreterOutputDisplayorExecuteOutput.Json.g.cs new file mode 100644 index 00000000..25b9f498 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.InterpreterOutputDisplayorExecuteOutput.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class InterpreterOutputDisplayorExecuteOutput + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + 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); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.InterpreterOutputDisplayorExecuteOutput? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.InterpreterOutputDisplayorExecuteOutput), + jsonSerializerContext) as global::Together.InterpreterOutputDisplayorExecuteOutput; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.InterpreterOutputDisplayorExecuteOutput? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.InterpreterOutputDisplayorExecuteOutput? FromJson( + 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); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.InterpreterOutputDisplayorExecuteOutput), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.InterpreterOutputDisplayorExecuteOutput; + } + + /// + /// 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.Models.InterpreterOutputDisplayorExecuteOutput.g.cs b/src/libs/Together/Generated/Together.Models.InterpreterOutputDisplayorExecuteOutput.g.cs new file mode 100644 index 00000000..30348aff --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.InterpreterOutputDisplayorExecuteOutput.g.cs @@ -0,0 +1,56 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class InterpreterOutputDisplayorExecuteOutput + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.InterpreterOutputDisplayorExecuteOutputData Data { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("type")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.InterpreterOutputDisplayorExecuteOutputTypeJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.InterpreterOutputDisplayorExecuteOutputType Type { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public InterpreterOutputDisplayorExecuteOutput( + global::Together.InterpreterOutputDisplayorExecuteOutputData data, + global::Together.InterpreterOutputDisplayorExecuteOutputType type) + { + this.Data = data ?? throw new global::System.ArgumentNullException(nameof(data)); + this.Type = type; + } + + /// + /// Initializes a new instance of the class. + /// + public InterpreterOutputDisplayorExecuteOutput() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.InterpreterOutputDisplayorExecuteOutputData.Json.g.cs b/src/libs/Together/Generated/Together.Models.InterpreterOutputDisplayorExecuteOutputData.Json.g.cs new file mode 100644 index 00000000..f11f147b --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.InterpreterOutputDisplayorExecuteOutputData.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class InterpreterOutputDisplayorExecuteOutputData + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + 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); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.InterpreterOutputDisplayorExecuteOutputData? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.InterpreterOutputDisplayorExecuteOutputData), + jsonSerializerContext) as global::Together.InterpreterOutputDisplayorExecuteOutputData; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.InterpreterOutputDisplayorExecuteOutputData? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.InterpreterOutputDisplayorExecuteOutputData? FromJson( + 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); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.InterpreterOutputDisplayorExecuteOutputData), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.InterpreterOutputDisplayorExecuteOutputData; + } + + /// + /// 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.Models.InterpreterOutputDisplayorExecuteOutputData.g.cs b/src/libs/Together/Generated/Together.Models.InterpreterOutputDisplayorExecuteOutputData.g.cs new file mode 100644 index 00000000..f227ff8a --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.InterpreterOutputDisplayorExecuteOutputData.g.cs @@ -0,0 +1,161 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class InterpreterOutputDisplayorExecuteOutputData + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("application/geo+json")] + public object? ApplicationGeoJson { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("application/javascript")] + public string? ApplicationJavascript { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("application/json")] + public object? ApplicationJson { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("application/pdf")] + public byte[]? ApplicationPdf { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("application/vnd.vega.v5+json")] + public object? ApplicationVndVegaV5Json { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("application/vnd.vegalite.v4+json")] + public object? ApplicationVndVegaliteV4Json { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("image/gif")] + public byte[]? ImageGif { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("image/jpeg")] + public byte[]? ImageJpeg { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("image/png")] + public byte[]? ImagePng { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("image/svg+xml")] + public string? ImageSvgXml { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("text/html")] + public string? TextHtml { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("text/latex")] + public string? TextLatex { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("text/markdown")] + public string? TextMarkdown { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("text/plain")] + public string? TextPlain { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public InterpreterOutputDisplayorExecuteOutputData( + object? applicationGeoJson, + string? applicationJavascript, + object? applicationJson, + byte[]? applicationPdf, + object? applicationVndVegaV5Json, + object? applicationVndVegaliteV4Json, + byte[]? imageGif, + byte[]? imageJpeg, + byte[]? imagePng, + string? imageSvgXml, + string? textHtml, + string? textLatex, + string? textMarkdown, + string? textPlain) + { + this.ApplicationGeoJson = applicationGeoJson; + this.ApplicationJavascript = applicationJavascript; + this.ApplicationJson = applicationJson; + this.ApplicationPdf = applicationPdf; + this.ApplicationVndVegaV5Json = applicationVndVegaV5Json; + this.ApplicationVndVegaliteV4Json = applicationVndVegaliteV4Json; + this.ImageGif = imageGif; + this.ImageJpeg = imageJpeg; + this.ImagePng = imagePng; + this.ImageSvgXml = imageSvgXml; + this.TextHtml = textHtml; + this.TextLatex = textLatex; + this.TextMarkdown = textMarkdown; + this.TextPlain = textPlain; + } + + /// + /// Initializes a new instance of the class. + /// + public InterpreterOutputDisplayorExecuteOutputData() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.InterpreterOutputDisplayorExecuteOutputDataApplicationGeoJson.Json.g.cs b/src/libs/Together/Generated/Together.Models.InterpreterOutputDisplayorExecuteOutputDataApplicationGeoJson.Json.g.cs new file mode 100644 index 00000000..ae93fee0 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.InterpreterOutputDisplayorExecuteOutputDataApplicationGeoJson.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class InterpreterOutputDisplayorExecuteOutputDataApplicationGeoJson + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + 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); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.InterpreterOutputDisplayorExecuteOutputDataApplicationGeoJson? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.InterpreterOutputDisplayorExecuteOutputDataApplicationGeoJson), + jsonSerializerContext) as global::Together.InterpreterOutputDisplayorExecuteOutputDataApplicationGeoJson; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.InterpreterOutputDisplayorExecuteOutputDataApplicationGeoJson? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.InterpreterOutputDisplayorExecuteOutputDataApplicationGeoJson? FromJson( + 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); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.InterpreterOutputDisplayorExecuteOutputDataApplicationGeoJson), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.InterpreterOutputDisplayorExecuteOutputDataApplicationGeoJson; + } + + /// + /// 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.Models.InterpreterOutputDisplayorExecuteOutputDataApplicationGeoJson.g.cs b/src/libs/Together/Generated/Together.Models.InterpreterOutputDisplayorExecuteOutputDataApplicationGeoJson.g.cs new file mode 100644 index 00000000..c049d412 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.InterpreterOutputDisplayorExecuteOutputDataApplicationGeoJson.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class InterpreterOutputDisplayorExecuteOutputDataApplicationGeoJson + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.InterpreterOutputDisplayorExecuteOutputDataApplicationJson.Json.g.cs b/src/libs/Together/Generated/Together.Models.InterpreterOutputDisplayorExecuteOutputDataApplicationJson.Json.g.cs new file mode 100644 index 00000000..0ba0ac17 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.InterpreterOutputDisplayorExecuteOutputDataApplicationJson.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class InterpreterOutputDisplayorExecuteOutputDataApplicationJson + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + 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); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.InterpreterOutputDisplayorExecuteOutputDataApplicationJson? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.InterpreterOutputDisplayorExecuteOutputDataApplicationJson), + jsonSerializerContext) as global::Together.InterpreterOutputDisplayorExecuteOutputDataApplicationJson; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.InterpreterOutputDisplayorExecuteOutputDataApplicationJson? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.InterpreterOutputDisplayorExecuteOutputDataApplicationJson? FromJson( + 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); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.InterpreterOutputDisplayorExecuteOutputDataApplicationJson), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.InterpreterOutputDisplayorExecuteOutputDataApplicationJson; + } + + /// + /// 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.Models.InterpreterOutputDisplayorExecuteOutputDataApplicationJson.g.cs b/src/libs/Together/Generated/Together.Models.InterpreterOutputDisplayorExecuteOutputDataApplicationJson.g.cs new file mode 100644 index 00000000..5bfc978c --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.InterpreterOutputDisplayorExecuteOutputDataApplicationJson.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class InterpreterOutputDisplayorExecuteOutputDataApplicationJson + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.InterpreterOutputDisplayorExecuteOutputDataApplicationVndVegaV5Json.Json.g.cs b/src/libs/Together/Generated/Together.Models.InterpreterOutputDisplayorExecuteOutputDataApplicationVndVegaV5Json.Json.g.cs new file mode 100644 index 00000000..ff4bec98 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.InterpreterOutputDisplayorExecuteOutputDataApplicationVndVegaV5Json.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class InterpreterOutputDisplayorExecuteOutputDataApplicationVndVegaV5Json + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + 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); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.InterpreterOutputDisplayorExecuteOutputDataApplicationVndVegaV5Json? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.InterpreterOutputDisplayorExecuteOutputDataApplicationVndVegaV5Json), + jsonSerializerContext) as global::Together.InterpreterOutputDisplayorExecuteOutputDataApplicationVndVegaV5Json; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.InterpreterOutputDisplayorExecuteOutputDataApplicationVndVegaV5Json? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.InterpreterOutputDisplayorExecuteOutputDataApplicationVndVegaV5Json? FromJson( + 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); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.InterpreterOutputDisplayorExecuteOutputDataApplicationVndVegaV5Json), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.InterpreterOutputDisplayorExecuteOutputDataApplicationVndVegaV5Json; + } + + /// + /// 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.Models.InterpreterOutputDisplayorExecuteOutputDataApplicationVndVegaV5Json.g.cs b/src/libs/Together/Generated/Together.Models.InterpreterOutputDisplayorExecuteOutputDataApplicationVndVegaV5Json.g.cs new file mode 100644 index 00000000..0de7e26c --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.InterpreterOutputDisplayorExecuteOutputDataApplicationVndVegaV5Json.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class InterpreterOutputDisplayorExecuteOutputDataApplicationVndVegaV5Json + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.InterpreterOutputDisplayorExecuteOutputDataApplicationVndVegaliteV4Json.Json.g.cs b/src/libs/Together/Generated/Together.Models.InterpreterOutputDisplayorExecuteOutputDataApplicationVndVegaliteV4Json.Json.g.cs new file mode 100644 index 00000000..2fe44486 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.InterpreterOutputDisplayorExecuteOutputDataApplicationVndVegaliteV4Json.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class InterpreterOutputDisplayorExecuteOutputDataApplicationVndVegaliteV4Json + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + 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); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.InterpreterOutputDisplayorExecuteOutputDataApplicationVndVegaliteV4Json? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.InterpreterOutputDisplayorExecuteOutputDataApplicationVndVegaliteV4Json), + jsonSerializerContext) as global::Together.InterpreterOutputDisplayorExecuteOutputDataApplicationVndVegaliteV4Json; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.InterpreterOutputDisplayorExecuteOutputDataApplicationVndVegaliteV4Json? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.InterpreterOutputDisplayorExecuteOutputDataApplicationVndVegaliteV4Json? FromJson( + 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); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.InterpreterOutputDisplayorExecuteOutputDataApplicationVndVegaliteV4Json), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.InterpreterOutputDisplayorExecuteOutputDataApplicationVndVegaliteV4Json; + } + + /// + /// 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.Models.InterpreterOutputDisplayorExecuteOutputDataApplicationVndVegaliteV4Json.g.cs b/src/libs/Together/Generated/Together.Models.InterpreterOutputDisplayorExecuteOutputDataApplicationVndVegaliteV4Json.g.cs new file mode 100644 index 00000000..4791cce1 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.InterpreterOutputDisplayorExecuteOutputDataApplicationVndVegaliteV4Json.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class InterpreterOutputDisplayorExecuteOutputDataApplicationVndVegaliteV4Json + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.InterpreterOutputDisplayorExecuteOutputType.g.cs b/src/libs/Together/Generated/Together.Models.InterpreterOutputDisplayorExecuteOutputType.g.cs new file mode 100644 index 00000000..42e1a728 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.InterpreterOutputDisplayorExecuteOutputType.g.cs @@ -0,0 +1,51 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public enum InterpreterOutputDisplayorExecuteOutputType + { + /// + /// + /// + DisplayData, + /// + /// + /// + ExecuteResult, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class InterpreterOutputDisplayorExecuteOutputTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this InterpreterOutputDisplayorExecuteOutputType value) + { + return value switch + { + InterpreterOutputDisplayorExecuteOutputType.DisplayData => "display_data", + InterpreterOutputDisplayorExecuteOutputType.ExecuteResult => "execute_result", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static InterpreterOutputDisplayorExecuteOutputType? ToEnum(string value) + { + return value switch + { + "display_data" => InterpreterOutputDisplayorExecuteOutputType.DisplayData, + "execute_result" => InterpreterOutputDisplayorExecuteOutputType.ExecuteResult, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.InterpreterOutputErrorOutput.Json.g.cs b/src/libs/Together/Generated/Together.Models.InterpreterOutputErrorOutput.Json.g.cs new file mode 100644 index 00000000..e63b5fbc --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.InterpreterOutputErrorOutput.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class InterpreterOutputErrorOutput + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + 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); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.InterpreterOutputErrorOutput? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.InterpreterOutputErrorOutput), + jsonSerializerContext) as global::Together.InterpreterOutputErrorOutput; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.InterpreterOutputErrorOutput? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.InterpreterOutputErrorOutput? FromJson( + 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); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.InterpreterOutputErrorOutput), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.InterpreterOutputErrorOutput; + } + + /// + /// 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.Models.InterpreterOutputErrorOutput.g.cs b/src/libs/Together/Generated/Together.Models.InterpreterOutputErrorOutput.g.cs new file mode 100644 index 00000000..6d7f4719 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.InterpreterOutputErrorOutput.g.cs @@ -0,0 +1,55 @@ + +#nullable enable + +namespace Together +{ + /// + /// Errors and exceptions that occurred. If this output type is present, your code did not execute successfully. + /// + public sealed partial class InterpreterOutputErrorOutput + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Data { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("type")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.InterpreterOutputErrorOutputTypeJsonConverter))] + public global::Together.InterpreterOutputErrorOutputType Type { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public InterpreterOutputErrorOutput( + string data, + global::Together.InterpreterOutputErrorOutputType type) + { + this.Data = data ?? throw new global::System.ArgumentNullException(nameof(data)); + this.Type = type; + } + + /// + /// Initializes a new instance of the class. + /// + public InterpreterOutputErrorOutput() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.WhoamiUserOrgJwtType.g.cs b/src/libs/Together/Generated/Together.Models.InterpreterOutputErrorOutputType.g.cs similarity index 62% rename from src/libs/Together/Generated/Together.Models.WhoamiUserOrgJwtType.g.cs rename to src/libs/Together/Generated/Together.Models.InterpreterOutputErrorOutputType.g.cs index 567d25e3..6e1e1d41 100644 --- a/src/libs/Together/Generated/Together.Models.WhoamiUserOrgJwtType.g.cs +++ b/src/libs/Together/Generated/Together.Models.InterpreterOutputErrorOutputType.g.cs @@ -4,40 +4,40 @@ namespace Together { /// - /// Always `user_org_jwt`. + /// /// - public enum WhoamiUserOrgJwtType + public enum InterpreterOutputErrorOutputType { /// /// /// - UserOrgJwt, + Error, } /// /// Enum extensions to do fast conversions without the reflection. /// - public static class WhoamiUserOrgJwtTypeExtensions + public static class InterpreterOutputErrorOutputTypeExtensions { /// /// Converts an enum to a string. /// - public static string ToValueString(this WhoamiUserOrgJwtType value) + public static string ToValueString(this InterpreterOutputErrorOutputType value) { return value switch { - WhoamiUserOrgJwtType.UserOrgJwt => "user_org_jwt", + InterpreterOutputErrorOutputType.Error => "error", _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), }; } /// /// Converts an string to a enum. /// - public static WhoamiUserOrgJwtType? ToEnum(string value) + public static InterpreterOutputErrorOutputType? ToEnum(string value) { return value switch { - "user_org_jwt" => WhoamiUserOrgJwtType.UserOrgJwt, + "error" => InterpreterOutputErrorOutputType.Error, _ => null, }; } diff --git a/src/libs/Together/Generated/Together.Models.RlModelResourcesStatusDetails.Json.g.cs b/src/libs/Together/Generated/Together.Models.InterpreterOutputStreamOutput.Json.g.cs similarity index 87% rename from src/libs/Together/Generated/Together.Models.RlModelResourcesStatusDetails.Json.g.cs rename to src/libs/Together/Generated/Together.Models.InterpreterOutputStreamOutput.Json.g.cs index 0ba765a2..ef7390b2 100644 --- a/src/libs/Together/Generated/Together.Models.RlModelResourcesStatusDetails.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.InterpreterOutputStreamOutput.Json.g.cs @@ -2,7 +2,7 @@ namespace Together { - public sealed partial class RlModelResourcesStatusDetails + public sealed partial class InterpreterOutputStreamOutput { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -47,20 +47,20 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::Together.RlModelResourcesStatusDetails? FromJson( + public static global::Together.InterpreterOutputStreamOutput? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::Together.RlModelResourcesStatusDetails), - jsonSerializerContext) as global::Together.RlModelResourcesStatusDetails; + typeof(global::Together.InterpreterOutputStreamOutput), + jsonSerializerContext) as global::Together.InterpreterOutputStreamOutput; } /// /// Deserializes a JSON string using the generated default JsonSerializerContext. /// - public static global::Together.RlModelResourcesStatusDetails? FromJson( + public static global::Together.InterpreterOutputStreamOutput? FromJson( string json) { return FromJson( @@ -75,7 +75,7 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::Together.RlModelResourcesStatusDetails? FromJson( + public static global::Together.InterpreterOutputStreamOutput? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -86,7 +86,7 @@ public string ToJson( global::Together.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -94,20 +94,20 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, - typeof(global::Together.RlModelResourcesStatusDetails), - jsonSerializerContext).ConfigureAwait(false)) as global::Together.RlModelResourcesStatusDetails; + typeof(global::Together.InterpreterOutputStreamOutput), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.InterpreterOutputStreamOutput; } /// /// Deserializes a JSON stream using the generated default JsonSerializerContext. /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream) { return FromJsonStreamAsync( @@ -122,7 +122,7 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -133,7 +133,7 @@ public string ToJson( global::Together.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.DeserializeAsync( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/Together/Generated/Together.Models.InterpreterOutputStreamOutput.g.cs b/src/libs/Together/Generated/Together.Models.InterpreterOutputStreamOutput.g.cs new file mode 100644 index 00000000..02df523f --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.InterpreterOutputStreamOutput.g.cs @@ -0,0 +1,56 @@ + +#nullable enable + +namespace Together +{ + /// + /// Outputs that were printed to stdout or stderr + /// + public sealed partial class InterpreterOutputStreamOutput + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Data { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("type")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.InterpreterOutputStreamOutputTypeJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.InterpreterOutputStreamOutputType Type { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public InterpreterOutputStreamOutput( + string data, + global::Together.InterpreterOutputStreamOutputType type) + { + this.Data = data ?? throw new global::System.ArgumentNullException(nameof(data)); + this.Type = type; + } + + /// + /// Initializes a new instance of the class. + /// + public InterpreterOutputStreamOutput() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.InterpreterOutputStreamOutputType.g.cs b/src/libs/Together/Generated/Together.Models.InterpreterOutputStreamOutputType.g.cs new file mode 100644 index 00000000..2a396efd --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.InterpreterOutputStreamOutputType.g.cs @@ -0,0 +1,51 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public enum InterpreterOutputStreamOutputType + { + /// + /// + /// + Stderr, + /// + /// + /// + Stdout, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class InterpreterOutputStreamOutputTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this InterpreterOutputStreamOutputType value) + { + return value switch + { + InterpreterOutputStreamOutputType.Stderr => "stderr", + InterpreterOutputStreamOutputType.Stdout => "stdout", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static InterpreterOutputStreamOutputType? ToEnum(string value) + { + return value switch + { + "stderr" => InterpreterOutputStreamOutputType.Stderr, + "stdout" => InterpreterOutputStreamOutputType.Stdout, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.JobInfoSuccessResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.JobInfoSuccessResponse.Json.g.cs new file mode 100644 index 00000000..1d25fec0 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.JobInfoSuccessResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class JobInfoSuccessResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + 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); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.JobInfoSuccessResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.JobInfoSuccessResponse), + jsonSerializerContext) as global::Together.JobInfoSuccessResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.JobInfoSuccessResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.JobInfoSuccessResponse? FromJson( + 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); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.JobInfoSuccessResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.JobInfoSuccessResponse; + } + + /// + /// 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.Models.JobInfoSuccessResponse.g.cs b/src/libs/Together/Generated/Together.Models.JobInfoSuccessResponse.g.cs new file mode 100644 index 00000000..0e1dc560 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.JobInfoSuccessResponse.g.cs @@ -0,0 +1,121 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class JobInfoSuccessResponse + { + /// + /// Example: model_upload + /// + /// model_upload + [global::System.Text.Json.Serialization.JsonPropertyName("type")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Type { get; set; } + + /// + /// Example: job-a15dad11-8d8e-4007-97c5-a211304de284 + /// + /// job-a15dad11-8d8e-4007-97c5-a211304de284 + [global::System.Text.Json.Serialization.JsonPropertyName("job_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string JobId { get; set; } + + /// + /// Example: Complete + /// + /// Complete + [global::System.Text.Json.Serialization.JsonPropertyName("status")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.JobInfoSuccessResponseStatusJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.JobInfoSuccessResponseStatus Status { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("status_updates")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList StatusUpdates { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("args")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.JobInfoSuccessResponseArgs Args { get; set; } + + /// + /// Example: 2025-03-11T22:05:43Z + /// + /// 2025-03-11T22:05:43Z + [global::System.Text.Json.Serialization.JsonPropertyName("created_at")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.DateTime CreatedAt { get; set; } + + /// + /// Example: 2025-03-11T22:36:12Z + /// + /// 2025-03-11T22:36:12Z + [global::System.Text.Json.Serialization.JsonPropertyName("updated_at")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.DateTime UpdatedAt { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Example: model_upload + /// + /// + /// Example: job-a15dad11-8d8e-4007-97c5-a211304de284 + /// + /// + /// Example: Complete + /// + /// + /// + /// + /// Example: 2025-03-11T22:05:43Z + /// + /// + /// Example: 2025-03-11T22:36:12Z + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public JobInfoSuccessResponse( + string type, + string jobId, + global::Together.JobInfoSuccessResponseStatus status, + global::System.Collections.Generic.IList statusUpdates, + global::Together.JobInfoSuccessResponseArgs args, + global::System.DateTime createdAt, + global::System.DateTime updatedAt) + { + this.Type = type ?? throw new global::System.ArgumentNullException(nameof(type)); + this.JobId = jobId ?? throw new global::System.ArgumentNullException(nameof(jobId)); + this.Status = status; + this.StatusUpdates = statusUpdates ?? throw new global::System.ArgumentNullException(nameof(statusUpdates)); + this.Args = args ?? throw new global::System.ArgumentNullException(nameof(args)); + this.CreatedAt = createdAt; + this.UpdatedAt = updatedAt; + } + + /// + /// Initializes a new instance of the class. + /// + public JobInfoSuccessResponse() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.JobInfoSuccessResponseArgs.Json.g.cs b/src/libs/Together/Generated/Together.Models.JobInfoSuccessResponseArgs.Json.g.cs new file mode 100644 index 00000000..54bdb627 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.JobInfoSuccessResponseArgs.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class JobInfoSuccessResponseArgs + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + 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); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.JobInfoSuccessResponseArgs? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.JobInfoSuccessResponseArgs), + jsonSerializerContext) as global::Together.JobInfoSuccessResponseArgs; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.JobInfoSuccessResponseArgs? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.JobInfoSuccessResponseArgs? FromJson( + 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); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.JobInfoSuccessResponseArgs), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.JobInfoSuccessResponseArgs; + } + + /// + /// 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.Models.JobInfoSuccessResponseArgs.g.cs b/src/libs/Together/Generated/Together.Models.JobInfoSuccessResponseArgs.g.cs new file mode 100644 index 00000000..fa1755c5 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.JobInfoSuccessResponseArgs.g.cs @@ -0,0 +1,71 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class JobInfoSuccessResponseArgs + { + /// + /// Example: Finetuned Qwen2.5-72B-Instruct by Unsloth + /// + /// Finetuned Qwen2.5-72B-Instruct by Unsloth + [global::System.Text.Json.Serialization.JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// Example: necolinehubner/Qwen2.5-72B-Instruct + /// + /// necolinehubner/Qwen2.5-72B-Instruct + [global::System.Text.Json.Serialization.JsonPropertyName("modelName")] + public string? ModelName { get; set; } + + /// + /// Example: unsloth/Qwen2.5-72B-Instruct + /// + /// unsloth/Qwen2.5-72B-Instruct + [global::System.Text.Json.Serialization.JsonPropertyName("modelSource")] + public string? ModelSource { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Example: Finetuned Qwen2.5-72B-Instruct by Unsloth + /// + /// + /// Example: necolinehubner/Qwen2.5-72B-Instruct + /// + /// + /// Example: unsloth/Qwen2.5-72B-Instruct + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public JobInfoSuccessResponseArgs( + string? description, + string? modelName, + string? modelSource) + { + this.Description = description; + this.ModelName = modelName; + this.ModelSource = modelSource; + } + + /// + /// Initializes a new instance of the class. + /// + public JobInfoSuccessResponseArgs() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.JobInfoSuccessResponseStatus.g.cs b/src/libs/Together/Generated/Together.Models.JobInfoSuccessResponseStatus.g.cs new file mode 100644 index 00000000..053d87dc --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.JobInfoSuccessResponseStatus.g.cs @@ -0,0 +1,63 @@ + +#nullable enable + +namespace Together +{ + /// + /// Example: Complete + /// + public enum JobInfoSuccessResponseStatus + { + /// + /// + /// + Complete, + /// + /// + /// + Failed, + /// + /// + /// + Queued, + /// + /// + /// + Running, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class JobInfoSuccessResponseStatusExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this JobInfoSuccessResponseStatus value) + { + return value switch + { + JobInfoSuccessResponseStatus.Complete => "Complete", + JobInfoSuccessResponseStatus.Failed => "Failed", + JobInfoSuccessResponseStatus.Queued => "Queued", + JobInfoSuccessResponseStatus.Running => "Running", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static JobInfoSuccessResponseStatus? ToEnum(string value) + { + return value switch + { + "Complete" => JobInfoSuccessResponseStatus.Complete, + "Failed" => JobInfoSuccessResponseStatus.Failed, + "Queued" => JobInfoSuccessResponseStatus.Queued, + "Running" => JobInfoSuccessResponseStatus.Running, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.JobInfoSuccessResponseStatusUpdate.Json.g.cs b/src/libs/Together/Generated/Together.Models.JobInfoSuccessResponseStatusUpdate.Json.g.cs new file mode 100644 index 00000000..82e44a13 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.JobInfoSuccessResponseStatusUpdate.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class JobInfoSuccessResponseStatusUpdate + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + 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); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.JobInfoSuccessResponseStatusUpdate? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.JobInfoSuccessResponseStatusUpdate), + jsonSerializerContext) as global::Together.JobInfoSuccessResponseStatusUpdate; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.JobInfoSuccessResponseStatusUpdate? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.JobInfoSuccessResponseStatusUpdate? FromJson( + 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); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.JobInfoSuccessResponseStatusUpdate), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.JobInfoSuccessResponseStatusUpdate; + } + + /// + /// 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.Models.JobInfoSuccessResponseStatusUpdate.g.cs b/src/libs/Together/Generated/Together.Models.JobInfoSuccessResponseStatusUpdate.g.cs new file mode 100644 index 00000000..b3258fdb --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.JobInfoSuccessResponseStatusUpdate.g.cs @@ -0,0 +1,74 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class JobInfoSuccessResponseStatusUpdate + { + /// + /// Example: Complete + /// + /// Complete + [global::System.Text.Json.Serialization.JsonPropertyName("status")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Status { get; set; } + + /// + /// Example: Job is Complete + /// + /// Job is Complete + [global::System.Text.Json.Serialization.JsonPropertyName("message")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Message { get; set; } + + /// + /// Example: 2025-03-11T22:36:12Z + /// + /// 2025-03-11T22:36:12Z + [global::System.Text.Json.Serialization.JsonPropertyName("timestamp")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.DateTime Timestamp { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Example: Complete + /// + /// + /// Example: Job is Complete + /// + /// + /// Example: 2025-03-11T22:36:12Z + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public JobInfoSuccessResponseStatusUpdate( + string status, + string message, + global::System.DateTime timestamp) + { + this.Status = status ?? throw new global::System.ArgumentNullException(nameof(status)); + this.Message = message ?? throw new global::System.ArgumentNullException(nameof(message)); + this.Timestamp = timestamp; + } + + /// + /// Initializes a new instance of the class. + /// + public JobInfoSuccessResponseStatusUpdate() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.JobsInfoSuccessResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.JobsInfoSuccessResponse.Json.g.cs new file mode 100644 index 00000000..c0961450 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.JobsInfoSuccessResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class JobsInfoSuccessResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + 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); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.JobsInfoSuccessResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.JobsInfoSuccessResponse), + jsonSerializerContext) as global::Together.JobsInfoSuccessResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.JobsInfoSuccessResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.JobsInfoSuccessResponse? FromJson( + 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); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.JobsInfoSuccessResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.JobsInfoSuccessResponse; + } + + /// + /// 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.Models.JobsInfoSuccessResponse.g.cs b/src/libs/Together/Generated/Together.Models.JobsInfoSuccessResponse.g.cs new file mode 100644 index 00000000..f48e3f3b --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.JobsInfoSuccessResponse.g.cs @@ -0,0 +1,45 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class JobsInfoSuccessResponse + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Data { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public JobsInfoSuccessResponse( + global::System.Collections.Generic.IList data) + { + this.Data = data ?? throw new global::System.ArgumentNullException(nameof(data)); + } + + /// + /// Initializes a new instance of the class. + /// + public JobsInfoSuccessResponse() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.JsonSerializerContext.g.cs b/src/libs/Together/Generated/Together.Models.JsonSerializerContext.g.cs new file mode 100644 index 00000000..61bb6206 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.JsonSerializerContext.g.cs @@ -0,0 +1,109 @@ + +#nullable enable + +namespace Together +{ /// + /// + /// + public sealed partial class ModelsSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext + { + private static readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver Resolver = new LazyChunkResolver(); + + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + internal static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver TypeInfoResolver => Resolver; + + + private static readonly global::System.Text.Json.JsonSerializerOptions DefaultOptions = CreateDefaultOptions(); + + /// + /// + /// + public static ModelsSourceGenerationContext Default { get; } = new(DefaultOptions); + + private ModelsSourceGenerationContext(global::System.Text.Json.JsonSerializerOptions options) + : base(options) + { + } + + /// + protected override global::System.Text.Json.JsonSerializerOptions? GeneratedSerializerOptions => DefaultOptions; + + /// + public override global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo(global::System.Type type) + { + return Resolver.GetTypeInfo(type, Options); + } + + /// + /// Adds this package's converters to . + /// + /// + /// A converter has to be on the options a chained resolver builds its JsonTypeInfo against, + /// and a context resolves types from every package below it. Each package contributes only + /// what it owns and calls down the chain for the rest, so the family's converter table is + /// written once rather than copied into all of them. + /// + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) + { + global::Together.SourceGenerationContext.AddConverters(options); + } + + private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() + { + var options = new global::System.Text.Json.JsonSerializerOptions + { + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + TypeInfoResolver = Resolver, + }; + AddConverters(options); + + return options; + } + + private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver + { + private readonly object _gate = new(); + private readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[] _resolvers = new global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[1]; + + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo( + global::System.Type type, + global::System.Text.Json.JsonSerializerOptions options) + { + for (var index = 0; index < _resolvers.Length; index++) + { + var typeInfo = GetResolver(index).GetTypeInfo(type, options); + if (typeInfo is not null) + { + return typeInfo; + } + } + + return null; + } + + private global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver GetResolver(int index) + { + var resolver = global::System.Threading.Volatile.Read(ref _resolvers[index]); + if (resolver is not null) + { + return resolver; + } + + lock (_gate) + { + return _resolvers[index] ??= CreateResolver(index); + } + } + + private static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver CreateResolver(int index) + { + return index switch + { + 0 => global::Together.SourceGenerationContext.TypeInfoResolver, + _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), + }; + } + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.ListAdaptersResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.ListAdaptersResponse.Json.g.cs new file mode 100644 index 00000000..8df4cdd9 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ListAdaptersResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class ListAdaptersResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + 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); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.ListAdaptersResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.ListAdaptersResponse), + jsonSerializerContext) as global::Together.ListAdaptersResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ListAdaptersResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.ListAdaptersResponse? FromJson( + 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); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.ListAdaptersResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.ListAdaptersResponse; + } + + /// + /// 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.Models.ListAdaptersResponse.g.cs b/src/libs/Together/Generated/Together.Models.ListAdaptersResponse.g.cs new file mode 100644 index 00000000..1b5cf93b --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ListAdaptersResponse.g.cs @@ -0,0 +1,56 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class ListAdaptersResponse + { + /// + /// Example: list + /// + /// list + [global::System.Text.Json.Serialization.JsonPropertyName("object")] + public string? Object { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + public global::System.Collections.Generic.IList? Data { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Example: list + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ListAdaptersResponse( + string? @object, + global::System.Collections.Generic.IList? data) + { + this.Object = @object; + this.Data = data; + } + + /// + /// Initializes a new instance of the class. + /// + public ListAdaptersResponse() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.ListAdaptersResponseDataItem.Json.g.cs b/src/libs/Together/Generated/Together.Models.ListAdaptersResponseDataItem.Json.g.cs new file mode 100644 index 00000000..76bd22c4 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ListAdaptersResponseDataItem.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class ListAdaptersResponseDataItem + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + 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); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.ListAdaptersResponseDataItem? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.ListAdaptersResponseDataItem), + jsonSerializerContext) as global::Together.ListAdaptersResponseDataItem; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ListAdaptersResponseDataItem? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.ListAdaptersResponseDataItem? FromJson( + 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); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.ListAdaptersResponseDataItem), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.ListAdaptersResponseDataItem; + } + + /// + /// 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.Models.ListAdaptersResponseDataItem.g.cs b/src/libs/Together/Generated/Together.Models.ListAdaptersResponseDataItem.g.cs new file mode 100644 index 00000000..00bb8d50 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ListAdaptersResponseDataItem.g.cs @@ -0,0 +1,64 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class ListAdaptersResponseDataItem + { + /// + /// Combined endpoint:adapter identifier + /// + [global::System.Text.Json.Serialization.JsonPropertyName("model_id")] + public string? ModelId { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("adapter_name")] + public string? AdapterName { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("endpoint_name")] + public string? EndpointName { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Combined endpoint:adapter identifier + /// + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ListAdaptersResponseDataItem( + string? modelId, + string? adapterName, + string? endpointName) + { + this.ModelId = modelId; + this.AdapterName = adapterName; + this.EndpointName = endpointName; + } + + /// + /// Initializes a new instance of the class. + /// + public ListAdaptersResponseDataItem() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.ListAvailibilityZonesResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.ListAvailibilityZonesResponse.Json.g.cs new file mode 100644 index 00000000..08fb3eaa --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ListAvailibilityZonesResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class ListAvailibilityZonesResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + 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); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.ListAvailibilityZonesResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.ListAvailibilityZonesResponse), + jsonSerializerContext) as global::Together.ListAvailibilityZonesResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ListAvailibilityZonesResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.ListAvailibilityZonesResponse? FromJson( + 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); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.ListAvailibilityZonesResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.ListAvailibilityZonesResponse; + } + + /// + /// 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.Models.ListAvailibilityZonesResponse.g.cs b/src/libs/Together/Generated/Together.Models.ListAvailibilityZonesResponse.g.cs new file mode 100644 index 00000000..4ae335e2 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ListAvailibilityZonesResponse.g.cs @@ -0,0 +1,45 @@ + +#nullable enable + +namespace Together +{ + /// + /// List of unique availability zones + /// + public sealed partial class ListAvailibilityZonesResponse + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("avzones")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Avzones { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ListAvailibilityZonesResponse( + global::System.Collections.Generic.IList avzones) + { + this.Avzones = avzones ?? throw new global::System.ArgumentNullException(nameof(avzones)); + } + + /// + /// Initializes a new instance of the class. + /// + public ListAvailibilityZonesResponse() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.ListEndpoint.Json.g.cs b/src/libs/Together/Generated/Together.Models.ListEndpoint.Json.g.cs new file mode 100644 index 00000000..c0f854fc --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ListEndpoint.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class ListEndpoint + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + 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); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.ListEndpoint? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.ListEndpoint), + jsonSerializerContext) as global::Together.ListEndpoint; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ListEndpoint? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.ListEndpoint? FromJson( + 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); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.ListEndpoint), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.ListEndpoint; + } + + /// + /// 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.Models.ListEndpoint.g.cs b/src/libs/Together/Generated/Together.Models.ListEndpoint.g.cs new file mode 100644 index 00000000..867a8719 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ListEndpoint.g.cs @@ -0,0 +1,154 @@ + +#nullable enable + +namespace Together +{ + /// + /// Details about an endpoint when listed via the list endpoint + /// + public sealed partial class ListEndpoint + { + /// + /// The object type, which is always `endpoint`. + /// + /// "endpoint" + [global::System.Text.Json.Serialization.JsonPropertyName("object")] + public string Object { get; set; } = "endpoint"; + + /// + /// Unique identifier for the endpoint
+ /// Example: endpoint-d23901de-ef8f-44bf-b3e7-de9c1ca8f2d7 + ///
+ /// endpoint-d23901de-ef8f-44bf-b3e7-de9c1ca8f2d7 + [global::System.Text.Json.Serialization.JsonPropertyName("id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Id { get; set; } + + /// + /// System name for the endpoint
+ /// Example: allenai/OLMo-7B + ///
+ /// allenai/OLMo-7B + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Name { get; set; } + + /// + /// The model deployed on this endpoint
+ /// Example: allenai/OLMo-7B + ///
+ /// allenai/OLMo-7B + [global::System.Text.Json.Serialization.JsonPropertyName("model")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Model { get; set; } + + /// + /// The type of endpoint
+ /// Example: serverless + ///
+ /// serverless + [global::System.Text.Json.Serialization.JsonPropertyName("type")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.ListEndpointTypeJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.ListEndpointType Type { get; set; } + + /// + /// The owner of this endpoint
+ /// Example: together + ///
+ /// together + [global::System.Text.Json.Serialization.JsonPropertyName("owner")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Owner { get; set; } + + /// + /// Current state of the endpoint
+ /// Example: STARTED + ///
+ /// STARTED + [global::System.Text.Json.Serialization.JsonPropertyName("state")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.ListEndpointStateJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.ListEndpointState State { get; set; } + + /// + /// Timestamp when the endpoint was created
+ /// Example: 2024-02-28T21:34:35.444Z + ///
+ /// 2024-02-28T21:34:35.444Z + [global::System.Text.Json.Serialization.JsonPropertyName("created_at")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.DateTime CreatedAt { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Unique identifier for the endpoint
+ /// Example: endpoint-d23901de-ef8f-44bf-b3e7-de9c1ca8f2d7 + /// + /// + /// System name for the endpoint
+ /// Example: allenai/OLMo-7B + /// + /// + /// The model deployed on this endpoint
+ /// Example: allenai/OLMo-7B + /// + /// + /// The type of endpoint
+ /// Example: serverless + /// + /// + /// The owner of this endpoint
+ /// Example: together + /// + /// + /// Current state of the endpoint
+ /// Example: STARTED + /// + /// + /// Timestamp when the endpoint was created
+ /// Example: 2024-02-28T21:34:35.444Z + /// + /// + /// The object type, which is always `endpoint`. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ListEndpoint( + string id, + string name, + string model, + global::Together.ListEndpointType type, + string owner, + global::Together.ListEndpointState state, + global::System.DateTime createdAt, + string @object = "endpoint") + { + this.Object = @object; + this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); + this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); + this.Model = model ?? throw new global::System.ArgumentNullException(nameof(model)); + this.Type = type; + this.Owner = owner ?? throw new global::System.ArgumentNullException(nameof(owner)); + this.State = state; + this.CreatedAt = createdAt; + } + + /// + /// Initializes a new instance of the class. + /// + public ListEndpoint() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.ListEndpointObject.Json.g.cs b/src/libs/Together/Generated/Together.Models.ListEndpointObject.Json.g.cs new file mode 100644 index 00000000..8bccbeac --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ListEndpointObject.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class ListEndpointObject + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + 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); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.ListEndpointObject? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.ListEndpointObject), + jsonSerializerContext) as global::Together.ListEndpointObject; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ListEndpointObject? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.ListEndpointObject? FromJson( + 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); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.ListEndpointObject), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.ListEndpointObject; + } + + /// + /// 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.Models.ListEndpointObject.g.cs b/src/libs/Together/Generated/Together.Models.ListEndpointObject.g.cs new file mode 100644 index 00000000..9597b323 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ListEndpointObject.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Together +{ + /// + /// The object type, which is always `endpoint`. + /// + public sealed partial class ListEndpointObject + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.ListEndpointState.g.cs b/src/libs/Together/Generated/Together.Models.ListEndpointState.g.cs new file mode 100644 index 00000000..31c51b31 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ListEndpointState.g.cs @@ -0,0 +1,76 @@ + +#nullable enable + +namespace Together +{ + /// + /// Current state of the endpoint
+ /// Example: STARTED + ///
+ public enum ListEndpointState + { + /// + /// + /// + Error, + /// + /// + /// + Pending, + /// + /// + /// + Started, + /// + /// + /// + Starting, + /// + /// + /// + Stopped, + /// + /// + /// + Stopping, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class ListEndpointStateExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this ListEndpointState value) + { + return value switch + { + ListEndpointState.Error => "ERROR", + ListEndpointState.Pending => "PENDING", + ListEndpointState.Started => "STARTED", + ListEndpointState.Starting => "STARTING", + ListEndpointState.Stopped => "STOPPED", + ListEndpointState.Stopping => "STOPPING", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static ListEndpointState? ToEnum(string value) + { + return value switch + { + "ERROR" => ListEndpointState.Error, + "PENDING" => ListEndpointState.Pending, + "STARTED" => ListEndpointState.Started, + "STARTING" => ListEndpointState.Starting, + "STOPPED" => ListEndpointState.Stopped, + "STOPPING" => ListEndpointState.Stopping, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.ListEndpointType.g.cs b/src/libs/Together/Generated/Together.Models.ListEndpointType.g.cs new file mode 100644 index 00000000..3cf5cee2 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ListEndpointType.g.cs @@ -0,0 +1,52 @@ + +#nullable enable + +namespace Together +{ + /// + /// The type of endpoint
+ /// Example: serverless + ///
+ public enum ListEndpointType + { + /// + /// + /// + Dedicated, + /// + /// + /// + Serverless, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class ListEndpointTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this ListEndpointType value) + { + return value switch + { + ListEndpointType.Dedicated => "dedicated", + ListEndpointType.Serverless => "serverless", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static ListEndpointType? ToEnum(string value) + { + return value switch + { + "dedicated" => ListEndpointType.Dedicated, + "serverless" => ListEndpointType.Serverless, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.ListEndpointsResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.ListEndpointsResponse.Json.g.cs new file mode 100644 index 00000000..f4e1d5c0 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ListEndpointsResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class ListEndpointsResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + 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); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.ListEndpointsResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.ListEndpointsResponse), + jsonSerializerContext) as global::Together.ListEndpointsResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ListEndpointsResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.ListEndpointsResponse? FromJson( + 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); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.ListEndpointsResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.ListEndpointsResponse; + } + + /// + /// 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.Models.ListEndpointsResponse.g.cs b/src/libs/Together/Generated/Together.Models.ListEndpointsResponse.g.cs new file mode 100644 index 00000000..b83cf5b1 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ListEndpointsResponse.g.cs @@ -0,0 +1,57 @@ + +#nullable enable + +namespace Together +{ + /// + /// Example: {"object":"list","data":[{"object":"endpoint","id":"endpoint-5c0c20db-62fe-4f41-8ffc-d9e4ea1a264e","name":"allenai/OLMo-7B","model":"allenai/OLMo-7B","type":"serverless","owner":"together","state":"STARTED","created_at":"2024-02-28T21:34:35.444Z"}]} + /// + public sealed partial class ListEndpointsResponse + { + /// + /// The object type, which is always `list`. + /// + /// "list" + [global::System.Text.Json.Serialization.JsonPropertyName("object")] + public string Object { get; set; } = "list"; + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Data { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// + /// The object type, which is always `list`. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ListEndpointsResponse( + global::System.Collections.Generic.IList data, + string @object = "list") + { + this.Object = @object; + this.Data = data ?? throw new global::System.ArgumentNullException(nameof(data)); + } + + /// + /// Initializes a new instance of the class. + /// + public ListEndpointsResponse() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.WhoamiResponseDiscriminator.Json.g.cs b/src/libs/Together/Generated/Together.Models.ListEndpointsResponseObject.Json.g.cs similarity index 87% rename from src/libs/Together/Generated/Together.Models.WhoamiResponseDiscriminator.Json.g.cs rename to src/libs/Together/Generated/Together.Models.ListEndpointsResponseObject.Json.g.cs index 6f5d5ff9..588ad6b9 100644 --- a/src/libs/Together/Generated/Together.Models.WhoamiResponseDiscriminator.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.ListEndpointsResponseObject.Json.g.cs @@ -2,7 +2,7 @@ namespace Together { - public sealed partial class WhoamiResponseDiscriminator + public sealed partial class ListEndpointsResponseObject { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -47,20 +47,20 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::Together.WhoamiResponseDiscriminator? FromJson( + public static global::Together.ListEndpointsResponseObject? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::Together.WhoamiResponseDiscriminator), - jsonSerializerContext) as global::Together.WhoamiResponseDiscriminator; + typeof(global::Together.ListEndpointsResponseObject), + jsonSerializerContext) as global::Together.ListEndpointsResponseObject; } /// /// Deserializes a JSON string using the generated default JsonSerializerContext. /// - public static global::Together.WhoamiResponseDiscriminator? FromJson( + public static global::Together.ListEndpointsResponseObject? FromJson( string json) { return FromJson( @@ -75,7 +75,7 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::Together.WhoamiResponseDiscriminator? FromJson( + public static global::Together.ListEndpointsResponseObject? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -86,7 +86,7 @@ public string ToJson( global::Together.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -94,20 +94,20 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, - typeof(global::Together.WhoamiResponseDiscriminator), - jsonSerializerContext).ConfigureAwait(false)) as global::Together.WhoamiResponseDiscriminator; + typeof(global::Together.ListEndpointsResponseObject), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.ListEndpointsResponseObject; } /// /// Deserializes a JSON stream using the generated default JsonSerializerContext. /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream) { return FromJsonStreamAsync( @@ -122,7 +122,7 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -133,7 +133,7 @@ public string ToJson( global::Together.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.DeserializeAsync( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/Together/Generated/Together.Models.ListEndpointsResponseObject.g.cs b/src/libs/Together/Generated/Together.Models.ListEndpointsResponseObject.g.cs new file mode 100644 index 00000000..a5dbabdd --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ListEndpointsResponseObject.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Together +{ + /// + /// The object type, which is always `list`. + /// + public sealed partial class ListEndpointsResponseObject + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.ListEndpointsType.g.cs b/src/libs/Together/Generated/Together.Models.ListEndpointsType.g.cs new file mode 100644 index 00000000..603493dc --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ListEndpointsType.g.cs @@ -0,0 +1,51 @@ + +#nullable enable + +namespace Together +{ + /// + /// Filter endpoints by type + /// + public enum ListEndpointsType + { + /// + /// + /// + Dedicated, + /// + /// + /// + Serverless, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class ListEndpointsTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this ListEndpointsType value) + { + return value switch + { + ListEndpointsType.Dedicated => "dedicated", + ListEndpointsType.Serverless => "serverless", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static ListEndpointsType? ToEnum(string value) + { + return value switch + { + "dedicated" => ListEndpointsType.Dedicated, + "serverless" => ListEndpointsType.Serverless, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.ListEndpointsUsageType.g.cs b/src/libs/Together/Generated/Together.Models.ListEndpointsUsageType.g.cs new file mode 100644 index 00000000..cc820db7 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ListEndpointsUsageType.g.cs @@ -0,0 +1,51 @@ + +#nullable enable + +namespace Together +{ + /// + /// Filter endpoints by usage type + /// + public enum ListEndpointsUsageType + { + /// + /// + /// + OnDemand, + /// + /// + /// + Reserved, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class ListEndpointsUsageTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this ListEndpointsUsageType value) + { + return value switch + { + ListEndpointsUsageType.OnDemand => "on-demand", + ListEndpointsUsageType.Reserved => "reserved", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static ListEndpointsUsageType? ToEnum(string value) + { + return value switch + { + "on-demand" => ListEndpointsUsageType.OnDemand, + "reserved" => ListEndpointsUsageType.Reserved, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.ListHardwareResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.ListHardwareResponse.Json.g.cs new file mode 100644 index 00000000..abcda90e --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ListHardwareResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class ListHardwareResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + 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); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.ListHardwareResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.ListHardwareResponse), + jsonSerializerContext) as global::Together.ListHardwareResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ListHardwareResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.ListHardwareResponse? FromJson( + 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); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.ListHardwareResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.ListHardwareResponse; + } + + /// + /// 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.Models.ListHardwareResponse.g.cs b/src/libs/Together/Generated/Together.Models.ListHardwareResponse.g.cs new file mode 100644 index 00000000..ba515ba3 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ListHardwareResponse.g.cs @@ -0,0 +1,57 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class ListHardwareResponse + { + /// + /// The object type, which is always `list`. + /// + /// "list" + [global::System.Text.Json.Serialization.JsonPropertyName("object")] + public string Object { get; set; } = "list"; + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Data { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// + /// The object type, which is always `list`. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ListHardwareResponse( + global::System.Collections.Generic.IList data, + string @object = "list") + { + this.Object = @object; + this.Data = data ?? throw new global::System.ArgumentNullException(nameof(data)); + } + + /// + /// Initializes a new instance of the class. + /// + public ListHardwareResponse() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.ListHardwareResponseObject.Json.g.cs b/src/libs/Together/Generated/Together.Models.ListHardwareResponseObject.Json.g.cs new file mode 100644 index 00000000..30503cc0 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ListHardwareResponseObject.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class ListHardwareResponseObject + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + 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); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.ListHardwareResponseObject? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.ListHardwareResponseObject), + jsonSerializerContext) as global::Together.ListHardwareResponseObject; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ListHardwareResponseObject? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.ListHardwareResponseObject? FromJson( + 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); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.ListHardwareResponseObject), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.ListHardwareResponseObject; + } + + /// + /// 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.Models.ListHardwareResponseObject.g.cs b/src/libs/Together/Generated/Together.Models.ListHardwareResponseObject.g.cs new file mode 100644 index 00000000..ef481381 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ListHardwareResponseObject.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Together +{ + /// + /// The object type, which is always `list`. + /// + public sealed partial class ListHardwareResponseObject + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.ModelInfo.Json.g.cs b/src/libs/Together/Generated/Together.Models.ModelInfo.Json.g.cs new file mode 100644 index 00000000..bb5c6c97 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ModelInfo.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class ModelInfo + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + 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); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.ModelInfo? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.ModelInfo), + jsonSerializerContext) as global::Together.ModelInfo; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ModelInfo? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.ModelInfo? FromJson( + 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); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.ModelInfo), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.ModelInfo; + } + + /// + /// 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.Models.ModelInfo.g.cs b/src/libs/Together/Generated/Together.Models.ModelInfo.g.cs new file mode 100644 index 00000000..c3104c5c --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ModelInfo.g.cs @@ -0,0 +1,153 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class ModelInfo + { + /// + /// Example: Austism/chronos-hermes-13b + /// + /// Austism/chronos-hermes-13b + [global::System.Text.Json.Serialization.JsonPropertyName("id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Id { get; set; } + + /// + /// The object type, which is always `model`. + /// + /// "model" + [global::System.Text.Json.Serialization.JsonPropertyName("object")] + public string Object { get; set; } = "model"; + + /// + /// Example: 1692896905 + /// + /// 1692896905 + [global::System.Text.Json.Serialization.JsonPropertyName("created")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int Created { get; set; } + + /// + /// Example: chat + /// + /// chat + [global::System.Text.Json.Serialization.JsonPropertyName("type")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.ModelInfoTypeJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.ModelInfoType Type { get; set; } + + /// + /// Example: Chronos Hermes (13B) + /// + /// Chronos Hermes (13B) + [global::System.Text.Json.Serialization.JsonPropertyName("display_name")] + public string? DisplayName { get; set; } + + /// + /// Example: Austism + /// + /// Austism + [global::System.Text.Json.Serialization.JsonPropertyName("organization")] + public string? Organization { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("link")] + public string? Link { get; set; } + + /// + /// Example: other + /// + /// other + [global::System.Text.Json.Serialization.JsonPropertyName("license")] + public string? License { get; set; } + + /// + /// Example: 2048 + /// + /// 2048 + [global::System.Text.Json.Serialization.JsonPropertyName("context_length")] + public int? ContextLength { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("pricing")] + public global::Together.Pricing? Pricing { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Example: Austism/chronos-hermes-13b + /// + /// + /// Example: 1692896905 + /// + /// + /// Example: chat + /// + /// + /// Example: Chronos Hermes (13B) + /// + /// + /// Example: Austism + /// + /// + /// + /// Example: other + /// + /// + /// Example: 2048 + /// + /// + /// + /// The object type, which is always `model`. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ModelInfo( + string id, + int created, + global::Together.ModelInfoType type, + string? displayName, + string? organization, + string? link, + string? license, + int? contextLength, + global::Together.Pricing? pricing, + string @object = "model") + { + this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); + this.Object = @object; + this.Created = created; + this.Type = type; + this.DisplayName = displayName; + this.Organization = organization; + this.Link = link; + this.License = license; + this.ContextLength = contextLength; + this.Pricing = pricing; + } + + /// + /// Initializes a new instance of the class. + /// + public ModelInfo() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.ModelInfoObject.Json.g.cs b/src/libs/Together/Generated/Together.Models.ModelInfoObject.Json.g.cs new file mode 100644 index 00000000..10818b95 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ModelInfoObject.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class ModelInfoObject + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + 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); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.ModelInfoObject? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.ModelInfoObject), + jsonSerializerContext) as global::Together.ModelInfoObject; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ModelInfoObject? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.ModelInfoObject? FromJson( + 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); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.ModelInfoObject), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.ModelInfoObject; + } + + /// + /// 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.Models.ModelInfoObject.g.cs b/src/libs/Together/Generated/Together.Models.ModelInfoObject.g.cs new file mode 100644 index 00000000..db9cf16d --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ModelInfoObject.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Together +{ + /// + /// The object type, which is always `model`. + /// + public sealed partial class ModelInfoObject + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.ModelInfoType.g.cs b/src/libs/Together/Generated/Together.Models.ModelInfoType.g.cs new file mode 100644 index 00000000..85951a56 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ModelInfoType.g.cs @@ -0,0 +1,99 @@ + +#nullable enable + +namespace Together +{ + /// + /// Example: chat + /// + public enum ModelInfoType + { + /// + /// + /// + Audio, + /// + /// + /// + Chat, + /// + /// + /// + Code, + /// + /// + /// + Embedding, + /// + /// + /// + Image, + /// + /// + /// + Language, + /// + /// + /// + Moderation, + /// + /// + /// + Rerank, + /// + /// + /// + Transcribe, + /// + /// + /// + Video, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class ModelInfoTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this ModelInfoType value) + { + return value switch + { + ModelInfoType.Audio => "audio", + ModelInfoType.Chat => "chat", + ModelInfoType.Code => "code", + ModelInfoType.Embedding => "embedding", + ModelInfoType.Image => "image", + ModelInfoType.Language => "language", + ModelInfoType.Moderation => "moderation", + ModelInfoType.Rerank => "rerank", + ModelInfoType.Transcribe => "transcribe", + ModelInfoType.Video => "video", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static ModelInfoType? ToEnum(string value) + { + return value switch + { + "audio" => ModelInfoType.Audio, + "chat" => ModelInfoType.Chat, + "code" => ModelInfoType.Code, + "embedding" => ModelInfoType.Embedding, + "image" => ModelInfoType.Image, + "language" => ModelInfoType.Language, + "moderation" => ModelInfoType.Moderation, + "rerank" => ModelInfoType.Rerank, + "transcribe" => ModelInfoType.Transcribe, + "video" => ModelInfoType.Video, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.ModelUploadRequest.Json.g.cs b/src/libs/Together/Generated/Together.Models.ModelUploadRequest.Json.g.cs new file mode 100644 index 00000000..92fb42ae --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ModelUploadRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class ModelUploadRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + 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); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.ModelUploadRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.ModelUploadRequest), + jsonSerializerContext) as global::Together.ModelUploadRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ModelUploadRequest? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.ModelUploadRequest? FromJson( + 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); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.ModelUploadRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.ModelUploadRequest; + } + + /// + /// 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.Models.ModelUploadRequest.g.cs b/src/libs/Together/Generated/Together.Models.ModelUploadRequest.g.cs new file mode 100644 index 00000000..33c2e222 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ModelUploadRequest.g.cs @@ -0,0 +1,138 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class ModelUploadRequest + { + /// + /// The name to give to your uploaded model
+ /// Example: Qwen2.5-72B-Instruct + ///
+ /// Qwen2.5-72B-Instruct + [global::System.Text.Json.Serialization.JsonPropertyName("model_name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string ModelName { get; set; } + + /// + /// The source location of the model (Hugging Face repo or S3 path)
+ /// Example: unsloth/Qwen2.5-72B-Instruct + ///
+ /// unsloth/Qwen2.5-72B-Instruct + [global::System.Text.Json.Serialization.JsonPropertyName("model_source")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string ModelSource { get; set; } + + /// + /// Whether the model is a full model or an adapter
+ /// Default Value: model
+ /// Example: model + ///
+ /// model + [global::System.Text.Json.Serialization.JsonPropertyName("model_type")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.ModelUploadRequestModelTypeJsonConverter))] + public global::Together.ModelUploadRequestModelType? ModelType { get; set; } + + /// + /// Hugging Face token (if uploading from Hugging Face)
+ /// Example: hf_examplehuggingfacetoken + ///
+ /// hf_examplehuggingfacetoken + [global::System.Text.Json.Serialization.JsonPropertyName("hf_token")] + public string? HfToken { get; set; } + + /// + /// A description of your model
+ /// Example: Finetuned Qwen2.5-72B-Instruct by Unsloth + ///
+ /// Finetuned Qwen2.5-72B-Instruct by Unsloth + [global::System.Text.Json.Serialization.JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// The base model to use for an adapter if setting it to run against a serverless pool. Only used for model_type `adapter`.
+ /// Example: Qwen/Qwen2.5-72B-Instruct + ///
+ /// Qwen/Qwen2.5-72B-Instruct + [global::System.Text.Json.Serialization.JsonPropertyName("base_model")] + public string? BaseModel { get; set; } + + /// + /// The lora pool to use for an adapter if setting it to run against, say, a dedicated pool. Only used for model_type `adapter`.
+ /// Example: my_username/Qwen2.5-72B-Instruct-lora + ///
+ /// my_username/Qwen2.5-72B-Instruct-lora + [global::System.Text.Json.Serialization.JsonPropertyName("lora_model")] + public string? LoraModel { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The name to give to your uploaded model
+ /// Example: Qwen2.5-72B-Instruct + /// + /// + /// The source location of the model (Hugging Face repo or S3 path)
+ /// Example: unsloth/Qwen2.5-72B-Instruct + /// + /// + /// Whether the model is a full model or an adapter
+ /// Default Value: model
+ /// Example: model + /// + /// + /// Hugging Face token (if uploading from Hugging Face)
+ /// Example: hf_examplehuggingfacetoken + /// + /// + /// A description of your model
+ /// Example: Finetuned Qwen2.5-72B-Instruct by Unsloth + /// + /// + /// The base model to use for an adapter if setting it to run against a serverless pool. Only used for model_type `adapter`.
+ /// Example: Qwen/Qwen2.5-72B-Instruct + /// + /// + /// The lora pool to use for an adapter if setting it to run against, say, a dedicated pool. Only used for model_type `adapter`.
+ /// Example: my_username/Qwen2.5-72B-Instruct-lora + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ModelUploadRequest( + string modelName, + string modelSource, + global::Together.ModelUploadRequestModelType? modelType, + string? hfToken, + string? description, + string? baseModel, + string? loraModel) + { + this.ModelName = modelName ?? throw new global::System.ArgumentNullException(nameof(modelName)); + this.ModelSource = modelSource ?? throw new global::System.ArgumentNullException(nameof(modelSource)); + this.ModelType = modelType; + this.HfToken = hfToken; + this.Description = description; + this.BaseModel = baseModel; + this.LoraModel = loraModel; + } + + /// + /// Initializes a new instance of the class. + /// + public ModelUploadRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.ModelUploadRequestModelType.g.cs b/src/libs/Together/Generated/Together.Models.ModelUploadRequestModelType.g.cs new file mode 100644 index 00000000..10bdc13e --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ModelUploadRequestModelType.g.cs @@ -0,0 +1,53 @@ + +#nullable enable + +namespace Together +{ + /// + /// Whether the model is a full model or an adapter
+ /// Default Value: model
+ /// Example: model + ///
+ public enum ModelUploadRequestModelType + { + /// + /// + /// + Adapter, + /// + /// + /// + Model, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class ModelUploadRequestModelTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this ModelUploadRequestModelType value) + { + return value switch + { + ModelUploadRequestModelType.Adapter => "adapter", + ModelUploadRequestModelType.Model => "model", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static ModelUploadRequestModelType? ToEnum(string value) + { + return value switch + { + "adapter" => ModelUploadRequestModelType.Adapter, + "model" => ModelUploadRequestModelType.Model, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.ModelUploadSuccessResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.ModelUploadSuccessResponse.Json.g.cs new file mode 100644 index 00000000..eb67e591 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ModelUploadSuccessResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class ModelUploadSuccessResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + 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); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.ModelUploadSuccessResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.ModelUploadSuccessResponse), + jsonSerializerContext) as global::Together.ModelUploadSuccessResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ModelUploadSuccessResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.ModelUploadSuccessResponse? FromJson( + 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); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.ModelUploadSuccessResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.ModelUploadSuccessResponse; + } + + /// + /// 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.Models.ModelUploadSuccessResponse.g.cs b/src/libs/Together/Generated/Together.Models.ModelUploadSuccessResponse.g.cs new file mode 100644 index 00000000..9b3006d3 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ModelUploadSuccessResponse.g.cs @@ -0,0 +1,58 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class ModelUploadSuccessResponse + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.ModelUploadSuccessResponseData Data { get; set; } + + /// + /// Example: Processing model weights. Job created. + /// + /// Processing model weights. Job created. + [global::System.Text.Json.Serialization.JsonPropertyName("message")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Message { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// + /// Example: Processing model weights. Job created. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ModelUploadSuccessResponse( + global::Together.ModelUploadSuccessResponseData data, + string message) + { + this.Data = data ?? throw new global::System.ArgumentNullException(nameof(data)); + this.Message = message ?? throw new global::System.ArgumentNullException(nameof(message)); + } + + /// + /// Initializes a new instance of the class. + /// + public ModelUploadSuccessResponse() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.ModelUploadSuccessResponseData.Json.g.cs b/src/libs/Together/Generated/Together.Models.ModelUploadSuccessResponseData.Json.g.cs new file mode 100644 index 00000000..3be1ff84 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ModelUploadSuccessResponseData.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class ModelUploadSuccessResponseData + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + 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); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.ModelUploadSuccessResponseData? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.ModelUploadSuccessResponseData), + jsonSerializerContext) as global::Together.ModelUploadSuccessResponseData; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ModelUploadSuccessResponseData? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.ModelUploadSuccessResponseData? FromJson( + 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); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.ModelUploadSuccessResponseData), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.ModelUploadSuccessResponseData; + } + + /// + /// 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.Models.ModelUploadSuccessResponseData.g.cs b/src/libs/Together/Generated/Together.Models.ModelUploadSuccessResponseData.g.cs new file mode 100644 index 00000000..39191db1 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ModelUploadSuccessResponseData.g.cs @@ -0,0 +1,87 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class ModelUploadSuccessResponseData + { + /// + /// Example: job-a15dad11-8d8e-4007-97c5-a211304de284 + /// + /// job-a15dad11-8d8e-4007-97c5-a211304de284 + [global::System.Text.Json.Serialization.JsonPropertyName("job_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string JobId { get; set; } + + /// + /// Example: necolinehubner/Qwen2.5-72B-Instruct + /// + /// necolinehubner/Qwen2.5-72B-Instruct + [global::System.Text.Json.Serialization.JsonPropertyName("model_name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string ModelName { get; set; } + + /// + /// Example: model-c0e32dfc-637e-47b2-bf4e-e9b2e58c9da7 + /// + /// model-c0e32dfc-637e-47b2-bf4e-e9b2e58c9da7 + [global::System.Text.Json.Serialization.JsonPropertyName("model_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string ModelId { get; set; } + + /// + /// Example: huggingface + /// + /// huggingface + [global::System.Text.Json.Serialization.JsonPropertyName("model_source")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string ModelSource { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Example: job-a15dad11-8d8e-4007-97c5-a211304de284 + /// + /// + /// Example: necolinehubner/Qwen2.5-72B-Instruct + /// + /// + /// Example: model-c0e32dfc-637e-47b2-bf4e-e9b2e58c9da7 + /// + /// + /// Example: huggingface + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ModelUploadSuccessResponseData( + string jobId, + string modelName, + string modelId, + string modelSource) + { + this.JobId = jobId ?? throw new global::System.ArgumentNullException(nameof(jobId)); + this.ModelName = modelName ?? throw new global::System.ArgumentNullException(nameof(modelName)); + this.ModelId = modelId ?? throw new global::System.ArgumentNullException(nameof(modelId)); + this.ModelSource = modelSource ?? throw new global::System.ArgumentNullException(nameof(modelSource)); + } + + /// + /// Initializes a new instance of the class. + /// + public ModelUploadSuccessResponseData() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.OutputsItem.Json.g.cs b/src/libs/Together/Generated/Together.Models.OutputsItem.Json.g.cs new file mode 100644 index 00000000..be9c7355 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.OutputsItem.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public readonly partial struct OutputsItem + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + 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); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.OutputsItem? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.OutputsItem), + jsonSerializerContext) as global::Together.OutputsItem?; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.OutputsItem? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.OutputsItem? FromJson( + 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); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.OutputsItem), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.OutputsItem?; + } + + /// + /// 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.Models.OutputsItem.g.cs b/src/libs/Together/Generated/Together.Models.OutputsItem.g.cs new file mode 100644 index 00000000..8fe3b58d --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.OutputsItem.g.cs @@ -0,0 +1,378 @@ +#pragma warning disable CS0618 // Type or member is obsolete + +#nullable enable + +namespace Together +{ + /// + /// + /// + public readonly partial struct OutputsItem : global::System.IEquatable + { + /// + /// Outputs that were printed to stdout or stderr + /// +#if NET6_0_OR_GREATER + public global::Together.ExecuteResponseSuccessfulExecutionDataOutputStreamOutput? StreamOutput { get; init; } +#else + public global::Together.ExecuteResponseSuccessfulExecutionDataOutputStreamOutput? StreamOutput { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(StreamOutput))] +#endif + public bool IsStreamOutput => StreamOutput != null; + + /// + /// + /// + public bool TryPickStreamOutput( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Together.ExecuteResponseSuccessfulExecutionDataOutputStreamOutput? value) + { + value = StreamOutput; + return IsStreamOutput; + } + + /// + /// + /// + public global::Together.ExecuteResponseSuccessfulExecutionDataOutputStreamOutput PickStreamOutput() => StreamOutput is { } value + ? value + : throw new global::System.InvalidOperationException($"Expected union variant 'StreamOutput' but the value was {ToString()}."); + + /// + /// Errors and exceptions that occurred. If this output type is present, your code did not execute successfully. + /// +#if NET6_0_OR_GREATER + public global::Together.ExecuteResponseSuccessfulExecutionDataOutputErrorOutput? Error { get; init; } +#else + public global::Together.ExecuteResponseSuccessfulExecutionDataOutputErrorOutput? Error { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Error))] +#endif + public bool IsError => Error != null; + + /// + /// + /// + public bool TryPickError( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Together.ExecuteResponseSuccessfulExecutionDataOutputErrorOutput? value) + { + value = Error; + return IsError; + } + + /// + /// + /// + public global::Together.ExecuteResponseSuccessfulExecutionDataOutputErrorOutput PickError() => Error is { } value + ? value + : throw new global::System.InvalidOperationException($"Expected union variant 'Error' but the value was {ToString()}."); + + /// + /// + /// +#if NET6_0_OR_GREATER + public global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutput? DisplayorExecuteOutput { get; init; } +#else + public global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutput? DisplayorExecuteOutput { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(DisplayorExecuteOutput))] +#endif + public bool IsDisplayorExecuteOutput => DisplayorExecuteOutput != null; + + /// + /// + /// + public bool TryPickDisplayorExecuteOutput( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutput? value) + { + value = DisplayorExecuteOutput; + return IsDisplayorExecuteOutput; + } + + /// + /// + /// + public global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutput PickDisplayorExecuteOutput() => DisplayorExecuteOutput is { } value + ? value + : throw new global::System.InvalidOperationException($"Expected union variant 'DisplayorExecuteOutput' but the value was {ToString()}."); + /// + /// + /// + public static implicit operator OutputsItem(global::Together.ExecuteResponseSuccessfulExecutionDataOutputStreamOutput value) => new OutputsItem((global::Together.ExecuteResponseSuccessfulExecutionDataOutputStreamOutput?)value); + + /// + /// + /// + public static implicit operator global::Together.ExecuteResponseSuccessfulExecutionDataOutputStreamOutput?(OutputsItem @this) => @this.StreamOutput; + + /// + /// + /// + public OutputsItem(global::Together.ExecuteResponseSuccessfulExecutionDataOutputStreamOutput? value) + { + StreamOutput = value; + } + + /// + /// + /// + public static OutputsItem FromStreamOutput(global::Together.ExecuteResponseSuccessfulExecutionDataOutputStreamOutput? value) => new OutputsItem(value); + + /// + /// + /// + public static implicit operator OutputsItem(global::Together.ExecuteResponseSuccessfulExecutionDataOutputErrorOutput value) => new OutputsItem((global::Together.ExecuteResponseSuccessfulExecutionDataOutputErrorOutput?)value); + + /// + /// + /// + public static implicit operator global::Together.ExecuteResponseSuccessfulExecutionDataOutputErrorOutput?(OutputsItem @this) => @this.Error; + + /// + /// + /// + public OutputsItem(global::Together.ExecuteResponseSuccessfulExecutionDataOutputErrorOutput? value) + { + Error = value; + } + + /// + /// + /// + public static OutputsItem FromError(global::Together.ExecuteResponseSuccessfulExecutionDataOutputErrorOutput? value) => new OutputsItem(value); + + /// + /// + /// + public static implicit operator OutputsItem(global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutput value) => new OutputsItem((global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutput?)value); + + /// + /// + /// + public static implicit operator global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutput?(OutputsItem @this) => @this.DisplayorExecuteOutput; + + /// + /// + /// + public OutputsItem(global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutput? value) + { + DisplayorExecuteOutput = value; + } + + /// + /// + /// + public static OutputsItem FromDisplayorExecuteOutput(global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutput? value) => new OutputsItem(value); + + /// + /// + /// + public OutputsItem( + global::Together.ExecuteResponseSuccessfulExecutionDataOutputStreamOutput? streamOutput, + global::Together.ExecuteResponseSuccessfulExecutionDataOutputErrorOutput? error, + global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutput? displayorExecuteOutput + ) + { + StreamOutput = streamOutput; + Error = error; + DisplayorExecuteOutput = displayorExecuteOutput; + } + + /// + /// + /// + public object? Object => + DisplayorExecuteOutput as object ?? + Error as object ?? + StreamOutput as object + ; + + /// + /// + /// + public override string? ToString() => + StreamOutput?.ToString() ?? + Error?.ToString() ?? + DisplayorExecuteOutput?.ToString() + ; + + /// + /// + /// + public bool Validate() + { + return IsStreamOutput && !IsError && !IsDisplayorExecuteOutput || !IsStreamOutput && IsError && !IsDisplayorExecuteOutput || !IsStreamOutput && !IsError && IsDisplayorExecuteOutput; + } + + /// + /// + /// + public TResult? Match( + global::System.Func? streamOutput = null, + global::System.Func? error = null, + global::System.Func? displayorExecuteOutput = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (StreamOutput is { } __value0 && streamOutput != null) + { + return streamOutput(__value0); + } + else if (Error is { } __value1 && error != null) + { + return error(__value1); + } + else if (DisplayorExecuteOutput is { } __value2 && displayorExecuteOutput != null) + { + return displayorExecuteOutput(__value2); + } + + return default(TResult); + } + + /// + /// + /// + public void Match( + global::System.Action? streamOutput = null, + + global::System.Action? error = null, + + global::System.Action? displayorExecuteOutput = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (StreamOutput is { } __value0) + { + streamOutput?.Invoke(__value0); + } + else if (Error is { } __value1) + { + error?.Invoke(__value1); + } + else if (DisplayorExecuteOutput is { } __value2) + { + displayorExecuteOutput?.Invoke(__value2); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? streamOutput = null, + global::System.Action? error = null, + global::System.Action? displayorExecuteOutput = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (StreamOutput is { } __value0) + { + streamOutput?.Invoke(__value0); + } + else if (Error is { } __value1) + { + error?.Invoke(__value1); + } + else if (DisplayorExecuteOutput is { } __value2) + { + displayorExecuteOutput?.Invoke(__value2); + } + } + + /// + /// + /// + public override int GetHashCode() + { + var fields = new object?[] + { + StreamOutput, + typeof(global::Together.ExecuteResponseSuccessfulExecutionDataOutputStreamOutput), + Error, + typeof(global::Together.ExecuteResponseSuccessfulExecutionDataOutputErrorOutput), + DisplayorExecuteOutput, + typeof(global::Together.ExecuteResponseSuccessfulExecutionDataOutputDisplayorExecuteOutput), + }; + const int offset = unchecked((int)2166136261); + const int prime = 16777619; + static int HashCodeAggregator(int hashCode, object? value) => value == null + ? (hashCode ^ 0) * prime + : (hashCode ^ value.GetHashCode()) * prime; + + return global::System.Linq.Enumerable.Aggregate(fields, offset, HashCodeAggregator); + } + + /// + /// + /// + public bool Equals(OutputsItem other) + { + return + global::System.Collections.Generic.EqualityComparer.Default.Equals(StreamOutput, other.StreamOutput) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Error, other.Error) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(DisplayorExecuteOutput, other.DisplayorExecuteOutput) + ; + } + + /// + /// + /// + public static bool operator ==(OutputsItem obj1, OutputsItem obj2) + { + return global::System.Collections.Generic.EqualityComparer.Default.Equals(obj1, obj2); + } + + /// + /// + /// + public static bool operator !=(OutputsItem obj1, OutputsItem obj2) + { + return !(obj1 == obj2); + } + + /// + /// + /// + public override bool Equals(object? obj) + { + return obj is OutputsItem o && Equals(o); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.Pricing.Json.g.cs b/src/libs/Together/Generated/Together.Models.Pricing.Json.g.cs new file mode 100644 index 00000000..703031d7 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.Pricing.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class Pricing + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + 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); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.Pricing? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.Pricing), + jsonSerializerContext) as global::Together.Pricing; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.Pricing? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.Pricing? FromJson( + 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); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.Pricing), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.Pricing; + } + + /// + /// 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.Models.Pricing.g.cs b/src/libs/Together/Generated/Together.Models.Pricing.g.cs new file mode 100644 index 00000000..dd9fa005 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.Pricing.g.cs @@ -0,0 +1,112 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class Pricing + { + /// + /// Example: 0 + /// + /// 0 + [global::System.Text.Json.Serialization.JsonPropertyName("base")] + [global::System.Text.Json.Serialization.JsonRequired] + public required double Base { get; set; } + + /// + /// Example: 0 + /// + /// 0 + [global::System.Text.Json.Serialization.JsonPropertyName("finetune")] + [global::System.Text.Json.Serialization.JsonRequired] + public required double Finetune { get; set; } + + /// + /// Example: 0 + /// + /// 0 + [global::System.Text.Json.Serialization.JsonPropertyName("hourly")] + [global::System.Text.Json.Serialization.JsonRequired] + public required double Hourly { get; set; } + + /// + /// Example: 0.3 + /// + /// 0.3 + [global::System.Text.Json.Serialization.JsonPropertyName("input")] + [global::System.Text.Json.Serialization.JsonRequired] + public required double Input { get; set; } + + /// + /// Example: 0.3 + /// + /// 0.3 + [global::System.Text.Json.Serialization.JsonPropertyName("output")] + [global::System.Text.Json.Serialization.JsonRequired] + public required double Output { get; set; } + + /// + /// Example: 0.2 + /// + /// 0.2 + [global::System.Text.Json.Serialization.JsonPropertyName("cached_input")] + public double? CachedInput { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Example: 0 + /// + /// + /// Example: 0 + /// + /// + /// Example: 0 + /// + /// + /// Example: 0.3 + /// + /// + /// Example: 0.3 + /// + /// + /// Example: 0.2 + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public Pricing( + double @base, + double finetune, + double hourly, + double input, + double output, + double? cachedInput) + { + this.Base = @base; + this.Finetune = finetune; + this.Hourly = hourly; + this.Input = input; + this.Output = output; + this.CachedInput = cachedInput; + } + + /// + /// Initializes a new instance of the class. + /// + public Pricing() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.QuantizationJob.g.cs b/src/libs/Together/Generated/Together.Models.QuantizationJob.g.cs index f0b0fa9a..1baae984 100644 --- a/src/libs/Together/Generated/Together.Models.QuantizationJob.g.cs +++ b/src/libs/Together/Generated/Together.Models.QuantizationJob.g.cs @@ -5,7 +5,7 @@ namespace Together { /// - /// Quantization job that prepares a fine-tuned model for FP4 inference. + /// Quantization job that prepares an adapter for FP4 inference. /// public readonly partial struct QuantizationJob : global::System.IEquatable { @@ -47,7 +47,7 @@ public bool TryPickBaseShaping( : throw new global::System.InvalidOperationException($"Expected union variant 'BaseShaping' but the value was {ToString()}."); /// - /// Quantization job that prepares a fine-tuned model for FP4 inference. + /// Quantization job that prepares an adapter for FP4 inference. /// #if NET6_0_OR_GREATER public global::Together.QuantizationJobVariant2? QuantizationJobVariant2 { get; init; } diff --git a/src/libs/Together/Generated/Together.Models.QuantizationJobVariant2.g.cs b/src/libs/Together/Generated/Together.Models.QuantizationJobVariant2.g.cs index 1dbc23b0..9789b1f1 100644 --- a/src/libs/Together/Generated/Together.Models.QuantizationJobVariant2.g.cs +++ b/src/libs/Together/Generated/Together.Models.QuantizationJobVariant2.g.cs @@ -4,7 +4,7 @@ namespace Together { /// - /// Quantization job that prepares a fine-tuned model for FP4 inference. + /// Quantization job that prepares an adapter for FP4 inference. /// public sealed partial class QuantizationJobVariant2 { diff --git a/src/libs/Together/Generated/Together.Models.QuantizationPipelineConfiguration.g.cs b/src/libs/Together/Generated/Together.Models.QuantizationPipelineConfiguration.g.cs index 8f454378..96b5c148 100644 --- a/src/libs/Together/Generated/Together.Models.QuantizationPipelineConfiguration.g.cs +++ b/src/libs/Together/Generated/Together.Models.QuantizationPipelineConfiguration.g.cs @@ -4,13 +4,13 @@ namespace Together { /// - /// Server-resolved configuration for a quantization job. The `adapter_*` fields are the deprecated names of the `model_*` ones, with the same values.
+ /// Server-resolved configuration for a quantization job.
/// Included only in responses ///
public sealed partial class QuantizationPipelineConfiguration { /// - /// User whose scope is used to fetch the model weights.
+ /// User whose scope is used to fetch the adapter weights.
/// Example: user_CKfewYkQBpaEmN7wuQS3W ///
/// user_CKfewYkQBpaEmN7wuQS3W @@ -19,34 +19,34 @@ public sealed partial class QuantizationPipelineConfiguration public required string UserId { get; set; } /// - /// Project the model belongs to.
+ /// Project that owns the adapter.
/// Example: proj_CczF9KYFantA84sNYDTJd ///
/// proj_CczF9KYFantA84sNYDTJd - [global::System.Text.Json.Serialization.JsonPropertyName("model_project_id")] + [global::System.Text.Json.Serialization.JsonPropertyName("adapter_project_id")] [global::System.Text.Json.Serialization.JsonRequired] - public required string ModelProjectId { get; set; } + public required string AdapterProjectId { get; set; } /// - /// Revision of the model selected for preparation.
+ /// Adapter revision selected for preparation.
/// Example: rv_CeERyXMBQCJTRC1yqGTpk ///
/// rv_CeERyXMBQCJTRC1yqGTpk - [global::System.Text.Json.Serialization.JsonPropertyName("model_revision_id")] + [global::System.Text.Json.Serialization.JsonPropertyName("adapter_revision_id")] [global::System.Text.Json.Serialization.JsonRequired] - public required string ModelRevisionId { get; set; } + public required string AdapterRevisionId { get; set; } /// - /// Qualified name of the model, which the produced model is named after.
+ /// Qualified adapter model name.
/// Example: ft-qa-artifacts/glm-5.3-e2e-test-adapter ///
/// ft-qa-artifacts/glm-5.3-e2e-test-adapter - [global::System.Text.Json.Serialization.JsonPropertyName("model_name")] + [global::System.Text.Json.Serialization.JsonPropertyName("adapter_model_name")] [global::System.Text.Json.Serialization.JsonRequired] - public required string ModelName { get; set; } + public required string AdapterModelName { get; set; } /// - /// Model object ID of the base model the prepared model was fine-tuned from.
+ /// Model object ID of the adapter's base model.
/// Example: ml_CbJ9yCnij7A47b1xkpioB ///
/// ml_CbJ9yCnij7A47b1xkpioB @@ -55,7 +55,7 @@ public sealed partial class QuantizationPipelineConfiguration public required string BaseObjectId { get; set; } /// - /// Revision ID of that base model.
+ /// Revision ID of the adapter's base model.
/// Example: rv_CbJ9yNrws93VQrZum1fTE ///
/// rv_CbJ9yNrws93VQrZum1fTE @@ -82,27 +82,27 @@ public sealed partial class QuantizationPipelineConfiguration /// Initializes a new instance of the class. ///
/// - /// User whose scope is used to fetch the model weights.
+ /// User whose scope is used to fetch the adapter weights.
/// Example: user_CKfewYkQBpaEmN7wuQS3W /// - /// - /// Project the model belongs to.
+ /// + /// Project that owns the adapter.
/// Example: proj_CczF9KYFantA84sNYDTJd /// - /// - /// Revision of the model selected for preparation.
+ /// + /// Adapter revision selected for preparation.
/// Example: rv_CeERyXMBQCJTRC1yqGTpk /// - /// - /// Qualified name of the model, which the produced model is named after.
+ /// + /// Qualified adapter model name.
/// Example: ft-qa-artifacts/glm-5.3-e2e-test-adapter /// /// - /// Model object ID of the base model the prepared model was fine-tuned from.
+ /// Model object ID of the adapter's base model.
/// Example: ml_CbJ9yCnij7A47b1xkpioB /// /// - /// Revision ID of that base model.
+ /// Revision ID of the adapter's base model.
/// Example: rv_CbJ9yNrws93VQrZum1fTE /// /// @@ -114,17 +114,17 @@ public sealed partial class QuantizationPipelineConfiguration #endif public QuantizationPipelineConfiguration( string userId, - string modelProjectId, - string modelRevisionId, - string modelName, + string adapterProjectId, + string adapterRevisionId, + string adapterModelName, string baseObjectId, string baseRevisionId, string baseModelName) { this.UserId = userId ?? throw new global::System.ArgumentNullException(nameof(userId)); - this.ModelProjectId = modelProjectId ?? throw new global::System.ArgumentNullException(nameof(modelProjectId)); - this.ModelRevisionId = modelRevisionId ?? throw new global::System.ArgumentNullException(nameof(modelRevisionId)); - this.ModelName = modelName ?? throw new global::System.ArgumentNullException(nameof(modelName)); + this.AdapterProjectId = adapterProjectId ?? throw new global::System.ArgumentNullException(nameof(adapterProjectId)); + this.AdapterRevisionId = adapterRevisionId ?? throw new global::System.ArgumentNullException(nameof(adapterRevisionId)); + this.AdapterModelName = adapterModelName ?? throw new global::System.ArgumentNullException(nameof(adapterModelName)); this.BaseObjectId = baseObjectId ?? throw new global::System.ArgumentNullException(nameof(baseObjectId)); this.BaseRevisionId = baseRevisionId ?? throw new global::System.ArgumentNullException(nameof(baseRevisionId)); this.BaseModelName = baseModelName ?? throw new global::System.ArgumentNullException(nameof(baseModelName)); diff --git a/src/libs/Together/Generated/Together.Models.QuantizationPipelineInputs.g.cs b/src/libs/Together/Generated/Together.Models.QuantizationPipelineInputs.g.cs index c5d978b5..8e14a528 100644 --- a/src/libs/Together/Generated/Together.Models.QuantizationPipelineInputs.g.cs +++ b/src/libs/Together/Generated/Together.Models.QuantizationPipelineInputs.g.cs @@ -4,22 +4,23 @@ namespace Together { /// - /// The model to prepare: an adapter or a full model. A request names it by the `model_*` fields or the deprecated `adapter_*` fields, never a mix of the two, and gives a revision only beside the ID it belongs to. A job returns both names, with the same values.
- /// Example: {"model_object_id":"ml_CeG3fF6pyEViU8dE8pk7R","model_revision_id":"rv_CeG3faPBj2ABwbAaHPTmx","calibration_file_id":"file-5f1b0c7a-2d19-4a3e-9c60-8ab41c2f7d35"} + /// Adapter identifiers to prepare.
+ /// Example: {"adapter_object_id":"ml_CeG3fF6pyEViU8dE8pk7R","adapter_revision_id":"rv_CeG3faPBj2ABwbAaHPTmx","calibration_file_id":"file-5f1b0c7a-2d19-4a3e-9c60-8ab41c2f7d35"} ///
public sealed partial class QuantizationPipelineInputs { /// - /// Model object ID of the model to prepare. It names the input model; it is not the `results.model_object_id` of a job, which names the model the job produced. + /// Model object ID of the adapter to prepare. /// - [global::System.Text.Json.Serialization.JsonPropertyName("model_object_id")] - public string? ModelObjectId { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("adapter_object_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string AdapterObjectId { get; set; } /// - /// Revision ID of the model to prepare. Omit to use the model's current revision. Only valid with `model_object_id`. + /// Adapter revision ID to prepare. Omit to use the adapter's current revision. /// - [global::System.Text.Json.Serialization.JsonPropertyName("model_revision_id")] - public string? ModelRevisionId { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("adapter_revision_id")] + public string? AdapterRevisionId { get; set; } /// /// Conversation dataset file ID to use for calibration. Upload it first with `POST /v1/files` using purpose `calibration` and file type `jsonl`. Each JSONL row must contain a `messages` array and may contain a `tools` array.
@@ -40,11 +41,11 @@ public sealed partial class QuantizationPipelineInputs /// /// Initializes a new instance of the class. /// - /// - /// Model object ID of the model to prepare. It names the input model; it is not the `results.model_object_id` of a job, which names the model the job produced. + /// + /// Model object ID of the adapter to prepare. /// - /// - /// Revision ID of the model to prepare. Omit to use the model's current revision. Only valid with `model_object_id`. + /// + /// Adapter revision ID to prepare. Omit to use the adapter's current revision. /// /// /// Conversation dataset file ID to use for calibration. Upload it first with `POST /v1/files` using purpose `calibration` and file type `jsonl`. Each JSONL row must contain a `messages` array and may contain a `tools` array.
@@ -56,12 +57,12 @@ public sealed partial class QuantizationPipelineInputs [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public QuantizationPipelineInputs( - string? modelObjectId, - string? modelRevisionId, + string adapterObjectId, + string? adapterRevisionId, string? calibrationFileId) { - this.ModelObjectId = modelObjectId; - this.ModelRevisionId = modelRevisionId; + this.AdapterObjectId = adapterObjectId ?? throw new global::System.ArgumentNullException(nameof(adapterObjectId)); + this.AdapterRevisionId = adapterRevisionId; this.CalibrationFileId = calibrationFileId; } diff --git a/src/libs/Together/Generated/Together.Models.QuantizationPipelineSpec.g.cs b/src/libs/Together/Generated/Together.Models.QuantizationPipelineSpec.g.cs index 5450a8fe..a27cad27 100644 --- a/src/libs/Together/Generated/Together.Models.QuantizationPipelineSpec.g.cs +++ b/src/libs/Together/Generated/Together.Models.QuantizationPipelineSpec.g.cs @@ -9,10 +9,10 @@ namespace Together public sealed partial class QuantizationPipelineSpec { /// - /// Inputs requested by the caller.
- /// Example: {"model_object_id":"ml_CeG3fF6pyEViU8dE8pk7R","model_revision_id":"rv_CeG3faPBj2ABwbAaHPTmx","calibration_file_id":"file-5f1b0c7a-2d19-4a3e-9c60-8ab41c2f7d35"} + /// Adapter inputs requested by the caller.
+ /// Example: {"adapter_object_id":"ml_CeG3fF6pyEViU8dE8pk7R","adapter_revision_id":"rv_CeG3faPBj2ABwbAaHPTmx","calibration_file_id":"file-5f1b0c7a-2d19-4a3e-9c60-8ab41c2f7d35"} ///
- /// {"model_object_id":"ml_CeG3fF6pyEViU8dE8pk7R","model_revision_id":"rv_CeG3faPBj2ABwbAaHPTmx","calibration_file_id":"file-5f1b0c7a-2d19-4a3e-9c60-8ab41c2f7d35"} + /// {"adapter_object_id":"ml_CeG3fF6pyEViU8dE8pk7R","adapter_revision_id":"rv_CeG3faPBj2ABwbAaHPTmx","calibration_file_id":"file-5f1b0c7a-2d19-4a3e-9c60-8ab41c2f7d35"} [global::System.Text.Json.Serialization.JsonPropertyName("inputs")] [global::System.Text.Json.Serialization.JsonRequired] public required global::Together.QuantizationPipelineInputs Inputs { get; set; } @@ -35,8 +35,8 @@ public sealed partial class QuantizationPipelineSpec /// Initializes a new instance of the class. ///
/// - /// Inputs requested by the caller.
- /// Example: {"model_object_id":"ml_CeG3fF6pyEViU8dE8pk7R","model_revision_id":"rv_CeG3faPBj2ABwbAaHPTmx","calibration_file_id":"file-5f1b0c7a-2d19-4a3e-9c60-8ab41c2f7d35"} + /// Adapter inputs requested by the caller.
+ /// Example: {"adapter_object_id":"ml_CeG3fF6pyEViU8dE8pk7R","adapter_revision_id":"rv_CeG3faPBj2ABwbAaHPTmx","calibration_file_id":"file-5f1b0c7a-2d19-4a3e-9c60-8ab41c2f7d35"} /// /// /// Server-resolved configuration for the run.
diff --git a/src/libs/Together/Generated/Together.Models.QuantizationRequest.g.cs b/src/libs/Together/Generated/Together.Models.QuantizationRequest.g.cs index 07a11945..2d2cedf4 100644 --- a/src/libs/Together/Generated/Together.Models.QuantizationRequest.g.cs +++ b/src/libs/Together/Generated/Together.Models.QuantizationRequest.g.cs @@ -4,15 +4,15 @@ namespace Together { /// - /// Request body for preparing a fine-tuned model for FP4 inference. + /// Request body for preparing an adapter for FP4 inference. /// public sealed partial class QuantizationRequest { /// - /// Inputs naming the fine-tuned model to prepare.
- /// Example: {"model_object_id":"ml_CeG3fF6pyEViU8dE8pk7R","model_revision_id":"rv_CeG3faPBj2ABwbAaHPTmx","calibration_file_id":"file-5f1b0c7a-2d19-4a3e-9c60-8ab41c2f7d35"} + /// Adapter inputs to prepare.
+ /// Example: {"adapter_object_id":"ml_CeG3fF6pyEViU8dE8pk7R","adapter_revision_id":"rv_CeG3faPBj2ABwbAaHPTmx","calibration_file_id":"file-5f1b0c7a-2d19-4a3e-9c60-8ab41c2f7d35"} ///
- /// {"model_object_id":"ml_CeG3fF6pyEViU8dE8pk7R","model_revision_id":"rv_CeG3faPBj2ABwbAaHPTmx","calibration_file_id":"file-5f1b0c7a-2d19-4a3e-9c60-8ab41c2f7d35"} + /// {"adapter_object_id":"ml_CeG3fF6pyEViU8dE8pk7R","adapter_revision_id":"rv_CeG3faPBj2ABwbAaHPTmx","calibration_file_id":"file-5f1b0c7a-2d19-4a3e-9c60-8ab41c2f7d35"} [global::System.Text.Json.Serialization.JsonPropertyName("inputs")] [global::System.Text.Json.Serialization.JsonRequired] public required global::Together.QuantizationPipelineInputs Inputs { get; set; } @@ -27,8 +27,8 @@ public sealed partial class QuantizationRequest /// Initializes a new instance of the class. ///
/// - /// Inputs naming the fine-tuned model to prepare.
- /// Example: {"model_object_id":"ml_CeG3fF6pyEViU8dE8pk7R","model_revision_id":"rv_CeG3faPBj2ABwbAaHPTmx","calibration_file_id":"file-5f1b0c7a-2d19-4a3e-9c60-8ab41c2f7d35"} + /// Adapter inputs to prepare.
+ /// Example: {"adapter_object_id":"ml_CeG3fF6pyEViU8dE8pk7R","adapter_revision_id":"rv_CeG3faPBj2ABwbAaHPTmx","calibration_file_id":"file-5f1b0c7a-2d19-4a3e-9c60-8ab41c2f7d35"} /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/libs/Together/Generated/Together.Models.RemoveAdapterRequest.Json.g.cs b/src/libs/Together/Generated/Together.Models.RemoveAdapterRequest.Json.g.cs new file mode 100644 index 00000000..76a6a62d --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RemoveAdapterRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class RemoveAdapterRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + 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); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.RemoveAdapterRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.RemoveAdapterRequest), + jsonSerializerContext) as global::Together.RemoveAdapterRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RemoveAdapterRequest? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.RemoveAdapterRequest? FromJson( + 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); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.RemoveAdapterRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.RemoveAdapterRequest; + } + + /// + /// 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.Models.WhoamiApiKey.g.cs b/src/libs/Together/Generated/Together.Models.RemoveAdapterRequest.g.cs similarity index 56% rename from src/libs/Together/Generated/Together.Models.WhoamiApiKey.g.cs rename to src/libs/Together/Generated/Together.Models.RemoveAdapterRequest.g.cs index ad221a6d..706ee15b 100644 --- a/src/libs/Together/Generated/Together.Models.WhoamiApiKey.g.cs +++ b/src/libs/Together/Generated/Together.Models.RemoveAdapterRequest.g.cs @@ -6,14 +6,14 @@ namespace Together /// /// /// - public sealed partial class WhoamiApiKey + public sealed partial class RemoveAdapterRequest { /// - /// The authenticated API key identifier. + /// Combined identifier in format "endpoint_name:adapter_model_name". /// - [global::System.Text.Json.Serialization.JsonPropertyName("id")] + [global::System.Text.Json.Serialization.JsonPropertyName("model_id")] [global::System.Text.Json.Serialization.JsonRequired] - public required string Id { get; set; } + public required string ModelId { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -22,24 +22,24 @@ public sealed partial class WhoamiApiKey public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - /// - /// The authenticated API key identifier. + /// + /// Combined identifier in format "endpoint_name:adapter_model_name". /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif - public WhoamiApiKey( - string id) + public RemoveAdapterRequest( + string modelId) { - this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); + this.ModelId = modelId ?? throw new global::System.ArgumentNullException(nameof(modelId)); } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public WhoamiApiKey() + public RemoveAdapterRequest() { } diff --git a/src/libs/Together/Generated/Together.Models.RemoveAdapterResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.RemoveAdapterResponse.Json.g.cs new file mode 100644 index 00000000..daa27903 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RemoveAdapterResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class RemoveAdapterResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + 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); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.RemoveAdapterResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.RemoveAdapterResponse), + jsonSerializerContext) as global::Together.RemoveAdapterResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.RemoveAdapterResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.RemoveAdapterResponse? FromJson( + 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); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.RemoveAdapterResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.RemoveAdapterResponse; + } + + /// + /// 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.Models.RemoveAdapterResponse.g.cs b/src/libs/Together/Generated/Together.Models.RemoveAdapterResponse.g.cs new file mode 100644 index 00000000..40c5ec06 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.RemoveAdapterResponse.g.cs @@ -0,0 +1,53 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class RemoveAdapterResponse + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("model_id")] + public string? ModelId { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("deleted")] + public bool? Deleted { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public RemoveAdapterResponse( + string? modelId, + bool? deleted) + { + this.ModelId = modelId; + this.Deleted = deleted; + } + + /// + /// Initializes a new instance of the class. + /// + public RemoveAdapterResponse() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.Response.Json.g.cs b/src/libs/Together/Generated/Together.Models.Response.Json.g.cs new file mode 100644 index 00000000..5021f9a7 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.Response.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class Response + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + 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); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.Response? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.Response), + jsonSerializerContext) as global::Together.Response; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.Response? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.Response? FromJson( + 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); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.Response), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.Response; + } + + /// + /// 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.Models.Response.g.cs b/src/libs/Together/Generated/Together.Models.Response.g.cs new file mode 100644 index 00000000..983b4bb6 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.Response.g.cs @@ -0,0 +1,44 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class Response + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("errors")] + public global::System.Collections.Generic.IList>? Errors { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public Response( + global::System.Collections.Generic.IList>? errors) + { + this.Errors = errors; + } + + /// + /// Initializes a new instance of the class. + /// + public Response() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.ResponseError.Json.g.cs b/src/libs/Together/Generated/Together.Models.ResponseError.Json.g.cs new file mode 100644 index 00000000..a2f0bddf --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ResponseError.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class ResponseError + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + 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); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.ResponseError? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.ResponseError), + jsonSerializerContext) as global::Together.ResponseError; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.ResponseError? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.ResponseError? FromJson( + 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); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.ResponseError), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.ResponseError; + } + + /// + /// 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.Models.ResponseError.g.cs b/src/libs/Together/Generated/Together.Models.ResponseError.g.cs new file mode 100644 index 00000000..9f114191 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.ResponseError.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class ResponseError + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.RlComputeConfig.g.cs b/src/libs/Together/Generated/Together.Models.RlComputeConfig.g.cs index 1ca6cc9b..a32a3200 100644 --- a/src/libs/Together/Generated/Together.Models.RlComputeConfig.g.cs +++ b/src/libs/Together/Generated/Together.Models.RlComputeConfig.g.cs @@ -19,9 +19,9 @@ public sealed partial class RlComputeConfig /// /// GPU type selected for this resource.
- /// Example: B200-SXM + /// Example: H100-80GB ///
- /// B200-SXM + /// H100-80GB [global::System.Text.Json.Serialization.JsonPropertyName("gpu_type")] [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.RlComputeConfigGpuTypeJsonConverter))] public global::Together.RlComputeConfigGpuType? GpuType { get; set; } @@ -41,7 +41,7 @@ public sealed partial class RlComputeConfig /// /// /// GPU type selected for this resource.
- /// Example: B200-SXM + /// Example: H100-80GB /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/libs/Together/Generated/Together.Models.RlComputeConfigCreateRequestGpuType.g.cs b/src/libs/Together/Generated/Together.Models.RlComputeConfigCreateRequestGpuType.g.cs index 74f6f87c..79319e63 100644 --- a/src/libs/Together/Generated/Together.Models.RlComputeConfigCreateRequestGpuType.g.cs +++ b/src/libs/Together/Generated/Together.Models.RlComputeConfigCreateRequestGpuType.g.cs @@ -13,6 +13,10 @@ public enum RlComputeConfigCreateRequestGpuType /// ///
B200Sxm, + /// + /// + /// + H10080gb, } /// @@ -28,6 +32,7 @@ public static string ToValueString(this RlComputeConfigCreateRequestGpuType valu return value switch { RlComputeConfigCreateRequestGpuType.B200Sxm => "B200-SXM", + RlComputeConfigCreateRequestGpuType.H10080gb => "H100-80GB", _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), }; } @@ -39,6 +44,7 @@ public static string ToValueString(this RlComputeConfigCreateRequestGpuType valu return value switch { "B200-SXM" => RlComputeConfigCreateRequestGpuType.B200Sxm, + "H100-80GB" => RlComputeConfigCreateRequestGpuType.H10080gb, _ => null, }; } diff --git a/src/libs/Together/Generated/Together.Models.RlComputeConfigGpuType.g.cs b/src/libs/Together/Generated/Together.Models.RlComputeConfigGpuType.g.cs index d0d87954..c7034708 100644 --- a/src/libs/Together/Generated/Together.Models.RlComputeConfigGpuType.g.cs +++ b/src/libs/Together/Generated/Together.Models.RlComputeConfigGpuType.g.cs @@ -5,7 +5,7 @@ namespace Together { /// /// GPU type selected for this resource.
- /// Example: B200-SXM + /// Example: H100-80GB ///
public enum RlComputeConfigGpuType { diff --git a/src/libs/Together/Generated/Together.Models.RlModelResources.g.cs b/src/libs/Together/Generated/Together.Models.RlModelResources.g.cs index dfc90b93..c7e980aa 100644 --- a/src/libs/Together/Generated/Together.Models.RlModelResources.g.cs +++ b/src/libs/Together/Generated/Together.Models.RlModelResources.g.cs @@ -31,13 +31,6 @@ public sealed partial class RlModelResources [global::System.Text.Json.Serialization.JsonPropertyName("error")] public global::Together.RlModelResourcesError? Error { get; set; } - /// - /// Details of the resource's current status, such as its place in the queue. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("status_details")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Together.RlModelResourcesStatusDetails StatusDetails { get; set; } - /// /// Base model the resource is provisioned for
/// Example: Qwen/Qwen3.5-4B @@ -121,9 +114,6 @@ public sealed partial class RlModelResources /// /// Lifecycle status of the model resource /// - /// - /// Details of the resource's current status, such as its place in the queue. - /// /// /// Base model the resource is provisioned for
/// Example: Qwen/Qwen3.5-4B @@ -163,7 +153,6 @@ public sealed partial class RlModelResources public RlModelResources( string id, global::Together.RlModelResourcesStatus status, - global::Together.RlModelResourcesStatusDetails statusDetails, string baseModel, global::Together.RlComputeConfig computeConfig, bool loraEnabled, @@ -177,7 +166,6 @@ public RlModelResources( this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); this.Status = status; this.Error = error; - this.StatusDetails = statusDetails ?? throw new global::System.ArgumentNullException(nameof(statusDetails)); this.BaseModel = baseModel ?? throw new global::System.ArgumentNullException(nameof(baseModel)); this.BaseWeightsRef = baseWeightsRef; this.ComputeConfig = computeConfig ?? throw new global::System.ArgumentNullException(nameof(computeConfig)); diff --git a/src/libs/Together/Generated/Together.Models.RlModelResourcesStatusDetails.g.cs b/src/libs/Together/Generated/Together.Models.RlModelResourcesStatusDetails.g.cs deleted file mode 100644 index 7abf6333..00000000 --- a/src/libs/Together/Generated/Together.Models.RlModelResourcesStatusDetails.g.cs +++ /dev/null @@ -1,49 +0,0 @@ - -#nullable enable - -namespace Together -{ - /// - /// Details of a model resource's current status - /// - public sealed partial class RlModelResourcesStatusDetails - { - /// - /// Estimated place of the resource in the queue: the number of older resources of the same GPU type still waiting for GPUs, plus one. Set only while the resource waits for GPUs.
- /// Example: 3 - ///
- /// 3 - [global::System.Text.Json.Serialization.JsonPropertyName("queue_position")] - public long? QueuePosition { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// Estimated place of the resource in the queue: the number of older resources of the same GPU type still waiting for GPUs, plus one. Set only while the resource waits for GPUs.
- /// Example: 3 - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public RlModelResourcesStatusDetails( - long? queuePosition) - { - this.QueuePosition = queuePosition; - } - - /// - /// Initializes a new instance of the class. - /// - public RlModelResourcesStatusDetails() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.RlSupportedModel.g.cs b/src/libs/Together/Generated/Together.Models.RlSupportedModel.g.cs index fe4377a3..b923531e 100644 --- a/src/libs/Together/Generated/Together.Models.RlSupportedModel.g.cs +++ b/src/libs/Together/Generated/Together.Models.RlSupportedModel.g.cs @@ -19,12 +19,13 @@ public sealed partial class RlSupportedModel /// /// GPU type used when model-resource creation omits gpu_type.
- /// Example: B200-SXM + /// Example: H100-80GB ///
- /// B200-SXM + /// H100-80GB [global::System.Text.Json.Serialization.JsonPropertyName("default_gpu_type")] [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.RlSupportedModelDefaultGpuTypeJsonConverter))] - public global::Together.RlSupportedModelDefaultGpuType DefaultGpuType { get; set; } + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.RlSupportedModelDefaultGpuType DefaultGpuType { get; set; } /// /// Validated GPU configurations available for this base model. @@ -47,7 +48,7 @@ public sealed partial class RlSupportedModel /// /// /// GPU type used when model-resource creation omits gpu_type.
- /// Example: B200-SXM + /// Example: H100-80GB /// /// /// Validated GPU configurations available for this base model. diff --git a/src/libs/Together/Generated/Together.Models.RlSupportedModelComputeConfig.g.cs b/src/libs/Together/Generated/Together.Models.RlSupportedModelComputeConfig.g.cs index edacda14..2fc01867 100644 --- a/src/libs/Together/Generated/Together.Models.RlSupportedModelComputeConfig.g.cs +++ b/src/libs/Together/Generated/Together.Models.RlSupportedModelComputeConfig.g.cs @@ -10,12 +10,13 @@ public sealed partial class RlSupportedModelComputeConfig { /// /// GPU type this configuration provisions.
- /// Example: B200-SXM + /// Example: H100-80GB ///
- /// B200-SXM + /// H100-80GB [global::System.Text.Json.Serialization.JsonPropertyName("gpu_type")] [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.RlSupportedModelComputeConfigGpuTypeJsonConverter))] - public global::Together.RlSupportedModelComputeConfigGpuType GpuType { get; set; } + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.RlSupportedModelComputeConfigGpuType GpuType { get; set; } /// /// Training config for this GPU type. Set when the model supports at least one training mode on this GPU type. @@ -40,7 +41,7 @@ public sealed partial class RlSupportedModelComputeConfig /// /// /// GPU type this configuration provisions.
- /// Example: B200-SXM + /// Example: H100-80GB /// /// /// Training config for this GPU type. Set when the model supports at least one training mode on this GPU type. diff --git a/src/libs/Together/Generated/Together.Models.RlSupportedModelComputeConfigGpuType.g.cs b/src/libs/Together/Generated/Together.Models.RlSupportedModelComputeConfigGpuType.g.cs index 5804da02..5e305aef 100644 --- a/src/libs/Together/Generated/Together.Models.RlSupportedModelComputeConfigGpuType.g.cs +++ b/src/libs/Together/Generated/Together.Models.RlSupportedModelComputeConfigGpuType.g.cs @@ -5,7 +5,7 @@ namespace Together { /// /// GPU type this configuration provisions.
- /// Example: B200-SXM + /// Example: H100-80GB ///
public enum RlSupportedModelComputeConfigGpuType { @@ -13,6 +13,10 @@ public enum RlSupportedModelComputeConfigGpuType /// ///
B200Sxm, + /// + /// + /// + H10080gb, } /// @@ -28,6 +32,7 @@ public static string ToValueString(this RlSupportedModelComputeConfigGpuType val return value switch { RlSupportedModelComputeConfigGpuType.B200Sxm => "B200-SXM", + RlSupportedModelComputeConfigGpuType.H10080gb => "H100-80GB", _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), }; } @@ -39,6 +44,7 @@ public static string ToValueString(this RlSupportedModelComputeConfigGpuType val return value switch { "B200-SXM" => RlSupportedModelComputeConfigGpuType.B200Sxm, + "H100-80GB" => RlSupportedModelComputeConfigGpuType.H10080gb, _ => null, }; } diff --git a/src/libs/Together/Generated/Together.Models.RlSupportedModelDefaultGpuType.g.cs b/src/libs/Together/Generated/Together.Models.RlSupportedModelDefaultGpuType.g.cs index 8964d960..18a9b029 100644 --- a/src/libs/Together/Generated/Together.Models.RlSupportedModelDefaultGpuType.g.cs +++ b/src/libs/Together/Generated/Together.Models.RlSupportedModelDefaultGpuType.g.cs @@ -5,7 +5,7 @@ namespace Together { /// /// GPU type used when model-resource creation omits gpu_type.
- /// Example: B200-SXM + /// Example: H100-80GB ///
public enum RlSupportedModelDefaultGpuType { @@ -13,6 +13,10 @@ public enum RlSupportedModelDefaultGpuType /// ///
B200Sxm, + /// + /// + /// + H10080gb, } /// @@ -28,6 +32,7 @@ public static string ToValueString(this RlSupportedModelDefaultGpuType value) return value switch { RlSupportedModelDefaultGpuType.B200Sxm => "B200-SXM", + RlSupportedModelDefaultGpuType.H10080gb => "H100-80GB", _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), }; } @@ -39,6 +44,7 @@ public static string ToValueString(this RlSupportedModelDefaultGpuType value) return value switch { "B200-SXM" => RlSupportedModelDefaultGpuType.B200Sxm, + "H100-80GB" => RlSupportedModelDefaultGpuType.H10080gb, _ => null, }; } diff --git a/src/libs/Together/Generated/Together.Models.WhoamiProjectApiKey.Json.g.cs b/src/libs/Together/Generated/Together.Models.SessionListResponse.Json.g.cs similarity index 88% rename from src/libs/Together/Generated/Together.Models.WhoamiProjectApiKey.Json.g.cs rename to src/libs/Together/Generated/Together.Models.SessionListResponse.Json.g.cs index 55f02c11..347dbd55 100644 --- a/src/libs/Together/Generated/Together.Models.WhoamiProjectApiKey.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.SessionListResponse.Json.g.cs @@ -2,7 +2,7 @@ namespace Together { - public sealed partial class WhoamiProjectApiKey + public readonly partial struct SessionListResponse { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -47,20 +47,20 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::Together.WhoamiProjectApiKey? FromJson( + public static global::Together.SessionListResponse? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::Together.WhoamiProjectApiKey), - jsonSerializerContext) as global::Together.WhoamiProjectApiKey; + typeof(global::Together.SessionListResponse), + jsonSerializerContext) as global::Together.SessionListResponse?; } /// /// Deserializes a JSON string using the generated default JsonSerializerContext. /// - public static global::Together.WhoamiProjectApiKey? FromJson( + public static global::Together.SessionListResponse? FromJson( string json) { return FromJson( @@ -75,7 +75,7 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::Together.WhoamiProjectApiKey? FromJson( + public static global::Together.SessionListResponse? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -86,7 +86,7 @@ public string ToJson( global::Together.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -94,20 +94,20 @@ public string ToJson( /// /// Deserializes a JSON stream using the provided JsonSerializerContext. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, - typeof(global::Together.WhoamiProjectApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::Together.WhoamiProjectApiKey; + typeof(global::Together.SessionListResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.SessionListResponse?; } /// /// Deserializes a JSON stream using the generated default JsonSerializerContext. /// - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream) { return FromJsonStreamAsync( @@ -122,7 +122,7 @@ public string ToJson( [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] #endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { @@ -133,7 +133,7 @@ public string ToJson( global::Together.SourceGenerationContext.Default); } - return global::System.Text.Json.JsonSerializer.DeserializeAsync( + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); } diff --git a/src/libs/Together/Generated/Together.Models.SessionListResponse.g.cs b/src/libs/Together/Generated/Together.Models.SessionListResponse.g.cs new file mode 100644 index 00000000..f93157e8 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.SessionListResponse.g.cs @@ -0,0 +1,295 @@ +#pragma warning disable CS0618 // Type or member is obsolete + +#nullable enable + +namespace Together +{ + /// + /// + /// + public readonly partial struct SessionListResponse : global::System.IEquatable + { + /// + /// + /// +#if NET6_0_OR_GREATER + public global::Together.SessionListResponseResponse? Response { get; init; } +#else + public global::Together.SessionListResponseResponse? Response { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Response))] +#endif + public bool IsResponse => Response != null; + + /// + /// + /// + public bool TryPickResponse( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Together.SessionListResponseResponse? value) + { + value = Response; + return IsResponse; + } + + /// + /// + /// + public global::Together.SessionListResponseResponse PickResponse() => Response is { } value + ? value + : throw new global::System.InvalidOperationException($"Expected union variant 'Response' but the value was {ToString()}."); + + /// + /// + /// +#if NET6_0_OR_GREATER + public global::Together.SessionListResponseVariant2? SessionListResponseVariant2 { get; init; } +#else + public global::Together.SessionListResponseVariant2? SessionListResponseVariant2 { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(SessionListResponseVariant2))] +#endif + public bool IsSessionListResponseVariant2 => SessionListResponseVariant2 != null; + + /// + /// + /// + public bool TryPickSessionListResponseVariant2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::Together.SessionListResponseVariant2? value) + { + value = SessionListResponseVariant2; + return IsSessionListResponseVariant2; + } + + /// + /// + /// + public global::Together.SessionListResponseVariant2 PickSessionListResponseVariant2() => SessionListResponseVariant2 is { } value + ? value + : throw new global::System.InvalidOperationException($"Expected union variant 'SessionListResponseVariant2' but the value was {ToString()}."); + /// + /// + /// + public static implicit operator SessionListResponse(global::Together.SessionListResponseResponse value) => new SessionListResponse((global::Together.SessionListResponseResponse?)value); + + /// + /// + /// + public static implicit operator global::Together.SessionListResponseResponse?(SessionListResponse @this) => @this.Response; + + /// + /// + /// + public SessionListResponse(global::Together.SessionListResponseResponse? value) + { + Response = value; + } + + /// + /// + /// + public static SessionListResponse FromResponse(global::Together.SessionListResponseResponse? value) => new SessionListResponse(value); + + /// + /// + /// + public static implicit operator SessionListResponse(global::Together.SessionListResponseVariant2 value) => new SessionListResponse((global::Together.SessionListResponseVariant2?)value); + + /// + /// + /// + public static implicit operator global::Together.SessionListResponseVariant2?(SessionListResponse @this) => @this.SessionListResponseVariant2; + + /// + /// + /// + public SessionListResponse(global::Together.SessionListResponseVariant2? value) + { + SessionListResponseVariant2 = value; + } + + /// + /// + /// + public static SessionListResponse FromSessionListResponseVariant2(global::Together.SessionListResponseVariant2? value) => new SessionListResponse(value); + + /// + /// + /// + public SessionListResponse( + global::Together.SessionListResponseResponse? response, + global::Together.SessionListResponseVariant2? sessionListResponseVariant2 + ) + { + Response = response; + SessionListResponseVariant2 = sessionListResponseVariant2; + } + + /// + /// + /// + public object? Object => + SessionListResponseVariant2 as object ?? + Response as object + ; + + /// + /// + /// + public override string? ToString() => + Response?.ToString() ?? + SessionListResponseVariant2?.ToString() + ; + + /// + /// + /// + public bool Validate() + { + return IsResponse && IsSessionListResponseVariant2; + } + + /// + /// + /// + public TResult? Match( + global::System.Func? response = null, + global::System.Func? sessionListResponseVariant2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (Response is { } __value0 && response != null) + { + return response(__value0); + } + else if (SessionListResponseVariant2 is { } __value1 && sessionListResponseVariant2 != null) + { + return sessionListResponseVariant2(__value1); + } + + return default(TResult); + } + + /// + /// + /// + public void Match( + global::System.Action? response = null, + + global::System.Action? sessionListResponseVariant2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (Response is { } __value0) + { + response?.Invoke(__value0); + } + else if (SessionListResponseVariant2 is { } __value1) + { + sessionListResponseVariant2?.Invoke(__value1); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? response = null, + global::System.Action? sessionListResponseVariant2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (Response is { } __value0) + { + response?.Invoke(__value0); + } + else if (SessionListResponseVariant2 is { } __value1) + { + sessionListResponseVariant2?.Invoke(__value1); + } + } + + /// + /// + /// + public override int GetHashCode() + { + var fields = new object?[] + { + Response, + typeof(global::Together.SessionListResponseResponse), + SessionListResponseVariant2, + typeof(global::Together.SessionListResponseVariant2), + }; + const int offset = unchecked((int)2166136261); + const int prime = 16777619; + static int HashCodeAggregator(int hashCode, object? value) => value == null + ? (hashCode ^ 0) * prime + : (hashCode ^ value.GetHashCode()) * prime; + + return global::System.Linq.Enumerable.Aggregate(fields, offset, HashCodeAggregator); + } + + /// + /// + /// + public bool Equals(SessionListResponse other) + { + return + global::System.Collections.Generic.EqualityComparer.Default.Equals(Response, other.Response) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(SessionListResponseVariant2, other.SessionListResponseVariant2) + ; + } + + /// + /// + /// + public static bool operator ==(SessionListResponse obj1, SessionListResponse obj2) + { + return global::System.Collections.Generic.EqualityComparer.Default.Equals(obj1, obj2); + } + + /// + /// + /// + public static bool operator !=(SessionListResponse obj1, SessionListResponse obj2) + { + return !(obj1 == obj2); + } + + /// + /// + /// + public override bool Equals(object? obj) + { + return obj is SessionListResponse o && Equals(o); + } + } +} diff --git a/src/libs/Together/Generated/Together.Models.SessionListResponseResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.SessionListResponseResponse.Json.g.cs new file mode 100644 index 00000000..f2ad73b0 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.SessionListResponseResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class SessionListResponseResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + 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); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.SessionListResponseResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.SessionListResponseResponse), + jsonSerializerContext) as global::Together.SessionListResponseResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.SessionListResponseResponse? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.SessionListResponseResponse? FromJson( + 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); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.SessionListResponseResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.SessionListResponseResponse; + } + + /// + /// 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.Models.SessionListResponseResponse.g.cs b/src/libs/Together/Generated/Together.Models.SessionListResponseResponse.g.cs new file mode 100644 index 00000000..4e00b9df --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.SessionListResponseResponse.g.cs @@ -0,0 +1,44 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class SessionListResponseResponse + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("errors")] + public global::System.Collections.Generic.IList>? Errors { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public SessionListResponseResponse( + global::System.Collections.Generic.IList>? errors) + { + this.Errors = errors; + } + + /// + /// Initializes a new instance of the class. + /// + public SessionListResponseResponse() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.SessionListResponseResponseError.Json.g.cs b/src/libs/Together/Generated/Together.Models.SessionListResponseResponseError.Json.g.cs new file mode 100644 index 00000000..abc8d918 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.SessionListResponseResponseError.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class SessionListResponseResponseError + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + 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); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.SessionListResponseResponseError? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.SessionListResponseResponseError), + jsonSerializerContext) as global::Together.SessionListResponseResponseError; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.SessionListResponseResponseError? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.SessionListResponseResponseError? FromJson( + 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); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.SessionListResponseResponseError), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.SessionListResponseResponseError; + } + + /// + /// 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.Models.SessionListResponseResponseError.g.cs b/src/libs/Together/Generated/Together.Models.SessionListResponseResponseError.g.cs new file mode 100644 index 00000000..ce019047 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.SessionListResponseResponseError.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class SessionListResponseResponseError + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.SessionListResponseVariant2.Json.g.cs b/src/libs/Together/Generated/Together.Models.SessionListResponseVariant2.Json.g.cs new file mode 100644 index 00000000..047b5541 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.SessionListResponseVariant2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class SessionListResponseVariant2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + 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); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.SessionListResponseVariant2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.SessionListResponseVariant2), + jsonSerializerContext) as global::Together.SessionListResponseVariant2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.SessionListResponseVariant2? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.SessionListResponseVariant2? FromJson( + 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); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.SessionListResponseVariant2), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.SessionListResponseVariant2; + } + + /// + /// 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.Models.SessionListResponseVariant2.g.cs b/src/libs/Together/Generated/Together.Models.SessionListResponseVariant2.g.cs new file mode 100644 index 00000000..e36b31b6 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.SessionListResponseVariant2.g.cs @@ -0,0 +1,44 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class SessionListResponseVariant2 + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + public global::Together.SessionListResponseVariant2Data? Data { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public SessionListResponseVariant2( + global::Together.SessionListResponseVariant2Data? data) + { + this.Data = data; + } + + /// + /// Initializes a new instance of the class. + /// + public SessionListResponseVariant2() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.SessionListResponseVariant2Data.Json.g.cs b/src/libs/Together/Generated/Together.Models.SessionListResponseVariant2Data.Json.g.cs new file mode 100644 index 00000000..7f3fdd7b --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.SessionListResponseVariant2Data.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class SessionListResponseVariant2Data + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + 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); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.SessionListResponseVariant2Data? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.SessionListResponseVariant2Data), + jsonSerializerContext) as global::Together.SessionListResponseVariant2Data; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.SessionListResponseVariant2Data? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.SessionListResponseVariant2Data? FromJson( + 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); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.SessionListResponseVariant2Data), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.SessionListResponseVariant2Data; + } + + /// + /// 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.Models.SessionListResponseVariant2Data.g.cs b/src/libs/Together/Generated/Together.Models.SessionListResponseVariant2Data.g.cs new file mode 100644 index 00000000..3148efcf --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.SessionListResponseVariant2Data.g.cs @@ -0,0 +1,45 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class SessionListResponseVariant2Data + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("sessions")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Sessions { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public SessionListResponseVariant2Data( + global::System.Collections.Generic.IList sessions) + { + this.Sessions = sessions ?? throw new global::System.ArgumentNullException(nameof(sessions)); + } + + /// + /// Initializes a new instance of the class. + /// + public SessionListResponseVariant2Data() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.SessionListResponseVariant2DataSession.Json.g.cs b/src/libs/Together/Generated/Together.Models.SessionListResponseVariant2DataSession.Json.g.cs new file mode 100644 index 00000000..1c50c491 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.SessionListResponseVariant2DataSession.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class SessionListResponseVariant2DataSession + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + 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); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.SessionListResponseVariant2DataSession? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.SessionListResponseVariant2DataSession), + jsonSerializerContext) as global::Together.SessionListResponseVariant2DataSession; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.SessionListResponseVariant2DataSession? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.SessionListResponseVariant2DataSession? FromJson( + 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); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.SessionListResponseVariant2DataSession), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.SessionListResponseVariant2DataSession; + } + + /// + /// 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.Models.SessionListResponseVariant2DataSession.g.cs b/src/libs/Together/Generated/Together.Models.SessionListResponseVariant2DataSession.g.cs new file mode 100644 index 00000000..88d64468 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.SessionListResponseVariant2DataSession.g.cs @@ -0,0 +1,90 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class SessionListResponseVariant2DataSession + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("execute_count")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int ExecuteCount { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("expires_at")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.DateTime ExpiresAt { get; set; } + + /// + /// Session Identifier. Used to make follow-up calls.
+ /// Example: ses_abcDEF123 + ///
+ /// ses_abcDEF123 + [global::System.Text.Json.Serialization.JsonPropertyName("id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Id { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("last_execute_at")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.DateTime LastExecuteAt { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("started_at")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.DateTime StartedAt { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// + /// + /// Session Identifier. Used to make follow-up calls.
+ /// Example: ses_abcDEF123 + /// + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public SessionListResponseVariant2DataSession( + int executeCount, + global::System.DateTime expiresAt, + string id, + global::System.DateTime lastExecuteAt, + global::System.DateTime startedAt) + { + this.ExecuteCount = executeCount; + this.ExpiresAt = expiresAt; + this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); + this.LastExecuteAt = lastExecuteAt; + this.StartedAt = startedAt; + } + + /// + /// Initializes a new instance of the class. + /// + public SessionListResponseVariant2DataSession() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.StreamOutput.Json.g.cs b/src/libs/Together/Generated/Together.Models.StreamOutput.Json.g.cs new file mode 100644 index 00000000..9f774943 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.StreamOutput.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class StreamOutput + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + 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); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.StreamOutput? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.StreamOutput), + jsonSerializerContext) as global::Together.StreamOutput; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.StreamOutput? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.StreamOutput? FromJson( + 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); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.StreamOutput), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.StreamOutput; + } + + /// + /// 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.Models.StreamOutput.g.cs b/src/libs/Together/Generated/Together.Models.StreamOutput.g.cs new file mode 100644 index 00000000..abee6de8 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.StreamOutput.g.cs @@ -0,0 +1,56 @@ + +#nullable enable + +namespace Together +{ + /// + /// Outputs that were printed to stdout or stderr + /// + public sealed partial class StreamOutput + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Data { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("type")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.StreamOutputTypeJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Together.StreamOutputType Type { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public StreamOutput( + string data, + global::Together.StreamOutputType type) + { + this.Data = data ?? throw new global::System.ArgumentNullException(nameof(data)); + this.Type = type; + } + + /// + /// Initializes a new instance of the class. + /// + public StreamOutput() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.WhoamiUserOrgProjectJwtType.g.cs b/src/libs/Together/Generated/Together.Models.StreamOutputType.g.cs similarity index 58% rename from src/libs/Together/Generated/Together.Models.WhoamiUserOrgProjectJwtType.g.cs rename to src/libs/Together/Generated/Together.Models.StreamOutputType.g.cs index ea89600e..7594fe12 100644 --- a/src/libs/Together/Generated/Together.Models.WhoamiUserOrgProjectJwtType.g.cs +++ b/src/libs/Together/Generated/Together.Models.StreamOutputType.g.cs @@ -4,40 +4,46 @@ namespace Together { /// - /// Always `user_org_project_jwt`. + /// /// - public enum WhoamiUserOrgProjectJwtType + public enum StreamOutputType { /// /// /// - UserOrgProjectJwt, + Stderr, + /// + /// + /// + Stdout, } /// /// Enum extensions to do fast conversions without the reflection. /// - public static class WhoamiUserOrgProjectJwtTypeExtensions + public static class StreamOutputTypeExtensions { /// /// Converts an enum to a string. /// - public static string ToValueString(this WhoamiUserOrgProjectJwtType value) + public static string ToValueString(this StreamOutputType value) { return value switch { - WhoamiUserOrgProjectJwtType.UserOrgProjectJwt => "user_org_project_jwt", + StreamOutputType.Stderr => "stderr", + StreamOutputType.Stdout => "stdout", _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), }; } /// /// Converts an string to a enum. /// - public static WhoamiUserOrgProjectJwtType? ToEnum(string value) + public static StreamOutputType? ToEnum(string value) { return value switch { - "user_org_project_jwt" => WhoamiUserOrgProjectJwtType.UserOrgProjectJwt, + "stderr" => StreamOutputType.Stderr, + "stdout" => StreamOutputType.Stdout, _ => null, }; } diff --git a/src/libs/Together/Generated/Together.Models.UpdateEndpointRequest.Json.g.cs b/src/libs/Together/Generated/Together.Models.UpdateEndpointRequest.Json.g.cs new file mode 100644 index 00000000..73c936f4 --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.UpdateEndpointRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Together +{ + public sealed partial class UpdateEndpointRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + 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); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Together.UpdateEndpointRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Together.UpdateEndpointRequest), + jsonSerializerContext) as global::Together.UpdateEndpointRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Together.UpdateEndpointRequest? FromJson( + string json) + { + return FromJson( + json, + global::Together.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Together.UpdateEndpointRequest? FromJson( + 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); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Together.UpdateEndpointRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Together.UpdateEndpointRequest; + } + + /// + /// 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. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + 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.Models.UpdateEndpointRequest.g.cs b/src/libs/Together/Generated/Together.Models.UpdateEndpointRequest.g.cs new file mode 100644 index 00000000..c737207f --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.UpdateEndpointRequest.g.cs @@ -0,0 +1,89 @@ + +#nullable enable + +namespace Together +{ + /// + /// + /// + public sealed partial class UpdateEndpointRequest + { + /// + /// A human-readable name for the endpoint
+ /// Example: My Llama3 70b endpoint + ///
+ /// My Llama3 70b endpoint + [global::System.Text.Json.Serialization.JsonPropertyName("display_name")] + public string? DisplayName { get; set; } + + /// + /// The desired state of the endpoint
+ /// Example: STARTED + ///
+ /// STARTED + [global::System.Text.Json.Serialization.JsonPropertyName("state")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.UpdateEndpointRequestStateJsonConverter))] + public global::Together.UpdateEndpointRequestState? State { get; set; } + + /// + /// New autoscaling configuration for the endpoint + /// + [global::System.Text.Json.Serialization.JsonPropertyName("autoscaling")] + public global::Together.Autoscaling? Autoscaling { get; set; } + + /// + /// The number of minutes of inactivity after which the endpoint stops automatically. Set to 0 to disable automatic timeout.
+ /// Example: 60 + ///
+ /// 60 + [global::System.Text.Json.Serialization.JsonPropertyName("inactive_timeout")] + public int? InactiveTimeout { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// A human-readable name for the endpoint
+ /// Example: My Llama3 70b endpoint + /// + /// + /// The desired state of the endpoint
+ /// Example: STARTED + /// + /// + /// New autoscaling configuration for the endpoint + /// + /// + /// The number of minutes of inactivity after which the endpoint stops automatically. Set to 0 to disable automatic timeout.
+ /// Example: 60 + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public UpdateEndpointRequest( + string? displayName, + global::Together.UpdateEndpointRequestState? state, + global::Together.Autoscaling? autoscaling, + int? inactiveTimeout) + { + this.DisplayName = displayName; + this.State = state; + this.Autoscaling = autoscaling; + this.InactiveTimeout = inactiveTimeout; + } + + /// + /// Initializes a new instance of the class. + /// + public UpdateEndpointRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.UpdateEndpointRequestState.g.cs b/src/libs/Together/Generated/Together.Models.UpdateEndpointRequestState.g.cs new file mode 100644 index 00000000..69d664af --- /dev/null +++ b/src/libs/Together/Generated/Together.Models.UpdateEndpointRequestState.g.cs @@ -0,0 +1,52 @@ + +#nullable enable + +namespace Together +{ + /// + /// The desired state of the endpoint
+ /// Example: STARTED + ///
+ public enum UpdateEndpointRequestState + { + /// + /// + /// + Started, + /// + /// + /// + Stopped, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class UpdateEndpointRequestStateExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this UpdateEndpointRequestState value) + { + return value switch + { + UpdateEndpointRequestState.Started => "STARTED", + UpdateEndpointRequestState.Stopped => "STOPPED", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static UpdateEndpointRequestState? ToEnum(string value) + { + return value switch + { + "STARTED" => UpdateEndpointRequestState.Started, + "STOPPED" => UpdateEndpointRequestState.Stopped, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.WhoamiOrgApiKey.g.cs b/src/libs/Together/Generated/Together.Models.WhoamiOrgApiKey.g.cs deleted file mode 100644 index bfe2cc56..00000000 --- a/src/libs/Together/Generated/Together.Models.WhoamiOrgApiKey.g.cs +++ /dev/null @@ -1,67 +0,0 @@ - -#nullable enable - -namespace Together -{ - /// - /// - /// - public sealed partial class WhoamiOrgApiKey - { - /// - /// Always `org_api_key`. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.WhoamiOrgApiKeyTypeJsonConverter))] - public global::Together.WhoamiOrgApiKeyType Type { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("api_key")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Together.WhoamiApiKey ApiKey { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("organization")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Together.WhoamiOrganization Organization { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// - /// - /// Always `org_api_key`. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public WhoamiOrgApiKey( - global::Together.WhoamiApiKey apiKey, - global::Together.WhoamiOrganization organization, - global::Together.WhoamiOrgApiKeyType type) - { - this.Type = type; - this.ApiKey = apiKey ?? throw new global::System.ArgumentNullException(nameof(apiKey)); - this.Organization = organization ?? throw new global::System.ArgumentNullException(nameof(organization)); - } - - /// - /// Initializes a new instance of the class. - /// - public WhoamiOrgApiKey() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.WhoamiProjectApiKey.g.cs b/src/libs/Together/Generated/Together.Models.WhoamiProjectApiKey.g.cs deleted file mode 100644 index c334359e..00000000 --- a/src/libs/Together/Generated/Together.Models.WhoamiProjectApiKey.g.cs +++ /dev/null @@ -1,77 +0,0 @@ - -#nullable enable - -namespace Together -{ - /// - /// - /// - public sealed partial class WhoamiProjectApiKey - { - /// - /// Always `project_api_key`. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.WhoamiProjectApiKeyTypeJsonConverter))] - public global::Together.WhoamiProjectApiKeyType Type { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("api_key")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Together.WhoamiApiKey ApiKey { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("organization")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Together.WhoamiOrganization Organization { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("project")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Together.WhoamiProject Project { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// - /// - /// - /// Always `project_api_key`. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public WhoamiProjectApiKey( - global::Together.WhoamiApiKey apiKey, - global::Together.WhoamiOrganization organization, - global::Together.WhoamiProject project, - global::Together.WhoamiProjectApiKeyType type) - { - this.Type = type; - this.ApiKey = apiKey ?? throw new global::System.ArgumentNullException(nameof(apiKey)); - this.Organization = organization ?? throw new global::System.ArgumentNullException(nameof(organization)); - this.Project = project ?? throw new global::System.ArgumentNullException(nameof(project)); - } - - /// - /// Initializes a new instance of the class. - /// - public WhoamiProjectApiKey() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.WhoamiResponse.Json.g.cs b/src/libs/Together/Generated/Together.Models.WhoamiResponse.Json.g.cs index b2d61084..d2ff9e54 100644 --- a/src/libs/Together/Generated/Together.Models.WhoamiResponse.Json.g.cs +++ b/src/libs/Together/Generated/Together.Models.WhoamiResponse.Json.g.cs @@ -2,7 +2,7 @@ namespace Together { - public readonly partial struct WhoamiResponse + public sealed partial class WhoamiResponse { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -54,7 +54,7 @@ public string ToJson( return global::System.Text.Json.JsonSerializer.Deserialize( json, typeof(global::Together.WhoamiResponse), - jsonSerializerContext) as global::Together.WhoamiResponse?; + jsonSerializerContext) as global::Together.WhoamiResponse; } /// @@ -101,7 +101,7 @@ public string ToJson( return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, typeof(global::Together.WhoamiResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::Together.WhoamiResponse?; + jsonSerializerContext).ConfigureAwait(false)) as global::Together.WhoamiResponse; } /// diff --git a/src/libs/Together/Generated/Together.Models.WhoamiResponse.g.cs b/src/libs/Together/Generated/Together.Models.WhoamiResponse.g.cs index f06e6263..995bdcaa 100644 --- a/src/libs/Together/Generated/Together.Models.WhoamiResponse.g.cs +++ b/src/libs/Together/Generated/Together.Models.WhoamiResponse.g.cs @@ -1,552 +1,118 @@ -#pragma warning disable CS0618 // Type or member is obsolete #nullable enable namespace Together { /// - /// The caller. `type` names the variant and which fields are present. + /// /// - public readonly partial struct WhoamiResponse : global::System.IEquatable + public sealed partial class WhoamiResponse { /// - /// + /// The ID of the API key that authenticated the request. /// - public global::Together.WhoamiResponseDiscriminatorType? Type { get; } + [global::System.Text.Json.Serialization.JsonPropertyName("api_key_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string ApiKeyId { get; set; } /// - /// + /// The ID of the project the API key is scoped to. /// -#if NET6_0_OR_GREATER - public global::Together.WhoamiProjectApiKey? ProjectApiKey { get; init; } -#else - public global::Together.WhoamiProjectApiKey? ProjectApiKey { get; } -#endif - - /// - /// - /// -#if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(ProjectApiKey))] -#endif - public bool IsProjectApiKey => ProjectApiKey != null; - - /// - /// - /// - public bool TryPickProjectApiKey( -#if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] -#endif - out global::Together.WhoamiProjectApiKey? value) - { - value = ProjectApiKey; - return IsProjectApiKey; - } - - /// - /// - /// - public global::Together.WhoamiProjectApiKey PickProjectApiKey() => ProjectApiKey is { } value - ? value - : throw new global::System.InvalidOperationException($"Expected union variant 'ProjectApiKey' but the value was {ToString()}."); - - /// - /// - /// -#if NET6_0_OR_GREATER - public global::Together.WhoamiOrgApiKey? OrgApiKey { get; init; } -#else - public global::Together.WhoamiOrgApiKey? OrgApiKey { get; } -#endif - - /// - /// - /// -#if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(OrgApiKey))] -#endif - public bool IsOrgApiKey => OrgApiKey != null; - - /// - /// - /// - public bool TryPickOrgApiKey( -#if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] -#endif - out global::Together.WhoamiOrgApiKey? value) - { - value = OrgApiKey; - return IsOrgApiKey; - } - - /// - /// - /// - public global::Together.WhoamiOrgApiKey PickOrgApiKey() => OrgApiKey is { } value - ? value - : throw new global::System.InvalidOperationException($"Expected union variant 'OrgApiKey' but the value was {ToString()}."); - - /// - /// - /// -#if NET6_0_OR_GREATER - public global::Together.WhoamiUserJwt? UserJwt { get; init; } -#else - public global::Together.WhoamiUserJwt? UserJwt { get; } -#endif - - /// - /// - /// -#if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(UserJwt))] -#endif - public bool IsUserJwt => UserJwt != null; - - /// - /// - /// - public bool TryPickUserJwt( -#if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] -#endif - out global::Together.WhoamiUserJwt? value) - { - value = UserJwt; - return IsUserJwt; - } - - /// - /// - /// - public global::Together.WhoamiUserJwt PickUserJwt() => UserJwt is { } value - ? value - : throw new global::System.InvalidOperationException($"Expected union variant 'UserJwt' but the value was {ToString()}."); + [global::System.Text.Json.Serialization.JsonPropertyName("project_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string ProjectId { get; set; } /// - /// + /// Human-readable name of the project. /// -#if NET6_0_OR_GREATER - public global::Together.WhoamiUserOrgJwt? UserOrgJwt { get; init; } -#else - public global::Together.WhoamiUserOrgJwt? UserOrgJwt { get; } -#endif + [global::System.Text.Json.Serialization.JsonPropertyName("project_name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string ProjectName { get; set; } /// - /// + /// DNS-friendly project identifier. Used with an endpoint slug as `<project_slug>/<endpoint_slug>` to form the `model` value in dedicated endpoint inference calls. /// -#if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(UserOrgJwt))] -#endif - public bool IsUserOrgJwt => UserOrgJwt != null; + [global::System.Text.Json.Serialization.JsonPropertyName("project_slug")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string ProjectSlug { get; set; } /// - /// + /// The ID of the organization that owns the project. /// - public bool TryPickUserOrgJwt( -#if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] -#endif - out global::Together.WhoamiUserOrgJwt? value) - { - value = UserOrgJwt; - return IsUserOrgJwt; - } + [global::System.Text.Json.Serialization.JsonPropertyName("organization_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string OrganizationId { get; set; } /// - /// + /// Human-readable name of the organization. /// - public global::Together.WhoamiUserOrgJwt PickUserOrgJwt() => UserOrgJwt is { } value - ? value - : throw new global::System.InvalidOperationException($"Expected union variant 'UserOrgJwt' but the value was {ToString()}."); + [global::System.Text.Json.Serialization.JsonPropertyName("organization_name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string OrganizationName { get; set; } /// - /// + /// The ID of the authenticated user, if available. /// -#if NET6_0_OR_GREATER - public global::Together.WhoamiUserOrgProjectJwt? UserOrgProjectJwt { get; init; } -#else - public global::Together.WhoamiUserOrgProjectJwt? UserOrgProjectJwt { get; } -#endif + [global::System.Text.Json.Serialization.JsonPropertyName("user_id")] + public string? UserId { get; set; } /// - /// + /// Additional properties that are not explicitly defined in the schema /// -#if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(UserOrgProjectJwt))] -#endif - public bool IsUserOrgProjectJwt => UserOrgProjectJwt != null; + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); /// - /// + /// Initializes a new instance of the class. /// - public bool TryPickUserOrgProjectJwt( -#if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] + /// + /// The ID of the API key that authenticated the request. + /// + /// + /// The ID of the project the API key is scoped to. + /// + /// + /// Human-readable name of the project. + /// + /// + /// DNS-friendly project identifier. Used with an endpoint slug as `<project_slug>/<endpoint_slug>` to form the `model` value in dedicated endpoint inference calls. + /// + /// + /// The ID of the organization that owns the project. + /// + /// + /// Human-readable name of the organization. + /// + /// + /// The ID of the authenticated user, if available. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif - out global::Together.WhoamiUserOrgProjectJwt? value) - { - value = UserOrgProjectJwt; - return IsUserOrgProjectJwt; - } - - /// - /// - /// - public global::Together.WhoamiUserOrgProjectJwt PickUserOrgProjectJwt() => UserOrgProjectJwt is { } value - ? value - : throw new global::System.InvalidOperationException($"Expected union variant 'UserOrgProjectJwt' but the value was {ToString()}."); - /// - /// - /// - public static implicit operator WhoamiResponse(global::Together.WhoamiProjectApiKey value) => new WhoamiResponse((global::Together.WhoamiProjectApiKey?)value); - - /// - /// - /// - public static implicit operator global::Together.WhoamiProjectApiKey?(WhoamiResponse @this) => @this.ProjectApiKey; - - /// - /// - /// - public WhoamiResponse(global::Together.WhoamiProjectApiKey? value) - { - ProjectApiKey = value; - } - - /// - /// - /// - public static WhoamiResponse FromProjectApiKey(global::Together.WhoamiProjectApiKey? value) => new WhoamiResponse(value); - - /// - /// - /// - public static implicit operator WhoamiResponse(global::Together.WhoamiOrgApiKey value) => new WhoamiResponse((global::Together.WhoamiOrgApiKey?)value); - - /// - /// - /// - public static implicit operator global::Together.WhoamiOrgApiKey?(WhoamiResponse @this) => @this.OrgApiKey; - - /// - /// - /// - public WhoamiResponse(global::Together.WhoamiOrgApiKey? value) - { - OrgApiKey = value; - } - - /// - /// - /// - public static WhoamiResponse FromOrgApiKey(global::Together.WhoamiOrgApiKey? value) => new WhoamiResponse(value); - - /// - /// - /// - public static implicit operator WhoamiResponse(global::Together.WhoamiUserJwt value) => new WhoamiResponse((global::Together.WhoamiUserJwt?)value); - - /// - /// - /// - public static implicit operator global::Together.WhoamiUserJwt?(WhoamiResponse @this) => @this.UserJwt; - - /// - /// - /// - public WhoamiResponse(global::Together.WhoamiUserJwt? value) - { - UserJwt = value; - } - - /// - /// - /// - public static WhoamiResponse FromUserJwt(global::Together.WhoamiUserJwt? value) => new WhoamiResponse(value); - - /// - /// - /// - public static implicit operator WhoamiResponse(global::Together.WhoamiUserOrgJwt value) => new WhoamiResponse((global::Together.WhoamiUserOrgJwt?)value); - - /// - /// - /// - public static implicit operator global::Together.WhoamiUserOrgJwt?(WhoamiResponse @this) => @this.UserOrgJwt; - - /// - /// - /// - public WhoamiResponse(global::Together.WhoamiUserOrgJwt? value) - { - UserOrgJwt = value; - } - - /// - /// - /// - public static WhoamiResponse FromUserOrgJwt(global::Together.WhoamiUserOrgJwt? value) => new WhoamiResponse(value); - - /// - /// - /// - public static implicit operator WhoamiResponse(global::Together.WhoamiUserOrgProjectJwt value) => new WhoamiResponse((global::Together.WhoamiUserOrgProjectJwt?)value); - - /// - /// - /// - public static implicit operator global::Together.WhoamiUserOrgProjectJwt?(WhoamiResponse @this) => @this.UserOrgProjectJwt; - - /// - /// - /// - public WhoamiResponse(global::Together.WhoamiUserOrgProjectJwt? value) - { - UserOrgProjectJwt = value; - } - - /// - /// - /// - public static WhoamiResponse FromUserOrgProjectJwt(global::Together.WhoamiUserOrgProjectJwt? value) => new WhoamiResponse(value); - - /// - /// - /// public WhoamiResponse( - global::Together.WhoamiResponseDiscriminatorType? type, - global::Together.WhoamiProjectApiKey? projectApiKey, - global::Together.WhoamiOrgApiKey? orgApiKey, - global::Together.WhoamiUserJwt? userJwt, - global::Together.WhoamiUserOrgJwt? userOrgJwt, - global::Together.WhoamiUserOrgProjectJwt? userOrgProjectJwt - ) + string apiKeyId, + string projectId, + string projectName, + string projectSlug, + string organizationId, + string organizationName, + string? userId) { - Type = type; - - ProjectApiKey = projectApiKey; - OrgApiKey = orgApiKey; - UserJwt = userJwt; - UserOrgJwt = userOrgJwt; - UserOrgProjectJwt = userOrgProjectJwt; + this.ApiKeyId = apiKeyId ?? throw new global::System.ArgumentNullException(nameof(apiKeyId)); + this.ProjectId = projectId ?? throw new global::System.ArgumentNullException(nameof(projectId)); + this.ProjectName = projectName ?? throw new global::System.ArgumentNullException(nameof(projectName)); + this.ProjectSlug = projectSlug ?? throw new global::System.ArgumentNullException(nameof(projectSlug)); + this.OrganizationId = organizationId ?? throw new global::System.ArgumentNullException(nameof(organizationId)); + this.OrganizationName = organizationName ?? throw new global::System.ArgumentNullException(nameof(organizationName)); + this.UserId = userId; } /// - /// - /// - public object? Object => - UserOrgProjectJwt as object ?? - UserOrgJwt as object ?? - UserJwt as object ?? - OrgApiKey as object ?? - ProjectApiKey as object - ; - - /// - /// + /// Initializes a new instance of the class. /// - public override string? ToString() => - ProjectApiKey?.ToString() ?? - OrgApiKey?.ToString() ?? - UserJwt?.ToString() ?? - UserOrgJwt?.ToString() ?? - UserOrgProjectJwt?.ToString() - ; - - /// - /// - /// - public bool Validate() + public WhoamiResponse() { - return IsProjectApiKey && !IsOrgApiKey && !IsUserJwt && !IsUserOrgJwt && !IsUserOrgProjectJwt || !IsProjectApiKey && IsOrgApiKey && !IsUserJwt && !IsUserOrgJwt && !IsUserOrgProjectJwt || !IsProjectApiKey && !IsOrgApiKey && IsUserJwt && !IsUserOrgJwt && !IsUserOrgProjectJwt || !IsProjectApiKey && !IsOrgApiKey && !IsUserJwt && IsUserOrgJwt && !IsUserOrgProjectJwt || !IsProjectApiKey && !IsOrgApiKey && !IsUserJwt && !IsUserOrgJwt && IsUserOrgProjectJwt; } - /// - /// - /// - public TResult? Match( - global::System.Func? projectApiKey = null, - global::System.Func? orgApiKey = null, - global::System.Func? userJwt = null, - global::System.Func? userOrgJwt = null, - global::System.Func? userOrgProjectJwt = null, - bool validate = true) - { - if (validate) - { - Validate(); - } - - if (ProjectApiKey is { } __value0 && projectApiKey != null) - { - return projectApiKey(__value0); - } - else if (OrgApiKey is { } __value1 && orgApiKey != null) - { - return orgApiKey(__value1); - } - else if (UserJwt is { } __value2 && userJwt != null) - { - return userJwt(__value2); - } - else if (UserOrgJwt is { } __value3 && userOrgJwt != null) - { - return userOrgJwt(__value3); - } - else if (UserOrgProjectJwt is { } __value4 && userOrgProjectJwt != null) - { - return userOrgProjectJwt(__value4); - } - - return default(TResult); - } - - /// - /// - /// - public void Match( - global::System.Action? projectApiKey = null, - - global::System.Action? orgApiKey = null, - - global::System.Action? userJwt = null, - - global::System.Action? userOrgJwt = null, - - global::System.Action? userOrgProjectJwt = null, - bool validate = true) - { - if (validate) - { - Validate(); - } - - if (ProjectApiKey is { } __value0) - { - projectApiKey?.Invoke(__value0); - } - else if (OrgApiKey is { } __value1) - { - orgApiKey?.Invoke(__value1); - } - else if (UserJwt is { } __value2) - { - userJwt?.Invoke(__value2); - } - else if (UserOrgJwt is { } __value3) - { - userOrgJwt?.Invoke(__value3); - } - else if (UserOrgProjectJwt is { } __value4) - { - userOrgProjectJwt?.Invoke(__value4); - } - } - - /// - /// - /// - public void Switch( - global::System.Action? projectApiKey = null, - global::System.Action? orgApiKey = null, - global::System.Action? userJwt = null, - global::System.Action? userOrgJwt = null, - global::System.Action? userOrgProjectJwt = null, - bool validate = true) - { - if (validate) - { - Validate(); - } - - if (ProjectApiKey is { } __value0) - { - projectApiKey?.Invoke(__value0); - } - else if (OrgApiKey is { } __value1) - { - orgApiKey?.Invoke(__value1); - } - else if (UserJwt is { } __value2) - { - userJwt?.Invoke(__value2); - } - else if (UserOrgJwt is { } __value3) - { - userOrgJwt?.Invoke(__value3); - } - else if (UserOrgProjectJwt is { } __value4) - { - userOrgProjectJwt?.Invoke(__value4); - } - } - - /// - /// - /// - public override int GetHashCode() - { - var fields = new object?[] - { - ProjectApiKey, - typeof(global::Together.WhoamiProjectApiKey), - OrgApiKey, - typeof(global::Together.WhoamiOrgApiKey), - UserJwt, - typeof(global::Together.WhoamiUserJwt), - UserOrgJwt, - typeof(global::Together.WhoamiUserOrgJwt), - UserOrgProjectJwt, - typeof(global::Together.WhoamiUserOrgProjectJwt), - }; - const int offset = unchecked((int)2166136261); - const int prime = 16777619; - static int HashCodeAggregator(int hashCode, object? value) => value == null - ? (hashCode ^ 0) * prime - : (hashCode ^ value.GetHashCode()) * prime; - - return global::System.Linq.Enumerable.Aggregate(fields, offset, HashCodeAggregator); - } - - /// - /// - /// - public bool Equals(WhoamiResponse other) - { - return - global::System.Collections.Generic.EqualityComparer.Default.Equals(ProjectApiKey, other.ProjectApiKey) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(OrgApiKey, other.OrgApiKey) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(UserJwt, other.UserJwt) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(UserOrgJwt, other.UserOrgJwt) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(UserOrgProjectJwt, other.UserOrgProjectJwt) - ; - } - - /// - /// - /// - public static bool operator ==(WhoamiResponse obj1, WhoamiResponse obj2) - { - return global::System.Collections.Generic.EqualityComparer.Default.Equals(obj1, obj2); - } - - /// - /// - /// - public static bool operator !=(WhoamiResponse obj1, WhoamiResponse obj2) - { - return !(obj1 == obj2); - } - - /// - /// - /// - public override bool Equals(object? obj) - { - return obj is WhoamiResponse o && Equals(o); - } } -} +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.WhoamiResponseDiscriminatorType.g.cs b/src/libs/Together/Generated/Together.Models.WhoamiResponseDiscriminatorType.g.cs deleted file mode 100644 index f3613fd9..00000000 --- a/src/libs/Together/Generated/Together.Models.WhoamiResponseDiscriminatorType.g.cs +++ /dev/null @@ -1,69 +0,0 @@ - -#nullable enable - -namespace Together -{ - /// - /// - /// - public enum WhoamiResponseDiscriminatorType - { - /// - /// - /// - OrgApiKey, - /// - /// - /// - ProjectApiKey, - /// - /// - /// - UserJwt, - /// - /// - /// - UserOrgJwt, - /// - /// - /// - UserOrgProjectJwt, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class WhoamiResponseDiscriminatorTypeExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this WhoamiResponseDiscriminatorType value) - { - return value switch - { - WhoamiResponseDiscriminatorType.OrgApiKey => "org_api_key", - WhoamiResponseDiscriminatorType.ProjectApiKey => "project_api_key", - WhoamiResponseDiscriminatorType.UserJwt => "user_jwt", - WhoamiResponseDiscriminatorType.UserOrgJwt => "user_org_jwt", - WhoamiResponseDiscriminatorType.UserOrgProjectJwt => "user_org_project_jwt", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static WhoamiResponseDiscriminatorType? ToEnum(string value) - { - return value switch - { - "org_api_key" => WhoamiResponseDiscriminatorType.OrgApiKey, - "project_api_key" => WhoamiResponseDiscriminatorType.ProjectApiKey, - "user_jwt" => WhoamiResponseDiscriminatorType.UserJwt, - "user_org_jwt" => WhoamiResponseDiscriminatorType.UserOrgJwt, - "user_org_project_jwt" => WhoamiResponseDiscriminatorType.UserOrgProjectJwt, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.WhoamiUserOrgJwt.Json.g.cs b/src/libs/Together/Generated/Together.Models.WhoamiUserOrgJwt.Json.g.cs deleted file mode 100644 index a3dfbc6a..00000000 --- a/src/libs/Together/Generated/Together.Models.WhoamiUserOrgJwt.Json.g.cs +++ /dev/null @@ -1,141 +0,0 @@ -#nullable enable - -namespace Together -{ - public sealed partial class WhoamiUserOrgJwt - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - 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. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - 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); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::Together.WhoamiUserOrgJwt? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::Together.WhoamiUserOrgJwt), - jsonSerializerContext) as global::Together.WhoamiUserOrgJwt; - } - - /// - /// Deserializes a JSON string using the generated default JsonSerializerContext. - /// - public static global::Together.WhoamiUserOrgJwt? FromJson( - string json) - { - return FromJson( - json, - global::Together.SourceGenerationContext.Default); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::Together.WhoamiUserOrgJwt? FromJson( - 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); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::Together.WhoamiUserOrgJwt), - jsonSerializerContext).ConfigureAwait(false)) as global::Together.WhoamiUserOrgJwt; - } - - /// - /// 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. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - 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.Models.WhoamiUserOrgJwt.g.cs b/src/libs/Together/Generated/Together.Models.WhoamiUserOrgJwt.g.cs deleted file mode 100644 index 913f08b5..00000000 --- a/src/libs/Together/Generated/Together.Models.WhoamiUserOrgJwt.g.cs +++ /dev/null @@ -1,67 +0,0 @@ - -#nullable enable - -namespace Together -{ - /// - /// - /// - public sealed partial class WhoamiUserOrgJwt - { - /// - /// Always `user_org_jwt`. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.WhoamiUserOrgJwtTypeJsonConverter))] - public global::Together.WhoamiUserOrgJwtType Type { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("user")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Together.WhoamiUser User { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("organization")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Together.WhoamiOrganization Organization { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// - /// - /// Always `user_org_jwt`. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public WhoamiUserOrgJwt( - global::Together.WhoamiUser user, - global::Together.WhoamiOrganization organization, - global::Together.WhoamiUserOrgJwtType type) - { - this.Type = type; - this.User = user ?? throw new global::System.ArgumentNullException(nameof(user)); - this.Organization = organization ?? throw new global::System.ArgumentNullException(nameof(organization)); - } - - /// - /// Initializes a new instance of the class. - /// - public WhoamiUserOrgJwt() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.Models.WhoamiUserOrgProjectJwt.g.cs b/src/libs/Together/Generated/Together.Models.WhoamiUserOrgProjectJwt.g.cs deleted file mode 100644 index 05c3a87f..00000000 --- a/src/libs/Together/Generated/Together.Models.WhoamiUserOrgProjectJwt.g.cs +++ /dev/null @@ -1,77 +0,0 @@ - -#nullable enable - -namespace Together -{ - /// - /// - /// - public sealed partial class WhoamiUserOrgProjectJwt - { - /// - /// Always `user_org_project_jwt`. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("type")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Together.JsonConverters.WhoamiUserOrgProjectJwtTypeJsonConverter))] - public global::Together.WhoamiUserOrgProjectJwtType Type { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("user")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Together.WhoamiUser User { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("organization")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Together.WhoamiOrganization Organization { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("project")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::Together.WhoamiProject Project { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// - /// - /// - /// Always `user_org_project_jwt`. - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public WhoamiUserOrgProjectJwt( - global::Together.WhoamiUser user, - global::Together.WhoamiOrganization organization, - global::Together.WhoamiProject project, - global::Together.WhoamiUserOrgProjectJwtType type) - { - this.Type = type; - this.User = user ?? throw new global::System.ArgumentNullException(nameof(user)); - this.Organization = organization ?? throw new global::System.ArgumentNullException(nameof(organization)); - this.Project = project ?? throw new global::System.ArgumentNullException(nameof(project)); - } - - /// - /// Initializes a new instance of the class. - /// - public WhoamiUserOrgProjectJwt() - { - } - - } -} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.ModelsClient.Models.g.cs b/src/libs/Together/Generated/Together.ModelsClient.Models.g.cs new file mode 100644 index 00000000..bf8b43bd --- /dev/null +++ b/src/libs/Together/Generated/Together.ModelsClient.Models.g.cs @@ -0,0 +1,653 @@ + +#nullable enable + +namespace Together +{ + public partial class ModelsClient + { + + private static readonly global::Together.AutoSDKServer[] s_ModelsServers = 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_ModelsSecurityRequirement0 = + 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_ModelsSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_ModelsSecurityRequirement0, + }; + partial void PrepareModelsArguments( + global::System.Net.Http.HttpClient httpClient, + ref bool? dedicated); + partial void PrepareModelsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + bool? dedicated); + partial void ProcessModelsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessModelsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// List all models
+ /// Lists all of Together's open-source models and metadata including pricing, chat template, and context. + ///
+ /// + /// Filter models to only return dedicated models + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// models = client.models.list()
+ /// for model in models:
+ /// print(model.id) + ///
+ public async global::System.Threading.Tasks.Task> ModelsAsync( + bool? dedicated = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ModelsAsResponseAsync( + dedicated: dedicated, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List all models
+ /// Lists all of Together's open-source models and metadata including pricing, chat template, and context. + ///
+ /// + /// Filter models to only return dedicated models + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// models = client.models.list()
+ /// for model in models:
+ /// print(model.id) + ///
+ public async global::System.Threading.Tasks.Task>> ModelsAsResponseAsync( + bool? dedicated = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareModelsArguments( + httpClient: HttpClient, + dedicated: ref dedicated); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ModelsSecurityRequirements, + operationName: "ModelsAsync"); + + 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: "/models", + baseUri: ResolveBaseUri( + servers: s_ModelsServers, + defaultBaseUrl: "https://api.together.ai/v1")); + __pathBuilder + .AddOptionalParameter("dedicated", dedicated?.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.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); + PrepareModelsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + dedicated: dedicated); + + 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: "Models", + methodName: "ModelsAsync", + pathTemplate: "\"/models\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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: "Models", + methodName: "ModelsAsync", + pathTemplate: "\"/models\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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: "Models", + methodName: "ModelsAsync", + pathTemplate: "\"/models\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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); + ProcessModelsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "Models", + methodName: "ModelsAsync", + pathTemplate: "\"/models\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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: "Models", + methodName: "ModelsAsync", + pathTemplate: "\"/models\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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); + } + // BadRequest + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + global::Together.ErrorData? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = global::Together.ErrorData.FromJson(__content_400, JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = global::Together.ErrorData.FromJson(__content_400, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized + 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)); + } + // NotFound + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::Together.ErrorData? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::Together.ErrorData.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::Together.ErrorData.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // RateLimit + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::Together.ErrorData? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::Together.ErrorData.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::Together.ErrorData.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Timeout + if ((int)__response.StatusCode == 504) + { + string? __content_504 = null; + global::System.Exception? __exception_504 = null; + global::Together.ErrorData? __value_504 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_504 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_504 = global::Together.ErrorData.FromJson(__content_504, JsonSerializerContext); + } + else + { + __content_504 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_504 = global::Together.ErrorData.FromJson(__content_504, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_504 = __ex; + } + + + throw global::Together.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_504 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_504, + responseBody: __content_504, + responseObject: __value_504, + 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); + ProcessModelsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), 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 = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), 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.ModelsClient.UploadModel.g.cs b/src/libs/Together/Generated/Together.ModelsClient.UploadModel.g.cs new file mode 100644 index 00000000..07161c2b --- /dev/null +++ b/src/libs/Together/Generated/Together.ModelsClient.UploadModel.g.cs @@ -0,0 +1,539 @@ + +#nullable enable + +namespace Together +{ + public partial class ModelsClient + { + + private static readonly global::Together.AutoSDKServer[] s_UploadModelServers = 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_UploadModelSecurityRequirement0 = + 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_UploadModelSecurityRequirements = + new global::Together.EndPointSecurityRequirement[] + { s_UploadModelSecurityRequirement0, + }; + partial void PrepareUploadModelArguments( + global::System.Net.Http.HttpClient httpClient, + global::Together.ModelUploadRequest request); + partial void PrepareUploadModelRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + global::Together.ModelUploadRequest request); + partial void ProcessUploadModelResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessUploadModelResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Upload a custom model or adapter
+ /// Upload a custom model or adapter from Hugging Face or S3 + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.models.upload(
+ /// model_name="My-Fine-Tuned-Model",
+ /// model_source="https://ml-models.s3.us-west-2.amazonaws.com/models/my-fine-tuned-model.tar.gz",
+ /// )
+ /// print(response.data.job_id) + ///
+ public async global::System.Threading.Tasks.Task UploadModelAsync( + + global::Together.ModelUploadRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UploadModelAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Upload a custom model or adapter
+ /// Upload a custom model or adapter from Hugging Face or S3 + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.models.upload(
+ /// model_name="My-Fine-Tuned-Model",
+ /// model_source="https://ml-models.s3.us-west-2.amazonaws.com/models/my-fine-tuned-model.tar.gz",
+ /// )
+ /// print(response.data.job_id) + ///
+ public async global::System.Threading.Tasks.Task> UploadModelAsResponseAsync( + + global::Together.ModelUploadRequest request, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareUploadModelArguments( + httpClient: HttpClient, + request: request); + + + var __authorizations = global::Together.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_UploadModelSecurityRequirements, + operationName: "UploadModelAsync"); + + 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: "/models", + baseUri: ResolveBaseUri( + servers: s_UploadModelServers, + 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.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); + PrepareUploadModelRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + 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: "UploadModel", + methodName: "UploadModelAsync", + pathTemplate: "\"/models\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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: "UploadModel", + methodName: "UploadModelAsync", + pathTemplate: "\"/models\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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: "UploadModel", + methodName: "UploadModelAsync", + pathTemplate: "\"/models\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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); + ProcessUploadModelResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Together.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UploadModel", + methodName: "UploadModelAsync", + pathTemplate: "\"/models\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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: "UploadModel", + methodName: "UploadModelAsync", + pathTemplate: "\"/models\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + 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); + } + + 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); + ProcessUploadModelResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Together.ModelUploadSuccessResponse.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.ModelUploadSuccessResponse.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(); + } + } + /// + /// Upload a custom model or adapter
+ /// Upload a custom model or adapter from Hugging Face or S3 + ///
+ /// + /// The name to give to your uploaded model
+ /// Example: Qwen2.5-72B-Instruct + /// + /// + /// The source location of the model (Hugging Face repo or S3 path)
+ /// Example: unsloth/Qwen2.5-72B-Instruct + /// + /// + /// Whether the model is a full model or an adapter
+ /// Default Value: model
+ /// Example: model + /// + /// + /// Hugging Face token (if uploading from Hugging Face)
+ /// Example: hf_examplehuggingfacetoken + /// + /// + /// A description of your model
+ /// Example: Finetuned Qwen2.5-72B-Instruct by Unsloth + /// + /// + /// The base model to use for an adapter if setting it to run against a serverless pool. Only used for model_type `adapter`.
+ /// Example: Qwen/Qwen2.5-72B-Instruct + /// + /// + /// The lora pool to use for an adapter if setting it to run against, say, a dedicated pool. Only used for model_type `adapter`.
+ /// Example: my_username/Qwen2.5-72B-Instruct-lora + /// + /// 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 UploadModelAsync( + string modelName, + string modelSource, + global::Together.ModelUploadRequestModelType? modelType = default, + string? hfToken = default, + string? description = default, + string? baseModel = default, + string? loraModel = default, + global::Together.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Together.ModelUploadRequest + { + ModelName = modelName, + ModelSource = modelSource, + ModelType = modelType, + HfToken = hfToken, + Description = description, + BaseModel = baseModel, + LoraModel = loraModel, + }; + + return await UploadModelAsync( + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/Together/Generated/Together.ModelsClient.g.cs b/src/libs/Together/Generated/Together.ModelsClient.g.cs new file mode 100644 index 00000000..2c464c08 --- /dev/null +++ b/src/libs/Together/Generated/Together.ModelsClient.g.cs @@ -0,0 +1,295 @@ + +#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 ModelsClient : global::Together.IModelsClient, 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; } + + + /// + public global::System.Func CreateIdempotencyKey { get; set; } = () => global::System.Guid.NewGuid().ToString("D"); + + + internal global::Together.AutoSDKServerConfiguration AutoSDKServerConfiguration { get; set; } = new global::Together.AutoSDKServerConfiguration(); + + internal global::System.Lazy? JsonSerializerContextProvider { get; set; } + + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext + { + get => JsonSerializerContextProvider?.Value ?? global::Together.ModelsSourceGenerationContext.Default; + set => JsonSerializerContextProvider = new(() => value); + } + + + + 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 ModelsClient. + /// 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 ModelsClient( + 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 ModelsClient 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 ModelsClient( + 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 ModelsClient. + /// 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 ModelsClient( + 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.PlacementProfileService.JsonSerializerContext.g.cs b/src/libs/Together/Generated/Together.PlacementProfileService.JsonSerializerContext.g.cs index ce0e1b58..b99a78d0 100644 --- a/src/libs/Together/Generated/Together.PlacementProfileService.JsonSerializerContext.g.cs +++ b/src/libs/Together/Generated/Together.PlacementProfileService.JsonSerializerContext.g.cs @@ -2,32 +2,7 @@ #nullable enable namespace Together -{ - /// - /// - /// - [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( - DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull - )] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeListPlacementProfilesResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DePlacementProfile))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ErrorData))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ErrorDataError))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - internal sealed partial class PlacementProfileServiceSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext - { - } - /// +{ /// /// /// public sealed partial class PlacementProfileServiceSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext @@ -71,25 +46,7 @@ private PlacementProfileServiceSourceGenerationContext(global::System.Text.Json. [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) { - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter, global::System.Collections.Generic.IList>()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter>()); - options.Converters.Add(new global::Together.JsonConverters.UnixTimestampJsonConverter()); + global::Together.SourceGenerationContext.AddConverters(options); } private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() @@ -143,7 +100,7 @@ private sealed class LazyChunkResolver : global::System.Text.Json.Serialization. { return index switch { - 0 => new PlacementProfileServiceSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), + 0 => global::Together.SourceGenerationContext.TypeInfoResolver, _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), }; } diff --git a/src/libs/Together/Generated/Together.PlacementProfileServiceClient.PlacementProfileServiceGetPlacementProfile.g.cs b/src/libs/Together/Generated/Together.PlacementProfileServiceClient.PlacementProfileServiceGetPlacementProfile.g.cs index d667f8d8..8aa97da4 100644 --- a/src/libs/Together/Generated/Together.PlacementProfileServiceClient.PlacementProfileServiceGetPlacementProfile.g.cs +++ b/src/libs/Together/Generated/Together.PlacementProfileServiceClient.PlacementProfileServiceGetPlacementProfile.g.cs @@ -6,6 +6,14 @@ namespace Together public partial class PlacementProfileServiceClient { + private static readonly global::Together.AutoSDKServer[] s_PlacementProfileServiceGetPlacementProfileServers = 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_PlacementProfileServiceGetPlacementProfileSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -56,6 +64,16 @@ partial void ProcessPlacementProfileServiceGetPlacementProfileResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// profile = client.beta.endpoints.placement_profiles.retrieve(
+ /// "pp_abc123",
+ /// project_id=project_id,
+ /// )
+ /// print(profile.name) + ///
public async global::System.Threading.Tasks.Task PlacementProfileServiceGetPlacementProfileAsync( string projectId, string id, @@ -84,6 +102,16 @@ partial void ProcessPlacementProfileServiceGetPlacementProfileResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// profile = client.beta.endpoints.placement_profiles.retrieve(
+ /// "pp_abc123",
+ /// project_id=project_id,
+ /// )
+ /// print(profile.name) + ///
public async global::System.Threading.Tasks.Task> PlacementProfileServiceGetPlacementProfileAsResponseAsync( string projectId, string id, @@ -121,8 +149,10 @@ partial void ProcessPlacementProfileServiceGetPlacementProfileResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v2/projects/{projectId}/placement-profiles/{id}", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/projects/{projectId}/placement-profiles/{id}", + baseUri: ResolveBaseUri( + servers: s_PlacementProfileServiceGetPlacementProfileServers, + defaultBaseUrl: "https://api.together.ai/v2")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -183,7 +213,7 @@ partial void ProcessPlacementProfileServiceGetPlacementProfileResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "PlacementProfileServiceGetPlacementProfile", methodName: "PlacementProfileServiceGetPlacementProfileAsync", - pathTemplate: "$\"/v2/projects/{projectId}/placement-profiles/{id}\"", + pathTemplate: "$\"/projects/{projectId}/placement-profiles/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -217,7 +247,7 @@ partial void ProcessPlacementProfileServiceGetPlacementProfileResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "PlacementProfileServiceGetPlacementProfile", methodName: "PlacementProfileServiceGetPlacementProfileAsync", - pathTemplate: "$\"/v2/projects/{projectId}/placement-profiles/{id}\"", + pathTemplate: "$\"/projects/{projectId}/placement-profiles/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -258,7 +288,7 @@ partial void ProcessPlacementProfileServiceGetPlacementProfileResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "PlacementProfileServiceGetPlacementProfile", methodName: "PlacementProfileServiceGetPlacementProfileAsync", - pathTemplate: "$\"/v2/projects/{projectId}/placement-profiles/{id}\"", + pathTemplate: "$\"/projects/{projectId}/placement-profiles/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -306,7 +336,7 @@ partial void ProcessPlacementProfileServiceGetPlacementProfileResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "PlacementProfileServiceGetPlacementProfile", methodName: "PlacementProfileServiceGetPlacementProfileAsync", - pathTemplate: "$\"/v2/projects/{projectId}/placement-profiles/{id}\"", + pathTemplate: "$\"/projects/{projectId}/placement-profiles/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -328,7 +358,7 @@ partial void ProcessPlacementProfileServiceGetPlacementProfileResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "PlacementProfileServiceGetPlacementProfile", methodName: "PlacementProfileServiceGetPlacementProfileAsync", - pathTemplate: "$\"/v2/projects/{projectId}/placement-profiles/{id}\"", + pathTemplate: "$\"/projects/{projectId}/placement-profiles/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.PlacementProfileServiceClient.PlacementProfileServiceListPlacementProfiles.g.cs b/src/libs/Together/Generated/Together.PlacementProfileServiceClient.PlacementProfileServiceListPlacementProfiles.g.cs index cc1256c3..9dd26ca3 100644 --- a/src/libs/Together/Generated/Together.PlacementProfileServiceClient.PlacementProfileServiceListPlacementProfiles.g.cs +++ b/src/libs/Together/Generated/Together.PlacementProfileServiceClient.PlacementProfileServiceListPlacementProfiles.g.cs @@ -6,6 +6,14 @@ namespace Together public partial class PlacementProfileServiceClient { + private static readonly global::Together.AutoSDKServer[] s_PlacementProfileServiceListPlacementProfilesServers = 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_PlacementProfileServiceListPlacementProfilesSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -61,6 +69,16 @@ partial void ProcessPlacementProfileServiceListPlacementProfilesResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// profiles = client.beta.endpoints.placement_profiles.list(
+ /// project_id=project_id,
+ /// )
+ /// for profile in profiles:
+ /// print(profile.id, profile.name) + ///
public async global::System.Threading.Tasks.Task PlacementProfileServiceListPlacementProfilesAsync( string projectId, int? limit = default, @@ -94,6 +112,16 @@ partial void ProcessPlacementProfileServiceListPlacementProfilesResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// profiles = client.beta.endpoints.placement_profiles.list(
+ /// project_id=project_id,
+ /// )
+ /// for profile in profiles:
+ /// print(profile.id, profile.name) + ///
public async global::System.Threading.Tasks.Task> PlacementProfileServiceListPlacementProfilesAsResponseAsync( string projectId, int? limit = default, @@ -133,8 +161,10 @@ partial void ProcessPlacementProfileServiceListPlacementProfilesResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v2/projects/{projectId}/placement-profiles", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/projects/{projectId}/placement-profiles", + baseUri: ResolveBaseUri( + servers: s_PlacementProfileServiceListPlacementProfilesServers, + defaultBaseUrl: "https://api.together.ai/v2")); __pathBuilder .AddOptionalParameter("limit", limit?.ToString()) .AddOptionalParameter("after", after) @@ -200,7 +230,7 @@ partial void ProcessPlacementProfileServiceListPlacementProfilesResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "PlacementProfileServiceListPlacementProfiles", methodName: "PlacementProfileServiceListPlacementProfilesAsync", - pathTemplate: "$\"/v2/projects/{projectId}/placement-profiles\"", + pathTemplate: "$\"/projects/{projectId}/placement-profiles\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -234,7 +264,7 @@ partial void ProcessPlacementProfileServiceListPlacementProfilesResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "PlacementProfileServiceListPlacementProfiles", methodName: "PlacementProfileServiceListPlacementProfilesAsync", - pathTemplate: "$\"/v2/projects/{projectId}/placement-profiles\"", + pathTemplate: "$\"/projects/{projectId}/placement-profiles\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -275,7 +305,7 @@ partial void ProcessPlacementProfileServiceListPlacementProfilesResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "PlacementProfileServiceListPlacementProfiles", methodName: "PlacementProfileServiceListPlacementProfilesAsync", - pathTemplate: "$\"/v2/projects/{projectId}/placement-profiles\"", + pathTemplate: "$\"/projects/{projectId}/placement-profiles\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -323,7 +353,7 @@ partial void ProcessPlacementProfileServiceListPlacementProfilesResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "PlacementProfileServiceListPlacementProfiles", methodName: "PlacementProfileServiceListPlacementProfilesAsync", - pathTemplate: "$\"/v2/projects/{projectId}/placement-profiles\"", + pathTemplate: "$\"/projects/{projectId}/placement-profiles\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -345,7 +375,7 @@ partial void ProcessPlacementProfileServiceListPlacementProfilesResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "PlacementProfileServiceListPlacementProfiles", methodName: "PlacementProfileServiceListPlacementProfilesAsync", - pathTemplate: "$\"/v2/projects/{projectId}/placement-profiles\"", + pathTemplate: "$\"/projects/{projectId}/placement-profiles\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.PlacementProfileServiceClient.g.cs b/src/libs/Together/Generated/Together.PlacementProfileServiceClient.g.cs index 9f7e3658..62e5cf9a 100644 --- a/src/libs/Together/Generated/Together.PlacementProfileServiceClient.g.cs +++ b/src/libs/Together/Generated/Together.PlacementProfileServiceClient.g.cs @@ -10,9 +10,9 @@ namespace Together public sealed partial class PlacementProfileServiceClient : global::Together.IPlacementProfileServiceClient, global::System.IDisposable { /// - /// Default environment for APIs + /// /// - public const string DefaultBaseUrl = "https://api.together.ai/"; + public const string DefaultBaseUrl = "https://api.together.ai/v2"; private bool _disposeHttpClient = true; @@ -151,5 +151,36 @@ 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.Projects.JsonSerializerContext.g.cs b/src/libs/Together/Generated/Together.Projects.JsonSerializerContext.g.cs index 22747b3a..ef0cc9f2 100644 --- a/src/libs/Together/Generated/Together.Projects.JsonSerializerContext.g.cs +++ b/src/libs/Together/Generated/Together.Projects.JsonSerializerContext.g.cs @@ -2,30 +2,7 @@ #nullable enable namespace Together -{ - /// - /// - /// - [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( - DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull - )] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ErrorData))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ErrorDataError))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.Project))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ListProjectsResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - internal sealed partial class ProjectsSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext - { - } - /// +{ /// /// /// public sealed partial class ProjectsSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext @@ -69,25 +46,7 @@ private ProjectsSourceGenerationContext(global::System.Text.Json.JsonSerializerO [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) { - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter, global::System.Collections.Generic.IList>()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter>()); - options.Converters.Add(new global::Together.JsonConverters.UnixTimestampJsonConverter()); + global::Together.SourceGenerationContext.AddConverters(options); } private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() @@ -141,7 +100,7 @@ private sealed class LazyChunkResolver : global::System.Text.Json.Serialization. { return index switch { - 0 => new ProjectsSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), + 0 => global::Together.SourceGenerationContext.TypeInfoResolver, _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), }; } diff --git a/src/libs/Together/Generated/Together.ProjectsClient.ListProjects.g.cs b/src/libs/Together/Generated/Together.ProjectsClient.ListProjects.g.cs index 695271d2..7099b9ad 100644 --- a/src/libs/Together/Generated/Together.ProjectsClient.ListProjects.g.cs +++ b/src/libs/Together/Generated/Together.ProjectsClient.ListProjects.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class ProjectsClient { + private static readonly global::Together.AutoSDKServer[] s_ListProjectsServers = 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_ListProjectsSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -56,6 +69,12 @@ partial void ProcessListProjectsResponseContent( /// 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()
+ /// for project in client.projects.list():
+ /// print(project.id, project.name, project.slug) + ///
public async global::System.Threading.Tasks.Task ListProjectsAsync( int? limit = default, string? after = default, @@ -84,6 +103,12 @@ partial void ProcessListProjectsResponseContent( /// 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()
+ /// for project in client.projects.list():
+ /// print(project.id, project.name, project.slug) + ///
public async global::System.Threading.Tasks.Task> ListProjectsAsResponseAsync( int? limit = default, string? after = default, @@ -121,8 +146,10 @@ partial void ProcessListProjectsResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: "/v1/projects", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: "/projects", + baseUri: ResolveBaseUri( + servers: s_ListProjectsServers, + defaultBaseUrl: "https://api.together.ai/v1")); __pathBuilder .AddOptionalParameter("limit", limit?.ToString()) .AddOptionalParameter("after", after) @@ -187,7 +214,7 @@ partial void ProcessListProjectsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ListProjects", methodName: "ListProjectsAsync", - pathTemplate: "\"/v1/projects\"", + pathTemplate: "\"/projects\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -221,7 +248,7 @@ partial void ProcessListProjectsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ListProjects", methodName: "ListProjectsAsync", - pathTemplate: "\"/v1/projects\"", + pathTemplate: "\"/projects\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -262,7 +289,7 @@ partial void ProcessListProjectsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ListProjects", methodName: "ListProjectsAsync", - pathTemplate: "\"/v1/projects\"", + pathTemplate: "\"/projects\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -310,7 +337,7 @@ partial void ProcessListProjectsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ListProjects", methodName: "ListProjectsAsync", - pathTemplate: "\"/v1/projects\"", + pathTemplate: "\"/projects\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -332,7 +359,7 @@ partial void ProcessListProjectsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ListProjects", methodName: "ListProjectsAsync", - pathTemplate: "\"/v1/projects\"", + pathTemplate: "\"/projects\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.ProjectsClient.g.cs b/src/libs/Together/Generated/Together.ProjectsClient.g.cs index c0ed8a39..66d563a9 100644 --- a/src/libs/Together/Generated/Together.ProjectsClient.g.cs +++ b/src/libs/Together/Generated/Together.ProjectsClient.g.cs @@ -12,7 +12,7 @@ public sealed partial class ProjectsClient : global::Together.IProjectsClient, g /// /// Default environment for APIs /// - public const string DefaultBaseUrl = "https://api.together.ai/"; + public const string DefaultBaseUrl = "https://api.together.ai/v1"; private bool _disposeHttpClient = true; @@ -20,7 +20,7 @@ public sealed partial class ProjectsClient : global::Together.IProjectsClient, g 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; } @@ -53,6 +53,34 @@ public sealed partial class ProjectsClient : global::Together.IProjectsClient, g } + + 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 ProjectsClient. /// If no httpClient is provided, a new one will be created. @@ -151,5 +179,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.Queue.JsonSerializerContext.g.cs b/src/libs/Together/Generated/Together.Queue.JsonSerializerContext.g.cs index 6de5630e..07f8e278 100644 --- a/src/libs/Together/Generated/Together.Queue.JsonSerializerContext.g.cs +++ b/src/libs/Together/Generated/Together.Queue.JsonSerializerContext.g.cs @@ -2,42 +2,7 @@ #nullable enable namespace Together -{ - /// - /// - /// - [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( - DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull - )] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(object))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.QueueError))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.QueueMetricsResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.QueueCancelRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.QueueCancelResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.QueueCancelResponseStatus), TypeInfoPropertyName = "QueueCancelResponseStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.QueueClearRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.QueueClearResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.QueueJobRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.QueueJobResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.QueueJobStatusResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.QueueJobStatusResponseStatus), TypeInfoPropertyName = "QueueJobStatusResponseStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.QueueCancelResponseStatus?), TypeInfoPropertyName = "NullableQueueCancelResponseStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.QueueJobStatusResponseStatus?), TypeInfoPropertyName = "NullableQueueJobStatusResponseStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - internal sealed partial class QueueSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext - { - } - /// +{ /// /// /// public sealed partial class QueueSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext @@ -81,26 +46,7 @@ private QueueSourceGenerationContext(global::System.Text.Json.JsonSerializerOpti [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) { - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter, global::System.Collections.Generic.IList>()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter>()); - options.Converters.Add(new global::Together.JsonConverters.UnixTimestampJsonConverter()); - options.Converters.Add(new LazyEnumJsonConverterFactory()); + global::Together.SourceGenerationContext.AddConverters(options); } private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() @@ -115,48 +61,6 @@ public static void AddConverters(global::System.Text.Json.JsonSerializerOptions return options; } - - private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Serialization.JsonConverterFactory - { - public override bool CanConvert(global::System.Type typeToConvert) - { - return - typeToConvert == typeof(global::Together.QueueCancelResponseStatus) - - || typeToConvert == typeof(global::Together.QueueCancelResponseStatus?) - - || typeToConvert == typeof(global::Together.QueueJobStatusResponseStatus) - - || typeToConvert == typeof(global::Together.QueueJobStatusResponseStatus?); - } - - public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - if (typeToConvert == typeof(global::Together.QueueCancelResponseStatus)) - { - return new global::Together.JsonConverters.QueueCancelResponseStatusJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.QueueCancelResponseStatus?)) - { - return new global::Together.JsonConverters.QueueCancelResponseStatusNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.QueueJobStatusResponseStatus)) - { - return new global::Together.JsonConverters.QueueJobStatusResponseStatusJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.QueueJobStatusResponseStatus?)) - { - return new global::Together.JsonConverters.QueueJobStatusResponseStatusNullableJsonConverter(); - } - throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); - } - } - private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver { private readonly object _gate = new(); @@ -196,7 +100,7 @@ private sealed class LazyChunkResolver : global::System.Text.Json.Serialization. { return index switch { - 0 => new QueueSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), + 0 => global::Together.SourceGenerationContext.TypeInfoResolver, _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), }; } diff --git a/src/libs/Together/Generated/Together.QueueClient.CancelQueueJob.g.cs b/src/libs/Together/Generated/Together.QueueClient.CancelQueueJob.g.cs index d23abf63..fdd88277 100644 --- a/src/libs/Together/Generated/Together.QueueClient.CancelQueueJob.g.cs +++ b/src/libs/Together/Generated/Together.QueueClient.CancelQueueJob.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class QueueClient { + private static readonly global::Together.AutoSDKServer[] s_CancelQueueJobServers = 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_CancelQueueJobSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -52,6 +65,15 @@ partial void ProcessCancelQueueJobResponseContent( /// 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()
+ /// job = client.beta.jig.queue.cancel(
+ /// model="my-deployment",
+ /// request_id="req_abc123",
+ /// )
+ /// print(job.status) + ///
public async global::System.Threading.Tasks.Task CancelQueueJobAsync( global::Together.QueueCancelRequest request, @@ -78,6 +100,15 @@ partial void ProcessCancelQueueJobResponseContent( /// 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()
+ /// job = client.beta.jig.queue.cancel(
+ /// model="my-deployment",
+ /// request_id="req_abc123",
+ /// )
+ /// print(job.status) + ///
public async global::System.Threading.Tasks.Task> CancelQueueJobAsResponseAsync( global::Together.QueueCancelRequest request, @@ -116,8 +147,10 @@ partial void ProcessCancelQueueJobResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: "/v1/queue/cancel", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: "/queue/cancel", + baseUri: ResolveBaseUri( + servers: s_CancelQueueJobServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -183,7 +216,7 @@ partial void ProcessCancelQueueJobResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "CancelQueueJob", methodName: "CancelQueueJobAsync", - pathTemplate: "\"/v1/queue/cancel\"", + pathTemplate: "\"/queue/cancel\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -217,7 +250,7 @@ partial void ProcessCancelQueueJobResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "CancelQueueJob", methodName: "CancelQueueJobAsync", - pathTemplate: "\"/v1/queue/cancel\"", + pathTemplate: "\"/queue/cancel\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -258,7 +291,7 @@ partial void ProcessCancelQueueJobResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "CancelQueueJob", methodName: "CancelQueueJobAsync", - pathTemplate: "\"/v1/queue/cancel\"", + pathTemplate: "\"/queue/cancel\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -306,7 +339,7 @@ partial void ProcessCancelQueueJobResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "CancelQueueJob", methodName: "CancelQueueJobAsync", - pathTemplate: "\"/v1/queue/cancel\"", + pathTemplate: "\"/queue/cancel\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -328,7 +361,7 @@ partial void ProcessCancelQueueJobResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "CancelQueueJob", methodName: "CancelQueueJobAsync", - pathTemplate: "\"/v1/queue/cancel\"", + pathTemplate: "\"/queue/cancel\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.QueueClient.ClearQueue.g.cs b/src/libs/Together/Generated/Together.QueueClient.ClearQueue.g.cs index 20081eec..1811f9aa 100644 --- a/src/libs/Together/Generated/Together.QueueClient.ClearQueue.g.cs +++ b/src/libs/Together/Generated/Together.QueueClient.ClearQueue.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class QueueClient { + private static readonly global::Together.AutoSDKServer[] s_ClearQueueServers = 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_ClearQueueSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -49,6 +62,12 @@ partial void ProcessClearQueueResponseContent( /// 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()
+ /// result = client.beta.jig.queue.clear(model="my-deployment")
+ /// print(result) + ///
public async global::System.Threading.Tasks.Task ClearQueueAsync( global::Together.QueueClearRequest request, @@ -72,6 +91,12 @@ partial void ProcessClearQueueResponseContent( /// 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()
+ /// result = client.beta.jig.queue.clear(model="my-deployment")
+ /// print(result) + ///
public async global::System.Threading.Tasks.Task> ClearQueueAsResponseAsync( global::Together.QueueClearRequest request, @@ -110,8 +135,10 @@ partial void ProcessClearQueueResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: "/v1/queue/clear", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: "/queue/clear", + baseUri: ResolveBaseUri( + servers: s_ClearQueueServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -177,7 +204,7 @@ partial void ProcessClearQueueResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ClearQueue", methodName: "ClearQueueAsync", - pathTemplate: "\"/v1/queue/clear\"", + pathTemplate: "\"/queue/clear\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -211,7 +238,7 @@ partial void ProcessClearQueueResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ClearQueue", methodName: "ClearQueueAsync", - pathTemplate: "\"/v1/queue/clear\"", + pathTemplate: "\"/queue/clear\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -252,7 +279,7 @@ partial void ProcessClearQueueResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ClearQueue", methodName: "ClearQueueAsync", - pathTemplate: "\"/v1/queue/clear\"", + pathTemplate: "\"/queue/clear\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -300,7 +327,7 @@ partial void ProcessClearQueueResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ClearQueue", methodName: "ClearQueueAsync", - pathTemplate: "\"/v1/queue/clear\"", + pathTemplate: "\"/queue/clear\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -322,7 +349,7 @@ partial void ProcessClearQueueResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ClearQueue", methodName: "ClearQueueAsync", - pathTemplate: "\"/v1/queue/clear\"", + pathTemplate: "\"/queue/clear\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.QueueClient.GetQueueJobStatus.g.cs b/src/libs/Together/Generated/Together.QueueClient.GetQueueJobStatus.g.cs index e00d2d88..174bea9b 100644 --- a/src/libs/Together/Generated/Together.QueueClient.GetQueueJobStatus.g.cs +++ b/src/libs/Together/Generated/Together.QueueClient.GetQueueJobStatus.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class QueueClient { + private static readonly global::Together.AutoSDKServer[] s_GetQueueJobStatusServers = 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_GetQueueJobStatusSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -56,6 +69,15 @@ partial void ProcessGetQueueJobStatusResponseContent( /// 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()
+ /// job = client.beta.jig.queue.retrieve(
+ /// model="my-deployment",
+ /// request_id="req_abc123",
+ /// )
+ /// print(job.status) + ///
public async global::System.Threading.Tasks.Task GetQueueJobStatusAsync( string requestId, string model, @@ -84,6 +106,15 @@ partial void ProcessGetQueueJobStatusResponseContent( /// 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()
+ /// job = client.beta.jig.queue.retrieve(
+ /// model="my-deployment",
+ /// request_id="req_abc123",
+ /// )
+ /// print(job.status) + ///
public async global::System.Threading.Tasks.Task> GetQueueJobStatusAsResponseAsync( string requestId, string model, @@ -121,8 +152,10 @@ partial void ProcessGetQueueJobStatusResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: "/v1/queue/status", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: "/queue/status", + baseUri: ResolveBaseUri( + servers: s_GetQueueJobStatusServers, + defaultBaseUrl: "https://api.together.ai/v1")); __pathBuilder .AddRequiredParameter("request_id", requestId) .AddRequiredParameter("model", model) @@ -187,7 +220,7 @@ partial void ProcessGetQueueJobStatusResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetQueueJobStatus", methodName: "GetQueueJobStatusAsync", - pathTemplate: "\"/v1/queue/status\"", + pathTemplate: "\"/queue/status\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -221,7 +254,7 @@ partial void ProcessGetQueueJobStatusResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetQueueJobStatus", methodName: "GetQueueJobStatusAsync", - pathTemplate: "\"/v1/queue/status\"", + pathTemplate: "\"/queue/status\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -262,7 +295,7 @@ partial void ProcessGetQueueJobStatusResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetQueueJobStatus", methodName: "GetQueueJobStatusAsync", - pathTemplate: "\"/v1/queue/status\"", + pathTemplate: "\"/queue/status\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -310,7 +343,7 @@ partial void ProcessGetQueueJobStatusResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetQueueJobStatus", methodName: "GetQueueJobStatusAsync", - pathTemplate: "\"/v1/queue/status\"", + pathTemplate: "\"/queue/status\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -332,7 +365,7 @@ partial void ProcessGetQueueJobStatusResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetQueueJobStatus", methodName: "GetQueueJobStatusAsync", - pathTemplate: "\"/v1/queue/status\"", + pathTemplate: "\"/queue/status\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.QueueClient.GetQueueMetrics.g.cs b/src/libs/Together/Generated/Together.QueueClient.GetQueueMetrics.g.cs index 7aff0c13..51484726 100644 --- a/src/libs/Together/Generated/Together.QueueClient.GetQueueMetrics.g.cs +++ b/src/libs/Together/Generated/Together.QueueClient.GetQueueMetrics.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class QueueClient { + private static readonly global::Together.AutoSDKServer[] s_GetQueueMetricsServers = 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_GetQueueMetricsSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -51,6 +64,12 @@ partial void ProcessGetQueueMetricsResponseContent( /// 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()
+ /// metrics = client.beta.jig.queue.metrics(model="my-deployment")
+ /// print(metrics) + ///
public async global::System.Threading.Tasks.Task GetQueueMetricsAsync( string model, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -74,6 +93,12 @@ partial void ProcessGetQueueMetricsResponseContent( /// 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()
+ /// metrics = client.beta.jig.queue.metrics(model="my-deployment")
+ /// print(metrics) + ///
public async global::System.Threading.Tasks.Task> GetQueueMetricsAsResponseAsync( string model, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -109,8 +134,10 @@ partial void ProcessGetQueueMetricsResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: "/v1/queue/metrics", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: "/queue/metrics", + baseUri: ResolveBaseUri( + servers: s_GetQueueMetricsServers, + defaultBaseUrl: "https://api.together.ai/v1")); __pathBuilder .AddRequiredParameter("model", model) ; @@ -173,7 +200,7 @@ partial void ProcessGetQueueMetricsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetQueueMetrics", methodName: "GetQueueMetricsAsync", - pathTemplate: "\"/v1/queue/metrics\"", + pathTemplate: "\"/queue/metrics\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -207,7 +234,7 @@ partial void ProcessGetQueueMetricsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetQueueMetrics", methodName: "GetQueueMetricsAsync", - pathTemplate: "\"/v1/queue/metrics\"", + pathTemplate: "\"/queue/metrics\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -248,7 +275,7 @@ partial void ProcessGetQueueMetricsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetQueueMetrics", methodName: "GetQueueMetricsAsync", - pathTemplate: "\"/v1/queue/metrics\"", + pathTemplate: "\"/queue/metrics\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -296,7 +323,7 @@ partial void ProcessGetQueueMetricsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetQueueMetrics", methodName: "GetQueueMetricsAsync", - pathTemplate: "\"/v1/queue/metrics\"", + pathTemplate: "\"/queue/metrics\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -318,7 +345,7 @@ partial void ProcessGetQueueMetricsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetQueueMetrics", methodName: "GetQueueMetricsAsync", - pathTemplate: "\"/v1/queue/metrics\"", + pathTemplate: "\"/queue/metrics\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.QueueClient.SubmitQueueJob.g.cs b/src/libs/Together/Generated/Together.QueueClient.SubmitQueueJob.g.cs index ba91d3b2..172a3232 100644 --- a/src/libs/Together/Generated/Together.QueueClient.SubmitQueueJob.g.cs +++ b/src/libs/Together/Generated/Together.QueueClient.SubmitQueueJob.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class QueueClient { + private static readonly global::Together.AutoSDKServer[] s_SubmitQueueJobServers = 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_SubmitQueueJobSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -52,6 +65,16 @@ partial void ProcessSubmitQueueJobResponseContent( /// 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()
+ /// job = client.beta.jig.queue.submit(
+ /// model="my-deployment",
+ /// payload={"prompt": "A cat playing piano"},
+ /// priority=1,
+ /// )
+ /// print(job.request_id) + ///
public async global::System.Threading.Tasks.Task SubmitQueueJobAsync( global::Together.QueueJobRequest request, @@ -78,6 +101,16 @@ partial void ProcessSubmitQueueJobResponseContent( /// 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()
+ /// job = client.beta.jig.queue.submit(
+ /// model="my-deployment",
+ /// payload={"prompt": "A cat playing piano"},
+ /// priority=1,
+ /// )
+ /// print(job.request_id) + ///
public async global::System.Threading.Tasks.Task> SubmitQueueJobAsResponseAsync( global::Together.QueueJobRequest request, @@ -116,8 +149,10 @@ partial void ProcessSubmitQueueJobResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: "/v1/queue/submit", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: "/queue/submit", + baseUri: ResolveBaseUri( + servers: s_SubmitQueueJobServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -183,7 +218,7 @@ partial void ProcessSubmitQueueJobResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "SubmitQueueJob", methodName: "SubmitQueueJobAsync", - pathTemplate: "\"/v1/queue/submit\"", + pathTemplate: "\"/queue/submit\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -217,7 +252,7 @@ partial void ProcessSubmitQueueJobResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "SubmitQueueJob", methodName: "SubmitQueueJobAsync", - pathTemplate: "\"/v1/queue/submit\"", + pathTemplate: "\"/queue/submit\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -258,7 +293,7 @@ partial void ProcessSubmitQueueJobResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "SubmitQueueJob", methodName: "SubmitQueueJobAsync", - pathTemplate: "\"/v1/queue/submit\"", + pathTemplate: "\"/queue/submit\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -306,7 +341,7 @@ partial void ProcessSubmitQueueJobResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "SubmitQueueJob", methodName: "SubmitQueueJobAsync", - pathTemplate: "\"/v1/queue/submit\"", + pathTemplate: "\"/queue/submit\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -328,7 +363,7 @@ partial void ProcessSubmitQueueJobResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "SubmitQueueJob", methodName: "SubmitQueueJobAsync", - pathTemplate: "\"/v1/queue/submit\"", + pathTemplate: "\"/queue/submit\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.QueueClient.g.cs b/src/libs/Together/Generated/Together.QueueClient.g.cs index 75f791fa..fb1d05ad 100644 --- a/src/libs/Together/Generated/Together.QueueClient.g.cs +++ b/src/libs/Together/Generated/Together.QueueClient.g.cs @@ -12,7 +12,7 @@ public sealed partial class QueueClient : global::Together.IQueueClient, global: /// /// Default environment for APIs /// - public const string DefaultBaseUrl = "https://api.together.ai/"; + public const string DefaultBaseUrl = "https://api.together.ai/v1"; private bool _disposeHttpClient = true; @@ -20,7 +20,7 @@ public sealed partial class QueueClient : global::Together.IQueueClient, 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; } @@ -53,6 +53,34 @@ public sealed partial class QueueClient : global::Together.IQueueClient, global: } + + 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 QueueClient. /// If no httpClient is provided, a new one will be created. @@ -151,5 +179,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.RegionService.JsonSerializerContext.g.cs b/src/libs/Together/Generated/Together.RegionService.JsonSerializerContext.g.cs index ac49e38a..31f5cd21 100644 --- a/src/libs/Together/Generated/Together.RegionService.JsonSerializerContext.g.cs +++ b/src/libs/Together/Generated/Together.RegionService.JsonSerializerContext.g.cs @@ -2,31 +2,7 @@ #nullable enable namespace Together -{ - /// - /// - /// - [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( - DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull - )] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RegionListResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RegionListResponseRegion))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ClusterDriverVersionInfo))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - internal sealed partial class RegionServiceSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext - { - } - /// +{ /// /// /// public sealed partial class RegionServiceSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext @@ -70,25 +46,7 @@ private RegionServiceSourceGenerationContext(global::System.Text.Json.JsonSerial [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) { - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter, global::System.Collections.Generic.IList>()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter>()); - options.Converters.Add(new global::Together.JsonConverters.UnixTimestampJsonConverter()); + global::Together.SourceGenerationContext.AddConverters(options); } private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() @@ -142,7 +100,7 @@ private sealed class LazyChunkResolver : global::System.Text.Json.Serialization. { return index switch { - 0 => new RegionServiceSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), + 0 => global::Together.SourceGenerationContext.TypeInfoResolver, _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), }; } diff --git a/src/libs/Together/Generated/Together.RegionServiceClient.RegionServiceList.g.cs b/src/libs/Together/Generated/Together.RegionServiceClient.RegionServiceList.g.cs index 35fb2564..d61ee937 100644 --- a/src/libs/Together/Generated/Together.RegionServiceClient.RegionServiceList.g.cs +++ b/src/libs/Together/Generated/Together.RegionServiceClient.RegionServiceList.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class RegionServiceClient { + private static readonly global::Together.AutoSDKServer[] s_RegionServiceListServers = 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_RegionServiceListSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -45,6 +58,12 @@ partial void ProcessRegionServiceListResponseContent( /// 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()
+ /// regions = client.beta.clusters.list_regions()
+ /// print(regions) + ///
public async global::System.Threading.Tasks.Task RegionServiceListAsync( global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -62,6 +81,12 @@ partial void ProcessRegionServiceListResponseContent( /// 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()
+ /// regions = client.beta.clusters.list_regions()
+ /// print(regions) + ///
public async global::System.Threading.Tasks.Task> RegionServiceListAsResponseAsync( global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -95,8 +120,10 @@ partial void ProcessRegionServiceListResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: "/v1/compute/regions", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: "/compute/regions", + baseUri: ResolveBaseUri( + servers: s_RegionServiceListServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -155,7 +182,7 @@ partial void ProcessRegionServiceListResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RegionServiceList", methodName: "RegionServiceListAsync", - pathTemplate: "\"/v1/compute/regions\"", + pathTemplate: "\"/compute/regions\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -189,7 +216,7 @@ partial void ProcessRegionServiceListResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RegionServiceList", methodName: "RegionServiceListAsync", - pathTemplate: "\"/v1/compute/regions\"", + pathTemplate: "\"/compute/regions\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -230,7 +257,7 @@ partial void ProcessRegionServiceListResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RegionServiceList", methodName: "RegionServiceListAsync", - pathTemplate: "\"/v1/compute/regions\"", + pathTemplate: "\"/compute/regions\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -278,7 +305,7 @@ partial void ProcessRegionServiceListResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RegionServiceList", methodName: "RegionServiceListAsync", - pathTemplate: "\"/v1/compute/regions\"", + pathTemplate: "\"/compute/regions\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -300,7 +327,7 @@ partial void ProcessRegionServiceListResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RegionServiceList", methodName: "RegionServiceListAsync", - pathTemplate: "\"/v1/compute/regions\"", + pathTemplate: "\"/compute/regions\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.RegionServiceClient.g.cs b/src/libs/Together/Generated/Together.RegionServiceClient.g.cs index 539d961d..33ffcba5 100644 --- a/src/libs/Together/Generated/Together.RegionServiceClient.g.cs +++ b/src/libs/Together/Generated/Together.RegionServiceClient.g.cs @@ -12,7 +12,7 @@ public sealed partial class RegionServiceClient : global::Together.IRegionServic /// /// Default environment for APIs /// - public const string DefaultBaseUrl = "https://api.together.ai/"; + public const string DefaultBaseUrl = "https://api.together.ai/v1"; private bool _disposeHttpClient = true; @@ -20,7 +20,7 @@ public sealed partial class RegionServiceClient : global::Together.IRegionServic 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; } @@ -53,6 +53,34 @@ public sealed partial class RegionServiceClient : global::Together.IRegionServic } + + 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 RegionServiceClient. /// If no httpClient is provided, a new one will be created. @@ -151,5 +179,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.RemediationService.JsonSerializerContext.g.cs b/src/libs/Together/Generated/Together.RemediationService.JsonSerializerContext.g.cs index d663ab01..62e5c3e3 100644 --- a/src/libs/Together/Generated/Together.RemediationService.JsonSerializerContext.g.cs +++ b/src/libs/Together/Generated/Together.RemediationService.JsonSerializerContext.g.cs @@ -2,65 +2,7 @@ #nullable enable namespace Together -{ - /// - /// - /// - [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( - DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull - )] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.Remediation))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CommentBody))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ApproveRemediationRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ApproveRemediationRequestMode), TypeInfoPropertyName = "ApproveRemediationRequestMode2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ListRemediationsResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.PassiveHealthCheckAlert))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.PHCAnnotation))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.XidDetail))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.SlurmNodeUnavailableDetail))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.PassiveHealthCheckAlertSeverity), TypeInfoPropertyName = "PassiveHealthCheckAlertSeverity2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RemediationMode), TypeInfoPropertyName = "RemediationMode2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RemediationTrigger), TypeInfoPropertyName = "RemediationTrigger2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RemediationState), TypeInfoPropertyName = "RemediationState2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.XidEvent))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RemediationServiceListRemediationsStateItem), TypeInfoPropertyName = "RemediationServiceListRemediationsStateItem2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RemediationServiceListRemediationsTriggerItem), TypeInfoPropertyName = "RemediationServiceListRemediationsTriggerItem2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RemediationServiceListRemediationsModeItem), TypeInfoPropertyName = "RemediationServiceListRemediationsModeItem2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ApproveRemediationRequestMode?), TypeInfoPropertyName = "NullableApproveRemediationRequestMode2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.PassiveHealthCheckAlertSeverity?), TypeInfoPropertyName = "NullablePassiveHealthCheckAlertSeverity2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RemediationMode?), TypeInfoPropertyName = "NullableRemediationMode2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RemediationTrigger?), TypeInfoPropertyName = "NullableRemediationTrigger2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RemediationState?), TypeInfoPropertyName = "NullableRemediationState2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RemediationServiceListRemediationsStateItem?), TypeInfoPropertyName = "NullableRemediationServiceListRemediationsStateItem2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RemediationServiceListRemediationsTriggerItem?), TypeInfoPropertyName = "NullableRemediationServiceListRemediationsTriggerItem2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RemediationServiceListRemediationsModeItem?), TypeInfoPropertyName = "NullableRemediationServiceListRemediationsModeItem2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - internal sealed partial class RemediationServiceSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext - { - } - /// +{ /// /// /// public sealed partial class RemediationServiceSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext @@ -104,26 +46,7 @@ private RemediationServiceSourceGenerationContext(global::System.Text.Json.JsonS [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) { - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter, global::System.Collections.Generic.IList>()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter>()); - options.Converters.Add(new global::Together.JsonConverters.UnixTimestampJsonConverter()); - options.Converters.Add(new LazyEnumJsonConverterFactory()); + global::Together.SourceGenerationContext.AddConverters(options); } private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() @@ -138,132 +61,6 @@ public static void AddConverters(global::System.Text.Json.JsonSerializerOptions return options; } - - private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Serialization.JsonConverterFactory - { - public override bool CanConvert(global::System.Type typeToConvert) - { - return - typeToConvert == typeof(global::Together.ApproveRemediationRequestMode) - - || typeToConvert == typeof(global::Together.ApproveRemediationRequestMode?) - - || typeToConvert == typeof(global::Together.PassiveHealthCheckAlertSeverity) - - || typeToConvert == typeof(global::Together.PassiveHealthCheckAlertSeverity?) - - || typeToConvert == typeof(global::Together.RemediationMode) - - || typeToConvert == typeof(global::Together.RemediationMode?) - - || typeToConvert == typeof(global::Together.RemediationTrigger) - - || typeToConvert == typeof(global::Together.RemediationTrigger?) - - || typeToConvert == typeof(global::Together.RemediationState) - - || typeToConvert == typeof(global::Together.RemediationState?) - - || typeToConvert == typeof(global::Together.RemediationServiceListRemediationsStateItem) - - || typeToConvert == typeof(global::Together.RemediationServiceListRemediationsStateItem?) - - || typeToConvert == typeof(global::Together.RemediationServiceListRemediationsTriggerItem) - - || typeToConvert == typeof(global::Together.RemediationServiceListRemediationsTriggerItem?) - - || typeToConvert == typeof(global::Together.RemediationServiceListRemediationsModeItem) - - || typeToConvert == typeof(global::Together.RemediationServiceListRemediationsModeItem?); - } - - public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - if (typeToConvert == typeof(global::Together.ApproveRemediationRequestMode)) - { - return new global::Together.JsonConverters.ApproveRemediationRequestModeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.ApproveRemediationRequestMode?)) - { - return new global::Together.JsonConverters.ApproveRemediationRequestModeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.PassiveHealthCheckAlertSeverity)) - { - return new global::Together.JsonConverters.PassiveHealthCheckAlertSeverityJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.PassiveHealthCheckAlertSeverity?)) - { - return new global::Together.JsonConverters.PassiveHealthCheckAlertSeverityNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.RemediationMode)) - { - return new global::Together.JsonConverters.RemediationModeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.RemediationMode?)) - { - return new global::Together.JsonConverters.RemediationModeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.RemediationTrigger)) - { - return new global::Together.JsonConverters.RemediationTriggerJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.RemediationTrigger?)) - { - return new global::Together.JsonConverters.RemediationTriggerNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.RemediationState)) - { - return new global::Together.JsonConverters.RemediationStateJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.RemediationState?)) - { - return new global::Together.JsonConverters.RemediationStateNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.RemediationServiceListRemediationsStateItem)) - { - return new global::Together.JsonConverters.RemediationServiceListRemediationsStateItemJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.RemediationServiceListRemediationsStateItem?)) - { - return new global::Together.JsonConverters.RemediationServiceListRemediationsStateItemNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.RemediationServiceListRemediationsTriggerItem)) - { - return new global::Together.JsonConverters.RemediationServiceListRemediationsTriggerItemJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.RemediationServiceListRemediationsTriggerItem?)) - { - return new global::Together.JsonConverters.RemediationServiceListRemediationsTriggerItemNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.RemediationServiceListRemediationsModeItem)) - { - return new global::Together.JsonConverters.RemediationServiceListRemediationsModeItemJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.RemediationServiceListRemediationsModeItem?)) - { - return new global::Together.JsonConverters.RemediationServiceListRemediationsModeItemNullableJsonConverter(); - } - throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); - } - } - private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver { private readonly object _gate = new(); @@ -303,7 +100,7 @@ private sealed class LazyChunkResolver : global::System.Text.Json.Serialization. { return index switch { - 0 => new RemediationServiceSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), + 0 => global::Together.SourceGenerationContext.TypeInfoResolver, _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), }; } diff --git a/src/libs/Together/Generated/Together.RemediationServiceClient.RemediationServiceApproveRemediation.g.cs b/src/libs/Together/Generated/Together.RemediationServiceClient.RemediationServiceApproveRemediation.g.cs index 375b07e3..f5f3ec6e 100644 --- a/src/libs/Together/Generated/Together.RemediationServiceClient.RemediationServiceApproveRemediation.g.cs +++ b/src/libs/Together/Generated/Together.RemediationServiceClient.RemediationServiceApproveRemediation.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class RemediationServiceClient { + private static readonly global::Together.AutoSDKServer[] s_RemediationServiceApproveRemediationServers = 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_RemediationServiceApproveRemediationSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -61,6 +74,17 @@ partial void ProcessRemediationServiceApproveRemediationResponseContent( /// 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()
+ /// remediation = client.clusters.remediations.approve(
+ /// "<REMEDIATION_ID>",
+ /// cluster_id="<CLUSTER_ID>",
+ /// instance_id="<INSTANCE_ID>",
+ /// comment="Approved after checking the node",
+ /// )
+ /// print(remediation.state) + ///
public async global::System.Threading.Tasks.Task RemediationServiceApproveRemediationAsync( string clusterId, string instanceId, @@ -96,6 +120,17 @@ partial void ProcessRemediationServiceApproveRemediationResponseContent( /// 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()
+ /// remediation = client.clusters.remediations.approve(
+ /// "<REMEDIATION_ID>",
+ /// cluster_id="<CLUSTER_ID>",
+ /// instance_id="<INSTANCE_ID>",
+ /// comment="Approved after checking the node",
+ /// )
+ /// print(remediation.state) + ///
public async global::System.Threading.Tasks.Task> RemediationServiceApproveRemediationAsResponseAsync( string clusterId, string instanceId, @@ -140,8 +175,10 @@ partial void ProcessRemediationServiceApproveRemediationResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v1/compute/clusters/{clusterId}/instances/{instanceId}/remediations/{remediationId}/approve", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/compute/clusters/{clusterId}/instances/{instanceId}/remediations/{remediationId}/approve", + baseUri: ResolveBaseUri( + servers: s_RemediationServiceApproveRemediationServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -210,7 +247,7 @@ partial void ProcessRemediationServiceApproveRemediationResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RemediationServiceApproveRemediation", methodName: "RemediationServiceApproveRemediationAsync", - pathTemplate: "$\"/v1/compute/clusters/{clusterId}/instances/{instanceId}/remediations/{remediationId}/approve\"", + pathTemplate: "$\"/compute/clusters/{clusterId}/instances/{instanceId}/remediations/{remediationId}/approve\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -244,7 +281,7 @@ partial void ProcessRemediationServiceApproveRemediationResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RemediationServiceApproveRemediation", methodName: "RemediationServiceApproveRemediationAsync", - pathTemplate: "$\"/v1/compute/clusters/{clusterId}/instances/{instanceId}/remediations/{remediationId}/approve\"", + pathTemplate: "$\"/compute/clusters/{clusterId}/instances/{instanceId}/remediations/{remediationId}/approve\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -285,7 +322,7 @@ partial void ProcessRemediationServiceApproveRemediationResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RemediationServiceApproveRemediation", methodName: "RemediationServiceApproveRemediationAsync", - pathTemplate: "$\"/v1/compute/clusters/{clusterId}/instances/{instanceId}/remediations/{remediationId}/approve\"", + pathTemplate: "$\"/compute/clusters/{clusterId}/instances/{instanceId}/remediations/{remediationId}/approve\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -333,7 +370,7 @@ partial void ProcessRemediationServiceApproveRemediationResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RemediationServiceApproveRemediation", methodName: "RemediationServiceApproveRemediationAsync", - pathTemplate: "$\"/v1/compute/clusters/{clusterId}/instances/{instanceId}/remediations/{remediationId}/approve\"", + pathTemplate: "$\"/compute/clusters/{clusterId}/instances/{instanceId}/remediations/{remediationId}/approve\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -355,7 +392,7 @@ partial void ProcessRemediationServiceApproveRemediationResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RemediationServiceApproveRemediation", methodName: "RemediationServiceApproveRemediationAsync", - pathTemplate: "$\"/v1/compute/clusters/{clusterId}/instances/{instanceId}/remediations/{remediationId}/approve\"", + pathTemplate: "$\"/compute/clusters/{clusterId}/instances/{instanceId}/remediations/{remediationId}/approve\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.RemediationServiceClient.RemediationServiceCancelRemediation.g.cs b/src/libs/Together/Generated/Together.RemediationServiceClient.RemediationServiceCancelRemediation.g.cs index f1c6e65d..ab35232a 100644 --- a/src/libs/Together/Generated/Together.RemediationServiceClient.RemediationServiceCancelRemediation.g.cs +++ b/src/libs/Together/Generated/Together.RemediationServiceClient.RemediationServiceCancelRemediation.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class RemediationServiceClient { + private static readonly global::Together.AutoSDKServer[] s_RemediationServiceCancelRemediationServers = 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_RemediationServiceCancelRemediationSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -61,6 +74,16 @@ partial void ProcessRemediationServiceCancelRemediationResponseContent( /// 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()
+ /// remediation = client.clusters.remediations.cancel(
+ /// "<REMEDIATION_ID>",
+ /// cluster_id="<CLUSTER_ID>",
+ /// instance_id="<INSTANCE_ID>",
+ /// )
+ /// print(remediation.state) + ///
public async global::System.Threading.Tasks.Task RemediationServiceCancelRemediationAsync( string clusterId, string instanceId, @@ -94,6 +117,16 @@ partial void ProcessRemediationServiceCancelRemediationResponseContent( /// 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()
+ /// remediation = client.clusters.remediations.cancel(
+ /// "<REMEDIATION_ID>",
+ /// cluster_id="<CLUSTER_ID>",
+ /// instance_id="<INSTANCE_ID>",
+ /// )
+ /// print(remediation.state) + ///
public async global::System.Threading.Tasks.Task> RemediationServiceCancelRemediationAsResponseAsync( string clusterId, string instanceId, @@ -133,8 +166,10 @@ partial void ProcessRemediationServiceCancelRemediationResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v1/compute/clusters/{clusterId}/instances/{instanceId}/remediations/{remediationId}/cancel", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/compute/clusters/{clusterId}/instances/{instanceId}/remediations/{remediationId}/cancel", + baseUri: ResolveBaseUri( + servers: s_RemediationServiceCancelRemediationServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -196,7 +231,7 @@ partial void ProcessRemediationServiceCancelRemediationResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RemediationServiceCancelRemediation", methodName: "RemediationServiceCancelRemediationAsync", - pathTemplate: "$\"/v1/compute/clusters/{clusterId}/instances/{instanceId}/remediations/{remediationId}/cancel\"", + pathTemplate: "$\"/compute/clusters/{clusterId}/instances/{instanceId}/remediations/{remediationId}/cancel\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -230,7 +265,7 @@ partial void ProcessRemediationServiceCancelRemediationResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RemediationServiceCancelRemediation", methodName: "RemediationServiceCancelRemediationAsync", - pathTemplate: "$\"/v1/compute/clusters/{clusterId}/instances/{instanceId}/remediations/{remediationId}/cancel\"", + pathTemplate: "$\"/compute/clusters/{clusterId}/instances/{instanceId}/remediations/{remediationId}/cancel\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -271,7 +306,7 @@ partial void ProcessRemediationServiceCancelRemediationResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RemediationServiceCancelRemediation", methodName: "RemediationServiceCancelRemediationAsync", - pathTemplate: "$\"/v1/compute/clusters/{clusterId}/instances/{instanceId}/remediations/{remediationId}/cancel\"", + pathTemplate: "$\"/compute/clusters/{clusterId}/instances/{instanceId}/remediations/{remediationId}/cancel\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -319,7 +354,7 @@ partial void ProcessRemediationServiceCancelRemediationResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RemediationServiceCancelRemediation", methodName: "RemediationServiceCancelRemediationAsync", - pathTemplate: "$\"/v1/compute/clusters/{clusterId}/instances/{instanceId}/remediations/{remediationId}/cancel\"", + pathTemplate: "$\"/compute/clusters/{clusterId}/instances/{instanceId}/remediations/{remediationId}/cancel\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -341,7 +376,7 @@ partial void ProcessRemediationServiceCancelRemediationResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RemediationServiceCancelRemediation", methodName: "RemediationServiceCancelRemediationAsync", - pathTemplate: "$\"/v1/compute/clusters/{clusterId}/instances/{instanceId}/remediations/{remediationId}/cancel\"", + pathTemplate: "$\"/compute/clusters/{clusterId}/instances/{instanceId}/remediations/{remediationId}/cancel\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.RemediationServiceClient.RemediationServiceCreateRemediation.g.cs b/src/libs/Together/Generated/Together.RemediationServiceClient.RemediationServiceCreateRemediation.g.cs index b6bfbdc9..d43de065 100644 --- a/src/libs/Together/Generated/Together.RemediationServiceClient.RemediationServiceCreateRemediation.g.cs +++ b/src/libs/Together/Generated/Together.RemediationServiceClient.RemediationServiceCreateRemediation.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class RemediationServiceClient { + private static readonly global::Together.AutoSDKServer[] s_RemediationServiceCreateRemediationServers = 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_RemediationServiceCreateRemediationSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -63,6 +76,17 @@ partial void ProcessRemediationServiceCreateRemediationResponseContent( /// 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()
+ /// remediation = client.clusters.remediations.create(
+ /// "<INSTANCE_ID>",
+ /// cluster_id="<CLUSTER_ID>",
+ /// mode="REMEDIATION_MODE_VM_ONLY",
+ /// reason="Repeated GPU Xid errors",
+ /// )
+ /// print(remediation.id, remediation.state) + ///
public async global::System.Threading.Tasks.Task RemediationServiceCreateRemediationAsync( string clusterId, string instanceId, @@ -100,6 +124,17 @@ partial void ProcessRemediationServiceCreateRemediationResponseContent( /// 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()
+ /// remediation = client.clusters.remediations.create(
+ /// "<INSTANCE_ID>",
+ /// cluster_id="<CLUSTER_ID>",
+ /// mode="REMEDIATION_MODE_VM_ONLY",
+ /// reason="Repeated GPU Xid errors",
+ /// )
+ /// print(remediation.id, remediation.state) + ///
public async global::System.Threading.Tasks.Task> RemediationServiceCreateRemediationAsResponseAsync( string clusterId, string instanceId, @@ -144,8 +179,10 @@ partial void ProcessRemediationServiceCreateRemediationResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v1/compute/clusters/{clusterId}/instances/{instanceId}/remediations", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/compute/clusters/{clusterId}/instances/{instanceId}/remediations", + baseUri: ResolveBaseUri( + servers: s_RemediationServiceCreateRemediationServers, + defaultBaseUrl: "https://api.together.ai/v1")); __pathBuilder .AddOptionalParameter("remediation_id", remediationId) ; @@ -217,7 +254,7 @@ partial void ProcessRemediationServiceCreateRemediationResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RemediationServiceCreateRemediation", methodName: "RemediationServiceCreateRemediationAsync", - pathTemplate: "$\"/v1/compute/clusters/{clusterId}/instances/{instanceId}/remediations\"", + pathTemplate: "$\"/compute/clusters/{clusterId}/instances/{instanceId}/remediations\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -251,7 +288,7 @@ partial void ProcessRemediationServiceCreateRemediationResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RemediationServiceCreateRemediation", methodName: "RemediationServiceCreateRemediationAsync", - pathTemplate: "$\"/v1/compute/clusters/{clusterId}/instances/{instanceId}/remediations\"", + pathTemplate: "$\"/compute/clusters/{clusterId}/instances/{instanceId}/remediations\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -292,7 +329,7 @@ partial void ProcessRemediationServiceCreateRemediationResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RemediationServiceCreateRemediation", methodName: "RemediationServiceCreateRemediationAsync", - pathTemplate: "$\"/v1/compute/clusters/{clusterId}/instances/{instanceId}/remediations\"", + pathTemplate: "$\"/compute/clusters/{clusterId}/instances/{instanceId}/remediations\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -340,7 +377,7 @@ partial void ProcessRemediationServiceCreateRemediationResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RemediationServiceCreateRemediation", methodName: "RemediationServiceCreateRemediationAsync", - pathTemplate: "$\"/v1/compute/clusters/{clusterId}/instances/{instanceId}/remediations\"", + pathTemplate: "$\"/compute/clusters/{clusterId}/instances/{instanceId}/remediations\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -362,7 +399,7 @@ partial void ProcessRemediationServiceCreateRemediationResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RemediationServiceCreateRemediation", methodName: "RemediationServiceCreateRemediationAsync", - pathTemplate: "$\"/v1/compute/clusters/{clusterId}/instances/{instanceId}/remediations\"", + pathTemplate: "$\"/compute/clusters/{clusterId}/instances/{instanceId}/remediations\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.RemediationServiceClient.RemediationServiceGetRemediation.g.cs b/src/libs/Together/Generated/Together.RemediationServiceClient.RemediationServiceGetRemediation.g.cs index 29ca3511..db3233da 100644 --- a/src/libs/Together/Generated/Together.RemediationServiceClient.RemediationServiceGetRemediation.g.cs +++ b/src/libs/Together/Generated/Together.RemediationServiceClient.RemediationServiceGetRemediation.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class RemediationServiceClient { + private static readonly global::Together.AutoSDKServer[] s_RemediationServiceGetRemediationServers = 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_RemediationServiceGetRemediationSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -54,6 +67,16 @@ partial void ProcessRemediationServiceGetRemediationResponseContent( /// 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()
+ /// remediation = client.clusters.remediations.retrieve(
+ /// "<REMEDIATION_ID>",
+ /// cluster_id="<CLUSTER_ID>",
+ /// instance_id="<INSTANCE_ID>",
+ /// )
+ /// print(remediation.state) + ///
public async global::System.Threading.Tasks.Task RemediationServiceGetRemediationAsync( string clusterId, string instanceId, @@ -80,6 +103,16 @@ partial void ProcessRemediationServiceGetRemediationResponseContent( /// 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()
+ /// remediation = client.clusters.remediations.retrieve(
+ /// "<REMEDIATION_ID>",
+ /// cluster_id="<CLUSTER_ID>",
+ /// instance_id="<INSTANCE_ID>",
+ /// )
+ /// print(remediation.state) + ///
public async global::System.Threading.Tasks.Task> RemediationServiceGetRemediationAsResponseAsync( string clusterId, string instanceId, @@ -119,8 +152,10 @@ partial void ProcessRemediationServiceGetRemediationResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v1/compute/clusters/{clusterId}/instances/{instanceId}/remediations/{remediationId}", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/compute/clusters/{clusterId}/instances/{instanceId}/remediations/{remediationId}", + baseUri: ResolveBaseUri( + servers: s_RemediationServiceGetRemediationServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -182,7 +217,7 @@ partial void ProcessRemediationServiceGetRemediationResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RemediationServiceGetRemediation", methodName: "RemediationServiceGetRemediationAsync", - pathTemplate: "$\"/v1/compute/clusters/{clusterId}/instances/{instanceId}/remediations/{remediationId}\"", + pathTemplate: "$\"/compute/clusters/{clusterId}/instances/{instanceId}/remediations/{remediationId}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -216,7 +251,7 @@ partial void ProcessRemediationServiceGetRemediationResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RemediationServiceGetRemediation", methodName: "RemediationServiceGetRemediationAsync", - pathTemplate: "$\"/v1/compute/clusters/{clusterId}/instances/{instanceId}/remediations/{remediationId}\"", + pathTemplate: "$\"/compute/clusters/{clusterId}/instances/{instanceId}/remediations/{remediationId}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -257,7 +292,7 @@ partial void ProcessRemediationServiceGetRemediationResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RemediationServiceGetRemediation", methodName: "RemediationServiceGetRemediationAsync", - pathTemplate: "$\"/v1/compute/clusters/{clusterId}/instances/{instanceId}/remediations/{remediationId}\"", + pathTemplate: "$\"/compute/clusters/{clusterId}/instances/{instanceId}/remediations/{remediationId}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -305,7 +340,7 @@ partial void ProcessRemediationServiceGetRemediationResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RemediationServiceGetRemediation", methodName: "RemediationServiceGetRemediationAsync", - pathTemplate: "$\"/v1/compute/clusters/{clusterId}/instances/{instanceId}/remediations/{remediationId}\"", + pathTemplate: "$\"/compute/clusters/{clusterId}/instances/{instanceId}/remediations/{remediationId}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -327,7 +362,7 @@ partial void ProcessRemediationServiceGetRemediationResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RemediationServiceGetRemediation", methodName: "RemediationServiceGetRemediationAsync", - pathTemplate: "$\"/v1/compute/clusters/{clusterId}/instances/{instanceId}/remediations/{remediationId}\"", + pathTemplate: "$\"/compute/clusters/{clusterId}/instances/{instanceId}/remediations/{remediationId}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.RemediationServiceClient.RemediationServiceListRemediations.g.cs b/src/libs/Together/Generated/Together.RemediationServiceClient.RemediationServiceListRemediations.g.cs index cfdbb73f..02d0001e 100644 --- a/src/libs/Together/Generated/Together.RemediationServiceClient.RemediationServiceListRemediations.g.cs +++ b/src/libs/Together/Generated/Together.RemediationServiceClient.RemediationServiceListRemediations.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class RemediationServiceClient { + private static readonly global::Together.AutoSDKServer[] s_RemediationServiceListRemediationsServers = 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_RemediationServiceListRemediationsSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -94,6 +107,17 @@ partial void ProcessRemediationServiceListRemediationsResponseContent( /// 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()
+ /// # Pass "-" as the instance ID to list remediations across the cluster.
+ /// response = client.clusters.remediations.list(
+ /// "-",
+ /// cluster_id="<CLUSTER_ID>",
+ /// )
+ /// for remediation in response.remediations or []:
+ /// print(remediation.id, remediation.instance_id, remediation.state) + ///
public async global::System.Threading.Tasks.Task RemediationServiceListRemediationsAsync( string clusterId, string instanceId, @@ -160,6 +184,17 @@ partial void ProcessRemediationServiceListRemediationsResponseContent( /// 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()
+ /// # Pass "-" as the instance ID to list remediations across the cluster.
+ /// response = client.clusters.remediations.list(
+ /// "-",
+ /// cluster_id="<CLUSTER_ID>",
+ /// )
+ /// for remediation in response.remediations or []:
+ /// print(remediation.id, remediation.instance_id, remediation.state) + ///
public async global::System.Threading.Tasks.Task> RemediationServiceListRemediationsAsResponseAsync( string clusterId, string instanceId, @@ -209,8 +244,10 @@ partial void ProcessRemediationServiceListRemediationsResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v1/compute/clusters/{clusterId}/instances/{instanceId}/remediations", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/compute/clusters/{clusterId}/instances/{instanceId}/remediations", + baseUri: ResolveBaseUri( + servers: s_RemediationServiceListRemediationsServers, + defaultBaseUrl: "https://api.together.ai/v1")); __pathBuilder .AddOptionalParameter("page_size", pageSize?.ToString()) .AddOptionalParameter("page_token", pageToken) @@ -285,7 +322,7 @@ partial void ProcessRemediationServiceListRemediationsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RemediationServiceListRemediations", methodName: "RemediationServiceListRemediationsAsync", - pathTemplate: "$\"/v1/compute/clusters/{clusterId}/instances/{instanceId}/remediations\"", + pathTemplate: "$\"/compute/clusters/{clusterId}/instances/{instanceId}/remediations\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -319,7 +356,7 @@ partial void ProcessRemediationServiceListRemediationsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RemediationServiceListRemediations", methodName: "RemediationServiceListRemediationsAsync", - pathTemplate: "$\"/v1/compute/clusters/{clusterId}/instances/{instanceId}/remediations\"", + pathTemplate: "$\"/compute/clusters/{clusterId}/instances/{instanceId}/remediations\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -360,7 +397,7 @@ partial void ProcessRemediationServiceListRemediationsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RemediationServiceListRemediations", methodName: "RemediationServiceListRemediationsAsync", - pathTemplate: "$\"/v1/compute/clusters/{clusterId}/instances/{instanceId}/remediations\"", + pathTemplate: "$\"/compute/clusters/{clusterId}/instances/{instanceId}/remediations\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -408,7 +445,7 @@ partial void ProcessRemediationServiceListRemediationsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RemediationServiceListRemediations", methodName: "RemediationServiceListRemediationsAsync", - pathTemplate: "$\"/v1/compute/clusters/{clusterId}/instances/{instanceId}/remediations\"", + pathTemplate: "$\"/compute/clusters/{clusterId}/instances/{instanceId}/remediations\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -430,7 +467,7 @@ partial void ProcessRemediationServiceListRemediationsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RemediationServiceListRemediations", methodName: "RemediationServiceListRemediationsAsync", - pathTemplate: "$\"/v1/compute/clusters/{clusterId}/instances/{instanceId}/remediations\"", + pathTemplate: "$\"/compute/clusters/{clusterId}/instances/{instanceId}/remediations\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.RemediationServiceClient.RemediationServiceRejectRemediation.g.cs b/src/libs/Together/Generated/Together.RemediationServiceClient.RemediationServiceRejectRemediation.g.cs index 944288d5..4c446fa9 100644 --- a/src/libs/Together/Generated/Together.RemediationServiceClient.RemediationServiceRejectRemediation.g.cs +++ b/src/libs/Together/Generated/Together.RemediationServiceClient.RemediationServiceRejectRemediation.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class RemediationServiceClient { + private static readonly global::Together.AutoSDKServer[] s_RemediationServiceRejectRemediationServers = 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_RemediationServiceRejectRemediationSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -61,6 +74,17 @@ partial void ProcessRemediationServiceRejectRemediationResponseContent( /// 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()
+ /// remediation = client.clusters.remediations.reject(
+ /// "<REMEDIATION_ID>",
+ /// cluster_id="<CLUSTER_ID>",
+ /// instance_id="<INSTANCE_ID>",
+ /// comment="Node recovered on its own",
+ /// )
+ /// print(remediation.state) + ///
public async global::System.Threading.Tasks.Task RemediationServiceRejectRemediationAsync( string clusterId, string instanceId, @@ -96,6 +120,17 @@ partial void ProcessRemediationServiceRejectRemediationResponseContent( /// 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()
+ /// remediation = client.clusters.remediations.reject(
+ /// "<REMEDIATION_ID>",
+ /// cluster_id="<CLUSTER_ID>",
+ /// instance_id="<INSTANCE_ID>",
+ /// comment="Node recovered on its own",
+ /// )
+ /// print(remediation.state) + ///
public async global::System.Threading.Tasks.Task> RemediationServiceRejectRemediationAsResponseAsync( string clusterId, string instanceId, @@ -140,8 +175,10 @@ partial void ProcessRemediationServiceRejectRemediationResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v1/compute/clusters/{clusterId}/instances/{instanceId}/remediations/{remediationId}/reject", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/compute/clusters/{clusterId}/instances/{instanceId}/remediations/{remediationId}/reject", + baseUri: ResolveBaseUri( + servers: s_RemediationServiceRejectRemediationServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -210,7 +247,7 @@ partial void ProcessRemediationServiceRejectRemediationResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RemediationServiceRejectRemediation", methodName: "RemediationServiceRejectRemediationAsync", - pathTemplate: "$\"/v1/compute/clusters/{clusterId}/instances/{instanceId}/remediations/{remediationId}/reject\"", + pathTemplate: "$\"/compute/clusters/{clusterId}/instances/{instanceId}/remediations/{remediationId}/reject\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -244,7 +281,7 @@ partial void ProcessRemediationServiceRejectRemediationResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RemediationServiceRejectRemediation", methodName: "RemediationServiceRejectRemediationAsync", - pathTemplate: "$\"/v1/compute/clusters/{clusterId}/instances/{instanceId}/remediations/{remediationId}/reject\"", + pathTemplate: "$\"/compute/clusters/{clusterId}/instances/{instanceId}/remediations/{remediationId}/reject\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -285,7 +322,7 @@ partial void ProcessRemediationServiceRejectRemediationResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RemediationServiceRejectRemediation", methodName: "RemediationServiceRejectRemediationAsync", - pathTemplate: "$\"/v1/compute/clusters/{clusterId}/instances/{instanceId}/remediations/{remediationId}/reject\"", + pathTemplate: "$\"/compute/clusters/{clusterId}/instances/{instanceId}/remediations/{remediationId}/reject\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -333,7 +370,7 @@ partial void ProcessRemediationServiceRejectRemediationResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RemediationServiceRejectRemediation", methodName: "RemediationServiceRejectRemediationAsync", - pathTemplate: "$\"/v1/compute/clusters/{clusterId}/instances/{instanceId}/remediations/{remediationId}/reject\"", + pathTemplate: "$\"/compute/clusters/{clusterId}/instances/{instanceId}/remediations/{remediationId}/reject\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -355,7 +392,7 @@ partial void ProcessRemediationServiceRejectRemediationResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RemediationServiceRejectRemediation", methodName: "RemediationServiceRejectRemediationAsync", - pathTemplate: "$\"/v1/compute/clusters/{clusterId}/instances/{instanceId}/remediations/{remediationId}/reject\"", + pathTemplate: "$\"/compute/clusters/{clusterId}/instances/{instanceId}/remediations/{remediationId}/reject\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.RemediationServiceClient.g.cs b/src/libs/Together/Generated/Together.RemediationServiceClient.g.cs index c302e883..fdfc613b 100644 --- a/src/libs/Together/Generated/Together.RemediationServiceClient.g.cs +++ b/src/libs/Together/Generated/Together.RemediationServiceClient.g.cs @@ -12,7 +12,7 @@ public sealed partial class RemediationServiceClient : global::Together.IRemedia /// /// Default environment for APIs /// - public const string DefaultBaseUrl = "https://api.together.ai/"; + public const string DefaultBaseUrl = "https://api.together.ai/v1"; private bool _disposeHttpClient = true; @@ -20,7 +20,7 @@ public sealed partial class RemediationServiceClient : global::Together.IRemedia 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; } @@ -53,6 +53,34 @@ public sealed partial class RemediationServiceClient : global::Together.IRemedia } + + 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 RemediationServiceClient. /// If no httpClient is provided, a new one will be created. @@ -151,5 +179,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.Rerank.JsonSerializerContext.g.cs b/src/libs/Together/Generated/Together.Rerank.JsonSerializerContext.g.cs index 8252ba64..07a0ca71 100644 --- a/src/libs/Together/Generated/Together.Rerank.JsonSerializerContext.g.cs +++ b/src/libs/Together/Generated/Together.Rerank.JsonSerializerContext.g.cs @@ -2,48 +2,7 @@ #nullable enable namespace Together -{ - /// - /// - /// - [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( - DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull - )] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(double))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(object))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RerankRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AnyOf), TypeInfoPropertyName = "AnyOfRerankRequestModelString2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RerankRequestModel), TypeInfoPropertyName = "RerankRequestModel2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf, global::System.Collections.Generic.IList>), TypeInfoPropertyName = "OneOfIListObjectIListString2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RerankResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RerankResponseResult))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RerankResponseResultDocument))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.UsageData))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ErrorData))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ErrorDataError))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(double?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AnyOf?), TypeInfoPropertyName = "NullableAnyOfRerankRequestModelString2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RerankRequestModel?), TypeInfoPropertyName = "NullableRerankRequestModel2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf, global::System.Collections.Generic.IList>?), TypeInfoPropertyName = "NullableOneOfIListObjectIListString2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf, global::System.Collections.Generic.List>))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - internal sealed partial class RerankSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext - { - } - /// +{ /// /// /// public sealed partial class RerankSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext @@ -87,29 +46,7 @@ private RerankSourceGenerationContext(global::System.Text.Json.JsonSerializerOpt [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) { - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.AnyOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter, global::System.Collections.Generic.IList>()); - options.Converters.Add(new global::Together.JsonConverters.AllOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.AllOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter>()); - options.Converters.Add(new global::Together.JsonConverters.UnixTimestampJsonConverter()); - options.Converters.Add(new LazyEnumJsonConverterFactory()); + global::Together.SourceGenerationContext.AddConverters(options); } private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() @@ -124,34 +61,6 @@ public static void AddConverters(global::System.Text.Json.JsonSerializerOptions return options; } - - private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Serialization.JsonConverterFactory - { - public override bool CanConvert(global::System.Type typeToConvert) - { - return - typeToConvert == typeof(global::Together.RerankRequestModel) - - || typeToConvert == typeof(global::Together.RerankRequestModel?); - } - - public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - if (typeToConvert == typeof(global::Together.RerankRequestModel)) - { - return new global::Together.JsonConverters.RerankRequestModelJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.RerankRequestModel?)) - { - return new global::Together.JsonConverters.RerankRequestModelNullableJsonConverter(); - } - throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); - } - } - private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver { private readonly object _gate = new(); @@ -191,7 +100,7 @@ private sealed class LazyChunkResolver : global::System.Text.Json.Serialization. { return index switch { - 0 => new RerankSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), + 0 => global::Together.SourceGenerationContext.TypeInfoResolver, _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), }; } diff --git a/src/libs/Together/Generated/Together.RerankClient.Rerank.g.cs b/src/libs/Together/Generated/Together.RerankClient.Rerank.g.cs index dfde1982..1d8c6d3c 100644 --- a/src/libs/Together/Generated/Together.RerankClient.Rerank.g.cs +++ b/src/libs/Together/Generated/Together.RerankClient.Rerank.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class RerankClient { + private static readonly global::Together.AutoSDKServer[] s_RerankServers = 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_RerankSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -49,6 +62,40 @@ partial void ProcessRerankResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// documents = [
+ /// {
+ /// "title": "Llama",
+ /// "text": "The llama is a domesticated South American camelid, widely used as a meat and pack animal by Andean cultures since the pre-Columbian era."
+ /// },
+ /// {
+ /// "title": "Panda",
+ /// "text": "The giant panda (Ailuropoda melanoleuca), also known as the panda bear or simply panda, is a bear species endemic to China."
+ /// },
+ /// {
+ /// "title": "Guanaco",
+ /// "text": "The guanaco is a camelid native to South America, closely related to the llama. Guanacos are one of two wild South American camelids; the other species is the vicuña, which lives at higher elevations."
+ /// },
+ /// {
+ /// "title": "Wild Bactrian camel",
+ /// "text": "The wild Bactrian camel (Camelus ferus) is an endangered species of camel endemic to Northwest China and southwestern Mongolia."
+ /// }
+ /// ]
+ /// response = client.rerank.create(
+ /// model="mixedbread-ai/mxbai-rerank-large-v2",
+ /// query="What animals can I find near Peru?",
+ /// documents=documents,
+ /// )
+ /// for result in response.results:
+ /// print(f"Rank: {result.index + 1}")
+ /// print(f"Title: {documents[result.index]['title']}")
+ /// print(f"Text: {documents[result.index]['text']}") + ///
public async global::System.Threading.Tasks.Task RerankAsync( global::Together.RerankRequest request, @@ -72,6 +119,40 @@ partial void ProcessRerankResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// documents = [
+ /// {
+ /// "title": "Llama",
+ /// "text": "The llama is a domesticated South American camelid, widely used as a meat and pack animal by Andean cultures since the pre-Columbian era."
+ /// },
+ /// {
+ /// "title": "Panda",
+ /// "text": "The giant panda (Ailuropoda melanoleuca), also known as the panda bear or simply panda, is a bear species endemic to China."
+ /// },
+ /// {
+ /// "title": "Guanaco",
+ /// "text": "The guanaco is a camelid native to South America, closely related to the llama. Guanacos are one of two wild South American camelids; the other species is the vicuña, which lives at higher elevations."
+ /// },
+ /// {
+ /// "title": "Wild Bactrian camel",
+ /// "text": "The wild Bactrian camel (Camelus ferus) is an endangered species of camel endemic to Northwest China and southwestern Mongolia."
+ /// }
+ /// ]
+ /// response = client.rerank.create(
+ /// model="mixedbread-ai/mxbai-rerank-large-v2",
+ /// query="What animals can I find near Peru?",
+ /// documents=documents,
+ /// )
+ /// for result in response.results:
+ /// print(f"Rank: {result.index + 1}")
+ /// print(f"Title: {documents[result.index]['title']}")
+ /// print(f"Text: {documents[result.index]['text']}") + ///
public async global::System.Threading.Tasks.Task> RerankAsResponseAsync( global::Together.RerankRequest request, @@ -110,8 +191,10 @@ partial void ProcessRerankResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: "/v1/rerank", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: "/rerank", + baseUri: ResolveBaseUri( + servers: s_RerankServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -177,7 +260,7 @@ partial void ProcessRerankResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "Rerank", methodName: "RerankAsync", - pathTemplate: "\"/v1/rerank\"", + pathTemplate: "\"/rerank\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -211,7 +294,7 @@ partial void ProcessRerankResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "Rerank", methodName: "RerankAsync", - pathTemplate: "\"/v1/rerank\"", + pathTemplate: "\"/rerank\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -252,7 +335,7 @@ partial void ProcessRerankResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "Rerank", methodName: "RerankAsync", - pathTemplate: "\"/v1/rerank\"", + pathTemplate: "\"/rerank\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -300,7 +383,7 @@ partial void ProcessRerankResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "Rerank", methodName: "RerankAsync", - pathTemplate: "\"/v1/rerank\"", + pathTemplate: "\"/rerank\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -322,7 +405,7 @@ partial void ProcessRerankResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "Rerank", methodName: "RerankAsync", - pathTemplate: "\"/v1/rerank\"", + pathTemplate: "\"/rerank\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.RerankClient.g.cs b/src/libs/Together/Generated/Together.RerankClient.g.cs index f95a2132..dc9ab197 100644 --- a/src/libs/Together/Generated/Together.RerankClient.g.cs +++ b/src/libs/Together/Generated/Together.RerankClient.g.cs @@ -12,7 +12,7 @@ public sealed partial class RerankClient : global::Together.IRerankClient, globa /// /// Default environment for APIs /// - public const string DefaultBaseUrl = "https://api.together.ai/"; + public const string DefaultBaseUrl = "https://api.together.ai/v1"; private bool _disposeHttpClient = true; @@ -20,7 +20,7 @@ public sealed partial class RerankClient : global::Together.IRerankClient, globa 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; } @@ -53,6 +53,34 @@ public sealed partial class RerankClient : global::Together.IRerankClient, globa } + + 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 RerankClient. /// If no httpClient is provided, a new one will be created. @@ -151,5 +179,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.Rl.JsonSerializerContext.g.cs b/src/libs/Together/Generated/Together.Rl.JsonSerializerContext.g.cs index 90f83da3..b7be7e7f 100644 --- a/src/libs/Together/Generated/Together.Rl.JsonSerializerContext.g.cs +++ b/src/libs/Together/Generated/Together.Rl.JsonSerializerContext.g.cs @@ -2,212 +2,7 @@ #nullable enable namespace Together -{ - /// - /// - /// - [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( - DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull - )] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(double))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlOptimStepBody))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlAdamParams))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlMuonParams))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlWeightsSyncBody))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlWeightSyncType), TypeInfoPropertyName = "RlWeightSyncType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlSampleBody))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlModelInput))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlSamplingParams))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlForwardBackwardBody))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlTrainingSample))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlLossConfig))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlModelInputChunk))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf), TypeInfoPropertyName = "OneOfStringInt322")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlEncodedTextChunk))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlListMeta))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlModelFullModeConfig))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlModelLoraModeConfig))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlComputeConfig))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlComputeConfigGpuType), TypeInfoPropertyName = "RlComputeConfigGpuType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlComputeConfigCreateRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlComputeConfigCreateRequestGpuType), TypeInfoPropertyName = "RlComputeConfigCreateRequestGpuType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlModelResourcesStatus), TypeInfoPropertyName = "RlModelResourcesStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlModelResources))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlModelResourcesError))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlModelResourcesStatusDetails))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlOptimizerConfig))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(long))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlModelResourcesErrorCode), TypeInfoPropertyName = "RlModelResourcesErrorCode2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlCreateModelResourcesRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlModelResourcesEstimateCostResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlModelResourcesListResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlModelTrainerConfig))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlModelSamplingDefaults))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlModelGeneratorConfig))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlSupportedModelComputeConfig))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlSupportedModelComputeConfigGpuType), TypeInfoPropertyName = "RlSupportedModelComputeConfigGpuType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlSupportedModel))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlSupportedModelDefaultGpuType), TypeInfoPropertyName = "RlSupportedModelDefaultGpuType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList>))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlDType), TypeInfoPropertyName = "RlDType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlLossType), TypeInfoPropertyName = "RlLossType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlCrossEntropyLossParams))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlGRPOLossParams))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(float))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlGRPOLossAggregationType), TypeInfoPropertyName = "RlGRPOLossAggregationType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlGRPOLossRatioType), TypeInfoPropertyName = "RlGRPOLossRatioType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlPPOLossParams))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlCISPOLossParams))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlDROLossParams))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlDPPOLossParams))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlLossFnOutput))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlTensorData))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlTensorDataDtype), TypeInfoPropertyName = "RlTensorDataDtype2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlPolicyVersionSegment))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlPromptTopLogprobs))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlOptimStepOperation))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlTrainingOperationStatus), TypeInfoPropertyName = "RlTrainingOperationStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlOptimStepResult))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlTrainingOperationError))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlWeightsSyncOperation))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlWeightsSyncResult))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlSampleOperation))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlSampleBatchResult))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlSampleResult))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlSampledSequence))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlStopReason), TypeInfoPropertyName = "RlStopReason2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlForwardBackwardOperation))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlForwardBackwardResult))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlCustomForwardBackwardBody))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlTargetLogprobGradients))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlCustomForwardBackwardOperation))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlCustomForwardBackwardResult))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlTrainingOperationErrorCode), TypeInfoPropertyName = "RlTrainingOperationErrorCode2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlStartTrainingSessionRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlLoraConfig))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlTrainingSessionMetadata))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlUpdateTrainingSessionRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlTrainingSessionStatus), TypeInfoPropertyName = "RlTrainingSessionStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlTrainingSessionError))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlTrainingSessionErrorCode), TypeInfoPropertyName = "RlTrainingSessionErrorCode2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlWandbMetadata))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlSessionPolicyState))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlTrainingSession))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlInferenceCheckpoint))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlTrainingCheckpoint))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlTrainingSessionsListResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlSupportedModelsListResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlAdamConfig))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlMuonConfig))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlMuonScalingStrategy), TypeInfoPropertyName = "RlMuonScalingStrategy2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlInferenceCheckpointOperation))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlInferenceCheckpointResult))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlInferenceCheckpointRegistration))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlModelRegistryArtifact))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlTrainingCheckpointResult))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlTrainingCheckpointOperation))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlCheckpointsListResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlCheckpoint))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlCheckpointType), TypeInfoPropertyName = "RlCheckpointType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlCheckpointVariant), TypeInfoPropertyName = "RlCheckpointVariant2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlCheckpointFile))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf), TypeInfoPropertyName = "OneOfStringInt642")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlCheckpointDownloadResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ErrorData))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ErrorDataError))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ListModelResourcesStatu), TypeInfoPropertyName = "ListModelResourcesStatu2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ListTrainingSessionsStatu), TypeInfoPropertyName = "ListTrainingSessionsStatu2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ListCheckpointsType), TypeInfoPropertyName = "ListCheckpointsType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(double?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlWeightSyncType?), TypeInfoPropertyName = "NullableRlWeightSyncType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf?), TypeInfoPropertyName = "NullableOneOfStringInt322")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlComputeConfigGpuType?), TypeInfoPropertyName = "NullableRlComputeConfigGpuType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlComputeConfigCreateRequestGpuType?), TypeInfoPropertyName = "NullableRlComputeConfigCreateRequestGpuType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlModelResourcesStatus?), TypeInfoPropertyName = "NullableRlModelResourcesStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(long?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlModelResourcesErrorCode?), TypeInfoPropertyName = "NullableRlModelResourcesErrorCode2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlSupportedModelComputeConfigGpuType?), TypeInfoPropertyName = "NullableRlSupportedModelComputeConfigGpuType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlSupportedModelDefaultGpuType?), TypeInfoPropertyName = "NullableRlSupportedModelDefaultGpuType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlDType?), TypeInfoPropertyName = "NullableRlDType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlLossType?), TypeInfoPropertyName = "NullableRlLossType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(float?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlGRPOLossAggregationType?), TypeInfoPropertyName = "NullableRlGRPOLossAggregationType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlGRPOLossRatioType?), TypeInfoPropertyName = "NullableRlGRPOLossRatioType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlTensorDataDtype?), TypeInfoPropertyName = "NullableRlTensorDataDtype2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlTrainingOperationStatus?), TypeInfoPropertyName = "NullableRlTrainingOperationStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlStopReason?), TypeInfoPropertyName = "NullableRlStopReason2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlTrainingOperationErrorCode?), TypeInfoPropertyName = "NullableRlTrainingOperationErrorCode2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlTrainingSessionStatus?), TypeInfoPropertyName = "NullableRlTrainingSessionStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlTrainingSessionErrorCode?), TypeInfoPropertyName = "NullableRlTrainingSessionErrorCode2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlMuonScalingStrategy?), TypeInfoPropertyName = "NullableRlMuonScalingStrategy2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlCheckpointType?), TypeInfoPropertyName = "NullableRlCheckpointType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RlCheckpointVariant?), TypeInfoPropertyName = "NullableRlCheckpointVariant2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf?), TypeInfoPropertyName = "NullableOneOfStringInt642")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ListModelResourcesStatu?), TypeInfoPropertyName = "NullableListModelResourcesStatu2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ListTrainingSessionsStatu?), TypeInfoPropertyName = "NullableListTrainingSessionsStatu2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ListCheckpointsType?), TypeInfoPropertyName = "NullableListCheckpointsType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List>))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - internal sealed partial class RlSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext - { - } - /// +{ /// /// /// public sealed partial class RlSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext @@ -251,26 +46,7 @@ private RlSourceGenerationContext(global::System.Text.Json.JsonSerializerOptions [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) { - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter, global::System.Collections.Generic.IList>()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter>()); - options.Converters.Add(new global::Together.JsonConverters.UnixTimestampJsonConverter()); - options.Converters.Add(new LazyEnumJsonConverterFactory()); + global::Together.SourceGenerationContext.AddConverters(options); } private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() @@ -285,342 +61,6 @@ public static void AddConverters(global::System.Text.Json.JsonSerializerOptions return options; } - - private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Serialization.JsonConverterFactory - { - public override bool CanConvert(global::System.Type typeToConvert) - { - return - typeToConvert == typeof(global::Together.RlComputeConfigGpuType) - - || typeToConvert == typeof(global::Together.RlComputeConfigGpuType?) - - || typeToConvert == typeof(global::Together.RlComputeConfigCreateRequestGpuType) - - || typeToConvert == typeof(global::Together.RlComputeConfigCreateRequestGpuType?) - - || typeToConvert == typeof(global::Together.RlModelResourcesStatus) - - || typeToConvert == typeof(global::Together.RlModelResourcesStatus?) - - || typeToConvert == typeof(global::Together.RlModelResourcesErrorCode) - - || typeToConvert == typeof(global::Together.RlModelResourcesErrorCode?) - - || typeToConvert == typeof(global::Together.RlSupportedModelComputeConfigGpuType) - - || typeToConvert == typeof(global::Together.RlSupportedModelComputeConfigGpuType?) - - || typeToConvert == typeof(global::Together.RlSupportedModelDefaultGpuType) - - || typeToConvert == typeof(global::Together.RlSupportedModelDefaultGpuType?) - - || typeToConvert == typeof(global::Together.RlDType) - - || typeToConvert == typeof(global::Together.RlDType?) - - || typeToConvert == typeof(global::Together.RlLossType) - - || typeToConvert == typeof(global::Together.RlLossType?) - - || typeToConvert == typeof(global::Together.RlWeightSyncType) - - || typeToConvert == typeof(global::Together.RlWeightSyncType?) - - || typeToConvert == typeof(global::Together.RlGRPOLossAggregationType) - - || typeToConvert == typeof(global::Together.RlGRPOLossAggregationType?) - - || typeToConvert == typeof(global::Together.RlGRPOLossRatioType) - - || typeToConvert == typeof(global::Together.RlGRPOLossRatioType?) - - || typeToConvert == typeof(global::Together.RlTensorDataDtype) - - || typeToConvert == typeof(global::Together.RlTensorDataDtype?) - - || typeToConvert == typeof(global::Together.RlStopReason) - - || typeToConvert == typeof(global::Together.RlStopReason?) - - || typeToConvert == typeof(global::Together.RlTrainingOperationErrorCode) - - || typeToConvert == typeof(global::Together.RlTrainingOperationErrorCode?) - - || typeToConvert == typeof(global::Together.RlTrainingOperationStatus) - - || typeToConvert == typeof(global::Together.RlTrainingOperationStatus?) - - || typeToConvert == typeof(global::Together.RlTrainingSessionStatus) - - || typeToConvert == typeof(global::Together.RlTrainingSessionStatus?) - - || typeToConvert == typeof(global::Together.RlTrainingSessionErrorCode) - - || typeToConvert == typeof(global::Together.RlTrainingSessionErrorCode?) - - || typeToConvert == typeof(global::Together.RlMuonScalingStrategy) - - || typeToConvert == typeof(global::Together.RlMuonScalingStrategy?) - - || typeToConvert == typeof(global::Together.RlCheckpointType) - - || typeToConvert == typeof(global::Together.RlCheckpointType?) - - || typeToConvert == typeof(global::Together.RlCheckpointVariant) - - || typeToConvert == typeof(global::Together.RlCheckpointVariant?) - - || typeToConvert == typeof(global::Together.ListModelResourcesStatu) - - || typeToConvert == typeof(global::Together.ListModelResourcesStatu?) - - || typeToConvert == typeof(global::Together.ListTrainingSessionsStatu) - - || typeToConvert == typeof(global::Together.ListTrainingSessionsStatu?) - - || typeToConvert == typeof(global::Together.ListCheckpointsType) - - || typeToConvert == typeof(global::Together.ListCheckpointsType?); - } - - public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - if (typeToConvert == typeof(global::Together.RlComputeConfigGpuType)) - { - return new global::Together.JsonConverters.RlComputeConfigGpuTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.RlComputeConfigGpuType?)) - { - return new global::Together.JsonConverters.RlComputeConfigGpuTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.RlComputeConfigCreateRequestGpuType)) - { - return new global::Together.JsonConverters.RlComputeConfigCreateRequestGpuTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.RlComputeConfigCreateRequestGpuType?)) - { - return new global::Together.JsonConverters.RlComputeConfigCreateRequestGpuTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.RlModelResourcesStatus)) - { - return new global::Together.JsonConverters.RlModelResourcesStatusJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.RlModelResourcesStatus?)) - { - return new global::Together.JsonConverters.RlModelResourcesStatusNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.RlModelResourcesErrorCode)) - { - return new global::Together.JsonConverters.RlModelResourcesErrorCodeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.RlModelResourcesErrorCode?)) - { - return new global::Together.JsonConverters.RlModelResourcesErrorCodeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.RlSupportedModelComputeConfigGpuType)) - { - return new global::Together.JsonConverters.RlSupportedModelComputeConfigGpuTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.RlSupportedModelComputeConfigGpuType?)) - { - return new global::Together.JsonConverters.RlSupportedModelComputeConfigGpuTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.RlSupportedModelDefaultGpuType)) - { - return new global::Together.JsonConverters.RlSupportedModelDefaultGpuTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.RlSupportedModelDefaultGpuType?)) - { - return new global::Together.JsonConverters.RlSupportedModelDefaultGpuTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.RlDType)) - { - return new global::Together.JsonConverters.RlDTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.RlDType?)) - { - return new global::Together.JsonConverters.RlDTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.RlLossType)) - { - return new global::Together.JsonConverters.RlLossTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.RlLossType?)) - { - return new global::Together.JsonConverters.RlLossTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.RlWeightSyncType)) - { - return new global::Together.JsonConverters.RlWeightSyncTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.RlWeightSyncType?)) - { - return new global::Together.JsonConverters.RlWeightSyncTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.RlGRPOLossAggregationType)) - { - return new global::Together.JsonConverters.RlGRPOLossAggregationTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.RlGRPOLossAggregationType?)) - { - return new global::Together.JsonConverters.RlGRPOLossAggregationTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.RlGRPOLossRatioType)) - { - return new global::Together.JsonConverters.RlGRPOLossRatioTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.RlGRPOLossRatioType?)) - { - return new global::Together.JsonConverters.RlGRPOLossRatioTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.RlTensorDataDtype)) - { - return new global::Together.JsonConverters.RlTensorDataDtypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.RlTensorDataDtype?)) - { - return new global::Together.JsonConverters.RlTensorDataDtypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.RlStopReason)) - { - return new global::Together.JsonConverters.RlStopReasonJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.RlStopReason?)) - { - return new global::Together.JsonConverters.RlStopReasonNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.RlTrainingOperationErrorCode)) - { - return new global::Together.JsonConverters.RlTrainingOperationErrorCodeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.RlTrainingOperationErrorCode?)) - { - return new global::Together.JsonConverters.RlTrainingOperationErrorCodeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.RlTrainingOperationStatus)) - { - return new global::Together.JsonConverters.RlTrainingOperationStatusJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.RlTrainingOperationStatus?)) - { - return new global::Together.JsonConverters.RlTrainingOperationStatusNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.RlTrainingSessionStatus)) - { - return new global::Together.JsonConverters.RlTrainingSessionStatusJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.RlTrainingSessionStatus?)) - { - return new global::Together.JsonConverters.RlTrainingSessionStatusNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.RlTrainingSessionErrorCode)) - { - return new global::Together.JsonConverters.RlTrainingSessionErrorCodeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.RlTrainingSessionErrorCode?)) - { - return new global::Together.JsonConverters.RlTrainingSessionErrorCodeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.RlMuonScalingStrategy)) - { - return new global::Together.JsonConverters.RlMuonScalingStrategyJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.RlMuonScalingStrategy?)) - { - return new global::Together.JsonConverters.RlMuonScalingStrategyNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.RlCheckpointType)) - { - return new global::Together.JsonConverters.RlCheckpointTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.RlCheckpointType?)) - { - return new global::Together.JsonConverters.RlCheckpointTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.RlCheckpointVariant)) - { - return new global::Together.JsonConverters.RlCheckpointVariantJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.RlCheckpointVariant?)) - { - return new global::Together.JsonConverters.RlCheckpointVariantNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.ListModelResourcesStatu)) - { - return new global::Together.JsonConverters.ListModelResourcesStatuJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.ListModelResourcesStatu?)) - { - return new global::Together.JsonConverters.ListModelResourcesStatuNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.ListTrainingSessionsStatu)) - { - return new global::Together.JsonConverters.ListTrainingSessionsStatuJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.ListTrainingSessionsStatu?)) - { - return new global::Together.JsonConverters.ListTrainingSessionsStatuNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.ListCheckpointsType)) - { - return new global::Together.JsonConverters.ListCheckpointsTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.ListCheckpointsType?)) - { - return new global::Together.JsonConverters.ListCheckpointsTypeNullableJsonConverter(); - } - throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); - } - } - private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver { private readonly object _gate = new(); @@ -660,7 +100,7 @@ private sealed class LazyChunkResolver : global::System.Text.Json.Serialization. { return index switch { - 0 => new RlSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), + 0 => global::Together.SourceGenerationContext.TypeInfoResolver, _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), }; } diff --git a/src/libs/Together/Generated/Together.RlClient.CreateInferenceCheckpoint.g.cs b/src/libs/Together/Generated/Together.RlClient.CreateInferenceCheckpoint.g.cs index 2cfe8bf1..969f9d84 100644 --- a/src/libs/Together/Generated/Together.RlClient.CreateInferenceCheckpoint.g.cs +++ b/src/libs/Together/Generated/Together.RlClient.CreateInferenceCheckpoint.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class RlClient { + private static readonly global::Together.AutoSDKServer[] s_CreateInferenceCheckpointServers = 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_CreateInferenceCheckpointSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -56,6 +69,16 @@ partial void ProcessCreateInferenceCheckpointResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// import uuid
+ /// from together import Together
+ /// client = Together()
+ /// operation = client.post_training.operations.create_inference_checkpoint(
+ /// "<SESSION_ID>",
+ /// idempotency_key=str(uuid.uuid4()),
+ /// )
+ /// print(operation.id, operation.status) + ///
public async global::System.Threading.Tasks.Task CreateInferenceCheckpointAsync( string sessionId, string? idempotencyKey = default, @@ -84,6 +107,16 @@ partial void ProcessCreateInferenceCheckpointResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// import uuid
+ /// from together import Together
+ /// client = Together()
+ /// operation = client.post_training.operations.create_inference_checkpoint(
+ /// "<SESSION_ID>",
+ /// idempotency_key=str(uuid.uuid4()),
+ /// )
+ /// print(operation.id, operation.status) + ///
public async global::System.Threading.Tasks.Task> CreateInferenceCheckpointAsResponseAsync( string sessionId, string? idempotencyKey = default, @@ -121,8 +154,10 @@ partial void ProcessCreateInferenceCheckpointResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v1/rl/training-sessions/{sessionId}/operations/inference-checkpoint", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/rl/training-sessions/{sessionId}/operations/inference-checkpoint", + baseUri: ResolveBaseUri( + servers: s_CreateInferenceCheckpointServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -189,7 +224,7 @@ partial void ProcessCreateInferenceCheckpointResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "CreateInferenceCheckpoint", methodName: "CreateInferenceCheckpointAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}/operations/inference-checkpoint\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/inference-checkpoint\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -223,7 +258,7 @@ partial void ProcessCreateInferenceCheckpointResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "CreateInferenceCheckpoint", methodName: "CreateInferenceCheckpointAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}/operations/inference-checkpoint\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/inference-checkpoint\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -264,7 +299,7 @@ partial void ProcessCreateInferenceCheckpointResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "CreateInferenceCheckpoint", methodName: "CreateInferenceCheckpointAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}/operations/inference-checkpoint\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/inference-checkpoint\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -312,7 +347,7 @@ partial void ProcessCreateInferenceCheckpointResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "CreateInferenceCheckpoint", methodName: "CreateInferenceCheckpointAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}/operations/inference-checkpoint\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/inference-checkpoint\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -334,7 +369,7 @@ partial void ProcessCreateInferenceCheckpointResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "CreateInferenceCheckpoint", methodName: "CreateInferenceCheckpointAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}/operations/inference-checkpoint\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/inference-checkpoint\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.RlClient.CreateModelResources.g.cs b/src/libs/Together/Generated/Together.RlClient.CreateModelResources.g.cs index 169b615c..ba7fdf32 100644 --- a/src/libs/Together/Generated/Together.RlClient.CreateModelResources.g.cs +++ b/src/libs/Together/Generated/Together.RlClient.CreateModelResources.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class RlClient { + private static readonly global::Together.AutoSDKServer[] s_CreateModelResourcesServers = 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_CreateModelResourcesSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -49,6 +62,16 @@ partial void ProcessCreateModelResourcesResponseContent( /// 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()
+ /// resource = client.post_training.model_resources.create(
+ /// base_model="Qwen/Qwen3.5-9B",
+ /// lora_enabled=True,
+ /// compute_config={"gpu_type": "H100-80GB", "num_generator_replicas": 1},
+ /// )
+ /// print(resource.id, resource.status) + ///
public async global::System.Threading.Tasks.Task CreateModelResourcesAsync( global::Together.RlCreateModelResourcesRequest request, @@ -72,6 +95,16 @@ partial void ProcessCreateModelResourcesResponseContent( /// 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()
+ /// resource = client.post_training.model_resources.create(
+ /// base_model="Qwen/Qwen3.5-9B",
+ /// lora_enabled=True,
+ /// compute_config={"gpu_type": "H100-80GB", "num_generator_replicas": 1},
+ /// )
+ /// print(resource.id, resource.status) + ///
public async global::System.Threading.Tasks.Task> CreateModelResourcesAsResponseAsync( global::Together.RlCreateModelResourcesRequest request, @@ -110,8 +143,10 @@ partial void ProcessCreateModelResourcesResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: "/v1/rl/model-resources", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: "/rl/model-resources", + baseUri: ResolveBaseUri( + servers: s_CreateModelResourcesServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -177,7 +212,7 @@ partial void ProcessCreateModelResourcesResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "CreateModelResources", methodName: "CreateModelResourcesAsync", - pathTemplate: "\"/v1/rl/model-resources\"", + pathTemplate: "\"/rl/model-resources\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -211,7 +246,7 @@ partial void ProcessCreateModelResourcesResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "CreateModelResources", methodName: "CreateModelResourcesAsync", - pathTemplate: "\"/v1/rl/model-resources\"", + pathTemplate: "\"/rl/model-resources\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -252,7 +287,7 @@ partial void ProcessCreateModelResourcesResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "CreateModelResources", methodName: "CreateModelResourcesAsync", - pathTemplate: "\"/v1/rl/model-resources\"", + pathTemplate: "\"/rl/model-resources\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -300,7 +335,7 @@ partial void ProcessCreateModelResourcesResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "CreateModelResources", methodName: "CreateModelResourcesAsync", - pathTemplate: "\"/v1/rl/model-resources\"", + pathTemplate: "\"/rl/model-resources\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -322,7 +357,7 @@ partial void ProcessCreateModelResourcesResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "CreateModelResources", methodName: "CreateModelResourcesAsync", - pathTemplate: "\"/v1/rl/model-resources\"", + pathTemplate: "\"/rl/model-resources\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.RlClient.CreateTrainingCheckpoint.g.cs b/src/libs/Together/Generated/Together.RlClient.CreateTrainingCheckpoint.g.cs index 4ac2d17e..fdb73ff9 100644 --- a/src/libs/Together/Generated/Together.RlClient.CreateTrainingCheckpoint.g.cs +++ b/src/libs/Together/Generated/Together.RlClient.CreateTrainingCheckpoint.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class RlClient { + private static readonly global::Together.AutoSDKServer[] s_CreateTrainingCheckpointServers = 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_CreateTrainingCheckpointSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -56,6 +69,16 @@ partial void ProcessCreateTrainingCheckpointResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// import uuid
+ /// from together import Together
+ /// client = Together()
+ /// operation = client.post_training.operations.create_training_checkpoint(
+ /// "<SESSION_ID>",
+ /// idempotency_key=str(uuid.uuid4()),
+ /// )
+ /// print(operation.id, operation.status) + ///
public async global::System.Threading.Tasks.Task CreateTrainingCheckpointAsync( string sessionId, string? idempotencyKey = default, @@ -84,6 +107,16 @@ partial void ProcessCreateTrainingCheckpointResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// import uuid
+ /// from together import Together
+ /// client = Together()
+ /// operation = client.post_training.operations.create_training_checkpoint(
+ /// "<SESSION_ID>",
+ /// idempotency_key=str(uuid.uuid4()),
+ /// )
+ /// print(operation.id, operation.status) + ///
public async global::System.Threading.Tasks.Task> CreateTrainingCheckpointAsResponseAsync( string sessionId, string? idempotencyKey = default, @@ -121,8 +154,10 @@ partial void ProcessCreateTrainingCheckpointResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v1/rl/training-sessions/{sessionId}/operations/training-checkpoint", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/rl/training-sessions/{sessionId}/operations/training-checkpoint", + baseUri: ResolveBaseUri( + servers: s_CreateTrainingCheckpointServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -189,7 +224,7 @@ partial void ProcessCreateTrainingCheckpointResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "CreateTrainingCheckpoint", methodName: "CreateTrainingCheckpointAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}/operations/training-checkpoint\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/training-checkpoint\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -223,7 +258,7 @@ partial void ProcessCreateTrainingCheckpointResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "CreateTrainingCheckpoint", methodName: "CreateTrainingCheckpointAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}/operations/training-checkpoint\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/training-checkpoint\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -264,7 +299,7 @@ partial void ProcessCreateTrainingCheckpointResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "CreateTrainingCheckpoint", methodName: "CreateTrainingCheckpointAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}/operations/training-checkpoint\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/training-checkpoint\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -312,7 +347,7 @@ partial void ProcessCreateTrainingCheckpointResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "CreateTrainingCheckpoint", methodName: "CreateTrainingCheckpointAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}/operations/training-checkpoint\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/training-checkpoint\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -334,7 +369,7 @@ partial void ProcessCreateTrainingCheckpointResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "CreateTrainingCheckpoint", methodName: "CreateTrainingCheckpointAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}/operations/training-checkpoint\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/training-checkpoint\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.RlClient.CustomForwardBackward.g.cs b/src/libs/Together/Generated/Together.RlClient.CustomForwardBackward.g.cs index 917f5d18..5e63fa68 100644 --- a/src/libs/Together/Generated/Together.RlClient.CustomForwardBackward.g.cs +++ b/src/libs/Together/Generated/Together.RlClient.CustomForwardBackward.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class RlClient { + private static readonly global::Together.AutoSDKServer[] s_CustomForwardBackwardServers = 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_CustomForwardBackwardSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -59,6 +72,34 @@ partial void ProcessCustomForwardBackwardResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// import uuid
+ /// from together import Together
+ /// client = Together()
+ /// # One gradient per sample: d(loss)/d(logprob) for each target token.
+ /// operation = client.post_training.operations.custom_forward_backward(
+ /// "<SESSION_ID>",
+ /// idempotency_key=str(uuid.uuid4()),
+ /// gradients=[{"data": [0.0, 0.0, -0.5, -0.5], "dtype": "D_TYPE_FLOAT32"}],
+ /// samples=[
+ /// {
+ /// "model_input": {
+ /// "chunks": [
+ /// {"encoded_text": {"tokens": [791, 6864, 315, 9822]}}
+ /// ]
+ /// },
+ /// "loss_fn_inputs": {
+ /// "target_tokens": {
+ /// "data": [6864, 315, 9822, 374],
+ /// "dtype": "int64",
+ /// },
+ /// "weights": {"data": [0.0, 0.0, 1.0, 1.0], "dtype": "float32"},
+ /// },
+ /// }
+ /// ],
+ /// )
+ /// print(operation.id, operation.status) + ///
public async global::System.Threading.Tasks.Task CustomForwardBackwardAsync( string sessionId, @@ -92,6 +133,34 @@ partial void ProcessCustomForwardBackwardResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// import uuid
+ /// from together import Together
+ /// client = Together()
+ /// # One gradient per sample: d(loss)/d(logprob) for each target token.
+ /// operation = client.post_training.operations.custom_forward_backward(
+ /// "<SESSION_ID>",
+ /// idempotency_key=str(uuid.uuid4()),
+ /// gradients=[{"data": [0.0, 0.0, -0.5, -0.5], "dtype": "D_TYPE_FLOAT32"}],
+ /// samples=[
+ /// {
+ /// "model_input": {
+ /// "chunks": [
+ /// {"encoded_text": {"tokens": [791, 6864, 315, 9822]}}
+ /// ]
+ /// },
+ /// "loss_fn_inputs": {
+ /// "target_tokens": {
+ /// "data": [6864, 315, 9822, 374],
+ /// "dtype": "int64",
+ /// },
+ /// "weights": {"data": [0.0, 0.0, 1.0, 1.0], "dtype": "float32"},
+ /// },
+ /// }
+ /// ],
+ /// )
+ /// print(operation.id, operation.status) + ///
public async global::System.Threading.Tasks.Task> CustomForwardBackwardAsResponseAsync( string sessionId, @@ -134,8 +203,10 @@ partial void ProcessCustomForwardBackwardResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v1/rl/training-sessions/{sessionId}/operations/custom-forward-backward", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/rl/training-sessions/{sessionId}/operations/custom-forward-backward", + baseUri: ResolveBaseUri( + servers: s_CustomForwardBackwardServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -209,7 +280,7 @@ partial void ProcessCustomForwardBackwardResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "CustomForwardBackward", methodName: "CustomForwardBackwardAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}/operations/custom-forward-backward\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/custom-forward-backward\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -243,7 +314,7 @@ partial void ProcessCustomForwardBackwardResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "CustomForwardBackward", methodName: "CustomForwardBackwardAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}/operations/custom-forward-backward\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/custom-forward-backward\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -284,7 +355,7 @@ partial void ProcessCustomForwardBackwardResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "CustomForwardBackward", methodName: "CustomForwardBackwardAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}/operations/custom-forward-backward\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/custom-forward-backward\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -332,7 +403,7 @@ partial void ProcessCustomForwardBackwardResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "CustomForwardBackward", methodName: "CustomForwardBackwardAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}/operations/custom-forward-backward\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/custom-forward-backward\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -354,7 +425,7 @@ partial void ProcessCustomForwardBackwardResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "CustomForwardBackward", methodName: "CustomForwardBackwardAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}/operations/custom-forward-backward\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/custom-forward-backward\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.RlClient.DownloadCheckpoint.g.cs b/src/libs/Together/Generated/Together.RlClient.DownloadCheckpoint.g.cs index 40b7a660..1db64f67 100644 --- a/src/libs/Together/Generated/Together.RlClient.DownloadCheckpoint.g.cs +++ b/src/libs/Together/Generated/Together.RlClient.DownloadCheckpoint.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class RlClient { + private static readonly global::Together.AutoSDKServer[] s_DownloadCheckpointServers = 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_DownloadCheckpointSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -57,6 +70,15 @@ partial void ProcessDownloadCheckpointResponseContent( /// 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()
+ /// download = client.post_training.checkpoints.download(
+ /// "<CHECKPOINT_ID>",
+ /// variant="CHECKPOINT_VARIANT_ADAPTER",
+ /// )
+ /// print(download) + ///
public async global::System.Threading.Tasks.Task DownloadCheckpointAsync( string id, global::Together.RlCheckpointVariant variant = global::Together.RlCheckpointVariant.CheckpointVariantUnspecified, @@ -86,6 +108,15 @@ partial void ProcessDownloadCheckpointResponseContent( /// 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()
+ /// download = client.post_training.checkpoints.download(
+ /// "<CHECKPOINT_ID>",
+ /// variant="CHECKPOINT_VARIANT_ADAPTER",
+ /// )
+ /// print(download) + ///
public async global::System.Threading.Tasks.Task> DownloadCheckpointAsResponseAsync( string id, global::Together.RlCheckpointVariant variant = global::Together.RlCheckpointVariant.CheckpointVariantUnspecified, @@ -123,8 +154,10 @@ partial void ProcessDownloadCheckpointResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v1/rl/checkpoints/{id}/download", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/rl/checkpoints/{id}/download", + baseUri: ResolveBaseUri( + servers: s_DownloadCheckpointServers, + defaultBaseUrl: "https://api.together.ai/v1")); __pathBuilder .AddRequiredParameter("variant", variant.ToValueString()) ; @@ -188,7 +221,7 @@ partial void ProcessDownloadCheckpointResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "DownloadCheckpoint", methodName: "DownloadCheckpointAsync", - pathTemplate: "$\"/v1/rl/checkpoints/{id}/download\"", + pathTemplate: "$\"/rl/checkpoints/{id}/download\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -222,7 +255,7 @@ partial void ProcessDownloadCheckpointResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "DownloadCheckpoint", methodName: "DownloadCheckpointAsync", - pathTemplate: "$\"/v1/rl/checkpoints/{id}/download\"", + pathTemplate: "$\"/rl/checkpoints/{id}/download\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -263,7 +296,7 @@ partial void ProcessDownloadCheckpointResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "DownloadCheckpoint", methodName: "DownloadCheckpointAsync", - pathTemplate: "$\"/v1/rl/checkpoints/{id}/download\"", + pathTemplate: "$\"/rl/checkpoints/{id}/download\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -311,7 +344,7 @@ partial void ProcessDownloadCheckpointResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "DownloadCheckpoint", methodName: "DownloadCheckpointAsync", - pathTemplate: "$\"/v1/rl/checkpoints/{id}/download\"", + pathTemplate: "$\"/rl/checkpoints/{id}/download\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -333,7 +366,7 @@ partial void ProcessDownloadCheckpointResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "DownloadCheckpoint", methodName: "DownloadCheckpointAsync", - pathTemplate: "$\"/v1/rl/checkpoints/{id}/download\"", + pathTemplate: "$\"/rl/checkpoints/{id}/download\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.RlClient.EstimateModelResourcesCost.g.cs b/src/libs/Together/Generated/Together.RlClient.EstimateModelResourcesCost.g.cs index 828db43c..ccb1c6ba 100644 --- a/src/libs/Together/Generated/Together.RlClient.EstimateModelResourcesCost.g.cs +++ b/src/libs/Together/Generated/Together.RlClient.EstimateModelResourcesCost.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class RlClient { + private static readonly global::Together.AutoSDKServer[] s_EstimateModelResourcesCostServers = 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_EstimateModelResourcesCostSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -49,6 +62,16 @@ partial void ProcessEstimateModelResourcesCostResponseContent( /// 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()
+ /// estimate = client.post_training.model_resources.estimate_cost(
+ /// base_model="Qwen/Qwen3.5-9B",
+ /// lora_enabled=True,
+ /// compute_config={"gpu_type": "H100-80GB", "num_generator_replicas": 1},
+ /// )
+ /// print(estimate) + ///
public async global::System.Threading.Tasks.Task EstimateModelResourcesCostAsync( global::Together.RlCreateModelResourcesRequest request, @@ -72,6 +95,16 @@ partial void ProcessEstimateModelResourcesCostResponseContent( /// 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()
+ /// estimate = client.post_training.model_resources.estimate_cost(
+ /// base_model="Qwen/Qwen3.5-9B",
+ /// lora_enabled=True,
+ /// compute_config={"gpu_type": "H100-80GB", "num_generator_replicas": 1},
+ /// )
+ /// print(estimate) + ///
public async global::System.Threading.Tasks.Task> EstimateModelResourcesCostAsResponseAsync( global::Together.RlCreateModelResourcesRequest request, @@ -110,8 +143,10 @@ partial void ProcessEstimateModelResourcesCostResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: "/v1/rl/model-resources/estimate-cost", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: "/rl/model-resources/estimate-cost", + baseUri: ResolveBaseUri( + servers: s_EstimateModelResourcesCostServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -177,7 +212,7 @@ partial void ProcessEstimateModelResourcesCostResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "EstimateModelResourcesCost", methodName: "EstimateModelResourcesCostAsync", - pathTemplate: "\"/v1/rl/model-resources/estimate-cost\"", + pathTemplate: "\"/rl/model-resources/estimate-cost\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -211,7 +246,7 @@ partial void ProcessEstimateModelResourcesCostResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "EstimateModelResourcesCost", methodName: "EstimateModelResourcesCostAsync", - pathTemplate: "\"/v1/rl/model-resources/estimate-cost\"", + pathTemplate: "\"/rl/model-resources/estimate-cost\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -252,7 +287,7 @@ partial void ProcessEstimateModelResourcesCostResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "EstimateModelResourcesCost", methodName: "EstimateModelResourcesCostAsync", - pathTemplate: "\"/v1/rl/model-resources/estimate-cost\"", + pathTemplate: "\"/rl/model-resources/estimate-cost\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -300,7 +335,7 @@ partial void ProcessEstimateModelResourcesCostResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "EstimateModelResourcesCost", methodName: "EstimateModelResourcesCostAsync", - pathTemplate: "\"/v1/rl/model-resources/estimate-cost\"", + pathTemplate: "\"/rl/model-resources/estimate-cost\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -322,7 +357,7 @@ partial void ProcessEstimateModelResourcesCostResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "EstimateModelResourcesCost", methodName: "EstimateModelResourcesCostAsync", - pathTemplate: "\"/v1/rl/model-resources/estimate-cost\"", + pathTemplate: "\"/rl/model-resources/estimate-cost\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.RlClient.ForwardBackward.g.cs b/src/libs/Together/Generated/Together.RlClient.ForwardBackward.g.cs index 3b9f853b..d8529982 100644 --- a/src/libs/Together/Generated/Together.RlClient.ForwardBackward.g.cs +++ b/src/libs/Together/Generated/Together.RlClient.ForwardBackward.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class RlClient { + private static readonly global::Together.AutoSDKServer[] s_ForwardBackwardServers = 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_ForwardBackwardSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -59,6 +72,34 @@ partial void ProcessForwardBackwardResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// import uuid
+ /// from together import Together
+ /// client = Together()
+ /// # Token IDs come from the base model's tokenizer.
+ /// operation = client.post_training.operations.forward_backward(
+ /// "<SESSION_ID>",
+ /// idempotency_key=str(uuid.uuid4()),
+ /// loss={"type": "LOSS_TYPE_CROSS_ENTROPY"},
+ /// samples=[
+ /// {
+ /// "model_input": {
+ /// "chunks": [
+ /// {"encoded_text": {"tokens": [791, 6864, 315, 9822]}}
+ /// ]
+ /// },
+ /// "loss_fn_inputs": {
+ /// "target_tokens": {
+ /// "data": [6864, 315, 9822, 374],
+ /// "dtype": "int64",
+ /// },
+ /// "weights": {"data": [0.0, 0.0, 1.0, 1.0], "dtype": "float32"},
+ /// },
+ /// }
+ /// ],
+ /// )
+ /// print(operation.id, operation.status) + ///
public async global::System.Threading.Tasks.Task ForwardBackwardAsync( string sessionId, @@ -92,6 +133,34 @@ partial void ProcessForwardBackwardResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// import uuid
+ /// from together import Together
+ /// client = Together()
+ /// # Token IDs come from the base model's tokenizer.
+ /// operation = client.post_training.operations.forward_backward(
+ /// "<SESSION_ID>",
+ /// idempotency_key=str(uuid.uuid4()),
+ /// loss={"type": "LOSS_TYPE_CROSS_ENTROPY"},
+ /// samples=[
+ /// {
+ /// "model_input": {
+ /// "chunks": [
+ /// {"encoded_text": {"tokens": [791, 6864, 315, 9822]}}
+ /// ]
+ /// },
+ /// "loss_fn_inputs": {
+ /// "target_tokens": {
+ /// "data": [6864, 315, 9822, 374],
+ /// "dtype": "int64",
+ /// },
+ /// "weights": {"data": [0.0, 0.0, 1.0, 1.0], "dtype": "float32"},
+ /// },
+ /// }
+ /// ],
+ /// )
+ /// print(operation.id, operation.status) + ///
public async global::System.Threading.Tasks.Task> ForwardBackwardAsResponseAsync( string sessionId, @@ -134,8 +203,10 @@ partial void ProcessForwardBackwardResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v1/rl/training-sessions/{sessionId}/operations/forward-backward", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/rl/training-sessions/{sessionId}/operations/forward-backward", + baseUri: ResolveBaseUri( + servers: s_ForwardBackwardServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -209,7 +280,7 @@ partial void ProcessForwardBackwardResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ForwardBackward", methodName: "ForwardBackwardAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}/operations/forward-backward\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/forward-backward\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -243,7 +314,7 @@ partial void ProcessForwardBackwardResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ForwardBackward", methodName: "ForwardBackwardAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}/operations/forward-backward\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/forward-backward\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -284,7 +355,7 @@ partial void ProcessForwardBackwardResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ForwardBackward", methodName: "ForwardBackwardAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}/operations/forward-backward\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/forward-backward\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -332,7 +403,7 @@ partial void ProcessForwardBackwardResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ForwardBackward", methodName: "ForwardBackwardAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}/operations/forward-backward\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/forward-backward\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -354,7 +425,7 @@ partial void ProcessForwardBackwardResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ForwardBackward", methodName: "ForwardBackwardAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}/operations/forward-backward\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/forward-backward\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.RlClient.GetCheckpoint.g.cs b/src/libs/Together/Generated/Together.RlClient.GetCheckpoint.g.cs index 9c642331..24a0eb05 100644 --- a/src/libs/Together/Generated/Together.RlClient.GetCheckpoint.g.cs +++ b/src/libs/Together/Generated/Together.RlClient.GetCheckpoint.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class RlClient { + private static readonly global::Together.AutoSDKServer[] s_GetCheckpointServers = 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_GetCheckpointSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -51,6 +64,12 @@ partial void ProcessGetCheckpointResponseContent( /// 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()
+ /// checkpoint = client.post_training.checkpoints.retrieve("<CHECKPOINT_ID>")
+ /// print(checkpoint.type, checkpoint.base_model, checkpoint.lora_rank) + ///
public async global::System.Threading.Tasks.Task GetCheckpointAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -74,6 +93,12 @@ partial void ProcessGetCheckpointResponseContent( /// 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()
+ /// checkpoint = client.post_training.checkpoints.retrieve("<CHECKPOINT_ID>")
+ /// print(checkpoint.type, checkpoint.base_model, checkpoint.lora_rank) + ///
public async global::System.Threading.Tasks.Task> GetCheckpointAsResponseAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -109,8 +134,10 @@ partial void ProcessGetCheckpointResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v1/rl/checkpoints/{id}", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/rl/checkpoints/{id}", + baseUri: ResolveBaseUri( + servers: s_GetCheckpointServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -170,7 +197,7 @@ partial void ProcessGetCheckpointResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetCheckpoint", methodName: "GetCheckpointAsync", - pathTemplate: "$\"/v1/rl/checkpoints/{id}\"", + pathTemplate: "$\"/rl/checkpoints/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -204,7 +231,7 @@ partial void ProcessGetCheckpointResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetCheckpoint", methodName: "GetCheckpointAsync", - pathTemplate: "$\"/v1/rl/checkpoints/{id}\"", + pathTemplate: "$\"/rl/checkpoints/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -245,7 +272,7 @@ partial void ProcessGetCheckpointResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetCheckpoint", methodName: "GetCheckpointAsync", - pathTemplate: "$\"/v1/rl/checkpoints/{id}\"", + pathTemplate: "$\"/rl/checkpoints/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -293,7 +320,7 @@ partial void ProcessGetCheckpointResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetCheckpoint", methodName: "GetCheckpointAsync", - pathTemplate: "$\"/v1/rl/checkpoints/{id}\"", + pathTemplate: "$\"/rl/checkpoints/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -315,7 +342,7 @@ partial void ProcessGetCheckpointResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetCheckpoint", methodName: "GetCheckpointAsync", - pathTemplate: "$\"/v1/rl/checkpoints/{id}\"", + pathTemplate: "$\"/rl/checkpoints/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.RlClient.GetCustomForwardBackwardOperation.g.cs b/src/libs/Together/Generated/Together.RlClient.GetCustomForwardBackwardOperation.g.cs index d3015232..a51b11a1 100644 --- a/src/libs/Together/Generated/Together.RlClient.GetCustomForwardBackwardOperation.g.cs +++ b/src/libs/Together/Generated/Together.RlClient.GetCustomForwardBackwardOperation.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class RlClient { + private static readonly global::Together.AutoSDKServer[] s_GetCustomForwardBackwardOperationServers = 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_GetCustomForwardBackwardOperationSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -56,6 +69,15 @@ partial void ProcessGetCustomForwardBackwardOperationResponseContent( /// 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()
+ /// operation = client.post_training.operations.retrieve_custom_forward_backward(
+ /// "<OPERATION_ID>",
+ /// session_id="<SESSION_ID>",
+ /// )
+ /// print(operation.status) + ///
public async global::System.Threading.Tasks.Task GetCustomForwardBackwardOperationAsync( string sessionId, string operationId, @@ -84,6 +106,15 @@ partial void ProcessGetCustomForwardBackwardOperationResponseContent( /// 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()
+ /// operation = client.post_training.operations.retrieve_custom_forward_backward(
+ /// "<OPERATION_ID>",
+ /// session_id="<SESSION_ID>",
+ /// )
+ /// print(operation.status) + ///
public async global::System.Threading.Tasks.Task> GetCustomForwardBackwardOperationAsResponseAsync( string sessionId, string operationId, @@ -121,8 +152,10 @@ partial void ProcessGetCustomForwardBackwardOperationResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v1/rl/training-sessions/{sessionId}/operations/custom-forward-backward/{operationId}", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/rl/training-sessions/{sessionId}/operations/custom-forward-backward/{operationId}", + baseUri: ResolveBaseUri( + servers: s_GetCustomForwardBackwardOperationServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -183,7 +216,7 @@ partial void ProcessGetCustomForwardBackwardOperationResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetCustomForwardBackwardOperation", methodName: "GetCustomForwardBackwardOperationAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}/operations/custom-forward-backward/{operationId}\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/custom-forward-backward/{operationId}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -217,7 +250,7 @@ partial void ProcessGetCustomForwardBackwardOperationResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetCustomForwardBackwardOperation", methodName: "GetCustomForwardBackwardOperationAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}/operations/custom-forward-backward/{operationId}\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/custom-forward-backward/{operationId}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -258,7 +291,7 @@ partial void ProcessGetCustomForwardBackwardOperationResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetCustomForwardBackwardOperation", methodName: "GetCustomForwardBackwardOperationAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}/operations/custom-forward-backward/{operationId}\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/custom-forward-backward/{operationId}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -306,7 +339,7 @@ partial void ProcessGetCustomForwardBackwardOperationResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetCustomForwardBackwardOperation", methodName: "GetCustomForwardBackwardOperationAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}/operations/custom-forward-backward/{operationId}\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/custom-forward-backward/{operationId}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -328,7 +361,7 @@ partial void ProcessGetCustomForwardBackwardOperationResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetCustomForwardBackwardOperation", methodName: "GetCustomForwardBackwardOperationAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}/operations/custom-forward-backward/{operationId}\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/custom-forward-backward/{operationId}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.RlClient.GetForwardBackwardOperation.g.cs b/src/libs/Together/Generated/Together.RlClient.GetForwardBackwardOperation.g.cs index 928cdefc..3bf9a2e9 100644 --- a/src/libs/Together/Generated/Together.RlClient.GetForwardBackwardOperation.g.cs +++ b/src/libs/Together/Generated/Together.RlClient.GetForwardBackwardOperation.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class RlClient { + private static readonly global::Together.AutoSDKServer[] s_GetForwardBackwardOperationServers = 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_GetForwardBackwardOperationSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -56,6 +69,15 @@ partial void ProcessGetForwardBackwardOperationResponseContent( /// 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()
+ /// operation = client.post_training.operations.retrieve_forward_backward(
+ /// "<OPERATION_ID>",
+ /// session_id="<SESSION_ID>",
+ /// )
+ /// print(operation.status) + ///
public async global::System.Threading.Tasks.Task GetForwardBackwardOperationAsync( string sessionId, string operationId, @@ -84,6 +106,15 @@ partial void ProcessGetForwardBackwardOperationResponseContent( /// 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()
+ /// operation = client.post_training.operations.retrieve_forward_backward(
+ /// "<OPERATION_ID>",
+ /// session_id="<SESSION_ID>",
+ /// )
+ /// print(operation.status) + ///
public async global::System.Threading.Tasks.Task> GetForwardBackwardOperationAsResponseAsync( string sessionId, string operationId, @@ -121,8 +152,10 @@ partial void ProcessGetForwardBackwardOperationResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v1/rl/training-sessions/{sessionId}/operations/forward-backward/{operationId}", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/rl/training-sessions/{sessionId}/operations/forward-backward/{operationId}", + baseUri: ResolveBaseUri( + servers: s_GetForwardBackwardOperationServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -183,7 +216,7 @@ partial void ProcessGetForwardBackwardOperationResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetForwardBackwardOperation", methodName: "GetForwardBackwardOperationAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}/operations/forward-backward/{operationId}\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/forward-backward/{operationId}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -217,7 +250,7 @@ partial void ProcessGetForwardBackwardOperationResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetForwardBackwardOperation", methodName: "GetForwardBackwardOperationAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}/operations/forward-backward/{operationId}\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/forward-backward/{operationId}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -258,7 +291,7 @@ partial void ProcessGetForwardBackwardOperationResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetForwardBackwardOperation", methodName: "GetForwardBackwardOperationAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}/operations/forward-backward/{operationId}\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/forward-backward/{operationId}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -306,7 +339,7 @@ partial void ProcessGetForwardBackwardOperationResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetForwardBackwardOperation", methodName: "GetForwardBackwardOperationAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}/operations/forward-backward/{operationId}\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/forward-backward/{operationId}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -328,7 +361,7 @@ partial void ProcessGetForwardBackwardOperationResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetForwardBackwardOperation", methodName: "GetForwardBackwardOperationAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}/operations/forward-backward/{operationId}\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/forward-backward/{operationId}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.RlClient.GetInferenceCheckpointOperation.g.cs b/src/libs/Together/Generated/Together.RlClient.GetInferenceCheckpointOperation.g.cs index accb9cad..bdfd3d41 100644 --- a/src/libs/Together/Generated/Together.RlClient.GetInferenceCheckpointOperation.g.cs +++ b/src/libs/Together/Generated/Together.RlClient.GetInferenceCheckpointOperation.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class RlClient { + private static readonly global::Together.AutoSDKServer[] s_GetInferenceCheckpointOperationServers = 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_GetInferenceCheckpointOperationSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -56,6 +69,15 @@ partial void ProcessGetInferenceCheckpointOperationResponseContent( /// 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()
+ /// operation = client.post_training.operations.retrieve_inference_checkpoint(
+ /// "<OPERATION_ID>",
+ /// session_id="<SESSION_ID>",
+ /// )
+ /// print(operation.status) + ///
public async global::System.Threading.Tasks.Task GetInferenceCheckpointOperationAsync( string sessionId, string operationId, @@ -84,6 +106,15 @@ partial void ProcessGetInferenceCheckpointOperationResponseContent( /// 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()
+ /// operation = client.post_training.operations.retrieve_inference_checkpoint(
+ /// "<OPERATION_ID>",
+ /// session_id="<SESSION_ID>",
+ /// )
+ /// print(operation.status) + ///
public async global::System.Threading.Tasks.Task> GetInferenceCheckpointOperationAsResponseAsync( string sessionId, string operationId, @@ -121,8 +152,10 @@ partial void ProcessGetInferenceCheckpointOperationResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v1/rl/training-sessions/{sessionId}/operations/inference-checkpoint/{operationId}", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/rl/training-sessions/{sessionId}/operations/inference-checkpoint/{operationId}", + baseUri: ResolveBaseUri( + servers: s_GetInferenceCheckpointOperationServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -183,7 +216,7 @@ partial void ProcessGetInferenceCheckpointOperationResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetInferenceCheckpointOperation", methodName: "GetInferenceCheckpointOperationAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}/operations/inference-checkpoint/{operationId}\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/inference-checkpoint/{operationId}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -217,7 +250,7 @@ partial void ProcessGetInferenceCheckpointOperationResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetInferenceCheckpointOperation", methodName: "GetInferenceCheckpointOperationAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}/operations/inference-checkpoint/{operationId}\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/inference-checkpoint/{operationId}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -258,7 +291,7 @@ partial void ProcessGetInferenceCheckpointOperationResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetInferenceCheckpointOperation", methodName: "GetInferenceCheckpointOperationAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}/operations/inference-checkpoint/{operationId}\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/inference-checkpoint/{operationId}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -306,7 +339,7 @@ partial void ProcessGetInferenceCheckpointOperationResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetInferenceCheckpointOperation", methodName: "GetInferenceCheckpointOperationAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}/operations/inference-checkpoint/{operationId}\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/inference-checkpoint/{operationId}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -328,7 +361,7 @@ partial void ProcessGetInferenceCheckpointOperationResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetInferenceCheckpointOperation", methodName: "GetInferenceCheckpointOperationAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}/operations/inference-checkpoint/{operationId}\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/inference-checkpoint/{operationId}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.RlClient.GetModelResources.g.cs b/src/libs/Together/Generated/Together.RlClient.GetModelResources.g.cs index c6d2228f..33417b81 100644 --- a/src/libs/Together/Generated/Together.RlClient.GetModelResources.g.cs +++ b/src/libs/Together/Generated/Together.RlClient.GetModelResources.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class RlClient { + private static readonly global::Together.AutoSDKServer[] s_GetModelResourcesServers = 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_GetModelResourcesSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -51,6 +64,14 @@ partial void ProcessGetModelResourcesResponseContent( /// 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()
+ /// resource = client.post_training.model_resources.retrieve(
+ /// "<MODEL_RESOURCES_ID>",
+ /// )
+ /// print(resource.status, resource.compute_config) + ///
public async global::System.Threading.Tasks.Task GetModelResourcesAsync( string modelResourcesId, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -74,6 +95,14 @@ partial void ProcessGetModelResourcesResponseContent( /// 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()
+ /// resource = client.post_training.model_resources.retrieve(
+ /// "<MODEL_RESOURCES_ID>",
+ /// )
+ /// print(resource.status, resource.compute_config) + ///
public async global::System.Threading.Tasks.Task> GetModelResourcesAsResponseAsync( string modelResourcesId, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -109,8 +138,10 @@ partial void ProcessGetModelResourcesResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v1/rl/model-resources/{modelResourcesId}", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/rl/model-resources/{modelResourcesId}", + baseUri: ResolveBaseUri( + servers: s_GetModelResourcesServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -170,7 +201,7 @@ partial void ProcessGetModelResourcesResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetModelResources", methodName: "GetModelResourcesAsync", - pathTemplate: "$\"/v1/rl/model-resources/{modelResourcesId}\"", + pathTemplate: "$\"/rl/model-resources/{modelResourcesId}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -204,7 +235,7 @@ partial void ProcessGetModelResourcesResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetModelResources", methodName: "GetModelResourcesAsync", - pathTemplate: "$\"/v1/rl/model-resources/{modelResourcesId}\"", + pathTemplate: "$\"/rl/model-resources/{modelResourcesId}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -245,7 +276,7 @@ partial void ProcessGetModelResourcesResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetModelResources", methodName: "GetModelResourcesAsync", - pathTemplate: "$\"/v1/rl/model-resources/{modelResourcesId}\"", + pathTemplate: "$\"/rl/model-resources/{modelResourcesId}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -293,7 +324,7 @@ partial void ProcessGetModelResourcesResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetModelResources", methodName: "GetModelResourcesAsync", - pathTemplate: "$\"/v1/rl/model-resources/{modelResourcesId}\"", + pathTemplate: "$\"/rl/model-resources/{modelResourcesId}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -315,7 +346,7 @@ partial void ProcessGetModelResourcesResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetModelResources", methodName: "GetModelResourcesAsync", - pathTemplate: "$\"/v1/rl/model-resources/{modelResourcesId}\"", + pathTemplate: "$\"/rl/model-resources/{modelResourcesId}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.RlClient.GetOptimStepOperation.g.cs b/src/libs/Together/Generated/Together.RlClient.GetOptimStepOperation.g.cs index f2fb349a..97ab4cc5 100644 --- a/src/libs/Together/Generated/Together.RlClient.GetOptimStepOperation.g.cs +++ b/src/libs/Together/Generated/Together.RlClient.GetOptimStepOperation.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class RlClient { + private static readonly global::Together.AutoSDKServer[] s_GetOptimStepOperationServers = 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_GetOptimStepOperationSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -56,6 +69,15 @@ partial void ProcessGetOptimStepOperationResponseContent( /// 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()
+ /// operation = client.post_training.operations.retrieve_optim_step(
+ /// "<OPERATION_ID>",
+ /// session_id="<SESSION_ID>",
+ /// )
+ /// print(operation.status) + ///
public async global::System.Threading.Tasks.Task GetOptimStepOperationAsync( string sessionId, string operationId, @@ -84,6 +106,15 @@ partial void ProcessGetOptimStepOperationResponseContent( /// 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()
+ /// operation = client.post_training.operations.retrieve_optim_step(
+ /// "<OPERATION_ID>",
+ /// session_id="<SESSION_ID>",
+ /// )
+ /// print(operation.status) + ///
public async global::System.Threading.Tasks.Task> GetOptimStepOperationAsResponseAsync( string sessionId, string operationId, @@ -121,8 +152,10 @@ partial void ProcessGetOptimStepOperationResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v1/rl/training-sessions/{sessionId}/operations/optim-step/{operationId}", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/rl/training-sessions/{sessionId}/operations/optim-step/{operationId}", + baseUri: ResolveBaseUri( + servers: s_GetOptimStepOperationServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -183,7 +216,7 @@ partial void ProcessGetOptimStepOperationResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetOptimStepOperation", methodName: "GetOptimStepOperationAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}/operations/optim-step/{operationId}\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/optim-step/{operationId}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -217,7 +250,7 @@ partial void ProcessGetOptimStepOperationResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetOptimStepOperation", methodName: "GetOptimStepOperationAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}/operations/optim-step/{operationId}\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/optim-step/{operationId}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -258,7 +291,7 @@ partial void ProcessGetOptimStepOperationResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetOptimStepOperation", methodName: "GetOptimStepOperationAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}/operations/optim-step/{operationId}\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/optim-step/{operationId}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -306,7 +339,7 @@ partial void ProcessGetOptimStepOperationResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetOptimStepOperation", methodName: "GetOptimStepOperationAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}/operations/optim-step/{operationId}\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/optim-step/{operationId}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -328,7 +361,7 @@ partial void ProcessGetOptimStepOperationResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetOptimStepOperation", methodName: "GetOptimStepOperationAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}/operations/optim-step/{operationId}\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/optim-step/{operationId}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.RlClient.GetSample.g.cs b/src/libs/Together/Generated/Together.RlClient.GetSample.g.cs index ff7d3973..5c77dd5a 100644 --- a/src/libs/Together/Generated/Together.RlClient.GetSample.g.cs +++ b/src/libs/Together/Generated/Together.RlClient.GetSample.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class RlClient { + private static readonly global::Together.AutoSDKServer[] s_GetSampleServers = 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_GetSampleSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -56,6 +69,15 @@ partial void ProcessGetSampleResponseContent( /// 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()
+ /// operation = client.post_training.operations.retrieve_sample(
+ /// "<OPERATION_ID>",
+ /// session_id="<SESSION_ID>",
+ /// )
+ /// print(operation.status) + ///
public async global::System.Threading.Tasks.Task GetSampleAsync( string sessionId, string operationId, @@ -84,6 +106,15 @@ partial void ProcessGetSampleResponseContent( /// 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()
+ /// operation = client.post_training.operations.retrieve_sample(
+ /// "<OPERATION_ID>",
+ /// session_id="<SESSION_ID>",
+ /// )
+ /// print(operation.status) + ///
public async global::System.Threading.Tasks.Task> GetSampleAsResponseAsync( string sessionId, string operationId, @@ -121,8 +152,10 @@ partial void ProcessGetSampleResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v1/rl/training-sessions/{sessionId}/operations/sample/{operationId}", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/rl/training-sessions/{sessionId}/operations/sample/{operationId}", + baseUri: ResolveBaseUri( + servers: s_GetSampleServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -183,7 +216,7 @@ partial void ProcessGetSampleResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetSample", methodName: "GetSampleAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}/operations/sample/{operationId}\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/sample/{operationId}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -217,7 +250,7 @@ partial void ProcessGetSampleResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetSample", methodName: "GetSampleAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}/operations/sample/{operationId}\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/sample/{operationId}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -258,7 +291,7 @@ partial void ProcessGetSampleResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetSample", methodName: "GetSampleAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}/operations/sample/{operationId}\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/sample/{operationId}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -306,7 +339,7 @@ partial void ProcessGetSampleResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetSample", methodName: "GetSampleAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}/operations/sample/{operationId}\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/sample/{operationId}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -328,7 +361,7 @@ partial void ProcessGetSampleResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetSample", methodName: "GetSampleAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}/operations/sample/{operationId}\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/sample/{operationId}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.RlClient.GetTrainingCheckpointOperation.g.cs b/src/libs/Together/Generated/Together.RlClient.GetTrainingCheckpointOperation.g.cs index c9b5fd86..9dc9e2be 100644 --- a/src/libs/Together/Generated/Together.RlClient.GetTrainingCheckpointOperation.g.cs +++ b/src/libs/Together/Generated/Together.RlClient.GetTrainingCheckpointOperation.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class RlClient { + private static readonly global::Together.AutoSDKServer[] s_GetTrainingCheckpointOperationServers = 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_GetTrainingCheckpointOperationSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -56,6 +69,15 @@ partial void ProcessGetTrainingCheckpointOperationResponseContent( /// 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()
+ /// operation = client.post_training.operations.retrieve_training_checkpoint(
+ /// "<OPERATION_ID>",
+ /// session_id="<SESSION_ID>",
+ /// )
+ /// print(operation.status) + ///
public async global::System.Threading.Tasks.Task GetTrainingCheckpointOperationAsync( string sessionId, string operationId, @@ -84,6 +106,15 @@ partial void ProcessGetTrainingCheckpointOperationResponseContent( /// 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()
+ /// operation = client.post_training.operations.retrieve_training_checkpoint(
+ /// "<OPERATION_ID>",
+ /// session_id="<SESSION_ID>",
+ /// )
+ /// print(operation.status) + ///
public async global::System.Threading.Tasks.Task> GetTrainingCheckpointOperationAsResponseAsync( string sessionId, string operationId, @@ -121,8 +152,10 @@ partial void ProcessGetTrainingCheckpointOperationResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v1/rl/training-sessions/{sessionId}/operations/training-checkpoint/{operationId}", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/rl/training-sessions/{sessionId}/operations/training-checkpoint/{operationId}", + baseUri: ResolveBaseUri( + servers: s_GetTrainingCheckpointOperationServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -183,7 +216,7 @@ partial void ProcessGetTrainingCheckpointOperationResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetTrainingCheckpointOperation", methodName: "GetTrainingCheckpointOperationAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}/operations/training-checkpoint/{operationId}\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/training-checkpoint/{operationId}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -217,7 +250,7 @@ partial void ProcessGetTrainingCheckpointOperationResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetTrainingCheckpointOperation", methodName: "GetTrainingCheckpointOperationAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}/operations/training-checkpoint/{operationId}\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/training-checkpoint/{operationId}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -258,7 +291,7 @@ partial void ProcessGetTrainingCheckpointOperationResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetTrainingCheckpointOperation", methodName: "GetTrainingCheckpointOperationAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}/operations/training-checkpoint/{operationId}\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/training-checkpoint/{operationId}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -306,7 +339,7 @@ partial void ProcessGetTrainingCheckpointOperationResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetTrainingCheckpointOperation", methodName: "GetTrainingCheckpointOperationAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}/operations/training-checkpoint/{operationId}\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/training-checkpoint/{operationId}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -328,7 +361,7 @@ partial void ProcessGetTrainingCheckpointOperationResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetTrainingCheckpointOperation", methodName: "GetTrainingCheckpointOperationAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}/operations/training-checkpoint/{operationId}\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/training-checkpoint/{operationId}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.RlClient.GetTrainingSession.g.cs b/src/libs/Together/Generated/Together.RlClient.GetTrainingSession.g.cs index f7eed92c..fe5f4723 100644 --- a/src/libs/Together/Generated/Together.RlClient.GetTrainingSession.g.cs +++ b/src/libs/Together/Generated/Together.RlClient.GetTrainingSession.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class RlClient { + private static readonly global::Together.AutoSDKServer[] s_GetTrainingSessionServers = 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_GetTrainingSessionSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -51,6 +64,12 @@ partial void ProcessGetTrainingSessionResponseContent( /// 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()
+ /// session = client.post_training.sessions.retrieve("<SESSION_ID>")
+ /// print(session.status) + ///
public async global::System.Threading.Tasks.Task GetTrainingSessionAsync( string sessionId, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -74,6 +93,12 @@ partial void ProcessGetTrainingSessionResponseContent( /// 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()
+ /// session = client.post_training.sessions.retrieve("<SESSION_ID>")
+ /// print(session.status) + ///
public async global::System.Threading.Tasks.Task> GetTrainingSessionAsResponseAsync( string sessionId, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -109,8 +134,10 @@ partial void ProcessGetTrainingSessionResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v1/rl/training-sessions/{sessionId}", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/rl/training-sessions/{sessionId}", + baseUri: ResolveBaseUri( + servers: s_GetTrainingSessionServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -170,7 +197,7 @@ partial void ProcessGetTrainingSessionResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetTrainingSession", methodName: "GetTrainingSessionAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -204,7 +231,7 @@ partial void ProcessGetTrainingSessionResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetTrainingSession", methodName: "GetTrainingSessionAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -245,7 +272,7 @@ partial void ProcessGetTrainingSessionResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetTrainingSession", methodName: "GetTrainingSessionAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -293,7 +320,7 @@ partial void ProcessGetTrainingSessionResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetTrainingSession", methodName: "GetTrainingSessionAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -315,7 +342,7 @@ partial void ProcessGetTrainingSessionResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetTrainingSession", methodName: "GetTrainingSessionAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.RlClient.GetWeightsSyncOperation.g.cs b/src/libs/Together/Generated/Together.RlClient.GetWeightsSyncOperation.g.cs index da449b16..98b16fc6 100644 --- a/src/libs/Together/Generated/Together.RlClient.GetWeightsSyncOperation.g.cs +++ b/src/libs/Together/Generated/Together.RlClient.GetWeightsSyncOperation.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class RlClient { + private static readonly global::Together.AutoSDKServer[] s_GetWeightsSyncOperationServers = 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_GetWeightsSyncOperationSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -56,6 +69,15 @@ partial void ProcessGetWeightsSyncOperationResponseContent( /// 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()
+ /// operation = client.post_training.operations.retrieve_weights_sync(
+ /// "<OPERATION_ID>",
+ /// session_id="<SESSION_ID>",
+ /// )
+ /// print(operation.status) + ///
public async global::System.Threading.Tasks.Task GetWeightsSyncOperationAsync( string sessionId, string operationId, @@ -84,6 +106,15 @@ partial void ProcessGetWeightsSyncOperationResponseContent( /// 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()
+ /// operation = client.post_training.operations.retrieve_weights_sync(
+ /// "<OPERATION_ID>",
+ /// session_id="<SESSION_ID>",
+ /// )
+ /// print(operation.status) + ///
public async global::System.Threading.Tasks.Task> GetWeightsSyncOperationAsResponseAsync( string sessionId, string operationId, @@ -121,8 +152,10 @@ partial void ProcessGetWeightsSyncOperationResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v1/rl/training-sessions/{sessionId}/operations/weights-sync/{operationId}", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/rl/training-sessions/{sessionId}/operations/weights-sync/{operationId}", + baseUri: ResolveBaseUri( + servers: s_GetWeightsSyncOperationServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -183,7 +216,7 @@ partial void ProcessGetWeightsSyncOperationResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetWeightsSyncOperation", methodName: "GetWeightsSyncOperationAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}/operations/weights-sync/{operationId}\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/weights-sync/{operationId}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -217,7 +250,7 @@ partial void ProcessGetWeightsSyncOperationResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetWeightsSyncOperation", methodName: "GetWeightsSyncOperationAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}/operations/weights-sync/{operationId}\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/weights-sync/{operationId}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -258,7 +291,7 @@ partial void ProcessGetWeightsSyncOperationResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetWeightsSyncOperation", methodName: "GetWeightsSyncOperationAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}/operations/weights-sync/{operationId}\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/weights-sync/{operationId}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -306,7 +339,7 @@ partial void ProcessGetWeightsSyncOperationResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetWeightsSyncOperation", methodName: "GetWeightsSyncOperationAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}/operations/weights-sync/{operationId}\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/weights-sync/{operationId}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -328,7 +361,7 @@ partial void ProcessGetWeightsSyncOperationResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetWeightsSyncOperation", methodName: "GetWeightsSyncOperationAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}/operations/weights-sync/{operationId}\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/weights-sync/{operationId}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.RlClient.ListCheckpoints.g.cs b/src/libs/Together/Generated/Together.RlClient.ListCheckpoints.g.cs index 5b9aad25..8deb746c 100644 --- a/src/libs/Together/Generated/Together.RlClient.ListCheckpoints.g.cs +++ b/src/libs/Together/Generated/Together.RlClient.ListCheckpoints.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class RlClient { + private static readonly global::Together.AutoSDKServer[] s_ListCheckpointsServers = 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_ListCheckpointsSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -72,6 +85,16 @@ partial void ProcessListCheckpointsResponseContent( /// 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()
+ /// checkpoints = client.post_training.checkpoints.list(
+ /// session_id="<SESSION_ID>",
+ /// type="CHECKPOINT_TYPE_TRAINING",
+ /// )
+ /// for checkpoint in checkpoints.data:
+ /// print(checkpoint.id, checkpoint.step) + ///
public async global::System.Threading.Tasks.Task ListCheckpointsAsync( string? sessionId = default, string? baseModel = default, @@ -116,6 +139,16 @@ partial void ProcessListCheckpointsResponseContent( /// 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()
+ /// checkpoints = client.post_training.checkpoints.list(
+ /// session_id="<SESSION_ID>",
+ /// type="CHECKPOINT_TYPE_TRAINING",
+ /// )
+ /// for checkpoint in checkpoints.data:
+ /// print(checkpoint.id, checkpoint.step) + ///
public async global::System.Threading.Tasks.Task> ListCheckpointsAsResponseAsync( string? sessionId = default, string? baseModel = default, @@ -159,8 +192,10 @@ partial void ProcessListCheckpointsResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: "/v1/rl/checkpoints", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: "/rl/checkpoints", + baseUri: ResolveBaseUri( + servers: s_ListCheckpointsServers, + defaultBaseUrl: "https://api.together.ai/v1")); __pathBuilder .AddOptionalParameter("session_id", sessionId) .AddOptionalParameter("base_model", baseModel) @@ -231,7 +266,7 @@ partial void ProcessListCheckpointsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ListCheckpoints", methodName: "ListCheckpointsAsync", - pathTemplate: "\"/v1/rl/checkpoints\"", + pathTemplate: "\"/rl/checkpoints\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -265,7 +300,7 @@ partial void ProcessListCheckpointsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ListCheckpoints", methodName: "ListCheckpointsAsync", - pathTemplate: "\"/v1/rl/checkpoints\"", + pathTemplate: "\"/rl/checkpoints\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -306,7 +341,7 @@ partial void ProcessListCheckpointsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ListCheckpoints", methodName: "ListCheckpointsAsync", - pathTemplate: "\"/v1/rl/checkpoints\"", + pathTemplate: "\"/rl/checkpoints\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -354,7 +389,7 @@ partial void ProcessListCheckpointsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ListCheckpoints", methodName: "ListCheckpointsAsync", - pathTemplate: "\"/v1/rl/checkpoints\"", + pathTemplate: "\"/rl/checkpoints\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -376,7 +411,7 @@ partial void ProcessListCheckpointsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ListCheckpoints", methodName: "ListCheckpointsAsync", - pathTemplate: "\"/v1/rl/checkpoints\"", + pathTemplate: "\"/rl/checkpoints\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.RlClient.ListModelResources.g.cs b/src/libs/Together/Generated/Together.RlClient.ListModelResources.g.cs index 4c1f77a6..f3193f81 100644 --- a/src/libs/Together/Generated/Together.RlClient.ListModelResources.g.cs +++ b/src/libs/Together/Generated/Together.RlClient.ListModelResources.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class RlClient { + private static readonly global::Together.AutoSDKServer[] s_ListModelResourcesServers = 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_ListModelResourcesSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -67,6 +80,15 @@ partial void ProcessListModelResourcesResponseContent( /// 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()
+ /// resources = client.post_training.model_resources.list(
+ /// status=["MODEL_RESOURCES_STATUS_READY"],
+ /// )
+ /// for resource in resources.data:
+ /// print(resource.id, resource.base_model, resource.status) + ///
public async global::System.Threading.Tasks.Task ListModelResourcesAsync( global::System.Collections.Generic.IList? status = default, int? limit = default, @@ -106,6 +128,15 @@ partial void ProcessListModelResourcesResponseContent( /// 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()
+ /// resources = client.post_training.model_resources.list(
+ /// status=["MODEL_RESOURCES_STATUS_READY"],
+ /// )
+ /// for resource in resources.data:
+ /// print(resource.id, resource.base_model, resource.status) + ///
public async global::System.Threading.Tasks.Task> ListModelResourcesAsResponseAsync( global::System.Collections.Generic.IList? status = default, int? limit = default, @@ -147,8 +178,10 @@ partial void ProcessListModelResourcesResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: "/v1/rl/model-resources", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: "/rl/model-resources", + baseUri: ResolveBaseUri( + servers: s_ListModelResourcesServers, + defaultBaseUrl: "https://api.together.ai/v1")); __pathBuilder .AddOptionalParameter("status", status, selector: static x => x.ToValueString(), delimiter: ",", explode: true) .AddOptionalParameter("limit", limit?.ToString()) @@ -217,7 +250,7 @@ partial void ProcessListModelResourcesResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ListModelResources", methodName: "ListModelResourcesAsync", - pathTemplate: "\"/v1/rl/model-resources\"", + pathTemplate: "\"/rl/model-resources\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -251,7 +284,7 @@ partial void ProcessListModelResourcesResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ListModelResources", methodName: "ListModelResourcesAsync", - pathTemplate: "\"/v1/rl/model-resources\"", + pathTemplate: "\"/rl/model-resources\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -292,7 +325,7 @@ partial void ProcessListModelResourcesResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ListModelResources", methodName: "ListModelResourcesAsync", - pathTemplate: "\"/v1/rl/model-resources\"", + pathTemplate: "\"/rl/model-resources\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -340,7 +373,7 @@ partial void ProcessListModelResourcesResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ListModelResources", methodName: "ListModelResourcesAsync", - pathTemplate: "\"/v1/rl/model-resources\"", + pathTemplate: "\"/rl/model-resources\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -362,7 +395,7 @@ partial void ProcessListModelResourcesResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ListModelResources", methodName: "ListModelResourcesAsync", - pathTemplate: "\"/v1/rl/model-resources\"", + pathTemplate: "\"/rl/model-resources\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.RlClient.ListSupportedModels.g.cs b/src/libs/Together/Generated/Together.RlClient.ListSupportedModels.g.cs index 1de1d5e0..c1eb0dd5 100644 --- a/src/libs/Together/Generated/Together.RlClient.ListSupportedModels.g.cs +++ b/src/libs/Together/Generated/Together.RlClient.ListSupportedModels.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class RlClient { + private static readonly global::Together.AutoSDKServer[] s_ListSupportedModelsServers = 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_ListSupportedModelsSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -46,6 +59,13 @@ partial void ProcessListSupportedModelsResponseContent( /// 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()
+ /// supported = client.post_training.supported_models.get()
+ /// for model in supported.data:
+ /// print(model.base_model) + ///
public async global::System.Threading.Tasks.Task ListSupportedModelsAsync( global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -64,6 +84,13 @@ partial void ProcessListSupportedModelsResponseContent( /// 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()
+ /// supported = client.post_training.supported_models.get()
+ /// for model in supported.data:
+ /// print(model.base_model) + ///
public async global::System.Threading.Tasks.Task> ListSupportedModelsAsResponseAsync( global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -97,8 +124,10 @@ partial void ProcessListSupportedModelsResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: "/v1/rl/supported-models", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: "/rl/supported-models", + baseUri: ResolveBaseUri( + servers: s_ListSupportedModelsServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -157,7 +186,7 @@ partial void ProcessListSupportedModelsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ListSupportedModels", methodName: "ListSupportedModelsAsync", - pathTemplate: "\"/v1/rl/supported-models\"", + pathTemplate: "\"/rl/supported-models\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -191,7 +220,7 @@ partial void ProcessListSupportedModelsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ListSupportedModels", methodName: "ListSupportedModelsAsync", - pathTemplate: "\"/v1/rl/supported-models\"", + pathTemplate: "\"/rl/supported-models\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -232,7 +261,7 @@ partial void ProcessListSupportedModelsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ListSupportedModels", methodName: "ListSupportedModelsAsync", - pathTemplate: "\"/v1/rl/supported-models\"", + pathTemplate: "\"/rl/supported-models\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -280,7 +309,7 @@ partial void ProcessListSupportedModelsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ListSupportedModels", methodName: "ListSupportedModelsAsync", - pathTemplate: "\"/v1/rl/supported-models\"", + pathTemplate: "\"/rl/supported-models\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -302,7 +331,7 @@ partial void ProcessListSupportedModelsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ListSupportedModels", methodName: "ListSupportedModelsAsync", - pathTemplate: "\"/v1/rl/supported-models\"", + pathTemplate: "\"/rl/supported-models\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.RlClient.ListTrainingSessions.g.cs b/src/libs/Together/Generated/Together.RlClient.ListTrainingSessions.g.cs index e0fa89b8..83f69f5d 100644 --- a/src/libs/Together/Generated/Together.RlClient.ListTrainingSessions.g.cs +++ b/src/libs/Together/Generated/Together.RlClient.ListTrainingSessions.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class RlClient { + private static readonly global::Together.AutoSDKServer[] s_ListTrainingSessionsServers = 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_ListTrainingSessionsSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -72,6 +85,15 @@ partial void ProcessListTrainingSessionsResponseContent( /// 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()
+ /// sessions = client.post_training.sessions.list(
+ /// model_resources_id="<MODEL_RESOURCES_ID>",
+ /// )
+ /// for session in sessions.data or []:
+ /// print(session.id, session.status) + ///
public async global::System.Threading.Tasks.Task ListTrainingSessionsAsync( global::System.Collections.Generic.IList? status = default, int? limit = default, @@ -116,6 +138,15 @@ partial void ProcessListTrainingSessionsResponseContent( /// 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()
+ /// sessions = client.post_training.sessions.list(
+ /// model_resources_id="<MODEL_RESOURCES_ID>",
+ /// )
+ /// for session in sessions.data or []:
+ /// print(session.id, session.status) + ///
public async global::System.Threading.Tasks.Task> ListTrainingSessionsAsResponseAsync( global::System.Collections.Generic.IList? status = default, int? limit = default, @@ -159,8 +190,10 @@ partial void ProcessListTrainingSessionsResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: "/v1/rl/training-sessions", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: "/rl/training-sessions", + baseUri: ResolveBaseUri( + servers: s_ListTrainingSessionsServers, + defaultBaseUrl: "https://api.together.ai/v1")); __pathBuilder .AddOptionalParameter("status", status, selector: static x => x.ToValueString(), delimiter: ",", explode: true) .AddOptionalParameter("limit", limit?.ToString()) @@ -231,7 +264,7 @@ partial void ProcessListTrainingSessionsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ListTrainingSessions", methodName: "ListTrainingSessionsAsync", - pathTemplate: "\"/v1/rl/training-sessions\"", + pathTemplate: "\"/rl/training-sessions\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -265,7 +298,7 @@ partial void ProcessListTrainingSessionsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ListTrainingSessions", methodName: "ListTrainingSessionsAsync", - pathTemplate: "\"/v1/rl/training-sessions\"", + pathTemplate: "\"/rl/training-sessions\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -306,7 +339,7 @@ partial void ProcessListTrainingSessionsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ListTrainingSessions", methodName: "ListTrainingSessionsAsync", - pathTemplate: "\"/v1/rl/training-sessions\"", + pathTemplate: "\"/rl/training-sessions\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -354,7 +387,7 @@ partial void ProcessListTrainingSessionsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ListTrainingSessions", methodName: "ListTrainingSessionsAsync", - pathTemplate: "\"/v1/rl/training-sessions\"", + pathTemplate: "\"/rl/training-sessions\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -376,7 +409,7 @@ partial void ProcessListTrainingSessionsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ListTrainingSessions", methodName: "ListTrainingSessionsAsync", - pathTemplate: "\"/v1/rl/training-sessions\"", + pathTemplate: "\"/rl/training-sessions\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.RlClient.OptimStep.g.cs b/src/libs/Together/Generated/Together.RlClient.OptimStep.g.cs index e6614971..66343233 100644 --- a/src/libs/Together/Generated/Together.RlClient.OptimStep.g.cs +++ b/src/libs/Together/Generated/Together.RlClient.OptimStep.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class RlClient { + private static readonly global::Together.AutoSDKServer[] s_OptimStepServers = 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_OptimStepSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -59,6 +72,17 @@ partial void ProcessOptimStepResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// import uuid
+ /// from together import Together
+ /// client = Together()
+ /// operation = client.post_training.operations.optim_step(
+ /// "<SESSION_ID>",
+ /// idempotency_key=str(uuid.uuid4()),
+ /// adam_params={"learning_rate": 1e-5},
+ /// )
+ /// print(operation.id, operation.status) + ///
public async global::System.Threading.Tasks.Task OptimStepAsync( string sessionId, @@ -92,6 +116,17 @@ partial void ProcessOptimStepResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// import uuid
+ /// from together import Together
+ /// client = Together()
+ /// operation = client.post_training.operations.optim_step(
+ /// "<SESSION_ID>",
+ /// idempotency_key=str(uuid.uuid4()),
+ /// adam_params={"learning_rate": 1e-5},
+ /// )
+ /// print(operation.id, operation.status) + ///
public async global::System.Threading.Tasks.Task> OptimStepAsResponseAsync( string sessionId, @@ -134,8 +169,10 @@ partial void ProcessOptimStepResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v1/rl/training-sessions/{sessionId}/operations/optim-step", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/rl/training-sessions/{sessionId}/operations/optim-step", + baseUri: ResolveBaseUri( + servers: s_OptimStepServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -209,7 +246,7 @@ partial void ProcessOptimStepResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "OptimStep", methodName: "OptimStepAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}/operations/optim-step\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/optim-step\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -243,7 +280,7 @@ partial void ProcessOptimStepResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "OptimStep", methodName: "OptimStepAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}/operations/optim-step\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/optim-step\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -284,7 +321,7 @@ partial void ProcessOptimStepResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "OptimStep", methodName: "OptimStepAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}/operations/optim-step\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/optim-step\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -332,7 +369,7 @@ partial void ProcessOptimStepResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "OptimStep", methodName: "OptimStepAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}/operations/optim-step\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/optim-step\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -354,7 +391,7 @@ partial void ProcessOptimStepResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "OptimStep", methodName: "OptimStepAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}/operations/optim-step\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/optim-step\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.RlClient.Sample.g.cs b/src/libs/Together/Generated/Together.RlClient.Sample.g.cs index 386e39f8..bd11965d 100644 --- a/src/libs/Together/Generated/Together.RlClient.Sample.g.cs +++ b/src/libs/Together/Generated/Together.RlClient.Sample.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class RlClient { + private static readonly global::Together.AutoSDKServer[] s_SampleServers = 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_SampleSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -59,6 +72,22 @@ partial void ProcessSampleResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// import uuid
+ /// from together import Together
+ /// client = Together()
+ /// # Token IDs come from the base model's tokenizer.
+ /// operation = client.post_training.operations.sample(
+ /// "<SESSION_ID>",
+ /// idempotency_key=str(uuid.uuid4()),
+ /// model_inputs=[
+ /// {"chunks": [{"encoded_text": {"tokens": [791, 6864, 315, 9822]}}]}
+ /// ],
+ /// num_samples=4,
+ /// sampling_params={"max_tokens": 256, "temperature": 1.0},
+ /// )
+ /// print(operation.id, operation.status) + ///
public async global::System.Threading.Tasks.Task SampleAsync( string sessionId, @@ -92,6 +121,22 @@ partial void ProcessSampleResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// import uuid
+ /// from together import Together
+ /// client = Together()
+ /// # Token IDs come from the base model's tokenizer.
+ /// operation = client.post_training.operations.sample(
+ /// "<SESSION_ID>",
+ /// idempotency_key=str(uuid.uuid4()),
+ /// model_inputs=[
+ /// {"chunks": [{"encoded_text": {"tokens": [791, 6864, 315, 9822]}}]}
+ /// ],
+ /// num_samples=4,
+ /// sampling_params={"max_tokens": 256, "temperature": 1.0},
+ /// )
+ /// print(operation.id, operation.status) + ///
public async global::System.Threading.Tasks.Task> SampleAsResponseAsync( string sessionId, @@ -134,8 +179,10 @@ partial void ProcessSampleResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v1/rl/training-sessions/{sessionId}/operations/sample", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/rl/training-sessions/{sessionId}/operations/sample", + baseUri: ResolveBaseUri( + servers: s_SampleServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -209,7 +256,7 @@ partial void ProcessSampleResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "Sample", methodName: "SampleAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}/operations/sample\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/sample\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -243,7 +290,7 @@ partial void ProcessSampleResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "Sample", methodName: "SampleAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}/operations/sample\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/sample\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -284,7 +331,7 @@ partial void ProcessSampleResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "Sample", methodName: "SampleAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}/operations/sample\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/sample\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -332,7 +379,7 @@ partial void ProcessSampleResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "Sample", methodName: "SampleAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}/operations/sample\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/sample\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -354,7 +401,7 @@ partial void ProcessSampleResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "Sample", methodName: "SampleAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}/operations/sample\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/sample\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.RlClient.StartTrainingSession.g.cs b/src/libs/Together/Generated/Together.RlClient.StartTrainingSession.g.cs index d3bdbcdd..576b6d5f 100644 --- a/src/libs/Together/Generated/Together.RlClient.StartTrainingSession.g.cs +++ b/src/libs/Together/Generated/Together.RlClient.StartTrainingSession.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class RlClient { + private static readonly global::Together.AutoSDKServer[] s_StartTrainingSessionServers = 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_StartTrainingSessionSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -49,6 +62,16 @@ partial void ProcessStartTrainingSessionResponseContent( /// 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()
+ /// session = client.post_training.sessions.create(
+ /// model_resources_id="<MODEL_RESOURCES_ID>",
+ /// display_name="grpo-math",
+ /// lora_config={"rank": 32},
+ /// )
+ /// print(session.id, session.status) + ///
public async global::System.Threading.Tasks.Task StartTrainingSessionAsync( global::Together.RlStartTrainingSessionRequest request, @@ -72,6 +95,16 @@ partial void ProcessStartTrainingSessionResponseContent( /// 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()
+ /// session = client.post_training.sessions.create(
+ /// model_resources_id="<MODEL_RESOURCES_ID>",
+ /// display_name="grpo-math",
+ /// lora_config={"rank": 32},
+ /// )
+ /// print(session.id, session.status) + ///
public async global::System.Threading.Tasks.Task> StartTrainingSessionAsResponseAsync( global::Together.RlStartTrainingSessionRequest request, @@ -110,8 +143,10 @@ partial void ProcessStartTrainingSessionResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: "/v1/rl/training-sessions", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: "/rl/training-sessions", + baseUri: ResolveBaseUri( + servers: s_StartTrainingSessionServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -177,7 +212,7 @@ partial void ProcessStartTrainingSessionResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "StartTrainingSession", methodName: "StartTrainingSessionAsync", - pathTemplate: "\"/v1/rl/training-sessions\"", + pathTemplate: "\"/rl/training-sessions\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -211,7 +246,7 @@ partial void ProcessStartTrainingSessionResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "StartTrainingSession", methodName: "StartTrainingSessionAsync", - pathTemplate: "\"/v1/rl/training-sessions\"", + pathTemplate: "\"/rl/training-sessions\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -252,7 +287,7 @@ partial void ProcessStartTrainingSessionResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "StartTrainingSession", methodName: "StartTrainingSessionAsync", - pathTemplate: "\"/v1/rl/training-sessions\"", + pathTemplate: "\"/rl/training-sessions\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -300,7 +335,7 @@ partial void ProcessStartTrainingSessionResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "StartTrainingSession", methodName: "StartTrainingSessionAsync", - pathTemplate: "\"/v1/rl/training-sessions\"", + pathTemplate: "\"/rl/training-sessions\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -322,7 +357,7 @@ partial void ProcessStartTrainingSessionResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "StartTrainingSession", methodName: "StartTrainingSessionAsync", - pathTemplate: "\"/v1/rl/training-sessions\"", + pathTemplate: "\"/rl/training-sessions\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.RlClient.StopModelResources.g.cs b/src/libs/Together/Generated/Together.RlClient.StopModelResources.g.cs index 9b14312f..18da3938 100644 --- a/src/libs/Together/Generated/Together.RlClient.StopModelResources.g.cs +++ b/src/libs/Together/Generated/Together.RlClient.StopModelResources.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class RlClient { + private static readonly global::Together.AutoSDKServer[] s_StopModelResourcesServers = 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_StopModelResourcesSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -57,6 +70,12 @@ partial void ProcessStopModelResourcesResponseContent( /// 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()
+ /// resource = client.post_training.model_resources.stop("<MODEL_RESOURCES_ID>")
+ /// print(resource.status) + ///
public async global::System.Threading.Tasks.Task StopModelResourcesAsync( string modelResourcesId, bool? force = default, @@ -86,6 +105,12 @@ partial void ProcessStopModelResourcesResponseContent( /// 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()
+ /// resource = client.post_training.model_resources.stop("<MODEL_RESOURCES_ID>")
+ /// print(resource.status) + ///
public async global::System.Threading.Tasks.Task> StopModelResourcesAsResponseAsync( string modelResourcesId, bool? force = default, @@ -123,8 +148,10 @@ partial void ProcessStopModelResourcesResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v1/rl/model-resources/{modelResourcesId}/stop", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/rl/model-resources/{modelResourcesId}/stop", + baseUri: ResolveBaseUri( + servers: s_StopModelResourcesServers, + defaultBaseUrl: "https://api.together.ai/v1")); __pathBuilder .AddOptionalParameter("force", force?.ToString().ToLowerInvariant()) ; @@ -188,7 +215,7 @@ partial void ProcessStopModelResourcesResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "StopModelResources", methodName: "StopModelResourcesAsync", - pathTemplate: "$\"/v1/rl/model-resources/{modelResourcesId}/stop\"", + pathTemplate: "$\"/rl/model-resources/{modelResourcesId}/stop\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -222,7 +249,7 @@ partial void ProcessStopModelResourcesResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "StopModelResources", methodName: "StopModelResourcesAsync", - pathTemplate: "$\"/v1/rl/model-resources/{modelResourcesId}/stop\"", + pathTemplate: "$\"/rl/model-resources/{modelResourcesId}/stop\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -263,7 +290,7 @@ partial void ProcessStopModelResourcesResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "StopModelResources", methodName: "StopModelResourcesAsync", - pathTemplate: "$\"/v1/rl/model-resources/{modelResourcesId}/stop\"", + pathTemplate: "$\"/rl/model-resources/{modelResourcesId}/stop\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -311,7 +338,7 @@ partial void ProcessStopModelResourcesResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "StopModelResources", methodName: "StopModelResourcesAsync", - pathTemplate: "$\"/v1/rl/model-resources/{modelResourcesId}/stop\"", + pathTemplate: "$\"/rl/model-resources/{modelResourcesId}/stop\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -333,7 +360,7 @@ partial void ProcessStopModelResourcesResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "StopModelResources", methodName: "StopModelResourcesAsync", - pathTemplate: "$\"/v1/rl/model-resources/{modelResourcesId}/stop\"", + pathTemplate: "$\"/rl/model-resources/{modelResourcesId}/stop\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.RlClient.StopTrainingSession.g.cs b/src/libs/Together/Generated/Together.RlClient.StopTrainingSession.g.cs index 552b6607..fc892152 100644 --- a/src/libs/Together/Generated/Together.RlClient.StopTrainingSession.g.cs +++ b/src/libs/Together/Generated/Together.RlClient.StopTrainingSession.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class RlClient { + private static readonly global::Together.AutoSDKServer[] s_StopTrainingSessionServers = 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_StopTrainingSessionSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -51,6 +64,12 @@ partial void ProcessStopTrainingSessionResponseContent( /// 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()
+ /// session = client.post_training.sessions.stop("<SESSION_ID>")
+ /// print(session.status) + ///
public async global::System.Threading.Tasks.Task StopTrainingSessionAsync( string sessionId, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -74,6 +93,12 @@ partial void ProcessStopTrainingSessionResponseContent( /// 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()
+ /// session = client.post_training.sessions.stop("<SESSION_ID>")
+ /// print(session.status) + ///
public async global::System.Threading.Tasks.Task> StopTrainingSessionAsResponseAsync( string sessionId, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -109,8 +134,10 @@ partial void ProcessStopTrainingSessionResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v1/rl/training-sessions/{sessionId}/stop", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/rl/training-sessions/{sessionId}/stop", + baseUri: ResolveBaseUri( + servers: s_StopTrainingSessionServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -170,7 +197,7 @@ partial void ProcessStopTrainingSessionResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "StopTrainingSession", methodName: "StopTrainingSessionAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}/stop\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/stop\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -204,7 +231,7 @@ partial void ProcessStopTrainingSessionResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "StopTrainingSession", methodName: "StopTrainingSessionAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}/stop\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/stop\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -245,7 +272,7 @@ partial void ProcessStopTrainingSessionResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "StopTrainingSession", methodName: "StopTrainingSessionAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}/stop\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/stop\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -293,7 +320,7 @@ partial void ProcessStopTrainingSessionResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "StopTrainingSession", methodName: "StopTrainingSessionAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}/stop\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/stop\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -315,7 +342,7 @@ partial void ProcessStopTrainingSessionResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "StopTrainingSession", methodName: "StopTrainingSessionAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}/stop\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/stop\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.RlClient.UpdateTrainingSession.g.cs b/src/libs/Together/Generated/Together.RlClient.UpdateTrainingSession.g.cs index c15ce1f8..ca9761c7 100644 --- a/src/libs/Together/Generated/Together.RlClient.UpdateTrainingSession.g.cs +++ b/src/libs/Together/Generated/Together.RlClient.UpdateTrainingSession.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class RlClient { + private static readonly global::Together.AutoSDKServer[] s_UpdateTrainingSessionServers = 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_UpdateTrainingSessionSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -54,6 +67,15 @@ partial void ProcessUpdateTrainingSessionResponseContent( /// 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()
+ /// session = client.post_training.sessions.update(
+ /// "<SESSION_ID>",
+ /// display_name="grpo-math-run-2",
+ /// )
+ /// print(session.display_name) + ///
public async global::System.Threading.Tasks.Task UpdateTrainingSessionAsync( string sessionId, @@ -82,6 +104,15 @@ partial void ProcessUpdateTrainingSessionResponseContent( /// 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()
+ /// session = client.post_training.sessions.update(
+ /// "<SESSION_ID>",
+ /// display_name="grpo-math-run-2",
+ /// )
+ /// print(session.display_name) + ///
public async global::System.Threading.Tasks.Task> UpdateTrainingSessionAsResponseAsync( string sessionId, @@ -122,8 +153,10 @@ partial void ProcessUpdateTrainingSessionResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v1/rl/training-sessions/{sessionId}", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/rl/training-sessions/{sessionId}", + baseUri: ResolveBaseUri( + servers: s_UpdateTrainingSessionServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -190,7 +223,7 @@ partial void ProcessUpdateTrainingSessionResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "UpdateTrainingSession", methodName: "UpdateTrainingSessionAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}\"", httpMethod: "PATCH", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -224,7 +257,7 @@ partial void ProcessUpdateTrainingSessionResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "UpdateTrainingSession", methodName: "UpdateTrainingSessionAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}\"", httpMethod: "PATCH", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -265,7 +298,7 @@ partial void ProcessUpdateTrainingSessionResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "UpdateTrainingSession", methodName: "UpdateTrainingSessionAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}\"", httpMethod: "PATCH", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -313,7 +346,7 @@ partial void ProcessUpdateTrainingSessionResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "UpdateTrainingSession", methodName: "UpdateTrainingSessionAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}\"", httpMethod: "PATCH", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -335,7 +368,7 @@ partial void ProcessUpdateTrainingSessionResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "UpdateTrainingSession", methodName: "UpdateTrainingSessionAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}\"", httpMethod: "PATCH", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.RlClient.WeightsSync.g.cs b/src/libs/Together/Generated/Together.RlClient.WeightsSync.g.cs index 1e040ba8..ad784b1d 100644 --- a/src/libs/Together/Generated/Together.RlClient.WeightsSync.g.cs +++ b/src/libs/Together/Generated/Together.RlClient.WeightsSync.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class RlClient { + private static readonly global::Together.AutoSDKServer[] s_WeightsSyncServers = 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_WeightsSyncSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -59,6 +72,17 @@ partial void ProcessWeightsSyncResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// import uuid
+ /// from together import Together
+ /// client = Together()
+ /// operation = client.post_training.operations.weights_sync(
+ /// "<SESSION_ID>",
+ /// idempotency_key=str(uuid.uuid4()),
+ /// weight_sync_type="WEIGHT_SYNC_TYPE_SYNCHRONOUS",
+ /// )
+ /// print(operation.id, operation.status) + ///
public async global::System.Threading.Tasks.Task WeightsSyncAsync( string sessionId, @@ -92,6 +116,17 @@ partial void ProcessWeightsSyncResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// import uuid
+ /// from together import Together
+ /// client = Together()
+ /// operation = client.post_training.operations.weights_sync(
+ /// "<SESSION_ID>",
+ /// idempotency_key=str(uuid.uuid4()),
+ /// weight_sync_type="WEIGHT_SYNC_TYPE_SYNCHRONOUS",
+ /// )
+ /// print(operation.id, operation.status) + ///
public async global::System.Threading.Tasks.Task> WeightsSyncAsResponseAsync( string sessionId, @@ -134,8 +169,10 @@ partial void ProcessWeightsSyncResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v1/rl/training-sessions/{sessionId}/operations/weights-sync", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/rl/training-sessions/{sessionId}/operations/weights-sync", + baseUri: ResolveBaseUri( + servers: s_WeightsSyncServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -209,7 +246,7 @@ partial void ProcessWeightsSyncResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "WeightsSync", methodName: "WeightsSyncAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}/operations/weights-sync\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/weights-sync\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -243,7 +280,7 @@ partial void ProcessWeightsSyncResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "WeightsSync", methodName: "WeightsSyncAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}/operations/weights-sync\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/weights-sync\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -284,7 +321,7 @@ partial void ProcessWeightsSyncResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "WeightsSync", methodName: "WeightsSyncAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}/operations/weights-sync\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/weights-sync\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -332,7 +369,7 @@ partial void ProcessWeightsSyncResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "WeightsSync", methodName: "WeightsSyncAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}/operations/weights-sync\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/weights-sync\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -354,7 +391,7 @@ partial void ProcessWeightsSyncResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "WeightsSync", methodName: "WeightsSyncAsync", - pathTemplate: "$\"/v1/rl/training-sessions/{sessionId}/operations/weights-sync\"", + pathTemplate: "$\"/rl/training-sessions/{sessionId}/operations/weights-sync\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.RlClient.g.cs b/src/libs/Together/Generated/Together.RlClient.g.cs index 3842dadf..4c6acaf4 100644 --- a/src/libs/Together/Generated/Together.RlClient.g.cs +++ b/src/libs/Together/Generated/Together.RlClient.g.cs @@ -12,7 +12,7 @@ public sealed partial class RlClient : global::Together.IRlClient, global::Syste /// /// Default environment for APIs /// - public const string DefaultBaseUrl = "https://api.together.ai/"; + public const string DefaultBaseUrl = "https://api.together.ai/v1"; private bool _disposeHttpClient = true; @@ -20,7 +20,7 @@ public sealed partial class RlClient : global::Together.IRlClient, global::Syste 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; } @@ -53,6 +53,34 @@ public sealed partial class RlClient : global::Together.IRlClient, global::Syste } + + 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 RlClient. /// If no httpClient is provided, a new one will be created. @@ -151,5 +179,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.RolloutService.JsonSerializerContext.g.cs b/src/libs/Together/Generated/Together.RolloutService.JsonSerializerContext.g.cs index edf0cf19..a1b14f54 100644 --- a/src/libs/Together/Generated/Together.RolloutService.JsonSerializerContext.g.cs +++ b/src/libs/Together/Generated/Together.RolloutService.JsonSerializerContext.g.cs @@ -2,101 +2,7 @@ #nullable enable namespace Together -{ - /// - /// - /// - [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( - DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull - )] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(double))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeDeleteResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeListRolloutsResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeRollout))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeCreateRolloutRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeCanaryConfig))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeBlueGreenConfig))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeRollingConfig))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeMetricRule))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(object))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeRolloutStep))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeMetricRuleName), TypeInfoPropertyName = "DeMetricRuleName2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeMetricRuleStat), TypeInfoPropertyName = "DeMetricRuleStat2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeThresholdCheck))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeRegressionCheck))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeThresholdCheckOperator), TypeInfoPropertyName = "DeThresholdCheckOperator2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeRegressionCheckDirection), TypeInfoPropertyName = "DeRegressionCheckDirection2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DePauseRolloutRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeResumeRolloutRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeCancelRolloutRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeCancelRolloutRequestDisposition), TypeInfoPropertyName = "DeCancelRolloutRequestDisposition2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DePromoteRolloutRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeRolloutDefaultsPreview))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DePreviewWarning))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DePauseInfo))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeRolloutStrategy), TypeInfoPropertyName = "DeRolloutStrategy2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeRolloutState), TypeInfoPropertyName = "DeRolloutState2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeRolloutStatus))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeRolloutCondition))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeRolloutStepStatus))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeRolloutConditionCategory), TypeInfoPropertyName = "DeRolloutConditionCategory2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeMetricResult))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeRolloutConditionType), TypeInfoPropertyName = "DeRolloutConditionType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeRolloutStepStatusState), TypeInfoPropertyName = "DeRolloutStepStatusState2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeMetricResultStat), TypeInfoPropertyName = "DeMetricResultStat2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeMetricResultCheck), TypeInfoPropertyName = "DeMetricResultCheck2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeMetricResultOperator), TypeInfoPropertyName = "DeMetricResultOperator2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeMetricResultDirection), TypeInfoPropertyName = "DeMetricResultDirection2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeMetricResultVerdict), TypeInfoPropertyName = "DeMetricResultVerdict2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ErrorData))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ErrorDataError))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RolloutServiceListRolloutsFilter), TypeInfoPropertyName = "RolloutServiceListRolloutsFilter2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(double?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeMetricRuleName?), TypeInfoPropertyName = "NullableDeMetricRuleName2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeMetricRuleStat?), TypeInfoPropertyName = "NullableDeMetricRuleStat2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeThresholdCheckOperator?), TypeInfoPropertyName = "NullableDeThresholdCheckOperator2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeRegressionCheckDirection?), TypeInfoPropertyName = "NullableDeRegressionCheckDirection2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeCancelRolloutRequestDisposition?), TypeInfoPropertyName = "NullableDeCancelRolloutRequestDisposition2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeRolloutStrategy?), TypeInfoPropertyName = "NullableDeRolloutStrategy2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeRolloutState?), TypeInfoPropertyName = "NullableDeRolloutState2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeRolloutConditionCategory?), TypeInfoPropertyName = "NullableDeRolloutConditionCategory2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeRolloutConditionType?), TypeInfoPropertyName = "NullableDeRolloutConditionType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeRolloutStepStatusState?), TypeInfoPropertyName = "NullableDeRolloutStepStatusState2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeMetricResultStat?), TypeInfoPropertyName = "NullableDeMetricResultStat2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeMetricResultCheck?), TypeInfoPropertyName = "NullableDeMetricResultCheck2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeMetricResultOperator?), TypeInfoPropertyName = "NullableDeMetricResultOperator2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeMetricResultDirection?), TypeInfoPropertyName = "NullableDeMetricResultDirection2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeMetricResultVerdict?), TypeInfoPropertyName = "NullableDeMetricResultVerdict2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.RolloutServiceListRolloutsFilter?), TypeInfoPropertyName = "NullableRolloutServiceListRolloutsFilter2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - internal sealed partial class RolloutServiceSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext - { - } - /// +{ /// /// /// public sealed partial class RolloutServiceSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext @@ -140,26 +46,7 @@ private RolloutServiceSourceGenerationContext(global::System.Text.Json.JsonSeria [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) { - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter, global::System.Collections.Generic.IList>()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter>()); - options.Converters.Add(new global::Together.JsonConverters.UnixTimestampJsonConverter()); - options.Converters.Add(new LazyEnumJsonConverterFactory()); + global::Together.SourceGenerationContext.AddConverters(options); } private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() @@ -174,244 +61,6 @@ public static void AddConverters(global::System.Text.Json.JsonSerializerOptions return options; } - - private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Serialization.JsonConverterFactory - { - public override bool CanConvert(global::System.Type typeToConvert) - { - return - typeToConvert == typeof(global::Together.DeMetricRuleName) - - || typeToConvert == typeof(global::Together.DeMetricRuleName?) - - || typeToConvert == typeof(global::Together.DeMetricRuleStat) - - || typeToConvert == typeof(global::Together.DeMetricRuleStat?) - - || typeToConvert == typeof(global::Together.DeThresholdCheckOperator) - - || typeToConvert == typeof(global::Together.DeThresholdCheckOperator?) - - || typeToConvert == typeof(global::Together.DeRegressionCheckDirection) - - || typeToConvert == typeof(global::Together.DeRegressionCheckDirection?) - - || typeToConvert == typeof(global::Together.DeCancelRolloutRequestDisposition) - - || typeToConvert == typeof(global::Together.DeCancelRolloutRequestDisposition?) - - || typeToConvert == typeof(global::Together.DeRolloutStrategy) - - || typeToConvert == typeof(global::Together.DeRolloutStrategy?) - - || typeToConvert == typeof(global::Together.DeRolloutState) - - || typeToConvert == typeof(global::Together.DeRolloutState?) - - || typeToConvert == typeof(global::Together.DeRolloutConditionCategory) - - || typeToConvert == typeof(global::Together.DeRolloutConditionCategory?) - - || typeToConvert == typeof(global::Together.DeRolloutConditionType) - - || typeToConvert == typeof(global::Together.DeRolloutConditionType?) - - || typeToConvert == typeof(global::Together.DeRolloutStepStatusState) - - || typeToConvert == typeof(global::Together.DeRolloutStepStatusState?) - - || typeToConvert == typeof(global::Together.DeMetricResultStat) - - || typeToConvert == typeof(global::Together.DeMetricResultStat?) - - || typeToConvert == typeof(global::Together.DeMetricResultCheck) - - || typeToConvert == typeof(global::Together.DeMetricResultCheck?) - - || typeToConvert == typeof(global::Together.DeMetricResultOperator) - - || typeToConvert == typeof(global::Together.DeMetricResultOperator?) - - || typeToConvert == typeof(global::Together.DeMetricResultDirection) - - || typeToConvert == typeof(global::Together.DeMetricResultDirection?) - - || typeToConvert == typeof(global::Together.DeMetricResultVerdict) - - || typeToConvert == typeof(global::Together.DeMetricResultVerdict?) - - || typeToConvert == typeof(global::Together.RolloutServiceListRolloutsFilter) - - || typeToConvert == typeof(global::Together.RolloutServiceListRolloutsFilter?); - } - - public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - if (typeToConvert == typeof(global::Together.DeMetricRuleName)) - { - return new global::Together.JsonConverters.DeMetricRuleNameJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeMetricRuleName?)) - { - return new global::Together.JsonConverters.DeMetricRuleNameNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeMetricRuleStat)) - { - return new global::Together.JsonConverters.DeMetricRuleStatJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeMetricRuleStat?)) - { - return new global::Together.JsonConverters.DeMetricRuleStatNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeThresholdCheckOperator)) - { - return new global::Together.JsonConverters.DeThresholdCheckOperatorJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeThresholdCheckOperator?)) - { - return new global::Together.JsonConverters.DeThresholdCheckOperatorNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeRegressionCheckDirection)) - { - return new global::Together.JsonConverters.DeRegressionCheckDirectionJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeRegressionCheckDirection?)) - { - return new global::Together.JsonConverters.DeRegressionCheckDirectionNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeCancelRolloutRequestDisposition)) - { - return new global::Together.JsonConverters.DeCancelRolloutRequestDispositionJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeCancelRolloutRequestDisposition?)) - { - return new global::Together.JsonConverters.DeCancelRolloutRequestDispositionNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeRolloutStrategy)) - { - return new global::Together.JsonConverters.DeRolloutStrategyJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeRolloutStrategy?)) - { - return new global::Together.JsonConverters.DeRolloutStrategyNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeRolloutState)) - { - return new global::Together.JsonConverters.DeRolloutStateJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeRolloutState?)) - { - return new global::Together.JsonConverters.DeRolloutStateNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeRolloutConditionCategory)) - { - return new global::Together.JsonConverters.DeRolloutConditionCategoryJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeRolloutConditionCategory?)) - { - return new global::Together.JsonConverters.DeRolloutConditionCategoryNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeRolloutConditionType)) - { - return new global::Together.JsonConverters.DeRolloutConditionTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeRolloutConditionType?)) - { - return new global::Together.JsonConverters.DeRolloutConditionTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeRolloutStepStatusState)) - { - return new global::Together.JsonConverters.DeRolloutStepStatusStateJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeRolloutStepStatusState?)) - { - return new global::Together.JsonConverters.DeRolloutStepStatusStateNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeMetricResultStat)) - { - return new global::Together.JsonConverters.DeMetricResultStatJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeMetricResultStat?)) - { - return new global::Together.JsonConverters.DeMetricResultStatNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeMetricResultCheck)) - { - return new global::Together.JsonConverters.DeMetricResultCheckJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeMetricResultCheck?)) - { - return new global::Together.JsonConverters.DeMetricResultCheckNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeMetricResultOperator)) - { - return new global::Together.JsonConverters.DeMetricResultOperatorJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeMetricResultOperator?)) - { - return new global::Together.JsonConverters.DeMetricResultOperatorNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeMetricResultDirection)) - { - return new global::Together.JsonConverters.DeMetricResultDirectionJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeMetricResultDirection?)) - { - return new global::Together.JsonConverters.DeMetricResultDirectionNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeMetricResultVerdict)) - { - return new global::Together.JsonConverters.DeMetricResultVerdictJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeMetricResultVerdict?)) - { - return new global::Together.JsonConverters.DeMetricResultVerdictNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.RolloutServiceListRolloutsFilter)) - { - return new global::Together.JsonConverters.RolloutServiceListRolloutsFilterJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.RolloutServiceListRolloutsFilter?)) - { - return new global::Together.JsonConverters.RolloutServiceListRolloutsFilterNullableJsonConverter(); - } - throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); - } - } - private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver { private readonly object _gate = new(); @@ -451,7 +100,7 @@ private sealed class LazyChunkResolver : global::System.Text.Json.Serialization. { return index switch { - 0 => new RolloutServiceSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), + 0 => global::Together.SourceGenerationContext.TypeInfoResolver, _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), }; } diff --git a/src/libs/Together/Generated/Together.RolloutServiceClient.RolloutServiceCancelRollout.g.cs b/src/libs/Together/Generated/Together.RolloutServiceClient.RolloutServiceCancelRollout.g.cs index 13b9d477..2f9ab3bf 100644 --- a/src/libs/Together/Generated/Together.RolloutServiceClient.RolloutServiceCancelRollout.g.cs +++ b/src/libs/Together/Generated/Together.RolloutServiceClient.RolloutServiceCancelRollout.g.cs @@ -6,6 +6,14 @@ namespace Together public partial class RolloutServiceClient { + private static readonly global::Together.AutoSDKServer[] s_RolloutServiceCancelRolloutServers = 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_RolloutServiceCancelRolloutSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -64,6 +72,18 @@ partial void ProcessRolloutServiceCancelRolloutResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// rollout = client.beta.endpoints.rollouts.cancel(
+ /// "rol_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// reason="Latency regression on the target",
+ /// )
+ /// print(rollout.id, rollout.state) + ///
public async global::System.Threading.Tasks.Task RolloutServiceCancelRolloutAsync( string projectId, string endpointId, @@ -102,6 +122,18 @@ partial void ProcessRolloutServiceCancelRolloutResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// rollout = client.beta.endpoints.rollouts.cancel(
+ /// "rol_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// reason="Latency regression on the target",
+ /// )
+ /// print(rollout.id, rollout.state) + ///
public async global::System.Threading.Tasks.Task> RolloutServiceCancelRolloutAsResponseAsync( string projectId, string endpointId, @@ -146,8 +178,10 @@ partial void ProcessRolloutServiceCancelRolloutResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v2/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/cancel", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/cancel", + baseUri: ResolveBaseUri( + servers: s_RolloutServiceCancelRolloutServers, + defaultBaseUrl: "https://api.together.ai/v2")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -216,7 +250,7 @@ partial void ProcessRolloutServiceCancelRolloutResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RolloutServiceCancelRollout", methodName: "RolloutServiceCancelRolloutAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/cancel\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/cancel\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -250,7 +284,7 @@ partial void ProcessRolloutServiceCancelRolloutResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RolloutServiceCancelRollout", methodName: "RolloutServiceCancelRolloutAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/cancel\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/cancel\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -291,7 +325,7 @@ partial void ProcessRolloutServiceCancelRolloutResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RolloutServiceCancelRollout", methodName: "RolloutServiceCancelRolloutAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/cancel\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/cancel\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -339,7 +373,7 @@ partial void ProcessRolloutServiceCancelRolloutResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RolloutServiceCancelRollout", methodName: "RolloutServiceCancelRolloutAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/cancel\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/cancel\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -361,7 +395,7 @@ partial void ProcessRolloutServiceCancelRolloutResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RolloutServiceCancelRollout", methodName: "RolloutServiceCancelRolloutAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/cancel\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/cancel\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.RolloutServiceClient.RolloutServiceCreateRollout.g.cs b/src/libs/Together/Generated/Together.RolloutServiceClient.RolloutServiceCreateRollout.g.cs index 2a190650..70164377 100644 --- a/src/libs/Together/Generated/Together.RolloutServiceClient.RolloutServiceCreateRollout.g.cs +++ b/src/libs/Together/Generated/Together.RolloutServiceClient.RolloutServiceCreateRollout.g.cs @@ -6,6 +6,14 @@ namespace Together public partial class RolloutServiceClient { + private static readonly global::Together.AutoSDKServer[] s_RolloutServiceCreateRolloutServers = 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_RolloutServiceCreateRolloutSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -59,6 +67,34 @@ partial void ProcessRolloutServiceCreateRolloutResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// rollout = client.beta.endpoints.rollouts.create(
+ /// "ep_abc123",
+ /// project_id=project_id,
+ /// source_deployment_id="dep_abc123",
+ /// target_deployment_id="dep_def456",
+ /// canary={
+ /// "steps": [{"traffic": 25}, {"traffic": 50}, {"traffic": 100}],
+ /// "step_interval": "300s",
+ /// },
+ /// metrics=[
+ /// {
+ /// "name": "router_latency",
+ /// "stat": "METRIC_STAT_TYPE_PERCENTILE",
+ /// "percentile": 95,
+ /// "threshold_check": {
+ /// "value": 30000,
+ /// "operator": "THRESHOLD_OPERATOR_LT",
+ /// },
+ /// "window": "300s",
+ /// }
+ /// ],
+ /// )
+ /// print(rollout.id, rollout.state) + ///
public async global::System.Threading.Tasks.Task RolloutServiceCreateRolloutAsync( string projectId, string endpointId, @@ -92,6 +128,34 @@ partial void ProcessRolloutServiceCreateRolloutResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// rollout = client.beta.endpoints.rollouts.create(
+ /// "ep_abc123",
+ /// project_id=project_id,
+ /// source_deployment_id="dep_abc123",
+ /// target_deployment_id="dep_def456",
+ /// canary={
+ /// "steps": [{"traffic": 25}, {"traffic": 50}, {"traffic": 100}],
+ /// "step_interval": "300s",
+ /// },
+ /// metrics=[
+ /// {
+ /// "name": "router_latency",
+ /// "stat": "METRIC_STAT_TYPE_PERCENTILE",
+ /// "percentile": 95,
+ /// "threshold_check": {
+ /// "value": 30000,
+ /// "operator": "THRESHOLD_OPERATOR_LT",
+ /// },
+ /// "window": "300s",
+ /// }
+ /// ],
+ /// )
+ /// print(rollout.id, rollout.state) + ///
public async global::System.Threading.Tasks.Task> RolloutServiceCreateRolloutAsResponseAsync( string projectId, string endpointId, @@ -134,8 +198,10 @@ partial void ProcessRolloutServiceCreateRolloutResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v2/projects/{projectId}/endpoints/{endpointId}/rollouts", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/projects/{projectId}/endpoints/{endpointId}/rollouts", + baseUri: ResolveBaseUri( + servers: s_RolloutServiceCreateRolloutServers, + defaultBaseUrl: "https://api.together.ai/v2")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -203,7 +269,7 @@ partial void ProcessRolloutServiceCreateRolloutResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RolloutServiceCreateRollout", methodName: "RolloutServiceCreateRolloutAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/rollouts\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -237,7 +303,7 @@ partial void ProcessRolloutServiceCreateRolloutResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RolloutServiceCreateRollout", methodName: "RolloutServiceCreateRolloutAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/rollouts\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -278,7 +344,7 @@ partial void ProcessRolloutServiceCreateRolloutResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RolloutServiceCreateRollout", methodName: "RolloutServiceCreateRolloutAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/rollouts\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -326,7 +392,7 @@ partial void ProcessRolloutServiceCreateRolloutResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RolloutServiceCreateRollout", methodName: "RolloutServiceCreateRolloutAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/rollouts\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -348,7 +414,7 @@ partial void ProcessRolloutServiceCreateRolloutResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RolloutServiceCreateRollout", methodName: "RolloutServiceCreateRolloutAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/rollouts\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.RolloutServiceClient.RolloutServiceDeleteRollout.g.cs b/src/libs/Together/Generated/Together.RolloutServiceClient.RolloutServiceDeleteRollout.g.cs index ec476df2..b0d1d944 100644 --- a/src/libs/Together/Generated/Together.RolloutServiceClient.RolloutServiceDeleteRollout.g.cs +++ b/src/libs/Together/Generated/Together.RolloutServiceClient.RolloutServiceDeleteRollout.g.cs @@ -6,6 +6,14 @@ namespace Together public partial class RolloutServiceClient { + private static readonly global::Together.AutoSDKServer[] s_RolloutServiceDeleteRolloutServers = 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_RolloutServiceDeleteRolloutSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -66,6 +74,16 @@ partial void ProcessRolloutServiceDeleteRolloutResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// client.beta.endpoints.rollouts.delete(
+ /// "rol_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// ) + ///
public async global::System.Threading.Tasks.Task RolloutServiceDeleteRolloutAsync( string projectId, string endpointId, @@ -104,6 +122,16 @@ partial void ProcessRolloutServiceDeleteRolloutResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// client.beta.endpoints.rollouts.delete(
+ /// "rol_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// ) + ///
public async global::System.Threading.Tasks.Task> RolloutServiceDeleteRolloutAsResponseAsync( string projectId, string endpointId, @@ -145,8 +173,10 @@ partial void ProcessRolloutServiceDeleteRolloutResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v2/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}", + baseUri: ResolveBaseUri( + servers: s_RolloutServiceDeleteRolloutServers, + defaultBaseUrl: "https://api.together.ai/v2")); __pathBuilder .AddOptionalParameter("etag", etag) ; @@ -212,7 +242,7 @@ partial void ProcessRolloutServiceDeleteRolloutResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RolloutServiceDeleteRollout", methodName: "RolloutServiceDeleteRolloutAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -246,7 +276,7 @@ partial void ProcessRolloutServiceDeleteRolloutResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RolloutServiceDeleteRollout", methodName: "RolloutServiceDeleteRolloutAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -287,7 +317,7 @@ partial void ProcessRolloutServiceDeleteRolloutResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RolloutServiceDeleteRollout", methodName: "RolloutServiceDeleteRolloutAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -335,7 +365,7 @@ partial void ProcessRolloutServiceDeleteRolloutResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RolloutServiceDeleteRollout", methodName: "RolloutServiceDeleteRolloutAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -357,7 +387,7 @@ partial void ProcessRolloutServiceDeleteRolloutResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RolloutServiceDeleteRollout", methodName: "RolloutServiceDeleteRolloutAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.RolloutServiceClient.RolloutServiceGetRollout.g.cs b/src/libs/Together/Generated/Together.RolloutServiceClient.RolloutServiceGetRollout.g.cs index feddb93f..b25a3403 100644 --- a/src/libs/Together/Generated/Together.RolloutServiceClient.RolloutServiceGetRollout.g.cs +++ b/src/libs/Together/Generated/Together.RolloutServiceClient.RolloutServiceGetRollout.g.cs @@ -6,6 +6,14 @@ namespace Together public partial class RolloutServiceClient { + private static readonly global::Together.AutoSDKServer[] s_RolloutServiceGetRolloutServers = 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_RolloutServiceGetRolloutSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -61,6 +69,17 @@ partial void ProcessRolloutServiceGetRolloutResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// rollout = client.beta.endpoints.rollouts.retrieve(
+ /// "rol_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// )
+ /// print(rollout.id, rollout.state) + ///
public async global::System.Threading.Tasks.Task RolloutServiceGetRolloutAsync( string projectId, string endpointId, @@ -94,6 +113,17 @@ partial void ProcessRolloutServiceGetRolloutResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// rollout = client.beta.endpoints.rollouts.retrieve(
+ /// "rol_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// )
+ /// print(rollout.id, rollout.state) + ///
public async global::System.Threading.Tasks.Task> RolloutServiceGetRolloutAsResponseAsync( string projectId, string endpointId, @@ -133,8 +163,10 @@ partial void ProcessRolloutServiceGetRolloutResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v2/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}", + baseUri: ResolveBaseUri( + servers: s_RolloutServiceGetRolloutServers, + defaultBaseUrl: "https://api.together.ai/v2")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -196,7 +228,7 @@ partial void ProcessRolloutServiceGetRolloutResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RolloutServiceGetRollout", methodName: "RolloutServiceGetRolloutAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -230,7 +262,7 @@ partial void ProcessRolloutServiceGetRolloutResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RolloutServiceGetRollout", methodName: "RolloutServiceGetRolloutAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -271,7 +303,7 @@ partial void ProcessRolloutServiceGetRolloutResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RolloutServiceGetRollout", methodName: "RolloutServiceGetRolloutAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -319,7 +351,7 @@ partial void ProcessRolloutServiceGetRolloutResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RolloutServiceGetRollout", methodName: "RolloutServiceGetRolloutAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -341,7 +373,7 @@ partial void ProcessRolloutServiceGetRolloutResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RolloutServiceGetRollout", methodName: "RolloutServiceGetRolloutAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.RolloutServiceClient.RolloutServiceListRollouts.g.cs b/src/libs/Together/Generated/Together.RolloutServiceClient.RolloutServiceListRollouts.g.cs index 5c406371..60483df2 100644 --- a/src/libs/Together/Generated/Together.RolloutServiceClient.RolloutServiceListRollouts.g.cs +++ b/src/libs/Together/Generated/Together.RolloutServiceClient.RolloutServiceListRollouts.g.cs @@ -6,6 +6,14 @@ namespace Together public partial class RolloutServiceClient { + private static readonly global::Together.AutoSDKServer[] s_RolloutServiceListRolloutsServers = 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_RolloutServiceListRolloutsSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -71,6 +79,17 @@ partial void ProcessRolloutServiceListRolloutsResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// rollouts = client.beta.endpoints.rollouts.list(
+ /// "ep_abc123",
+ /// project_id=project_id,
+ /// )
+ /// for rollout in rollouts:
+ /// print(rollout.id, rollout.state) + ///
public async global::System.Threading.Tasks.Task RolloutServiceListRolloutsAsync( string projectId, string endpointId, @@ -114,6 +133,17 @@ partial void ProcessRolloutServiceListRolloutsResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// rollouts = client.beta.endpoints.rollouts.list(
+ /// "ep_abc123",
+ /// project_id=project_id,
+ /// )
+ /// for rollout in rollouts:
+ /// print(rollout.id, rollout.state) + ///
public async global::System.Threading.Tasks.Task> RolloutServiceListRolloutsAsResponseAsync( string projectId, string endpointId, @@ -157,8 +187,10 @@ partial void ProcessRolloutServiceListRolloutsResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v2/projects/{projectId}/endpoints/{endpointId}/rollouts", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/projects/{projectId}/endpoints/{endpointId}/rollouts", + baseUri: ResolveBaseUri( + servers: s_RolloutServiceListRolloutsServers, + defaultBaseUrl: "https://api.together.ai/v2")); __pathBuilder .AddOptionalParameter("limit", limit?.ToString()) .AddOptionalParameter("after", after) @@ -227,7 +259,7 @@ partial void ProcessRolloutServiceListRolloutsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RolloutServiceListRollouts", methodName: "RolloutServiceListRolloutsAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/rollouts\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -261,7 +293,7 @@ partial void ProcessRolloutServiceListRolloutsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RolloutServiceListRollouts", methodName: "RolloutServiceListRolloutsAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/rollouts\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -302,7 +334,7 @@ partial void ProcessRolloutServiceListRolloutsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RolloutServiceListRollouts", methodName: "RolloutServiceListRolloutsAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/rollouts\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -350,7 +382,7 @@ partial void ProcessRolloutServiceListRolloutsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RolloutServiceListRollouts", methodName: "RolloutServiceListRolloutsAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/rollouts\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -372,7 +404,7 @@ partial void ProcessRolloutServiceListRolloutsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RolloutServiceListRollouts", methodName: "RolloutServiceListRolloutsAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/rollouts\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.RolloutServiceClient.RolloutServicePauseRollout.g.cs b/src/libs/Together/Generated/Together.RolloutServiceClient.RolloutServicePauseRollout.g.cs index 8389431c..2ca986cc 100644 --- a/src/libs/Together/Generated/Together.RolloutServiceClient.RolloutServicePauseRollout.g.cs +++ b/src/libs/Together/Generated/Together.RolloutServiceClient.RolloutServicePauseRollout.g.cs @@ -6,6 +6,14 @@ namespace Together public partial class RolloutServiceClient { + private static readonly global::Together.AutoSDKServer[] s_RolloutServicePauseRolloutServers = 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_RolloutServicePauseRolloutSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -64,6 +72,18 @@ partial void ProcessRolloutServicePauseRolloutResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// rollout = client.beta.endpoints.rollouts.pause(
+ /// "rol_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// reason="Investigating a latency regression",
+ /// )
+ /// print(rollout.id, rollout.state) + ///
public async global::System.Threading.Tasks.Task RolloutServicePauseRolloutAsync( string projectId, string endpointId, @@ -102,6 +122,18 @@ partial void ProcessRolloutServicePauseRolloutResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// rollout = client.beta.endpoints.rollouts.pause(
+ /// "rol_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// reason="Investigating a latency regression",
+ /// )
+ /// print(rollout.id, rollout.state) + ///
public async global::System.Threading.Tasks.Task> RolloutServicePauseRolloutAsResponseAsync( string projectId, string endpointId, @@ -146,8 +178,10 @@ partial void ProcessRolloutServicePauseRolloutResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v2/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/pause", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/pause", + baseUri: ResolveBaseUri( + servers: s_RolloutServicePauseRolloutServers, + defaultBaseUrl: "https://api.together.ai/v2")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -216,7 +250,7 @@ partial void ProcessRolloutServicePauseRolloutResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RolloutServicePauseRollout", methodName: "RolloutServicePauseRolloutAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/pause\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/pause\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -250,7 +284,7 @@ partial void ProcessRolloutServicePauseRolloutResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RolloutServicePauseRollout", methodName: "RolloutServicePauseRolloutAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/pause\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/pause\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -291,7 +325,7 @@ partial void ProcessRolloutServicePauseRolloutResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RolloutServicePauseRollout", methodName: "RolloutServicePauseRolloutAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/pause\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/pause\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -339,7 +373,7 @@ partial void ProcessRolloutServicePauseRolloutResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RolloutServicePauseRollout", methodName: "RolloutServicePauseRolloutAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/pause\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/pause\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -361,7 +395,7 @@ partial void ProcessRolloutServicePauseRolloutResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RolloutServicePauseRollout", methodName: "RolloutServicePauseRolloutAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/pause\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/pause\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.RolloutServiceClient.RolloutServicePreviewRolloutDefaults.g.cs b/src/libs/Together/Generated/Together.RolloutServiceClient.RolloutServicePreviewRolloutDefaults.g.cs index 4ebf409f..2c6839bb 100644 --- a/src/libs/Together/Generated/Together.RolloutServiceClient.RolloutServicePreviewRolloutDefaults.g.cs +++ b/src/libs/Together/Generated/Together.RolloutServiceClient.RolloutServicePreviewRolloutDefaults.g.cs @@ -6,6 +6,14 @@ namespace Together public partial class RolloutServiceClient { + private static readonly global::Together.AutoSDKServer[] s_RolloutServicePreviewRolloutDefaultsServers = 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_RolloutServicePreviewRolloutDefaultsSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -59,6 +67,21 @@ partial void ProcessRolloutServicePreviewRolloutDefaultsResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// # Returns the values a create request would use for unset fields,
+ /// # without creating a rollout.
+ /// defaults = client.beta.endpoints.rollouts.preview_defaults(
+ /// "ep_abc123",
+ /// project_id=project_id,
+ /// source_deployment_id="dep_abc123",
+ /// target_deployment_id="dep_def456",
+ /// canary={"steps": [{"traffic": 25}, {"traffic": 100}]},
+ /// )
+ /// print(defaults) + ///
public async global::System.Threading.Tasks.Task RolloutServicePreviewRolloutDefaultsAsync( string projectId, string endpointId, @@ -92,6 +115,21 @@ partial void ProcessRolloutServicePreviewRolloutDefaultsResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// # Returns the values a create request would use for unset fields,
+ /// # without creating a rollout.
+ /// defaults = client.beta.endpoints.rollouts.preview_defaults(
+ /// "ep_abc123",
+ /// project_id=project_id,
+ /// source_deployment_id="dep_abc123",
+ /// target_deployment_id="dep_def456",
+ /// canary={"steps": [{"traffic": 25}, {"traffic": 100}]},
+ /// )
+ /// print(defaults) + ///
public async global::System.Threading.Tasks.Task> RolloutServicePreviewRolloutDefaultsAsResponseAsync( string projectId, string endpointId, @@ -134,8 +172,10 @@ partial void ProcessRolloutServicePreviewRolloutDefaultsResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v2/projects/{projectId}/endpoints/{endpointId}/rollouts/preview-defaults", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/projects/{projectId}/endpoints/{endpointId}/rollouts/preview-defaults", + baseUri: ResolveBaseUri( + servers: s_RolloutServicePreviewRolloutDefaultsServers, + defaultBaseUrl: "https://api.together.ai/v2")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -203,7 +243,7 @@ partial void ProcessRolloutServicePreviewRolloutDefaultsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RolloutServicePreviewRolloutDefaults", methodName: "RolloutServicePreviewRolloutDefaultsAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/rollouts/preview-defaults\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts/preview-defaults\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -237,7 +277,7 @@ partial void ProcessRolloutServicePreviewRolloutDefaultsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RolloutServicePreviewRolloutDefaults", methodName: "RolloutServicePreviewRolloutDefaultsAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/rollouts/preview-defaults\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts/preview-defaults\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -278,7 +318,7 @@ partial void ProcessRolloutServicePreviewRolloutDefaultsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RolloutServicePreviewRolloutDefaults", methodName: "RolloutServicePreviewRolloutDefaultsAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/rollouts/preview-defaults\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts/preview-defaults\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -326,7 +366,7 @@ partial void ProcessRolloutServicePreviewRolloutDefaultsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RolloutServicePreviewRolloutDefaults", methodName: "RolloutServicePreviewRolloutDefaultsAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/rollouts/preview-defaults\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts/preview-defaults\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -348,7 +388,7 @@ partial void ProcessRolloutServicePreviewRolloutDefaultsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RolloutServicePreviewRolloutDefaults", methodName: "RolloutServicePreviewRolloutDefaultsAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/rollouts/preview-defaults\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts/preview-defaults\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.RolloutServiceClient.RolloutServicePromoteRollout.g.cs b/src/libs/Together/Generated/Together.RolloutServiceClient.RolloutServicePromoteRollout.g.cs index 4bee6bda..602f6b4c 100644 --- a/src/libs/Together/Generated/Together.RolloutServiceClient.RolloutServicePromoteRollout.g.cs +++ b/src/libs/Together/Generated/Together.RolloutServiceClient.RolloutServicePromoteRollout.g.cs @@ -6,6 +6,14 @@ namespace Together public partial class RolloutServiceClient { + private static readonly global::Together.AutoSDKServer[] s_RolloutServicePromoteRolloutServers = 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_RolloutServicePromoteRolloutSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -64,6 +72,17 @@ partial void ProcessRolloutServicePromoteRolloutResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// rollout = client.beta.endpoints.rollouts.promote(
+ /// "rol_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// )
+ /// print(rollout.id, rollout.state) + ///
public async global::System.Threading.Tasks.Task RolloutServicePromoteRolloutAsync( string projectId, string endpointId, @@ -102,6 +121,17 @@ partial void ProcessRolloutServicePromoteRolloutResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// rollout = client.beta.endpoints.rollouts.promote(
+ /// "rol_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// )
+ /// print(rollout.id, rollout.state) + ///
public async global::System.Threading.Tasks.Task> RolloutServicePromoteRolloutAsResponseAsync( string projectId, string endpointId, @@ -146,8 +176,10 @@ partial void ProcessRolloutServicePromoteRolloutResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v2/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/promote", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/promote", + baseUri: ResolveBaseUri( + servers: s_RolloutServicePromoteRolloutServers, + defaultBaseUrl: "https://api.together.ai/v2")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -216,7 +248,7 @@ partial void ProcessRolloutServicePromoteRolloutResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RolloutServicePromoteRollout", methodName: "RolloutServicePromoteRolloutAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/promote\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/promote\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -250,7 +282,7 @@ partial void ProcessRolloutServicePromoteRolloutResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RolloutServicePromoteRollout", methodName: "RolloutServicePromoteRolloutAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/promote\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/promote\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -291,7 +323,7 @@ partial void ProcessRolloutServicePromoteRolloutResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RolloutServicePromoteRollout", methodName: "RolloutServicePromoteRolloutAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/promote\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/promote\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -339,7 +371,7 @@ partial void ProcessRolloutServicePromoteRolloutResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RolloutServicePromoteRollout", methodName: "RolloutServicePromoteRolloutAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/promote\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/promote\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -361,7 +393,7 @@ partial void ProcessRolloutServicePromoteRolloutResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RolloutServicePromoteRollout", methodName: "RolloutServicePromoteRolloutAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/promote\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/promote\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.RolloutServiceClient.RolloutServiceResumeRollout.g.cs b/src/libs/Together/Generated/Together.RolloutServiceClient.RolloutServiceResumeRollout.g.cs index 44cc76e9..368c9cfa 100644 --- a/src/libs/Together/Generated/Together.RolloutServiceClient.RolloutServiceResumeRollout.g.cs +++ b/src/libs/Together/Generated/Together.RolloutServiceClient.RolloutServiceResumeRollout.g.cs @@ -6,6 +6,14 @@ namespace Together public partial class RolloutServiceClient { + private static readonly global::Together.AutoSDKServer[] s_RolloutServiceResumeRolloutServers = 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_RolloutServiceResumeRolloutSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -64,6 +72,17 @@ partial void ProcessRolloutServiceResumeRolloutResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// rollout = client.beta.endpoints.rollouts.resume(
+ /// "rol_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// )
+ /// print(rollout.id, rollout.state) + ///
public async global::System.Threading.Tasks.Task RolloutServiceResumeRolloutAsync( string projectId, string endpointId, @@ -102,6 +121,17 @@ partial void ProcessRolloutServiceResumeRolloutResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// rollout = client.beta.endpoints.rollouts.resume(
+ /// "rol_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// )
+ /// print(rollout.id, rollout.state) + ///
public async global::System.Threading.Tasks.Task> RolloutServiceResumeRolloutAsResponseAsync( string projectId, string endpointId, @@ -146,8 +176,10 @@ partial void ProcessRolloutServiceResumeRolloutResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v2/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/resume", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/resume", + baseUri: ResolveBaseUri( + servers: s_RolloutServiceResumeRolloutServers, + defaultBaseUrl: "https://api.together.ai/v2")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -216,7 +248,7 @@ partial void ProcessRolloutServiceResumeRolloutResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RolloutServiceResumeRollout", methodName: "RolloutServiceResumeRolloutAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/resume\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/resume\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -250,7 +282,7 @@ partial void ProcessRolloutServiceResumeRolloutResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RolloutServiceResumeRollout", methodName: "RolloutServiceResumeRolloutAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/resume\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/resume\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -291,7 +323,7 @@ partial void ProcessRolloutServiceResumeRolloutResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RolloutServiceResumeRollout", methodName: "RolloutServiceResumeRolloutAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/resume\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/resume\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -339,7 +371,7 @@ partial void ProcessRolloutServiceResumeRolloutResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RolloutServiceResumeRollout", methodName: "RolloutServiceResumeRolloutAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/resume\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/resume\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -361,7 +393,7 @@ partial void ProcessRolloutServiceResumeRolloutResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RolloutServiceResumeRollout", methodName: "RolloutServiceResumeRolloutAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/resume\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/resume\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.RolloutServiceClient.RolloutServiceStartRollout.g.cs b/src/libs/Together/Generated/Together.RolloutServiceClient.RolloutServiceStartRollout.g.cs index cbdc7204..dd46149a 100644 --- a/src/libs/Together/Generated/Together.RolloutServiceClient.RolloutServiceStartRollout.g.cs +++ b/src/libs/Together/Generated/Together.RolloutServiceClient.RolloutServiceStartRollout.g.cs @@ -6,6 +6,14 @@ namespace Together public partial class RolloutServiceClient { + private static readonly global::Together.AutoSDKServer[] s_RolloutServiceStartRolloutServers = 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_RolloutServiceStartRolloutSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -61,6 +69,17 @@ partial void ProcessRolloutServiceStartRolloutResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// rollout = client.beta.endpoints.rollouts.start(
+ /// "rol_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// )
+ /// print(rollout.id, rollout.state) + ///
public async global::System.Threading.Tasks.Task RolloutServiceStartRolloutAsync( string projectId, string endpointId, @@ -94,6 +113,17 @@ partial void ProcessRolloutServiceStartRolloutResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// rollout = client.beta.endpoints.rollouts.start(
+ /// "rol_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// )
+ /// print(rollout.id, rollout.state) + ///
public async global::System.Threading.Tasks.Task> RolloutServiceStartRolloutAsResponseAsync( string projectId, string endpointId, @@ -133,8 +163,10 @@ partial void ProcessRolloutServiceStartRolloutResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v2/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/start", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/start", + baseUri: ResolveBaseUri( + servers: s_RolloutServiceStartRolloutServers, + defaultBaseUrl: "https://api.together.ai/v2")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -196,7 +228,7 @@ partial void ProcessRolloutServiceStartRolloutResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RolloutServiceStartRollout", methodName: "RolloutServiceStartRolloutAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/start\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/start\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -230,7 +262,7 @@ partial void ProcessRolloutServiceStartRolloutResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RolloutServiceStartRollout", methodName: "RolloutServiceStartRolloutAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/start\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/start\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -271,7 +303,7 @@ partial void ProcessRolloutServiceStartRolloutResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RolloutServiceStartRollout", methodName: "RolloutServiceStartRolloutAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/start\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/start\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -319,7 +351,7 @@ partial void ProcessRolloutServiceStartRolloutResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RolloutServiceStartRollout", methodName: "RolloutServiceStartRolloutAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/start\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/start\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -341,7 +373,7 @@ partial void ProcessRolloutServiceStartRolloutResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RolloutServiceStartRollout", methodName: "RolloutServiceStartRolloutAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/start\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/start\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.RolloutServiceClient.g.cs b/src/libs/Together/Generated/Together.RolloutServiceClient.g.cs index 650eeca1..20f5be04 100644 --- a/src/libs/Together/Generated/Together.RolloutServiceClient.g.cs +++ b/src/libs/Together/Generated/Together.RolloutServiceClient.g.cs @@ -10,9 +10,9 @@ namespace Together public sealed partial class RolloutServiceClient : global::Together.IRolloutServiceClient, global::System.IDisposable { /// - /// Default environment for APIs + /// /// - public const string DefaultBaseUrl = "https://api.together.ai/"; + public const string DefaultBaseUrl = "https://api.together.ai/v2"; private bool _disposeHttpClient = true; @@ -151,5 +151,36 @@ 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.Secrets.JsonSerializerContext.g.cs b/src/libs/Together/Generated/Together.Secrets.JsonSerializerContext.g.cs index e4b80d63..bcf1b9ba 100644 --- a/src/libs/Together/Generated/Together.Secrets.JsonSerializerContext.g.cs +++ b/src/libs/Together/Generated/Together.Secrets.JsonSerializerContext.g.cs @@ -2,29 +2,7 @@ #nullable enable namespace Together -{ - /// - /// - /// - [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( - DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull - )] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(object))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateSecretRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ListSecretsResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.SecretResponseItem))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.UpdateSecretRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - internal sealed partial class SecretsSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext - { - } - /// +{ /// /// /// public sealed partial class SecretsSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext @@ -68,25 +46,7 @@ private SecretsSourceGenerationContext(global::System.Text.Json.JsonSerializerOp [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) { - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter, global::System.Collections.Generic.IList>()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter>()); - options.Converters.Add(new global::Together.JsonConverters.UnixTimestampJsonConverter()); + global::Together.SourceGenerationContext.AddConverters(options); } private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() @@ -140,7 +100,7 @@ private sealed class LazyChunkResolver : global::System.Text.Json.Serialization. { return index switch { - 0 => new SecretsSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), + 0 => global::Together.SourceGenerationContext.TypeInfoResolver, _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), }; } diff --git a/src/libs/Together/Generated/Together.SecretsClient.CreateDeploymentsSecrets.g.cs b/src/libs/Together/Generated/Together.SecretsClient.CreateDeploymentsSecrets.g.cs index 5d1111fd..1a60aa8b 100644 --- a/src/libs/Together/Generated/Together.SecretsClient.CreateDeploymentsSecrets.g.cs +++ b/src/libs/Together/Generated/Together.SecretsClient.CreateDeploymentsSecrets.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class SecretsClient { + private static readonly global::Together.AutoSDKServer[] s_CreateDeploymentsSecretsServers = 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_CreateDeploymentsSecretsSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -49,6 +62,11 @@ partial void ProcessCreateDeploymentsSecretsResponseContent( /// 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()
+ /// client.beta.jig.secrets.create(name="my-secret", value="my-value") + ///
public async global::System.Threading.Tasks.Task CreateDeploymentsSecretsAsync( global::Together.CreateSecretRequest request, @@ -72,6 +90,11 @@ partial void ProcessCreateDeploymentsSecretsResponseContent( /// 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()
+ /// client.beta.jig.secrets.create(name="my-secret", value="my-value") + ///
public async global::System.Threading.Tasks.Task> CreateDeploymentsSecretsAsResponseAsync( global::Together.CreateSecretRequest request, @@ -110,8 +133,10 @@ partial void ProcessCreateDeploymentsSecretsResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: "/v1/deployments/secrets", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: "/deployments/secrets", + baseUri: ResolveBaseUri( + servers: s_CreateDeploymentsSecretsServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -177,7 +202,7 @@ partial void ProcessCreateDeploymentsSecretsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "createDeploymentsSecrets", methodName: "CreateDeploymentsSecretsAsync", - pathTemplate: "\"/v1/deployments/secrets\"", + pathTemplate: "\"/deployments/secrets\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -211,7 +236,7 @@ partial void ProcessCreateDeploymentsSecretsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "createDeploymentsSecrets", methodName: "CreateDeploymentsSecretsAsync", - pathTemplate: "\"/v1/deployments/secrets\"", + pathTemplate: "\"/deployments/secrets\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -252,7 +277,7 @@ partial void ProcessCreateDeploymentsSecretsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "createDeploymentsSecrets", methodName: "CreateDeploymentsSecretsAsync", - pathTemplate: "\"/v1/deployments/secrets\"", + pathTemplate: "\"/deployments/secrets\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -300,7 +325,7 @@ partial void ProcessCreateDeploymentsSecretsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "createDeploymentsSecrets", methodName: "CreateDeploymentsSecretsAsync", - pathTemplate: "\"/v1/deployments/secrets\"", + pathTemplate: "\"/deployments/secrets\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -322,7 +347,7 @@ partial void ProcessCreateDeploymentsSecretsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "createDeploymentsSecrets", methodName: "CreateDeploymentsSecretsAsync", - pathTemplate: "\"/v1/deployments/secrets\"", + pathTemplate: "\"/deployments/secrets\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.SecretsClient.DeleteDeploymentsSecretsById.g.cs b/src/libs/Together/Generated/Together.SecretsClient.DeleteDeploymentsSecretsById.g.cs index dc1226f7..febc3447 100644 --- a/src/libs/Together/Generated/Together.SecretsClient.DeleteDeploymentsSecretsById.g.cs +++ b/src/libs/Together/Generated/Together.SecretsClient.DeleteDeploymentsSecretsById.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class SecretsClient { + private static readonly global::Together.AutoSDKServer[] s_DeleteDeploymentsSecretsByIdServers = 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_DeleteDeploymentsSecretsByIdSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -51,6 +64,11 @@ partial void ProcessDeleteDeploymentsSecretsByIdResponseContent( /// 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()
+ /// client.beta.jig.secrets.delete("my-secret") + ///
public async global::System.Threading.Tasks.Task DeleteDeploymentsSecretsByIdAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -74,6 +92,11 @@ partial void ProcessDeleteDeploymentsSecretsByIdResponseContent( /// 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()
+ /// client.beta.jig.secrets.delete("my-secret") + ///
public async global::System.Threading.Tasks.Task> DeleteDeploymentsSecretsByIdAsResponseAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -109,8 +132,10 @@ partial void ProcessDeleteDeploymentsSecretsByIdResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v1/deployments/secrets/{id}", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/deployments/secrets/{id}", + baseUri: ResolveBaseUri( + servers: s_DeleteDeploymentsSecretsByIdServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -170,7 +195,7 @@ partial void ProcessDeleteDeploymentsSecretsByIdResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "deleteDeploymentsSecretsById", methodName: "DeleteDeploymentsSecretsByIdAsync", - pathTemplate: "$\"/v1/deployments/secrets/{id}\"", + pathTemplate: "$\"/deployments/secrets/{id}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -204,7 +229,7 @@ partial void ProcessDeleteDeploymentsSecretsByIdResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "deleteDeploymentsSecretsById", methodName: "DeleteDeploymentsSecretsByIdAsync", - pathTemplate: "$\"/v1/deployments/secrets/{id}\"", + pathTemplate: "$\"/deployments/secrets/{id}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -245,7 +270,7 @@ partial void ProcessDeleteDeploymentsSecretsByIdResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "deleteDeploymentsSecretsById", methodName: "DeleteDeploymentsSecretsByIdAsync", - pathTemplate: "$\"/v1/deployments/secrets/{id}\"", + pathTemplate: "$\"/deployments/secrets/{id}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -293,7 +318,7 @@ partial void ProcessDeleteDeploymentsSecretsByIdResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "deleteDeploymentsSecretsById", methodName: "DeleteDeploymentsSecretsByIdAsync", - pathTemplate: "$\"/v1/deployments/secrets/{id}\"", + pathTemplate: "$\"/deployments/secrets/{id}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -315,7 +340,7 @@ partial void ProcessDeleteDeploymentsSecretsByIdResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "deleteDeploymentsSecretsById", methodName: "DeleteDeploymentsSecretsByIdAsync", - pathTemplate: "$\"/v1/deployments/secrets/{id}\"", + pathTemplate: "$\"/deployments/secrets/{id}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.SecretsClient.EditDeploymentsSecretsById.g.cs b/src/libs/Together/Generated/Together.SecretsClient.EditDeploymentsSecretsById.g.cs index ceb32225..8fbc3abd 100644 --- a/src/libs/Together/Generated/Together.SecretsClient.EditDeploymentsSecretsById.g.cs +++ b/src/libs/Together/Generated/Together.SecretsClient.EditDeploymentsSecretsById.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class SecretsClient { + private static readonly global::Together.AutoSDKServer[] s_EditDeploymentsSecretsByIdServers = 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_EditDeploymentsSecretsByIdSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -54,6 +67,11 @@ partial void ProcessEditDeploymentsSecretsByIdResponseContent( /// 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()
+ /// client.beta.jig.secrets.update("my-secret", value="my-new-value") + ///
public async global::System.Threading.Tasks.Task EditDeploymentsSecretsByIdAsync( string id, @@ -82,6 +100,11 @@ partial void ProcessEditDeploymentsSecretsByIdResponseContent( /// 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()
+ /// client.beta.jig.secrets.update("my-secret", value="my-new-value") + ///
public async global::System.Threading.Tasks.Task> EditDeploymentsSecretsByIdAsResponseAsync( string id, @@ -122,8 +145,10 @@ partial void ProcessEditDeploymentsSecretsByIdResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v1/deployments/secrets/{id}", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/deployments/secrets/{id}", + baseUri: ResolveBaseUri( + servers: s_EditDeploymentsSecretsByIdServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -190,7 +215,7 @@ partial void ProcessEditDeploymentsSecretsByIdResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "editDeploymentsSecretsById", methodName: "EditDeploymentsSecretsByIdAsync", - pathTemplate: "$\"/v1/deployments/secrets/{id}\"", + pathTemplate: "$\"/deployments/secrets/{id}\"", httpMethod: "PATCH", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -224,7 +249,7 @@ partial void ProcessEditDeploymentsSecretsByIdResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "editDeploymentsSecretsById", methodName: "EditDeploymentsSecretsByIdAsync", - pathTemplate: "$\"/v1/deployments/secrets/{id}\"", + pathTemplate: "$\"/deployments/secrets/{id}\"", httpMethod: "PATCH", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -265,7 +290,7 @@ partial void ProcessEditDeploymentsSecretsByIdResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "editDeploymentsSecretsById", methodName: "EditDeploymentsSecretsByIdAsync", - pathTemplate: "$\"/v1/deployments/secrets/{id}\"", + pathTemplate: "$\"/deployments/secrets/{id}\"", httpMethod: "PATCH", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -313,7 +338,7 @@ partial void ProcessEditDeploymentsSecretsByIdResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "editDeploymentsSecretsById", methodName: "EditDeploymentsSecretsByIdAsync", - pathTemplate: "$\"/v1/deployments/secrets/{id}\"", + pathTemplate: "$\"/deployments/secrets/{id}\"", httpMethod: "PATCH", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -335,7 +360,7 @@ partial void ProcessEditDeploymentsSecretsByIdResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "editDeploymentsSecretsById", methodName: "EditDeploymentsSecretsByIdAsync", - pathTemplate: "$\"/v1/deployments/secrets/{id}\"", + pathTemplate: "$\"/deployments/secrets/{id}\"", httpMethod: "PATCH", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.SecretsClient.GetDeploymentsSecrets.g.cs b/src/libs/Together/Generated/Together.SecretsClient.GetDeploymentsSecrets.g.cs index 11853069..ca958d18 100644 --- a/src/libs/Together/Generated/Together.SecretsClient.GetDeploymentsSecrets.g.cs +++ b/src/libs/Together/Generated/Together.SecretsClient.GetDeploymentsSecrets.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class SecretsClient { + private static readonly global::Together.AutoSDKServer[] s_GetDeploymentsSecretsServers = 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_GetDeploymentsSecretsSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -46,6 +59,12 @@ partial void ProcessGetDeploymentsSecretsResponseContent( /// 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()
+ /// secrets = client.beta.jig.secrets.list()
+ /// print(secrets) + ///
public async global::System.Threading.Tasks.Task GetDeploymentsSecretsAsync( global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -64,6 +83,12 @@ partial void ProcessGetDeploymentsSecretsResponseContent( /// 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()
+ /// secrets = client.beta.jig.secrets.list()
+ /// print(secrets) + ///
public async global::System.Threading.Tasks.Task> GetDeploymentsSecretsAsResponseAsync( global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -97,8 +122,10 @@ partial void ProcessGetDeploymentsSecretsResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: "/v1/deployments/secrets", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: "/deployments/secrets", + baseUri: ResolveBaseUri( + servers: s_GetDeploymentsSecretsServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -157,7 +184,7 @@ partial void ProcessGetDeploymentsSecretsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getDeploymentsSecrets", methodName: "GetDeploymentsSecretsAsync", - pathTemplate: "\"/v1/deployments/secrets\"", + pathTemplate: "\"/deployments/secrets\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -191,7 +218,7 @@ partial void ProcessGetDeploymentsSecretsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getDeploymentsSecrets", methodName: "GetDeploymentsSecretsAsync", - pathTemplate: "\"/v1/deployments/secrets\"", + pathTemplate: "\"/deployments/secrets\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -232,7 +259,7 @@ partial void ProcessGetDeploymentsSecretsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getDeploymentsSecrets", methodName: "GetDeploymentsSecretsAsync", - pathTemplate: "\"/v1/deployments/secrets\"", + pathTemplate: "\"/deployments/secrets\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -280,7 +307,7 @@ partial void ProcessGetDeploymentsSecretsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getDeploymentsSecrets", methodName: "GetDeploymentsSecretsAsync", - pathTemplate: "\"/v1/deployments/secrets\"", + pathTemplate: "\"/deployments/secrets\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -302,7 +329,7 @@ partial void ProcessGetDeploymentsSecretsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getDeploymentsSecrets", methodName: "GetDeploymentsSecretsAsync", - pathTemplate: "\"/v1/deployments/secrets\"", + pathTemplate: "\"/deployments/secrets\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.SecretsClient.GetDeploymentsSecretsById.g.cs b/src/libs/Together/Generated/Together.SecretsClient.GetDeploymentsSecretsById.g.cs index d861ce29..5a924333 100644 --- a/src/libs/Together/Generated/Together.SecretsClient.GetDeploymentsSecretsById.g.cs +++ b/src/libs/Together/Generated/Together.SecretsClient.GetDeploymentsSecretsById.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class SecretsClient { + private static readonly global::Together.AutoSDKServer[] s_GetDeploymentsSecretsByIdServers = 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_GetDeploymentsSecretsByIdSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -51,6 +64,12 @@ partial void ProcessGetDeploymentsSecretsByIdResponseContent( /// 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()
+ /// secret = client.beta.jig.secrets.retrieve("my-secret")
+ /// print(secret) + ///
public async global::System.Threading.Tasks.Task GetDeploymentsSecretsByIdAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -74,6 +93,12 @@ partial void ProcessGetDeploymentsSecretsByIdResponseContent( /// 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()
+ /// secret = client.beta.jig.secrets.retrieve("my-secret")
+ /// print(secret) + ///
public async global::System.Threading.Tasks.Task> GetDeploymentsSecretsByIdAsResponseAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -109,8 +134,10 @@ partial void ProcessGetDeploymentsSecretsByIdResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v1/deployments/secrets/{id}", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/deployments/secrets/{id}", + baseUri: ResolveBaseUri( + servers: s_GetDeploymentsSecretsByIdServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -170,7 +197,7 @@ partial void ProcessGetDeploymentsSecretsByIdResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getDeploymentsSecretsById", methodName: "GetDeploymentsSecretsByIdAsync", - pathTemplate: "$\"/v1/deployments/secrets/{id}\"", + pathTemplate: "$\"/deployments/secrets/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -204,7 +231,7 @@ partial void ProcessGetDeploymentsSecretsByIdResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getDeploymentsSecretsById", methodName: "GetDeploymentsSecretsByIdAsync", - pathTemplate: "$\"/v1/deployments/secrets/{id}\"", + pathTemplate: "$\"/deployments/secrets/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -245,7 +272,7 @@ partial void ProcessGetDeploymentsSecretsByIdResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getDeploymentsSecretsById", methodName: "GetDeploymentsSecretsByIdAsync", - pathTemplate: "$\"/v1/deployments/secrets/{id}\"", + pathTemplate: "$\"/deployments/secrets/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -293,7 +320,7 @@ partial void ProcessGetDeploymentsSecretsByIdResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getDeploymentsSecretsById", methodName: "GetDeploymentsSecretsByIdAsync", - pathTemplate: "$\"/v1/deployments/secrets/{id}\"", + pathTemplate: "$\"/deployments/secrets/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -315,7 +342,7 @@ partial void ProcessGetDeploymentsSecretsByIdResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getDeploymentsSecretsById", methodName: "GetDeploymentsSecretsByIdAsync", - pathTemplate: "$\"/v1/deployments/secrets/{id}\"", + pathTemplate: "$\"/deployments/secrets/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.SecretsClient.g.cs b/src/libs/Together/Generated/Together.SecretsClient.g.cs index b2fdac43..55822e89 100644 --- a/src/libs/Together/Generated/Together.SecretsClient.g.cs +++ b/src/libs/Together/Generated/Together.SecretsClient.g.cs @@ -12,7 +12,7 @@ public sealed partial class SecretsClient : global::Together.ISecretsClient, glo /// /// Default environment for APIs /// - public const string DefaultBaseUrl = "https://api.together.ai/"; + public const string DefaultBaseUrl = "https://api.together.ai/v1"; private bool _disposeHttpClient = true; @@ -20,7 +20,7 @@ public sealed partial class SecretsClient : global::Together.ISecretsClient, 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; } @@ -53,6 +53,34 @@ public sealed partial class SecretsClient : global::Together.ISecretsClient, glo } + + 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 SecretsClient. /// If no httpClient is provided, a new one will be created. @@ -151,5 +179,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.ShadowExperimentService.JsonSerializerContext.g.cs b/src/libs/Together/Generated/Together.ShadowExperimentService.JsonSerializerContext.g.cs index a00d0ed4..8643ac06 100644 --- a/src/libs/Together/Generated/Together.ShadowExperimentService.JsonSerializerContext.g.cs +++ b/src/libs/Together/Generated/Together.ShadowExperimentService.JsonSerializerContext.g.cs @@ -2,73 +2,7 @@ #nullable enable namespace Together -{ - /// - /// - /// - [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( - DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull - )] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(double))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeDeleteResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeCreateShadowExperimentRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeShadowExperimentSource))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeCreateShadowExperimentTargetRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeUpdateShadowExperimentRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeUpdateShadowExperimentTargetRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeListShadowExperimentsResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeShadowExperiment))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeListShadowExperimentTargetsResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeShadowExperimentTarget))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeShadowExperimentSourceResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeShadowExperimentState), TypeInfoPropertyName = "DeShadowExperimentState2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeShadowExperimentEndpointSource))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeShadowExperimentSampling), TypeInfoPropertyName = "DeShadowExperimentSampling2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeShadowExperimentEndpointSourceResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeShadowExperimentSamplingResponse), TypeInfoPropertyName = "DeShadowExperimentSamplingResponse2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeShadowExperimentSamplingResponseVariant1))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeShadowExperimentUniformSamplingResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeShadowExperimentSamplingResponseVariant2))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeShadowExperimentKeyBasedSamplingResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeShadowExperimentSamplingResponseVariant3))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeShadowExperimentAdaptiveUniformSamplingResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeShadowExperimentSamplingResponseVariant4))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeShadowExperimentAdaptiveKeyBasedSamplingResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeShadowExperimentSamplingVariant1))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeShadowExperimentUniformSampling))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeShadowExperimentSamplingVariant2))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeShadowExperimentKeyBasedSampling))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeShadowExperimentSamplingVariant3))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeShadowExperimentAdaptiveUniformSampling))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeShadowExperimentSamplingVariant4))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeShadowExperimentAdaptiveKeyBasedSampling))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ErrorData))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ErrorDataError))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(double?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeShadowExperimentState?), TypeInfoPropertyName = "NullableDeShadowExperimentState2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeShadowExperimentSampling?), TypeInfoPropertyName = "NullableDeShadowExperimentSampling2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeShadowExperimentSamplingResponse?), TypeInfoPropertyName = "NullableDeShadowExperimentSamplingResponse2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - internal sealed partial class ShadowExperimentServiceSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext - { - } - /// +{ /// /// /// public sealed partial class ShadowExperimentServiceSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext @@ -112,28 +46,7 @@ private ShadowExperimentServiceSourceGenerationContext(global::System.Text.Json. [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) { - options.Converters.Add(new global::Together.JsonConverters.DeShadowExperimentSamplingResponseJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.DeShadowExperimentSamplingJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter, global::System.Collections.Generic.IList>()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter>()); - options.Converters.Add(new global::Together.JsonConverters.UnixTimestampJsonConverter()); - options.Converters.Add(new LazyEnumJsonConverterFactory()); + global::Together.SourceGenerationContext.AddConverters(options); } private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() @@ -148,34 +61,6 @@ public static void AddConverters(global::System.Text.Json.JsonSerializerOptions return options; } - - private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Serialization.JsonConverterFactory - { - public override bool CanConvert(global::System.Type typeToConvert) - { - return - typeToConvert == typeof(global::Together.DeShadowExperimentState) - - || typeToConvert == typeof(global::Together.DeShadowExperimentState?); - } - - public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - if (typeToConvert == typeof(global::Together.DeShadowExperimentState)) - { - return new global::Together.JsonConverters.DeShadowExperimentStateJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeShadowExperimentState?)) - { - return new global::Together.JsonConverters.DeShadowExperimentStateNullableJsonConverter(); - } - throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); - } - } - private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver { private readonly object _gate = new(); @@ -215,7 +100,7 @@ private sealed class LazyChunkResolver : global::System.Text.Json.Serialization. { return index switch { - 0 => new ShadowExperimentServiceSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), + 0 => global::Together.SourceGenerationContext.TypeInfoResolver, _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), }; } diff --git a/src/libs/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceCreateShadowExperiment.g.cs b/src/libs/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceCreateShadowExperiment.g.cs index 2f86194a..1965e0b3 100644 --- a/src/libs/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceCreateShadowExperiment.g.cs +++ b/src/libs/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceCreateShadowExperiment.g.cs @@ -6,6 +6,14 @@ namespace Together public partial class ShadowExperimentServiceClient { + private static readonly global::Together.AutoSDKServer[] s_ShadowExperimentServiceCreateShadowExperimentServers = 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_ShadowExperimentServiceCreateShadowExperimentSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -59,6 +67,22 @@ partial void ProcessShadowExperimentServiceCreateShadowExperimentResponseContent /// 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()
+ /// project_id = client.whoami().project_id
+ /// # Mirror 10% of the endpoint's requests to the candidate deployment.
+ /// experiment = client.beta.endpoints.shadow_experiments.create(
+ /// "ep_abc123",
+ /// project_id=project_id,
+ /// name="candidate-shadow",
+ /// source={"endpoint": {"sampling": {"uniform": {"rate": 0.1}}}},
+ /// targets=[
+ /// {"name": "candidate", "target_deployment_id": "dep_def456"},
+ /// ],
+ /// )
+ /// print(experiment.id) + ///
public async global::System.Threading.Tasks.Task ShadowExperimentServiceCreateShadowExperimentAsync( string projectId, string endpointId, @@ -92,6 +116,22 @@ partial void ProcessShadowExperimentServiceCreateShadowExperimentResponseContent /// 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()
+ /// project_id = client.whoami().project_id
+ /// # Mirror 10% of the endpoint's requests to the candidate deployment.
+ /// experiment = client.beta.endpoints.shadow_experiments.create(
+ /// "ep_abc123",
+ /// project_id=project_id,
+ /// name="candidate-shadow",
+ /// source={"endpoint": {"sampling": {"uniform": {"rate": 0.1}}}},
+ /// targets=[
+ /// {"name": "candidate", "target_deployment_id": "dep_def456"},
+ /// ],
+ /// )
+ /// print(experiment.id) + ///
public async global::System.Threading.Tasks.Task> ShadowExperimentServiceCreateShadowExperimentAsResponseAsync( string projectId, string endpointId, @@ -134,8 +174,10 @@ partial void ProcessShadowExperimentServiceCreateShadowExperimentResponseContent { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v2/projects/{projectId}/endpoints/{endpointId}/shadowExperiments", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments", + baseUri: ResolveBaseUri( + servers: s_ShadowExperimentServiceCreateShadowExperimentServers, + defaultBaseUrl: "https://api.together.ai/v2")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -203,7 +245,7 @@ partial void ProcessShadowExperimentServiceCreateShadowExperimentResponseContent context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ShadowExperimentServiceCreateShadowExperiment", methodName: "ShadowExperimentServiceCreateShadowExperimentAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/shadowExperiments\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -237,7 +279,7 @@ partial void ProcessShadowExperimentServiceCreateShadowExperimentResponseContent context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ShadowExperimentServiceCreateShadowExperiment", methodName: "ShadowExperimentServiceCreateShadowExperimentAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/shadowExperiments\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -278,7 +320,7 @@ partial void ProcessShadowExperimentServiceCreateShadowExperimentResponseContent context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ShadowExperimentServiceCreateShadowExperiment", methodName: "ShadowExperimentServiceCreateShadowExperimentAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/shadowExperiments\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -326,7 +368,7 @@ partial void ProcessShadowExperimentServiceCreateShadowExperimentResponseContent context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ShadowExperimentServiceCreateShadowExperiment", methodName: "ShadowExperimentServiceCreateShadowExperimentAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/shadowExperiments\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -348,7 +390,7 @@ partial void ProcessShadowExperimentServiceCreateShadowExperimentResponseContent context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ShadowExperimentServiceCreateShadowExperiment", methodName: "ShadowExperimentServiceCreateShadowExperimentAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/shadowExperiments\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceCreateTarget.g.cs b/src/libs/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceCreateTarget.g.cs index ccba10f8..83e70a2d 100644 --- a/src/libs/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceCreateTarget.g.cs +++ b/src/libs/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceCreateTarget.g.cs @@ -6,6 +6,14 @@ namespace Together public partial class ShadowExperimentServiceClient { + private static readonly global::Together.AutoSDKServer[] s_ShadowExperimentServiceCreateTargetServers = 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_ShadowExperimentServiceCreateTargetSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -64,6 +72,19 @@ partial void ProcessShadowExperimentServiceCreateTargetResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// target = client.beta.endpoints.shadow_experiments.targets.create(
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// experiment_id="exp_abc123",
+ /// name="candidate-2",
+ /// target_deployment_id="dep_ghi789",
+ /// )
+ /// print(target.id) + ///
public async global::System.Threading.Tasks.Task ShadowExperimentServiceCreateTargetAsync( string projectId, string endpointId, @@ -102,6 +123,19 @@ partial void ProcessShadowExperimentServiceCreateTargetResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// target = client.beta.endpoints.shadow_experiments.targets.create(
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// experiment_id="exp_abc123",
+ /// name="candidate-2",
+ /// target_deployment_id="dep_ghi789",
+ /// )
+ /// print(target.id) + ///
public async global::System.Threading.Tasks.Task> ShadowExperimentServiceCreateTargetAsResponseAsync( string projectId, string endpointId, @@ -146,8 +180,10 @@ partial void ProcessShadowExperimentServiceCreateTargetResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v2/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets", + baseUri: ResolveBaseUri( + servers: s_ShadowExperimentServiceCreateTargetServers, + defaultBaseUrl: "https://api.together.ai/v2")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -216,7 +252,7 @@ partial void ProcessShadowExperimentServiceCreateTargetResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ShadowExperimentServiceCreateTarget", methodName: "ShadowExperimentServiceCreateTargetAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -250,7 +286,7 @@ partial void ProcessShadowExperimentServiceCreateTargetResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ShadowExperimentServiceCreateTarget", methodName: "ShadowExperimentServiceCreateTargetAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -291,7 +327,7 @@ partial void ProcessShadowExperimentServiceCreateTargetResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ShadowExperimentServiceCreateTarget", methodName: "ShadowExperimentServiceCreateTargetAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -339,7 +375,7 @@ partial void ProcessShadowExperimentServiceCreateTargetResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ShadowExperimentServiceCreateTarget", methodName: "ShadowExperimentServiceCreateTargetAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -361,7 +397,7 @@ partial void ProcessShadowExperimentServiceCreateTargetResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ShadowExperimentServiceCreateTarget", methodName: "ShadowExperimentServiceCreateTargetAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceDeleteShadowExperiment.g.cs b/src/libs/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceDeleteShadowExperiment.g.cs index 27a76697..176523bd 100644 --- a/src/libs/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceDeleteShadowExperiment.g.cs +++ b/src/libs/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceDeleteShadowExperiment.g.cs @@ -6,6 +6,14 @@ namespace Together public partial class ShadowExperimentServiceClient { + private static readonly global::Together.AutoSDKServer[] s_ShadowExperimentServiceDeleteShadowExperimentServers = 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_ShadowExperimentServiceDeleteShadowExperimentSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -66,6 +74,16 @@ partial void ProcessShadowExperimentServiceDeleteShadowExperimentResponseContent /// 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()
+ /// project_id = client.whoami().project_id
+ /// client.beta.endpoints.shadow_experiments.delete(
+ /// "exp_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// ) + ///
public async global::System.Threading.Tasks.Task ShadowExperimentServiceDeleteShadowExperimentAsync( string projectId, string endpointId, @@ -104,6 +122,16 @@ partial void ProcessShadowExperimentServiceDeleteShadowExperimentResponseContent /// 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()
+ /// project_id = client.whoami().project_id
+ /// client.beta.endpoints.shadow_experiments.delete(
+ /// "exp_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// ) + ///
public async global::System.Threading.Tasks.Task> ShadowExperimentServiceDeleteShadowExperimentAsResponseAsync( string projectId, string endpointId, @@ -145,8 +173,10 @@ partial void ProcessShadowExperimentServiceDeleteShadowExperimentResponseContent { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v2/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{id}", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{id}", + baseUri: ResolveBaseUri( + servers: s_ShadowExperimentServiceDeleteShadowExperimentServers, + defaultBaseUrl: "https://api.together.ai/v2")); __pathBuilder .AddOptionalParameter("etag", etag) ; @@ -212,7 +242,7 @@ partial void ProcessShadowExperimentServiceDeleteShadowExperimentResponseContent context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ShadowExperimentServiceDeleteShadowExperiment", methodName: "ShadowExperimentServiceDeleteShadowExperimentAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{id}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -246,7 +276,7 @@ partial void ProcessShadowExperimentServiceDeleteShadowExperimentResponseContent context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ShadowExperimentServiceDeleteShadowExperiment", methodName: "ShadowExperimentServiceDeleteShadowExperimentAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{id}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -287,7 +317,7 @@ partial void ProcessShadowExperimentServiceDeleteShadowExperimentResponseContent context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ShadowExperimentServiceDeleteShadowExperiment", methodName: "ShadowExperimentServiceDeleteShadowExperimentAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{id}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -335,7 +365,7 @@ partial void ProcessShadowExperimentServiceDeleteShadowExperimentResponseContent context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ShadowExperimentServiceDeleteShadowExperiment", methodName: "ShadowExperimentServiceDeleteShadowExperimentAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{id}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -357,7 +387,7 @@ partial void ProcessShadowExperimentServiceDeleteShadowExperimentResponseContent context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ShadowExperimentServiceDeleteShadowExperiment", methodName: "ShadowExperimentServiceDeleteShadowExperimentAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{id}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceDeleteTarget.g.cs b/src/libs/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceDeleteTarget.g.cs index ed8fd84c..e6ade9fa 100644 --- a/src/libs/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceDeleteTarget.g.cs +++ b/src/libs/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceDeleteTarget.g.cs @@ -6,6 +6,14 @@ namespace Together public partial class ShadowExperimentServiceClient { + private static readonly global::Together.AutoSDKServer[] s_ShadowExperimentServiceDeleteTargetServers = 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_ShadowExperimentServiceDeleteTargetSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -71,6 +79,17 @@ partial void ProcessShadowExperimentServiceDeleteTargetResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// client.beta.endpoints.shadow_experiments.targets.delete(
+ /// "tgt_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// experiment_id="exp_abc123",
+ /// ) + ///
public async global::System.Threading.Tasks.Task ShadowExperimentServiceDeleteTargetAsync( string projectId, string endpointId, @@ -114,6 +133,17 @@ partial void ProcessShadowExperimentServiceDeleteTargetResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// client.beta.endpoints.shadow_experiments.targets.delete(
+ /// "tgt_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// experiment_id="exp_abc123",
+ /// ) + ///
public async global::System.Threading.Tasks.Task> ShadowExperimentServiceDeleteTargetAsResponseAsync( string projectId, string endpointId, @@ -157,8 +187,10 @@ partial void ProcessShadowExperimentServiceDeleteTargetResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v2/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets/{id}", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets/{id}", + baseUri: ResolveBaseUri( + servers: s_ShadowExperimentServiceDeleteTargetServers, + defaultBaseUrl: "https://api.together.ai/v2")); __pathBuilder .AddOptionalParameter("etag", etag) ; @@ -225,7 +257,7 @@ partial void ProcessShadowExperimentServiceDeleteTargetResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ShadowExperimentServiceDeleteTarget", methodName: "ShadowExperimentServiceDeleteTargetAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets/{id}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -259,7 +291,7 @@ partial void ProcessShadowExperimentServiceDeleteTargetResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ShadowExperimentServiceDeleteTarget", methodName: "ShadowExperimentServiceDeleteTargetAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets/{id}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -300,7 +332,7 @@ partial void ProcessShadowExperimentServiceDeleteTargetResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ShadowExperimentServiceDeleteTarget", methodName: "ShadowExperimentServiceDeleteTargetAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets/{id}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -348,7 +380,7 @@ partial void ProcessShadowExperimentServiceDeleteTargetResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ShadowExperimentServiceDeleteTarget", methodName: "ShadowExperimentServiceDeleteTargetAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets/{id}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -370,7 +402,7 @@ partial void ProcessShadowExperimentServiceDeleteTargetResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ShadowExperimentServiceDeleteTarget", methodName: "ShadowExperimentServiceDeleteTargetAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets/{id}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceGetShadowExperiment.g.cs b/src/libs/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceGetShadowExperiment.g.cs index 752d7c1f..c6c63f9b 100644 --- a/src/libs/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceGetShadowExperiment.g.cs +++ b/src/libs/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceGetShadowExperiment.g.cs @@ -6,6 +6,14 @@ namespace Together public partial class ShadowExperimentServiceClient { + private static readonly global::Together.AutoSDKServer[] s_ShadowExperimentServiceGetShadowExperimentServers = 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_ShadowExperimentServiceGetShadowExperimentSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -61,6 +69,17 @@ partial void ProcessShadowExperimentServiceGetShadowExperimentResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// experiment = client.beta.endpoints.shadow_experiments.retrieve(
+ /// "exp_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// )
+ /// print(experiment.name, experiment.targets) + ///
public async global::System.Threading.Tasks.Task ShadowExperimentServiceGetShadowExperimentAsync( string projectId, string endpointId, @@ -94,6 +113,17 @@ partial void ProcessShadowExperimentServiceGetShadowExperimentResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// experiment = client.beta.endpoints.shadow_experiments.retrieve(
+ /// "exp_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// )
+ /// print(experiment.name, experiment.targets) + ///
public async global::System.Threading.Tasks.Task> ShadowExperimentServiceGetShadowExperimentAsResponseAsync( string projectId, string endpointId, @@ -133,8 +163,10 @@ partial void ProcessShadowExperimentServiceGetShadowExperimentResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v2/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{id}", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{id}", + baseUri: ResolveBaseUri( + servers: s_ShadowExperimentServiceGetShadowExperimentServers, + defaultBaseUrl: "https://api.together.ai/v2")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -196,7 +228,7 @@ partial void ProcessShadowExperimentServiceGetShadowExperimentResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ShadowExperimentServiceGetShadowExperiment", methodName: "ShadowExperimentServiceGetShadowExperimentAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -230,7 +262,7 @@ partial void ProcessShadowExperimentServiceGetShadowExperimentResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ShadowExperimentServiceGetShadowExperiment", methodName: "ShadowExperimentServiceGetShadowExperimentAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -271,7 +303,7 @@ partial void ProcessShadowExperimentServiceGetShadowExperimentResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ShadowExperimentServiceGetShadowExperiment", methodName: "ShadowExperimentServiceGetShadowExperimentAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -319,7 +351,7 @@ partial void ProcessShadowExperimentServiceGetShadowExperimentResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ShadowExperimentServiceGetShadowExperiment", methodName: "ShadowExperimentServiceGetShadowExperimentAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -341,7 +373,7 @@ partial void ProcessShadowExperimentServiceGetShadowExperimentResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ShadowExperimentServiceGetShadowExperiment", methodName: "ShadowExperimentServiceGetShadowExperimentAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceGetTarget.g.cs b/src/libs/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceGetTarget.g.cs index dd91bcd1..2fa2e004 100644 --- a/src/libs/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceGetTarget.g.cs +++ b/src/libs/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceGetTarget.g.cs @@ -6,6 +6,14 @@ namespace Together public partial class ShadowExperimentServiceClient { + private static readonly global::Together.AutoSDKServer[] s_ShadowExperimentServiceGetTargetServers = 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_ShadowExperimentServiceGetTargetSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -66,6 +74,18 @@ partial void ProcessShadowExperimentServiceGetTargetResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// target = client.beta.endpoints.shadow_experiments.targets.retrieve(
+ /// "tgt_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// experiment_id="exp_abc123",
+ /// )
+ /// print(target.name, target.target_deployment_id) + ///
public async global::System.Threading.Tasks.Task ShadowExperimentServiceGetTargetAsync( string projectId, string endpointId, @@ -104,6 +124,18 @@ partial void ProcessShadowExperimentServiceGetTargetResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// target = client.beta.endpoints.shadow_experiments.targets.retrieve(
+ /// "tgt_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// experiment_id="exp_abc123",
+ /// )
+ /// print(target.name, target.target_deployment_id) + ///
public async global::System.Threading.Tasks.Task> ShadowExperimentServiceGetTargetAsResponseAsync( string projectId, string endpointId, @@ -145,8 +177,10 @@ partial void ProcessShadowExperimentServiceGetTargetResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v2/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets/{id}", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets/{id}", + baseUri: ResolveBaseUri( + servers: s_ShadowExperimentServiceGetTargetServers, + defaultBaseUrl: "https://api.together.ai/v2")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -209,7 +243,7 @@ partial void ProcessShadowExperimentServiceGetTargetResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ShadowExperimentServiceGetTarget", methodName: "ShadowExperimentServiceGetTargetAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -243,7 +277,7 @@ partial void ProcessShadowExperimentServiceGetTargetResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ShadowExperimentServiceGetTarget", methodName: "ShadowExperimentServiceGetTargetAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -284,7 +318,7 @@ partial void ProcessShadowExperimentServiceGetTargetResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ShadowExperimentServiceGetTarget", methodName: "ShadowExperimentServiceGetTargetAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -332,7 +366,7 @@ partial void ProcessShadowExperimentServiceGetTargetResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ShadowExperimentServiceGetTarget", methodName: "ShadowExperimentServiceGetTargetAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -354,7 +388,7 @@ partial void ProcessShadowExperimentServiceGetTargetResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ShadowExperimentServiceGetTarget", methodName: "ShadowExperimentServiceGetTargetAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceListShadowExperiments.g.cs b/src/libs/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceListShadowExperiments.g.cs index 321842f7..c0df47ac 100644 --- a/src/libs/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceListShadowExperiments.g.cs +++ b/src/libs/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceListShadowExperiments.g.cs @@ -6,6 +6,14 @@ namespace Together public partial class ShadowExperimentServiceClient { + private static readonly global::Together.AutoSDKServer[] s_ShadowExperimentServiceListShadowExperimentsServers = 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_ShadowExperimentServiceListShadowExperimentsSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -71,6 +79,18 @@ partial void ProcessShadowExperimentServiceListShadowExperimentsResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// experiments = client.beta.endpoints.shadow_experiments.list(
+ /// "ep_abc123",
+ /// project_id=project_id,
+ /// include_targets=True,
+ /// )
+ /// for experiment in experiments:
+ /// print(experiment.id, experiment.name) + ///
public async global::System.Threading.Tasks.Task ShadowExperimentServiceListShadowExperimentsAsync( string projectId, string endpointId, @@ -114,6 +134,18 @@ partial void ProcessShadowExperimentServiceListShadowExperimentsResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// experiments = client.beta.endpoints.shadow_experiments.list(
+ /// "ep_abc123",
+ /// project_id=project_id,
+ /// include_targets=True,
+ /// )
+ /// for experiment in experiments:
+ /// print(experiment.id, experiment.name) + ///
public async global::System.Threading.Tasks.Task> ShadowExperimentServiceListShadowExperimentsAsResponseAsync( string projectId, string endpointId, @@ -157,8 +189,10 @@ partial void ProcessShadowExperimentServiceListShadowExperimentsResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v2/projects/{projectId}/endpoints/{endpointId}/shadowExperiments", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments", + baseUri: ResolveBaseUri( + servers: s_ShadowExperimentServiceListShadowExperimentsServers, + defaultBaseUrl: "https://api.together.ai/v2")); __pathBuilder .AddOptionalParameter("limit", limit?.ToString()) .AddOptionalParameter("after", after) @@ -227,7 +261,7 @@ partial void ProcessShadowExperimentServiceListShadowExperimentsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ShadowExperimentServiceListShadowExperiments", methodName: "ShadowExperimentServiceListShadowExperimentsAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/shadowExperiments\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -261,7 +295,7 @@ partial void ProcessShadowExperimentServiceListShadowExperimentsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ShadowExperimentServiceListShadowExperiments", methodName: "ShadowExperimentServiceListShadowExperimentsAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/shadowExperiments\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -302,7 +336,7 @@ partial void ProcessShadowExperimentServiceListShadowExperimentsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ShadowExperimentServiceListShadowExperiments", methodName: "ShadowExperimentServiceListShadowExperimentsAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/shadowExperiments\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -350,7 +384,7 @@ partial void ProcessShadowExperimentServiceListShadowExperimentsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ShadowExperimentServiceListShadowExperiments", methodName: "ShadowExperimentServiceListShadowExperimentsAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/shadowExperiments\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -372,7 +406,7 @@ partial void ProcessShadowExperimentServiceListShadowExperimentsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ShadowExperimentServiceListShadowExperiments", methodName: "ShadowExperimentServiceListShadowExperimentsAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/shadowExperiments\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceListTargets.g.cs b/src/libs/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceListTargets.g.cs index 191f95b9..d7d6bbb3 100644 --- a/src/libs/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceListTargets.g.cs +++ b/src/libs/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceListTargets.g.cs @@ -6,6 +6,14 @@ namespace Together public partial class ShadowExperimentServiceClient { + private static readonly global::Together.AutoSDKServer[] s_ShadowExperimentServiceListTargetsServers = 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_ShadowExperimentServiceListTargetsSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -71,6 +79,18 @@ partial void ProcessShadowExperimentServiceListTargetsResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// targets = client.beta.endpoints.shadow_experiments.targets.list(
+ /// endpoint_id="ep_abc123",
+ /// experiment_id="exp_abc123",
+ /// project_id=project_id,
+ /// )
+ /// for target in targets:
+ /// print(target.id, target.name, target.target_deployment_id) + ///
public async global::System.Threading.Tasks.Task ShadowExperimentServiceListTargetsAsync( string projectId, string endpointId, @@ -114,6 +134,18 @@ partial void ProcessShadowExperimentServiceListTargetsResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// targets = client.beta.endpoints.shadow_experiments.targets.list(
+ /// endpoint_id="ep_abc123",
+ /// experiment_id="exp_abc123",
+ /// project_id=project_id,
+ /// )
+ /// for target in targets:
+ /// print(target.id, target.name, target.target_deployment_id) + ///
public async global::System.Threading.Tasks.Task> ShadowExperimentServiceListTargetsAsResponseAsync( string projectId, string endpointId, @@ -157,8 +189,10 @@ partial void ProcessShadowExperimentServiceListTargetsResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v2/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets", + baseUri: ResolveBaseUri( + servers: s_ShadowExperimentServiceListTargetsServers, + defaultBaseUrl: "https://api.together.ai/v2")); __pathBuilder .AddOptionalParameter("limit", limit?.ToString()) .AddOptionalParameter("after", after) @@ -226,7 +260,7 @@ partial void ProcessShadowExperimentServiceListTargetsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ShadowExperimentServiceListTargets", methodName: "ShadowExperimentServiceListTargetsAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -260,7 +294,7 @@ partial void ProcessShadowExperimentServiceListTargetsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ShadowExperimentServiceListTargets", methodName: "ShadowExperimentServiceListTargetsAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -301,7 +335,7 @@ partial void ProcessShadowExperimentServiceListTargetsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ShadowExperimentServiceListTargets", methodName: "ShadowExperimentServiceListTargetsAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -349,7 +383,7 @@ partial void ProcessShadowExperimentServiceListTargetsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ShadowExperimentServiceListTargets", methodName: "ShadowExperimentServiceListTargetsAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -371,7 +405,7 @@ partial void ProcessShadowExperimentServiceListTargetsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ShadowExperimentServiceListTargets", methodName: "ShadowExperimentServiceListTargetsAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceUpdateShadowExperiment.g.cs b/src/libs/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceUpdateShadowExperiment.g.cs index 253d299f..f0d0a862 100644 --- a/src/libs/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceUpdateShadowExperiment.g.cs +++ b/src/libs/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceUpdateShadowExperiment.g.cs @@ -6,6 +6,14 @@ namespace Together public partial class ShadowExperimentServiceClient { + private static readonly global::Together.AutoSDKServer[] s_ShadowExperimentServiceUpdateShadowExperimentServers = 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_ShadowExperimentServiceUpdateShadowExperimentSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -69,6 +77,19 @@ partial void ProcessShadowExperimentServiceUpdateShadowExperimentResponseContent /// 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()
+ /// project_id = client.whoami().project_id
+ /// experiment = client.beta.endpoints.shadow_experiments.update(
+ /// "exp_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// update_mask="description",
+ /// description="Compare the FP8 config against production",
+ /// )
+ /// print(experiment.description) + ///
public async global::System.Threading.Tasks.Task ShadowExperimentServiceUpdateShadowExperimentAsync( string projectId, string endpointId, @@ -112,6 +133,19 @@ partial void ProcessShadowExperimentServiceUpdateShadowExperimentResponseContent /// 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()
+ /// project_id = client.whoami().project_id
+ /// experiment = client.beta.endpoints.shadow_experiments.update(
+ /// "exp_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// update_mask="description",
+ /// description="Compare the FP8 config against production",
+ /// )
+ /// print(experiment.description) + ///
public async global::System.Threading.Tasks.Task> ShadowExperimentServiceUpdateShadowExperimentAsResponseAsync( string projectId, string endpointId, @@ -158,8 +192,10 @@ partial void ProcessShadowExperimentServiceUpdateShadowExperimentResponseContent { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v2/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{id}", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{id}", + baseUri: ResolveBaseUri( + servers: s_ShadowExperimentServiceUpdateShadowExperimentServers, + defaultBaseUrl: "https://api.together.ai/v2")); __pathBuilder .AddRequiredParameter("updateMask", updateMask) ; @@ -232,7 +268,7 @@ partial void ProcessShadowExperimentServiceUpdateShadowExperimentResponseContent context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ShadowExperimentServiceUpdateShadowExperiment", methodName: "ShadowExperimentServiceUpdateShadowExperimentAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{id}\"", httpMethod: "PATCH", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -266,7 +302,7 @@ partial void ProcessShadowExperimentServiceUpdateShadowExperimentResponseContent context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ShadowExperimentServiceUpdateShadowExperiment", methodName: "ShadowExperimentServiceUpdateShadowExperimentAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{id}\"", httpMethod: "PATCH", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -307,7 +343,7 @@ partial void ProcessShadowExperimentServiceUpdateShadowExperimentResponseContent context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ShadowExperimentServiceUpdateShadowExperiment", methodName: "ShadowExperimentServiceUpdateShadowExperimentAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{id}\"", httpMethod: "PATCH", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -355,7 +391,7 @@ partial void ProcessShadowExperimentServiceUpdateShadowExperimentResponseContent context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ShadowExperimentServiceUpdateShadowExperiment", methodName: "ShadowExperimentServiceUpdateShadowExperimentAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{id}\"", httpMethod: "PATCH", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -377,7 +413,7 @@ partial void ProcessShadowExperimentServiceUpdateShadowExperimentResponseContent context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ShadowExperimentServiceUpdateShadowExperiment", methodName: "ShadowExperimentServiceUpdateShadowExperimentAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{id}\"", httpMethod: "PATCH", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceUpdateTarget.g.cs b/src/libs/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceUpdateTarget.g.cs index 603ce708..648e9914 100644 --- a/src/libs/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceUpdateTarget.g.cs +++ b/src/libs/Together/Generated/Together.ShadowExperimentServiceClient.ShadowExperimentServiceUpdateTarget.g.cs @@ -6,6 +6,14 @@ namespace Together public partial class ShadowExperimentServiceClient { + private static readonly global::Together.AutoSDKServer[] s_ShadowExperimentServiceUpdateTargetServers = 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_ShadowExperimentServiceUpdateTargetSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -74,6 +82,20 @@ partial void ProcessShadowExperimentServiceUpdateTargetResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// target = client.beta.endpoints.shadow_experiments.targets.update(
+ /// "tgt_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// experiment_id="exp_abc123",
+ /// update_mask="name",
+ /// name="candidate-fp8",
+ /// )
+ /// print(target.name) + ///
public async global::System.Threading.Tasks.Task ShadowExperimentServiceUpdateTargetAsync( string projectId, string endpointId, @@ -122,6 +144,20 @@ partial void ProcessShadowExperimentServiceUpdateTargetResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// target = client.beta.endpoints.shadow_experiments.targets.update(
+ /// "tgt_abc123",
+ /// project_id=project_id,
+ /// endpoint_id="ep_abc123",
+ /// experiment_id="exp_abc123",
+ /// update_mask="name",
+ /// name="candidate-fp8",
+ /// )
+ /// print(target.name) + ///
public async global::System.Threading.Tasks.Task> ShadowExperimentServiceUpdateTargetAsResponseAsync( string projectId, string endpointId, @@ -170,8 +206,10 @@ partial void ProcessShadowExperimentServiceUpdateTargetResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v2/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets/{id}", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets/{id}", + baseUri: ResolveBaseUri( + servers: s_ShadowExperimentServiceUpdateTargetServers, + defaultBaseUrl: "https://api.together.ai/v2")); __pathBuilder .AddRequiredParameter("updateMask", updateMask) ; @@ -245,7 +283,7 @@ partial void ProcessShadowExperimentServiceUpdateTargetResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ShadowExperimentServiceUpdateTarget", methodName: "ShadowExperimentServiceUpdateTargetAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets/{id}\"", httpMethod: "PATCH", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -279,7 +317,7 @@ partial void ProcessShadowExperimentServiceUpdateTargetResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ShadowExperimentServiceUpdateTarget", methodName: "ShadowExperimentServiceUpdateTargetAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets/{id}\"", httpMethod: "PATCH", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -320,7 +358,7 @@ partial void ProcessShadowExperimentServiceUpdateTargetResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ShadowExperimentServiceUpdateTarget", methodName: "ShadowExperimentServiceUpdateTargetAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets/{id}\"", httpMethod: "PATCH", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -368,7 +406,7 @@ partial void ProcessShadowExperimentServiceUpdateTargetResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ShadowExperimentServiceUpdateTarget", methodName: "ShadowExperimentServiceUpdateTargetAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets/{id}\"", httpMethod: "PATCH", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -390,7 +428,7 @@ partial void ProcessShadowExperimentServiceUpdateTargetResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ShadowExperimentServiceUpdateTarget", methodName: "ShadowExperimentServiceUpdateTargetAsync", - pathTemplate: "$\"/v2/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets/{id}\"", + pathTemplate: "$\"/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets/{id}\"", httpMethod: "PATCH", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.ShadowExperimentServiceClient.g.cs b/src/libs/Together/Generated/Together.ShadowExperimentServiceClient.g.cs index 10bdeaaf..705d29b1 100644 --- a/src/libs/Together/Generated/Together.ShadowExperimentServiceClient.g.cs +++ b/src/libs/Together/Generated/Together.ShadowExperimentServiceClient.g.cs @@ -10,9 +10,9 @@ namespace Together public sealed partial class ShadowExperimentServiceClient : global::Together.IShadowExperimentServiceClient, global::System.IDisposable { /// - /// Default environment for APIs + /// /// - public const string DefaultBaseUrl = "https://api.together.ai/"; + public const string DefaultBaseUrl = "https://api.together.ai/v2"; private bool _disposeHttpClient = true; @@ -151,5 +151,36 @@ 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.Shaping.JsonSerializerContext.g.cs b/src/libs/Together/Generated/Together.Shaping.JsonSerializerContext.g.cs index b421310e..89a918f4 100644 --- a/src/libs/Together/Generated/Together.Shaping.JsonSerializerContext.g.cs +++ b/src/libs/Together/Generated/Together.Shaping.JsonSerializerContext.g.cs @@ -2,58 +2,7 @@ #nullable enable namespace Together -{ - /// - /// - /// - [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( - DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull - )] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(double))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ErrorData))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ErrorDataError))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ShapingJobType), TypeInfoPropertyName = "ShapingJobType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ShapingJobStatus), TypeInfoPropertyName = "ShapingJobStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.EventLevel), TypeInfoPropertyName = "EventLevel2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.BaseShapingJob))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.QuantizationRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.QuantizationPipelineInputs))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.QuantizationEstimate))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.QuantizationPipelineConfiguration))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.QuantizationPipelineSpec))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.QuantizationResults))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.QuantizationJob), TypeInfoPropertyName = "QuantizationJob2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.QuantizationJobVariant2))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.QuantizationEvent), TypeInfoPropertyName = "QuantizationEvent2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.BaseShapingEvent))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.QuantizationEventVariant2))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.QuantizationEventVariant2Type), TypeInfoPropertyName = "QuantizationEventVariant2Type2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.EventsList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ShapingJobsList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(double?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ShapingJobType?), TypeInfoPropertyName = "NullableShapingJobType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ShapingJobStatus?), TypeInfoPropertyName = "NullableShapingJobStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.EventLevel?), TypeInfoPropertyName = "NullableEventLevel2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.QuantizationJob?), TypeInfoPropertyName = "NullableQuantizationJob2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.QuantizationEvent?), TypeInfoPropertyName = "NullableQuantizationEvent2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.QuantizationEventVariant2Type?), TypeInfoPropertyName = "NullableQuantizationEventVariant2Type2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - internal sealed partial class ShapingSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext - { - } - /// +{ /// /// /// public sealed partial class ShapingSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext @@ -97,28 +46,7 @@ private ShapingSourceGenerationContext(global::System.Text.Json.JsonSerializerOp [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) { - options.Converters.Add(new global::Together.JsonConverters.QuantizationJobJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.QuantizationEventJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter, global::System.Collections.Generic.IList>()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter>()); - options.Converters.Add(new global::Together.JsonConverters.UnixTimestampJsonConverter()); - options.Converters.Add(new LazyEnumJsonConverterFactory()); + global::Together.SourceGenerationContext.AddConverters(options); } private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() @@ -133,76 +61,6 @@ public static void AddConverters(global::System.Text.Json.JsonSerializerOptions return options; } - - private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Serialization.JsonConverterFactory - { - public override bool CanConvert(global::System.Type typeToConvert) - { - return - typeToConvert == typeof(global::Together.ShapingJobType) - - || typeToConvert == typeof(global::Together.ShapingJobType?) - - || typeToConvert == typeof(global::Together.ShapingJobStatus) - - || typeToConvert == typeof(global::Together.ShapingJobStatus?) - - || typeToConvert == typeof(global::Together.EventLevel) - - || typeToConvert == typeof(global::Together.EventLevel?) - - || typeToConvert == typeof(global::Together.QuantizationEventVariant2Type) - - || typeToConvert == typeof(global::Together.QuantizationEventVariant2Type?); - } - - public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - if (typeToConvert == typeof(global::Together.ShapingJobType)) - { - return new global::Together.JsonConverters.ShapingJobTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.ShapingJobType?)) - { - return new global::Together.JsonConverters.ShapingJobTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.ShapingJobStatus)) - { - return new global::Together.JsonConverters.ShapingJobStatusJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.ShapingJobStatus?)) - { - return new global::Together.JsonConverters.ShapingJobStatusNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.EventLevel)) - { - return new global::Together.JsonConverters.EventLevelJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.EventLevel?)) - { - return new global::Together.JsonConverters.EventLevelNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.QuantizationEventVariant2Type)) - { - return new global::Together.JsonConverters.QuantizationEventVariant2TypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.QuantizationEventVariant2Type?)) - { - return new global::Together.JsonConverters.QuantizationEventVariant2TypeNullableJsonConverter(); - } - throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); - } - } - private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver { private readonly object _gate = new(); @@ -242,7 +100,7 @@ private sealed class LazyChunkResolver : global::System.Text.Json.Serialization. { return index switch { - 0 => new ShapingSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), + 0 => global::Together.SourceGenerationContext.TypeInfoResolver, _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), }; } diff --git a/src/libs/Together/Generated/Together.ShapingClient.CancelShapingJob.g.cs b/src/libs/Together/Generated/Together.ShapingClient.CancelShapingJob.g.cs index eec5eb05..17fc4173 100644 --- a/src/libs/Together/Generated/Together.ShapingClient.CancelShapingJob.g.cs +++ b/src/libs/Together/Generated/Together.ShapingClient.CancelShapingJob.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class ShapingClient { + private static readonly global::Together.AutoSDKServer[] s_CancelShapingJobServers = 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_CancelShapingJobSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -51,6 +64,12 @@ partial void ProcessCancelShapingJobResponseContent( /// 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()
+ /// job = client.post_training.prepare_for_fp4_inference.cancel("<JOB_ID>")
+ /// print(job.status) + ///
public async global::System.Threading.Tasks.Task CancelShapingJobAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -74,6 +93,12 @@ partial void ProcessCancelShapingJobResponseContent( /// 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()
+ /// job = client.post_training.prepare_for_fp4_inference.cancel("<JOB_ID>")
+ /// print(job.status) + ///
public async global::System.Threading.Tasks.Task> CancelShapingJobAsResponseAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -109,8 +134,10 @@ partial void ProcessCancelShapingJobResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v1/shaping/{id}/cancel", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/shaping/{id}/cancel", + baseUri: ResolveBaseUri( + servers: s_CancelShapingJobServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -170,7 +197,7 @@ partial void ProcessCancelShapingJobResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "CancelShapingJob", methodName: "CancelShapingJobAsync", - pathTemplate: "$\"/v1/shaping/{id}/cancel\"", + pathTemplate: "$\"/shaping/{id}/cancel\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -204,7 +231,7 @@ partial void ProcessCancelShapingJobResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "CancelShapingJob", methodName: "CancelShapingJobAsync", - pathTemplate: "$\"/v1/shaping/{id}/cancel\"", + pathTemplate: "$\"/shaping/{id}/cancel\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -245,7 +272,7 @@ partial void ProcessCancelShapingJobResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "CancelShapingJob", methodName: "CancelShapingJobAsync", - pathTemplate: "$\"/v1/shaping/{id}/cancel\"", + pathTemplate: "$\"/shaping/{id}/cancel\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -293,7 +320,7 @@ partial void ProcessCancelShapingJobResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "CancelShapingJob", methodName: "CancelShapingJobAsync", - pathTemplate: "$\"/v1/shaping/{id}/cancel\"", + pathTemplate: "$\"/shaping/{id}/cancel\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -315,7 +342,7 @@ partial void ProcessCancelShapingJobResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "CancelShapingJob", methodName: "CancelShapingJobAsync", - pathTemplate: "$\"/v1/shaping/{id}/cancel\"", + pathTemplate: "$\"/shaping/{id}/cancel\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.ShapingClient.CreateQuantizationJob.g.cs b/src/libs/Together/Generated/Together.ShapingClient.CreateQuantizationJob.g.cs index 6a9cebc6..a0d5ea2c 100644 --- a/src/libs/Together/Generated/Together.ShapingClient.CreateQuantizationJob.g.cs +++ b/src/libs/Together/Generated/Together.ShapingClient.CreateQuantizationJob.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class ShapingClient { + private static readonly global::Together.AutoSDKServer[] s_CreateQuantizationJobServers = 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_CreateQuantizationJobSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -43,12 +56,23 @@ partial void ProcessCreateQuantizationJobResponseContent( /// /// Prepare a fine-tuned model for FP4 inference
- /// Prepares a fine-tuned model for FP4 inference: an adapter is merged into its base model and the result quantized to FP4; a full model is quantized as it is. The model is resolved when the request is made, so a request naming a model that does not exist in the project, was not produced by fine-tuning, has no base model, or uses an unsupported base model is rejected with 400 rather than accepted and failed later. The request names the model by `model_object_id` (the deprecated `adapter_object_id` is still accepted). The run is priced before it is created, and a project that cannot cover it is answered 402. + /// Merges a fine-tuned adapter into its base model and prepares the result for FP4 inference. The adapter is resolved when the request is made, so a request naming a model that does not exist in the project, is not an adapter, was not produced by fine-tuning, has no base model to merge into, or uses an unsupported base model is rejected with 400 rather than accepted and failed later. The run is priced before it is created, and a project that cannot cover it is answered 402. ///
/// /// 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()
+ /// job = client.post_training.prepare_for_fp4_inference.create(
+ /// inputs={
+ /// "adapter_object_id": "ml_abc123",
+ /// "adapter_revision_id": "rv_abc123",
+ /// },
+ /// )
+ /// print(job.id, job.status) + ///
public async global::System.Threading.Tasks.Task CreateQuantizationJobAsync( global::Together.QuantizationRequest request, @@ -66,12 +90,23 @@ partial void ProcessCreateQuantizationJobResponseContent( } /// /// Prepare a fine-tuned model for FP4 inference
- /// Prepares a fine-tuned model for FP4 inference: an adapter is merged into its base model and the result quantized to FP4; a full model is quantized as it is. The model is resolved when the request is made, so a request naming a model that does not exist in the project, was not produced by fine-tuning, has no base model, or uses an unsupported base model is rejected with 400 rather than accepted and failed later. The request names the model by `model_object_id` (the deprecated `adapter_object_id` is still accepted). The run is priced before it is created, and a project that cannot cover it is answered 402. + /// Merges a fine-tuned adapter into its base model and prepares the result for FP4 inference. The adapter is resolved when the request is made, so a request naming a model that does not exist in the project, is not an adapter, was not produced by fine-tuning, has no base model to merge into, or uses an unsupported base model is rejected with 400 rather than accepted and failed later. The run is priced before it is created, and a project that cannot cover it is answered 402. ///
/// /// 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()
+ /// job = client.post_training.prepare_for_fp4_inference.create(
+ /// inputs={
+ /// "adapter_object_id": "ml_abc123",
+ /// "adapter_revision_id": "rv_abc123",
+ /// },
+ /// )
+ /// print(job.id, job.status) + ///
public async global::System.Threading.Tasks.Task> CreateQuantizationJobAsResponseAsync( global::Together.QuantizationRequest request, @@ -110,8 +145,10 @@ partial void ProcessCreateQuantizationJobResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: "/v1/shaping/prepare-for-fp4-inference", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: "/shaping/prepare-for-fp4-inference", + baseUri: ResolveBaseUri( + servers: s_CreateQuantizationJobServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -177,7 +214,7 @@ partial void ProcessCreateQuantizationJobResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "CreateQuantizationJob", methodName: "CreateQuantizationJobAsync", - pathTemplate: "\"/v1/shaping/prepare-for-fp4-inference\"", + pathTemplate: "\"/shaping/prepare-for-fp4-inference\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -211,7 +248,7 @@ partial void ProcessCreateQuantizationJobResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "CreateQuantizationJob", methodName: "CreateQuantizationJobAsync", - pathTemplate: "\"/v1/shaping/prepare-for-fp4-inference\"", + pathTemplate: "\"/shaping/prepare-for-fp4-inference\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -252,7 +289,7 @@ partial void ProcessCreateQuantizationJobResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "CreateQuantizationJob", methodName: "CreateQuantizationJobAsync", - pathTemplate: "\"/v1/shaping/prepare-for-fp4-inference\"", + pathTemplate: "\"/shaping/prepare-for-fp4-inference\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -300,7 +337,7 @@ partial void ProcessCreateQuantizationJobResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "CreateQuantizationJob", methodName: "CreateQuantizationJobAsync", - pathTemplate: "\"/v1/shaping/prepare-for-fp4-inference\"", + pathTemplate: "\"/shaping/prepare-for-fp4-inference\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -322,7 +359,7 @@ partial void ProcessCreateQuantizationJobResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "CreateQuantizationJob", methodName: "CreateQuantizationJobAsync", - pathTemplate: "\"/v1/shaping/prepare-for-fp4-inference\"", + pathTemplate: "\"/shaping/prepare-for-fp4-inference\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -657,11 +694,11 @@ partial void ProcessCreateQuantizationJobResponseContent( } /// /// Prepare a fine-tuned model for FP4 inference
- /// Prepares a fine-tuned model for FP4 inference: an adapter is merged into its base model and the result quantized to FP4; a full model is quantized as it is. The model is resolved when the request is made, so a request naming a model that does not exist in the project, was not produced by fine-tuning, has no base model, or uses an unsupported base model is rejected with 400 rather than accepted and failed later. The request names the model by `model_object_id` (the deprecated `adapter_object_id` is still accepted). The run is priced before it is created, and a project that cannot cover it is answered 402. + /// Merges a fine-tuned adapter into its base model and prepares the result for FP4 inference. The adapter is resolved when the request is made, so a request naming a model that does not exist in the project, is not an adapter, was not produced by fine-tuning, has no base model to merge into, or uses an unsupported base model is rejected with 400 rather than accepted and failed later. The run is priced before it is created, and a project that cannot cover it is answered 402. ///
/// - /// Inputs naming the fine-tuned model to prepare.
- /// Example: {"model_object_id":"ml_CeG3fF6pyEViU8dE8pk7R","model_revision_id":"rv_CeG3faPBj2ABwbAaHPTmx","calibration_file_id":"file-5f1b0c7a-2d19-4a3e-9c60-8ab41c2f7d35"} + /// Adapter inputs to prepare.
+ /// Example: {"adapter_object_id":"ml_CeG3fF6pyEViU8dE8pk7R","adapter_revision_id":"rv_CeG3faPBj2ABwbAaHPTmx","calibration_file_id":"file-5f1b0c7a-2d19-4a3e-9c60-8ab41c2f7d35"} /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with diff --git a/src/libs/Together/Generated/Together.ShapingClient.EstimateQuantizationJob.g.cs b/src/libs/Together/Generated/Together.ShapingClient.EstimateQuantizationJob.g.cs index 75a08757..844011ef 100644 --- a/src/libs/Together/Generated/Together.ShapingClient.EstimateQuantizationJob.g.cs +++ b/src/libs/Together/Generated/Together.ShapingClient.EstimateQuantizationJob.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class ShapingClient { + private static readonly global::Together.AutoSDKServer[] s_EstimateQuantizationJobServers = 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_EstimateQuantizationJobSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -43,12 +56,23 @@ partial void ProcessEstimateQuantizationJobResponseContent( /// /// Estimate FP4 preparation cost
- /// Reports the price and expected wall-clock time for preparing the model named by `model_object_id` or the deprecated `adapter_object_id` without creating a job. The request body is the same as POST /shaping/prepare-for-fp4-inference, so a caller can price exactly the job it is about to submit. + /// Reports the price and expected wall-clock time for preparing the named adapter without creating a job. The request body is the same as POST /shaping/prepare-for-fp4-inference, so a caller can price exactly the job it is about to submit. ///
/// /// 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()
+ /// estimate = client.post_training.prepare_for_fp4_inference.estimate_cost(
+ /// inputs={
+ /// "adapter_object_id": "ml_abc123",
+ /// "adapter_revision_id": "rv_abc123",
+ /// },
+ /// )
+ /// print(estimate.price_usd, estimate.time_hours, estimate.allowed_to_proceed) + ///
public async global::System.Threading.Tasks.Task EstimateQuantizationJobAsync( global::Together.QuantizationRequest request, @@ -66,12 +90,23 @@ partial void ProcessEstimateQuantizationJobResponseContent( } /// /// Estimate FP4 preparation cost
- /// Reports the price and expected wall-clock time for preparing the model named by `model_object_id` or the deprecated `adapter_object_id` without creating a job. The request body is the same as POST /shaping/prepare-for-fp4-inference, so a caller can price exactly the job it is about to submit. + /// Reports the price and expected wall-clock time for preparing the named adapter without creating a job. The request body is the same as POST /shaping/prepare-for-fp4-inference, so a caller can price exactly the job it is about to submit. ///
/// /// 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()
+ /// estimate = client.post_training.prepare_for_fp4_inference.estimate_cost(
+ /// inputs={
+ /// "adapter_object_id": "ml_abc123",
+ /// "adapter_revision_id": "rv_abc123",
+ /// },
+ /// )
+ /// print(estimate.price_usd, estimate.time_hours, estimate.allowed_to_proceed) + ///
public async global::System.Threading.Tasks.Task> EstimateQuantizationJobAsResponseAsync( global::Together.QuantizationRequest request, @@ -110,8 +145,10 @@ partial void ProcessEstimateQuantizationJobResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: "/v1/shaping/prepare-for-fp4-inference/estimate", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: "/shaping/prepare-for-fp4-inference/estimate", + baseUri: ResolveBaseUri( + servers: s_EstimateQuantizationJobServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -177,7 +214,7 @@ partial void ProcessEstimateQuantizationJobResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "EstimateQuantizationJob", methodName: "EstimateQuantizationJobAsync", - pathTemplate: "\"/v1/shaping/prepare-for-fp4-inference/estimate\"", + pathTemplate: "\"/shaping/prepare-for-fp4-inference/estimate\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -211,7 +248,7 @@ partial void ProcessEstimateQuantizationJobResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "EstimateQuantizationJob", methodName: "EstimateQuantizationJobAsync", - pathTemplate: "\"/v1/shaping/prepare-for-fp4-inference/estimate\"", + pathTemplate: "\"/shaping/prepare-for-fp4-inference/estimate\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -252,7 +289,7 @@ partial void ProcessEstimateQuantizationJobResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "EstimateQuantizationJob", methodName: "EstimateQuantizationJobAsync", - pathTemplate: "\"/v1/shaping/prepare-for-fp4-inference/estimate\"", + pathTemplate: "\"/shaping/prepare-for-fp4-inference/estimate\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -300,7 +337,7 @@ partial void ProcessEstimateQuantizationJobResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "EstimateQuantizationJob", methodName: "EstimateQuantizationJobAsync", - pathTemplate: "\"/v1/shaping/prepare-for-fp4-inference/estimate\"", + pathTemplate: "\"/shaping/prepare-for-fp4-inference/estimate\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -322,7 +359,7 @@ partial void ProcessEstimateQuantizationJobResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "EstimateQuantizationJob", methodName: "EstimateQuantizationJobAsync", - pathTemplate: "\"/v1/shaping/prepare-for-fp4-inference/estimate\"", + pathTemplate: "\"/shaping/prepare-for-fp4-inference/estimate\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -583,11 +620,11 @@ partial void ProcessEstimateQuantizationJobResponseContent( } /// /// Estimate FP4 preparation cost
- /// Reports the price and expected wall-clock time for preparing the model named by `model_object_id` or the deprecated `adapter_object_id` without creating a job. The request body is the same as POST /shaping/prepare-for-fp4-inference, so a caller can price exactly the job it is about to submit. + /// Reports the price and expected wall-clock time for preparing the named adapter without creating a job. The request body is the same as POST /shaping/prepare-for-fp4-inference, so a caller can price exactly the job it is about to submit. ///
/// - /// Inputs naming the fine-tuned model to prepare.
- /// Example: {"model_object_id":"ml_CeG3fF6pyEViU8dE8pk7R","model_revision_id":"rv_CeG3faPBj2ABwbAaHPTmx","calibration_file_id":"file-5f1b0c7a-2d19-4a3e-9c60-8ab41c2f7d35"} + /// Adapter inputs to prepare.
+ /// Example: {"adapter_object_id":"ml_CeG3fF6pyEViU8dE8pk7R","adapter_revision_id":"rv_CeG3faPBj2ABwbAaHPTmx","calibration_file_id":"file-5f1b0c7a-2d19-4a3e-9c60-8ab41c2f7d35"} /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with diff --git a/src/libs/Together/Generated/Together.ShapingClient.GetShapingEvents.g.cs b/src/libs/Together/Generated/Together.ShapingClient.GetShapingEvents.g.cs index 93af6ecc..98711c4d 100644 --- a/src/libs/Together/Generated/Together.ShapingClient.GetShapingEvents.g.cs +++ b/src/libs/Together/Generated/Together.ShapingClient.GetShapingEvents.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class ShapingClient { + private static readonly global::Together.AutoSDKServer[] s_GetShapingEventsServers = 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_GetShapingEventsSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -51,6 +64,15 @@ partial void ProcessGetShapingEventsResponseContent( /// 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()
+ /// events = client.post_training.prepare_for_fp4_inference.list_events(
+ /// "<JOB_ID>",
+ /// )
+ /// for event in events.data:
+ /// print(event) + ///
public async global::System.Threading.Tasks.Task GetShapingEventsAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -74,6 +96,15 @@ partial void ProcessGetShapingEventsResponseContent( /// 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()
+ /// events = client.post_training.prepare_for_fp4_inference.list_events(
+ /// "<JOB_ID>",
+ /// )
+ /// for event in events.data:
+ /// print(event) + ///
public async global::System.Threading.Tasks.Task> GetShapingEventsAsResponseAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -109,8 +140,10 @@ partial void ProcessGetShapingEventsResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v1/shaping/{id}/events", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/shaping/{id}/events", + baseUri: ResolveBaseUri( + servers: s_GetShapingEventsServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -170,7 +203,7 @@ partial void ProcessGetShapingEventsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetShapingEvents", methodName: "GetShapingEventsAsync", - pathTemplate: "$\"/v1/shaping/{id}/events\"", + pathTemplate: "$\"/shaping/{id}/events\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -204,7 +237,7 @@ partial void ProcessGetShapingEventsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetShapingEvents", methodName: "GetShapingEventsAsync", - pathTemplate: "$\"/v1/shaping/{id}/events\"", + pathTemplate: "$\"/shaping/{id}/events\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -245,7 +278,7 @@ partial void ProcessGetShapingEventsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetShapingEvents", methodName: "GetShapingEventsAsync", - pathTemplate: "$\"/v1/shaping/{id}/events\"", + pathTemplate: "$\"/shaping/{id}/events\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -293,7 +326,7 @@ partial void ProcessGetShapingEventsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetShapingEvents", methodName: "GetShapingEventsAsync", - pathTemplate: "$\"/v1/shaping/{id}/events\"", + pathTemplate: "$\"/shaping/{id}/events\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -315,7 +348,7 @@ partial void ProcessGetShapingEventsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetShapingEvents", methodName: "GetShapingEventsAsync", - pathTemplate: "$\"/v1/shaping/{id}/events\"", + pathTemplate: "$\"/shaping/{id}/events\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.ShapingClient.GetShapingJob.g.cs b/src/libs/Together/Generated/Together.ShapingClient.GetShapingJob.g.cs index b6678749..e0ce3e99 100644 --- a/src/libs/Together/Generated/Together.ShapingClient.GetShapingJob.g.cs +++ b/src/libs/Together/Generated/Together.ShapingClient.GetShapingJob.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class ShapingClient { + private static readonly global::Together.AutoSDKServer[] s_GetShapingJobServers = 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_GetShapingJobSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -51,6 +64,12 @@ partial void ProcessGetShapingJobResponseContent( /// 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()
+ /// job = client.post_training.prepare_for_fp4_inference.retrieve("<JOB_ID>")
+ /// print(job.status) + ///
public async global::System.Threading.Tasks.Task GetShapingJobAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -74,6 +93,12 @@ partial void ProcessGetShapingJobResponseContent( /// 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()
+ /// job = client.post_training.prepare_for_fp4_inference.retrieve("<JOB_ID>")
+ /// print(job.status) + ///
public async global::System.Threading.Tasks.Task> GetShapingJobAsResponseAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -109,8 +134,10 @@ partial void ProcessGetShapingJobResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v1/shaping/{id}", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/shaping/{id}", + baseUri: ResolveBaseUri( + servers: s_GetShapingJobServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -170,7 +197,7 @@ partial void ProcessGetShapingJobResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetShapingJob", methodName: "GetShapingJobAsync", - pathTemplate: "$\"/v1/shaping/{id}\"", + pathTemplate: "$\"/shaping/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -204,7 +231,7 @@ partial void ProcessGetShapingJobResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetShapingJob", methodName: "GetShapingJobAsync", - pathTemplate: "$\"/v1/shaping/{id}\"", + pathTemplate: "$\"/shaping/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -245,7 +272,7 @@ partial void ProcessGetShapingJobResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetShapingJob", methodName: "GetShapingJobAsync", - pathTemplate: "$\"/v1/shaping/{id}\"", + pathTemplate: "$\"/shaping/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -293,7 +320,7 @@ partial void ProcessGetShapingJobResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetShapingJob", methodName: "GetShapingJobAsync", - pathTemplate: "$\"/v1/shaping/{id}\"", + pathTemplate: "$\"/shaping/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -315,7 +342,7 @@ partial void ProcessGetShapingJobResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "GetShapingJob", methodName: "GetShapingJobAsync", - pathTemplate: "$\"/v1/shaping/{id}\"", + pathTemplate: "$\"/shaping/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.ShapingClient.ListShapingJobs.g.cs b/src/libs/Together/Generated/Together.ShapingClient.ListShapingJobs.g.cs index acbd9c23..6fc3532d 100644 --- a/src/libs/Together/Generated/Together.ShapingClient.ListShapingJobs.g.cs +++ b/src/libs/Together/Generated/Together.ShapingClient.ListShapingJobs.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class ShapingClient { + private static readonly global::Together.AutoSDKServer[] s_ListShapingJobsServers = 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_ListShapingJobsSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -46,6 +59,13 @@ partial void ProcessListShapingJobsResponseContent( /// 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()
+ /// jobs = client.post_training.prepare_for_fp4_inference.list()
+ /// for job in jobs.data:
+ /// print(job.id, job.status) + ///
public async global::System.Threading.Tasks.Task ListShapingJobsAsync( global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -64,6 +84,13 @@ partial void ProcessListShapingJobsResponseContent( /// 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()
+ /// jobs = client.post_training.prepare_for_fp4_inference.list()
+ /// for job in jobs.data:
+ /// print(job.id, job.status) + ///
public async global::System.Threading.Tasks.Task> ListShapingJobsAsResponseAsync( global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -97,8 +124,10 @@ partial void ProcessListShapingJobsResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: "/v1/shaping", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: "/shaping", + baseUri: ResolveBaseUri( + servers: s_ListShapingJobsServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -157,7 +186,7 @@ partial void ProcessListShapingJobsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ListShapingJobs", methodName: "ListShapingJobsAsync", - pathTemplate: "\"/v1/shaping\"", + pathTemplate: "\"/shaping\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -191,7 +220,7 @@ partial void ProcessListShapingJobsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ListShapingJobs", methodName: "ListShapingJobsAsync", - pathTemplate: "\"/v1/shaping\"", + pathTemplate: "\"/shaping\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -232,7 +261,7 @@ partial void ProcessListShapingJobsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ListShapingJobs", methodName: "ListShapingJobsAsync", - pathTemplate: "\"/v1/shaping\"", + pathTemplate: "\"/shaping\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -280,7 +309,7 @@ partial void ProcessListShapingJobsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ListShapingJobs", methodName: "ListShapingJobsAsync", - pathTemplate: "\"/v1/shaping\"", + pathTemplate: "\"/shaping\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -302,7 +331,7 @@ partial void ProcessListShapingJobsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "ListShapingJobs", methodName: "ListShapingJobsAsync", - pathTemplate: "\"/v1/shaping\"", + pathTemplate: "\"/shaping\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.ShapingClient.g.cs b/src/libs/Together/Generated/Together.ShapingClient.g.cs index 7de65af7..059870c3 100644 --- a/src/libs/Together/Generated/Together.ShapingClient.g.cs +++ b/src/libs/Together/Generated/Together.ShapingClient.g.cs @@ -12,7 +12,7 @@ public sealed partial class ShapingClient : global::Together.IShapingClient, glo /// /// Default environment for APIs /// - public const string DefaultBaseUrl = "https://api.together.ai/"; + public const string DefaultBaseUrl = "https://api.together.ai/v1"; private bool _disposeHttpClient = true; @@ -20,7 +20,7 @@ public sealed partial class ShapingClient : global::Together.IShapingClient, 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; } @@ -53,6 +53,34 @@ public sealed partial class ShapingClient : global::Together.IShapingClient, glo } + + 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 ShapingClient. /// If no httpClient is provided, a new one will be created. @@ -151,5 +179,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.SharedVolumeService.JsonSerializerContext.g.cs b/src/libs/Together/Generated/Together.SharedVolumeService.JsonSerializerContext.g.cs index c8b6b29c..3e85a47a 100644 --- a/src/libs/Together/Generated/Together.SharedVolumeService.JsonSerializerContext.g.cs +++ b/src/libs/Together/Generated/Together.SharedVolumeService.JsonSerializerContext.g.cs @@ -2,37 +2,7 @@ #nullable enable namespace Together -{ - /// - /// - /// - [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( - DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull - )] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(long))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GPUClustersSharedVolumeCreateRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GPUClustersSharedVolumeDeleteResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GPUClustersSharedVolume))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GPUClustersSharedVolumeStatus), TypeInfoPropertyName = "GPUClustersSharedVolumeStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GPUClustersSharedVolumeUpdateRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GPUClustersSharedVolumes))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(long?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.GPUClustersSharedVolumeStatus?), TypeInfoPropertyName = "NullableGPUClustersSharedVolumeStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - internal sealed partial class SharedVolumeServiceSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext - { - } - /// +{ /// /// /// public sealed partial class SharedVolumeServiceSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext @@ -76,26 +46,7 @@ private SharedVolumeServiceSourceGenerationContext(global::System.Text.Json.Json [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) { - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter, global::System.Collections.Generic.IList>()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter>()); - options.Converters.Add(new global::Together.JsonConverters.UnixTimestampJsonConverter()); - options.Converters.Add(new LazyEnumJsonConverterFactory()); + global::Together.SourceGenerationContext.AddConverters(options); } private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() @@ -110,34 +61,6 @@ public static void AddConverters(global::System.Text.Json.JsonSerializerOptions return options; } - - private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Serialization.JsonConverterFactory - { - public override bool CanConvert(global::System.Type typeToConvert) - { - return - typeToConvert == typeof(global::Together.GPUClustersSharedVolumeStatus) - - || typeToConvert == typeof(global::Together.GPUClustersSharedVolumeStatus?); - } - - public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - if (typeToConvert == typeof(global::Together.GPUClustersSharedVolumeStatus)) - { - return new global::Together.JsonConverters.GPUClustersSharedVolumeStatusJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.GPUClustersSharedVolumeStatus?)) - { - return new global::Together.JsonConverters.GPUClustersSharedVolumeStatusNullableJsonConverter(); - } - throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); - } - } - private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver { private readonly object _gate = new(); @@ -177,7 +100,7 @@ private sealed class LazyChunkResolver : global::System.Text.Json.Serialization. { return index switch { - 0 => new SharedVolumeServiceSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), + 0 => global::Together.SourceGenerationContext.TypeInfoResolver, _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), }; } diff --git a/src/libs/Together/Generated/Together.SharedVolumeServiceClient.SharedVolumeServiceCreate.g.cs b/src/libs/Together/Generated/Together.SharedVolumeServiceClient.SharedVolumeServiceCreate.g.cs index dc03cf98..5225bfe2 100644 --- a/src/libs/Together/Generated/Together.SharedVolumeServiceClient.SharedVolumeServiceCreate.g.cs +++ b/src/libs/Together/Generated/Together.SharedVolumeServiceClient.SharedVolumeServiceCreate.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class SharedVolumeServiceClient { + private static readonly global::Together.AutoSDKServer[] s_SharedVolumeServiceCreateServers = 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_SharedVolumeServiceCreateSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -51,6 +64,15 @@ partial void ProcessSharedVolumeServiceCreateResponseContent( /// 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()
+ /// volume = client.beta.clusters.storage.create(
+ /// volume_name="my-shared-volume",
+ /// size_tib=2,
+ /// region="us-west-2"
+ /// ) + ///
public async global::System.Threading.Tasks.Task SharedVolumeServiceCreateAsync( global::Together.GPUClustersSharedVolumeCreateRequest request, @@ -76,6 +98,15 @@ partial void ProcessSharedVolumeServiceCreateResponseContent( /// 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()
+ /// volume = client.beta.clusters.storage.create(
+ /// volume_name="my-shared-volume",
+ /// size_tib=2,
+ /// region="us-west-2"
+ /// ) + ///
public async global::System.Threading.Tasks.Task> SharedVolumeServiceCreateAsResponseAsync( global::Together.GPUClustersSharedVolumeCreateRequest request, @@ -114,8 +145,10 @@ partial void ProcessSharedVolumeServiceCreateResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: "/v1/compute/clusters/storage/volumes", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: "/compute/clusters/storage/volumes", + baseUri: ResolveBaseUri( + servers: s_SharedVolumeServiceCreateServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -181,7 +214,7 @@ partial void ProcessSharedVolumeServiceCreateResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "SharedVolumeServiceCreate", methodName: "SharedVolumeServiceCreateAsync", - pathTemplate: "\"/v1/compute/clusters/storage/volumes\"", + pathTemplate: "\"/compute/clusters/storage/volumes\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -215,7 +248,7 @@ partial void ProcessSharedVolumeServiceCreateResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "SharedVolumeServiceCreate", methodName: "SharedVolumeServiceCreateAsync", - pathTemplate: "\"/v1/compute/clusters/storage/volumes\"", + pathTemplate: "\"/compute/clusters/storage/volumes\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -256,7 +289,7 @@ partial void ProcessSharedVolumeServiceCreateResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "SharedVolumeServiceCreate", methodName: "SharedVolumeServiceCreateAsync", - pathTemplate: "\"/v1/compute/clusters/storage/volumes\"", + pathTemplate: "\"/compute/clusters/storage/volumes\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -304,7 +337,7 @@ partial void ProcessSharedVolumeServiceCreateResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "SharedVolumeServiceCreate", methodName: "SharedVolumeServiceCreateAsync", - pathTemplate: "\"/v1/compute/clusters/storage/volumes\"", + pathTemplate: "\"/compute/clusters/storage/volumes\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -326,7 +359,7 @@ partial void ProcessSharedVolumeServiceCreateResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "SharedVolumeServiceCreate", methodName: "SharedVolumeServiceCreateAsync", - pathTemplate: "\"/v1/compute/clusters/storage/volumes\"", + pathTemplate: "\"/compute/clusters/storage/volumes\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -459,7 +492,7 @@ partial void ProcessSharedVolumeServiceCreateResponseContent( /// Project ID that will own the volume. When omitted, the caller's default project is used. /// /// - /// Cluster ID to place the volume on the same infrastructure as that GPU cluster. + /// Cluster ID to pin the volume to the same substrate as that GPU cluster. /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with diff --git a/src/libs/Together/Generated/Together.SharedVolumeServiceClient.SharedVolumeServiceDelete.g.cs b/src/libs/Together/Generated/Together.SharedVolumeServiceClient.SharedVolumeServiceDelete.g.cs index 09470c88..13b072e1 100644 --- a/src/libs/Together/Generated/Together.SharedVolumeServiceClient.SharedVolumeServiceDelete.g.cs +++ b/src/libs/Together/Generated/Together.SharedVolumeServiceClient.SharedVolumeServiceDelete.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class SharedVolumeServiceClient { + private static readonly global::Together.AutoSDKServer[] s_SharedVolumeServiceDeleteServers = 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_SharedVolumeServiceDeleteSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -51,6 +64,12 @@ partial void ProcessSharedVolumeServiceDeleteResponseContent( /// 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()
+ /// volume = client.beta.clusters.storage.delete("volume_id")
+ /// print(volume) + ///
public async global::System.Threading.Tasks.Task SharedVolumeServiceDeleteAsync( string volumeId, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -74,6 +93,12 @@ partial void ProcessSharedVolumeServiceDeleteResponseContent( /// 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()
+ /// volume = client.beta.clusters.storage.delete("volume_id")
+ /// print(volume) + ///
public async global::System.Threading.Tasks.Task> SharedVolumeServiceDeleteAsResponseAsync( string volumeId, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -109,8 +134,10 @@ partial void ProcessSharedVolumeServiceDeleteResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v1/compute/clusters/storage/volumes/{volumeId}", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/compute/clusters/storage/volumes/{volumeId}", + baseUri: ResolveBaseUri( + servers: s_SharedVolumeServiceDeleteServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -170,7 +197,7 @@ partial void ProcessSharedVolumeServiceDeleteResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "SharedVolumeServiceDelete", methodName: "SharedVolumeServiceDeleteAsync", - pathTemplate: "$\"/v1/compute/clusters/storage/volumes/{volumeId}\"", + pathTemplate: "$\"/compute/clusters/storage/volumes/{volumeId}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -204,7 +231,7 @@ partial void ProcessSharedVolumeServiceDeleteResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "SharedVolumeServiceDelete", methodName: "SharedVolumeServiceDeleteAsync", - pathTemplate: "$\"/v1/compute/clusters/storage/volumes/{volumeId}\"", + pathTemplate: "$\"/compute/clusters/storage/volumes/{volumeId}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -245,7 +272,7 @@ partial void ProcessSharedVolumeServiceDeleteResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "SharedVolumeServiceDelete", methodName: "SharedVolumeServiceDeleteAsync", - pathTemplate: "$\"/v1/compute/clusters/storage/volumes/{volumeId}\"", + pathTemplate: "$\"/compute/clusters/storage/volumes/{volumeId}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -293,7 +320,7 @@ partial void ProcessSharedVolumeServiceDeleteResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "SharedVolumeServiceDelete", methodName: "SharedVolumeServiceDeleteAsync", - pathTemplate: "$\"/v1/compute/clusters/storage/volumes/{volumeId}\"", + pathTemplate: "$\"/compute/clusters/storage/volumes/{volumeId}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -315,7 +342,7 @@ partial void ProcessSharedVolumeServiceDeleteResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "SharedVolumeServiceDelete", methodName: "SharedVolumeServiceDeleteAsync", - pathTemplate: "$\"/v1/compute/clusters/storage/volumes/{volumeId}\"", + pathTemplate: "$\"/compute/clusters/storage/volumes/{volumeId}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.SharedVolumeServiceClient.SharedVolumeServiceGet.g.cs b/src/libs/Together/Generated/Together.SharedVolumeServiceClient.SharedVolumeServiceGet.g.cs index ff44d078..63d978e5 100644 --- a/src/libs/Together/Generated/Together.SharedVolumeServiceClient.SharedVolumeServiceGet.g.cs +++ b/src/libs/Together/Generated/Together.SharedVolumeServiceClient.SharedVolumeServiceGet.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class SharedVolumeServiceClient { + private static readonly global::Together.AutoSDKServer[] s_SharedVolumeServiceGetServers = 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_SharedVolumeServiceGetSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -51,6 +64,12 @@ partial void ProcessSharedVolumeServiceGetResponseContent( /// 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()
+ /// volume = client.beta.clusters.storage.retrieve("volume_id")
+ /// print(volume) + ///
public async global::System.Threading.Tasks.Task SharedVolumeServiceGetAsync( string volumeId, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -74,6 +93,12 @@ partial void ProcessSharedVolumeServiceGetResponseContent( /// 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()
+ /// volume = client.beta.clusters.storage.retrieve("volume_id")
+ /// print(volume) + ///
public async global::System.Threading.Tasks.Task> SharedVolumeServiceGetAsResponseAsync( string volumeId, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -109,8 +134,10 @@ partial void ProcessSharedVolumeServiceGetResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v1/compute/clusters/storage/volumes/{volumeId}", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/compute/clusters/storage/volumes/{volumeId}", + baseUri: ResolveBaseUri( + servers: s_SharedVolumeServiceGetServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -170,7 +197,7 @@ partial void ProcessSharedVolumeServiceGetResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "SharedVolumeServiceGet", methodName: "SharedVolumeServiceGetAsync", - pathTemplate: "$\"/v1/compute/clusters/storage/volumes/{volumeId}\"", + pathTemplate: "$\"/compute/clusters/storage/volumes/{volumeId}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -204,7 +231,7 @@ partial void ProcessSharedVolumeServiceGetResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "SharedVolumeServiceGet", methodName: "SharedVolumeServiceGetAsync", - pathTemplate: "$\"/v1/compute/clusters/storage/volumes/{volumeId}\"", + pathTemplate: "$\"/compute/clusters/storage/volumes/{volumeId}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -245,7 +272,7 @@ partial void ProcessSharedVolumeServiceGetResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "SharedVolumeServiceGet", methodName: "SharedVolumeServiceGetAsync", - pathTemplate: "$\"/v1/compute/clusters/storage/volumes/{volumeId}\"", + pathTemplate: "$\"/compute/clusters/storage/volumes/{volumeId}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -293,7 +320,7 @@ partial void ProcessSharedVolumeServiceGetResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "SharedVolumeServiceGet", methodName: "SharedVolumeServiceGetAsync", - pathTemplate: "$\"/v1/compute/clusters/storage/volumes/{volumeId}\"", + pathTemplate: "$\"/compute/clusters/storage/volumes/{volumeId}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -315,7 +342,7 @@ partial void ProcessSharedVolumeServiceGetResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "SharedVolumeServiceGet", methodName: "SharedVolumeServiceGetAsync", - pathTemplate: "$\"/v1/compute/clusters/storage/volumes/{volumeId}\"", + pathTemplate: "$\"/compute/clusters/storage/volumes/{volumeId}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.SharedVolumeServiceClient.SharedVolumeServiceList.g.cs b/src/libs/Together/Generated/Together.SharedVolumeServiceClient.SharedVolumeServiceList.g.cs index ff067768..54fac9d7 100644 --- a/src/libs/Together/Generated/Together.SharedVolumeServiceClient.SharedVolumeServiceList.g.cs +++ b/src/libs/Together/Generated/Together.SharedVolumeServiceClient.SharedVolumeServiceList.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class SharedVolumeServiceClient { + private static readonly global::Together.AutoSDKServer[] s_SharedVolumeServiceListServers = 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_SharedVolumeServiceListSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -53,6 +66,12 @@ partial void ProcessSharedVolumeServiceListResponseContent( /// 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()
+ /// volumes = client.beta.clusters.storage.list()
+ /// print(volumes) + ///
public async global::System.Threading.Tasks.Task SharedVolumeServiceListAsync( string? projectId = default, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -78,6 +97,12 @@ partial void ProcessSharedVolumeServiceListResponseContent( /// 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()
+ /// volumes = client.beta.clusters.storage.list()
+ /// print(volumes) + ///
public async global::System.Threading.Tasks.Task> SharedVolumeServiceListAsResponseAsync( string? projectId = default, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -113,8 +138,10 @@ partial void ProcessSharedVolumeServiceListResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: "/v1/compute/clusters/storage/volumes", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: "/compute/clusters/storage/volumes", + baseUri: ResolveBaseUri( + servers: s_SharedVolumeServiceListServers, + defaultBaseUrl: "https://api.together.ai/v1")); __pathBuilder .AddOptionalParameter("projectId", projectId) ; @@ -177,7 +204,7 @@ partial void ProcessSharedVolumeServiceListResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "SharedVolumeServiceList", methodName: "SharedVolumeServiceListAsync", - pathTemplate: "\"/v1/compute/clusters/storage/volumes\"", + pathTemplate: "\"/compute/clusters/storage/volumes\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -211,7 +238,7 @@ partial void ProcessSharedVolumeServiceListResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "SharedVolumeServiceList", methodName: "SharedVolumeServiceListAsync", - pathTemplate: "\"/v1/compute/clusters/storage/volumes\"", + pathTemplate: "\"/compute/clusters/storage/volumes\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -252,7 +279,7 @@ partial void ProcessSharedVolumeServiceListResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "SharedVolumeServiceList", methodName: "SharedVolumeServiceListAsync", - pathTemplate: "\"/v1/compute/clusters/storage/volumes\"", + pathTemplate: "\"/compute/clusters/storage/volumes\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -300,7 +327,7 @@ partial void ProcessSharedVolumeServiceListResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "SharedVolumeServiceList", methodName: "SharedVolumeServiceListAsync", - pathTemplate: "\"/v1/compute/clusters/storage/volumes\"", + pathTemplate: "\"/compute/clusters/storage/volumes\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -322,7 +349,7 @@ partial void ProcessSharedVolumeServiceListResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "SharedVolumeServiceList", methodName: "SharedVolumeServiceListAsync", - pathTemplate: "\"/v1/compute/clusters/storage/volumes\"", + pathTemplate: "\"/compute/clusters/storage/volumes\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.SharedVolumeServiceClient.SharedVolumeServiceUpdate.g.cs b/src/libs/Together/Generated/Together.SharedVolumeServiceClient.SharedVolumeServiceUpdate.g.cs index 881175b0..47d58289 100644 --- a/src/libs/Together/Generated/Together.SharedVolumeServiceClient.SharedVolumeServiceUpdate.g.cs +++ b/src/libs/Together/Generated/Together.SharedVolumeServiceClient.SharedVolumeServiceUpdate.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class SharedVolumeServiceClient { + private static readonly global::Together.AutoSDKServer[] s_SharedVolumeServiceUpdateServers = 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_SharedVolumeServiceUpdateSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -49,6 +62,15 @@ partial void ProcessSharedVolumeServiceUpdateResponseContent( /// 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()
+ /// volume = client.beta.clusters.storage.update(
+ /// volume_id="12345-67890-12345-67890",
+ /// size_tib=3
+ /// )
+ /// print(volume) + ///
public async global::System.Threading.Tasks.Task SharedVolumeServiceUpdateAsync( global::Together.GPUClustersSharedVolumeUpdateRequest request, @@ -72,6 +94,15 @@ partial void ProcessSharedVolumeServiceUpdateResponseContent( /// 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()
+ /// volume = client.beta.clusters.storage.update(
+ /// volume_id="12345-67890-12345-67890",
+ /// size_tib=3
+ /// )
+ /// print(volume) + ///
public async global::System.Threading.Tasks.Task> SharedVolumeServiceUpdateAsResponseAsync( global::Together.GPUClustersSharedVolumeUpdateRequest request, @@ -110,8 +141,10 @@ partial void ProcessSharedVolumeServiceUpdateResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: "/v1/compute/clusters/storage/volumes", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: "/compute/clusters/storage/volumes", + baseUri: ResolveBaseUri( + servers: s_SharedVolumeServiceUpdateServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -177,7 +210,7 @@ partial void ProcessSharedVolumeServiceUpdateResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "SharedVolumeServiceUpdate", methodName: "SharedVolumeServiceUpdateAsync", - pathTemplate: "\"/v1/compute/clusters/storage/volumes\"", + pathTemplate: "\"/compute/clusters/storage/volumes\"", httpMethod: "PUT", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -211,7 +244,7 @@ partial void ProcessSharedVolumeServiceUpdateResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "SharedVolumeServiceUpdate", methodName: "SharedVolumeServiceUpdateAsync", - pathTemplate: "\"/v1/compute/clusters/storage/volumes\"", + pathTemplate: "\"/compute/clusters/storage/volumes\"", httpMethod: "PUT", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -252,7 +285,7 @@ partial void ProcessSharedVolumeServiceUpdateResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "SharedVolumeServiceUpdate", methodName: "SharedVolumeServiceUpdateAsync", - pathTemplate: "\"/v1/compute/clusters/storage/volumes\"", + pathTemplate: "\"/compute/clusters/storage/volumes\"", httpMethod: "PUT", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -300,7 +333,7 @@ partial void ProcessSharedVolumeServiceUpdateResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "SharedVolumeServiceUpdate", methodName: "SharedVolumeServiceUpdateAsync", - pathTemplate: "\"/v1/compute/clusters/storage/volumes\"", + pathTemplate: "\"/compute/clusters/storage/volumes\"", httpMethod: "PUT", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -322,7 +355,7 @@ partial void ProcessSharedVolumeServiceUpdateResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "SharedVolumeServiceUpdate", methodName: "SharedVolumeServiceUpdateAsync", - pathTemplate: "\"/v1/compute/clusters/storage/volumes\"", + pathTemplate: "\"/compute/clusters/storage/volumes\"", httpMethod: "PUT", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.SharedVolumeServiceClient.g.cs b/src/libs/Together/Generated/Together.SharedVolumeServiceClient.g.cs index 5fa42add..0c3f3aa5 100644 --- a/src/libs/Together/Generated/Together.SharedVolumeServiceClient.g.cs +++ b/src/libs/Together/Generated/Together.SharedVolumeServiceClient.g.cs @@ -12,7 +12,7 @@ public sealed partial class SharedVolumeServiceClient : global::Together.IShared /// /// Default environment for APIs /// - public const string DefaultBaseUrl = "https://api.together.ai/"; + public const string DefaultBaseUrl = "https://api.together.ai/v1"; private bool _disposeHttpClient = true; @@ -20,7 +20,7 @@ public sealed partial class SharedVolumeServiceClient : global::Together.IShared 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; } @@ -53,6 +53,34 @@ public sealed partial class SharedVolumeServiceClient : global::Together.IShared } + + 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 SharedVolumeServiceClient. /// If no httpClient is provided, a new one will be created. @@ -151,5 +179,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.SupportedModelsService.JsonSerializerContext.g.cs b/src/libs/Together/Generated/Together.SupportedModelsService.JsonSerializerContext.g.cs index dd0aa184..9682d9bf 100644 --- a/src/libs/Together/Generated/Together.SupportedModelsService.JsonSerializerContext.g.cs +++ b/src/libs/Together/Generated/Together.SupportedModelsService.JsonSerializerContext.g.cs @@ -2,71 +2,7 @@ #nullable enable namespace Together -{ - /// - /// - /// - [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( - DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull - )] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(double))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeListSupportedModelsResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeSupportedModel))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeSupportedModelDeploymentProfile))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeSupportedModelPerformanceBenchmarks))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeSupportedModelDeploymentProfileAdapterMode), TypeInfoPropertyName = "DeSupportedModelDeploymentProfileAdapterMode2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeSupportedModelPricing))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeSupportedModelInputModalitie), TypeInfoPropertyName = "DeSupportedModelInputModalitie2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeSupportedModelOutputModalitie), TypeInfoPropertyName = "DeSupportedModelOutputModalitie2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeSupportedModelProduct), TypeInfoPropertyName = "DeSupportedModelProduct2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeSupportedModelFeature), TypeInfoPropertyName = "DeSupportedModelFeature2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeSupportedModelCapabilitie), TypeInfoPropertyName = "DeSupportedModelCapabilitie2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeSupportedModelStatus), TypeInfoPropertyName = "DeSupportedModelStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ErrorData))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ErrorDataError))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.SupportedModelsServiceListSupportedModelsModality), TypeInfoPropertyName = "SupportedModelsServiceListSupportedModelsModality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.SupportedModelsServiceListSupportedModelsProduct), TypeInfoPropertyName = "SupportedModelsServiceListSupportedModelsProduct2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.SupportedModelsServiceListSupportedModelsAdapterMode), TypeInfoPropertyName = "SupportedModelsServiceListSupportedModelsAdapterMode2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(double?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeSupportedModelDeploymentProfileAdapterMode?), TypeInfoPropertyName = "NullableDeSupportedModelDeploymentProfileAdapterMode2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeSupportedModelInputModalitie?), TypeInfoPropertyName = "NullableDeSupportedModelInputModalitie2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeSupportedModelOutputModalitie?), TypeInfoPropertyName = "NullableDeSupportedModelOutputModalitie2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeSupportedModelProduct?), TypeInfoPropertyName = "NullableDeSupportedModelProduct2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeSupportedModelFeature?), TypeInfoPropertyName = "NullableDeSupportedModelFeature2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeSupportedModelCapabilitie?), TypeInfoPropertyName = "NullableDeSupportedModelCapabilitie2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeSupportedModelStatus?), TypeInfoPropertyName = "NullableDeSupportedModelStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.SupportedModelsServiceListSupportedModelsModality?), TypeInfoPropertyName = "NullableSupportedModelsServiceListSupportedModelsModality2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.SupportedModelsServiceListSupportedModelsProduct?), TypeInfoPropertyName = "NullableSupportedModelsServiceListSupportedModelsProduct2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.SupportedModelsServiceListSupportedModelsAdapterMode?), TypeInfoPropertyName = "NullableSupportedModelsServiceListSupportedModelsAdapterMode2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - internal sealed partial class SupportedModelsServiceSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext - { - } - /// +{ /// /// /// public sealed partial class SupportedModelsServiceSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext @@ -110,26 +46,7 @@ private SupportedModelsServiceSourceGenerationContext(global::System.Text.Json.J [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) { - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter, global::System.Collections.Generic.IList>()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter>()); - options.Converters.Add(new global::Together.JsonConverters.UnixTimestampJsonConverter()); - options.Converters.Add(new LazyEnumJsonConverterFactory()); + global::Together.SourceGenerationContext.AddConverters(options); } private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() @@ -144,160 +61,6 @@ public static void AddConverters(global::System.Text.Json.JsonSerializerOptions return options; } - - private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Serialization.JsonConverterFactory - { - public override bool CanConvert(global::System.Type typeToConvert) - { - return - typeToConvert == typeof(global::Together.DeSupportedModelDeploymentProfileAdapterMode) - - || typeToConvert == typeof(global::Together.DeSupportedModelDeploymentProfileAdapterMode?) - - || typeToConvert == typeof(global::Together.DeSupportedModelInputModalitie) - - || typeToConvert == typeof(global::Together.DeSupportedModelInputModalitie?) - - || typeToConvert == typeof(global::Together.DeSupportedModelOutputModalitie) - - || typeToConvert == typeof(global::Together.DeSupportedModelOutputModalitie?) - - || typeToConvert == typeof(global::Together.DeSupportedModelProduct) - - || typeToConvert == typeof(global::Together.DeSupportedModelProduct?) - - || typeToConvert == typeof(global::Together.DeSupportedModelFeature) - - || typeToConvert == typeof(global::Together.DeSupportedModelFeature?) - - || typeToConvert == typeof(global::Together.DeSupportedModelCapabilitie) - - || typeToConvert == typeof(global::Together.DeSupportedModelCapabilitie?) - - || typeToConvert == typeof(global::Together.DeSupportedModelStatus) - - || typeToConvert == typeof(global::Together.DeSupportedModelStatus?) - - || typeToConvert == typeof(global::Together.SupportedModelsServiceListSupportedModelsModality) - - || typeToConvert == typeof(global::Together.SupportedModelsServiceListSupportedModelsModality?) - - || typeToConvert == typeof(global::Together.SupportedModelsServiceListSupportedModelsProduct) - - || typeToConvert == typeof(global::Together.SupportedModelsServiceListSupportedModelsProduct?) - - || typeToConvert == typeof(global::Together.SupportedModelsServiceListSupportedModelsAdapterMode) - - || typeToConvert == typeof(global::Together.SupportedModelsServiceListSupportedModelsAdapterMode?); - } - - public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - if (typeToConvert == typeof(global::Together.DeSupportedModelDeploymentProfileAdapterMode)) - { - return new global::Together.JsonConverters.DeSupportedModelDeploymentProfileAdapterModeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeSupportedModelDeploymentProfileAdapterMode?)) - { - return new global::Together.JsonConverters.DeSupportedModelDeploymentProfileAdapterModeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeSupportedModelInputModalitie)) - { - return new global::Together.JsonConverters.DeSupportedModelInputModalitieJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeSupportedModelInputModalitie?)) - { - return new global::Together.JsonConverters.DeSupportedModelInputModalitieNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeSupportedModelOutputModalitie)) - { - return new global::Together.JsonConverters.DeSupportedModelOutputModalitieJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeSupportedModelOutputModalitie?)) - { - return new global::Together.JsonConverters.DeSupportedModelOutputModalitieNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeSupportedModelProduct)) - { - return new global::Together.JsonConverters.DeSupportedModelProductJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeSupportedModelProduct?)) - { - return new global::Together.JsonConverters.DeSupportedModelProductNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeSupportedModelFeature)) - { - return new global::Together.JsonConverters.DeSupportedModelFeatureJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeSupportedModelFeature?)) - { - return new global::Together.JsonConverters.DeSupportedModelFeatureNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeSupportedModelCapabilitie)) - { - return new global::Together.JsonConverters.DeSupportedModelCapabilitieJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeSupportedModelCapabilitie?)) - { - return new global::Together.JsonConverters.DeSupportedModelCapabilitieNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeSupportedModelStatus)) - { - return new global::Together.JsonConverters.DeSupportedModelStatusJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeSupportedModelStatus?)) - { - return new global::Together.JsonConverters.DeSupportedModelStatusNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.SupportedModelsServiceListSupportedModelsModality)) - { - return new global::Together.JsonConverters.SupportedModelsServiceListSupportedModelsModalityJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.SupportedModelsServiceListSupportedModelsModality?)) - { - return new global::Together.JsonConverters.SupportedModelsServiceListSupportedModelsModalityNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.SupportedModelsServiceListSupportedModelsProduct)) - { - return new global::Together.JsonConverters.SupportedModelsServiceListSupportedModelsProductJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.SupportedModelsServiceListSupportedModelsProduct?)) - { - return new global::Together.JsonConverters.SupportedModelsServiceListSupportedModelsProductNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.SupportedModelsServiceListSupportedModelsAdapterMode)) - { - return new global::Together.JsonConverters.SupportedModelsServiceListSupportedModelsAdapterModeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.SupportedModelsServiceListSupportedModelsAdapterMode?)) - { - return new global::Together.JsonConverters.SupportedModelsServiceListSupportedModelsAdapterModeNullableJsonConverter(); - } - throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); - } - } - private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver { private readonly object _gate = new(); @@ -337,7 +100,7 @@ private sealed class LazyChunkResolver : global::System.Text.Json.Serialization. { return index switch { - 0 => new SupportedModelsServiceSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), + 0 => global::Together.SourceGenerationContext.TypeInfoResolver, _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), }; } diff --git a/src/libs/Together/Generated/Together.SupportedModelsServiceClient.SupportedModelsServiceGetSupportedModel.g.cs b/src/libs/Together/Generated/Together.SupportedModelsServiceClient.SupportedModelsServiceGetSupportedModel.g.cs index 11aa742c..2668ffab 100644 --- a/src/libs/Together/Generated/Together.SupportedModelsServiceClient.SupportedModelsServiceGetSupportedModel.g.cs +++ b/src/libs/Together/Generated/Together.SupportedModelsServiceClient.SupportedModelsServiceGetSupportedModel.g.cs @@ -6,6 +6,14 @@ namespace Together public partial class SupportedModelsServiceClient { + private static readonly global::Together.AutoSDKServer[] s_SupportedModelsServiceGetSupportedModelServers = 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_SupportedModelsServiceGetSupportedModelSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -51,6 +59,12 @@ partial void ProcessSupportedModelsServiceGetSupportedModelResponseContent( /// 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()
+ /// model = client.beta.models.retrieve_supported("arch_abc123")
+ /// print(model.name, model.deployment_profiles) + ///
public async global::System.Threading.Tasks.Task SupportedModelsServiceGetSupportedModelAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -74,6 +88,12 @@ partial void ProcessSupportedModelsServiceGetSupportedModelResponseContent( /// 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()
+ /// model = client.beta.models.retrieve_supported("arch_abc123")
+ /// print(model.name, model.deployment_profiles) + ///
public async global::System.Threading.Tasks.Task> SupportedModelsServiceGetSupportedModelAsResponseAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -109,8 +129,10 @@ partial void ProcessSupportedModelsServiceGetSupportedModelResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v2/supported-models/{id}", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/supported-models/{id}", + baseUri: ResolveBaseUri( + servers: s_SupportedModelsServiceGetSupportedModelServers, + defaultBaseUrl: "https://api.together.ai/v2")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -170,7 +192,7 @@ partial void ProcessSupportedModelsServiceGetSupportedModelResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "SupportedModelsServiceGetSupportedModel", methodName: "SupportedModelsServiceGetSupportedModelAsync", - pathTemplate: "$\"/v2/supported-models/{id}\"", + pathTemplate: "$\"/supported-models/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -204,7 +226,7 @@ partial void ProcessSupportedModelsServiceGetSupportedModelResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "SupportedModelsServiceGetSupportedModel", methodName: "SupportedModelsServiceGetSupportedModelAsync", - pathTemplate: "$\"/v2/supported-models/{id}\"", + pathTemplate: "$\"/supported-models/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -245,7 +267,7 @@ partial void ProcessSupportedModelsServiceGetSupportedModelResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "SupportedModelsServiceGetSupportedModel", methodName: "SupportedModelsServiceGetSupportedModelAsync", - pathTemplate: "$\"/v2/supported-models/{id}\"", + pathTemplate: "$\"/supported-models/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -293,7 +315,7 @@ partial void ProcessSupportedModelsServiceGetSupportedModelResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "SupportedModelsServiceGetSupportedModel", methodName: "SupportedModelsServiceGetSupportedModelAsync", - pathTemplate: "$\"/v2/supported-models/{id}\"", + pathTemplate: "$\"/supported-models/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -315,7 +337,7 @@ partial void ProcessSupportedModelsServiceGetSupportedModelResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "SupportedModelsServiceGetSupportedModel", methodName: "SupportedModelsServiceGetSupportedModelAsync", - pathTemplate: "$\"/v2/supported-models/{id}\"", + pathTemplate: "$\"/supported-models/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.SupportedModelsServiceClient.SupportedModelsServiceListSupportedModels.g.cs b/src/libs/Together/Generated/Together.SupportedModelsServiceClient.SupportedModelsServiceListSupportedModels.g.cs index 30cbf8a6..2ffe9441 100644 --- a/src/libs/Together/Generated/Together.SupportedModelsServiceClient.SupportedModelsServiceListSupportedModels.g.cs +++ b/src/libs/Together/Generated/Together.SupportedModelsServiceClient.SupportedModelsServiceListSupportedModels.g.cs @@ -6,6 +6,14 @@ namespace Together public partial class SupportedModelsServiceClient { + private static readonly global::Together.AutoSDKServer[] s_SupportedModelsServiceListSupportedModelsServers = 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_SupportedModelsServiceListSupportedModelsSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -76,6 +84,13 @@ partial void ProcessSupportedModelsServiceListSupportedModelsResponseContent( /// 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()
+ /// models = client.beta.models.list_supported(product="PRODUCT_DEDICATED")
+ /// for model in models:
+ /// print(model.id, model.name) + ///
public async global::System.Threading.Tasks.Task SupportedModelsServiceListSupportedModelsAsync( global::Together.SupportedModelsServiceListSupportedModelsModality? modality = default, global::Together.SupportedModelsServiceListSupportedModelsProduct? product = default, @@ -124,6 +139,13 @@ partial void ProcessSupportedModelsServiceListSupportedModelsResponseContent( /// 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()
+ /// models = client.beta.models.list_supported(product="PRODUCT_DEDICATED")
+ /// for model in models:
+ /// print(model.id, model.name) + ///
public async global::System.Threading.Tasks.Task> SupportedModelsServiceListSupportedModelsAsResponseAsync( global::Together.SupportedModelsServiceListSupportedModelsModality? modality = default, global::Together.SupportedModelsServiceListSupportedModelsProduct? product = default, @@ -169,8 +191,10 @@ partial void ProcessSupportedModelsServiceListSupportedModelsResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: "/v2/supported-models", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: "/supported-models", + baseUri: ResolveBaseUri( + servers: s_SupportedModelsServiceListSupportedModelsServers, + defaultBaseUrl: "https://api.together.ai/v2")); __pathBuilder .AddOptionalParameter("modality", modality?.ToValueString()) .AddOptionalParameter("product", product?.ToValueString()) @@ -243,7 +267,7 @@ partial void ProcessSupportedModelsServiceListSupportedModelsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "SupportedModelsServiceListSupportedModels", methodName: "SupportedModelsServiceListSupportedModelsAsync", - pathTemplate: "\"/v2/supported-models\"", + pathTemplate: "\"/supported-models\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -277,7 +301,7 @@ partial void ProcessSupportedModelsServiceListSupportedModelsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "SupportedModelsServiceListSupportedModels", methodName: "SupportedModelsServiceListSupportedModelsAsync", - pathTemplate: "\"/v2/supported-models\"", + pathTemplate: "\"/supported-models\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -318,7 +342,7 @@ partial void ProcessSupportedModelsServiceListSupportedModelsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "SupportedModelsServiceListSupportedModels", methodName: "SupportedModelsServiceListSupportedModelsAsync", - pathTemplate: "\"/v2/supported-models\"", + pathTemplate: "\"/supported-models\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -366,7 +390,7 @@ partial void ProcessSupportedModelsServiceListSupportedModelsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "SupportedModelsServiceListSupportedModels", methodName: "SupportedModelsServiceListSupportedModelsAsync", - pathTemplate: "\"/v2/supported-models\"", + pathTemplate: "\"/supported-models\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -388,7 +412,7 @@ partial void ProcessSupportedModelsServiceListSupportedModelsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "SupportedModelsServiceListSupportedModels", methodName: "SupportedModelsServiceListSupportedModelsAsync", - pathTemplate: "\"/v2/supported-models\"", + pathTemplate: "\"/supported-models\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.SupportedModelsServiceClient.g.cs b/src/libs/Together/Generated/Together.SupportedModelsServiceClient.g.cs index 79ade6cf..35b7a140 100644 --- a/src/libs/Together/Generated/Together.SupportedModelsServiceClient.g.cs +++ b/src/libs/Together/Generated/Together.SupportedModelsServiceClient.g.cs @@ -10,9 +10,9 @@ namespace Together public sealed partial class SupportedModelsServiceClient : global::Together.ISupportedModelsServiceClient, global::System.IDisposable { /// - /// Default environment for APIs + /// /// - public const string DefaultBaseUrl = "https://api.together.ai/"; + public const string DefaultBaseUrl = "https://api.together.ai/v2"; private bool _disposeHttpClient = true; @@ -151,5 +151,36 @@ 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.TogetherClient.g.cs b/src/libs/Together/Generated/Together.TogetherClient.g.cs index 61f1f3ed..35d1951c 100644 --- a/src/libs/Together/Generated/Together.TogetherClient.g.cs +++ b/src/libs/Together/Generated/Together.TogetherClient.g.cs @@ -13,7 +13,7 @@ public sealed partial class TogetherClient : global::Together.ITogetherClient, g /// /// Default environment for APIs /// - public const string DefaultBaseUrl = "https://api.together.ai/"; + public const string DefaultBaseUrl = "https://api.together.ai/v1"; private bool _disposeHttpClient = true; @@ -120,6 +120,17 @@ public sealed partial class TogetherClient : global::Together.ITogetherClient, g AutoSDKServerConfiguration = AutoSDKServerConfiguration, }; + /// + /// + /// + public CodeInterpreterClient CodeInterpreter => new CodeInterpreterClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + CreateIdempotencyKey = CreateIdempotencyKey, + JsonSerializerContextProvider = JsonSerializerContextProvider, + AutoSDKServerConfiguration = AutoSDKServerConfiguration, + }; + /// /// /// @@ -208,6 +219,28 @@ public sealed partial class TogetherClient : global::Together.ITogetherClient, g AutoSDKServerConfiguration = AutoSDKServerConfiguration, }; + /// + /// + /// + public EndpointsClient Endpoints => new EndpointsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + CreateIdempotencyKey = CreateIdempotencyKey, + JsonSerializerContextProvider = JsonSerializerContextProvider, + AutoSDKServerConfiguration = AutoSDKServerConfiguration, + }; + + /// + /// + /// + public Endpoints2Client Endpoints2 => new Endpoints2Client(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + CreateIdempotencyKey = CreateIdempotencyKey, + JsonSerializerContextProvider = JsonSerializerContextProvider, + AutoSDKServerConfiguration = AutoSDKServerConfiguration, + }; + /// /// /// @@ -252,6 +285,17 @@ public sealed partial class TogetherClient : global::Together.ITogetherClient, g AutoSDKServerConfiguration = AutoSDKServerConfiguration, }; + /// + /// + /// + public HardwareClient Hardware => new HardwareClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + CreateIdempotencyKey = CreateIdempotencyKey, + JsonSerializerContextProvider = JsonSerializerContextProvider, + AutoSDKServerConfiguration = AutoSDKServerConfiguration, + }; + /// /// /// @@ -296,6 +340,28 @@ public sealed partial class TogetherClient : global::Together.ITogetherClient, g AutoSDKServerConfiguration = AutoSDKServerConfiguration, }; + /// + /// + /// + public JobsClient Jobs => new JobsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + CreateIdempotencyKey = CreateIdempotencyKey, + JsonSerializerContextProvider = JsonSerializerContextProvider, + AutoSDKServerConfiguration = AutoSDKServerConfiguration, + }; + + /// + /// + /// + public ModelsClient Models => new ModelsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + CreateIdempotencyKey = CreateIdempotencyKey, + JsonSerializerContextProvider = JsonSerializerContextProvider, + AutoSDKServerConfiguration = AutoSDKServerConfiguration, + }; + /// /// /// @@ -486,14 +552,19 @@ public sealed partial class TogetherClient : global::Together.ITogetherClient, g private static readonly global::Together.AutoSDKServer[] s_availableServers = new global::Together.AutoSDKServer[] { new global::Together.AutoSDKServer( - id: "https-api-together-ai", + id: "https-api-together-ai-v1", name: "Default environment for APIs", - url: "https://api.together.ai/", + url: "https://api.together.ai/v1", description: "Default environment for APIs"), new global::Together.AutoSDKServer( - id: "https-api-inference-together-ai", - name: "api-inference.together.ai", - url: "https://api-inference.together.ai/", + id: "https-api-inference-together-ai-v2", + name: "Optimized environment for inference", + url: "https://api-inference.together.ai/v2", + description: "Optimized environment for inference"), + new global::Together.AutoSDKServer( + id: "https-api-together-ai-v2", + name: "api.together.ai v2", + url: "https://api.together.ai/v2", description: ""), }; diff --git a/src/libs/Together/Generated/Together.Video.JsonSerializerContext.g.cs b/src/libs/Together/Generated/Together.Video.JsonSerializerContext.g.cs index b0b5c2fc..edff3f41 100644 --- a/src/libs/Together/Generated/Together.Video.JsonSerializerContext.g.cs +++ b/src/libs/Together/Generated/Together.Video.JsonSerializerContext.g.cs @@ -2,56 +2,7 @@ #nullable enable namespace Together -{ - /// - /// - /// - [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( - DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull - )] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(double))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.CreateVideoBody))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.VideoOutputFormat), TypeInfoPropertyName = "VideoOutputFormat2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.VideoMedia))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.VideoStatus), TypeInfoPropertyName = "VideoStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.VideoFrameImageInput))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AnyOf), TypeInfoPropertyName = "AnyOfDoubleVideoFrameImageInputFrame2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.VideoFrameImageInputFrame), TypeInfoPropertyName = "VideoFrameImageInputFrame2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.VideoRef))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf), TypeInfoPropertyName = "OneOfStringVideoRef2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList>))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf), TypeInfoPropertyName = "OneOfStringAudioRef2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AudioRef))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.VideoJob))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.VideoJobError))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.VideoJobOutputs))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(double?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.VideoOutputFormat?), TypeInfoPropertyName = "NullableVideoOutputFormat2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.VideoStatus?), TypeInfoPropertyName = "NullableVideoStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.AnyOf?), TypeInfoPropertyName = "NullableAnyOfDoubleVideoFrameImageInputFrame2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.VideoFrameImageInputFrame?), TypeInfoPropertyName = "NullableVideoFrameImageInputFrame2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf?), TypeInfoPropertyName = "NullableOneOfStringVideoRef2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.OneOf?), TypeInfoPropertyName = "NullableOneOfStringAudioRef2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List>))] - internal sealed partial class VideoSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext - { - } - /// +{ /// /// /// public sealed partial class VideoSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext @@ -95,29 +46,7 @@ private VideoSourceGenerationContext(global::System.Text.Json.JsonSerializerOpti [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) { - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter, global::System.Collections.Generic.IList>()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter>()); - options.Converters.Add(new global::Together.JsonConverters.AnyOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.UnixTimestampJsonConverter()); - options.Converters.Add(new LazyEnumJsonConverterFactory()); + global::Together.SourceGenerationContext.AddConverters(options); } private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() @@ -132,62 +61,6 @@ public static void AddConverters(global::System.Text.Json.JsonSerializerOptions return options; } - - private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Serialization.JsonConverterFactory - { - public override bool CanConvert(global::System.Type typeToConvert) - { - return - typeToConvert == typeof(global::Together.VideoStatus) - - || typeToConvert == typeof(global::Together.VideoStatus?) - - || typeToConvert == typeof(global::Together.VideoFrameImageInputFrame) - - || typeToConvert == typeof(global::Together.VideoFrameImageInputFrame?) - - || typeToConvert == typeof(global::Together.VideoOutputFormat) - - || typeToConvert == typeof(global::Together.VideoOutputFormat?); - } - - public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - if (typeToConvert == typeof(global::Together.VideoStatus)) - { - return new global::Together.JsonConverters.VideoStatusJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.VideoStatus?)) - { - return new global::Together.JsonConverters.VideoStatusNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.VideoFrameImageInputFrame)) - { - return new global::Together.JsonConverters.VideoFrameImageInputFrameJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.VideoFrameImageInputFrame?)) - { - return new global::Together.JsonConverters.VideoFrameImageInputFrameNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.VideoOutputFormat)) - { - return new global::Together.JsonConverters.VideoOutputFormatJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.VideoOutputFormat?)) - { - return new global::Together.JsonConverters.VideoOutputFormatNullableJsonConverter(); - } - throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); - } - } - private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver { private readonly object _gate = new(); @@ -227,7 +100,7 @@ private sealed class LazyChunkResolver : global::System.Text.Json.Serialization. { return index switch { - 0 => new VideoSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), + 0 => global::Together.SourceGenerationContext.TypeInfoResolver, _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), }; } diff --git a/src/libs/Together/Generated/Together.VideoClient.CreateVideo.g.cs b/src/libs/Together/Generated/Together.VideoClient.CreateVideo.g.cs index aaef57c0..142911e9 100644 --- a/src/libs/Together/Generated/Together.VideoClient.CreateVideo.g.cs +++ b/src/libs/Together/Generated/Together.VideoClient.CreateVideo.g.cs @@ -1,11 +1,21 @@ #nullable enable +#pragma warning disable CS0618 // Type or member is obsolete + namespace Together { public partial class VideoClient { + private static readonly global::Together.AutoSDKServer[] s_CreateVideoServers = 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_CreateVideoSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -49,6 +59,18 @@ partial void ProcessCreateVideoResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.videos.create(
+ /// model="minimax/video-01-director",
+ /// prompt="A cartoon of an astronaut riding a horse on the moon"
+ /// )
+ /// print(response.id) + ///
public async global::System.Threading.Tasks.Task CreateVideoAsync( global::Together.CreateVideoBody request, @@ -72,6 +94,18 @@ partial void ProcessCreateVideoResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.videos.create(
+ /// model="minimax/video-01-director",
+ /// prompt="A cartoon of an astronaut riding a horse on the moon"
+ /// )
+ /// print(response.id) + ///
public async global::System.Threading.Tasks.Task> CreateVideoAsResponseAsync( global::Together.CreateVideoBody request, @@ -110,8 +144,10 @@ partial void ProcessCreateVideoResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: "/v2/videos", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: "/videos", + baseUri: ResolveBaseUri( + servers: s_CreateVideoServers, + defaultBaseUrl: "https://api.together.ai/v2")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -177,7 +213,7 @@ partial void ProcessCreateVideoResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "CreateVideo", methodName: "CreateVideoAsync", - pathTemplate: "\"/v2/videos\"", + pathTemplate: "\"/videos\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -211,7 +247,7 @@ partial void ProcessCreateVideoResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "CreateVideo", methodName: "CreateVideoAsync", - pathTemplate: "\"/v2/videos\"", + pathTemplate: "\"/videos\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -252,7 +288,7 @@ partial void ProcessCreateVideoResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "CreateVideo", methodName: "CreateVideoAsync", - pathTemplate: "\"/v2/videos\"", + pathTemplate: "\"/videos\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -300,7 +336,7 @@ partial void ProcessCreateVideoResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "CreateVideo", methodName: "CreateVideoAsync", - pathTemplate: "\"/v2/videos\"", + pathTemplate: "\"/videos\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -322,7 +358,7 @@ partial void ProcessCreateVideoResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "CreateVideo", methodName: "CreateVideoAsync", - pathTemplate: "\"/v2/videos\"", + pathTemplate: "\"/videos\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.VideoClient.RetrieveVideo.g.cs b/src/libs/Together/Generated/Together.VideoClient.RetrieveVideo.g.cs index 052110f7..6dd92f2c 100644 --- a/src/libs/Together/Generated/Together.VideoClient.RetrieveVideo.g.cs +++ b/src/libs/Together/Generated/Together.VideoClient.RetrieveVideo.g.cs @@ -6,6 +6,14 @@ namespace Together public partial class VideoClient { + private static readonly global::Together.AutoSDKServer[] s_RetrieveVideoServers = 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_RetrieveVideoSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -51,6 +59,15 @@ partial void ProcessRetrieveVideoResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.videos.retrieve("<VIDEO_ID>")
+ /// print(response.status) + ///
public async global::System.Threading.Tasks.Task RetrieveVideoAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -74,6 +91,15 @@ partial void ProcessRetrieveVideoResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.videos.retrieve("<VIDEO_ID>")
+ /// print(response.status) + ///
public async global::System.Threading.Tasks.Task> RetrieveVideoAsResponseAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -109,8 +135,10 @@ partial void ProcessRetrieveVideoResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v2/videos/{id}", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/videos/{id}", + baseUri: ResolveBaseUri( + servers: s_RetrieveVideoServers, + defaultBaseUrl: "https://api.together.ai/v2")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -170,7 +198,7 @@ partial void ProcessRetrieveVideoResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RetrieveVideo", methodName: "RetrieveVideoAsync", - pathTemplate: "$\"/v2/videos/{id}\"", + pathTemplate: "$\"/videos/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -204,7 +232,7 @@ partial void ProcessRetrieveVideoResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RetrieveVideo", methodName: "RetrieveVideoAsync", - pathTemplate: "$\"/v2/videos/{id}\"", + pathTemplate: "$\"/videos/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -245,7 +273,7 @@ partial void ProcessRetrieveVideoResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RetrieveVideo", methodName: "RetrieveVideoAsync", - pathTemplate: "$\"/v2/videos/{id}\"", + pathTemplate: "$\"/videos/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -293,7 +321,7 @@ partial void ProcessRetrieveVideoResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RetrieveVideo", methodName: "RetrieveVideoAsync", - pathTemplate: "$\"/v2/videos/{id}\"", + pathTemplate: "$\"/videos/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -315,7 +343,7 @@ partial void ProcessRetrieveVideoResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "RetrieveVideo", methodName: "RetrieveVideoAsync", - pathTemplate: "$\"/v2/videos/{id}\"", + pathTemplate: "$\"/videos/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.VideoClient.g.cs b/src/libs/Together/Generated/Together.VideoClient.g.cs index 04d4413c..528a1909 100644 --- a/src/libs/Together/Generated/Together.VideoClient.g.cs +++ b/src/libs/Together/Generated/Together.VideoClient.g.cs @@ -10,9 +10,9 @@ namespace Together public sealed partial class VideoClient : global::Together.IVideoClient, global::System.IDisposable { /// - /// Default environment for APIs + /// /// - public const string DefaultBaseUrl = "https://api.together.ai/"; + public const string DefaultBaseUrl = "https://api.together.ai/v2"; private bool _disposeHttpClient = true; @@ -151,5 +151,36 @@ 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.Voices.JsonSerializerContext.g.cs b/src/libs/Together/Generated/Together.Voices.JsonSerializerContext.g.cs index 5cb49e64..8899c6eb 100644 --- a/src/libs/Together/Generated/Together.Voices.JsonSerializerContext.g.cs +++ b/src/libs/Together/Generated/Together.Voices.JsonSerializerContext.g.cs @@ -2,29 +2,7 @@ #nullable enable namespace Together -{ - /// - /// - /// - [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( - DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull - )] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ListVoicesResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ModelVoices))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ModelVoicesVoice))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - internal sealed partial class VoicesSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext - { - } - /// +{ /// /// /// public sealed partial class VoicesSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext @@ -68,25 +46,7 @@ private VoicesSourceGenerationContext(global::System.Text.Json.JsonSerializerOpt [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) { - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter, global::System.Collections.Generic.IList>()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter>()); - options.Converters.Add(new global::Together.JsonConverters.UnixTimestampJsonConverter()); + global::Together.SourceGenerationContext.AddConverters(options); } private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() @@ -140,7 +100,7 @@ private sealed class LazyChunkResolver : global::System.Text.Json.Serialization. { return index switch { - 0 => new VoicesSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), + 0 => global::Together.SourceGenerationContext.TypeInfoResolver, _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), }; } diff --git a/src/libs/Together/Generated/Together.VoicesClient.FetchVoices.g.cs b/src/libs/Together/Generated/Together.VoicesClient.FetchVoices.g.cs index af8d30fd..aeee21a5 100644 --- a/src/libs/Together/Generated/Together.VoicesClient.FetchVoices.g.cs +++ b/src/libs/Together/Generated/Together.VoicesClient.FetchVoices.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class VoicesClient { + private static readonly global::Together.AutoSDKServer[] s_FetchVoicesServers = 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_FetchVoicesSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -46,6 +59,15 @@ partial void ProcessFetchVoicesResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.audio.voices.list()
+ /// print(response.data) + ///
public async global::System.Threading.Tasks.Task FetchVoicesAsync( global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -64,6 +86,15 @@ partial void ProcessFetchVoicesResponseContent( /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// + /// + /// from together import Together
+ /// import os
+ /// client = Together(
+ /// api_key=os.environ.get("TOGETHER_API_KEY"),
+ /// )
+ /// response = client.audio.voices.list()
+ /// print(response.data) + ///
public async global::System.Threading.Tasks.Task> FetchVoicesAsResponseAsync( global::Together.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -97,8 +128,10 @@ partial void ProcessFetchVoicesResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: "/v1/voices", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: "/voices", + baseUri: ResolveBaseUri( + servers: s_FetchVoicesServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -157,7 +190,7 @@ partial void ProcessFetchVoicesResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "FetchVoices", methodName: "FetchVoicesAsync", - pathTemplate: "\"/v1/voices\"", + pathTemplate: "\"/voices\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -191,7 +224,7 @@ partial void ProcessFetchVoicesResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "FetchVoices", methodName: "FetchVoicesAsync", - pathTemplate: "\"/v1/voices\"", + pathTemplate: "\"/voices\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -232,7 +265,7 @@ partial void ProcessFetchVoicesResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "FetchVoices", methodName: "FetchVoicesAsync", - pathTemplate: "\"/v1/voices\"", + pathTemplate: "\"/voices\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -280,7 +313,7 @@ partial void ProcessFetchVoicesResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "FetchVoices", methodName: "FetchVoicesAsync", - pathTemplate: "\"/v1/voices\"", + pathTemplate: "\"/voices\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -302,7 +335,7 @@ partial void ProcessFetchVoicesResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "FetchVoices", methodName: "FetchVoicesAsync", - pathTemplate: "\"/v1/voices\"", + pathTemplate: "\"/voices\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.VoicesClient.g.cs b/src/libs/Together/Generated/Together.VoicesClient.g.cs index d6a5836a..5d7313cb 100644 --- a/src/libs/Together/Generated/Together.VoicesClient.g.cs +++ b/src/libs/Together/Generated/Together.VoicesClient.g.cs @@ -12,7 +12,7 @@ public sealed partial class VoicesClient : global::Together.IVoicesClient, globa /// /// Default environment for APIs /// - public const string DefaultBaseUrl = "https://api.together.ai/"; + public const string DefaultBaseUrl = "https://api.together.ai/v1"; private bool _disposeHttpClient = true; @@ -20,7 +20,7 @@ public sealed partial class VoicesClient : global::Together.IVoicesClient, globa 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; } @@ -53,6 +53,34 @@ public sealed partial class VoicesClient : global::Together.IVoicesClient, globa } + + 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 VoicesClient. /// If no httpClient is provided, a new one will be created. @@ -151,5 +179,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.VolumeService.JsonSerializerContext.g.cs b/src/libs/Together/Generated/Together.VolumeService.JsonSerializerContext.g.cs index 030ee824..3ffc2cdd 100644 --- a/src/libs/Together/Generated/Together.VolumeService.JsonSerializerContext.g.cs +++ b/src/libs/Together/Generated/Together.VolumeService.JsonSerializerContext.g.cs @@ -2,78 +2,7 @@ #nullable enable namespace Together -{ - /// - /// - /// - [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( - DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull - )] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeCreateRemoteUploadSpec))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeListFilesResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeListFilesResponseFile))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeDeleteResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeListRemoteUploadsResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeRemoteUpload))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeListRemoteUploadEventsResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeRemoteUploadEvent))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeListModelsResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeModel))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeListRevisionsResponse))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeListRevisionsResponseRevision))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeUpdateModelRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeUpdateModelRequestVisibility), TypeInfoPropertyName = "DeUpdateModelRequestVisibility2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeCreateModelRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeRemoteUploadStatus), TypeInfoPropertyName = "DeRemoteUploadStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeModelWeights))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeModelVisibility), TypeInfoPropertyName = "DeModelVisibility2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeRemoteUploadEventLevel), TypeInfoPropertyName = "DeRemoteUploadEventLevel2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeListRevisionsResponseRevisionValidationStatus), TypeInfoPropertyName = "DeListRevisionsResponseRevisionValidationStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeRevisionValidationError))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeModelWeightsType), TypeInfoPropertyName = "DeModelWeightsType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeModelWeightsSpeculatorMechanism), TypeInfoPropertyName = "DeModelWeightsSpeculatorMechanism2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeModelWeightsDraftSpeculatorType), TypeInfoPropertyName = "DeModelWeightsDraftSpeculatorType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeModelParameters))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeModelDTypeCount))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ErrorData))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.ErrorDataError))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.VolumeServiceListModelsVisibility), TypeInfoPropertyName = "VolumeServiceListModelsVisibility2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeUpdateModelRequestVisibility?), TypeInfoPropertyName = "NullableDeUpdateModelRequestVisibility2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeRemoteUploadStatus?), TypeInfoPropertyName = "NullableDeRemoteUploadStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeModelVisibility?), TypeInfoPropertyName = "NullableDeModelVisibility2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeRemoteUploadEventLevel?), TypeInfoPropertyName = "NullableDeRemoteUploadEventLevel2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeListRevisionsResponseRevisionValidationStatus?), TypeInfoPropertyName = "NullableDeListRevisionsResponseRevisionValidationStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeModelWeightsType?), TypeInfoPropertyName = "NullableDeModelWeightsType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeModelWeightsSpeculatorMechanism?), TypeInfoPropertyName = "NullableDeModelWeightsSpeculatorMechanism2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.DeModelWeightsDraftSpeculatorType?), TypeInfoPropertyName = "NullableDeModelWeightsDraftSpeculatorType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.VolumeServiceListModelsVisibility?), TypeInfoPropertyName = "NullableVolumeServiceListModelsVisibility2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - internal sealed partial class VolumeServiceSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext - { - } - /// +{ /// /// /// public sealed partial class VolumeServiceSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext @@ -117,26 +46,7 @@ private VolumeServiceSourceGenerationContext(global::System.Text.Json.JsonSerial [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) { - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter, global::System.Collections.Generic.IList>()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter>()); - options.Converters.Add(new global::Together.JsonConverters.UnixTimestampJsonConverter()); - options.Converters.Add(new LazyEnumJsonConverterFactory()); + global::Together.SourceGenerationContext.AddConverters(options); } private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() @@ -151,146 +61,6 @@ public static void AddConverters(global::System.Text.Json.JsonSerializerOptions return options; } - - private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Serialization.JsonConverterFactory - { - public override bool CanConvert(global::System.Type typeToConvert) - { - return - typeToConvert == typeof(global::Together.DeUpdateModelRequestVisibility) - - || typeToConvert == typeof(global::Together.DeUpdateModelRequestVisibility?) - - || typeToConvert == typeof(global::Together.DeRemoteUploadStatus) - - || typeToConvert == typeof(global::Together.DeRemoteUploadStatus?) - - || typeToConvert == typeof(global::Together.DeModelVisibility) - - || typeToConvert == typeof(global::Together.DeModelVisibility?) - - || typeToConvert == typeof(global::Together.DeRemoteUploadEventLevel) - - || typeToConvert == typeof(global::Together.DeRemoteUploadEventLevel?) - - || typeToConvert == typeof(global::Together.DeListRevisionsResponseRevisionValidationStatus) - - || typeToConvert == typeof(global::Together.DeListRevisionsResponseRevisionValidationStatus?) - - || typeToConvert == typeof(global::Together.DeModelWeightsType) - - || typeToConvert == typeof(global::Together.DeModelWeightsType?) - - || typeToConvert == typeof(global::Together.DeModelWeightsSpeculatorMechanism) - - || typeToConvert == typeof(global::Together.DeModelWeightsSpeculatorMechanism?) - - || typeToConvert == typeof(global::Together.DeModelWeightsDraftSpeculatorType) - - || typeToConvert == typeof(global::Together.DeModelWeightsDraftSpeculatorType?) - - || typeToConvert == typeof(global::Together.VolumeServiceListModelsVisibility) - - || typeToConvert == typeof(global::Together.VolumeServiceListModelsVisibility?); - } - - public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - if (typeToConvert == typeof(global::Together.DeUpdateModelRequestVisibility)) - { - return new global::Together.JsonConverters.DeUpdateModelRequestVisibilityJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeUpdateModelRequestVisibility?)) - { - return new global::Together.JsonConverters.DeUpdateModelRequestVisibilityNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeRemoteUploadStatus)) - { - return new global::Together.JsonConverters.DeRemoteUploadStatusJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeRemoteUploadStatus?)) - { - return new global::Together.JsonConverters.DeRemoteUploadStatusNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeModelVisibility)) - { - return new global::Together.JsonConverters.DeModelVisibilityJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeModelVisibility?)) - { - return new global::Together.JsonConverters.DeModelVisibilityNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeRemoteUploadEventLevel)) - { - return new global::Together.JsonConverters.DeRemoteUploadEventLevelJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeRemoteUploadEventLevel?)) - { - return new global::Together.JsonConverters.DeRemoteUploadEventLevelNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeListRevisionsResponseRevisionValidationStatus)) - { - return new global::Together.JsonConverters.DeListRevisionsResponseRevisionValidationStatusJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeListRevisionsResponseRevisionValidationStatus?)) - { - return new global::Together.JsonConverters.DeListRevisionsResponseRevisionValidationStatusNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeModelWeightsType)) - { - return new global::Together.JsonConverters.DeModelWeightsTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeModelWeightsType?)) - { - return new global::Together.JsonConverters.DeModelWeightsTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeModelWeightsSpeculatorMechanism)) - { - return new global::Together.JsonConverters.DeModelWeightsSpeculatorMechanismJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeModelWeightsSpeculatorMechanism?)) - { - return new global::Together.JsonConverters.DeModelWeightsSpeculatorMechanismNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeModelWeightsDraftSpeculatorType)) - { - return new global::Together.JsonConverters.DeModelWeightsDraftSpeculatorTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.DeModelWeightsDraftSpeculatorType?)) - { - return new global::Together.JsonConverters.DeModelWeightsDraftSpeculatorTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.VolumeServiceListModelsVisibility)) - { - return new global::Together.JsonConverters.VolumeServiceListModelsVisibilityJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.VolumeServiceListModelsVisibility?)) - { - return new global::Together.JsonConverters.VolumeServiceListModelsVisibilityNullableJsonConverter(); - } - throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); - } - } - private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver { private readonly object _gate = new(); @@ -330,7 +100,7 @@ private sealed class LazyChunkResolver : global::System.Text.Json.Serialization. { return index switch { - 0 => new VolumeServiceSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), + 0 => global::Together.SourceGenerationContext.TypeInfoResolver, _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), }; } diff --git a/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceCreateModel.g.cs b/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceCreateModel.g.cs index 8e736303..499e36aa 100644 --- a/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceCreateModel.g.cs +++ b/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceCreateModel.g.cs @@ -6,6 +6,14 @@ namespace Together public partial class VolumeServiceClient { + private static readonly global::Together.AutoSDKServer[] s_VolumeServiceCreateModelServers = 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_VolumeServiceCreateModelSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -54,6 +62,18 @@ partial void ProcessVolumeServiceCreateModelResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// model = client.beta.models.create(
+ /// project_id=project_id,
+ /// type="adapter",
+ /// name="my-lora-adapter",
+ /// base_model_id="ml_abc123",
+ /// )
+ /// print(model.id) + ///
public async global::System.Threading.Tasks.Task VolumeServiceCreateModelAsync( string projectId, @@ -82,6 +102,18 @@ partial void ProcessVolumeServiceCreateModelResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// model = client.beta.models.create(
+ /// project_id=project_id,
+ /// type="adapter",
+ /// name="my-lora-adapter",
+ /// base_model_id="ml_abc123",
+ /// )
+ /// print(model.id) + ///
public async global::System.Threading.Tasks.Task> VolumeServiceCreateModelAsResponseAsync( string projectId, @@ -122,8 +154,10 @@ partial void ProcessVolumeServiceCreateModelResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v2/projects/{projectId}/models", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/projects/{projectId}/models", + baseUri: ResolveBaseUri( + servers: s_VolumeServiceCreateModelServers, + defaultBaseUrl: "https://api.together.ai/v2")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -190,7 +224,7 @@ partial void ProcessVolumeServiceCreateModelResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "VolumeServiceCreateModel", methodName: "VolumeServiceCreateModelAsync", - pathTemplate: "$\"/v2/projects/{projectId}/models\"", + pathTemplate: "$\"/projects/{projectId}/models\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -224,7 +258,7 @@ partial void ProcessVolumeServiceCreateModelResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "VolumeServiceCreateModel", methodName: "VolumeServiceCreateModelAsync", - pathTemplate: "$\"/v2/projects/{projectId}/models\"", + pathTemplate: "$\"/projects/{projectId}/models\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -265,7 +299,7 @@ partial void ProcessVolumeServiceCreateModelResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "VolumeServiceCreateModel", methodName: "VolumeServiceCreateModelAsync", - pathTemplate: "$\"/v2/projects/{projectId}/models\"", + pathTemplate: "$\"/projects/{projectId}/models\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -313,7 +347,7 @@ partial void ProcessVolumeServiceCreateModelResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "VolumeServiceCreateModel", methodName: "VolumeServiceCreateModelAsync", - pathTemplate: "$\"/v2/projects/{projectId}/models\"", + pathTemplate: "$\"/projects/{projectId}/models\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -335,7 +369,7 @@ partial void ProcessVolumeServiceCreateModelResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "VolumeServiceCreateModel", methodName: "VolumeServiceCreateModelAsync", - pathTemplate: "$\"/v2/projects/{projectId}/models\"", + pathTemplate: "$\"/projects/{projectId}/models\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceCreateRemoteModelUpload.g.cs b/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceCreateRemoteModelUpload.g.cs index 9fb0e260..733c12a5 100644 --- a/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceCreateRemoteModelUpload.g.cs +++ b/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceCreateRemoteModelUpload.g.cs @@ -6,6 +6,14 @@ namespace Together public partial class VolumeServiceClient { + private static readonly global::Together.AutoSDKServer[] s_VolumeServiceCreateRemoteModelUploadServers = 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_VolumeServiceCreateRemoteModelUploadSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -54,6 +62,17 @@ partial void ProcessVolumeServiceCreateRemoteModelUploadResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// job = client.beta.models.remote_uploads.create(
+ /// project_id=project_id,
+ /// model_id="ml_abc123",
+ /// remote_url="https://huggingface.co/your-org/your-adapter",
+ /// )
+ /// print(job) + ///
public async global::System.Threading.Tasks.Task VolumeServiceCreateRemoteModelUploadAsync( string projectId, @@ -82,6 +101,17 @@ partial void ProcessVolumeServiceCreateRemoteModelUploadResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// job = client.beta.models.remote_uploads.create(
+ /// project_id=project_id,
+ /// model_id="ml_abc123",
+ /// remote_url="https://huggingface.co/your-org/your-adapter",
+ /// )
+ /// print(job) + ///
public async global::System.Threading.Tasks.Task> VolumeServiceCreateRemoteModelUploadAsResponseAsync( string projectId, @@ -122,8 +152,10 @@ partial void ProcessVolumeServiceCreateRemoteModelUploadResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v2/projects/{projectId}/models/uploads", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/projects/{projectId}/models/uploads", + baseUri: ResolveBaseUri( + servers: s_VolumeServiceCreateRemoteModelUploadServers, + defaultBaseUrl: "https://api.together.ai/v2")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -190,7 +222,7 @@ partial void ProcessVolumeServiceCreateRemoteModelUploadResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "VolumeServiceCreateRemoteModelUpload", methodName: "VolumeServiceCreateRemoteModelUploadAsync", - pathTemplate: "$\"/v2/projects/{projectId}/models/uploads\"", + pathTemplate: "$\"/projects/{projectId}/models/uploads\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -224,7 +256,7 @@ partial void ProcessVolumeServiceCreateRemoteModelUploadResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "VolumeServiceCreateRemoteModelUpload", methodName: "VolumeServiceCreateRemoteModelUploadAsync", - pathTemplate: "$\"/v2/projects/{projectId}/models/uploads\"", + pathTemplate: "$\"/projects/{projectId}/models/uploads\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -265,7 +297,7 @@ partial void ProcessVolumeServiceCreateRemoteModelUploadResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "VolumeServiceCreateRemoteModelUpload", methodName: "VolumeServiceCreateRemoteModelUploadAsync", - pathTemplate: "$\"/v2/projects/{projectId}/models/uploads\"", + pathTemplate: "$\"/projects/{projectId}/models/uploads\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -313,7 +345,7 @@ partial void ProcessVolumeServiceCreateRemoteModelUploadResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "VolumeServiceCreateRemoteModelUpload", methodName: "VolumeServiceCreateRemoteModelUploadAsync", - pathTemplate: "$\"/v2/projects/{projectId}/models/uploads\"", + pathTemplate: "$\"/projects/{projectId}/models/uploads\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -335,7 +367,7 @@ partial void ProcessVolumeServiceCreateRemoteModelUploadResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "VolumeServiceCreateRemoteModelUpload", methodName: "VolumeServiceCreateRemoteModelUploadAsync", - pathTemplate: "$\"/v2/projects/{projectId}/models/uploads\"", + pathTemplate: "$\"/projects/{projectId}/models/uploads\"", httpMethod: "POST", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceDeleteModel.g.cs b/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceDeleteModel.g.cs index 348903ad..a69440b9 100644 --- a/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceDeleteModel.g.cs +++ b/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceDeleteModel.g.cs @@ -6,6 +6,14 @@ namespace Together public partial class VolumeServiceClient { + private static readonly global::Together.AutoSDKServer[] s_VolumeServiceDeleteModelServers = 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_VolumeServiceDeleteModelSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -56,6 +64,12 @@ partial void ProcessVolumeServiceDeleteModelResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// client.beta.models.delete("ml_abc123", project_id=project_id) + ///
public async global::System.Threading.Tasks.Task VolumeServiceDeleteModelAsync( string projectId, string id, @@ -84,6 +98,12 @@ partial void ProcessVolumeServiceDeleteModelResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// client.beta.models.delete("ml_abc123", project_id=project_id) + ///
public async global::System.Threading.Tasks.Task> VolumeServiceDeleteModelAsResponseAsync( string projectId, string id, @@ -121,8 +141,10 @@ partial void ProcessVolumeServiceDeleteModelResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v2/projects/{projectId}/models/{id}", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/projects/{projectId}/models/{id}", + baseUri: ResolveBaseUri( + servers: s_VolumeServiceDeleteModelServers, + defaultBaseUrl: "https://api.together.ai/v2")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -183,7 +205,7 @@ partial void ProcessVolumeServiceDeleteModelResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "VolumeServiceDeleteModel", methodName: "VolumeServiceDeleteModelAsync", - pathTemplate: "$\"/v2/projects/{projectId}/models/{id}\"", + pathTemplate: "$\"/projects/{projectId}/models/{id}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -217,7 +239,7 @@ partial void ProcessVolumeServiceDeleteModelResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "VolumeServiceDeleteModel", methodName: "VolumeServiceDeleteModelAsync", - pathTemplate: "$\"/v2/projects/{projectId}/models/{id}\"", + pathTemplate: "$\"/projects/{projectId}/models/{id}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -258,7 +280,7 @@ partial void ProcessVolumeServiceDeleteModelResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "VolumeServiceDeleteModel", methodName: "VolumeServiceDeleteModelAsync", - pathTemplate: "$\"/v2/projects/{projectId}/models/{id}\"", + pathTemplate: "$\"/projects/{projectId}/models/{id}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -306,7 +328,7 @@ partial void ProcessVolumeServiceDeleteModelResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "VolumeServiceDeleteModel", methodName: "VolumeServiceDeleteModelAsync", - pathTemplate: "$\"/v2/projects/{projectId}/models/{id}\"", + pathTemplate: "$\"/projects/{projectId}/models/{id}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -328,7 +350,7 @@ partial void ProcessVolumeServiceDeleteModelResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "VolumeServiceDeleteModel", methodName: "VolumeServiceDeleteModelAsync", - pathTemplate: "$\"/v2/projects/{projectId}/models/{id}\"", + pathTemplate: "$\"/projects/{projectId}/models/{id}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceGetModel.g.cs b/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceGetModel.g.cs index c9835434..4ba3a9c3 100644 --- a/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceGetModel.g.cs +++ b/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceGetModel.g.cs @@ -6,6 +6,14 @@ namespace Together public partial class VolumeServiceClient { + private static readonly global::Together.AutoSDKServer[] s_VolumeServiceGetModelServers = 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_VolumeServiceGetModelSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -56,6 +64,13 @@ partial void ProcessVolumeServiceGetModelResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// model = client.beta.models.retrieve("ml_abc123", project_id=project_id)
+ /// print(model.id, model.name) + ///
public async global::System.Threading.Tasks.Task VolumeServiceGetModelAsync( string projectId, string id, @@ -84,6 +99,13 @@ partial void ProcessVolumeServiceGetModelResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// model = client.beta.models.retrieve("ml_abc123", project_id=project_id)
+ /// print(model.id, model.name) + ///
public async global::System.Threading.Tasks.Task> VolumeServiceGetModelAsResponseAsync( string projectId, string id, @@ -121,8 +143,10 @@ partial void ProcessVolumeServiceGetModelResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v2/projects/{projectId}/models/{id}", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/projects/{projectId}/models/{id}", + baseUri: ResolveBaseUri( + servers: s_VolumeServiceGetModelServers, + defaultBaseUrl: "https://api.together.ai/v2")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -183,7 +207,7 @@ partial void ProcessVolumeServiceGetModelResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "VolumeServiceGetModel", methodName: "VolumeServiceGetModelAsync", - pathTemplate: "$\"/v2/projects/{projectId}/models/{id}\"", + pathTemplate: "$\"/projects/{projectId}/models/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -217,7 +241,7 @@ partial void ProcessVolumeServiceGetModelResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "VolumeServiceGetModel", methodName: "VolumeServiceGetModelAsync", - pathTemplate: "$\"/v2/projects/{projectId}/models/{id}\"", + pathTemplate: "$\"/projects/{projectId}/models/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -258,7 +282,7 @@ partial void ProcessVolumeServiceGetModelResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "VolumeServiceGetModel", methodName: "VolumeServiceGetModelAsync", - pathTemplate: "$\"/v2/projects/{projectId}/models/{id}\"", + pathTemplate: "$\"/projects/{projectId}/models/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -306,7 +330,7 @@ partial void ProcessVolumeServiceGetModelResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "VolumeServiceGetModel", methodName: "VolumeServiceGetModelAsync", - pathTemplate: "$\"/v2/projects/{projectId}/models/{id}\"", + pathTemplate: "$\"/projects/{projectId}/models/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -328,7 +352,7 @@ partial void ProcessVolumeServiceGetModelResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "VolumeServiceGetModel", methodName: "VolumeServiceGetModelAsync", - pathTemplate: "$\"/v2/projects/{projectId}/models/{id}\"", + pathTemplate: "$\"/projects/{projectId}/models/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceGetRemoteModelUpload.g.cs b/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceGetRemoteModelUpload.g.cs index 7ff60d0b..4e949585 100644 --- a/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceGetRemoteModelUpload.g.cs +++ b/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceGetRemoteModelUpload.g.cs @@ -6,6 +6,14 @@ namespace Together public partial class VolumeServiceClient { + private static readonly global::Together.AutoSDKServer[] s_VolumeServiceGetRemoteModelUploadServers = 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_VolumeServiceGetRemoteModelUploadSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -56,6 +64,16 @@ partial void ProcessVolumeServiceGetRemoteModelUploadResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// job = client.beta.models.remote_uploads.retrieve(
+ /// "job_abc123",
+ /// project_id=project_id,
+ /// )
+ /// print(job) + ///
public async global::System.Threading.Tasks.Task VolumeServiceGetRemoteModelUploadAsync( string projectId, string id, @@ -84,6 +102,16 @@ partial void ProcessVolumeServiceGetRemoteModelUploadResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// job = client.beta.models.remote_uploads.retrieve(
+ /// "job_abc123",
+ /// project_id=project_id,
+ /// )
+ /// print(job) + ///
public async global::System.Threading.Tasks.Task> VolumeServiceGetRemoteModelUploadAsResponseAsync( string projectId, string id, @@ -121,8 +149,10 @@ partial void ProcessVolumeServiceGetRemoteModelUploadResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v2/projects/{projectId}/models/uploads/{id}", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/projects/{projectId}/models/uploads/{id}", + baseUri: ResolveBaseUri( + servers: s_VolumeServiceGetRemoteModelUploadServers, + defaultBaseUrl: "https://api.together.ai/v2")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -183,7 +213,7 @@ partial void ProcessVolumeServiceGetRemoteModelUploadResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "VolumeServiceGetRemoteModelUpload", methodName: "VolumeServiceGetRemoteModelUploadAsync", - pathTemplate: "$\"/v2/projects/{projectId}/models/uploads/{id}\"", + pathTemplate: "$\"/projects/{projectId}/models/uploads/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -217,7 +247,7 @@ partial void ProcessVolumeServiceGetRemoteModelUploadResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "VolumeServiceGetRemoteModelUpload", methodName: "VolumeServiceGetRemoteModelUploadAsync", - pathTemplate: "$\"/v2/projects/{projectId}/models/uploads/{id}\"", + pathTemplate: "$\"/projects/{projectId}/models/uploads/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -258,7 +288,7 @@ partial void ProcessVolumeServiceGetRemoteModelUploadResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "VolumeServiceGetRemoteModelUpload", methodName: "VolumeServiceGetRemoteModelUploadAsync", - pathTemplate: "$\"/v2/projects/{projectId}/models/uploads/{id}\"", + pathTemplate: "$\"/projects/{projectId}/models/uploads/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -306,7 +336,7 @@ partial void ProcessVolumeServiceGetRemoteModelUploadResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "VolumeServiceGetRemoteModelUpload", methodName: "VolumeServiceGetRemoteModelUploadAsync", - pathTemplate: "$\"/v2/projects/{projectId}/models/uploads/{id}\"", + pathTemplate: "$\"/projects/{projectId}/models/uploads/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -328,7 +358,7 @@ partial void ProcessVolumeServiceGetRemoteModelUploadResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "VolumeServiceGetRemoteModelUpload", methodName: "VolumeServiceGetRemoteModelUploadAsync", - pathTemplate: "$\"/v2/projects/{projectId}/models/uploads/{id}\"", + pathTemplate: "$\"/projects/{projectId}/models/uploads/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceGetRevisionByModelType.g.cs b/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceGetRevisionByModelType.g.cs index 7cc5f429..77f8abf6 100644 --- a/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceGetRevisionByModelType.g.cs +++ b/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceGetRevisionByModelType.g.cs @@ -6,6 +6,14 @@ namespace Together public partial class VolumeServiceClient { + private static readonly global::Together.AutoSDKServer[] s_VolumeServiceGetRevisionByModelTypeServers = 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_VolumeServiceGetRevisionByModelTypeSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -61,6 +69,19 @@ partial void ProcessVolumeServiceGetRevisionByModelTypeResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// # The SDK has no dedicated method for this endpoint yet, so call it with
+ /// # the client's generic GET helper.
+ /// url = (
+ /// f"https://api.together.ai/v2/projects/{project_id}"
+ /// "/models/ml_abc123/revisions/rv_abc123"
+ /// )
+ /// revision = client.get(url, cast_to=object)
+ /// print(revision) + ///
public async global::System.Threading.Tasks.Task VolumeServiceGetRevisionByModelTypeAsync( string projectId, string id, @@ -94,6 +115,19 @@ partial void ProcessVolumeServiceGetRevisionByModelTypeResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// # The SDK has no dedicated method for this endpoint yet, so call it with
+ /// # the client's generic GET helper.
+ /// url = (
+ /// f"https://api.together.ai/v2/projects/{project_id}"
+ /// "/models/ml_abc123/revisions/rv_abc123"
+ /// )
+ /// revision = client.get(url, cast_to=object)
+ /// print(revision) + ///
public async global::System.Threading.Tasks.Task> VolumeServiceGetRevisionByModelTypeAsResponseAsync( string projectId, string id, @@ -133,8 +167,10 @@ partial void ProcessVolumeServiceGetRevisionByModelTypeResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v2/projects/{projectId}/models/{id}/revisions/{revisionId}", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/projects/{projectId}/models/{id}/revisions/{revisionId}", + baseUri: ResolveBaseUri( + servers: s_VolumeServiceGetRevisionByModelTypeServers, + defaultBaseUrl: "https://api.together.ai/v2")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -196,7 +232,7 @@ partial void ProcessVolumeServiceGetRevisionByModelTypeResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "VolumeServiceGetRevisionByModelType", methodName: "VolumeServiceGetRevisionByModelTypeAsync", - pathTemplate: "$\"/v2/projects/{projectId}/models/{id}/revisions/{revisionId}\"", + pathTemplate: "$\"/projects/{projectId}/models/{id}/revisions/{revisionId}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -230,7 +266,7 @@ partial void ProcessVolumeServiceGetRevisionByModelTypeResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "VolumeServiceGetRevisionByModelType", methodName: "VolumeServiceGetRevisionByModelTypeAsync", - pathTemplate: "$\"/v2/projects/{projectId}/models/{id}/revisions/{revisionId}\"", + pathTemplate: "$\"/projects/{projectId}/models/{id}/revisions/{revisionId}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -271,7 +307,7 @@ partial void ProcessVolumeServiceGetRevisionByModelTypeResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "VolumeServiceGetRevisionByModelType", methodName: "VolumeServiceGetRevisionByModelTypeAsync", - pathTemplate: "$\"/v2/projects/{projectId}/models/{id}/revisions/{revisionId}\"", + pathTemplate: "$\"/projects/{projectId}/models/{id}/revisions/{revisionId}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -319,7 +355,7 @@ partial void ProcessVolumeServiceGetRevisionByModelTypeResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "VolumeServiceGetRevisionByModelType", methodName: "VolumeServiceGetRevisionByModelTypeAsync", - pathTemplate: "$\"/v2/projects/{projectId}/models/{id}/revisions/{revisionId}\"", + pathTemplate: "$\"/projects/{projectId}/models/{id}/revisions/{revisionId}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -341,7 +377,7 @@ partial void ProcessVolumeServiceGetRevisionByModelTypeResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "VolumeServiceGetRevisionByModelType", methodName: "VolumeServiceGetRevisionByModelTypeAsync", - pathTemplate: "$\"/v2/projects/{projectId}/models/{id}/revisions/{revisionId}\"", + pathTemplate: "$\"/projects/{projectId}/models/{id}/revisions/{revisionId}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceListModelFiles.g.cs b/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceListModelFiles.g.cs index 7e29ae9b..79eb15d5 100644 --- a/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceListModelFiles.g.cs +++ b/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceListModelFiles.g.cs @@ -6,6 +6,14 @@ namespace Together public partial class VolumeServiceClient { + private static readonly global::Together.AutoSDKServer[] s_VolumeServiceListModelFilesServers = 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_VolumeServiceListModelFilesSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -61,6 +69,13 @@ partial void ProcessVolumeServiceListModelFilesResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// files = client.beta.models.list_files("ml_abc123", project_id=project_id)
+ /// print(files) + ///
public async global::System.Threading.Tasks.Task VolumeServiceListModelFilesAsync( string projectId, string id, @@ -94,6 +109,13 @@ partial void ProcessVolumeServiceListModelFilesResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// files = client.beta.models.list_files("ml_abc123", project_id=project_id)
+ /// print(files) + ///
public async global::System.Threading.Tasks.Task> VolumeServiceListModelFilesAsResponseAsync( string projectId, string id, @@ -133,8 +155,10 @@ partial void ProcessVolumeServiceListModelFilesResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v2/projects/{projectId}/models/{id}/files", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/projects/{projectId}/models/{id}/files", + baseUri: ResolveBaseUri( + servers: s_VolumeServiceListModelFilesServers, + defaultBaseUrl: "https://api.together.ai/v2")); __pathBuilder .AddOptionalParameter("revisionId", revisionId) ; @@ -199,7 +223,7 @@ partial void ProcessVolumeServiceListModelFilesResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "VolumeServiceListModelFiles", methodName: "VolumeServiceListModelFilesAsync", - pathTemplate: "$\"/v2/projects/{projectId}/models/{id}/files\"", + pathTemplate: "$\"/projects/{projectId}/models/{id}/files\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -233,7 +257,7 @@ partial void ProcessVolumeServiceListModelFilesResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "VolumeServiceListModelFiles", methodName: "VolumeServiceListModelFilesAsync", - pathTemplate: "$\"/v2/projects/{projectId}/models/{id}/files\"", + pathTemplate: "$\"/projects/{projectId}/models/{id}/files\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -274,7 +298,7 @@ partial void ProcessVolumeServiceListModelFilesResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "VolumeServiceListModelFiles", methodName: "VolumeServiceListModelFilesAsync", - pathTemplate: "$\"/v2/projects/{projectId}/models/{id}/files\"", + pathTemplate: "$\"/projects/{projectId}/models/{id}/files\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -322,7 +346,7 @@ partial void ProcessVolumeServiceListModelFilesResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "VolumeServiceListModelFiles", methodName: "VolumeServiceListModelFilesAsync", - pathTemplate: "$\"/v2/projects/{projectId}/models/{id}/files\"", + pathTemplate: "$\"/projects/{projectId}/models/{id}/files\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -344,7 +368,7 @@ partial void ProcessVolumeServiceListModelFilesResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "VolumeServiceListModelFiles", methodName: "VolumeServiceListModelFilesAsync", - pathTemplate: "$\"/v2/projects/{projectId}/models/{id}/files\"", + pathTemplate: "$\"/projects/{projectId}/models/{id}/files\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceListModelRevisions.g.cs b/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceListModelRevisions.g.cs index 30c79c37..f9a209f4 100644 --- a/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceListModelRevisions.g.cs +++ b/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceListModelRevisions.g.cs @@ -6,6 +6,14 @@ namespace Together public partial class VolumeServiceClient { + private static readonly global::Together.AutoSDKServer[] s_VolumeServiceListModelRevisionsServers = 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_VolumeServiceListModelRevisionsSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -56,6 +64,16 @@ partial void ProcessVolumeServiceListModelRevisionsResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// revisions = client.beta.models.list_revisions(
+ /// "ml_abc123",
+ /// project_id=project_id,
+ /// )
+ /// print(revisions) + ///
public async global::System.Threading.Tasks.Task VolumeServiceListModelRevisionsAsync( string projectId, string id, @@ -84,6 +102,16 @@ partial void ProcessVolumeServiceListModelRevisionsResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// revisions = client.beta.models.list_revisions(
+ /// "ml_abc123",
+ /// project_id=project_id,
+ /// )
+ /// print(revisions) + ///
public async global::System.Threading.Tasks.Task> VolumeServiceListModelRevisionsAsResponseAsync( string projectId, string id, @@ -121,8 +149,10 @@ partial void ProcessVolumeServiceListModelRevisionsResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v2/projects/{projectId}/models/{id}/revisions", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/projects/{projectId}/models/{id}/revisions", + baseUri: ResolveBaseUri( + servers: s_VolumeServiceListModelRevisionsServers, + defaultBaseUrl: "https://api.together.ai/v2")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -183,7 +213,7 @@ partial void ProcessVolumeServiceListModelRevisionsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "VolumeServiceListModelRevisions", methodName: "VolumeServiceListModelRevisionsAsync", - pathTemplate: "$\"/v2/projects/{projectId}/models/{id}/revisions\"", + pathTemplate: "$\"/projects/{projectId}/models/{id}/revisions\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -217,7 +247,7 @@ partial void ProcessVolumeServiceListModelRevisionsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "VolumeServiceListModelRevisions", methodName: "VolumeServiceListModelRevisionsAsync", - pathTemplate: "$\"/v2/projects/{projectId}/models/{id}/revisions\"", + pathTemplate: "$\"/projects/{projectId}/models/{id}/revisions\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -258,7 +288,7 @@ partial void ProcessVolumeServiceListModelRevisionsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "VolumeServiceListModelRevisions", methodName: "VolumeServiceListModelRevisionsAsync", - pathTemplate: "$\"/v2/projects/{projectId}/models/{id}/revisions\"", + pathTemplate: "$\"/projects/{projectId}/models/{id}/revisions\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -306,7 +336,7 @@ partial void ProcessVolumeServiceListModelRevisionsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "VolumeServiceListModelRevisions", methodName: "VolumeServiceListModelRevisionsAsync", - pathTemplate: "$\"/v2/projects/{projectId}/models/{id}/revisions\"", + pathTemplate: "$\"/projects/{projectId}/models/{id}/revisions\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -328,7 +358,7 @@ partial void ProcessVolumeServiceListModelRevisionsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "VolumeServiceListModelRevisions", methodName: "VolumeServiceListModelRevisionsAsync", - pathTemplate: "$\"/v2/projects/{projectId}/models/{id}/revisions\"", + pathTemplate: "$\"/projects/{projectId}/models/{id}/revisions\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceListModels.g.cs b/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceListModels.g.cs index 57185e2b..5a77e650 100644 --- a/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceListModels.g.cs +++ b/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceListModels.g.cs @@ -6,6 +6,14 @@ namespace Together public partial class VolumeServiceClient { + private static readonly global::Together.AutoSDKServer[] s_VolumeServiceListModelsServers = 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_VolumeServiceListModelsSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -71,6 +79,13 @@ partial void ProcessVolumeServiceListModelsResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// for model in client.beta.models.list(project_id=project_id):
+ /// print(model.id, model.name) + ///
public async global::System.Threading.Tasks.Task VolumeServiceListModelsAsync( string projectId, global::Together.VolumeServiceListModelsVisibility? visibility = default, @@ -114,6 +129,13 @@ partial void ProcessVolumeServiceListModelsResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// for model in client.beta.models.list(project_id=project_id):
+ /// print(model.id, model.name) + ///
public async global::System.Threading.Tasks.Task> VolumeServiceListModelsAsResponseAsync( string projectId, global::Together.VolumeServiceListModelsVisibility? visibility = default, @@ -157,8 +179,10 @@ partial void ProcessVolumeServiceListModelsResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v2/projects/{projectId}/models", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/projects/{projectId}/models", + baseUri: ResolveBaseUri( + servers: s_VolumeServiceListModelsServers, + defaultBaseUrl: "https://api.together.ai/v2")); __pathBuilder .AddOptionalParameter("visibility", visibility?.ToValueString()) .AddOptionalParameter("organizationId", organizationId) @@ -228,7 +252,7 @@ partial void ProcessVolumeServiceListModelsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "VolumeServiceListModels", methodName: "VolumeServiceListModelsAsync", - pathTemplate: "$\"/v2/projects/{projectId}/models\"", + pathTemplate: "$\"/projects/{projectId}/models\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -262,7 +286,7 @@ partial void ProcessVolumeServiceListModelsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "VolumeServiceListModels", methodName: "VolumeServiceListModelsAsync", - pathTemplate: "$\"/v2/projects/{projectId}/models\"", + pathTemplate: "$\"/projects/{projectId}/models\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -303,7 +327,7 @@ partial void ProcessVolumeServiceListModelsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "VolumeServiceListModels", methodName: "VolumeServiceListModelsAsync", - pathTemplate: "$\"/v2/projects/{projectId}/models\"", + pathTemplate: "$\"/projects/{projectId}/models\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -351,7 +375,7 @@ partial void ProcessVolumeServiceListModelsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "VolumeServiceListModels", methodName: "VolumeServiceListModelsAsync", - pathTemplate: "$\"/v2/projects/{projectId}/models\"", + pathTemplate: "$\"/projects/{projectId}/models\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -373,7 +397,7 @@ partial void ProcessVolumeServiceListModelsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "VolumeServiceListModels", methodName: "VolumeServiceListModelsAsync", - pathTemplate: "$\"/v2/projects/{projectId}/models\"", + pathTemplate: "$\"/projects/{projectId}/models\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceListOrganizationModels.g.cs b/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceListOrganizationModels.g.cs index 8d00e30c..882fbdff 100644 --- a/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceListOrganizationModels.g.cs +++ b/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceListOrganizationModels.g.cs @@ -6,6 +6,14 @@ namespace Together public partial class VolumeServiceClient { + private static readonly global::Together.AutoSDKServer[] s_VolumeServiceListOrganizationModelsServers = 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_VolumeServiceListOrganizationModelsSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -61,6 +69,13 @@ partial void ProcessVolumeServiceListOrganizationModelsResponseContent( /// 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()
+ /// organization_id = client.whoami().organization_id
+ /// for model in client.beta.models.list_org_scoped(organization_id):
+ /// print(model.id, model.name) + ///
public async global::System.Threading.Tasks.Task VolumeServiceListOrganizationModelsAsync( string organizationId, int? limit = default, @@ -94,6 +109,13 @@ partial void ProcessVolumeServiceListOrganizationModelsResponseContent( /// 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()
+ /// organization_id = client.whoami().organization_id
+ /// for model in client.beta.models.list_org_scoped(organization_id):
+ /// print(model.id, model.name) + ///
public async global::System.Threading.Tasks.Task> VolumeServiceListOrganizationModelsAsResponseAsync( string organizationId, int? limit = default, @@ -133,8 +155,10 @@ partial void ProcessVolumeServiceListOrganizationModelsResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v2/organizations/{organizationId}/models", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/organizations/{organizationId}/models", + baseUri: ResolveBaseUri( + servers: s_VolumeServiceListOrganizationModelsServers, + defaultBaseUrl: "https://api.together.ai/v2")); __pathBuilder .AddOptionalParameter("limit", limit?.ToString()) .AddOptionalParameter("after", after) @@ -200,7 +224,7 @@ partial void ProcessVolumeServiceListOrganizationModelsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "VolumeServiceListOrganizationModels", methodName: "VolumeServiceListOrganizationModelsAsync", - pathTemplate: "$\"/v2/organizations/{organizationId}/models\"", + pathTemplate: "$\"/organizations/{organizationId}/models\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -234,7 +258,7 @@ partial void ProcessVolumeServiceListOrganizationModelsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "VolumeServiceListOrganizationModels", methodName: "VolumeServiceListOrganizationModelsAsync", - pathTemplate: "$\"/v2/organizations/{organizationId}/models\"", + pathTemplate: "$\"/organizations/{organizationId}/models\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -275,7 +299,7 @@ partial void ProcessVolumeServiceListOrganizationModelsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "VolumeServiceListOrganizationModels", methodName: "VolumeServiceListOrganizationModelsAsync", - pathTemplate: "$\"/v2/organizations/{organizationId}/models\"", + pathTemplate: "$\"/organizations/{organizationId}/models\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -323,7 +347,7 @@ partial void ProcessVolumeServiceListOrganizationModelsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "VolumeServiceListOrganizationModels", methodName: "VolumeServiceListOrganizationModelsAsync", - pathTemplate: "$\"/v2/organizations/{organizationId}/models\"", + pathTemplate: "$\"/organizations/{organizationId}/models\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -345,7 +369,7 @@ partial void ProcessVolumeServiceListOrganizationModelsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "VolumeServiceListOrganizationModels", methodName: "VolumeServiceListOrganizationModelsAsync", - pathTemplate: "$\"/v2/organizations/{organizationId}/models\"", + pathTemplate: "$\"/organizations/{organizationId}/models\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceListRemoteModelUploadEvents.g.cs b/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceListRemoteModelUploadEvents.g.cs index 65b0fd12..170b61a6 100644 --- a/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceListRemoteModelUploadEvents.g.cs +++ b/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceListRemoteModelUploadEvents.g.cs @@ -6,6 +6,14 @@ namespace Together public partial class VolumeServiceClient { + private static readonly global::Together.AutoSDKServer[] s_VolumeServiceListRemoteModelUploadEventsServers = 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_VolumeServiceListRemoteModelUploadEventsSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -66,6 +74,16 @@ partial void ProcessVolumeServiceListRemoteModelUploadEventsResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// events = client.beta.models.remote_uploads.events(
+ /// "job_abc123",
+ /// project_id=project_id,
+ /// )
+ /// print(events) + ///
public async global::System.Threading.Tasks.Task VolumeServiceListRemoteModelUploadEventsAsync( string projectId, string id, @@ -104,6 +122,16 @@ partial void ProcessVolumeServiceListRemoteModelUploadEventsResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// events = client.beta.models.remote_uploads.events(
+ /// "job_abc123",
+ /// project_id=project_id,
+ /// )
+ /// print(events) + ///
public async global::System.Threading.Tasks.Task> VolumeServiceListRemoteModelUploadEventsAsResponseAsync( string projectId, string id, @@ -145,8 +173,10 @@ partial void ProcessVolumeServiceListRemoteModelUploadEventsResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v2/projects/{projectId}/models/uploads/{id}/events", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/projects/{projectId}/models/uploads/{id}/events", + baseUri: ResolveBaseUri( + servers: s_VolumeServiceListRemoteModelUploadEventsServers, + defaultBaseUrl: "https://api.together.ai/v2")); __pathBuilder .AddOptionalParameter("limit", limit?.ToString()) .AddOptionalParameter("after", after) @@ -213,7 +243,7 @@ partial void ProcessVolumeServiceListRemoteModelUploadEventsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "VolumeServiceListRemoteModelUploadEvents", methodName: "VolumeServiceListRemoteModelUploadEventsAsync", - pathTemplate: "$\"/v2/projects/{projectId}/models/uploads/{id}/events\"", + pathTemplate: "$\"/projects/{projectId}/models/uploads/{id}/events\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -247,7 +277,7 @@ partial void ProcessVolumeServiceListRemoteModelUploadEventsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "VolumeServiceListRemoteModelUploadEvents", methodName: "VolumeServiceListRemoteModelUploadEventsAsync", - pathTemplate: "$\"/v2/projects/{projectId}/models/uploads/{id}/events\"", + pathTemplate: "$\"/projects/{projectId}/models/uploads/{id}/events\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -288,7 +318,7 @@ partial void ProcessVolumeServiceListRemoteModelUploadEventsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "VolumeServiceListRemoteModelUploadEvents", methodName: "VolumeServiceListRemoteModelUploadEventsAsync", - pathTemplate: "$\"/v2/projects/{projectId}/models/uploads/{id}/events\"", + pathTemplate: "$\"/projects/{projectId}/models/uploads/{id}/events\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -336,7 +366,7 @@ partial void ProcessVolumeServiceListRemoteModelUploadEventsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "VolumeServiceListRemoteModelUploadEvents", methodName: "VolumeServiceListRemoteModelUploadEventsAsync", - pathTemplate: "$\"/v2/projects/{projectId}/models/uploads/{id}/events\"", + pathTemplate: "$\"/projects/{projectId}/models/uploads/{id}/events\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -358,7 +388,7 @@ partial void ProcessVolumeServiceListRemoteModelUploadEventsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "VolumeServiceListRemoteModelUploadEvents", methodName: "VolumeServiceListRemoteModelUploadEventsAsync", - pathTemplate: "$\"/v2/projects/{projectId}/models/uploads/{id}/events\"", + pathTemplate: "$\"/projects/{projectId}/models/uploads/{id}/events\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceListRemoteModelUploads.g.cs b/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceListRemoteModelUploads.g.cs index a504da9f..e8982e93 100644 --- a/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceListRemoteModelUploads.g.cs +++ b/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceListRemoteModelUploads.g.cs @@ -6,6 +6,14 @@ namespace Together public partial class VolumeServiceClient { + private static readonly global::Together.AutoSDKServer[] s_VolumeServiceListRemoteModelUploadsServers = 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_VolumeServiceListRemoteModelUploadsSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -61,6 +69,13 @@ partial void ProcessVolumeServiceListRemoteModelUploadsResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// for job in client.beta.models.remote_uploads.list(project_id=project_id):
+ /// print(job.id, job.status) + ///
public async global::System.Threading.Tasks.Task VolumeServiceListRemoteModelUploadsAsync( string projectId, int? limit = default, @@ -94,6 +109,13 @@ partial void ProcessVolumeServiceListRemoteModelUploadsResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// for job in client.beta.models.remote_uploads.list(project_id=project_id):
+ /// print(job.id, job.status) + ///
public async global::System.Threading.Tasks.Task> VolumeServiceListRemoteModelUploadsAsResponseAsync( string projectId, int? limit = default, @@ -133,8 +155,10 @@ partial void ProcessVolumeServiceListRemoteModelUploadsResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v2/projects/{projectId}/models/uploads", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/projects/{projectId}/models/uploads", + baseUri: ResolveBaseUri( + servers: s_VolumeServiceListRemoteModelUploadsServers, + defaultBaseUrl: "https://api.together.ai/v2")); __pathBuilder .AddOptionalParameter("limit", limit?.ToString()) .AddOptionalParameter("after", after) @@ -200,7 +224,7 @@ partial void ProcessVolumeServiceListRemoteModelUploadsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "VolumeServiceListRemoteModelUploads", methodName: "VolumeServiceListRemoteModelUploadsAsync", - pathTemplate: "$\"/v2/projects/{projectId}/models/uploads\"", + pathTemplate: "$\"/projects/{projectId}/models/uploads\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -234,7 +258,7 @@ partial void ProcessVolumeServiceListRemoteModelUploadsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "VolumeServiceListRemoteModelUploads", methodName: "VolumeServiceListRemoteModelUploadsAsync", - pathTemplate: "$\"/v2/projects/{projectId}/models/uploads\"", + pathTemplate: "$\"/projects/{projectId}/models/uploads\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -275,7 +299,7 @@ partial void ProcessVolumeServiceListRemoteModelUploadsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "VolumeServiceListRemoteModelUploads", methodName: "VolumeServiceListRemoteModelUploadsAsync", - pathTemplate: "$\"/v2/projects/{projectId}/models/uploads\"", + pathTemplate: "$\"/projects/{projectId}/models/uploads\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -323,7 +347,7 @@ partial void ProcessVolumeServiceListRemoteModelUploadsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "VolumeServiceListRemoteModelUploads", methodName: "VolumeServiceListRemoteModelUploadsAsync", - pathTemplate: "$\"/v2/projects/{projectId}/models/uploads\"", + pathTemplate: "$\"/projects/{projectId}/models/uploads\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -345,7 +369,7 @@ partial void ProcessVolumeServiceListRemoteModelUploadsResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "VolumeServiceListRemoteModelUploads", methodName: "VolumeServiceListRemoteModelUploadsAsync", - pathTemplate: "$\"/v2/projects/{projectId}/models/uploads\"", + pathTemplate: "$\"/projects/{projectId}/models/uploads\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceUpdateModel.g.cs b/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceUpdateModel.g.cs index 0c5ec4f8..fb85191b 100644 --- a/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceUpdateModel.g.cs +++ b/src/libs/Together/Generated/Together.VolumeServiceClient.VolumeServiceUpdateModel.g.cs @@ -6,6 +6,14 @@ namespace Together public partial class VolumeServiceClient { + private static readonly global::Together.AutoSDKServer[] s_VolumeServiceUpdateModelServers = 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_VolumeServiceUpdateModelSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -64,6 +72,18 @@ partial void ProcessVolumeServiceUpdateModelResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// model = client.beta.models.update(
+ /// "ml_abc123",
+ /// project_id=project_id,
+ /// update_mask="description",
+ /// description="LoRA adapter for support-ticket triage",
+ /// )
+ /// print(model.description) + ///
public async global::System.Threading.Tasks.Task VolumeServiceUpdateModelAsync( string projectId, string id, @@ -102,6 +122,18 @@ partial void ProcessVolumeServiceUpdateModelResponseContent( /// 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()
+ /// project_id = client.whoami().project_id
+ /// model = client.beta.models.update(
+ /// "ml_abc123",
+ /// project_id=project_id,
+ /// update_mask="description",
+ /// description="LoRA adapter for support-ticket triage",
+ /// )
+ /// print(model.description) + ///
public async global::System.Threading.Tasks.Task> VolumeServiceUpdateModelAsResponseAsync( string projectId, string id, @@ -146,8 +178,10 @@ partial void ProcessVolumeServiceUpdateModelResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v2/projects/{projectId}/models/{id}", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/projects/{projectId}/models/{id}", + baseUri: ResolveBaseUri( + servers: s_VolumeServiceUpdateModelServers, + defaultBaseUrl: "https://api.together.ai/v2")); __pathBuilder .AddOptionalParameter("updateMask", updateMask) ; @@ -219,7 +253,7 @@ partial void ProcessVolumeServiceUpdateModelResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "VolumeServiceUpdateModel", methodName: "VolumeServiceUpdateModelAsync", - pathTemplate: "$\"/v2/projects/{projectId}/models/{id}\"", + pathTemplate: "$\"/projects/{projectId}/models/{id}\"", httpMethod: "PATCH", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -253,7 +287,7 @@ partial void ProcessVolumeServiceUpdateModelResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "VolumeServiceUpdateModel", methodName: "VolumeServiceUpdateModelAsync", - pathTemplate: "$\"/v2/projects/{projectId}/models/{id}\"", + pathTemplate: "$\"/projects/{projectId}/models/{id}\"", httpMethod: "PATCH", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -294,7 +328,7 @@ partial void ProcessVolumeServiceUpdateModelResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "VolumeServiceUpdateModel", methodName: "VolumeServiceUpdateModelAsync", - pathTemplate: "$\"/v2/projects/{projectId}/models/{id}\"", + pathTemplate: "$\"/projects/{projectId}/models/{id}\"", httpMethod: "PATCH", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -342,7 +376,7 @@ partial void ProcessVolumeServiceUpdateModelResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "VolumeServiceUpdateModel", methodName: "VolumeServiceUpdateModelAsync", - pathTemplate: "$\"/v2/projects/{projectId}/models/{id}\"", + pathTemplate: "$\"/projects/{projectId}/models/{id}\"", httpMethod: "PATCH", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -364,7 +398,7 @@ partial void ProcessVolumeServiceUpdateModelResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "VolumeServiceUpdateModel", methodName: "VolumeServiceUpdateModelAsync", - pathTemplate: "$\"/v2/projects/{projectId}/models/{id}\"", + pathTemplate: "$\"/projects/{projectId}/models/{id}\"", httpMethod: "PATCH", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.VolumeServiceClient.g.cs b/src/libs/Together/Generated/Together.VolumeServiceClient.g.cs index 932c5d53..cf2502a1 100644 --- a/src/libs/Together/Generated/Together.VolumeServiceClient.g.cs +++ b/src/libs/Together/Generated/Together.VolumeServiceClient.g.cs @@ -10,9 +10,9 @@ namespace Together public sealed partial class VolumeServiceClient : global::Together.IVolumeServiceClient, global::System.IDisposable { /// - /// Default environment for APIs + /// /// - public const string DefaultBaseUrl = "https://api.together.ai/"; + public const string DefaultBaseUrl = "https://api.together.ai/v2"; private bool _disposeHttpClient = true; @@ -151,5 +151,36 @@ 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.Volumes.JsonSerializerContext.g.cs b/src/libs/Together/Generated/Together.Volumes.JsonSerializerContext.g.cs index 1145c0b3..0de43898 100644 --- a/src/libs/Together/Generated/Together.Volumes.JsonSerializerContext.g.cs +++ b/src/libs/Together/Generated/Together.Volumes.JsonSerializerContext.g.cs @@ -2,48 +2,7 @@ #nullable enable namespace Together -{ - /// - /// - /// - [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( - DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull - )] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(object))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(long))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.VolumeContentRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.VolumeType), TypeInfoPropertyName = "VolumeType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.VolumeResponseItem))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.UpdateVolumeRequest))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.VolumeContent))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.VolumeStatus), TypeInfoPropertyName = "VolumeStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.VersionHistoryItem))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.VolumeOrigin))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.VolumeContentRequestType), TypeInfoPropertyName = "VolumeContentRequestType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.FileInfo))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.VolumeContentType), TypeInfoPropertyName = "VolumeContentType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.S3Origin))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(long?))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.VolumeType?), TypeInfoPropertyName = "NullableVolumeType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.VolumeStatus?), TypeInfoPropertyName = "NullableVolumeStatus2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.VolumeContentRequestType?), TypeInfoPropertyName = "NullableVolumeContentRequestType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Together.VolumeContentType?), TypeInfoPropertyName = "NullableVolumeContentType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] - internal sealed partial class VolumesSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext - { - } - /// +{ /// /// /// public sealed partial class VolumesSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext @@ -87,26 +46,7 @@ private VolumesSourceGenerationContext(global::System.Text.Json.JsonSerializerOp [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) { - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter, global::System.Collections.Generic.IList>()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter()); - options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter>()); - options.Converters.Add(new global::Together.JsonConverters.UnixTimestampJsonConverter()); - options.Converters.Add(new LazyEnumJsonConverterFactory()); + global::Together.SourceGenerationContext.AddConverters(options); } private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() @@ -121,76 +61,6 @@ public static void AddConverters(global::System.Text.Json.JsonSerializerOptions return options; } - - private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Serialization.JsonConverterFactory - { - public override bool CanConvert(global::System.Type typeToConvert) - { - return - typeToConvert == typeof(global::Together.VolumeContentRequestType) - - || typeToConvert == typeof(global::Together.VolumeContentRequestType?) - - || typeToConvert == typeof(global::Together.VolumeContentType) - - || typeToConvert == typeof(global::Together.VolumeContentType?) - - || typeToConvert == typeof(global::Together.VolumeStatus) - - || typeToConvert == typeof(global::Together.VolumeStatus?) - - || typeToConvert == typeof(global::Together.VolumeType) - - || typeToConvert == typeof(global::Together.VolumeType?); - } - - public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - if (typeToConvert == typeof(global::Together.VolumeContentRequestType)) - { - return new global::Together.JsonConverters.VolumeContentRequestTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.VolumeContentRequestType?)) - { - return new global::Together.JsonConverters.VolumeContentRequestTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.VolumeContentType)) - { - return new global::Together.JsonConverters.VolumeContentTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.VolumeContentType?)) - { - return new global::Together.JsonConverters.VolumeContentTypeNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.VolumeStatus)) - { - return new global::Together.JsonConverters.VolumeStatusJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.VolumeStatus?)) - { - return new global::Together.JsonConverters.VolumeStatusNullableJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.VolumeType)) - { - return new global::Together.JsonConverters.VolumeTypeJsonConverter(); - } - - if (typeToConvert == typeof(global::Together.VolumeType?)) - { - return new global::Together.JsonConverters.VolumeTypeNullableJsonConverter(); - } - throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); - } - } - private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver { private readonly object _gate = new(); @@ -230,7 +100,7 @@ private sealed class LazyChunkResolver : global::System.Text.Json.Serialization. { return index switch { - 0 => new VolumesSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), + 0 => global::Together.SourceGenerationContext.TypeInfoResolver, _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), }; } diff --git a/src/libs/Together/Generated/Together.VolumesClient.DeleteDeploymentsStorageVolumesById.g.cs b/src/libs/Together/Generated/Together.VolumesClient.DeleteDeploymentsStorageVolumesById.g.cs index e65b3b0c..301fed96 100644 --- a/src/libs/Together/Generated/Together.VolumesClient.DeleteDeploymentsStorageVolumesById.g.cs +++ b/src/libs/Together/Generated/Together.VolumesClient.DeleteDeploymentsStorageVolumesById.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class VolumesClient { + private static readonly global::Together.AutoSDKServer[] s_DeleteDeploymentsStorageVolumesByIdServers = 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_DeleteDeploymentsStorageVolumesByIdSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -51,6 +64,11 @@ partial void ProcessDeleteDeploymentsStorageVolumesByIdResponseContent( /// 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()
+ /// client.beta.jig.volumes.delete("my-volume") + ///
public async global::System.Threading.Tasks.Task DeleteDeploymentsStorageVolumesByIdAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -74,6 +92,11 @@ partial void ProcessDeleteDeploymentsStorageVolumesByIdResponseContent( /// 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()
+ /// client.beta.jig.volumes.delete("my-volume") + ///
public async global::System.Threading.Tasks.Task> DeleteDeploymentsStorageVolumesByIdAsResponseAsync( string id, global::Together.AutoSDKRequestOptions? requestOptions = default, @@ -109,8 +132,10 @@ partial void ProcessDeleteDeploymentsStorageVolumesByIdResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v1/deployments/storage/volumes/{id}", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/deployments/storage/volumes/{id}", + baseUri: ResolveBaseUri( + servers: s_DeleteDeploymentsStorageVolumesByIdServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -170,7 +195,7 @@ partial void ProcessDeleteDeploymentsStorageVolumesByIdResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "deleteDeploymentsStorageVolumesById", methodName: "DeleteDeploymentsStorageVolumesByIdAsync", - pathTemplate: "$\"/v1/deployments/storage/volumes/{id}\"", + pathTemplate: "$\"/deployments/storage/volumes/{id}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -204,7 +229,7 @@ partial void ProcessDeleteDeploymentsStorageVolumesByIdResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "deleteDeploymentsStorageVolumesById", methodName: "DeleteDeploymentsStorageVolumesByIdAsync", - pathTemplate: "$\"/v1/deployments/storage/volumes/{id}\"", + pathTemplate: "$\"/deployments/storage/volumes/{id}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -245,7 +270,7 @@ partial void ProcessDeleteDeploymentsStorageVolumesByIdResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "deleteDeploymentsStorageVolumesById", methodName: "DeleteDeploymentsStorageVolumesByIdAsync", - pathTemplate: "$\"/v1/deployments/storage/volumes/{id}\"", + pathTemplate: "$\"/deployments/storage/volumes/{id}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -293,7 +318,7 @@ partial void ProcessDeleteDeploymentsStorageVolumesByIdResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "deleteDeploymentsStorageVolumesById", methodName: "DeleteDeploymentsStorageVolumesByIdAsync", - pathTemplate: "$\"/v1/deployments/storage/volumes/{id}\"", + pathTemplate: "$\"/deployments/storage/volumes/{id}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -315,7 +340,7 @@ partial void ProcessDeleteDeploymentsStorageVolumesByIdResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "deleteDeploymentsStorageVolumesById", methodName: "DeleteDeploymentsStorageVolumesByIdAsync", - pathTemplate: "$\"/v1/deployments/storage/volumes/{id}\"", + pathTemplate: "$\"/deployments/storage/volumes/{id}\"", httpMethod: "DELETE", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.VolumesClient.EditDeploymentsStorageVolumesById.g.cs b/src/libs/Together/Generated/Together.VolumesClient.EditDeploymentsStorageVolumesById.g.cs index 38c096ba..ae6b3ebf 100644 --- a/src/libs/Together/Generated/Together.VolumesClient.EditDeploymentsStorageVolumesById.g.cs +++ b/src/libs/Together/Generated/Together.VolumesClient.EditDeploymentsStorageVolumesById.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class VolumesClient { + private static readonly global::Together.AutoSDKServer[] s_EditDeploymentsStorageVolumesByIdServers = 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_EditDeploymentsStorageVolumesByIdSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -54,6 +67,17 @@ partial void ProcessEditDeploymentsStorageVolumesByIdResponseContent( /// 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()
+ /// # Point the volume at a new version of its files. The CLI's
+ /// # `tg beta jig volumes update` uploads the files and makes this call for you.
+ /// volume = client.beta.jig.volumes.update(
+ /// "my-volume",
+ /// content={"type": "files", "source_prefix": "my-volume/1"},
+ /// )
+ /// print(volume.current_version) + ///
public async global::System.Threading.Tasks.Task EditDeploymentsStorageVolumesByIdAsync( string id, @@ -82,6 +106,17 @@ partial void ProcessEditDeploymentsStorageVolumesByIdResponseContent( /// 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()
+ /// # Point the volume at a new version of its files. The CLI's
+ /// # `tg beta jig volumes update` uploads the files and makes this call for you.
+ /// volume = client.beta.jig.volumes.update(
+ /// "my-volume",
+ /// content={"type": "files", "source_prefix": "my-volume/1"},
+ /// )
+ /// print(volume.current_version) + ///
public async global::System.Threading.Tasks.Task> EditDeploymentsStorageVolumesByIdAsResponseAsync( string id, @@ -122,8 +157,10 @@ partial void ProcessEditDeploymentsStorageVolumesByIdResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v1/deployments/storage/volumes/{id}", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/deployments/storage/volumes/{id}", + baseUri: ResolveBaseUri( + servers: s_EditDeploymentsStorageVolumesByIdServers, + defaultBaseUrl: "https://api.together.ai/v1")); var __path = __pathBuilder.ToString(); __path = global::Together.AutoSDKRequestOptionsSupport.AppendQueryParameters( path: __path, @@ -190,7 +227,7 @@ partial void ProcessEditDeploymentsStorageVolumesByIdResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "editDeploymentsStorageVolumesById", methodName: "EditDeploymentsStorageVolumesByIdAsync", - pathTemplate: "$\"/v1/deployments/storage/volumes/{id}\"", + pathTemplate: "$\"/deployments/storage/volumes/{id}\"", httpMethod: "PATCH", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -224,7 +261,7 @@ partial void ProcessEditDeploymentsStorageVolumesByIdResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "editDeploymentsStorageVolumesById", methodName: "EditDeploymentsStorageVolumesByIdAsync", - pathTemplate: "$\"/v1/deployments/storage/volumes/{id}\"", + pathTemplate: "$\"/deployments/storage/volumes/{id}\"", httpMethod: "PATCH", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -265,7 +302,7 @@ partial void ProcessEditDeploymentsStorageVolumesByIdResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "editDeploymentsStorageVolumesById", methodName: "EditDeploymentsStorageVolumesByIdAsync", - pathTemplate: "$\"/v1/deployments/storage/volumes/{id}\"", + pathTemplate: "$\"/deployments/storage/volumes/{id}\"", httpMethod: "PATCH", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -313,7 +350,7 @@ partial void ProcessEditDeploymentsStorageVolumesByIdResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "editDeploymentsStorageVolumesById", methodName: "EditDeploymentsStorageVolumesByIdAsync", - pathTemplate: "$\"/v1/deployments/storage/volumes/{id}\"", + pathTemplate: "$\"/deployments/storage/volumes/{id}\"", httpMethod: "PATCH", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -335,7 +372,7 @@ partial void ProcessEditDeploymentsStorageVolumesByIdResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "editDeploymentsStorageVolumesById", methodName: "EditDeploymentsStorageVolumesByIdAsync", - pathTemplate: "$\"/v1/deployments/storage/volumes/{id}\"", + pathTemplate: "$\"/deployments/storage/volumes/{id}\"", httpMethod: "PATCH", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.VolumesClient.GetDeploymentsStorageVolumesById.g.cs b/src/libs/Together/Generated/Together.VolumesClient.GetDeploymentsStorageVolumesById.g.cs index 11157ff8..8cb91377 100644 --- a/src/libs/Together/Generated/Together.VolumesClient.GetDeploymentsStorageVolumesById.g.cs +++ b/src/libs/Together/Generated/Together.VolumesClient.GetDeploymentsStorageVolumesById.g.cs @@ -6,6 +6,19 @@ namespace Together public partial class VolumesClient { + private static readonly global::Together.AutoSDKServer[] s_GetDeploymentsStorageVolumesByIdServers = 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_GetDeploymentsStorageVolumesByIdSecurityRequirement0 = new global::Together.EndPointSecurityRequirement @@ -56,6 +69,12 @@ partial void ProcessGetDeploymentsStorageVolumesByIdResponseContent( /// 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()
+ /// volume = client.beta.jig.volumes.retrieve("my-volume")
+ /// print(volume) + ///
public async global::System.Threading.Tasks.Task GetDeploymentsStorageVolumesByIdAsync( string id, int? version = default, @@ -84,6 +103,12 @@ partial void ProcessGetDeploymentsStorageVolumesByIdResponseContent( /// 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()
+ /// volume = client.beta.jig.volumes.retrieve("my-volume")
+ /// print(volume) + ///
public async global::System.Threading.Tasks.Task> GetDeploymentsStorageVolumesByIdAsResponseAsync( string id, int? version = default, @@ -121,8 +146,10 @@ partial void ProcessGetDeploymentsStorageVolumesByIdResponseContent( { var __pathBuilder = new global::Together.PathBuilder( - path: $"/v1/deployments/storage/volumes/{id}", - baseUri: HttpClient.BaseAddress ?? new global::System.Uri("https://api.together.ai/", global::System.UriKind.RelativeOrAbsolute)); + path: $"/deployments/storage/volumes/{id}", + baseUri: ResolveBaseUri( + servers: s_GetDeploymentsStorageVolumesByIdServers, + defaultBaseUrl: "https://api.together.ai/v1")); __pathBuilder .AddOptionalParameter("version", version?.ToString()) ; @@ -186,7 +213,7 @@ partial void ProcessGetDeploymentsStorageVolumesByIdResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getDeploymentsStorageVolumesById", methodName: "GetDeploymentsStorageVolumesByIdAsync", - pathTemplate: "$\"/v1/deployments/storage/volumes/{id}\"", + pathTemplate: "$\"/deployments/storage/volumes/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -220,7 +247,7 @@ partial void ProcessGetDeploymentsStorageVolumesByIdResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getDeploymentsStorageVolumesById", methodName: "GetDeploymentsStorageVolumesByIdAsync", - pathTemplate: "$\"/v1/deployments/storage/volumes/{id}\"", + pathTemplate: "$\"/deployments/storage/volumes/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -261,7 +288,7 @@ partial void ProcessGetDeploymentsStorageVolumesByIdResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getDeploymentsStorageVolumesById", methodName: "GetDeploymentsStorageVolumesByIdAsync", - pathTemplate: "$\"/v1/deployments/storage/volumes/{id}\"", + pathTemplate: "$\"/deployments/storage/volumes/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -309,7 +336,7 @@ partial void ProcessGetDeploymentsStorageVolumesByIdResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getDeploymentsStorageVolumesById", methodName: "GetDeploymentsStorageVolumesByIdAsync", - pathTemplate: "$\"/v1/deployments/storage/volumes/{id}\"", + pathTemplate: "$\"/deployments/storage/volumes/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), @@ -331,7 +358,7 @@ partial void ProcessGetDeploymentsStorageVolumesByIdResponseContent( context: global::Together.AutoSDKRequestOptionsSupport.CreateHookContext( operationId: "getDeploymentsStorageVolumesById", methodName: "GetDeploymentsStorageVolumesByIdAsync", - pathTemplate: "$\"/v1/deployments/storage/volumes/{id}\"", + pathTemplate: "$\"/deployments/storage/volumes/{id}\"", httpMethod: "GET", baseUri: BaseUri, request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), diff --git a/src/libs/Together/Generated/Together.VolumesClient.g.cs b/src/libs/Together/Generated/Together.VolumesClient.g.cs index c0030d91..084cf164 100644 --- a/src/libs/Together/Generated/Together.VolumesClient.g.cs +++ b/src/libs/Together/Generated/Together.VolumesClient.g.cs @@ -12,7 +12,7 @@ public sealed partial class VolumesClient : global::Together.IVolumesClient, glo /// /// Default environment for APIs /// - public const string DefaultBaseUrl = "https://api.together.ai/"; + public const string DefaultBaseUrl = "https://api.together.ai/v1"; private bool _disposeHttpClient = true; @@ -20,7 +20,7 @@ public sealed partial class VolumesClient : global::Together.IVolumesClient, 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; } @@ -53,6 +53,34 @@ public sealed partial class VolumesClient : global::Together.IVolumesClient, glo } + + 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 VolumesClient. /// If no httpClient is provided, a new one will be created. @@ -151,5 +179,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/autosdk.generated-examples.json b/src/libs/Together/Generated/autosdk.generated-examples.json index 4ace06eb..1f4e438f 100644 --- a/src/libs/Together/Generated/autosdk.generated-examples.json +++ b/src/libs/Together/Generated/autosdk.generated-examples.json @@ -2,55 +2,66 @@ "Examples": [ { "Order": 1, + "Title": "List all endpoints", + "Slug": "listendpoints", + "Description": "Returns a list of all endpoints associated with your account. You can filter the results by type (dedicated or serverless).", + "Language": "csharp", + "Code": "using var client = new TogetherClient(apiKey);\nvar response = await client.Endpoints.ListEndpointsAsync();\n\n// Example response:\n// {\n// \u0022object\u0022: \u0022list\u0022,\n// \u0022data\u0022: [\n// {\n// \u0022object\u0022: \u0022endpoint\u0022,\n// \u0022id\u0022: \u0022endpoint-5c0c20db-62fe-4f41-8ffc-d9e4ea1a264e\u0022,\n// \u0022name\u0022: \u0022allenai/OLMo-7B\u0022,\n// \u0022model\u0022: \u0022allenai/OLMo-7B\u0022,\n// \u0022type\u0022: \u0022serverless\u0022,\n// \u0022owner\u0022: \u0022together\u0022,\n// \u0022state\u0022: \u0022STARTED\u0022,\n// \u0022created_at\u0022: \u00222024-02-28T21:34:35.444Z\u0022\n// }\n// ]\n// }", + "Format": "sdk", + "OperationId": "listEndpoints", + "Setup": "This example assumes \u0060using Together;\u0060 is in scope and \u0060apiKey\u0060 contains the required credential." + }, + { + "Order": 2, "Title": "Create job", "Slug": "create-job", "Description": "Create a fine-tuning job with the provided model and training data.", "Language": "http", - "Code": "### Create job\nPOST {{host}}/v1/fine-tunes\nAuthorization: Bearer {{token}}\nContent-Type: application/json\nAccept: application/json\n\n{\n \u0022training_file\u0022: \u0022string\u0022,\n \u0022validation_file\u0022: \u0022string\u0022,\n \u0022packing\u0022: true,\n \u0022max_seq_length\u0022: 0,\n \u0022model\u0022: \u0022string\u0022,\n \u0022n_epochs\u0022: 1,\n \u0022n_checkpoints\u0022: 1,\n \u0022n_evals\u0022: 0,\n \u0022batch_size\u0022: \u0022max\u0022,\n \u0022gradient_accumulation_steps\u0022: 0,\n \u0022learning_rate\u0022: 0.00001,\n \u0022lr_scheduler\u0022: {\n \u0022lr_scheduler_type\u0022: \u0022linear\u0022,\n \u0022lr_scheduler_args\u0022: {\n \u0022min_lr_ratio\u0022: 0.0\n }\n },\n \u0022warmup_ratio\u0022: 0.0,\n \u0022max_grad_norm\u0022: 1.0,\n \u0022weight_decay\u0022: 0.0,\n \u0022random_seed\u0022: 0,\n \u0022early_stopping_enabled\u0022: false,\n \u0022early_stopping_patience\u0022: 2,\n \u0022early_stopping_min_delta\u0022: 0.0,\n \u0022early_stopping_warmup_evals\u0022: 1,\n \u0022suffix\u0022: \u0022string\u0022,\n \u0022wandb_api_key\u0022: \u0022string\u0022,\n \u0022wandb_base_url\u0022: \u0022string\u0022,\n \u0022wandb_project_name\u0022: \u0022string\u0022,\n \u0022wandb_name\u0022: \u0022string\u0022,\n \u0022wandb_entity\u0022: \u0022string\u0022,\n \u0022training_method\u0022: {\n \u0022method\u0022: \u0022sft\u0022,\n \u0022train_on_inputs\u0022: \u0022auto\u0022\n },\n \u0022training_type\u0022: \u0022openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464\u0022,\n \u0022multimodal_params\u0022: {\n \u0022train_vision\u0022: true\n },\n \u0022from_checkpoint\u0022: \u0022string\u0022,\n \u0022from_hf_model\u0022: \u0022string\u0022,\n \u0022hf_model_revision\u0022: \u0022string\u0022,\n \u0022hf_api_token\u0022: \u0022string\u0022,\n \u0022hf_output_repo_name\u0022: \u0022string\u0022\n}\n\n## Responses\n# 200\n# Description: Fine-tuning job initiated successfully\n# Content-Type: application/json\n# 503\n# Description: The fine-tuning service is shutting down and cannot accept new jobs.\n# Content-Type: application/json", + "Code": "### Create job\nPOST {{host}}/fine-tunes\nAuthorization: Bearer {{token}}\nContent-Type: application/json\nAccept: application/json\n\n{\n \u0022training_file\u0022: \u0022string\u0022,\n \u0022validation_file\u0022: \u0022string\u0022,\n \u0022packing\u0022: true,\n \u0022max_seq_length\u0022: 0,\n \u0022model\u0022: \u0022string\u0022,\n \u0022n_epochs\u0022: 1,\n \u0022n_checkpoints\u0022: 1,\n \u0022n_evals\u0022: 0,\n \u0022batch_size\u0022: \u0022max\u0022,\n \u0022gradient_accumulation_steps\u0022: 0,\n \u0022learning_rate\u0022: 0.00001,\n \u0022lr_scheduler\u0022: {\n \u0022lr_scheduler_type\u0022: \u0022linear\u0022,\n \u0022lr_scheduler_args\u0022: {\n \u0022min_lr_ratio\u0022: 0.0\n }\n },\n \u0022warmup_ratio\u0022: 0.0,\n \u0022max_grad_norm\u0022: 1.0,\n \u0022weight_decay\u0022: 0.0,\n \u0022random_seed\u0022: 0,\n \u0022early_stopping_enabled\u0022: false,\n \u0022early_stopping_patience\u0022: 2,\n \u0022early_stopping_min_delta\u0022: 0.0,\n \u0022early_stopping_warmup_evals\u0022: 1,\n \u0022suffix\u0022: \u0022string\u0022,\n \u0022wandb_api_key\u0022: \u0022string\u0022,\n \u0022wandb_base_url\u0022: \u0022string\u0022,\n \u0022wandb_project_name\u0022: \u0022string\u0022,\n \u0022wandb_name\u0022: \u0022string\u0022,\n \u0022wandb_entity\u0022: \u0022string\u0022,\n \u0022train_on_inputs\u0022: \u0022auto\u0022,\n \u0022training_method\u0022: {\n \u0022method\u0022: \u0022sft\u0022,\n \u0022train_on_inputs\u0022: \u0022auto\u0022\n },\n \u0022training_type\u0022: \u0022openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464\u0022,\n \u0022multimodal_params\u0022: {\n \u0022train_vision\u0022: true\n },\n \u0022from_checkpoint\u0022: \u0022string\u0022,\n \u0022from_hf_model\u0022: \u0022string\u0022,\n \u0022hf_model_revision\u0022: \u0022string\u0022,\n \u0022hf_api_token\u0022: \u0022string\u0022,\n \u0022hf_output_repo_name\u0022: \u0022string\u0022\n}\n\n## Responses\n# 200\n# Description: Fine-tuning job initiated successfully\n# Content-Type: application/json\n# 503\n# Description: The fine-tuning service is shutting down and cannot accept new jobs.\n# Content-Type: application/json", "Format": "http", "OperationId": "createFineTunes", "Setup": null }, { - "Order": 2, + "Order": 3, "Title": "Cancel job", "Slug": "cancel-job", "Description": "Cancel a currently running fine-tuning job. Returns a FinetuneResponseTruncated object.", "Language": "http", - "Code": "### Cancel job\nPOST {{host}}/v1/fine-tunes/{{id}}/cancel\nAuthorization: Bearer {{token}}\nAccept: application/json\n\n## Responses\n# 200\n# Description: Successfully cancelled the fine-tuning job.\n# Content-Type: application/json\n# 400\n# Description: Invalid request parameters.\n# 404\n# Description: Fine-tune ID not found.", + "Code": "### Cancel job\nPOST {{host}}/fine-tunes/{{id}}/cancel\nAuthorization: Bearer {{token}}\nAccept: application/json\n\n## Responses\n# 200\n# Description: Successfully cancelled the fine-tuning job.\n# Content-Type: application/json\n# 400\n# Description: Invalid request parameters.\n# 404\n# Description: Fine-tune ID not found.", "Format": "http", "OperationId": "createFineTunesByIdCancel", "Setup": null }, { - "Order": 3, + "Order": 4, "Title": "Get metrics", "Slug": "get-metrics", "Description": "Retrieves recorded training metrics for a fine-tuning job in chronological order. All query parameters are optional: omit them to retrieve all metrics.", "Language": "http", - "Code": "### Get metrics\nGET {{host}}/v1/fine-tunes/{{id}}/metrics?global_step_from=0\u0026global_step_to=500\u0026logged_at_from=2024-01-01T00:00:00Z\u0026logged_at_to=2024-01-01T12:00:00Z\u0026resolution=100\nAuthorization: Bearer {{token}}\nAccept: application/json\n\n## Responses\n# 200\n# Description: List of metrics snapshots in chronological order.\n# Content-Type: application/json\n# 400\n# Description: Invalid request: bad JSON body or missing job ID.\n# 404\n# Description: Fine-tune job not found.\n# 500\n# Description: Internal server error: failed to retrieve metrics.", + "Code": "### Get metrics\nGET {{host}}/fine-tunes/{{id}}/metrics?global_step_from=0\u0026global_step_to=500\u0026logged_at_from=2024-01-01T00:00:00Z\u0026logged_at_to=2024-01-01T12:00:00Z\u0026resolution=100\nAuthorization: Bearer {{token}}\nAccept: application/json\n\n## Responses\n# 200\n# Description: List of metrics snapshots in chronological order.\n# Content-Type: application/json\n# 400\n# Description: Invalid request: bad JSON body or missing job ID.\n# 404\n# Description: Fine-tune job not found.\n# 500\n# Description: Internal server error: failed to retrieve metrics.", "Format": "http", "OperationId": "getFineTunesByIdMetrics", "Setup": null }, { - "Order": 4, + "Order": 5, "Title": "Create a rollout", "Slug": "rolloutservice-createrollout", "Description": "Creates a rollout in the pending state without shifting traffic. Start the rollout in a separate request after reviewing its strategy and metric gates.", "Language": "http", - "Code": "### Create a rollout\n# @name RolloutService_CreateRollout\nPOST {{host}}/v2/projects/{{projectId}}/endpoints/{{endpointId}}/rollouts\nAuthorization: Bearer {{token}}\nContent-Type: application/json\nAccept: application/json\n\n{\n \u0022sourceDeploymentId\u0022: \u0022dep_source123\u0022,\n \u0022targetDeploymentId\u0022: \u0022dep_target456\u0022,\n \u0022blueGreen\u0022: {}\n}\n\n## Responses\n# 200\n# Description: OK\n# Content-Type: application/json\n# default\n# Description: Default error response\n# Content-Type: application/json", + "Code": "### Create a rollout\n# @name RolloutService_CreateRollout\nPOST {{host}}/projects/{{projectId}}/endpoints/{{endpointId}}/rollouts\nAuthorization: Bearer {{token}}\nContent-Type: application/json\nAccept: application/json\n\n{\n \u0022sourceDeploymentId\u0022: \u0022dep_source123\u0022,\n \u0022targetDeploymentId\u0022: \u0022dep_target456\u0022,\n \u0022blueGreen\u0022: {}\n}\n\n## Responses\n# 200\n# Description: OK\n# Content-Type: application/json\n# default\n# Description: Default error response\n# Content-Type: application/json", "Format": "http", "OperationId": "RolloutService_CreateRollout", "Setup": null }, { - "Order": 5, + "Order": 6, "Title": "Preview rollout defaults", "Slug": "rolloutservice-previewrolloutdefaults", "Description": "Returns the values a create request would pick for any field left unset, plus the capacity context needed to display them, without creating a rollout. Responses are display state only and re-validated authoritatively at create and start; do not copy response values back into a create request.", "Language": "http", - "Code": "### Preview rollout defaults\n# @name RolloutService_PreviewRolloutDefaults\nPOST {{host}}/v2/projects/{{projectId}}/endpoints/{{endpointId}}/rollouts/preview-defaults\nAuthorization: Bearer {{token}}\nContent-Type: application/json\nAccept: application/json\n\n{\n \u0022sourceDeploymentId\u0022: \u0022dep_source123\u0022,\n \u0022targetDeploymentId\u0022: \u0022dep_target456\u0022,\n \u0022blueGreen\u0022: {}\n}\n\n## Responses\n# 200\n# Description: OK\n# Content-Type: application/json\n# default\n# Description: Default error response\n# Content-Type: application/json", + "Code": "### Preview rollout defaults\n# @name RolloutService_PreviewRolloutDefaults\nPOST {{host}}/projects/{{projectId}}/endpoints/{{endpointId}}/rollouts/preview-defaults\nAuthorization: Bearer {{token}}\nContent-Type: application/json\nAccept: application/json\n\n{\n \u0022sourceDeploymentId\u0022: \u0022dep_source123\u0022,\n \u0022targetDeploymentId\u0022: \u0022dep_target456\u0022,\n \u0022blueGreen\u0022: {}\n}\n\n## Responses\n# 200\n# Description: OK\n# Content-Type: application/json\n# default\n# Description: Default error response\n# Content-Type: application/json", "Format": "http", "OperationId": "RolloutService_PreviewRolloutDefaults", "Setup": null diff --git a/src/libs/Together/openapi.yaml b/src/libs/Together/openapi.yaml index 94510cd1..47918deb 100644 --- a/src/libs/Together/openapi.yaml +++ b/src/libs/Together/openapi.yaml @@ -16,17 +16,21 @@ info: name: MIT url: https://github.com/togethercomputer/openapi/blob/main/LICENSE servers: - - url: https://api.together.ai + - url: https://api.together.ai/v1 description: Default environment for APIs + - url: https://api-inference.together.ai/v2 + description: Optimized environment for inference security: - bearerAuth: [] paths: - /v2/organizations/{organizationId}/endpoints: + /organizations/{organizationId}/endpoints: get: tags: [EndpointService] summary: List organization endpoints description: Lists endpoints shared with every project in the specified organization. Project-private and public endpoints are not included. operationId: EndpointService_ListOrganizationEndpoints + servers: + - url: https://api.together.ai/v2 parameters: - name: organizationId in: path @@ -67,12 +71,51 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' - /v2/organizations/{organizationId}/models: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + organization_id = client.whoami().organization_id + + for endpoint in client.beta.endpoints.list_org_scoped(organization_id): + print(endpoint.id, endpoint.name) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { organization_id: organizationId } = await client.whoami(); + + for await (const endpoint of client.beta.endpoints.listOrgScoped( + organizationId, + )) { + console.log(endpoint.id, endpoint.name); + } + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { organization_id: organizationId } = await client.whoami(); + + for await (const endpoint of client.beta.endpoints.listOrgScoped( + organizationId, + )) { + console.log(endpoint.id, endpoint.name); + } + /organizations/{organizationId}/models: get: tags: [VolumeService] summary: List organization models description: Lists custom models shared with every project in the specified organization. Project-private and public models are not included. operationId: VolumeService_ListOrganizationModels + servers: + - url: https://api.together.ai/v2 parameters: - name: organizationId in: path @@ -103,12 +146,47 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' - /v2/projects/{projectId}/configs: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + organization_id = client.whoami().organization_id + + for model in client.beta.models.list_org_scoped(organization_id): + print(model.id, model.name) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { organization_id: organizationId } = await client.whoami(); + + for await (const model of client.beta.models.listOrgScoped(organizationId)) { + console.log(model.id, model.name); + } + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { organization_id: organizationId } = await client.whoami(); + + for await (const model of client.beta.models.listOrgScoped(organizationId)) { + console.log(model.id, model.name); + } + /projects/{projectId}/configs: get: tags: [ConfigService] summary: List model configurations description: 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. operationId: ConfigService_ListProjectConfigs + servers: + - url: https://api.together.ai/v2 parameters: - name: projectId in: path @@ -149,12 +227,71 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' - /v2/projects/{projectId}/configs/{id}: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + project_id = client.whoami().project_id + + # Configurations are listed per model. A supported model's base_model is + # the resource name to pass as reference_model. + model = client.beta.models.retrieve_supported("arch_abc123") + + configs = client.beta.models.configs.list( + project_id=project_id, + reference_model=model.base_model, + ) + for config in configs: + print(config.id, config.reference_model) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + // Configurations are listed per model. A supported model's baseModel is + // the resource name to pass as referenceModel. + const model = await client.beta.models.retrieveSupported("arch_abc123"); + + const configs = client.beta.models.configs.list({ + projectId, + referenceModel: model.baseModel, + }); + for await (const config of configs) { + console.log(config.id, config.referenceModel); + } + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + // Configurations are listed per model. A supported model's baseModel is + // the resource name to pass as referenceModel. + const model = await client.beta.models.retrieveSupported("arch_abc123"); + + const configs = client.beta.models.configs.list({ + projectId, + referenceModel: model.baseModel, + }); + for await (const config of configs) { + console.log(config.id, config.referenceModel); + } + /projects/{projectId}/configs/{id}: get: tags: [ConfigService] summary: Get a model configuration description: Retrieves a model configuration revision by ID, including its runtime selectors and certifications. operationId: ConfigService_GetProjectConfig + servers: + - url: https://api.together.ai/v2 parameters: - name: projectId in: path @@ -181,12 +318,52 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' - /v2/projects/{projectId}/endpoints: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + project_id = client.whoami().project_id + + config = client.beta.models.configs.retrieve( + "cr_abc123", + project_id=project_id, + ) + print(config.id, config.reference_model) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const config = await client.beta.models.configs.retrieve("cr_abc123", { + projectId, + }); + console.log(config.id, config.referenceModel); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const config = await client.beta.models.configs.retrieve("cr_abc123", { + projectId, + }); + console.log(config.id, config.referenceModel); + /projects/{projectId}/endpoints: get: tags: [EndpointService] summary: List endpoints description: Lists the dedicated inference endpoints owned by the specified project. operationId: EndpointService_ListEndpoints + servers: + - url: https://api.together.ai/v2 parameters: - name: projectId in: path @@ -228,11 +405,46 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + project_id = client.whoami().project_id + + for endpoint in client.beta.endpoints.list(project_id=project_id): + print(endpoint.id, endpoint.name) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + for await (const endpoint of client.beta.endpoints.list({ projectId })) { + console.log(endpoint.id, endpoint.name); + } + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + for await (const endpoint of client.beta.endpoints.list({ projectId })) { + console.log(endpoint.id, endpoint.name); + } post: tags: [EndpointService] summary: Create an endpoint description: Creates a stable, inference-addressable endpoint. Add one or more deployments and configure its traffic split before sending inference requests to the endpoint name. operationId: EndpointService_CreateEndpoint + servers: + - url: https://api.together.ai/v2 parameters: - name: projectId in: path @@ -259,12 +471,54 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' - /v2/projects/{projectId}/endpoints/{id}: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + project_id = client.whoami().project_id + + endpoint = client.beta.endpoints.create( + project_id=project_id, + name="my-endpoint", + ) + print(endpoint.id, endpoint.name) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const endpoint = await client.beta.endpoints.create({ + projectId, + name: "my-endpoint", + }); + console.log(endpoint.id, endpoint.name); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const endpoint = await client.beta.endpoints.create({ + projectId, + name: "my-endpoint", + }); + console.log(endpoint.id, endpoint.name); + /projects/{projectId}/endpoints/{id}: patch: tags: [EndpointService] summary: Update an endpoint description: Updates mutable endpoint fields such as its endpoint string, visibility, or deployment traffic split. Use `updateMask` to select fields explicitly and `etag` in the request body for optimistic concurrency. operationId: EndpointService_UpdateEndpoint + servers: + - url: https://api.together.ai/v2 parameters: - name: projectId in: path @@ -302,11 +556,54 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + project_id = client.whoami().project_id + + endpoint = client.beta.endpoints.update( + "ep_abc123", + project_id=project_id, + traffic_split=[{"deployment_id": "dep_abc123", "weight": 1}], + ) + print(endpoint.traffic_split) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const endpoint = await client.beta.endpoints.update("ep_abc123", { + projectId, + trafficSplit: [{ deploymentId: "dep_abc123", weight: 1 }], + }); + console.log(endpoint.trafficSplit); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const endpoint = await client.beta.endpoints.update("ep_abc123", { + projectId, + trafficSplit: [{ deploymentId: "dep_abc123", weight: 1 }], + }); + console.log(endpoint.trafficSplit); get: tags: [EndpointService] summary: Get an endpoint description: Retrieves an endpoint and lightweight summaries of the deployments attached to it. operationId: EndpointService_GetEndpoint + servers: + - url: https://api.together.ai/v2 parameters: - name: projectId in: path @@ -333,11 +630,51 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + project_id = client.whoami().project_id + + endpoint = client.beta.endpoints.retrieve( + "ep_abc123", + project_id=project_id, + ) + print(endpoint.name, endpoint.traffic_split) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const endpoint = await client.beta.endpoints.retrieve("ep_abc123", { + projectId, + }); + console.log(endpoint.name, endpoint.trafficSplit); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const endpoint = await client.beta.endpoints.retrieve("ep_abc123", { + projectId, + }); + console.log(endpoint.name, endpoint.trafficSplit); delete: tags: [EndpointService] summary: Delete an endpoint description: Permanently deletes an endpoint. Delete its deployments first; use `etag` to reject the request if the endpoint changed after it was read. operationId: EndpointService_DeleteEndpoint + servers: + - url: https://api.together.ai/v2 parameters: - name: projectId in: path @@ -369,12 +706,42 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' - /v2/projects/{projectId}/endpoints/{endpointId}/deployments: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + project_id = client.whoami().project_id + + client.beta.endpoints.delete("ep_abc123", project_id=project_id) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + await client.beta.endpoints.delete("ep_abc123", { projectId }); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + await client.beta.endpoints.delete("ep_abc123", { projectId }); + /projects/{projectId}/endpoints/{endpointId}/deployments: get: tags: [DeploymentService] summary: List deployments description: Lists the deployments attached to an endpoint, including their model, configuration, scaling settings, placement, and current status. operationId: DeploymentService_ListDeployments + servers: + - url: https://api.together.ai/v2 parameters: - name: projectId in: path @@ -421,11 +788,56 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + project_id = client.whoami().project_id + + deployments = client.beta.endpoints.deployments.list( + "ep_abc123", + project_id=project_id, + ) + for deployment in deployments: + print(deployment.id, deployment.name, deployment.status) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const deployments = client.beta.endpoints.deployments.list("ep_abc123", { + projectId, + }); + for await (const deployment of deployments) { + console.log(deployment.id, deployment.name, deployment.status); + } + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const deployments = client.beta.endpoints.deployments.list("ep_abc123", { + projectId, + }); + for await (const deployment of deployments) { + console.log(deployment.id, deployment.name, deployment.status); + } post: tags: [DeploymentService] summary: Create a deployment description: Creates a model deployment under an endpoint. The deployment provisions asynchronously; monitor its status before routing live traffic to it. operationId: DeploymentService_CreateDeployment + servers: + - url: https://api.together.ai/v2 parameters: - name: projectId in: path @@ -463,12 +875,64 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' - /v2/projects/{projectId}/endpoints/{endpointId}/deployments/{id}: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + project_id = client.whoami().project_id + + deployment = client.beta.endpoints.deployments.create( + "ep_abc123", + project_id=project_id, + name="prod", + model=f"projects/{project_id}/models/ml_abc123", + config=f"projects/{project_id}/configs/cr_abc123", + autoscaling={"min_replicas": 1, "max_replicas": 2}, + ) + print(deployment.id, deployment.status) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const deployment = await client.beta.endpoints.deployments.create("ep_abc123", { + projectId, + name: "prod", + model: `projects/${projectId}/models/ml_abc123`, + config: `projects/${projectId}/configs/cr_abc123`, + autoscaling: { minReplicas: 1, maxReplicas: 2 }, + }); + console.log(deployment.id, deployment.status); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const deployment = await client.beta.endpoints.deployments.create("ep_abc123", { + projectId, + name: "prod", + model: `projects/${projectId}/models/ml_abc123`, + config: `projects/${projectId}/configs/cr_abc123`, + autoscaling: { minReplicas: 1, maxReplicas: 2 }, + }); + console.log(deployment.id, deployment.status); + /projects/{projectId}/endpoints/{endpointId}/deployments/{id}: patch: tags: [DeploymentService] summary: Update a deployment description: Updates mutable deployment fields such as its model, configuration, autoscaling bounds, or LoRA support. Changes that affect serving may trigger asynchronous reprovisioning. operationId: DeploymentService_UpdateDeployment + servers: + - url: https://api.together.ai/v2 parameters: - name: projectId in: path @@ -512,11 +976,93 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + project_id = client.whoami().project_id + + deployment = client.beta.endpoints.deployments.update( + "dep_abc123", + project_id=project_id, + endpoint_id="ep_abc123", + autoscaling={ + "min_replicas": 1, + "max_replicas": 4, + "scaling_metrics": [ + { + "name": "gpu_utilization", + "target": 70, + "type": "METRIC_TARGET_TYPE_UTILIZATION", + } + ], + }, + ) + print(deployment.autoscaling) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const deployment = await client.beta.endpoints.deployments.update( + "dep_abc123", + { + projectId, + endpointId: "ep_abc123", + autoscaling: { + minReplicas: 1, + maxReplicas: 4, + scalingMetrics: [ + { + name: "gpu_utilization", + target: 70, + type: "METRIC_TARGET_TYPE_UTILIZATION", + }, + ], + }, + }, + ); + console.log(deployment.autoscaling); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const deployment = await client.beta.endpoints.deployments.update( + "dep_abc123", + { + projectId, + endpointId: "ep_abc123", + autoscaling: { + minReplicas: 1, + maxReplicas: 4, + scalingMetrics: [ + { + name: "gpu_utilization", + target: 70, + type: "METRIC_TARGET_TYPE_UTILIZATION", + }, + ], + }, + }, + ); + console.log(deployment.autoscaling); get: tags: [DeploymentService] summary: Get a deployment description: Retrieves a deployment's desired configuration, placement, runtime information, and current provisioning status. operationId: DeploymentService_GetDeployment + servers: + - url: https://api.together.ai/v2 parameters: - name: projectId in: path @@ -549,11 +1095,54 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + project_id = client.whoami().project_id + + deployment = client.beta.endpoints.deployments.retrieve( + "dep_abc123", + project_id=project_id, + endpoint_id="ep_abc123", + ) + print(deployment.name, deployment.status) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const deployment = await client.beta.endpoints.deployments.retrieve( + "dep_abc123", + { projectId, endpointId: "ep_abc123" }, + ); + console.log(deployment.name, deployment.status); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const deployment = await client.beta.endpoints.deployments.retrieve( + "dep_abc123", + { projectId, endpointId: "ep_abc123" }, + ); + console.log(deployment.name, deployment.status); delete: tags: [DeploymentService] summary: Delete a deployment description: 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. operationId: DeploymentService_DeleteDeployment + servers: + - url: https://api.together.ai/v2 parameters: - name: projectId in: path @@ -591,12 +1180,52 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' - /v2/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + project_id = client.whoami().project_id + + client.beta.endpoints.deployments.delete( + "dep_abc123", + project_id=project_id, + endpoint_id="ep_abc123", + ) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + await client.beta.endpoints.deployments.delete("dep_abc123", { + projectId, + endpointId: "ep_abc123", + }); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + await client.beta.endpoints.deployments.delete("dep_abc123", { + projectId, + endpointId: "ep_abc123", + }); + /projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters: get: tags: [DeploymentService] summary: List deployment adapters description: Lists LoRA adapters attached to a deployment with per-cluster load state. operationId: DeploymentService_ListAdapters + servers: + - url: https://api.together.ai/v2 parameters: - name: projectId in: path @@ -639,11 +1268,61 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + project_id = client.whoami().project_id + + adapters = client.beta.endpoints.adapters.list( + endpoint_id="ep_abc123", + deployment_id="dep_abc123", + project_id=project_id, + ) + for adapter in adapters: + print(adapter.id, adapter.adapter_model_id) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const adapters = client.beta.endpoints.adapters.list( + "ep_abc123", + "dep_abc123", + { projectId }, + ); + for await (const adapter of adapters) { + console.log(adapter.id, adapter.adapterModelId); + } + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const adapters = client.beta.endpoints.adapters.list( + "ep_abc123", + "dep_abc123", + { projectId }, + ); + for await (const adapter of adapters) { + console.log(adapter.id, adapter.adapterModelId); + } post: tags: [DeploymentService] summary: Add a deployment adapter description: Attaches a LoRA adapter to a deployment. If the deployment is at adapter capacity, force can evict the oldest adapter. operationId: DeploymentService_AddAdapter + servers: + - url: https://api.together.ai/v2 parameters: - name: projectId in: path @@ -682,12 +1361,60 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' - /v2/projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters/{id}: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + project_id = client.whoami().project_id + + adapter = client.beta.endpoints.adapters.create( + project_id=project_id, + endpoint_id="ep_abc123", + deployment_id="dep_abc123", + adapter_model_id="ml_abc123", + ) + print(adapter) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const adapter = await client.beta.endpoints.adapters.create({ + projectId, + endpointId: "ep_abc123", + deploymentId: "dep_abc123", + adapterModelId: "ml_abc123", + }); + console.log(adapter); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const adapter = await client.beta.endpoints.adapters.create({ + projectId, + endpointId: "ep_abc123", + deploymentId: "dep_abc123", + adapterModelId: "ml_abc123", + }); + console.log(adapter); + /projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters/{id}: get: tags: [DeploymentService] summary: Get a deployment adapter - description: Gets an adapter attachment by its `dad_` id and returns its per-cluster load state. + description: Gets an attached adapter and its per-cluster load state. operationId: DeploymentService_GetAdapter + servers: + - url: https://api.together.ai/v2 parameters: - name: projectId in: path @@ -711,7 +1438,7 @@ paths: in: path required: true schema: - description: Adapter attachment `dad_` id from a prior add, update, get, or list response. + description: Adapter model identifier. type: string responses: "200": @@ -726,11 +1453,57 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + project_id = client.whoami().project_id + + adapter = client.beta.endpoints.adapters.retrieve( + "dad_abc123", + project_id=project_id, + endpoint_id="ep_abc123", + deployment_id="dep_abc123", + ) + print(adapter) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const adapter = await client.beta.endpoints.adapters.retrieve("dad_abc123", { + projectId, + endpointId: "ep_abc123", + deploymentId: "dep_abc123", + }); + console.log(adapter); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const adapter = await client.beta.endpoints.adapters.retrieve("dad_abc123", { + projectId, + endpointId: "ep_abc123", + deploymentId: "dep_abc123", + }); + console.log(adapter); delete: tags: [DeploymentService] summary: Remove a deployment adapter - description: Detaches an adapter attachment by its `dad_` id using its row-level etag for optimistic concurrency. + description: Detaches an adapter from a deployment using its row-level etag for optimistic concurrency. operationId: DeploymentService_RemoveAdapter + servers: + - url: https://api.together.ai/v2 parameters: - name: projectId in: path @@ -754,7 +1527,7 @@ paths: in: path required: true schema: - description: Adapter attachment `dad_` id from a prior add, update, get, or list response. + description: Adapter model identifier. type: string - name: etag in: query @@ -775,11 +1548,79 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + project_id = client.whoami().project_id + + # Read the attachment first: removing it requires its current etag. + adapter = client.beta.endpoints.adapters.retrieve( + "dad_abc123", + project_id=project_id, + endpoint_id="ep_abc123", + deployment_id="dep_abc123", + ) + + client.beta.endpoints.adapters.delete( + "dad_abc123", + project_id=project_id, + endpoint_id="ep_abc123", + deployment_id="dep_abc123", + etag=adapter.etag, + ) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + // Read the attachment first: removing it requires its current etag. + const adapter = await client.beta.endpoints.adapters.retrieve("dad_abc123", { + projectId, + endpointId: "ep_abc123", + deploymentId: "dep_abc123", + }); + + await client.beta.endpoints.adapters.delete("dad_abc123", { + projectId, + endpointId: "ep_abc123", + deploymentId: "dep_abc123", + etag: adapter.etag, + }); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + // Read the attachment first: removing it requires its current etag. + const adapter = await client.beta.endpoints.adapters.retrieve("dad_abc123", { + projectId, + endpointId: "ep_abc123", + deploymentId: "dep_abc123", + }); + + await client.beta.endpoints.adapters.delete("dad_abc123", { + projectId, + endpointId: "ep_abc123", + deploymentId: "dep_abc123", + etag: adapter.etag, + }); patch: tags: [DeploymentService] summary: Update a deployment adapter - description: Updates the pinned revision of an adapter attachment by its `dad_` id using its row-level etag for optimistic concurrency. + description: Updates the pinned revision of an attached adapter using its row-level etag for optimistic concurrency. operationId: DeploymentService_UpdateAdapter + servers: + - url: https://api.together.ai/v2 parameters: - name: projectId in: path @@ -803,7 +1644,7 @@ paths: in: path required: true schema: - description: Adapter attachment `dad_` id from a prior add, update, get, or list response. + description: Adapter model identifier. type: string requestBody: content: @@ -824,12 +1665,86 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' - /v2/projects/{projectId}/endpoints/{endpointId}/rollouts: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + project_id = client.whoami().project_id + + # Read the attachment first: updating it requires its current etag. + adapter = client.beta.endpoints.adapters.retrieve( + "dad_abc123", + project_id=project_id, + endpoint_id="ep_abc123", + deployment_id="dep_abc123", + ) + + updated = client.beta.endpoints.adapters.update( + "dad_abc123", + project_id=project_id, + endpoint_id="ep_abc123", + deployment_id="dep_abc123", + adapter_revision_id="rv_abc123", + etag=adapter.etag, + ) + print(updated) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + // Read the attachment first: updating it requires its current etag. + const adapter = await client.beta.endpoints.adapters.retrieve("dad_abc123", { + projectId, + endpointId: "ep_abc123", + deploymentId: "dep_abc123", + }); + + const updated = await client.beta.endpoints.adapters.update("dad_abc123", { + projectId, + endpointId: "ep_abc123", + deploymentId: "dep_abc123", + adapterRevisionId: "rv_abc123", + etag: adapter.etag, + }); + console.log(updated); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + // Read the attachment first: updating it requires its current etag. + const adapter = await client.beta.endpoints.adapters.retrieve("dad_abc123", { + projectId, + endpointId: "ep_abc123", + deploymentId: "dep_abc123", + }); + + const updated = await client.beta.endpoints.adapters.update("dad_abc123", { + projectId, + endpointId: "ep_abc123", + deploymentId: "dep_abc123", + adapterRevisionId: "rv_abc123", + etag: adapter.etag, + }); + console.log(updated); + /projects/{projectId}/endpoints/{endpointId}/rollouts: get: tags: [RolloutService] summary: List endpoint rollouts description: Lists rollout histories for an endpoint. Use `filter=ROLLOUT_FILTER_ACTIVE` to return only the active rollout, if one exists. operationId: RolloutService_ListRollouts + servers: + - url: https://api.together.ai/v2 parameters: - name: projectId in: path @@ -874,11 +1789,56 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + project_id = client.whoami().project_id + + rollouts = client.beta.endpoints.rollouts.list( + "ep_abc123", + project_id=project_id, + ) + for rollout in rollouts: + print(rollout.id, rollout.state) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const rollouts = client.beta.endpoints.rollouts.list("ep_abc123", { + projectId, + }); + for await (const rollout of rollouts) { + console.log(rollout.id, rollout.state); + } + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const rollouts = client.beta.endpoints.rollouts.list("ep_abc123", { + projectId, + }); + for await (const rollout of rollouts) { + console.log(rollout.id, rollout.state); + } post: tags: [RolloutService] summary: Create a rollout description: Creates a rollout in the pending state without shifting traffic. Start the rollout in a separate request after reviewing its strategy and metric gates. operationId: RolloutService_CreateRollout + servers: + - url: https://api.together.ai/v2 parameters: - name: projectId in: path @@ -946,12 +1906,100 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' - /v2/projects/{projectId}/endpoints/{endpointId}/rollouts/preview-defaults: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + project_id = client.whoami().project_id + + rollout = client.beta.endpoints.rollouts.create( + "ep_abc123", + project_id=project_id, + source_deployment_id="dep_abc123", + target_deployment_id="dep_def456", + canary={ + "steps": [{"traffic": 25}, {"traffic": 50}, {"traffic": 100}], + "step_interval": "300s", + }, + metrics=[ + { + "name": "router_latency", + "stat": "METRIC_STAT_TYPE_PERCENTILE", + "percentile": 95, + "threshold_check": { + "value": 30000, + "operator": "THRESHOLD_OPERATOR_LT", + }, + "window": "300s", + } + ], + ) + print(rollout.id, rollout.state) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const rollout = await client.beta.endpoints.rollouts.create("ep_abc123", { + projectId, + sourceDeploymentId: "dep_abc123", + targetDeploymentId: "dep_def456", + canary: { + steps: [{ traffic: 25 }, { traffic: 50 }, { traffic: 100 }], + stepInterval: "300s", + }, + metrics: [ + { + name: "router_latency", + stat: "METRIC_STAT_TYPE_PERCENTILE", + percentile: 95, + thresholdCheck: { value: 30000, operator: "THRESHOLD_OPERATOR_LT" }, + window: "300s", + }, + ], + }); + console.log(rollout.id, rollout.state); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const rollout = await client.beta.endpoints.rollouts.create("ep_abc123", { + projectId, + sourceDeploymentId: "dep_abc123", + targetDeploymentId: "dep_def456", + canary: { + steps: [{ traffic: 25 }, { traffic: 50 }, { traffic: 100 }], + stepInterval: "300s", + }, + metrics: [ + { + name: "router_latency", + stat: "METRIC_STAT_TYPE_PERCENTILE", + percentile: 95, + thresholdCheck: { value: 30000, operator: "THRESHOLD_OPERATOR_LT" }, + window: "300s", + }, + ], + }); + console.log(rollout.id, rollout.state); + /projects/{projectId}/endpoints/{endpointId}/rollouts/preview-defaults: post: tags: [RolloutService] summary: Preview rollout defaults description: Returns the values a create request would pick for any field left unset, plus the capacity context needed to display them, without creating a rollout. Responses are display state only and re-validated authoritatively at create and start; do not copy response values back into a create request. operationId: RolloutService_PreviewRolloutDefaults + servers: + - url: https://api.together.ai/v2 parameters: - name: projectId in: path @@ -1047,12 +2095,73 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' - /v2/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + project_id = client.whoami().project_id + + # Returns the values a create request would use for unset fields, + # without creating a rollout. + defaults = client.beta.endpoints.rollouts.preview_defaults( + "ep_abc123", + project_id=project_id, + source_deployment_id="dep_abc123", + target_deployment_id="dep_def456", + canary={"steps": [{"traffic": 25}, {"traffic": 100}]}, + ) + print(defaults) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + // Returns the values a create request would use for unset fields, + // without creating a rollout. + const defaults = await client.beta.endpoints.rollouts.previewDefaults( + "ep_abc123", + { + projectId, + sourceDeploymentId: "dep_abc123", + targetDeploymentId: "dep_def456", + canary: { steps: [{ traffic: 25 }, { traffic: 100 }] }, + }, + ); + console.log(defaults); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + // Returns the values a create request would use for unset fields, + // without creating a rollout. + const defaults = await client.beta.endpoints.rollouts.previewDefaults( + "ep_abc123", + { + projectId, + sourceDeploymentId: "dep_abc123", + targetDeploymentId: "dep_def456", + canary: { steps: [{ traffic: 25 }, { traffic: 100 }] }, + }, + ); + console.log(defaults); + /projects/{projectId}/endpoints/{endpointId}/rollouts/{id}: get: tags: [RolloutService] summary: Get a rollout description: Retrieves a rollout's strategy, lifecycle state, current traffic percentage, step history, and metric-gate results. operationId: RolloutService_GetRollout + servers: + - url: https://api.together.ai/v2 parameters: - name: projectId in: path @@ -1085,11 +2194,54 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + project_id = client.whoami().project_id + + rollout = client.beta.endpoints.rollouts.retrieve( + "rol_abc123", + project_id=project_id, + endpoint_id="ep_abc123", + ) + print(rollout.id, rollout.state) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const rollout = await client.beta.endpoints.rollouts.retrieve("rol_abc123", { + projectId, + endpointId: "ep_abc123", + }); + console.log(rollout.id, rollout.state); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const rollout = await client.beta.endpoints.rollouts.retrieve("rol_abc123", { + projectId, + endpointId: "ep_abc123", + }); + console.log(rollout.id, rollout.state); delete: tags: [RolloutService] summary: Delete a rollout description: Deletes a rollout record. An active rollout must be aborted or completed before it can be deleted. operationId: RolloutService_DeleteRollout + servers: + - url: https://api.together.ai/v2 parameters: - name: projectId in: path @@ -1127,12 +2279,52 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' - /v2/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/start: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + project_id = client.whoami().project_id + + client.beta.endpoints.rollouts.delete( + "rol_abc123", + project_id=project_id, + endpoint_id="ep_abc123", + ) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + await client.beta.endpoints.rollouts.delete("rol_abc123", { + projectId, + endpointId: "ep_abc123", + }); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + await client.beta.endpoints.rollouts.delete("rol_abc123", { + projectId, + endpointId: "ep_abc123", + }); + /projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/start: post: tags: [RolloutService] summary: Start a rollout description: Starts a pending rollout and begins its configured traffic-shifting workflow. operationId: RolloutService_StartRollout + servers: + - url: https://api.together.ai/v2 parameters: - name: projectId in: path @@ -1165,13 +2357,56 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' - /v2/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/pause: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + project_id = client.whoami().project_id + + rollout = client.beta.endpoints.rollouts.start( + "rol_abc123", + project_id=project_id, + endpoint_id="ep_abc123", + ) + print(rollout.id, rollout.state) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const rollout = await client.beta.endpoints.rollouts.start("rol_abc123", { + projectId, + endpointId: "ep_abc123", + }); + console.log(rollout.id, rollout.state); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const rollout = await client.beta.endpoints.rollouts.start("rol_abc123", { + projectId, + endpointId: "ep_abc123", + }); + console.log(rollout.id, rollout.state); + /projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/pause: post: tags: [RolloutService] summary: Pause a rollout description: |- Requests a running or stabilizing rollout to pause and records an optional reason. The response returns the PAUSING snapshot; poll GetRollout until state is PAUSED to confirm the executor has parked. operationId: RolloutService_PauseRollout + servers: + - url: https://api.together.ai/v2 parameters: - name: projectId in: path @@ -1210,12 +2445,58 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' - /v2/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/resume: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + project_id = client.whoami().project_id + + rollout = client.beta.endpoints.rollouts.pause( + "rol_abc123", + project_id=project_id, + endpoint_id="ep_abc123", + reason="Investigating a latency regression", + ) + print(rollout.id, rollout.state) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const rollout = await client.beta.endpoints.rollouts.pause("rol_abc123", { + projectId, + endpointId: "ep_abc123", + reason: "Investigating a latency regression", + }); + console.log(rollout.id, rollout.state); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const rollout = await client.beta.endpoints.rollouts.pause("rol_abc123", { + projectId, + endpointId: "ep_abc123", + reason: "Investigating a latency regression", + }); + console.log(rollout.id, rollout.state); + /projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/resume: post: tags: [RolloutService] summary: Resume a rollout description: Resumes a pausing, paused, or system-paused rollout from its current step and traffic split. operationId: RolloutService_ResumeRollout + servers: + - url: https://api.together.ai/v2 parameters: - name: projectId in: path @@ -1254,12 +2535,55 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' - /v2/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/cancel: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + project_id = client.whoami().project_id + + rollout = client.beta.endpoints.rollouts.resume( + "rol_abc123", + project_id=project_id, + endpoint_id="ep_abc123", + ) + print(rollout.id, rollout.state) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const rollout = await client.beta.endpoints.rollouts.resume("rol_abc123", { + projectId, + endpointId: "ep_abc123", + }); + console.log(rollout.id, rollout.state); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const rollout = await client.beta.endpoints.rollouts.resume("rol_abc123", { + projectId, + endpointId: "ep_abc123", + }); + console.log(rollout.id, rollout.state); + /projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/cancel: post: tags: [RolloutService] summary: Cancel a rollout description: Cancels a running, pausing, paused, system-paused, or stabilizing rollout by freezing the current traffic split into standing weights. Revert is removed and rejected; after canceling, start another canary rollout in either direction or rebalance the traffic split. The response is the accepted rollout snapshot; poll GetRollout until it reaches CANCELED. operationId: RolloutService_CancelRollout + servers: + - url: https://api.together.ai/v2 parameters: - name: projectId in: path @@ -1298,12 +2622,58 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' - /v2/projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/promote: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + project_id = client.whoami().project_id + + rollout = client.beta.endpoints.rollouts.cancel( + "rol_abc123", + project_id=project_id, + endpoint_id="ep_abc123", + reason="Latency regression on the target", + ) + print(rollout.id, rollout.state) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const rollout = await client.beta.endpoints.rollouts.cancel("rol_abc123", { + projectId, + endpointId: "ep_abc123", + reason: "Latency regression on the target", + }); + console.log(rollout.id, rollout.state); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const rollout = await client.beta.endpoints.rollouts.cancel("rol_abc123", { + projectId, + endpointId: "ep_abc123", + reason: "Latency regression on the target", + }); + console.log(rollout.id, rollout.state); + /projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/promote: post: tags: [RolloutService] summary: Promote a rollout description: Completes a running or paused rollout immediately by sending all live traffic to the target deployment. operationId: RolloutService_PromoteRollout + servers: + - url: https://api.together.ai/v2 parameters: - name: projectId in: path @@ -1342,12 +2712,55 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' - /v2/projects/{projectId}/endpoints/{endpointId}/abExperiments: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + project_id = client.whoami().project_id + + rollout = client.beta.endpoints.rollouts.promote( + "rol_abc123", + project_id=project_id, + endpoint_id="ep_abc123", + ) + print(rollout.id, rollout.state) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const rollout = await client.beta.endpoints.rollouts.promote("rol_abc123", { + projectId, + endpointId: "ep_abc123", + }); + console.log(rollout.id, rollout.state); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const rollout = await client.beta.endpoints.rollouts.promote("rol_abc123", { + projectId, + endpointId: "ep_abc123", + }); + console.log(rollout.id, rollout.state); + /projects/{projectId}/endpoints/{endpointId}/abExperiments: get: tags: [ABExperimentService] summary: List A/B experiments description: Lists the managed live-traffic experiments configured for an endpoint. operationId: ABExperimentService_ListABExperiments + servers: + - url: https://api.together.ai/v2 parameters: - name: projectId in: path @@ -1384,11 +2797,56 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + project_id = client.whoami().project_id + + experiments = client.beta.endpoints.ab_experiments.list( + "ep_abc123", + project_id=project_id, + ) + for experiment in experiments: + print(experiment.id, experiment.name) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const experiments = client.beta.endpoints.abExperiments.list("ep_abc123", { + projectId, + }); + for await (const experiment of experiments) { + console.log(experiment.id, experiment.name); + } + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const experiments = client.beta.endpoints.abExperiments.list("ep_abc123", { + projectId, + }); + for await (const experiment of experiments) { + console.log(experiment.id, experiment.name); + } post: tags: [ABExperimentService] summary: Create an A/B experiment description: 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. operationId: ABExperimentService_CreateABExperiment + servers: + - url: https://api.together.ai/v2 parameters: - name: projectId in: path @@ -1421,12 +2879,97 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' - /v2/projects/{projectId}/endpoints/{endpointId}/abExperiments/{id}: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + project_id = client.whoami().project_id + + experiment = client.beta.endpoints.ab_experiments.create( + "ep_abc123", + project_id=project_id, + name="new-config-test", + members=[ + { + "deployment_id": "dep_abc123", + "role": "AB_EXPERIMENT_MEMBER_ROLE_CONTROL", + "percent": 90, + }, + { + "deployment_id": "dep_def456", + "role": "AB_EXPERIMENT_MEMBER_ROLE_VARIANT", + "percent": 10, + }, + ], + ) + print(experiment.id) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const experiment = await client.beta.endpoints.abExperiments.create( + "ep_abc123", + { + projectId, + name: "new-config-test", + members: [ + { + deploymentId: "dep_abc123", + role: "AB_EXPERIMENT_MEMBER_ROLE_CONTROL", + percent: 90, + }, + { + deploymentId: "dep_def456", + role: "AB_EXPERIMENT_MEMBER_ROLE_VARIANT", + percent: 10, + }, + ], + }, + ); + console.log(experiment.id); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const experiment = await client.beta.endpoints.abExperiments.create( + "ep_abc123", + { + projectId, + name: "new-config-test", + members: [ + { + deploymentId: "dep_abc123", + role: "AB_EXPERIMENT_MEMBER_ROLE_CONTROL", + percent: 90, + }, + { + deploymentId: "dep_def456", + role: "AB_EXPERIMENT_MEMBER_ROLE_VARIANT", + percent: 10, + }, + ], + }, + ); + console.log(experiment.id); + /projects/{projectId}/endpoints/{endpointId}/abExperiments/{id}: patch: tags: [ABExperimentService] summary: Update an A/B experiment description: Updates an experiment's description or member traffic percentages. Use the experiment etag for optimistic concurrency. operationId: ABExperimentService_UpdateABExperiment + servers: + - url: https://api.together.ai/v2 parameters: - name: projectId in: path @@ -1470,11 +3013,99 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' - get: - tags: [ABExperimentService] - summary: Get an A/B experiment - description: Retrieves an A/B experiment and its participating deployments, roles, and traffic percentages. - operationId: ABExperimentService_GetABExperiment + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + project_id = client.whoami().project_id + + experiment = client.beta.endpoints.ab_experiments.update( + "abx_abc123", + project_id=project_id, + endpoint_id="ep_abc123", + update_mask="members", + members=[ + { + "deployment_id": "dep_abc123", + "role": "AB_EXPERIMENT_MEMBER_ROLE_CONTROL", + "percent": 50, + }, + { + "deployment_id": "dep_def456", + "role": "AB_EXPERIMENT_MEMBER_ROLE_VARIANT", + "percent": 50, + }, + ], + ) + print(experiment.members) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const experiment = await client.beta.endpoints.abExperiments.update( + "abx_abc123", + { + projectId, + endpointId: "ep_abc123", + updateMask: "members", + members: [ + { + deploymentId: "dep_abc123", + role: "AB_EXPERIMENT_MEMBER_ROLE_CONTROL", + percent: 50, + }, + { + deploymentId: "dep_def456", + role: "AB_EXPERIMENT_MEMBER_ROLE_VARIANT", + percent: 50, + }, + ], + }, + ); + console.log(experiment.members); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const experiment = await client.beta.endpoints.abExperiments.update( + "abx_abc123", + { + projectId, + endpointId: "ep_abc123", + updateMask: "members", + members: [ + { + deploymentId: "dep_abc123", + role: "AB_EXPERIMENT_MEMBER_ROLE_CONTROL", + percent: 50, + }, + { + deploymentId: "dep_def456", + role: "AB_EXPERIMENT_MEMBER_ROLE_VARIANT", + percent: 50, + }, + ], + }, + ); + console.log(experiment.members); + get: + tags: [ABExperimentService] + summary: Get an A/B experiment + description: Retrieves an A/B experiment and its participating deployments, roles, and traffic percentages. + operationId: ABExperimentService_GetABExperiment + servers: + - url: https://api.together.ai/v2 parameters: - name: projectId in: path @@ -1507,11 +3138,54 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + project_id = client.whoami().project_id + + experiment = client.beta.endpoints.ab_experiments.retrieve( + "abx_abc123", + project_id=project_id, + endpoint_id="ep_abc123", + ) + print(experiment.name, experiment.members) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const experiment = await client.beta.endpoints.abExperiments.retrieve( + "abx_abc123", + { projectId, endpointId: "ep_abc123" }, + ); + console.log(experiment.name, experiment.members); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const experiment = await client.beta.endpoints.abExperiments.retrieve( + "abx_abc123", + { projectId, endpointId: "ep_abc123" }, + ); + console.log(experiment.name, experiment.members); delete: tags: [ABExperimentService] summary: Delete an A/B experiment description: Deletes an A/B experiment and removes its managed traffic split. The deployments themselves are not deleted. operationId: ABExperimentService_DeleteABExperiment + servers: + - url: https://api.together.ai/v2 parameters: - name: projectId in: path @@ -1549,12 +3223,52 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' - /v2/projects/{projectId}/endpoints/{endpointId}/shadowExperiments: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + project_id = client.whoami().project_id + + client.beta.endpoints.ab_experiments.delete( + "abx_abc123", + project_id=project_id, + endpoint_id="ep_abc123", + ) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + await client.beta.endpoints.abExperiments.delete("abx_abc123", { + projectId, + endpointId: "ep_abc123", + }); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + await client.beta.endpoints.abExperiments.delete("abx_abc123", { + projectId, + endpointId: "ep_abc123", + }); + /projects/{projectId}/endpoints/{endpointId}/shadowExperiments: get: tags: [ShadowExperimentService] summary: List shadow experiments description: Lists experiments that mirror sampled endpoint traffic to target deployments without affecting client responses. Set `includeTargets=true` to include target details inline. operationId: ShadowExperimentService_ListShadowExperiments + servers: + - url: https://api.together.ai/v2 parameters: - name: projectId in: path @@ -1602,11 +3316,59 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + project_id = client.whoami().project_id + + experiments = client.beta.endpoints.shadow_experiments.list( + "ep_abc123", + project_id=project_id, + include_targets=True, + ) + for experiment in experiments: + print(experiment.id, experiment.name) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const experiments = client.beta.endpoints.shadowExperiments.list("ep_abc123", { + projectId, + includeTargets: true, + }); + for await (const experiment of experiments) { + console.log(experiment.id, experiment.name); + } + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const experiments = client.beta.endpoints.shadowExperiments.list("ep_abc123", { + projectId, + includeTargets: true, + }); + for await (const experiment of experiments) { + console.log(experiment.id, experiment.name); + } post: tags: [ShadowExperimentService] summary: Create a shadow experiment description: Creates an experiment that mirrors a sampled portion of endpoint traffic to one or more target deployments without returning their responses to clients. Add a description with the update operation after creation. operationId: ShadowExperimentService_CreateShadowExperiment + servers: + - url: https://api.together.ai/v2 parameters: - name: projectId in: path @@ -1645,12 +3407,72 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' - /v2/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{id}: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + project_id = client.whoami().project_id + + # Mirror 10% of the endpoint's requests to the candidate deployment. + experiment = client.beta.endpoints.shadow_experiments.create( + "ep_abc123", + project_id=project_id, + name="candidate-shadow", + source={"endpoint": {"sampling": {"uniform": {"rate": 0.1}}}}, + targets=[ + {"name": "candidate", "target_deployment_id": "dep_def456"}, + ], + ) + print(experiment.id) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + // Mirror 10% of the endpoint's requests to the candidate deployment. + const experiment = await client.beta.endpoints.shadowExperiments.create( + "ep_abc123", + { + projectId, + name: "candidate-shadow", + source: { endpoint: { sampling: { uniform: { rate: 0.1 } } } }, + targets: [{ name: "candidate", targetDeploymentId: "dep_def456" }], + }, + ); + console.log(experiment.id); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + // Mirror 10% of the endpoint's requests to the candidate deployment. + const experiment = await client.beta.endpoints.shadowExperiments.create( + "ep_abc123", + { + projectId, + name: "candidate-shadow", + source: { endpoint: { sampling: { uniform: { rate: 0.1 } } } }, + targets: [{ name: "candidate", targetDeploymentId: "dep_def456" }], + }, + ); + console.log(experiment.id); + /projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{id}: patch: tags: [ShadowExperimentService] summary: Update a shadow experiment description: Updates a shadow experiment's description or source sampling strategy. `updateMask` is required; source changes also require the current `etag` in the request body. operationId: ShadowExperimentService_UpdateShadowExperiment + servers: + - url: https://api.together.ai/v2 parameters: - name: projectId in: path @@ -1701,11 +3523,66 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + project_id = client.whoami().project_id + + experiment = client.beta.endpoints.shadow_experiments.update( + "exp_abc123", + project_id=project_id, + endpoint_id="ep_abc123", + update_mask="description", + description="Compare the FP8 config against production", + ) + print(experiment.description) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const experiment = await client.beta.endpoints.shadowExperiments.update( + "exp_abc123", + { + projectId, + endpointId: "ep_abc123", + updateMask: "description", + description: "Compare the FP8 config against production", + }, + ); + console.log(experiment.description); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const experiment = await client.beta.endpoints.shadowExperiments.update( + "exp_abc123", + { + projectId, + endpointId: "ep_abc123", + updateMask: "description", + description: "Compare the FP8 config against production", + }, + ); + console.log(experiment.description); get: tags: [ShadowExperimentService] summary: Get a shadow experiment description: Retrieves a shadow experiment, including its sampling strategy and target deployments. operationId: ShadowExperimentService_GetShadowExperiment + servers: + - url: https://api.together.ai/v2 parameters: - name: projectId in: path @@ -1744,11 +3621,54 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + project_id = client.whoami().project_id + + experiment = client.beta.endpoints.shadow_experiments.retrieve( + "exp_abc123", + project_id=project_id, + endpoint_id="ep_abc123", + ) + print(experiment.name, experiment.targets) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const experiment = await client.beta.endpoints.shadowExperiments.retrieve( + "exp_abc123", + { projectId, endpointId: "ep_abc123" }, + ); + console.log(experiment.name, experiment.targets); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const experiment = await client.beta.endpoints.shadowExperiments.retrieve( + "exp_abc123", + { projectId, endpointId: "ep_abc123" }, + ); + console.log(experiment.name, experiment.targets); delete: tags: [ShadowExperimentService] summary: Delete a shadow experiment description: Deletes a shadow experiment and its target records. The underlying deployments are not deleted. operationId: ShadowExperimentService_DeleteShadowExperiment + servers: + - url: https://api.together.ai/v2 parameters: - name: projectId in: path @@ -1792,12 +3712,52 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' - /v2/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + project_id = client.whoami().project_id + + client.beta.endpoints.shadow_experiments.delete( + "exp_abc123", + project_id=project_id, + endpoint_id="ep_abc123", + ) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + await client.beta.endpoints.shadowExperiments.delete("exp_abc123", { + projectId, + endpointId: "ep_abc123", + }); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + await client.beta.endpoints.shadowExperiments.delete("exp_abc123", { + projectId, + endpointId: "ep_abc123", + }); + /projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets: get: tags: [ShadowExperimentService] summary: List shadow experiment targets description: Lists the deployments that receive mirrored requests from a shadow experiment. operationId: ShadowExperimentService_ListTargets + servers: + - url: https://api.together.ai/v2 parameters: - name: projectId in: path @@ -1846,11 +3806,61 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + project_id = client.whoami().project_id + + targets = client.beta.endpoints.shadow_experiments.targets.list( + endpoint_id="ep_abc123", + experiment_id="exp_abc123", + project_id=project_id, + ) + for target in targets: + print(target.id, target.name, target.target_deployment_id) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const targets = client.beta.endpoints.shadowExperiments.targets.list( + "ep_abc123", + "exp_abc123", + { projectId }, + ); + for await (const target of targets) { + console.log(target.id, target.name, target.targetDeploymentId); + } + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const targets = client.beta.endpoints.shadowExperiments.targets.list( + "ep_abc123", + "exp_abc123", + { projectId }, + ); + for await (const target of targets) { + console.log(target.id, target.name, target.targetDeploymentId); + } post: tags: [ShadowExperimentService] summary: Create a shadow experiment target description: Adds a deployment under the same endpoint as a target for mirrored requests. operationId: ShadowExperimentService_CreateTarget + servers: + - url: https://api.together.ai/v2 parameters: - name: projectId in: path @@ -1895,12 +3905,63 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' - /v2/projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets/{id}: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + project_id = client.whoami().project_id + + target = client.beta.endpoints.shadow_experiments.targets.create( + project_id=project_id, + endpoint_id="ep_abc123", + experiment_id="exp_abc123", + name="candidate-2", + target_deployment_id="dep_ghi789", + ) + print(target.id) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const target = await client.beta.endpoints.shadowExperiments.targets.create({ + projectId, + endpointId: "ep_abc123", + experimentId: "exp_abc123", + name: "candidate-2", + targetDeploymentId: "dep_ghi789", + }); + console.log(target.id); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const target = await client.beta.endpoints.shadowExperiments.targets.create({ + projectId, + endpointId: "ep_abc123", + experimentId: "exp_abc123", + name: "candidate-2", + targetDeploymentId: "dep_ghi789", + }); + console.log(target.id); + /projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets/{id}: patch: tags: [ShadowExperimentService] summary: Update a shadow experiment target description: Updates a shadow target's name, deployment, or description. `updateMask` is required and must select at least one mutable field. operationId: ShadowExperimentService_UpdateTarget + servers: + - url: https://api.together.ai/v2 parameters: - name: projectId in: path @@ -1957,11 +4018,69 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + project_id = client.whoami().project_id + + target = client.beta.endpoints.shadow_experiments.targets.update( + "tgt_abc123", + project_id=project_id, + endpoint_id="ep_abc123", + experiment_id="exp_abc123", + update_mask="name", + name="candidate-fp8", + ) + print(target.name) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const target = await client.beta.endpoints.shadowExperiments.targets.update( + "tgt_abc123", + { + projectId, + endpointId: "ep_abc123", + experimentId: "exp_abc123", + updateMask: "name", + name: "candidate-fp8", + }, + ); + console.log(target.name); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const target = await client.beta.endpoints.shadowExperiments.targets.update( + "tgt_abc123", + { + projectId, + endpointId: "ep_abc123", + experimentId: "exp_abc123", + updateMask: "name", + name: "candidate-fp8", + }, + ); + console.log(target.name); get: tags: [ShadowExperimentService] summary: Get a shadow experiment target description: Retrieves one target configured to receive mirrored requests from a shadow experiment. operationId: ShadowExperimentService_GetTarget + servers: + - url: https://api.together.ai/v2 parameters: - name: projectId in: path @@ -2006,11 +4125,55 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + project_id = client.whoami().project_id + + target = client.beta.endpoints.shadow_experiments.targets.retrieve( + "tgt_abc123", + project_id=project_id, + endpoint_id="ep_abc123", + experiment_id="exp_abc123", + ) + print(target.name, target.target_deployment_id) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const target = await client.beta.endpoints.shadowExperiments.targets.retrieve( + "tgt_abc123", + { projectId, endpointId: "ep_abc123", experimentId: "exp_abc123" }, + ); + console.log(target.name, target.targetDeploymentId); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const target = await client.beta.endpoints.shadowExperiments.targets.retrieve( + "tgt_abc123", + { projectId, endpointId: "ep_abc123", experimentId: "exp_abc123" }, + ); + console.log(target.name, target.targetDeploymentId); delete: tags: [ShadowExperimentService] summary: Delete a shadow experiment target description: Removes a target from a shadow experiment without deleting the underlying deployment. operationId: ShadowExperimentService_DeleteTarget + servers: + - url: https://api.together.ai/v2 parameters: - name: projectId in: path @@ -2060,12 +4223,55 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' - /v2/projects/{projectId}/endpoints/{id}/analytics: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + project_id = client.whoami().project_id + + client.beta.endpoints.shadow_experiments.targets.delete( + "tgt_abc123", + project_id=project_id, + endpoint_id="ep_abc123", + experiment_id="exp_abc123", + ) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + await client.beta.endpoints.shadowExperiments.targets.delete("tgt_abc123", { + projectId, + endpointId: "ep_abc123", + experimentId: "exp_abc123", + }); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + await client.beta.endpoints.shadowExperiments.targets.delete("tgt_abc123", { + projectId, + endpointId: "ep_abc123", + experimentId: "exp_abc123", + }); + /projects/{projectId}/endpoints/{id}/analytics: get: tags: [EndpointService] summary: Get endpoint analytics description: Returns aggregated request, token, latency, throughput, error, and resource-utilization metrics for an endpoint over a time range. Optionally includes time-series buckets and a per-deployment breakdown. operationId: EndpointService_GetEndpointAnalytics + servers: + - url: https://api.together.ai/v2 parameters: - name: projectId in: path @@ -2119,12 +4325,58 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' - /v2/projects/{projectId}/endpoints/{id}/events: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + project_id = client.whoami().project_id + + analytics = client.beta.endpoints.analytics( + "ep_abc123", + project_id=project_id, + start_time="2026-10-01T00:00:00Z", + end_time="2026-10-02T00:00:00Z", + ) + print(analytics) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const analytics = await client.beta.endpoints.analytics("ep_abc123", { + projectId, + startTime: "2026-10-01T00:00:00Z", + endTime: "2026-10-02T00:00:00Z", + }); + console.log(analytics); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const analytics = await client.beta.endpoints.analytics("ep_abc123", { + projectId, + startTime: "2026-10-01T00:00:00Z", + endTime: "2026-10-02T00:00:00Z", + }); + console.log(analytics); + /projects/{projectId}/endpoints/{id}/events: get: tags: [EndpointService] summary: List endpoint events description: Lists an endpoint's audit and lifecycle events newest first. The feed combines endpoint changes with provisioning, scaling, readiness, rollout, and other events from deployments under the endpoint. operationId: EndpointService_ListEndpointEvents + servers: + - url: https://api.together.ai/v2 parameters: - name: projectId in: path @@ -2212,12 +4464,60 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' - /v2/projects/{projectId}/models: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + project_id = client.whoami().project_id + + events = client.beta.endpoints.list_events( + "ep_abc123", + project_id=project_id, + min_level="LEVEL_WARN", + ) + for event in events: + print(event) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const events = client.beta.endpoints.listEvents("ep_abc123", { + projectId, + minLevel: "LEVEL_WARN", + }); + for await (const event of events) { + console.log(event); + } + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const events = client.beta.endpoints.listEvents("ep_abc123", { + projectId, + minLevel: "LEVEL_WARN", + }); + for await (const event of events) { + console.log(event); + } + /projects/{projectId}/models: get: tags: [VolumeService] summary: List project models description: Lists custom model resources owned by the specified project. Use the organization endpoint to list models shared across projects or the supported-model catalog to discover Together-hosted base models. operationId: VolumeService_ListModels + servers: + - url: https://api.together.ai/v2 parameters: - name: projectId in: path @@ -2261,11 +4561,46 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + project_id = client.whoami().project_id + + for model in client.beta.models.list(project_id=project_id): + print(model.id, model.name) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + for await (const model of client.beta.models.list({ projectId })) { + console.log(model.id, model.name); + } + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + for await (const model of client.beta.models.list({ projectId })) { + console.log(model.id, model.name); + } post: tags: [VolumeService] summary: Create a model description: Registers a custom model resource in the project. Registration creates the model's metadata; upload or import model files separately before deploying it. operationId: VolumeService_CreateModel + servers: + - url: https://api.together.ai/v2 parameters: - name: projectId in: path @@ -2292,12 +4627,60 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' - /v2/projects/{projectId}/models/{id}: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + project_id = client.whoami().project_id + + model = client.beta.models.create( + project_id=project_id, + type="adapter", + name="my-lora-adapter", + base_model_id="ml_abc123", + ) + print(model.id) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const model = await client.beta.models.create({ + projectId, + type: "adapter", + name: "my-lora-adapter", + baseModelId: "ml_abc123", + }); + console.log(model.id); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const model = await client.beta.models.create({ + projectId, + type: "adapter", + name: "my-lora-adapter", + baseModelId: "ml_abc123", + }); + console.log(model.id); + /projects/{projectId}/models/{id}: get: tags: [VolumeService] summary: Get a model description: Retrieves a custom model's metadata, visibility, weight information, and base-model relationship. operationId: VolumeService_GetModel + servers: + - url: https://api.together.ai/v2 parameters: - name: projectId in: path @@ -2324,11 +4707,44 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + project_id = client.whoami().project_id + + model = client.beta.models.retrieve("ml_abc123", project_id=project_id) + print(model.id, model.name) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const model = await client.beta.models.retrieve("ml_abc123", { projectId }); + console.log(model.id, model.name); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const model = await client.beta.models.retrieve("ml_abc123", { projectId }); + console.log(model.id, model.name); delete: tags: [VolumeService] summary: Delete a model description: Permanently deletes a custom model resource. The model must not be in use by an active deployment. operationId: VolumeService_DeleteModel + servers: + - url: https://api.together.ai/v2 parameters: - name: projectId in: path @@ -2355,11 +4771,41 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + project_id = client.whoami().project_id + + client.beta.models.delete("ml_abc123", project_id=project_id) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + await client.beta.models.delete("ml_abc123", { projectId }); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + await client.beta.models.delete("ml_abc123", { projectId }); patch: tags: [VolumeService] summary: Update a model description: Updates mutable model metadata such as its inference name, description, base model, or visibility. operationId: VolumeService_UpdateModel + servers: + - url: https://api.together.ai/v2 parameters: - name: projectId in: path @@ -2398,12 +4844,58 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' - /v2/projects/{projectId}/placement-profiles: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + project_id = client.whoami().project_id + + model = client.beta.models.update( + "ml_abc123", + project_id=project_id, + update_mask="description", + description="LoRA adapter for support-ticket triage", + ) + print(model.description) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const model = await client.beta.models.update("ml_abc123", { + projectId, + updateMask: "description", + description: "LoRA adapter for support-ticket triage", + }); + console.log(model.description); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const model = await client.beta.models.update("ml_abc123", { + projectId, + updateMask: "description", + description: "LoRA adapter for support-ticket triage", + }); + console.log(model.description); + /projects/{projectId}/placement-profiles: get: tags: [PlacementProfileService] summary: List placement profiles description: Lists reusable, project-visible placement policies that control the regions where deployments may be scheduled. operationId: PlacementProfileService_ListPlacementProfiles + servers: + - url: https://api.together.ai/v2 parameters: - name: projectId in: path @@ -2434,12 +4926,52 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' - /v2/projects/{projectId}/placement-profiles/{id}: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + project_id = client.whoami().project_id + + profiles = client.beta.endpoints.placement_profiles.list( + project_id=project_id, + ) + for profile in profiles: + print(profile.id, profile.name) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const profiles = client.beta.endpoints.placementProfiles.list({ projectId }); + for await (const profile of profiles) { + console.log(profile.id, profile.name); + } + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const profiles = client.beta.endpoints.placementProfiles.list({ projectId }); + for await (const profile of profiles) { + console.log(profile.id, profile.name); + } + /projects/{projectId}/placement-profiles/{id}: get: tags: [PlacementProfileService] summary: Get a placement profile description: Retrieves a reusable placement profile and its ordered region preferences. operationId: PlacementProfileService_GetPlacementProfile + servers: + - url: https://api.together.ai/v2 parameters: - name: projectId in: path @@ -2466,12 +4998,54 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' - /v2/projects/{projectId}/models/{id}/files: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + project_id = client.whoami().project_id + + profile = client.beta.endpoints.placement_profiles.retrieve( + "pp_abc123", + project_id=project_id, + ) + print(profile.name) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const profile = await client.beta.endpoints.placementProfiles.retrieve( + "pp_abc123", + { projectId }, + ); + console.log(profile.name); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const profile = await client.beta.endpoints.placementProfiles.retrieve( + "pp_abc123", + { projectId }, + ); + console.log(profile.name); + /projects/{projectId}/models/{id}/files: get: tags: [VolumeService] summary: List model files description: Lists files in the latest or specified revision of a model, including paths, sizes, and content hashes. operationId: VolumeService_ListModelFiles + servers: + - url: https://api.together.ai/v2 parameters: - name: projectId in: path @@ -2503,12 +5077,45 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' - /v2/projects/{projectId}/models/{id}/revisions: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + project_id = client.whoami().project_id + + files = client.beta.models.list_files("ml_abc123", project_id=project_id) + print(files) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const files = await client.beta.models.listFiles("ml_abc123", { projectId }); + console.log(files); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const files = await client.beta.models.listFiles("ml_abc123", { projectId }); + console.log(files); + /projects/{projectId}/models/{id}/revisions: get: tags: [VolumeService] summary: List model revisions description: Lists the immutable file revisions available for a custom model, newest first. operationId: VolumeService_ListModelRevisions + servers: + - url: https://api.together.ai/v2 parameters: - name: projectId in: path @@ -2535,12 +5142,52 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' - /v2/projects/{projectId}/models/{id}/revisions/{revisionId}: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + project_id = client.whoami().project_id + + revisions = client.beta.models.list_revisions( + "ml_abc123", + project_id=project_id, + ) + print(revisions) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const revisions = await client.beta.models.listRevisions("ml_abc123", { + projectId, + }); + console.log(revisions); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const revisions = await client.beta.models.listRevisions("ml_abc123", { + projectId, + }); + console.log(revisions); + /projects/{projectId}/models/{id}/revisions/{revisionId}: get: tags: [VolumeService] summary: Get a model volume revision description: Retrieves metadata for one immutable revision of a custom model's files. operationId: VolumeService_GetRevisionByModelType + servers: + - url: https://api.together.ai/v2 parameters: - name: projectId in: path @@ -2573,12 +5220,59 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' - /v2/projects/{projectId}/models/uploads: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + project_id = client.whoami().project_id + + # The SDK has no dedicated method for this endpoint yet, so call it with + # the client's generic GET helper. + url = ( + f"https://api.together.ai/v2/projects/{project_id}" + "/models/ml_abc123/revisions/rv_abc123" + ) + revision = client.get(url, cast_to=object) + print(revision) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + // The SDK has no dedicated method for this endpoint yet, so call it with + // the client's generic GET helper. + const revision = await client.get( + `https://api.together.ai/v2/projects/${projectId}/models/ml_abc123/revisions/rv_abc123`, + ); + console.log(revision); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + // The SDK has no dedicated method for this endpoint yet, so call it with + // the client's generic GET helper. + const revision = await client.get( + `https://api.together.ai/v2/projects/${projectId}/models/ml_abc123/revisions/rv_abc123`, + ); + console.log(revision); + /projects/{projectId}/models/uploads: get: tags: [VolumeService] summary: List remote model uploads description: Lists asynchronous jobs that import model files from Hugging Face or a presigned remote URL. operationId: VolumeService_ListRemoteModelUploads + servers: + - url: https://api.together.ai/v2 parameters: - name: projectId in: path @@ -2609,11 +5303,50 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + project_id = client.whoami().project_id + + for job in client.beta.models.remote_uploads.list(project_id=project_id): + print(job.id, job.status) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + for await (const job of client.beta.models.remoteUploads.list({ + projectId, + })) { + console.log(job.id, job.status); + } + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + for await (const job of client.beta.models.remoteUploads.list({ + projectId, + })) { + console.log(job.id, job.status); + } post: tags: [VolumeService] summary: Create a remote model upload description: Starts an asynchronous job that imports model files from Hugging Face or a presigned URL into a registered model and creates a model revision when the import completes. operationId: VolumeService_CreateRemoteModelUpload + servers: + - url: https://api.together.ai/v2 parameters: - name: projectId in: path @@ -2640,12 +5373,57 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' - /v2/projects/{projectId}/models/uploads/{id}: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + project_id = client.whoami().project_id + + job = client.beta.models.remote_uploads.create( + project_id=project_id, + model_id="ml_abc123", + remote_url="https://huggingface.co/your-org/your-adapter", + ) + print(job) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const job = await client.beta.models.remoteUploads.create({ + projectId, + modelId: "ml_abc123", + remoteUrl: "https://huggingface.co/your-org/your-adapter", + }); + console.log(job); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const job = await client.beta.models.remoteUploads.create({ + projectId, + modelId: "ml_abc123", + remoteUrl: "https://huggingface.co/your-org/your-adapter", + }); + console.log(job); + /projects/{projectId}/models/uploads/{id}: get: tags: [VolumeService] summary: Get a remote model upload description: Retrieves the status, progress details, retry counts, and timestamps for a remote model import job. operationId: VolumeService_GetRemoteModelUpload + servers: + - url: https://api.together.ai/v2 parameters: - name: projectId in: path @@ -2672,12 +5450,52 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' - /v2/projects/{projectId}/models/uploads/{id}/events: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + project_id = client.whoami().project_id + + job = client.beta.models.remote_uploads.retrieve( + "job_abc123", + project_id=project_id, + ) + print(job) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const job = await client.beta.models.remoteUploads.retrieve("job_abc123", { + projectId, + }); + console.log(job); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const job = await client.beta.models.remoteUploads.retrieve("job_abc123", { + projectId, + }); + console.log(job); + /projects/{projectId}/models/uploads/{id}/events: get: tags: [VolumeService] summary: List remote model upload events description: Lists progress and diagnostic events for a remote model import job. operationId: VolumeService_ListRemoteModelUploadEvents + servers: + - url: https://api.together.ai/v2 parameters: - name: projectId in: path @@ -2714,12 +5532,52 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' - /v2/public/endpoints: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + project_id = client.whoami().project_id + + events = client.beta.models.remote_uploads.events( + "job_abc123", + project_id=project_id, + ) + print(events) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const events = await client.beta.models.remoteUploads.events("job_abc123", { + projectId, + }); + console.log(events); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const { project_id: projectId } = await client.whoami(); + + const events = await client.beta.models.remoteUploads.events("job_abc123", { + projectId, + }); + console.log(events); + /public/endpoints: get: tags: [EndpointService] summary: List public endpoints description: Lists endpoints that are publicly visible across Together projects. operationId: EndpointService_ListPublicEndpoints + servers: + - url: https://api.together.ai/v2 parameters: - name: limit in: query @@ -2754,12 +5612,14 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' - /v2/public/inference-instance-types: + /public/inference-instance-types: get: tags: [InstanceTypeService] summary: List inference instance types description: Lists hardware instance types currently available to inference deployments, including GPU resources, pricing, regions, and best-effort capacity headroom. operationId: InstanceTypeService_ListInferenceInstanceTypes + servers: + - url: https://api.together.ai/v2 responses: "200": description: OK @@ -2773,12 +5633,47 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' - /v2/public/inference-instance-types/{id}: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + + instance_types = client.beta.endpoints.hardware.list() + for instance_type in instance_types.data: + print(instance_type.name, instance_type.price_cents_per_hour) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + + const instanceTypes = await client.beta.endpoints.hardware.list(); + for (const instanceType of instanceTypes.data) { + console.log(instanceType.name, instanceType.priceCentsPerHour); + } + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + + const instanceTypes = await client.beta.endpoints.hardware.list(); + for (const instanceType of instanceTypes.data) { + console.log(instanceType.name, instanceType.priceCentsPerHour); + } + /public/inference-instance-types/{id}: get: tags: [InstanceTypeService] summary: Get an inference instance type description: Retrieves the GPU resources, pricing, regional availability, and best-effort capacity headroom for one inference instance type. operationId: InstanceTypeService_GetInferenceInstanceType + servers: + - url: https://api.together.ai/v2 parameters: - name: id in: path @@ -2799,13 +5694,45 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + + instance_type = client.beta.endpoints.hardware.retrieve("ins_abc123") + print(instance_type.name, instance_type.regions) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; - /v2/supported-models: + const client = new Together(); + + const instanceType = + await client.beta.endpoints.hardware.retrieve("ins_abc123"); + console.log(instanceType.name, instanceType.regions); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + + const instanceType = + await client.beta.endpoints.hardware.retrieve("ins_abc123"); + console.log(instanceType.name, instanceType.regions); + + /supported-models: get: tags: [SupportedModelsService] summary: List supported models description: Lists Together-hosted base models that can be deployed for dedicated inference, together with their capabilities and certified deployment profiles. operationId: SupportedModelsService_ListSupportedModels + servers: + - url: https://api.together.ai/v2 parameters: - name: modality in: query @@ -2863,12 +5790,51 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' - /v2/supported-models/{id}: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + + models = client.beta.models.list_supported(product="PRODUCT_DEDICATED") + for model in models: + print(model.id, model.name) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + + const models = client.beta.models.listSupported({ + product: "PRODUCT_DEDICATED", + }); + for await (const model of models) { + console.log(model.id, model.name); + } + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + + const models = client.beta.models.listSupported({ + product: "PRODUCT_DEDICATED", + }); + for await (const model of models) { + console.log(model.id, model.name); + } + /supported-models/{id}: get: tags: [SupportedModelsService] summary: Get a supported model description: Retrieves a Together-hosted base model and the certified model, configuration, hardware, and performance profiles available for deployment. operationId: SupportedModelsService_GetSupportedModel + servers: + - url: https://api.together.ai/v2 parameters: - name: id in: path @@ -2889,8 +5855,36 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + + model = client.beta.models.retrieve_supported("arch_abc123") + print(model.name, model.deployment_profiles) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; - /v1/deployments: + const client = new Together(); + + const model = await client.beta.models.retrieveSupported("arch_abc123"); + console.log(model.name, model.deploymentProfiles); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + + const model = await client.beta.models.retrieveSupported("arch_abc123"); + console.log(model.name, model.deploymentProfiles); + + /deployments: get: description: Get a list of all deployments in your project summary: Get the list of deployments @@ -2908,6 +5902,37 @@ paths: application/json: schema: type: object + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + client = Together() + + deployments = client.beta.jig.list() + print(deployments) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + const client = new Together(); + + const deployments = await client.beta.jig.list(); + console.log(deployments); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + const client = new Together(); + + const deployments = await client.beta.jig.list(); + console.log(deployments); + - lang: Shell + label: cURL + source: | + curl -X GET \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + https://api.together.ai/v1/deployments post: description: Create a new deployment with specified configuration summary: Create a new deployment @@ -2938,8 +5963,45 @@ paths: application/json: schema: type: object - /v1/deployments/{id}: - delete: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + client = Together() + + deployment = client.beta.jig.deploy( + name="my-deployment", + gpu_type="h100-80gb", + image="registry.together.ai/proj_abcdefg1234567890/my-image:latest" + ) + print(deployment) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + const client = new Together(); + + const deployment = await client.beta.jig.deploy({ + name: "my-deployment", + gpu_type: "h100-80gb", + image: "registry.together.ai/proj_abcdefg1234567890/my-image:latest" + }); + console.log(deployment); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + const client = new Together(); + + const deployment = await client.beta.jig.deploy({ + name: "my-deployment", + gpu_type: "h100-80gb", + image: "registry.together.ai/proj_abcdefg1234567890/my-image:latest" + }); + console.log(deployment); + /deployments/{id}: + delete: description: Delete an existing deployment summary: Delete a deployment tags: ['Deployments'] @@ -2969,6 +6031,37 @@ paths: application/json: schema: type: object + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + client = Together() + + deployment = client.beta.jig.destroy("my-deployment") + print(deployment) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + const client = new Together(); + + const deployment = await client.beta.jig.destroy("my-deployment"); + console.log(deployment); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + const client = new Together(); + + const deployment = await client.beta.jig.destroy("my-deployment"); + console.log(deployment); + - lang: Shell + label: cURL + source: | + curl -X DELETE \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + https://api.together.ai/v1/deployments/my-deployment get: description: Retrieve details of a specific deployment by its ID or name summary: Get a deployment by ID or name @@ -2999,6 +6092,31 @@ paths: application/json: schema: type: object + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + client = Together() + + deployment = client.beta.jig.retrieve("my-deployment") + print(deployment) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + const client = new Together(); + + const deployment = await client.beta.jig.retrieve("my-deployment"); + console.log(deployment); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + const client = new Together(); + + const deployment = await client.beta.jig.retrieve("my-deployment"); + console.log(deployment); patch: description: Update an existing deployment configuration summary: Update a deployment @@ -3042,7 +6160,39 @@ paths: application/json: schema: type: object - /v1/deployments/{id}/logs: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + client = Together() + + deployment = client.beta.jig.update("my-deployment", gpu_count=2) + print(deployment) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + const client = new Together(); + + const deployment = await client.beta.jig.update("my-deployment", { gpu_count: 2 }); + console.log(deployment); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + const client = new Together(); + + const deployment = await client.beta.jig.update("my-deployment", { gpu_count: 2 }); + console.log(deployment); + - lang: Shell + label: cURL + source: | + curl -X PATCH \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + --data '{ "gpu_count": 2 }' \ + https://api.together.ai/v1/deployments/my-deployment + /deployments/{id}/logs: get: description: Retrieve logs from a deployment, optionally filtered by replica ID. summary: Get logs for a deployment @@ -3089,7 +6239,38 @@ paths: application/json: schema: type: object - /v1/deployments/{id}/revisions: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + client = Together() + + logs = client.beta.jig.retrieve_logs("my-deployment") + print(logs) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + const client = new Together(); + + const logs = await client.beta.jig.retrieveLogs("my-deployment"); + console.log(logs); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + const client = new Together(); + + const logs = await client.beta.jig.retrieveLogs("my-deployment"); + console.log(logs); + - lang: Shell + label: cURL + source: | + curl -X GET \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + https://api.together.ai/v1/deployments/my-deployment/logs + /deployments/{id}/revisions: get: description: |- Returns the revision history of the deployment, in descending order. Defaults to the most recent events. @@ -3138,7 +6319,7 @@ paths: application/json: schema: type: object - /v1/deployments/{id}/revisions/{revisionIdentifier}: + /deployments/{id}/revisions/{revisionIdentifier}: get: description: |- Returns the deployment configuration defined by the specified revision. @@ -3184,7 +6365,7 @@ paths: application/json: schema: type: object - /v1/deployments/{id}/rollback: + /deployments/{id}/rollback: post: description: |- Re-applies the spec of a previous revision. Pods running the target revision will be retained. Other pods will be drained and restarted with the target revision. @@ -3230,7 +6411,7 @@ paths: application/json: schema: type: object - /v1/deployments/secrets: + /deployments/secrets: get: description: Retrieve all secrets in your project summary: Get the list of project secrets @@ -3248,6 +6429,31 @@ paths: application/json: schema: type: object + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + client = Together() + + secrets = client.beta.jig.secrets.list() + print(secrets) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + const client = new Together(); + + const secrets = await client.beta.jig.secrets.list(); + console.log(secrets); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + const client = new Together(); + + const secrets = await client.beta.jig.secrets.list(); + console.log(secrets); post: description: Create a new secret to store sensitive configuration values summary: Create a new secret @@ -3278,7 +6484,36 @@ paths: application/json: schema: type: object - /v1/deployments/secrets/{id}: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + client = Together() + + client.beta.jig.secrets.create(name="my-secret", value="my-value") + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + const client = new Together(); + + await client.beta.jig.secrets.create({ name: "my-secret", value: "my-value" }); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + const client = new Together(); + + await client.beta.jig.secrets.create({ name: "my-secret", value: "my-value" }); + - lang: Shell + label: cURL + source: | + curl -X POST \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + --data '{ "name": "my-secret", "value": "my-value" }' \ + https://api.together.ai/v1/deployments/secrets + /deployments/secrets/{id}: delete: description: Delete an existing secret summary: Delete a secret @@ -3309,6 +6544,34 @@ paths: application/json: schema: type: object + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + client = Together() + + client.beta.jig.secrets.delete("my-secret") + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + const client = new Together(); + + await client.beta.jig.secrets.delete("my-secret"); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + const client = new Together(); + + await client.beta.jig.secrets.delete("my-secret"); + - lang: Shell + label: cURL + source: | + curl -X DELETE \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + https://api.together.ai/v1/deployments/secrets/my-secret get: description: Retrieve details of a specific secret by its ID or name summary: Get a secret by ID or name @@ -3339,6 +6602,37 @@ paths: application/json: schema: type: object + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + client = Together() + + secret = client.beta.jig.secrets.retrieve("my-secret") + print(secret) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + const client = new Together(); + + const secret = await client.beta.jig.secrets.retrieve("my-secret"); + console.log(secret); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + const client = new Together(); + + const secret = await client.beta.jig.secrets.retrieve("my-secret"); + console.log(secret); + - lang: Shell + label: cURL + source: | + curl -X GET \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + https://api.together.ai/v1/deployments/secrets/my-secret patch: description: Update an existing secret's value or metadata summary: Update a secret @@ -3383,7 +6677,36 @@ paths: application/json: schema: type: object - /v1/deployments/storage/{filename}: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + client = Together() + + client.beta.jig.secrets.update("my-secret", value="my-new-value") + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + const client = new Together(); + + await client.beta.jig.secrets.update("my-secret", { value: "my-new-value" }); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + const client = new Together(); + + await client.beta.jig.secrets.update("my-secret", { value: "my-new-value" }); + - lang: Shell + label: cURL + source: | + curl -X PATCH \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + --data '{ "value": "my-new-value" }' \ + https://api.together.ai/v1/deployments/secrets/my-secret + /deployments/storage/{filename}: get: description: Download a file by redirecting to a signed URL summary: Download a file @@ -3426,7 +6749,7 @@ paths: additionalProperties: type: string type: object - /v1/deployments/storage/{filename}/url: + /deployments/storage/{filename}/url: get: description: Create a signed URL for downloading a deployment storage file summary: Get a file download URL @@ -3469,7 +6792,7 @@ paths: additionalProperties: type: string type: object - /v1/deployments/storage/volumes: + /deployments/storage/volumes: get: description: Retrieve all volumes in your project summary: Get the list of project volumes @@ -3487,6 +6810,37 @@ paths: application/json: schema: type: object + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + client = Together() + + volumes = client.beta.jig.volumes.list() + print(volumes) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + const client = new Together(); + + const volumes = await client.beta.jig.volumes.list(); + console.log(volumes); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + const client = new Together(); + + const volumes = await client.beta.jig.volumes.list(); + console.log(volumes); + - lang: Shell + label: cURL + source: | + curl -X GET \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + https://api.together.ai/v1/deployments/storage/volumes post: description: Create a new volume to preload files in deployments summary: Create a new volume @@ -3517,7 +6871,60 @@ paths: application/json: schema: type: object - /v1/deployments/storage/volumes/{id}: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + + # Files uploaded under source_prefix are loaded into the volume. + # `tg beta jig volumes create` uploads them and creates the volume for you. + volume = client.beta.jig.volumes.create( + name="my-volume", + type="readOnly", + content={"type": "files", "source_prefix": "my-volume/0"}, + ) + print(volume.id) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + + // Files uploaded under source_prefix are loaded into the volume. + // `tg beta jig volumes create` uploads them and creates the volume for you. + const volume = await client.beta.jig.volumes.create({ + name: "my-volume", + type: "readOnly", + content: { type: "files", source_prefix: "my-volume/0" }, + }); + console.log(volume.id); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + + // Files uploaded under source_prefix are loaded into the volume. + // `tg beta jig volumes create` uploads them and creates the volume for you. + const volume = await client.beta.jig.volumes.create({ + name: "my-volume", + type: "readOnly", + content: { type: "files", source_prefix: "my-volume/0" }, + }); + console.log(volume.id); + - lang: Shell + label: cURL + source: | + curl -X POST \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + --data '{ "name": "my-volume", "type": "readOnly", "content": { "type": "files", "source_prefix": "my-volume/0" } }' \ + https://api.together.ai/v1/deployments/storage/volumes + /deployments/storage/volumes/{id}: delete: description: Delete an existing volume parameters: @@ -3549,6 +6956,31 @@ paths: summary: Delete a volume tags: - Volumes + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + + client.beta.jig.volumes.delete("my-volume") + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + + await client.beta.jig.volumes.delete("my-volume"); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + + await client.beta.jig.volumes.delete("my-volume"); get: description: Retrieve details of a specific volume by its ID or name parameters: @@ -3591,6 +7023,34 @@ paths: summary: Get a volume by ID or name tags: - Volumes + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + + volume = client.beta.jig.volumes.retrieve("my-volume") + print(volume) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + + const volume = await client.beta.jig.volumes.retrieve("my-volume"); + console.log(volume); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + + const volume = await client.beta.jig.volumes.retrieve("my-volume"); + console.log(volume); patch: description: Update an existing volume's configuration or contents parameters: @@ -3635,7 +7095,48 @@ paths: summary: Update a volume tags: - Volumes - /v1/voices: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + + # Point the volume at a new version of its files. The CLI's + # `tg beta jig volumes update` uploads the files and makes this call for you. + volume = client.beta.jig.volumes.update( + "my-volume", + content={"type": "files", "source_prefix": "my-volume/1"}, + ) + print(volume.current_version) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + + // Point the volume at a new version of its files. The CLI's + // `tg beta jig volumes update` uploads the files and makes this call for you. + const volume = await client.beta.jig.volumes.update("my-volume", { + content: { type: "files", source_prefix: "my-volume/1" }, + }); + console.log(volume.current_version); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + + // Point the volume at a new version of its files. The CLI's + // `tg beta jig volumes update` uploads the files and makes this call for you. + const volume = await client.beta.jig.volumes.update("my-volume", { + content: { type: "files", source_prefix: "my-volume/1" }, + }); + console.log(volume.current_version); + /voices: get: tags: ['Voices'] summary: Fetch available voices for each model @@ -3648,11 +7149,51 @@ paths: application/json: schema: $ref: '#/components/schemas/ListVoicesResponse' - /v2/videos/{id}: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + response = client.audio.voices.list() + + print(response.data) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const response = await client.audio.voices.list() + + console.log(response.data); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const response = await client.audio.voices.list() + + console.log(response.data); + /videos/{id}: get: tags: ['Video'] summary: Fetch video metadata description: Fetch video metadata + servers: + - url: https://api.together.ai/v2 operationId: retrieveVideo parameters: - in: path @@ -3672,12 +7213,52 @@ paths: description: Invalid request parameters. '404': description: Video ID not found. - /v2/videos: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + response = client.videos.retrieve("") + + print(response.status) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const response = await client.videos.retrieve(""); + + console.log(response.status); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const response = await client.videos.retrieve(""); + + console.log(response.status); + /videos: post: tags: ['Video'] summary: Create video description: Create a video operationId: createVideo + servers: + - url: https://api.together.ai/v2 requestBody: content: application/json: @@ -3690,14 +7271,59 @@ paths: application/json: schema: $ref: '#/components/schemas/VideoJob' - /v1/chat/completions: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + response = client.videos.create( + model="minimax/video-01-director", + prompt="A cartoon of an astronaut riding a horse on the moon" + ) + + print(response.id) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const response = await client.videos.create({ + model: "minimax/video-01-director", + prompt: "A cartoon of an astronaut riding a horse on the moon", + }); + + console.log(response.id); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const response = await client.videos.create({ + model: "minimax/video-01-director", + prompt: "A cartoon of an astronaut riding a horse on the moon", + }); + + console.log(response.id); + /chat/completions: post: tags: ['Chat'] summary: Create chat completion description: Generate a model response for a given chat conversation. Supports single queries and multi-turn conversations with system, user, and assistant messages. operationId: chat-completions - servers: - - url: https://api-inference.together.ai requestBody: content: application/json: @@ -3750,7 +7376,80 @@ paths: schema: $ref: '#/components/schemas/ErrorData' deprecated: false - /v1/completions: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + response = client.chat.completions.create( + model="Qwen/Qwen3.5-9B", + messages=[ + {"role": "system", "content": "You are a helpful assistant."}, + {"role": "user", "content": "What are some fun things to do in New York?"}, + ], + reasoning={"enabled": False}, + ) + + print(response.choices[0].message.content) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const response = await client.chat.completions.create({ + model: "Qwen/Qwen3.5-9B", + messages: [ + { role: "system", content: "You are a helpful assistant." }, + { role: "user", "content": "What are some fun things to do in New York?" }, + ], + reasoning: { enabled: false }, + }); + + console.log(response.choices[0].message?.content); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const response = await client.chat.completions.create({ + model: "Qwen/Qwen3.5-9B", + messages: [ + { role: "system", content: "You are a helpful assistant." }, + { role: "user", "content": "What are some fun things to do in New York?" }, + ], + reasoning: { enabled: false }, + }); + + console.log(response.choices[0].message?.content); + - lang: Shell + label: cURL + source: | + curl -X POST "https://api.together.ai/v1/chat/completions" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + -H "Content-Type: application/json" \ + -d '{ + "model": "Qwen/Qwen3.5-9B", + "messages": [ + {"role": "system", "content": "You are a helpful assistant."}, + {"role": "user", "content": "What are some fun things to do in New York?"} + ], + "reasoning": {"enabled": false} + }' + /completions: post: tags: ['Completion'] summary: Create completion @@ -3808,7 +7507,68 @@ paths: schema: $ref: '#/components/schemas/ErrorData' deprecated: false - /v1/embeddings: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + response = client.completions.create( + model="Qwen/Qwen3.5-9B", + prompt="The largest city in France is", + max_tokens=1 + ) + + print(response.choices[0].text) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const response = await client.completions.create({ + model: "Qwen/Qwen3.5-9B", + prompt: "The largest city in France is", + max_tokens: 1, + }); + + console.log(response.choices[0].text); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const response = await client.completions.create({ + model: "Qwen/Qwen3.5-9B", + prompt: "The largest city in France is", + max_tokens: 1, + }); + + console.log(response.choices[0].text); + - lang: Shell + label: cURL + source: | + curl -X POST "https://api.together.ai/v1/completions" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + -H "Content-Type: application/json" \ + -d '{ + "model": "Qwen/Qwen3.5-9B", + "prompt": "The largest city in France is", + "max_tokens": 1 + }' + /embeddings: post: tags: ['Embeddings'] summary: Create embedding @@ -3863,7 +7623,337 @@ paths: schema: $ref: '#/components/schemas/ErrorData' deprecated: false - /v1/images/generations: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + response = client.embeddings.create( + model="BAAI/bge-large-en-v1.5", + input="New York City", + ) + + print(response.data[0].embedding) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const response = await client.embeddings.create({ + model: "BAAI/bge-large-en-v1.5", + input: "New York City", + }); + + console.log(response.data[0].embedding); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const response = await client.embeddings.create({ + model: "BAAI/bge-large-en-v1.5", + input: "New York City", + }); + + console.log(response.data[0].embedding); + - lang: Shell + label: cURL + source: | + curl -X POST "https://api.together.ai/v1/embeddings" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + -H "Content-Type: application/json" \ + -d '{ + "model": "BAAI/bge-large-en-v1.5", + "input": "New York City" + }' + /models: + get: + tags: ['Models'] + summary: List all models + description: Lists all of Together's open-source models and metadata including pricing, chat template, and context. + operationId: models + parameters: + - name: dedicated + in: query + schema: + description: Filter models to only return dedicated models + type: boolean + responses: + '200': + description: '200' + content: + application/json: + schema: + $ref: '#/components/schemas/ModelInfoList' + '400': + description: 'BadRequest' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + '401': + description: 'Unauthorized' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + '404': + description: 'NotFound' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + '429': + description: 'RateLimit' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + '504': + description: 'Timeout' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + deprecated: false + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + models = client.models.list() + + for model in models: + print(model.id) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const models = await client.models.list(); + + for (const model of models) { + console.log(model.id); + } + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const models = await client.models.list(); + + for (const model of models) { + console.log(model.id); + } + - lang: Shell + label: cURL + source: | + curl "https://api.together.ai/v1/models" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + -H "Content-Type: application/json" + post: + tags: ['Models'] + summary: Upload a custom model or adapter + description: Upload a custom model or adapter from Hugging Face or S3 + operationId: uploadModel + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ModelUploadRequest' + responses: + '200': + description: Model / adapter upload job created successfully + content: + application/json: + schema: + $ref: '#/components/schemas/ModelUploadSuccessResponse' + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + response = client.models.upload( + model_name="My-Fine-Tuned-Model", + model_source="https://ml-models.s3.us-west-2.amazonaws.com/models/my-fine-tuned-model.tar.gz", + ) + + print(response.data.job_id) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const response = await client.models.upload({ + model_name: "My-Fine-Tuned-Model", + model_source: "https://ml-models.s3.us-west-2.amazonaws.com/models/my-fine-tuned-model.tar.gz", + }) + + console.log(response); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const response = await client.models.upload({ + model_name: "My-Fine-Tuned-Model", + model_source: "https://ml-models.s3.us-west-2.amazonaws.com/models/my-fine-tuned-model.tar.gz", + }) + + console.log(response); + - lang: Shell + label: cURL + source: | + curl -X POST "https://api.together.ai/v1/models" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + -H "Content-Type: application/json" \ + -d '{ + "model_name": "My-Fine-Tuned-Model", + "model_source": "https://ml-models.s3.us-west-2.amazonaws.com/models/my-fine-tuned-model.tar.gz" + }' + + /jobs/{jobId}: + get: + tags: ['Jobs'] + summary: Get job status + description: Get the status of a specific job + operationId: getJob + parameters: + - name: jobId + in: path + required: true + schema: + example: job-a15dad11-8d8e-4007-97c5-a211304de284 + description: The ID of the job to retrieve + type: string + responses: + '200': + description: Job status retrieved successfully + content: + application/json: + schema: + $ref: '#/components/schemas/JobInfoSuccessResponse' + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + + status = client.models.uploads.status("") + print(status) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + + const status = await client.models.uploads.status(""); + console.log(status); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + + const status = await client.models.uploads.status(""); + console.log(status); + + /jobs: + get: + tags: ['Jobs'] + summary: List all jobs + description: List all jobs and their statuses + operationId: listJobs + responses: + '200': + description: Jobs retrieved successfully + content: + application/json: + schema: + $ref: '#/components/schemas/JobsInfoSuccessResponse' + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + + # The SDK has no dedicated method for this endpoint yet, so call it with + # the client's generic GET helper. + jobs = client.get("/jobs", cast_to=object) + print(jobs) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + + // The SDK has no dedicated method for this endpoint yet, so call it with + // the client's generic GET helper. + const jobs = await client.get("/jobs"); + console.log(jobs); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + + // The SDK has no dedicated method for this endpoint yet, so call it with + // the client's generic GET helper. + const jobs = await client.get("/jobs"); + console.log(jobs); + + /images/generations: post: tags: ['Images'] summary: Create image @@ -3965,7 +8055,64 @@ paths: application/json: schema: $ref: '#/components/schemas/ImageResponse' - /v1/files: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + response = client.images.generate( + model="black-forest-labs/FLUX.2-dev", + prompt="A cartoon of an astronaut riding a horse on the moon", + ) + + print(response.data[0].url) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const response = await client.images.generate({ + model: "black-forest-labs/FLUX.2-dev", + prompt: "A cartoon of an astronaut riding a horse on the moon", + }); + + console.log(response.data[0].url); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const response = await client.images.generate({ + model: "black-forest-labs/FLUX.2-dev", + prompt: "A cartoon of an astronaut riding a horse on the moon", + }); + + console.log(response.data[0].url); + - lang: Shell + label: cURL + source: | + curl -X POST "https://api.together.ai/v1/images/generations" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + -H "Content-Type: application/json" \ + -d '{ + "model": "black-forest-labs/FLUX.2-dev", + "prompt": "A cartoon of an astronaut riding a horse on the moon" + }' + /files: get: tags: ['Files'] summary: List all files @@ -3977,7 +8124,56 @@ paths: application/json: schema: $ref: '#/components/schemas/FileList' - /v1/files/{id}: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + response = client.files.list() + + for file in response.data: + print(file.id) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const response = await client.files.list(); + + for (const file of response.data) { + console.log(file.id); + } + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const response = await client.files.list(); + + for (const file of response.data) { + console.log(file.id); + } + - lang: Shell + label: cURL + source: | + curl "https://api.together.ai/v1/files" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + -H "Content-Type: application/json" + /files/{id}: get: tags: ['Files'] summary: Retrieve file metadata @@ -3996,6 +8192,50 @@ paths: application/json: schema: $ref: '#/components/schemas/FileResponse' + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + file = client.files.retrieve(id="") + + print(file) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const file = await client.files.retrieve(""); + + console.log(file); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const file = await client.files.retrieve(""); + + console.log(file); + - lang: Shell + label: cURL + source: | + curl "https://api.together.ai/v1/files/" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + -H "Content-Type: application/json" delete: tags: ['Files'] summary: Delete a file @@ -4014,11 +8254,54 @@ paths: application/json: schema: $ref: '#/components/schemas/FileDeleteResponse' - /v1/files/{id}/content: - get: - tags: ['Files'] - summary: Get file contents - description: Get the contents of a single uploaded data file. + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + response = client.files.delete(id="") + + print(response) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const response = await client.files.delete(""); + + console.log(response); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const response = await client.files.delete(""); + + console.log(response); + - lang: Shell + label: cURL + source: | + curl -X "DELETE" "https://api.together.ai/v1/files/" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" + /files/{id}/content: + get: + tags: ['Files'] + summary: Get file contents + description: Get the contents of a single uploaded data file. parameters: - name: id in: path @@ -4040,7 +8323,53 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' - /v1/files/upload: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + with client.files.with_streaming_response.content(id="") as response: + for line in response.iter_lines(): + print(line) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const response = await client.files.content(""); + const content = await response.text(); + + console.log(content); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const response = await client.files.content(""); + const content = await response.text(); + + console.log(content); + - lang: Shell + label: cURL + source: | + curl "https://api.together.ai/v1/files//content" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + -H "Content-Type: application/json" + /files/upload: post: tags: ['Files'] summary: Upload a file @@ -4093,7 +8422,51 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' - /v1/fine-tunes: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + current_dir = os.path.dirname(os.path.abspath(__file__)) + file_path = os.path.join(current_dir, "data.jsonl") + file = client.files.upload(file=file_path) + + print(file.id) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + + const file = await client.files.upload("data.jsonl", "fine-tune"); + + console.log(file.id); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + + const file = await client.files.upload("data.jsonl", "fine-tune"); + + console.log(file.id); + - lang: Shell + label: cURL + source: | + curl "https://api.together.ai/v1/files/upload" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + -F "file=@/path/to/data.jsonl" \ + -F "file_name=data.jsonl" \ + -F "purpose=fine-tune" + /fine-tunes: post: tags: ['Fine-tuning'] summary: Create job @@ -4218,6 +8591,16 @@ paths: wandb_entity: type: string description: The Weights & Biases entity for your run. + train_on_inputs: + oneOf: + - type: boolean + - type: string + enum: + - auto + type: boolean + default: auto + description: Whether to mask user messages in conversational data or prompts in instruction data. + deprecated: true training_method: type: object oneOf: @@ -4262,6 +8645,63 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + response = client.fine_tuning.create( + model="meta-llama/Meta-Llama-3.1-8B-Instruct-Reference", + training_file="" + ) + + print(response) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const response = await client.fineTuning.create({ + model: "meta-llama/Meta-Llama-3.1-8B-Instruct-Reference", + training_file: "", + }); + + console.log(response); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const response = await client.fineTuning.create({ + model: "meta-llama/Meta-Llama-3.1-8B-Instruct-Reference", + training_file: "", + }); + + console.log(response); + - lang: Shell + label: cURL + source: | + curl -X POST "https://api.together.ai/v1/fine-tunes" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + -H "Content-Type: application/json" \ + -d '{ + "model": "meta-llama/Meta-Llama-3.1-8B-Instruct-Reference", + "training_file": "" + }' get: tags: ['Fine-tuning'] summary: List all jobs @@ -4273,7 +8713,56 @@ paths: application/json: schema: $ref: '#/components/schemas/FinetuneTruncatedList' - /v1/fine-tunes/estimate-price: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + response = client.fine_tuning.list() + + for fine_tune in response.data: + print(f"ID: {fine_tune.id}, Status: {fine_tune.status}") + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const response = await client.fineTuning.list(); + + for (const fineTune of response.data) { + console.log(fineTune.id, fineTune.status); + } + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const response = await client.fineTuning.list(); + + for (const fineTune of response.data) { + console.log(fineTune.id, fineTune.status); + } + - lang: Shell + label: cURL + source: | + curl "https://api.together.ai/v1/fine-tunes" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + -H "Content-Type: application/json" + /fine-tunes/estimate-price: post: tags: ['Fine-tuning'] summary: Estimate price @@ -4381,7 +8870,53 @@ paths: - train_file_invalid - eval_file_invalid example: multimodal_dataset - /v1/fine-tunes/preview: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + + estimate = client.fine_tuning.estimate_price( + training_file="", + model="meta-llama/Meta-Llama-3.1-8B-Instruct-Reference", + n_epochs=3, + training_method={"method": "sft", "train_on_inputs": "auto"}, + training_type={"type": "Lora", "lora_r": 8, "lora_alpha": 16}, + ) + print(estimate) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + + const estimate = await client.fineTuning.estimatePrice({ + training_file: "", + model: "meta-llama/Meta-Llama-3.1-8B-Instruct-Reference", + n_epochs: 3, + training_method: { method: "sft", train_on_inputs: "auto" }, + training_type: { type: "Lora", lora_r: 8, lora_alpha: 16 }, + }); + console.log(estimate); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + + const estimate = await client.fineTuning.estimatePrice({ + training_file: "", + model: "meta-llama/Meta-Llama-3.1-8B-Instruct-Reference", + n_epochs: 3, + training_method: { method: "sft", train_on_inputs: "auto" }, + training_type: { type: "Lora", lora_r: 8, lora_alpha: 16 }, + }); + console.log(estimate); + /fine-tunes/preview: post: tags: ['Fine-tuning'] summary: Preview tokenized data @@ -4437,7 +8972,44 @@ paths: application/json: schema: $ref: '#/components/schemas/FineTunePreviewDetailError' - /v1/fine-tunes/{id}: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + + preview = client.fine_tuning.preview( + model="meta-llama/Meta-Llama-3.1-8B-Instruct-Reference", + training_file="", + ) + print(preview) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + + const preview = await client.fineTuning.preview({ + model: "meta-llama/Meta-Llama-3.1-8B-Instruct-Reference", + training_file: "", + }); + console.log(preview); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + + const preview = await client.fineTuning.preview({ + model: "meta-llama/Meta-Llama-3.1-8B-Instruct-Reference", + training_file: "", + }); + console.log(preview); + /fine-tunes/{id}: get: tags: ['Fine-tuning'] summary: List job @@ -4456,6 +9028,50 @@ paths: application/json: schema: $ref: '#/components/schemas/FinetuneResponse' + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + fine_tune = client.fine_tuning.retrieve(id="") + + print(fine_tune) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const fineTune = await client.fineTuning.retrieve(""); + + console.log(fineTune); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const fineTune = await client.fineTuning.retrieve(""); + + console.log(fineTune); + - lang: Shell + label: cURL + source: | + curl "https://api.together.ai/v1/fine-tunes/" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + -H "Content-Type: application/json" delete: tags: ['Fine-tuning'] summary: Delete a fine-tune job @@ -4467,6 +9083,13 @@ paths: schema: description: The ID of the fine-tune job to delete type: string + - name: force + deprecated: true + in: query + schema: + description: Deprecated and unused parameter. + type: boolean + default: false responses: '200': description: Fine-tune job deleted successfully @@ -4486,7 +9109,51 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' - /v1/fine-tunes/{id}/events: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + response = client.fine_tuning.delete(id="") + + print(response) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const response = await client.fineTuning.delete(""); + + console.log(response); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const response = await client.fineTuning.delete(""); + + console.log(response); + - lang: Shell + label: cURL + source: | + curl -X "DELETE" "https://api.together.ai/v1/fine-tunes/?force=false" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + -H "Content-Type: application/json" + /fine-tunes/{id}/events: get: tags: ['Fine-tuning'] summary: List job events @@ -4505,7 +9172,52 @@ paths: application/json: schema: $ref: '#/components/schemas/FinetuneListEvents' - /v1/fine-tunes/{id}/checkpoints: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + response = client.fine_tuning.list_events(id="") + + for event in response.data: + print(event) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const events = await client.fineTuning.listEvents(""); + + console.log(events); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const events = await client.fineTuning.listEvents(""); + + console.log(events); + - lang: Shell + label: cURL + source: | + curl "https://api.together.ai/v1/fine-tunes//events" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + -H "Content-Type: application/json" + /fine-tunes/{id}/checkpoints: get: tags: ['Fine-tuning'] summary: List checkpoints @@ -4524,7 +9236,51 @@ paths: application/json: schema: $ref: '#/components/schemas/FinetuneListCheckpoints' - /v1/fine-tunes/{id}/download-tokenized-dataset: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + checkpoints = client.fine_tuning.list_checkpoints(id="") + + print(checkpoints) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const checkpoints = await client.fineTuning.listCheckpoints(""); + + console.log(checkpoints); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const checkpoints = await client.fineTuning.listCheckpoints(""); + + console.log(checkpoints); + - lang: Shell + label: cURL + source: | + curl "https://api.together.ai/v1/fine-tunes//checkpoints" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + -H "Content-Type: application/json" + /fine-tunes/{id}/download-tokenized-dataset: get: tags: ['Fine-tuning'] summary: Download tokenized dataset @@ -4549,7 +9305,61 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' - /v1/finetune/download: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + tokenized_dataset = client.fine_tuning.retrieve_tokenized_dataset( + id="", + ) + + print(tokenized_dataset.url) + print(tokenized_dataset.filename) + print(tokenized_dataset.size) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const tokenizedDataset = + await client.fineTuning.retrieveTokenizedDataset(""); + + console.log(tokenizedDataset.url); + console.log(tokenizedDataset.filename); + console.log(tokenizedDataset.size); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const tokenizedDataset = + await client.fineTuning.retrieveTokenizedDataset(""); + + console.log(tokenizedDataset.url); + console.log(tokenizedDataset.filename); + console.log(tokenizedDataset.size); + - lang: Shell + label: cURL + source: | + curl "https://api.together.ai/v1/fine-tunes//download-tokenized-dataset" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + -H "Content-Type: application/json" + /finetune/download: get: tags: ['Fine-tuning'] summary: Download model @@ -4588,7 +9398,58 @@ paths: description: Invalid request parameters. '404': description: Fine-tune ID not found. - /v1/fine-tunes/{id}/cancel: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + # Using `with_streaming_response` gives you control to do what you want with the response. + stream = client.fine_tuning.with_streaming_response.content(ft_id="") + + with stream as response: + for line in response.iter_lines(): + print(line) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const response = await client.fineTuning.content({ + ft_id: "", + }); + + console.log(await response.blob()); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const response = await client.fineTuning.content({ + ft_id: "", + }); + + console.log(await response.blob()); + - lang: Shell + label: cURL + source: | + curl "https://api.together.ai/v1/finetune/download?ft_id=&checkpoint=merged" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + -H "Content-Type: application/json" + /fine-tunes/{id}/cancel: post: tags: ['Fine-tuning'] summary: Cancel job @@ -4611,7 +9472,51 @@ paths: description: Invalid request parameters. '404': description: Fine-tune ID not found. - /v1/fine-tunes/{id}/metrics: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + response = client.fine_tuning.cancel(id="") + + print(response) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const response = await client.fineTuning.cancel(""); + + console.log(response); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const response = await client.fineTuning.cancel(""); + + console.log(response); + - lang: Shell + label: cURL + source: | + curl -X POST "https://api.together.ai/v1/fine-tunes//cancel" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + -H "Content-Type: application/json" + /fine-tunes/{id}/metrics: get: tags: ['Fine-tuning'] summary: Get metrics @@ -4693,7 +9598,50 @@ paths: description: Fine-tune job not found. '500': description: 'Internal server error: failed to retrieve metrics.' - /v1/fine-tunes/models/supported: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + + metrics = client.fine_tuning.list_metrics( + "", + global_step_from=0, + global_step_to=500, + ) + print(metrics) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + + const metrics = await client.fineTuning.listMetrics("", { + global_step_from: 0, + global_step_to: 500, + }); + console.log(metrics); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + + const metrics = await client.fineTuning.listMetrics("", { + global_step_from: 0, + global_step_to: 500, + }); + console.log(metrics); + - lang: Shell + label: cURL + source: | + curl -X GET "https://api.together.ai/v1/fine-tunes//metrics?global_step_from=0&global_step_to=500" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" + /fine-tunes/models/supported: get: tags: ['Fine-tuning'] summary: List supported models @@ -4729,7 +9677,46 @@ paths: type: string description: Parent model used for fine-tuning. description: Supported models with parent model details. - /v1/fine-tunes/models/limits: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + + # The SDK has no dedicated method for this endpoint yet, so call it with + # the client's generic GET helper. + models = client.get("/fine-tunes/models/supported", cast_to=object) + print(models) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + + // The SDK has no dedicated method for this endpoint yet, so call it with + // the client's generic GET helper. + const models = await client.get("/fine-tunes/models/supported"); + console.log(models); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + + // The SDK has no dedicated method for this endpoint yet, so call it with + // the client's generic GET helper. + const models = await client.get("/fine-tunes/models/supported"); + console.log(models); + - lang: Shell + label: cURL (list all) + source: | + curl "https://api.together.ai/v1/fine-tunes/models/supported" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" + /fine-tunes/models/limits: get: tags: ['Fine-tuning'] summary: Get model limits @@ -4758,7 +9745,46 @@ paths: message: type: string description: Error message explaining the model is not available. - /v1/shaping: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + + limits = client.fine_tuning.model_limits( + model_name="meta-llama/Meta-Llama-3.1-8B-Instruct-Reference", + ) + print(limits) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + + const limits = await client.fineTuning.modelLimits({ + model_name: "meta-llama/Meta-Llama-3.1-8B-Instruct-Reference", + }); + console.log(limits); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + + const limits = await client.fineTuning.modelLimits({ + model_name: "meta-llama/Meta-Llama-3.1-8B-Instruct-Reference", + }); + console.log(limits); + - lang: Shell + label: cURL + source: | + curl "https://api.together.ai/v1/fine-tunes/models/limits?model_name=meta-llama/Meta-Llama-3.1-8B-Instruct-Reference" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" + /shaping: get: tags: ['Shaping'] summary: List shaping jobs @@ -4783,12 +9809,23 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' - /v1/shaping/prepare-for-fp4-inference: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + + jobs = client.post_training.prepare_for_fp4_inference.list() + for job in jobs.data: + print(job.id, job.status) + /shaping/prepare-for-fp4-inference: post: tags: ['Shaping'] summary: Prepare a fine-tuned model for FP4 inference description: > - Prepares a fine-tuned model for FP4 inference: an adapter is merged into its base model and the result quantized to FP4; a full model is quantized as it is. The model is resolved when the request is made, so a request naming a model that does not exist in the project, was not produced by fine-tuning, has no base model, or uses an unsupported base model is rejected with 400 rather than accepted and failed later. The request names the model by `model_object_id` (the deprecated `adapter_object_id` is still accepted). The run is priced before it is created, and a project that cannot cover it is answered 402. + Merges a fine-tuned adapter into its base model and prepares the result for FP4 inference. The adapter is resolved when the request is made, so a request naming a model that does not exist in the project, is not an adapter, was not produced by fine-tuning, has no base model to merge into, or uses an unsupported base model is rejected with 400 rather than accepted and failed later. The run is priced before it is created, and a project that cannot cover it is answered 402. operationId: createQuantizationJob requestBody: required: true @@ -4839,12 +9876,27 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' - /v1/shaping/prepare-for-fp4-inference/estimate: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + + job = client.post_training.prepare_for_fp4_inference.create( + inputs={ + "adapter_object_id": "ml_abc123", + "adapter_revision_id": "rv_abc123", + }, + ) + print(job.id, job.status) + /shaping/prepare-for-fp4-inference/estimate: post: tags: ['Shaping'] summary: Estimate FP4 preparation cost description: > - Reports the price and expected wall-clock time for preparing the model named by `model_object_id` or the deprecated `adapter_object_id` without creating a job. The request body is the same as POST /shaping/prepare-for-fp4-inference, so a caller can price exactly the job it is about to submit. + Reports the price and expected wall-clock time for preparing the named adapter without creating a job. The request body is the same as POST /shaping/prepare-for-fp4-inference, so a caller can price exactly the job it is about to submit. operationId: estimateQuantizationJob requestBody: required: true @@ -4883,7 +9935,22 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' - /v1/shaping/{id}: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + + estimate = client.post_training.prepare_for_fp4_inference.estimate_cost( + inputs={ + "adapter_object_id": "ml_abc123", + "adapter_revision_id": "rv_abc123", + }, + ) + print(estimate.price_usd, estimate.time_hours, estimate.allowed_to_proceed) + /shaping/{id}: get: tags: ['Shaping'] summary: Get shaping job @@ -4922,7 +9989,17 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' - /v1/shaping/{id}/cancel: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + + job = client.post_training.prepare_for_fp4_inference.retrieve("") + print(job.status) + /shaping/{id}/cancel: post: tags: ['Shaping'] summary: Cancel shaping job @@ -4967,7 +10044,17 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' - /v1/shaping/{id}/events: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + + job = client.post_training.prepare_for_fp4_inference.cancel("") + print(job.status) + /shaping/{id}/events: get: tags: ['Shaping'] summary: List shaping job events @@ -5006,7 +10093,20 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' - /v1/rerank: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + + events = client.post_training.prepare_for_fp4_inference.list_events( + "", + ) + for event in events.data: + print(event) + /rerank: post: tags: ['Rerank'] summary: Create a rerank request @@ -5061,7 +10161,147 @@ paths: schema: $ref: '#/components/schemas/ErrorData' deprecated: false - /v1/audio/speech: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + documents = [ + { + "title": "Llama", + "text": "The llama is a domesticated South American camelid, widely used as a meat and pack animal by Andean cultures since the pre-Columbian era." + }, + { + "title": "Panda", + "text": "The giant panda (Ailuropoda melanoleuca), also known as the panda bear or simply panda, is a bear species endemic to China." + }, + { + "title": "Guanaco", + "text": "The guanaco is a camelid native to South America, closely related to the llama. Guanacos are one of two wild South American camelids; the other species is the vicuña, which lives at higher elevations." + }, + { + "title": "Wild Bactrian camel", + "text": "The wild Bactrian camel (Camelus ferus) is an endangered species of camel endemic to Northwest China and southwestern Mongolia." + } + ] + + response = client.rerank.create( + model="mixedbread-ai/mxbai-rerank-large-v2", + query="What animals can I find near Peru?", + documents=documents, + ) + + for result in response.results: + print(f"Rank: {result.index + 1}") + print(f"Title: {documents[result.index]['title']}") + print(f"Text: {documents[result.index]['text']}") + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const documents = [{ + "title": "Llama", + "text": "The llama is a domesticated South American camelid, widely used as a meat and pack animal by Andean cultures since the pre-Columbian era." + }, + { + "title": "Panda", + "text": "The giant panda (Ailuropoda melanoleuca), also known as the panda bear or simply panda, is a bear species endemic to China." + }, + { + "title": "Guanaco", + "text": "The guanaco is a camelid native to South America, closely related to the llama. Guanacos are one of two wild South American camelids; the other species is the vicuña, which lives at higher elevations." + }, + { + "title": "Wild Bactrian camel", + "text": "The wild Bactrian camel (Camelus ferus) is an endangered species of camel endemic to Northwest China and southwestern Mongolia." + }]; + + const response = await client.rerank.create({ + model: "mixedbread-ai/mxbai-rerank-large-v2", + query: "What animals can I find near Peru?", + documents, + }); + + for (const result of response.results) { + console.log(`Rank: ${result.index + 1}`); + console.log(`Title: ${documents[result.index].title}`); + console.log(`Text: ${documents[result.index].text}`); + } + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const documents = [{ + "title": "Llama", + "text": "The llama is a domesticated South American camelid, widely used as a meat and pack animal by Andean cultures since the pre-Columbian era." + }, + { + "title": "Panda", + "text": "The giant panda (Ailuropoda melanoleuca), also known as the panda bear or simply panda, is a bear species endemic to China." + }, + { + "title": "Guanaco", + "text": "The guanaco is a camelid native to South America, closely related to the llama. Guanacos are one of two wild South American camelids; the other species is the vicuña, which lives at higher elevations." + }, + { + "title": "Wild Bactrian camel", + "text": "The wild Bactrian camel (Camelus ferus) is an endangered species of camel endemic to Northwest China and southwestern Mongolia." + }]; + + const response = await client.rerank.create({ + model: "mixedbread-ai/mxbai-rerank-large-v2", + query: "What animals can I find near Peru?", + documents, + }); + + for (const result of response.results) { + console.log(`Rank: ${result.index + 1}`); + console.log(`Title: ${documents[result.index].title}`); + console.log(`Text: ${documents[result.index].text}`); + } + - lang: Shell + label: cURL + source: | + curl -X POST "https://api.together.ai/v1/rerank" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + -H "Content-Type: application/json" \ + -d '{ + "model": "mixedbread-ai/mxbai-rerank-large-v2", + "query": "What animals can I find near Peru?", + "documents": [{ + "title": "Llama", + "text": "The llama is a domesticated South American camelid, widely used as a meat and pack animal by Andean cultures since the pre-Columbian era." + }, + { + "title": "Panda", + "text": "The giant panda (Ailuropoda melanoleuca), also known as the panda bear or simply panda, is a bear species endemic to China." + }, + { + "title": "Guanaco", + "text": "The guanaco is a camelid native to South America, closely related to the llama. Guanacos are one of two wild South American camelids; the other species is the vicuña, which lives at higher elevations." + }, + { + "title": "Wild Bactrian camel", + "text": "The wild Bactrian camel (Camelus ferus) is an endangered species of camel endemic to Northwest China and southwestern Mongolia." + }] + }' + /audio/speech: post: tags: ['Audio'] summary: Create audio generation request @@ -5103,7 +10343,86 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' - /v1/audio/speech/websocket: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + response = client.audio.speech.with_streaming_response.create( + model="cartesia/sonic-2", + input="The quick brown fox jumps over the lazy dog.", + voice="laidback woman", + ) + + with response as stream: + stream.stream_to_file("audio.wav") + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + import { createWriteStream } from "fs"; + import { join } from "path"; + import { pipeline } from "stream/promises"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const response = await client.audio.speech.create({ + model: "cartesia/sonic-2", + input: "The quick brown fox jumps over the lazy dog.", + voice: "laidback woman", + }); + + const filepath = join(process.cwd(), "audio.wav"); + const writeStream = createWriteStream(filepath); + + if (response.body) { + await pipeline(response.body, writeStream); + } + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + import { createWriteStream } from "fs"; + import { join } from "path"; + import { pipeline } from "stream/promises"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const response = await client.audio.speech.create({ + model: "cartesia/sonic-2", + input: "The quick brown fox jumps over the lazy dog.", + voice: "laidback woman", + }); + + const filepath = join(process.cwd(), "audio.wav"); + const writeStream = createWriteStream(filepath); + + if (response.body) { + await pipeline(response.body, writeStream); + } + - lang: Shell + label: cURL + source: | + curl -X POST "https://api.together.ai/v1/audio/speech" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + -H "Content-Type: application/json" \ + -d '{ + "model": "cartesia/sonic-2", + "input": "The quick brown fox jumps over the lazy dog.", + "voice": "laidback woman" + }' \ + --output audio.wav + /audio/speech/websocket: get: tags: ['Audio'] summary: Real-time text-to-speech via WebSocket @@ -5271,7 +10590,162 @@ paths: } } ``` - /v1/audio/transcriptions: + x-codeSamples: + - lang: Python + label: Python WebSocket Client + source: | + import asyncio + import websockets + import json + import base64 + import os + + async def generate_speech(): + api_key = os.environ.get("TOGETHER_API_KEY") + url = "wss://api.together.ai/v1/audio/speech/websocket?model=hexgrad/Kokoro-82M&voice=af_heart" + + headers = { + "Authorization": f"Bearer {api_key}" + } + + async with websockets.connect(url, additional_headers=headers) as ws: + # Wait for session created + session_msg = await ws.recv() + session_data = json.loads(session_msg) + if session_data.get("type") != "session.created": + print(f"Failed to start session: {session_data}") + return + print(f"Session created: {session_data['session']['id']}") + + # Send text for TTS + text_chunks = [ + "Hello, this is a test.", + "This is the second sentence.", + "And this is the final one." + ] + + async def send_text(): + for chunk in text_chunks: + await ws.send(json.dumps({ + "type": "input_text_buffer.append", + "text": chunk + })) + await asyncio.sleep(0.5) # Simulate typing + + # Commit to process any remaining text + await ws.send(json.dumps({ + "type": "input_text_buffer.commit" + })) + + async def receive_audio(): + audio_data = bytearray() + async for message in ws: + data = json.loads(message) + + if data["type"] == "conversation.item.input_text.received": + print(f"Text received: {data['text']}") + elif data["type"] == "conversation.item.audio_output.delta": + # Decode base64 audio chunk + audio_chunk = base64.b64decode(data['delta']) + audio_data.extend(audio_chunk) + print(f"Received audio chunk for item {data['item_id']}") + elif data["type"] == "conversation.item.audio_output.done": + print(f"Audio generation complete for item {data['item_id']}") + break + elif data["type"] == "conversation.item.tts.failed": + error = data.get("error", {}) + print(f"Error: {error.get('message')}") + break + + # Save the raw PCM samples to a file + with open("output.pcm", "wb") as f: + f.write(audio_data) + print("Audio saved to output.pcm") + + # Run send and receive concurrently + await asyncio.gather(send_text(), receive_audio()) + + asyncio.run(generate_speech()) + - lang: JavaScript + label: Node.js WebSocket Client + source: | + import WebSocket from 'ws'; + import fs from 'fs'; + + const apiKey = process.env.TOGETHER_API_KEY; + const url = 'wss://api.together.ai/v1/audio/speech/websocket?model=hexgrad/Kokoro-82M&voice=af_heart'; + + const ws = new WebSocket(url, { + headers: { + 'Authorization': `Bearer ${apiKey}` + } + }); + + const audioData = []; + + ws.on('open', () => { + console.log('WebSocket connection established!'); + }); + + ws.on('message', (data) => { + const message = JSON.parse(data.toString()); + + if (message.type === 'session.created') { + console.log(`Session created: ${message.session.id}`); + + // Send text chunks + const textChunks = [ + "Hello, this is a test.", + "This is the second sentence.", + "And this is the final one." + ]; + + textChunks.forEach((text, index) => { + setTimeout(() => { + ws.send(JSON.stringify({ + type: 'input_text_buffer.append', + text: text + })); + }, index * 500); + }); + + // Commit after all chunks + setTimeout(() => { + ws.send(JSON.stringify({ + type: 'input_text_buffer.commit' + })); + }, textChunks.length * 500 + 100); + + } else if (message.type === 'conversation.item.input_text.received') { + console.log(`Text received: ${message.text}`); + } else if (message.type === 'conversation.item.audio_output.delta') { + // Decode base64 audio chunk + const audioChunk = Buffer.from(message.delta, 'base64'); + audioData.push(audioChunk); + console.log(`Received audio chunk for item ${message.item_id}`); + } else if (message.type === 'conversation.item.audio_output.done') { + console.log(`Audio generation complete for item ${message.item_id}`); + ws.close(); + } else if (message.type === 'conversation.item.tts.failed') { + const errorMessage = message.error?.message ?? 'Unknown error'; + console.error(`Error: ${errorMessage}`); + ws.close(); + } + }); + + ws.on('close', () => { + // Save the raw PCM samples to a file + if (audioData.length > 0) { + const completeAudio = Buffer.concat(audioData); + fs.writeFileSync('output.pcm', completeAudio); + console.log('Audio saved to output.pcm'); + } + }); + + ws.on('error', (error) => { + console.error('WebSocket error:', error); + }); + /audio/transcriptions: post: tags: ['Audio'] summary: Create audio transcription request @@ -5316,7 +10790,76 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' - /v1/audio/translations: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + import os + + from together import Together + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + file = open("audio.wav", "rb") + + response = client.audio.transcriptions.create( + model="openai/whisper-large-v3", + file=file, + ) + + print(response.text) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + import { readFileSync } from "fs"; + import { join } from "path"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const audioFilePath = join(process.cwd(), "audio.wav"); + const audioBuffer = readFileSync(audioFilePath); + const audioFile = new File([audioBuffer], "audio.wav", { type: "audio/wav" }); + + const response = await client.audio.transcriptions.create({ + model: "openai/whisper-large-v3", + file: audioFile, + }); + + console.log(response.text); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + import { readFileSync } from "fs"; + import { join } from "path"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const audioFilePath = join(process.cwd(), "audio.wav"); + const audioBuffer = readFileSync(audioFilePath); + const audioFile = new File([audioBuffer], "audio.wav", { type: "audio/wav" }); + + const response = await client.audio.transcriptions.create({ + model: "openai/whisper-large-v3", + file: audioFile, + }); + + console.log(response.text); + - lang: Shell + label: cURL + source: | + curl -X POST "https://api.together.ai/v1/audio/transcriptions" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + -F "file=@audio.wav" \ + -F "model=openai/whisper-large-v3" + /audio/translations: post: tags: ['Audio'] summary: Create audio translation request @@ -5361,18 +10904,90 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' - /v1/compute/clusters: - get: - tags: ['GPUClusterService'] - summary: List all GPU clusters - description: List all GPU clusters. - operationId: GPUClusterService_List - parameters: - - name: projectId - in: query - schema: - description: |- - Optional UMS project ID to filter clusters by. When set, only clusters + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + file = open("audio.wav", "rb") + + response = client.audio.translations.create( + model="openai/whisper-large-v3", + file=file, + language="es", + ) + + print(response.text) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + import { readFileSync } from "fs"; + import { join } from "path"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const audioFilePath = join(process.cwd(), "audio.wav"); + const audioBuffer = readFileSync(audioFilePath); + const audioFile = new File([audioBuffer], "audio.wav", { type: "audio/wav" }); + + const response = await client.audio.translations.create({ + model: "openai/whisper-large-v3", + file: audioFile, + language: "es" + }); + + console.log(response.text); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + import { readFileSync } from "fs"; + import { join } from "path"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const audioFilePath = join(process.cwd(), "audio.wav"); + const audioBuffer = readFileSync(audioFilePath); + const audioFile = new File([audioBuffer], "audio.wav", { type: "audio/wav" }); + + const response = await client.audio.translations.create({ + model: "openai/whisper-large-v3", + file: audioFile, + language: "es" + }); + + console.log(response.text); + - lang: Shell + label: cURL + source: | + curl -X POST "https://api.together.ai/v1/audio/translations" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + -F "file=@audio.wav" \ + -F "model=openai/whisper-large-v3" \ + -F "language=es" + /compute/clusters: + get: + tags: ['GPUClusterService'] + summary: List all GPU clusters + description: List all GPU clusters. + operationId: GPUClusterService_List + parameters: + - name: projectId + in: query + schema: + description: |- + Optional UMS project ID to filter clusters by. When set, only clusters belonging to this project are returned. The caller must be a member of the project; otherwise the result set will be empty. type: string @@ -5383,6 +10998,48 @@ paths: application/json: schema: $ref: '#/components/schemas/GPUClusters' + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + response = client.beta.clusters.list() + + print(response.clusters) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const response = await client.beta.clusters.list(); + + console.log(response.clusters); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const response = await client.beta.clusters.list(); + + console.log(response.clusters); + - lang: Shell + label: CLI + source: |- + tg beta clusters list post: tags: ['GPUClusterService'] summary: Create a GPU cluster @@ -5405,7 +11062,74 @@ paths: application/json: schema: $ref: '#/components/schemas/GPUClusterInfo' - /v1/compute/clusters/{cluster_id}: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + + response = client.beta.clusters.create( + cluster_name="my-gpu-cluster", + region="us-central-8", + gpu_type="H100_SXM", + num_gpus=8, + nvidia_driver_version="560", + cuda_version="12.6", + billint_type="ON_DEMAND", + ) + + print(response.cluster_id) + - lang: TypeScript + label: Together AI SDK (Python) + source: | + import Together from "together-ai"; + + const client = new Together(); + + const response = await client.beta.clusters.create({ + cluster_name: "my-gpu-cluster", + region: "us-central-8", + gpu_type: "H100_SXM", + num_gpus: 8, + nvidia_driver_version: "560", + cuda_version: "12.6", + billint_type: "ON_DEMAND", + }); + + console.log(response.cluster_id) + - lang: JavaScript + label: Together AI SDK (Python) + source: | + import Together from "together-ai"; + + const client = new Together(); + + const response = await client.beta.clusters.create({ + cluster_name: "my-gpu-cluster", + region: "us-central-8", + gpu_type: "H100_SXM", + num_gpus: 8, + nvidia_driver_version: "560", + cuda_version: "12.6", + billint_type: "ON_DEMAND", + }); + + console.log(response.cluster_id) + - lang: Shell + label: CLI + source: | + tg beta clusters create \ + --name my-gpu-cluster \ + --region us-central-8 \ + --gpu-type H100_SXM \ + --cluster-type KUBERNETES \ + --num-gpus 8 \ + --billing-type ON_DEMAND \ + --nvidia-driver-version 560 \ + --cuda-version 12.6 + /compute/clusters/{cluster_id}: get: tags: ['GPUClusterService'] summary: Get GPU cluster by cluster ID @@ -5425,6 +11149,35 @@ paths: application/json: schema: $ref: '#/components/schemas/GPUClusterInfo' + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + client = Together() + + cluster = client.beta.clusters.retrieve("cluster_id") + print(cluster) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + const client = new Together(); + + const cluster = await client.beta.clusters.retrieve("cluster_id"); + console.log(cluster); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + const client = new Together(); + + const cluster = await client.beta.clusters.retrieve("cluster_id"); + console.log(cluster); + - lang: Shell + label: CLI + source: | + tg beta clusters get put: tags: ['GPUClusterService'] summary: Update a GPU cluster @@ -5450,6 +11203,45 @@ paths: application/json: schema: $ref: '#/components/schemas/GPUClusterInfo' + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + client = Together() + + cluster = client.beta.clusters.update("cluster_id", cluster_type="KUBERNETES", num_gpus=24) + print(cluster) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + const client = new Together(); + + const cluster = await client.beta.clusters.update({ + cluster_id: "cluster_id", + cluster_type: "KUBERNETES", + num_gpus: 24, + }) + console.log(cluster) + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + const client = new Together(); + + const cluster = await client.beta.clusters.update({ + cluster_id: "cluster_id", + cluster_type: "KUBERNETES", + num_gpus: 24, + }) + console.log(cluster) + - lang: Shell + label: CLI + source: | + tg beta clusters update \ + --cluster-type KUBERNETES \ + --num-gpus 24 delete: tags: ['GPUClusterService'] summary: Delete GPU cluster by cluster ID @@ -5469,7 +11261,36 @@ paths: application/json: schema: $ref: '#/components/schemas/GPUClusterDeleteResponse' - /v1/compute/regions: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + client = Together() + + cluster = client.beta.clusters.delete("cluster_id") + print(cluster) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + const client = new Together(); + + const cluster = await client.beta.clusters.delete("cluster_id"); + console.log(cluster); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + const client = new Together(); + + const cluster = await client.beta.clusters.delete("cluster_id"); + console.log(cluster); + - lang: Shell + label: CLI + source: | + tg beta clusters delete + /compute/regions: get: tags: ['RegionService'] summary: List regions and corresponding supported driver versions @@ -5481,7 +11302,36 @@ paths: application/json: schema: $ref: '#/components/schemas/RegionListResponse' - /v1/compute/clusters/storage/volumes: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + client = Together() + + regions = client.beta.clusters.list_regions() + print(regions) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + const client = new Together(); + + const regions = await client.beta.clusters.list_regions(); + console.log(regions); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + const client = new Together(); + + const regions = await client.beta.clusters.list_regions(); + console.log(regions); + - lang: Shell + label: CLI + source: | + tg beta clusters list-regions + /compute/clusters/storage/volumes: get: tags: ['SharedVolumeService'] summary: List all shared volumes @@ -5503,6 +11353,35 @@ paths: application/json: schema: $ref: '#/components/schemas/GPUClustersSharedVolumes' + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + client = Together() + + volumes = client.beta.clusters.storage.list() + print(volumes) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + const client = new Together(); + + const volumes = await client.beta.clusters.storage.list(); + console.log(volumes); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + const client = new Together(); + + const volumes = await client.beta.clusters.storage.list(); + console.log(volumes); + - lang: Shell + label: CLI + source: | + tg beta clusters storage list put: tags: ['SharedVolumeService'] summary: Update a shared volume @@ -5522,6 +11401,44 @@ paths: application/json: schema: $ref: '#/components/schemas/GPUClustersSharedVolume' + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + client = Together() + + volume = client.beta.clusters.storage.update( + volume_id="12345-67890-12345-67890", + size_tib=3 + ) + print(volume) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + const client = new Together(); + + const volume = await client.beta.clusters.storage.update({ + volume_id: "12345-67890-12345-67890", + size_tib: 3 + }); + console.log(volume); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + const client = new Together(); + + const volume = await client.beta.clusters.storage.update({ + volume_id: "12345-67890-12345-67890", + size_tib: 3 + }); + console.log(volume); + - lang: Shell + label: CLI + source: | + tg beta clusters storage update --size-tib 3 post: tags: ['SharedVolumeService'] summary: Create a shared volume @@ -5543,7 +11460,48 @@ paths: application/json: schema: $ref: '#/components/schemas/GPUClustersSharedVolume' - /v1/compute/clusters/storage/volumes/{volume_id}: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + client = Together() + + volume = client.beta.clusters.storage.create( + volume_name="my-shared-volume", + size_tib=2, + region="us-west-2" + ) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + const client = new Together(); + + const volume = await client.beta.clusters.storage.create({ + volume_name: "my-shared-volume", + size_tib: 2, + region: "us-west-2" + }); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + const client = new Together(); + + const volume = await client.beta.clusters.storage.create({ + volume_name: "my-shared-volume", + size_tib: 2, + region: "us-west-2" + }); + - lang: Shell + label: cURL + source: | + tg beta clusters storage create \ + --volume-name my-shared-volume \ + --size-tib 2 \ + --region us-west-2 + /compute/clusters/storage/volumes/{volume_id}: get: tags: ['SharedVolumeService'] summary: Get a shared volume by ID @@ -5563,6 +11521,35 @@ paths: application/json: schema: $ref: '#/components/schemas/GPUClustersSharedVolume' + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + client = Together() + + volume = client.beta.clusters.storage.retrieve("volume_id") + print(volume) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + const client = new Together(); + + const volume = await client.beta.clusters.storage.retrieve("volume_id"); + console.log(volume); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + const client = new Together(); + + const volume = await client.beta.clusters.storage.retrieve("volume_id"); + console.log(volume); + - lang: Shell + label: CLI + source: | + tg beta clusters storage retrieve delete: tags: ['SharedVolumeService'] summary: Delete a shared volume by ID @@ -5583,154 +11570,1444 @@ paths: application/json: schema: $ref: '#/components/schemas/GPUClustersSharedVolumeDeleteResponse' - /v1/batches: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + client = Together() + + volume = client.beta.clusters.storage.delete("volume_id") + print(volume) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + const client = new Together(); + + const volume = await client.beta.clusters.storage.delete("volume_id"); + console.log(volume); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + const client = new Together(); + + const volume = await client.beta.clusters.storage.delete("volume_id"); + console.log(volume); + - lang: Shell + label: CLI + source: | + tg beta clusters storage delete + /clusters/availability-zones: get: - tags: ['Batches'] - summary: List batch jobs - description: List all batch jobs for the authenticated user - security: - - bearerAuth: [] + tags: ['endpoints'] + summary: List all available availability zones + description: List all available availability zones. + operationId: availabilityZones responses: '200': - description: OK + description: Success content: application/json: schema: - type: array - items: - $ref: '#/components/schemas/BatchJob' - '401': - description: Unauthorized + $ref: '#/components/schemas/ListAvailibilityZonesResponse' + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + response = client.endpoints.list_avzones() + + print(response.avzones) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const response = await client.endpoints.listAvzones(); + + console.log(response.avzones); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const response = await client.endpoints.listAvzones(); + + console.log(response.avzones); + - lang: Shell + label: cURL + source: | + curl "https://api.together.ai/v1/clusters/availability-zones" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + -H "Content-Type: application/json" + /endpoints: + get: + tags: ['Endpoints'] + summary: List all endpoints + description: Returns a list of all endpoints associated with your account. You can filter the results by type (dedicated or serverless). + operationId: listEndpoints + parameters: + - name: type + in: query + required: false + schema: + description: Filter endpoints by type + type: string + enum: + - dedicated + - serverless + - name: usage_type + in: query + required: false + schema: + type: string + enum: + - on-demand + - reserved + description: Filter endpoints by usage type + - name: mine + in: query + required: false + schema: + type: boolean + description: If true, return only endpoints owned by the caller + responses: + '200': + description: '200' content: application/json: schema: - $ref: '#/components/schemas/BatchErrorResponse' + type: object + required: + - object + - data + properties: + object: + description: The object type, which is always `list`. + const: list + data: + type: array + items: + $ref: '#/components/schemas/ListEndpoint' + example: + object: 'list' + data: + - object: 'endpoint' + id: 'endpoint-5c0c20db-62fe-4f41-8ffc-d9e4ea1a264e' + name: 'allenai/OLMo-7B' + model: 'allenai/OLMo-7B' + type: 'serverless' + owner: 'together' + state: 'STARTED' + created_at: '2024-02-28T21:34:35.444Z' + '403': + description: 'Unauthorized' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' '500': - description: Internal Server Error + description: 'Internal error' content: application/json: schema: - $ref: '#/components/schemas/BatchErrorResponse' + $ref: '#/components/schemas/ErrorData' + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + response = client.endpoints.list() + + for endpoint in response.data: + print(endpoint.id) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const endpoints = await client.endpoints.list(); + + for (const endpoint of endpoints.data) { + console.log(endpoint); + } + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const endpoints = await client.endpoints.list(); + + for (const endpoint of endpoints.data) { + console.log(endpoint); + } + - lang: Shell + label: cURL + source: | + curl "https://api.together.ai/v1/endpoints" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + -H "Content-Type: application/json" post: - tags: ['Batches'] - summary: Create a batch job - description: Create a new batch job with the given input file and endpoint - security: - - bearerAuth: [] + tags: ['Endpoints'] + summary: Create a dedicated endpoint + description: Creates a new dedicated endpoint for serving models. The endpoint starts automatically after creation. You can deploy any supported model on hardware configurations that meet the model's requirements. + operationId: createEndpoint requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/CreateBatchRequest' + $ref: '#/components/schemas/CreateEndpointRequest' responses: - '201': - description: Job created (potentially with warnings) - content: - application/json: - schema: - $ref: '#/components/schemas/BatchJobWithWarning' - '400': - description: Bad Request - content: - application/json: - schema: - $ref: '#/components/schemas/BatchErrorResponse' - '401': - description: Unauthorized + '200': + description: '200' content: application/json: schema: - $ref: '#/components/schemas/BatchErrorResponse' - '429': - description: Too Many Requests + $ref: '#/components/schemas/DedicatedEndpoint' + '403': + description: 'Unauthorized' content: application/json: schema: - $ref: '#/components/schemas/BatchErrorResponse' + $ref: '#/components/schemas/ErrorData' '500': - description: Internal Server Error + description: 'Internal error' content: application/json: schema: - $ref: '#/components/schemas/BatchErrorResponse' - /v1/batches/{id}: + $ref: '#/components/schemas/ErrorData' + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + endpoint = client.endpoints.create( + model="Qwen/Qwen3.5-9B-FP8", + hardware="1x_nvidia_h100_80gb_sxm", + autoscaling={ + "min_replicas": 2, + "max_replicas": 5, + } + ) + + print(endpoint.id) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const endpoint = await client.endpoints.create({ + model: "Qwen/Qwen3.5-9B-FP8", + hardware: "1x_nvidia_h100_80gb_sxm", + autoscaling: { + max_replicas: 5, + min_replicas: 2, + } + }); + + console.log(endpoint.id); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const endpoint = await client.endpoints.create({ + model: "Qwen/Qwen3.5-9B-FP8", + hardware: "1x_nvidia_h100_80gb_sxm", + autoscaling: { + max_replicas: 5, + min_replicas: 2, + } + }); + + console.log(endpoint.id); + - lang: Shell + label: cURL + source: | + curl -X POST "https://api.together.ai/v1/endpoints" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + -H "Content-Type: application/json" \ + -d '{ + "model": "Qwen/Qwen3.5-9B-FP8", + "hardware": "1x_nvidia_h100_80gb_sxm", + "autoscaling": { + "max_replicas": 5, + "min_replicas": 2 + } + }' + + /endpoints/{endpointId}: get: - tags: ['Batches'] - summary: Get a batch job - description: Get details of a batch job by ID - security: - - bearerAuth: [] + tags: ['Endpoints'] + summary: Get endpoint by ID + description: Retrieves details about a specific endpoint, including its current state, configuration, and scaling settings. + operationId: getEndpoint parameters: - - name: id + - name: endpointId in: path required: true schema: type: string - description: The ID of the batch job to retrieve - example: batch_job_abc123def456 + description: The ID of the endpoint to retrieve + example: endpoint-d23901de-ef8f-44bf-b3e7-de9c1ca8f2d7 responses: '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/BatchJob' - '400': - description: Bad Request - content: - application/json: - schema: - $ref: '#/components/schemas/BatchErrorResponse' - '401': - description: Unauthorized + description: '200' content: application/json: schema: - $ref: '#/components/schemas/BatchErrorResponse' + $ref: '#/components/schemas/DedicatedEndpoint' '403': - description: Forbidden + description: 'Unauthorized' content: application/json: schema: - $ref: '#/components/schemas/BatchErrorResponse' + $ref: '#/components/schemas/ErrorData' '404': - description: Not Found + description: 'Not Found' content: application/json: schema: - $ref: '#/components/schemas/BatchErrorResponse' + $ref: '#/components/schemas/ErrorData' '500': - description: Internal Server Error + description: 'Internal error' content: application/json: schema: - $ref: '#/components/schemas/BatchErrorResponse' - /v1/batches/{id}/cancel: - post: - tags: ['Batches'] - summary: Cancel a batch job - description: Cancel a batch job by ID - security: - - bearerAuth: [] + $ref: '#/components/schemas/ErrorData' + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + endpoint = client.endpoints.retrieve("") + + print(endpoint.id) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const endpoint = await client.endpoints.retrieve(""); + + console.log(endpoint); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const endpoint = await client.endpoints.retrieve(""); + + console.log(endpoint); + - lang: Shell + label: cURL + source: | + curl "https://api.together.ai/v1/endpoints/" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + -H "Content-Type: application/json" + + patch: + tags: ['Endpoints'] + summary: Update endpoint, this can also be used to start or stop a dedicated endpoint + description: Updates an existing endpoint's configuration. You can modify the display name, autoscaling settings, or change the endpoint's state (start/stop). + operationId: updateEndpoint parameters: - - name: id + - name: endpointId in: path required: true schema: type: string - description: The ID of the batch job to cancel - example: batch_job_abc123def456 + description: The ID of the endpoint to update + example: endpoint-d23901de-ef8f-44bf-b3e7-de9c1ca8f2d7 + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + display_name: + type: string + description: A human-readable name for the endpoint + example: My Llama3 70b endpoint + state: + type: string + description: The desired state of the endpoint + enum: + - STARTED + - STOPPED + example: STARTED + autoscaling: + $ref: '#/components/schemas/Autoscaling' + description: New autoscaling configuration for the endpoint + inactive_timeout: + type: integer + description: The number of minutes of inactivity after which the endpoint stops automatically. Set to 0 to disable automatic timeout. + nullable: true + example: 60 responses: '200': - description: OK + description: '200' content: application/json: schema: - $ref: '#/components/schemas/BatchJob' - '400': - description: Bad Request - content: + $ref: '#/components/schemas/DedicatedEndpoint' + '403': + description: 'Unauthorized' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + '404': + description: 'Not Found' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + '500': + description: 'Internal error' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + endpoint = client.endpoints.update( + "", + state="STOPPED" + ) + + print(endpoint) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const endpoint = await client.endpoints.update("", { + state: "STOPPED" + }); + + console.log(endpoint); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const endpoint = await client.endpoints.update("", { + state: "STOPPED" + }); + + console.log(endpoint); + - lang: Shell + label: cURL + source: | + curl -X PATCH "https://api.together.ai/v1/endpoints/" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + -H "Content-Type: application/json" \ + -d '{ + "state": "STOPPED" + }' + + delete: + tags: ['Endpoints'] + summary: Delete endpoint + description: Permanently deletes an endpoint. This action cannot be undone. + operationId: deleteEndpoint + parameters: + - name: endpointId + in: path + required: true + schema: + type: string + description: The ID of the endpoint to delete + example: endpoint-d23901de-ef8f-44bf-b3e7-de9c1ca8f2d7 + responses: + '204': + description: 'No Content - Endpoint successfully deleted' + '403': + description: 'Unauthorized' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + '404': + description: 'Not Found' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + '500': + description: 'Internal error' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + endpoint = client.endpoints.delete("") + + print(endpoint) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const endpoint = await client.endpoints.delete(""); + + console.log(endpoint); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const endpoint = await client.endpoints.delete(""); + + console.log(endpoint); + - lang: Shell + label: cURL + source: | + curl -X "DELETE" "https://api.together.ai/v1/endpoints/" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" + + /endpoints/{endpointId}/adapters: + parameters: + - name: endpointId + in: path + required: true + schema: + type: string + description: The endpoint ID + post: + tags: ['Endpoints'] + summary: Add a LoRA adapter to an endpoint + description: | + Adds a LoRA adapter model to a dedicated endpoint. After this call, + inference requests to the adapter model name will be routed to the + specified endpoint. The endpoint must have LoRA enabled, and the + adapter's base model must be compatible with the endpoint's model. + The endpoint name prefix in model_id must match the resolved endpoint. + operationId: addAdapter + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - model_id + properties: + model_id: + type: string + description: 'Combined identifier in format "endpoint_name:adapter_model_name".' + example: 'username/Meta-Llama-3.1-8B-Instruct-def456:username/my-adapter-abc123' + responses: + '200': + description: Adapter successfully bound to endpoint + content: + application/json: + schema: + type: object + properties: + model_id: + type: string + '400': + description: 'Bad Request — invalid model_id format, endpoint name mismatch, LoRA not enabled, incompatible base model, or adapter already bound' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + '403': + description: 'Forbidden — adapter model not found or not owned' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + '404': + description: 'Not Found — endpoint does not exist' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + result = client.endpoints.adapters.add( + "", + model_id="username/my-endpoint-name:username/my-adapter-model", + ) + print(result.api_model_id) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const result = await client.endpoints.adapters.add("", { + model_id: "username/my-endpoint-name:username/my-adapter-model", + }); + console.log(result.model_id); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const result = await client.endpoints.adapters.add("", { + model_id: "username/my-endpoint-name:username/my-adapter-model", + }); + console.log(result.model_id); + - lang: Shell + label: cURL + source: | + curl -X POST "https://api.together.ai/v1/endpoints//adapters" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + -H "Content-Type: application/json" \ + -d '{"model_id": "username/my-endpoint-name:username/my-adapter-model"}' + get: + tags: ['Endpoints'] + summary: List adapters on an endpoint + description: Returns all LoRA adapters bound to the specified dedicated endpoint. + operationId: listAdapters + responses: + '200': + description: List of bound adapters + content: + application/json: + schema: + type: object + properties: + object: + type: string + example: 'list' + data: + type: array + items: + type: object + properties: + model_id: + type: string + description: 'Combined endpoint:adapter identifier' + adapter_name: + type: string + endpoint_name: + type: string + '404': + description: 'Not Found — endpoint does not exist' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + adapters = client.endpoints.adapters.list("") + for adapter in adapters.data or []: + print(adapter.api_model_id, adapter.adapter_name, adapter.endpoint_name) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const adapters = await client.endpoints.adapters.list(""); + for (const adapter of adapters.data ?? []) { + console.log(adapter.model_id, adapter.adapter_name, adapter.endpoint_name); + } + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const adapters = await client.endpoints.adapters.list(""); + for (const adapter of adapters.data ?? []) { + console.log(adapter.model_id, adapter.adapter_name, adapter.endpoint_name); + } + - lang: Shell + label: cURL + source: | + curl "https://api.together.ai/v1/endpoints//adapters" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" + delete: + tags: ['Endpoints'] + summary: Remove a LoRA adapter from an endpoint + description: | + Removes the routing rule that binds an adapter to an endpoint. + The adapter must be currently bound to this specific endpoint. + operationId: removeAdapter + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - model_id + properties: + model_id: + type: string + description: 'Combined identifier in format "endpoint_name:adapter_model_name".' + responses: + '200': + description: Adapter successfully unbound + content: + application/json: + schema: + type: object + properties: + model_id: + type: string + deleted: + type: boolean + '400': + description: 'Bad Request — invalid model_id format, or adapter not bound to this endpoint' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + '403': + description: 'Forbidden — adapter model not found or not owned' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + '404': + description: 'Not Found — endpoint does not exist' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + client.endpoints.adapters.remove( + "", + model_id="username/my-endpoint-name:username/my-adapter-model", + ) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + await client.endpoints.adapters.remove("", { + model_id: "username/my-endpoint-name:username/my-adapter-model", + }); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + await client.endpoints.adapters.remove("", { + model_id: "username/my-endpoint-name:username/my-adapter-model", + }); + - lang: Shell + label: cURL + source: | + curl -X DELETE "https://api.together.ai/v1/endpoints//adapters" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + -H "Content-Type: application/json" \ + -d '{"model_id": "username/my-endpoint-name:username/my-adapter-model"}' + + /hardware: + get: + tags: ['Hardware'] + summary: List available hardware configurations + description: > + Returns a list of available hardware configurations for deploying models. When a model parameter is provided, it returns only hardware configurations compatible with that model, including their current availability status. + operationId: listHardware + parameters: + - name: model + in: query + required: false + schema: + type: string + description: | + Filter hardware configurations by model compatibility. When provided, + the response includes availability status for each compatible configuration. + [See all of Together AI's dedicated models](https://docs.together.ai/docs/dedicated-models) + example: deepseek-ai/DeepSeek-R1 + responses: + '200': + description: 'List of available hardware configurations' + content: + application/json: + schema: + type: object + required: + - object + - data + properties: + object: + description: The object type, which is always `list`. + const: list + data: + type: array + items: + $ref: '#/components/schemas/HardwareWithStatus' + '403': + description: 'Unauthorized' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + '500': + description: 'Internal error' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorData' + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + response = client.endpoints.list_hardware() + + for hardware in response.data: + print(hardware.id) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const hardware = await client.endpoints.listHardware(); + + console.log(hardware); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const hardware = await client.endpoints.listHardware(); + + console.log(hardware); + - lang: Shell + label: cURL + source: | + curl "https://api.together.ai/v1/hardware" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + -H "Content-Type: application/json" + /tci/execute: + post: + tags: ['Code Interpreter'] + summary: Execute code + callbacks: {} + description: | + Executes the given code snippet and returns the output. Without a session_id, a new session is created to run the code. If you pass a valid session_id, the code runs in that session. This is useful for running multiple code snippets in the same environment, because dependencies and similar things are persisted + between calls to the same session. + operationId: tci/execute + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ExecuteRequest' + description: Execute Request + required: false + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ExecuteResponse' + description: Execute Response + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + response = client.code_interpreter.execute( + code="print('Hello world!')", + language="python", + ) + + print(response.data.outputs[0].data); + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const response = await client.codeInterpreter.execute({ + code: "print('Hello world!')", + language: "python" + }); + + console.log(response.data?.outputs?.[0]?.data); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const response = await client.codeInterpreter.execute({ + code: "print('Hello world!')", + language: "python" + }); + + console.log(response.data?.outputs?.[0]?.data); + - lang: Shell + label: cURL + source: | + curl -X POST "https://api.together.ai/v1/tci/execute" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + -H "Content-Type: application/json" \ + -d '{ + "code": "print(\'Hello world!\')", + "language": "python" + }' + /tci/sessions: + get: + summary: List active sessions + tags: ['Code Interpreter'] + callbacks: {} + description: | + Lists all your currently active sessions. + operationId: sessions/list + parameters: [] + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/SessionListResponse' + description: List Response + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + response = client.code_interpreter.sessions.list() + + for session in response.data.sessions: + print(session.id) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const response = await client.codeInterpreter.sessions.list(); + + for (const session of response.data?.sessions) { + console.log(session.id); + } + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const response = await client.codeInterpreter.sessions.list(); + + for (const session of response.data?.sessions) { + console.log(session.id); + } + - lang: Shell + label: cURL + source: | + curl "https://api.together.ai/v1/tci/sessions" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + -H "Content-Type: application/json" + /batches: + get: + tags: ['Batches'] + summary: List batch jobs + description: List all batch jobs for the authenticated user + security: + - bearerAuth: [] + responses: + '200': + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/BatchJob' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/BatchErrorResponse' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/BatchErrorResponse' + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + batches = client.batches.list() + + for batch in batches: + print(batch.id) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const batches = await client.batches.list(); + + console.log(batches); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const batches = await client.batches.list(); + + console.log(batches); + - lang: Shell + label: cURL + source: | + curl "https://api.together.ai/v1/batches" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + -H "Content-Type: application/json" + post: + tags: ['Batches'] + summary: Create a batch job + description: Create a new batch job with the given input file and endpoint + security: + - bearerAuth: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CreateBatchRequest' + responses: + '201': + description: Job created (potentially with warnings) + content: + application/json: + schema: + $ref: '#/components/schemas/BatchJobWithWarning' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/BatchErrorResponse' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/BatchErrorResponse' + '429': + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/BatchErrorResponse' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/BatchErrorResponse' + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + batch = client.batches.create(input_file_id="", endpoint="/v1/chat/completions") + + print(batch.job) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const batch = await client.batches.create({ + endpoint: "/v1/chat/completions", + input_file_id: "", + }); + + console.log(batch); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const batch = await client.batches.create({ + endpoint: "/v1/chat/completions", + input_file_id: "", + }); + + console.log(batch); + - lang: Shell + label: cURL + source: | + curl -X POST "https://api.together.ai/v1/batches" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + -H "Content-Type: application/json" \ + -d '{ + "endpoint": "/v1/chat/completions", + "input_file_id": "" + }' + - lang: Python + label: Audio transcriptions (Python) + source: | + # Audio transcription batches use the /v1/audio/transcriptions endpoint. + # Each line in the uploaded JSONL must include `"method": "FILE"` so the + # worker dispatches the request as multipart/form-data. Example line: + # {"custom_id": "transcription-1", "method": "FILE", + # "body": {"file": "https://example.com/audio.wav", + # "model": "openai/whisper-large-v3"}} + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + batch = client.batches.create( + input_file_id="", + endpoint="/v1/audio/transcriptions", + ) + + print(batch.job) + - lang: Shell + label: Audio transcriptions (cURL) + source: | + curl -X POST "https://api.together.ai/v1/batches" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + -H "Content-Type: application/json" \ + -d '{ + "endpoint": "/v1/audio/transcriptions", + "input_file_id": "" + }' + + /batches/{id}: + get: + tags: ['Batches'] + summary: Get a batch job + description: Get details of a batch job by ID + security: + - bearerAuth: [] + parameters: + - name: id + in: path + required: true + schema: + type: string + description: The ID of the batch job to retrieve + example: batch_job_abc123def456 + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/BatchJob' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/BatchErrorResponse' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/BatchErrorResponse' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/BatchErrorResponse' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/BatchErrorResponse' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/BatchErrorResponse' + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + batch = client.batches.retrieve("") + + print(batch) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const batch = await client.batches.retrieve(""); + + console.log(batch); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const batch = await client.batches.retrieve(""); + + console.log(batch); + - lang: Shell + label: cURL + source: | + curl "https://api.together.ai/v1/batches/" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + -H "Content-Type: application/json" + /batches/{id}/cancel: + post: + tags: ['Batches'] + summary: Cancel a batch job + description: Cancel a batch job by ID + security: + - bearerAuth: [] + parameters: + - name: id + in: path + required: true + schema: + type: string + description: The ID of the batch job to cancel + example: batch_job_abc123def456 + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/BatchJob' + '400': + description: Bad Request + content: application/json: schema: $ref: '#/components/schemas/BatchErrorResponse' @@ -5758,7 +13035,51 @@ paths: application/json: schema: $ref: '#/components/schemas/BatchErrorResponse' - /v1/evaluation: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + batch = client.batches.cancel("") + + print(batch) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const batch = await client.batches.cancel(""); + + console.log(batch); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const batch = await client.batches.cancel(""); + + console.log(batch); + - lang: Shell + label: cURL + source: | + curl -X POST "https://api.together.ai/v1/batches//cancel" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" \ + -H "Content-Type: application/json" + /evaluation: post: tags: - evaluation @@ -5790,6 +13111,83 @@ paths: application/json: schema: $ref: "#/components/schemas/ErrorData" + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + response = client.evals.create( + type="classify", + parameters={ + "judge": { + "model": "openai/gpt-oss-120b", + "model_source": "serverless", + "system_template": "You are an expert evaluator...", + }, + "input_data_file_path": "", + "labels": ["good", "bad"], + "pass_labels": ["good"], + "model_to_evaluate": "Qwen/Qwen3.5-9B", + }, + ) + + print(response.workflow_id) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const response = await client.evals.create({ + type: 'classify', + parameters: { + judge: { + model: 'openai/gpt-oss-120b', + model_source: 'serverless', + system_template: 'You are an expert evaluator...', + }, + input_data_file_path: '', + labels: ['good', 'bad'], + pass_labels: ['good'], + model_to_evaluate: 'Qwen/Qwen3.5-9B', + }, + }); + + console.log(response.workflow_id); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const response = await client.evals.create({ + type: 'classify', + parameters: { + judge: { + model: 'openai/gpt-oss-120b', + model_source: 'serverless', + system_template: 'You are an expert evaluator...', + }, + input_data_file_path: '', + labels: ['good', 'bad'], + pass_labels: ['good'], + model_to_evaluate: 'Qwen/Qwen3.5-9B', + }, + }); + + console.log(response.workflow_id); get: tags: - evaluation @@ -5830,7 +13228,50 @@ paths: application/json: schema: $ref: "#/components/schemas/ErrorData" - /v1/evaluation/model-list: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + response = client.evals.list() + + for job in response: + print(job.workflow_id) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const response = await client.evals.list(); + + for (const job of response) { + console.log(job.workflow_id); + } + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const response = await client.evals.list(); + + for (const job of response) { + console.log(job.workflow_id); + } + /evaluation/model-list: get: tags: - evaluation @@ -5869,7 +13310,49 @@ paths: application/json: schema: $ref: "#/components/schemas/ErrorData" - /v1/evaluation/{id}: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + + # The SDK has no dedicated method for this endpoint yet, so call it with + # the client's generic GET helper. + models = client.get( + "/evaluation/model-list", + cast_to=object, + options={"params": {"model_source": "serverless"}}, + ) + print(models) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + + // The SDK has no dedicated method for this endpoint yet, so call it with + // the client's generic GET helper. + const models = await client.get("/evaluation/model-list", { + query: { model_source: "serverless" }, + }); + console.log(models); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + + // The SDK has no dedicated method for this endpoint yet, so call it with + // the client's generic GET helper. + const models = await client.get("/evaluation/model-list", { + query: { model_source: "serverless" }, + }); + console.log(models); + /evaluation/{id}: get: tags: - evaluation @@ -5901,7 +13384,46 @@ paths: application/json: schema: $ref: "#/components/schemas/ErrorData" - /v1/evaluation/{id}/status: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + response = client.evals.retrieve('') + + print(response) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const response = await client.evals.retrieve(''); + + console.log(response); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const response = await client.evals.retrieve(''); + + console.log(response); + + /evaluation/{id}/status: get: tags: - evaluation @@ -5944,7 +13466,49 @@ paths: application/json: schema: $ref: "#/components/schemas/ErrorData" - /v1/realtime: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + import os + + client = Together( + api_key=os.environ.get("TOGETHER_API_KEY"), + ) + + response = client.evals.status('') + + print(response.status) + print(response.results) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const response = await client.evals.status(''); + + console.log(response.status); + console.log(response.results); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together({ + apiKey: process.env.TOGETHER_API_KEY, + }); + + const response = await client.evals.status(''); + + console.log(response.status); + console.log(response.results); + + /realtime: get: tags: ['Audio'] summary: Real-time audio transcription via WebSocket @@ -6115,7 +13679,130 @@ paths: } } ``` - /v1/queue/cancel: + x-codeSamples: + - lang: Python + label: Python WebSocket Client + source: | + import asyncio + import websockets + import json + import base64 + import os + + async def transcribe_audio(): + api_key = os.environ.get("TOGETHER_API_KEY") + url = "wss://api.together.ai/v1/realtime?model=openai/whisper-large-v3&input_audio_format=pcm_s16le_16000" + + headers = { + "Authorization": f"Bearer {api_key}" + } + + async with websockets.connect(url, additional_headers=headers) as ws: + # audio.wav must be 16 kHz, 16-bit mono PCM to match input_audio_format + with open("audio.wav", "rb") as f: + audio_data = f.read() + + # Send audio in chunks with delay to simulate real-time + chunk_size = 8192 + bytes_per_second = 16000 * 2 # 16kHz * 2 bytes (16-bit) + delay_per_chunk = chunk_size / bytes_per_second + + for i in range(0, len(audio_data), chunk_size): + chunk = audio_data[i:i+chunk_size] + base64_chunk = base64.b64encode(chunk).decode('utf-8') + await ws.send(json.dumps({ + "type": "input_audio_buffer.append", + "audio": base64_chunk + })) + # Simulate real-time streaming + if i + chunk_size < len(audio_data): + await asyncio.sleep(delay_per_chunk) + + # Commit the audio buffer + await ws.send(json.dumps({ + "type": "input_audio_buffer.commit" + })) + + # Receive transcription results + async for message in ws: + data = json.loads(message) + if data["type"] == "conversation.item.input_audio_transcription.delta": + print(f"Partial: {data['delta']}") + elif data["type"] == "conversation.item.input_audio_transcription.completed": + print(f"Final: {data['transcript']}") + break + elif data["type"] == "conversation.item.input_audio_transcription.failed": + error = data.get("error", {}) + print(f"Error: {error.get('message')}") + break + + asyncio.run(transcribe_audio()) + - lang: JavaScript + label: Node.js WebSocket Client + source: | + import WebSocket from 'ws'; + import fs from 'fs'; + + const apiKey = process.env.TOGETHER_API_KEY; + const url = 'wss://api.together.ai/v1/realtime?model=openai/whisper-large-v3&input_audio_format=pcm_s16le_16000'; + + const ws = new WebSocket(url, { + headers: { + 'Authorization': `Bearer ${apiKey}` + } + }); + + ws.on('open', async () => { + console.log('WebSocket connection established!'); + + // audio.wav must be 16 kHz, 16-bit mono PCM to match input_audio_format + const audioData = fs.readFileSync('audio.wav'); + + // Send audio in chunks with delay to simulate real-time + const chunkSize = 8192; + const bytesPerSecond = 16000 * 2; // 16kHz * 2 bytes (16-bit) + const delayPerChunk = (chunkSize / bytesPerSecond) * 1000; // Convert to ms + + for (let i = 0; i < audioData.length; i += chunkSize) { + const chunk = audioData.slice(i, i + chunkSize); + const base64Chunk = chunk.toString('base64'); + ws.send(JSON.stringify({ + type: 'input_audio_buffer.append', + audio: base64Chunk + })); + + // Simulate real-time streaming + if (i + chunkSize < audioData.length) { + await new Promise(resolve => setTimeout(resolve, delayPerChunk)); + } + } + + // Commit audio buffer + ws.send(JSON.stringify({ + type: 'input_audio_buffer.commit' + })); + }); + + ws.on('message', (data) => { + const message = JSON.parse(data.toString()); + + if (message.type === 'conversation.item.input_audio_transcription.delta') { + console.log(`Partial: ${message.delta}`); + } else if (message.type === 'conversation.item.input_audio_transcription.completed') { + console.log(`Final: ${message.transcript}`); + ws.close(); + } else if (message.type === 'conversation.item.input_audio_transcription.failed') { + const errorMessage = message.error?.message ?? message.message ?? 'Unknown error'; + console.error(`Error: ${errorMessage}`); + ws.close(); + } + }); + + ws.on('error', (error) => { + console.error('WebSocket error:', error); + }); + + /queue/cancel: post: description: | Cancel a pending job. Only jobs in pending status can be canceled. @@ -6164,7 +13851,44 @@ paths: summary: Cancel a queued job tags: - Queue - /v1/queue/clear: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + + job = client.beta.jig.queue.cancel( + model="my-deployment", + request_id="req_abc123", + ) + print(job.status) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + + const job = await client.beta.jig.queue.cancel({ + model: "my-deployment", + request_id: "req_abc123", + }); + console.log(job.status); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + + const job = await client.beta.jig.queue.cancel({ + model: "my-deployment", + request_id: "req_abc123", + }); + console.log(job.status); + /queue/clear: post: description: Cancel all pending jobs for the given model. Running jobs are left untouched. Returns the number of jobs that were canceled. operationId: clearQueue @@ -6203,7 +13927,35 @@ paths: summary: Clear a model's pending jobs tags: - Queue - /v1/queue/metrics: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + + result = client.beta.jig.queue.clear(model="my-deployment") + print(result) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + + const result = await client.beta.jig.queue.clear({ model: "my-deployment" }); + console.log(result); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + + const result = await client.beta.jig.queue.clear({ model: "my-deployment" }); + console.log(result); + /queue/metrics: get: description: Get the current queue statistics for a model, including pending and running job counts. operationId: getQueueMetrics @@ -6242,7 +13994,39 @@ paths: summary: Get queue metrics tags: - Queue - /v1/queue/status: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + + metrics = client.beta.jig.queue.metrics(model="my-deployment") + print(metrics) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + + const metrics = await client.beta.jig.queue.metrics({ + model: "my-deployment", + }); + console.log(metrics); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + + const metrics = await client.beta.jig.queue.metrics({ + model: "my-deployment", + }); + console.log(metrics); + /queue/status: get: description: Poll the current status of a previously submitted job. Provide the request_id and model as query parameters. operationId: getQueueJobStatus @@ -6293,7 +14077,44 @@ paths: summary: Get job status tags: - Queue - /v1/queue/submit: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + + job = client.beta.jig.queue.retrieve( + model="my-deployment", + request_id="req_abc123", + ) + print(job.status) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + + const job = await client.beta.jig.queue.retrieve({ + model: "my-deployment", + request_id: "req_abc123", + }); + console.log(job.status); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + + const job = await client.beta.jig.queue.retrieve({ + model: "my-deployment", + request_id: "req_abc123", + }); + console.log(job.status); + /queue/submit: post: description: | Submit a new job to the queue for asynchronous processing. Jobs are @@ -6336,7 +14157,47 @@ paths: summary: Submit a queued job tags: - Queue - /v1/rl/model-resources: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + + job = client.beta.jig.queue.submit( + model="my-deployment", + payload={"prompt": "A cat playing piano"}, + priority=1, + ) + print(job.request_id) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + + const job = await client.beta.jig.queue.submit({ + model: "my-deployment", + payload: { prompt: "A cat playing piano" }, + priority: 1, + }); + console.log(job.requestId); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + + const job = await client.beta.jig.queue.submit({ + model: "my-deployment", + payload: { prompt: "A cat playing piano" }, + priority: 1, + }); + console.log(job.requestId); + /rl/model-resources: get: summary: List model resources description: Lists the caller's model resources. @@ -6390,6 +14251,19 @@ paths: schema: description: Filter resources in the current project by the creator ID. Pass "me" to show resources you created. type: string + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + + resources = client.post_training.model_resources.list( + status=["MODEL_RESOURCES_STATUS_READY"], + ) + for resource in resources.data: + print(resource.id, resource.base_model, resource.status) post: summary: Create model resources description: Provisions a standalone model resource that training sessions can attach to. @@ -6420,7 +14294,21 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' - /v1/rl/model-resources/estimate-cost: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + + resource = client.post_training.model_resources.create( + base_model="Qwen/Qwen3.5-9B", + lora_enabled=True, + compute_config={"gpu_type": "H100-80GB", "num_generator_replicas": 1}, + ) + print(resource.id, resource.status) + /rl/model-resources/estimate-cost: post: summary: Estimate on-demand model resource cost description: Estimates a model resource's on-demand hourly price without creating it. @@ -6445,7 +14333,21 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' - /v1/rl/model-resources/{model_resources_id}: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + + estimate = client.post_training.model_resources.estimate_cost( + base_model="Qwen/Qwen3.5-9B", + lora_enabled=True, + compute_config={"gpu_type": "H100-80GB", "num_generator_replicas": 1}, + ) + print(estimate) + /rl/model-resources/{model_resources_id}: get: summary: Get model resources description: Gets a model resource by its ID and returns its details. @@ -6471,7 +14373,19 @@ paths: schema: description: ID of the model resource type: string - /v1/rl/model-resources/{model_resources_id}/stop: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + + resource = client.post_training.model_resources.retrieve( + "", + ) + print(resource.status, resource.compute_config) + /rl/model-resources/{model_resources_id}/stop: post: summary: Stop model resources description: Stops the model resource and releases its allocated compute. If active training sessions are attached, the request fails unless `force=true`. A forced stop also stops all attached training sessions. @@ -6504,7 +14418,17 @@ paths: description: When true, also stop all attached training sessions. When false, the request fails if any training sessions are active. type: boolean default: false - /v1/rl/training-sessions: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + + resource = client.post_training.model_resources.stop("") + print(resource.status) + /rl/training-sessions: get: summary: List training sessions description: Lists all training sessions. @@ -6564,6 +14488,19 @@ paths: schema: description: Filter sessions in the current project by the creator ID. Pass "me" to show sessions you created. type: string + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + + sessions = client.post_training.sessions.list( + model_resources_id="", + ) + for session in sessions.data or []: + print(session.id, session.status) post: summary: Create training session description: Creates a training session and returns its details. @@ -6588,7 +14525,21 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' - /v1/rl/supported-models: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + + session = client.post_training.sessions.create( + model_resources_id="", + display_name="grpo-math", + lora_config={"rank": 32}, + ) + print(session.id, session.status) + /rl/supported-models: get: summary: List supported models description: Returns the models supported by the RL service and their limits for training/sampling operations. @@ -6613,7 +14564,18 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' - /v1/rl/training-sessions/{session_id}: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + + supported = client.post_training.supported_models.get() + for model in supported.data: + print(model.base_model) + /rl/training-sessions/{session_id}: get: summary: Get training session description: Gets a training session by its ID and returns its details. @@ -6639,6 +14601,16 @@ paths: schema: description: ID of the training session type: string + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + + session = client.post_training.sessions.retrieve("") + print(session.status) patch: summary: Update a training session description: Updates the display name or metadata associated with a training session. Omitted fields remain unchanged, and empty strings clear existing values. @@ -6670,7 +14642,20 @@ paths: schema: description: ID of the training session type: string - /v1/rl/training-sessions/{session_id}/stop: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + + session = client.post_training.sessions.update( + "", + display_name="grpo-math-run-2", + ) + print(session.display_name) + /rl/training-sessions/{session_id}/stop: post: summary: Stop training session description: Stops a training session. @@ -6696,7 +14681,17 @@ paths: schema: description: ID of the training session type: string - /v1/rl/training-sessions/{session_id}/operations/forward-backward/{operation_id}: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + + session = client.post_training.sessions.stop("") + print(session.status) + /rl/training-sessions/{session_id}/operations/forward-backward/{operation_id}: get: summary: Get forward-backward operation description: Retrieves the current status and result of a forward-backward operation. @@ -6728,7 +14723,20 @@ paths: schema: description: Operation ID type: string - /v1/rl/training-sessions/{session_id}/operations/optim-step/{operation_id}: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + + operation = client.post_training.operations.retrieve_forward_backward( + "", + session_id="", + ) + print(operation.status) + /rl/training-sessions/{session_id}/operations/optim-step/{operation_id}: get: summary: Get optim-step operation description: Retrieves the current status and result of an optim-step operation. @@ -6760,7 +14768,20 @@ paths: schema: description: Operation ID type: string - /v1/rl/training-sessions/{session_id}/operations/weights-sync/{operation_id}: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + + operation = client.post_training.operations.retrieve_optim_step( + "", + session_id="", + ) + print(operation.status) + /rl/training-sessions/{session_id}/operations/weights-sync/{operation_id}: get: summary: Get weights-sync operation description: Retrieves the current status and result of a weights-sync operation. @@ -6792,7 +14813,20 @@ paths: schema: description: Operation ID type: string - /v1/rl/training-sessions/{session_id}/operations/sample/{operation_id}: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + + operation = client.post_training.operations.retrieve_weights_sync( + "", + session_id="", + ) + print(operation.status) + /rl/training-sessions/{session_id}/operations/sample/{operation_id}: get: summary: Get sample operation description: Retrieves the current status and result of a sample operation. @@ -6824,7 +14858,20 @@ paths: schema: description: Operation ID type: string - /v1/rl/training-sessions/{session_id}/operations/forward-backward: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + + operation = client.post_training.operations.retrieve_sample( + "", + session_id="", + ) + print(operation.status) + /rl/training-sessions/{session_id}/operations/forward-backward: post: summary: Forward-backward pass description: Submits a forward-backward pass operation that will asynchronously compute gradients via backpropagation. @@ -6862,7 +14909,40 @@ paths: schema: description: Required key that makes retries return the original operation; use a new key for changed request bodies. type: string - /v1/rl/training-sessions/{session_id}/operations/custom-forward-backward: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + import uuid + + from together import Together + + client = Together() + + # Token IDs come from the base model's tokenizer. + operation = client.post_training.operations.forward_backward( + "", + idempotency_key=str(uuid.uuid4()), + loss={"type": "LOSS_TYPE_CROSS_ENTROPY"}, + samples=[ + { + "model_input": { + "chunks": [ + {"encoded_text": {"tokens": [791, 6864, 315, 9822]}} + ] + }, + "loss_fn_inputs": { + "target_tokens": { + "data": [6864, 315, 9822, 374], + "dtype": "int64", + }, + "weights": {"data": [0.0, 0.0, 1.0, 1.0], "dtype": "float32"}, + }, + } + ], + ) + print(operation.id, operation.status) + /rl/training-sessions/{session_id}/operations/custom-forward-backward: post: summary: Custom forward-backward pass description: Submits a forward-backward pass driven by externally computed gradients of the loss with respect to per-token log-probabilities. @@ -6900,7 +14980,40 @@ paths: schema: description: Required key that makes retries return the original operation; use a new key for changed request bodies. type: string - /v1/rl/training-sessions/{session_id}/operations/custom-forward-backward/{operation_id}: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + import uuid + + from together import Together + + client = Together() + + # One gradient per sample: d(loss)/d(logprob) for each target token. + operation = client.post_training.operations.custom_forward_backward( + "", + idempotency_key=str(uuid.uuid4()), + gradients=[{"data": [0.0, 0.0, -0.5, -0.5], "dtype": "D_TYPE_FLOAT32"}], + samples=[ + { + "model_input": { + "chunks": [ + {"encoded_text": {"tokens": [791, 6864, 315, 9822]}} + ] + }, + "loss_fn_inputs": { + "target_tokens": { + "data": [6864, 315, 9822, 374], + "dtype": "int64", + }, + "weights": {"data": [0.0, 0.0, 1.0, 1.0], "dtype": "float32"}, + }, + } + ], + ) + print(operation.id, operation.status) + /rl/training-sessions/{session_id}/operations/custom-forward-backward/{operation_id}: get: summary: Get custom forward-backward operation description: Retrieves the current status and result of a custom forward-backward operation. @@ -6932,7 +15045,20 @@ paths: schema: description: Operation ID type: string - /v1/rl/training-sessions/{session_id}/operations/optim-step: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + + operation = client.post_training.operations.retrieve_custom_forward_backward( + "", + session_id="", + ) + print(operation.status) + /rl/training-sessions/{session_id}/operations/optim-step: post: summary: Optimizer step description: Submits an optimizer step operation that will asynchronously apply accumulated gradients to update model parameters. Does not make the updated parameters available for sampling; call `weights-sync` afterwards when you want subsequent samples to use the updated policy. @@ -6970,7 +15096,23 @@ paths: schema: description: Required key that makes retries return the original operation; use a new key for changed request bodies. type: string - /v1/rl/training-sessions/{session_id}/operations/weights-sync: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + import uuid + + from together import Together + + client = Together() + + operation = client.post_training.operations.optim_step( + "", + idempotency_key=str(uuid.uuid4()), + adam_params={"learning_rate": 1e-5}, + ) + print(operation.id, operation.status) + /rl/training-sessions/{session_id}/operations/weights-sync: post: summary: Weights sync description: Submits a weights-sync operation that makes the session's current trained parameters available for sampling. Call this after `optim-step` when you want subsequent samples to use the updated policy. @@ -7008,7 +15150,23 @@ paths: schema: description: Required key that makes retries return the original operation; use a new key for changed request bodies. type: string - /v1/rl/training-sessions/{session_id}/operations/sample: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + import uuid + + from together import Together + + client = Together() + + operation = client.post_training.operations.weights_sync( + "", + idempotency_key=str(uuid.uuid4()), + weight_sync_type="WEIGHT_SYNC_TYPE_SYNCHRONOUS", + ) + print(operation.id, operation.status) + /rl/training-sessions/{session_id}/operations/sample: post: summary: Sample description: Submits a sample operation that will asynchronously generate text completions with logprobs. @@ -7046,7 +15204,28 @@ paths: schema: description: Required key that makes retries return the original operation; use a new key for changed request bodies. type: string - /v1/rl/training-sessions/{session_id}/operations/inference-checkpoint: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + import uuid + + from together import Together + + client = Together() + + # Token IDs come from the base model's tokenizer. + operation = client.post_training.operations.sample( + "", + idempotency_key=str(uuid.uuid4()), + model_inputs=[ + {"chunks": [{"encoded_text": {"tokens": [791, 6864, 315, 9822]}}]} + ], + num_samples=4, + sampling_params={"max_tokens": 256, "temperature": 1.0}, + ) + print(operation.id, operation.status) + /rl/training-sessions/{session_id}/operations/inference-checkpoint: post: summary: Create inference checkpoint description: Submits an operation that will asynchronously save the current LoRA adapter as an inference checkpoint and upload it to object storage. @@ -7078,7 +15257,22 @@ paths: schema: description: Required key that makes retries return the original operation; use a new key for changed request bodies. type: string - /v1/rl/training-sessions/{session_id}/operations/inference-checkpoint/{operation_id}: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + import uuid + + from together import Together + + client = Together() + + operation = client.post_training.operations.create_inference_checkpoint( + "", + idempotency_key=str(uuid.uuid4()), + ) + print(operation.id, operation.status) + /rl/training-sessions/{session_id}/operations/inference-checkpoint/{operation_id}: get: summary: Get inference checkpoint operation description: Retrieves the current status and result of an inference checkpoint operation. @@ -7110,7 +15304,20 @@ paths: schema: description: Operation ID type: string - /v1/rl/training-sessions/{session_id}/operations/training-checkpoint: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + + operation = client.post_training.operations.retrieve_inference_checkpoint( + "", + session_id="", + ) + print(operation.status) + /rl/training-sessions/{session_id}/operations/training-checkpoint: post: summary: Save training checkpoint description: Submits an operation that will asynchronously save the full training state (adapter + optimizer + step). @@ -7142,7 +15349,22 @@ paths: schema: description: Required key that makes retries return the original operation; use a new key for changed request bodies. type: string - /v1/rl/training-sessions/{session_id}/operations/training-checkpoint/{operation_id}: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + import uuid + + from together import Together + + client = Together() + + operation = client.post_training.operations.create_training_checkpoint( + "", + idempotency_key=str(uuid.uuid4()), + ) + print(operation.id, operation.status) + /rl/training-sessions/{session_id}/operations/training-checkpoint/{operation_id}: get: summary: Get save training checkpoint operation description: Retrieves the current status and result of a save training checkpoint operation. @@ -7174,7 +15396,20 @@ paths: schema: description: Operation ID type: string - /v1/rl/checkpoints: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + + operation = client.post_training.operations.retrieve_training_checkpoint( + "", + session_id="", + ) + print(operation.status) + /rl/checkpoints: get: summary: List checkpoints description: Lists training and inference checkpoints owned by the caller, newest first. Filter by type, session, or base model, for example to recover a checkpoint ID for resume. @@ -7228,7 +15463,21 @@ paths: - CHECKPOINT_TYPE_TRAINING - CHECKPOINT_TYPE_INFERENCE type: string - /v1/rl/checkpoints/{id}: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + + checkpoints = client.post_training.checkpoints.list( + session_id="", + type="CHECKPOINT_TYPE_TRAINING", + ) + for checkpoint in checkpoints.data: + print(checkpoint.id, checkpoint.step) + /rl/checkpoints/{id}: get: summary: Get checkpoint description: "Returns metadata for a checkpoint: type, base model, LoRA rank, step, and owning session." @@ -7254,7 +15503,17 @@ paths: schema: description: ID of the checkpoint type: string - /v1/rl/checkpoints/{id}/download: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + + checkpoint = client.post_training.checkpoints.retrieve("") + print(checkpoint.type, checkpoint.base_model, checkpoint.lora_rank) + /rl/checkpoints/{id}/download: get: summary: Download checkpoint description: Returns presigned URLs for downloading a checkpoint's model files. Only inference checkpoints support downloading. @@ -7286,7 +15545,21 @@ paths: schema: description: Files to download. CHECKPOINT_VARIANT_MERGED is the full model with the trained weights applied; CHECKPOINT_VARIANT_ADAPTER is the LoRA adapter weights only, available for checkpoints from LoRA training sessions. $ref: '#/components/schemas/RL.CheckpointVariant' - /v1/compute/clusters/{cluster_id}/addons: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + + download = client.post_training.checkpoints.download( + "", + variant="CHECKPOINT_VARIANT_ADAPTER", + ) + print(download) + + /compute/clusters/{cluster_id}/addons: get: tags: ['InstanceClusterAddOnService'] operationId: InstanceClusterAddOnService_List @@ -7327,7 +15600,7 @@ paths: application/json: schema: $ref: '#/components/schemas/AddOnInfo' - /v1/compute/clusters/{cluster_id}/addons/{addon_id}: + /compute/clusters/{cluster_id}/addons/{addon_id}: get: tags: ['InstanceClusterAddOnService'] operationId: InstanceClusterAddOnService_Get @@ -7403,7 +15676,7 @@ paths: application/json: schema: $ref: '#/components/schemas/ClusterAddOnDeleteResponse' - /v1/compute/clusters/{cluster_id}/instances/{instance_id}/remediations: + /compute/clusters/{cluster_id}/instances/{instance_id}/remediations: get: tags: ['RemediationService'] summary: List remediations @@ -7497,6 +15770,49 @@ paths: application/json: schema: $ref: '#/components/schemas/ListRemediationsResponse' + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + + # Pass "-" as the instance ID to list remediations across the cluster. + response = client.clusters.remediations.list( + "-", + cluster_id="", + ) + for remediation in response.remediations or []: + print(remediation.id, remediation.instance_id, remediation.state) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + + // Pass "-" as the instance ID to list remediations across the cluster. + const response = await client.clusters.remediations.list("-", { + cluster_id: "", + }); + for (const remediation of response.remediations ?? []) { + console.log(remediation.id, remediation.instance_id, remediation.state); + } + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + + // Pass "-" as the instance ID to list remediations across the cluster. + const response = await client.clusters.remediations.list("-", { + cluster_id: "", + }); + for (const remediation of response.remediations ?? []) { + console.log(remediation.id, remediation.instance_id, remediation.state); + } post: tags: ['RemediationService'] description: |- @@ -7537,7 +15853,48 @@ paths: application/json: schema: $ref: '#/components/schemas/Remediation' - /v1/compute/clusters/{cluster_id}/instances/{instance_id}/remediations/{remediation_id}: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + + remediation = client.clusters.remediations.create( + "", + cluster_id="", + mode="REMEDIATION_MODE_VM_ONLY", + reason="Repeated GPU Xid errors", + ) + print(remediation.id, remediation.state) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + + const remediation = await client.clusters.remediations.create("", { + cluster_id: "", + mode: "REMEDIATION_MODE_VM_ONLY", + reason: "Repeated GPU Xid errors", + }); + console.log(remediation.id, remediation.state); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + + const remediation = await client.clusters.remediations.create("", { + cluster_id: "", + mode: "REMEDIATION_MODE_VM_ONLY", + reason: "Repeated GPU Xid errors", + }); + console.log(remediation.id, remediation.state); + /compute/clusters/{cluster_id}/instances/{instance_id}/remediations/{remediation_id}: get: tags: ['RemediationService'] description: Retrieve the status of a specific remdiation on a specific instance in a specific cluster. @@ -7565,7 +15922,51 @@ paths: application/json: schema: $ref: '#/components/schemas/Remediation' - /v1/compute/clusters/{cluster_id}/instances/{instance_id}/remediations/{remediation_id}/approve: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + + remediation = client.clusters.remediations.retrieve( + "", + cluster_id="", + instance_id="", + ) + print(remediation.state) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + + const remediation = await client.clusters.remediations.retrieve( + "", + { + cluster_id: "", + instance_id: "", + }, + ); + console.log(remediation.state); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + + const remediation = await client.clusters.remediations.retrieve( + "", + { + cluster_id: "", + instance_id: "", + }, + ); + console.log(remediation.state); + /compute/clusters/{cluster_id}/instances/{instance_id}/remediations/{remediation_id}/approve: post: tags: ['RemediationService'] description: | @@ -7606,7 +16007,54 @@ paths: application/json: schema: $ref: '#/components/schemas/Remediation' - /v1/compute/clusters/{cluster_id}/instances/{instance_id}/remediations/{remediation_id}/cancel: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + + remediation = client.clusters.remediations.approve( + "", + cluster_id="", + instance_id="", + comment="Approved after checking the node", + ) + print(remediation.state) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + + const remediation = await client.clusters.remediations.approve( + "", + { + cluster_id: "", + instance_id: "", + comment: "Approved after checking the node", + }, + ); + console.log(remediation.state); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + + const remediation = await client.clusters.remediations.approve( + "", + { + cluster_id: "", + instance_id: "", + comment: "Approved after checking the node", + }, + ); + console.log(remediation.state); + /compute/clusters/{cluster_id}/instances/{instance_id}/remediations/{remediation_id}/cancel: post: tags: ['RemediationService'] description: | @@ -7640,7 +16088,51 @@ paths: application/json: schema: $ref: '#/components/schemas/Remediation' - /v1/compute/clusters/{cluster_id}/instances/{instance_id}/remediations/{remediation_id}/reject: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + + remediation = client.clusters.remediations.cancel( + "", + cluster_id="", + instance_id="", + ) + print(remediation.state) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + + const remediation = await client.clusters.remediations.cancel( + "", + { + cluster_id: "", + instance_id: "", + }, + ); + console.log(remediation.state); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + + const remediation = await client.clusters.remediations.cancel( + "", + { + cluster_id: "", + instance_id: "", + }, + ); + console.log(remediation.state); + /compute/clusters/{cluster_id}/instances/{instance_id}/remediations/{remediation_id}/reject: post: tags: ['RemediationService'] description: | @@ -7681,7 +16173,54 @@ paths: application/json: schema: $ref: '#/components/schemas/Remediation' - /v1/compute/passive_health_check_alerts: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + + remediation = client.clusters.remediations.reject( + "", + cluster_id="", + instance_id="", + comment="Node recovered on its own", + ) + print(remediation.state) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + + const remediation = await client.clusters.remediations.reject( + "", + { + cluster_id: "", + instance_id: "", + comment: "Node recovered on its own", + }, + ); + console.log(remediation.state); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + + const remediation = await client.clusters.remediations.reject( + "", + { + cluster_id: "", + instance_id: "", + comment: "Node recovered on its own", + }, + ); + console.log(remediation.state); + /compute/passive_health_check_alerts: get: tags: ['HealthCheckService'] summary: List passive health check alerts @@ -7751,7 +16290,7 @@ paths: application/json: schema: $ref: '#/components/schemas/ListPassiveHealthCheckAlertsResponse' - /v1/projects: + /projects: get: tags: ['Projects'] summary: List available projects @@ -7817,54 +16356,54 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' - /v3/whoami: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + + for project in client.projects.list(): + print(project.id, project.name, project.slug) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + + for await (const project of client.projects.list()) { + console.log(project.id, project.name, project.slug); + } + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + + for await (const project of client.projects.list()) { + console.log(project.id, project.name, project.slug); + } + /whoami: get: tags: ['Account'] - summary: Identify the caller + summary: Get API key identity description: > - Returns identity information for the authenticated caller. Accepts project API keys and user session JWTs. The response `type` indicates which fields are present. + 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 (`/`) in dedicated endpoint inference calls. - For project-scoped credentials, `project.slug` can be used with an endpoint slug as `/` to form the `model` value in dedicated endpoint inference calls. + Requires a Bearer API key in the `Authorization` header. Cookie, session, and SLS JWT credentials are not accepted. operationId: whoami responses: '200': - description: Caller identity + description: API key identity information content: application/json: schema: $ref: '#/components/schemas/WhoamiResponse' - '400': - description: Invalid request - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorData' '401': - description: Authentication failed - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorData' - '403': - description: Authentication failed or permission denied - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorData' - '404': - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorData' - '409': - description: Conflict - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorData' - '413': - description: Request body too large + description: Unauthorized — missing or invalid API key content: application/json: schema: @@ -7875,19 +16414,37 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' - '503': - description: Service unavailable - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorData' - '504': - description: Request timed out - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorData' - /v1/billing/usage: + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + identity = client.whoami() + print(identity) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const identity = await client.whoami(); + console.log(identity); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + const identity = await client.whoami(); + console.log(identity); + - lang: Shell + label: cURL + source: | + curl https://api.together.ai/v1/whoami \ + -H "Authorization: Bearer $TOGETHER_API_KEY" + /billing/usage: get: tags: ['Billing'] summary: Get billing usage @@ -7967,6 +16524,58 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorData' + x-codeSamples: + - lang: Python + label: Together AI SDK (Python) + source: | + from together import Together + + client = Together() + + # The SDK has no dedicated method for this endpoint yet, so call it with + # the client's generic GET helper. + usage = client.get( + "/billing/usage", + cast_to=object, + options={"params": {"month": "2026-06", "granularity": "day"}}, + ) + print(usage) + - lang: TypeScript + label: Together AI SDK (TypeScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + + // The SDK has no dedicated method for this endpoint yet, so call it with + // the client's generic GET helper. + const usage = await client.get("/billing/usage", { + query: { month: "2026-06", granularity: "day" }, + }); + console.log(usage); + - lang: JavaScript + label: Together AI SDK (JavaScript) + source: | + import Together from "together-ai"; + + const client = new Together(); + + // The SDK has no dedicated method for this endpoint yet, so call it with + // the client's generic GET helper. + const usage = await client.get("/billing/usage", { + query: { month: "2026-06", granularity: "day" }, + }); + console.log(usage); + - lang: Shell + label: cURL + source: | + # First page + curl "https://api.together.ai/v1/billing/usage?month=2026-06&granularity=day" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" + + # Next page: pass the previous response's next_cursor + curl "https://api.together.ai/v1/billing/usage?month=2026-06&granularity=day&after=" \ + -H "Authorization: Bearer $TOGETHER_API_KEY" components: securitySchemes: bearerAuth: @@ -8696,7 +17305,7 @@ components: description: Resource name of the adapter model revision pinned on the deployment, using projects/{projectId}/models/{adapterModelId}/revisions/{revisionId}. id: type: string - description: Adapter attachment `dad_` id used by get, update, and remove; stale ids never address a replacement after remove and re-add. + description: Row identifier for this adapter attachment; changes if the adapter is removed and re-added. DE.DeploymentAdapterStatus: type: object description: Controller-reported load state for an adapter on one deployment cluster. @@ -9568,6 +18177,10 @@ components: quantization: type: string description: Quantization method for the profile, if available. + tensorParallelSize: + type: integer + description: Deprecated. Use `parallelism`. Legacy tensor-parallel shard count for the profile. + deprecated: true performanceBenchmarks: $ref: '#/components/schemas/DE.SupportedModelPerformanceBenchmarks' description: Performance benchmarks for the profile, if available. @@ -11561,7 +20174,7 @@ components: description: Number of generator replicas. 0 means the resource runs the trainer only, with no generator. gpu_type: type: string - example: B200-SXM + example: H100-80GB enum: - H100-80GB - B200-SXM @@ -11580,6 +20193,7 @@ components: type: string example: B200-SXM enum: + - H100-80GB - B200-SXM description: GPU type to provision. Omit to use the model's default GPU type. RL.ModelResourcesStatus: @@ -11598,7 +20212,6 @@ components: required: - id - status - - status_details - base_model - compute_config - lora_enabled @@ -11618,9 +20231,6 @@ components: error: $ref: '#/components/schemas/RL.ModelResourcesError' description: Structured detail for the model resource's current error. Set when the resource is in an error state. - status_details: - $ref: '#/components/schemas/RL.ModelResourcesStatusDetails' - description: Details of the resource's current status, such as its place in the queue. base_model: type: string example: Qwen/Qwen3.5-4B @@ -11653,15 +20263,6 @@ components: type: string example: user_123 description: ID of the user who created the model resource - RL.ModelResourcesStatusDetails: - type: object - description: Details of a model resource's current status - properties: - queue_position: - type: integer - format: int64 - example: 3 - description: 'Estimated place of the resource in the queue: the number of older resources of the same GPU type still waiting for GPUs, plus one. Set only while the resource waits for GPUs.' RL.ModelResourcesError: type: object description: Structured detail for the model resource's current error @@ -11804,8 +20405,9 @@ components: properties: gpu_type: type: string - example: B200-SXM + example: H100-80GB enum: + - H100-80GB - B200-SXM description: GPU type this configuration provisions. trainer_config: @@ -11827,8 +20429,9 @@ components: description: Base model identifier to pass as base_model when creating a model resource default_gpu_type: type: string - example: B200-SXM + example: H100-80GB enum: + - H100-80GB - B200-SXM description: GPU type used when model-resource creation omits gpu_type. compute_configs: @@ -13205,9 +21808,14 @@ components: - RESERVED - ON_DEMAND - SCHEDULED_CAPACITY + auto_scaled: + deprecated: true + type: boolean + default: false + description: Whether GPU cluster should be auto-scaled based on the workload. By default, it is not auto-scaled. auto_scale_max_gpus: type: integer - description: Maximum number of GPUs to which the cluster can be auto-scaled up. + description: Maximum number of GPUs to which the cluster can be auto-scaled up. This field is required if auto_scaled is true. slurm_shm_size_gib: type: integer description: Shared memory size in GiB for Slurm cluster. This field is required if cluster_type is SLURM. @@ -13467,7 +22075,7 @@ components: format: date-time is_in_substrate: type: boolean - description: Whether the cluster runs on the Together-managed GPU cluster platform. + description: Whether the cluster is managed inside a substrate environment. control_plane_ready: type: boolean description: Whether the control plane is currently ready. @@ -14294,7 +22902,7 @@ components: description: Project ID that will own the volume. When omitted, the caller's default project is used. instance_cluster_id: type: string - description: Cluster ID to place the volume on the same infrastructure as that GPU cluster. + description: Cluster ID to pin the volume to the same substrate as that GPU cluster. GPUClustersSharedVolumeDeleteResponse: type: object required: @@ -14450,6 +23058,16 @@ components: description: Voice name to be used for audio inference. type: string + ListAvailibilityZonesResponse: + description: List of unique availability zones + type: object + required: ['avzones'] + properties: + avzones: + type: array + items: + type: string + RerankRequest: type: object properties: @@ -14843,6 +23461,18 @@ components: type: array items: $ref: '#/components/schemas/ToolChoice' + function_call: + type: object + deprecated: true + nullable: true + properties: + arguments: + type: string + name: + type: string + required: + - arguments + - name CompletionToken: type: object @@ -14892,6 +23522,15 @@ components: type: array items: $ref: '#/components/schemas/ToolChoice' + function_call: + type: object + deprecated: true + required: [arguments, name] + properties: + arguments: + type: string + name: + type: string reasoning: type: string nullable: true @@ -15144,6 +23783,7 @@ components: - $ref: '#/components/schemas/ChatCompletionUserMessageParam' - $ref: '#/components/schemas/ChatCompletionAssistantMessageParam' - $ref: '#/components/schemas/ChatCompletionToolMessageParam' + - $ref: '#/components/schemas/ChatCompletionFunctionMessageParam' # Start Message Params @@ -15289,6 +23929,15 @@ components: type: array items: $ref: '#/components/schemas/ToolChoice' + function_call: + type: object + deprecated: true + properties: + arguments: + type: string + name: + type: string + required: [arguments, name] reasoning: type: string nullable: true @@ -15296,6 +23945,19 @@ components: type: string nullable: true + ChatCompletionFunctionMessageParam: + type: object + deprecated: true + required: [content, role, name] + properties: + role: + type: string + enum: ['function'] + content: + type: string + name: + type: string + ChatCompletionToolMessageParam: type: object properties: @@ -15408,6 +24070,18 @@ components: type: array items: $ref: '#/components/schemas/ToolChoice' + function_call: + type: object + deprecated: true + nullable: true + properties: + arguments: + type: string + name: + type: string + required: + - arguments + - name usage: allOf: - $ref: '#/components/schemas/UsageData' @@ -15896,6 +24570,18 @@ components: type: array items: $ref: '#/components/schemas/ToolChoice' + function_call: + type: object + deprecated: true + nullable: true + properties: + arguments: + type: string + name: + type: string + required: + - arguments + - name reasoning: type: string nullable: true @@ -15959,6 +24645,122 @@ components: index: type: integer + ModelInfoList: + type: array + items: + $ref: '#/components/schemas/ModelInfo' + ModelInfo: + type: object + required: [id, object, created, type] + properties: + id: + type: string + example: 'Austism/chronos-hermes-13b' + object: + description: The object type, which is always `model`. + const: model + created: + type: integer + example: 1692896905 + type: + enum: + - chat + - language + - code + - image + - embedding + - moderation + - rerank + - audio + - transcribe + - video + example: 'chat' + display_name: + type: string + example: 'Chronos Hermes (13B)' + organization: + type: string + example: 'Austism' + link: + type: string + license: + type: string + example: 'other' + context_length: + type: integer + example: 2048 + pricing: + $ref: '#/components/schemas/Pricing' + + ModelUploadRequest: + type: object + required: + - model_name + - model_source + properties: + model_name: + type: string + description: The name to give to your uploaded model + example: 'Qwen2.5-72B-Instruct' + model_source: + type: string + description: The source location of the model (Hugging Face repo or S3 path) + example: 'unsloth/Qwen2.5-72B-Instruct' + model_type: + type: string + description: Whether the model is a full model or an adapter + default: 'model' + enum: + - model + - adapter + example: 'model' + hf_token: + type: string + description: Hugging Face token (if uploading from Hugging Face) + example: 'hf_examplehuggingfacetoken' + description: + type: string + description: A description of your model + example: 'Finetuned Qwen2.5-72B-Instruct by Unsloth' + base_model: + type: string + description: The base model to use for an adapter if setting it to run against a serverless pool. Only used for model_type `adapter`. + example: 'Qwen/Qwen2.5-72B-Instruct' + lora_model: + type: string + description: The lora pool to use for an adapter if setting it to run against, say, a dedicated pool. Only used for model_type `adapter`. + example: 'my_username/Qwen2.5-72B-Instruct-lora' + + ModelUploadSuccessResponse: + type: object + required: + - data + - message + properties: + data: + type: object + required: + - job_id + - model_name + - model_id + - model_source + properties: + job_id: + type: string + example: 'job-a15dad11-8d8e-4007-97c5-a211304de284' + model_name: + type: string + example: 'necolinehubner/Qwen2.5-72B-Instruct' + model_id: + type: string + example: 'model-c0e32dfc-637e-47b2-bf4e-e9b2e58c9da7' + model_source: + type: string + example: 'huggingface' + message: + type: string + example: 'Processing model weights. Job created.' + ImageResponse: type: object properties: @@ -16007,6 +24809,100 @@ components: type: string enum: [url] + JobInfoSuccessResponse: + type: object + required: + - type + - job_id + - status + - status_updates + - args + - created_at + - updated_at + properties: + type: + type: string + example: 'model_upload' + job_id: + type: string + example: 'job-a15dad11-8d8e-4007-97c5-a211304de284' + status: + type: string + enum: ['Queued', 'Running', 'Complete', 'Failed'] + example: 'Complete' + status_updates: + type: array + items: + type: object + required: + - status + - message + - timestamp + properties: + status: + type: string + example: 'Complete' + message: + type: string + example: 'Job is Complete' + timestamp: + type: string + format: date-time + example: '2025-03-11T22:36:12Z' + args: + type: object + properties: + description: + type: string + example: 'Finetuned Qwen2.5-72B-Instruct by Unsloth' + modelName: + type: string + example: 'necolinehubner/Qwen2.5-72B-Instruct' + modelSource: + type: string + example: 'unsloth/Qwen2.5-72B-Instruct' + created_at: + type: string + format: date-time + example: '2025-03-11T22:05:43Z' + updated_at: + type: string + format: date-time + example: '2025-03-11T22:36:12Z' + + JobsInfoSuccessResponse: + type: object + required: + - data + properties: + data: + type: array + items: + $ref: '#/components/schemas/JobInfoSuccessResponse' + + Pricing: + type: object + required: [hourly, input, output, base, finetune] + properties: + base: + type: number + example: 0 + finetune: + type: number + example: 0 + hourly: + type: number + example: 0 + input: + type: number + example: 0.3 + output: + type: number + example: 0.3 + cached_input: + type: number + example: 0.2 + ToolsPart: type: object properties: @@ -16080,6 +24976,11 @@ components: purpose: description: The purpose of the file as it was uploaded. $ref: '#/components/schemas/FilePurpose' + Processed: + description: | + Deprecated. Whether file has been fully uploaded. + type: boolean + deprecated: true FileType: description: The type of the file such as `jsonl`, `csv`, or `parquet`. $ref: '#/components/schemas/FileType' @@ -16995,13 +25896,13 @@ components: description: User that created the job. QuantizationRequest: type: object - description: Request body for preparing a fine-tuned model for FP4 inference. + description: Request body for preparing an adapter for FP4 inference. required: - inputs properties: inputs: $ref: '#/components/schemas/QuantizationPipelineInputs' - description: Inputs naming the fine-tuned model to prepare. + description: Adapter inputs to prepare. QuantizationEstimate: type: object description: Price and duration estimate for a quantization job. @@ -17032,19 +25933,18 @@ components: example: true QuantizationPipelineInputs: type: object - description: > - The model to prepare: an adapter or a full model. A request names it by the `model_*` fields or the deprecated `adapter_*` fields, never a mix of the two, and gives a revision only beside the ID it belongs to. A job returns both names, with the same values. + description: Adapter identifiers to prepare. + required: + - adapter_object_id properties: - model_object_id: + adapter_object_id: type: string - pattern: '^ml_.+' - description: > - Model object ID of the model to prepare. It names the input model; it is not the `results.model_object_id` of a job, which names the model the job produced. - model_revision_id: + pattern: '^ml_.+' + description: Model object ID of the adapter to prepare. + adapter_revision_id: type: string pattern: '^rv_.+' - description: > - Revision ID of the model to prepare. Omit to use the model's current revision. Only valid with `model_object_id`. + description: Adapter revision ID to prepare. Omit to use the adapter's current revision. calibration_file_id: type: string pattern: '^file-.+' @@ -17056,46 +25956,45 @@ components: The request is rejected unless the file exists in the request project, has finished uploading, has passed files API validation as a conversation dataset, is not empty, and is at most 64 MiB. A `fine-tune` purpose file is also accepted so a training file can be reused. example: file-5f1b0c7a-2d19-4a3e-9c60-8ab41c2f7d35 example: - model_object_id: ml_CeG3fF6pyEViU8dE8pk7R - model_revision_id: rv_CeG3faPBj2ABwbAaHPTmx + adapter_object_id: ml_CeG3fF6pyEViU8dE8pk7R + adapter_revision_id: rv_CeG3faPBj2ABwbAaHPTmx calibration_file_id: file-5f1b0c7a-2d19-4a3e-9c60-8ab41c2f7d35 QuantizationPipelineConfiguration: type: object - description: > - Server-resolved configuration for a quantization job. The `adapter_*` fields are the deprecated names of the `model_*` ones, with the same values. + description: Server-resolved configuration for a quantization job. readOnly: true required: - user_id - - model_project_id - - model_revision_id - - model_name + - adapter_project_id + - adapter_revision_id + - adapter_model_name - base_object_id - base_revision_id - base_model_name properties: user_id: type: string - description: User whose scope is used to fetch the model weights. + description: User whose scope is used to fetch the adapter weights. example: user_CKfewYkQBpaEmN7wuQS3W - model_project_id: + adapter_project_id: type: string - description: Project the model belongs to. + description: Project that owns the adapter. example: proj_CczF9KYFantA84sNYDTJd - model_revision_id: + adapter_revision_id: type: string - description: Revision of the model selected for preparation. + description: Adapter revision selected for preparation. example: rv_CeERyXMBQCJTRC1yqGTpk - model_name: + adapter_model_name: type: string - description: Qualified name of the model, which the produced model is named after. + description: Qualified adapter model name. example: ft-qa-artifacts/glm-5.3-e2e-test-adapter base_object_id: type: string - description: Model object ID of the base model the prepared model was fine-tuned from. + description: Model object ID of the adapter's base model. example: ml_CbJ9yCnij7A47b1xkpioB base_revision_id: type: string - description: Revision ID of that base model. + description: Revision ID of the adapter's base model. example: rv_CbJ9yNrws93VQrZum1fTE base_model_name: type: string @@ -17110,7 +26009,7 @@ components: properties: inputs: $ref: '#/components/schemas/QuantizationPipelineInputs' - description: Inputs requested by the caller. + description: Adapter inputs requested by the caller. configuration: $ref: '#/components/schemas/QuantizationPipelineConfiguration' description: Server-resolved configuration for the run. @@ -17125,11 +26024,11 @@ components: type: string description: Model revision ID registered by the job. QuantizationJob: - description: Quantization job that prepares a fine-tuned model for FP4 inference. + description: Quantization job that prepares an adapter for FP4 inference. allOf: - $ref: '#/components/schemas/BaseShapingJob' - type: object - description: Quantization job that prepares a fine-tuned model for FP4 inference. + description: Quantization job that prepares an adapter for FP4 inference. required: - params - events @@ -17282,74 +26181,732 @@ components: default: auto description: Whether to mask user messages in conversational data or prompts in instruction data. required: - - method - - train_on_inputs - TrainingMethodDPO: - type: object + - method + - train_on_inputs + TrainingMethodDPO: + type: object + properties: + method: + type: string + enum: ['dpo'] + dpo_beta: + type: number + default: 0.1 + rpo_alpha: + type: number + default: 0.0 + dpo_normalize_logratios_by_length: + type: boolean + default: false + dpo_reference_free: + type: boolean + default: false + simpo_gamma: + type: number + default: 0.0 + required: + - method + + MultimodalParams: + type: object + properties: + train_vision: + type: boolean + description: Whether to train the vision encoder of the model. Only available for multimodal models. + + LRScheduler: + type: object + properties: + lr_scheduler_type: + type: string + enum: + - linear + - cosine + lr_scheduler_args: + oneOf: + - $ref: '#/components/schemas/LinearLRSchedulerArgs' + - $ref: '#/components/schemas/CosineLRSchedulerArgs' + required: + - lr_scheduler_type + CosineLRSchedulerArgs: + type: object + properties: + min_lr_ratio: + type: number + default: 0.0 + description: The ratio of the final learning rate to the peak learning rate + num_cycles: + type: number + default: 0.5 + description: Number or fraction of cycles for the cosine learning rate scheduler + required: + - min_lr_ratio + - num_cycles + LinearLRSchedulerArgs: + type: object + properties: + min_lr_ratio: + type: number + default: 0.0 + description: The ratio of the final learning rate to the peak learning rate + + Autoscaling: + type: object + description: Configuration for automatic scaling of replicas based on demand. + required: + - min_replicas + - max_replicas + properties: + min_replicas: + type: integer + description: The minimum number of replicas to maintain, even when there is no load + examples: + - 2 + max_replicas: + type: integer + description: The maximum number of replicas to scale up to under load + examples: + - 5 + + HardwareSpec: + type: object + description: Detailed specifications of a hardware configuration + required: + - gpu_type + - gpu_link + - gpu_memory + - gpu_count + properties: + gpu_type: + type: string + description: The type/model of GPU + examples: + - a100-80gb + gpu_link: + type: string + description: The GPU interconnect technology + examples: + - sxm + gpu_memory: + type: number + description: Amount of GPU memory in GB + examples: + - 80 + gpu_count: + type: integer + description: Number of GPUs in this configuration + examples: + - 2 + + EndpointPricing: + type: object + description: Pricing details for using an endpoint + required: + - cents_per_minute + properties: + cents_per_minute: + type: number + description: Cost per minute of endpoint uptime in cents + examples: + - 5.42 + + HardwareAvailability: + type: object + description: Indicates the current availability status of a hardware configuration + required: + - status + properties: + status: + type: string + description: The availability status of the hardware configuration + enum: + - available + - unavailable + - insufficient + + HardwareWithStatus: + type: object + description: Hardware configuration details with optional availability status + required: + - object + - id + - pricing + - specs + - updated_at + properties: + object: + description: The object type, which is always `hardware`. + const: hardware + id: + type: string + description: Unique identifier for the hardware configuration + examples: + - 2x_nvidia_a100_80gb_sxm + pricing: + $ref: '#/components/schemas/EndpointPricing' + specs: + $ref: '#/components/schemas/HardwareSpec' + availability: + $ref: '#/components/schemas/HardwareAvailability' + updated_at: + type: string + format: date-time + description: Timestamp of when the hardware status was last updated + + CreateEndpointRequest: + type: object + required: + - model + - hardware + - autoscaling + properties: + display_name: + type: string + description: A human-readable name for the endpoint + example: My Llama3 70b endpoint + model: + type: string + description: The model to deploy on this endpoint + example: deepseek-ai/DeepSeek-R1 + hardware: + type: string + description: The hardware configuration to use for this endpoint + example: 1x_nvidia_a100_80gb_sxm + autoscaling: + $ref: '#/components/schemas/Autoscaling' + description: Configuration for automatic scaling of the endpoint + disable_prompt_cache: + deprecated: true + type: boolean + description: This parameter is deprecated and no longer has any effect. + default: false + disable_speculative_decoding: + type: boolean + description: Whether to disable speculative decoding for this endpoint + default: false + state: + type: string + description: The desired state of the endpoint + enum: + - STARTED + - STOPPED + default: STARTED + example: STARTED + inactive_timeout: + type: integer + description: The number of minutes of inactivity after which the endpoint stops automatically. Set to null, omit, or set to 0 to disable automatic timeout. + nullable: true + example: 60 + availability_zone: + type: string + description: Create the endpoint in a specified availability zone (e.g., us-central-4b) + + DedicatedEndpoint: + type: object + description: Details about a dedicated endpoint deployment + required: + - object + - id + - name + - display_name + - model + - hardware + - type + - owner + - state + - autoscaling + - created_at + properties: + object: + description: The object type, which is always `endpoint`. + const: endpoint + id: + type: string + description: Unique identifier for the endpoint + example: endpoint-d23901de-ef8f-44bf-b3e7-de9c1ca8f2d7 + name: + type: string + description: System name for the endpoint + example: devuser/deepseek-ai/DeepSeek-R1-a32b82a1 + display_name: + type: string + description: Human-readable name for the endpoint + example: My DeepSeek R1 endpoint + model: + type: string + description: The model deployed on this endpoint + example: deepseek-ai/DeepSeek-R1 + hardware: + type: string + description: The hardware configuration used for this endpoint + example: 8x_nvidia_h200_140gb_sxm + type: + type: string + enum: + - dedicated + description: The type of endpoint + example: dedicated + owner: + type: string + description: The owner of this endpoint + example: devuser + state: + type: string + enum: + - PENDING + - STARTING + - STARTED + - STOPPING + - STOPPED + - ERROR + description: Current state of the endpoint + example: STARTED + autoscaling: + $ref: '#/components/schemas/Autoscaling' + description: Configuration for automatic scaling of the endpoint + created_at: + type: string + format: date-time + description: Timestamp when the endpoint was created + example: 2025-02-04T10:43:55.405Z + + ListEndpoint: + type: object + description: Details about an endpoint when listed via the list endpoint + required: + - id + - object + - name + - model + - type + - owner + - state + - created_at + properties: + object: + description: The object type, which is always `endpoint`. + const: endpoint + id: + type: string + description: Unique identifier for the endpoint + example: endpoint-d23901de-ef8f-44bf-b3e7-de9c1ca8f2d7 + name: + type: string + description: System name for the endpoint + example: allenai/OLMo-7B + model: + type: string + description: The model deployed on this endpoint + example: allenai/OLMo-7B + type: + type: string + enum: + - serverless + - dedicated + description: The type of endpoint + example: serverless + owner: + type: string + description: The owner of this endpoint + example: together + state: + type: string + enum: + - PENDING + - STARTING + - STARTED + - STOPPING + - STOPPED + - ERROR + description: Current state of the endpoint + example: STARTED + created_at: + type: string + format: date-time + description: Timestamp when the endpoint was created + example: 2024-02-28T21:34:35.444Z + + DisplayorExecuteOutput: + properties: + data: + properties: + application/geo+json: + type: object + application/javascript: + type: string + application/json: + type: object + application/pdf: + format: byte + type: string + application/vnd.vega.v5+json: + type: object + application/vnd.vegalite.v4+json: + type: object + image/gif: + format: byte + type: string + image/jpeg: + format: byte + type: string + image/png: + format: byte + type: string + image/svg+xml: + type: string + text/html: + type: string + text/latex: + type: string + text/markdown: + type: string + text/plain: + type: string + type: object + type: + enum: + - display_data + - execute_result + type: string + required: + - type + - data + title: DisplayorExecuteOutput + + Error: + oneOf: + - type: string + - additionalProperties: true + type: object + title: Error + + ErrorOutput: + title: ErrorOutput + description: Errors and exceptions that occurred. If this output type is present, your code did not execute successfully. + properties: + data: + type: string + type: + enum: + - error + type: string + required: + - type + - data + + ExecuteRequest: + title: ExecuteRequest + required: + - language + - code properties: - method: + code: + description: 'Code snippet to execute.' + example: "print('Hello, world!')" + type: string + files: + description: Files to upload to the session. If present, files are uploaded before executing the given code. + items: + properties: + content: + type: string + encoding: + description: Encoding of the file content. Use `string` for text files such as code, and `base64` for binary files, such as images. + enum: + - string + - base64 + type: string + name: + type: string + required: + - name + - encoding + - content + type: object + type: array + language: + default: python + description: Programming language for the code to execute. Currently only supports Python. + enum: + - python + session_id: + description: Identifier of the current session. Used to make follow-up calls. Returns an error if the session does not belong to the caller or has expired. + example: ses_abcDEF123 + nullable: false type: string - enum: ['dpo'] - dpo_beta: - type: number - default: 0.1 - rpo_alpha: - type: number - default: 0.0 - dpo_normalize_logratios_by_length: - type: boolean - default: false - dpo_reference_free: - type: boolean - default: false - simpo_gamma: - type: number - default: 0.0 - required: - - method - MultimodalParams: + ExecuteResponse: + title: ExecuteResponse type: object + description: 'The result of the execution. If successful, `data` contains the result and `errors` is null. If unsuccessful, `data` is null and `errors` contains the errors.' + oneOf: + - title: SuccessfulExecution + type: object + required: [data, errors] + properties: + errors: + type: 'null' + data: + type: object + nullable: false + required: [session_id, outputs] + properties: + outputs: + type: array + items: + discriminator: + propertyName: type + oneOf: + - title: StreamOutput + description: Outputs that were printed to stdout or stderr + type: object + required: [type, data] + properties: + type: + enum: + - stdout + - stderr + type: string + data: + type: string + - description: Errors and exceptions that occurred. If this output type is present, your code did not execute successfully. + properties: + data: + type: string + type: + enum: + - error + type: string + required: + - type + - data + title: ErrorOutput + - properties: + data: + properties: + application/geo+json: + type: object + additionalProperties: true + application/javascript: + type: string + application/json: + type: object + additionalProperties: true + application/pdf: + format: byte + type: string + application/vnd.vega.v5+json: + type: object + additionalProperties: true + application/vnd.vegalite.v4+json: + type: object + additionalProperties: true + image/gif: + format: byte + type: string + image/jpeg: + format: byte + type: string + image/png: + format: byte + type: string + image/svg+xml: + type: string + text/html: + type: string + text/latex: + type: string + text/markdown: + type: string + text/plain: + type: string + type: object + type: + enum: + - display_data + - execute_result + type: string + required: + - type + - data + title: DisplayorExecuteOutput + title: InterpreterOutput + session_id: + type: string + description: Identifier of the current session. Used to make follow-up calls. + example: ses_abcDEF123 + nullable: false + status: + type: string + enum: + - success + description: Status of the execution. Currently only supports success. + - title: FailedExecution + type: object + required: [data, errors] + properties: + data: + type: 'null' + errors: + type: array + items: + title: Error + oneOf: + - type: string + - type: object + additionalProperties: true + + InterpreterOutput: + discriminator: + propertyName: type + oneOf: + - description: Outputs that were printed to stdout or stderr + properties: + data: + type: string + type: + enum: + - stdout + - stderr + type: string + required: + - type + - data + title: StreamOutput + - description: Errors and exceptions that occurred. If this output type is present, your code did not execute successfully. + properties: + data: + type: string + type: + enum: + - error + type: string + required: + - type + - data + title: ErrorOutput + - properties: + data: + properties: + application/geo+json: + type: object + application/javascript: + type: string + application/json: + type: object + application/pdf: + format: byte + type: string + application/vnd.vega.v5+json: + type: object + application/vnd.vegalite.v4+json: + type: object + image/gif: + format: byte + type: string + image/jpeg: + format: byte + type: string + image/png: + format: byte + type: string + image/svg+xml: + type: string + text/html: + type: string + text/latex: + type: string + text/markdown: + type: string + text/plain: + type: string + type: object + type: + enum: + - display_data + - execute_result + type: string + required: + - type + - data + title: DisplayorExecuteOutput + title: InterpreterOutput + + Response: properties: - train_vision: - type: boolean - description: Whether to train the vision encoder of the model. Only available for multimodal models. + errors: + items: + oneOf: + - type: string + - additionalProperties: true + type: object + title: Error + type: array + title: Response + type: object - LRScheduler: + SessionListResponse: + allOf: + - properties: + errors: + items: + oneOf: + - type: string + - additionalProperties: true + type: object + title: Error + type: array + title: Response + type: object + - properties: + data: + properties: + sessions: + items: + properties: + execute_count: + type: integer + expires_at: + format: date-time + type: string + id: + description: Session Identifier. Used to make follow-up calls. + example: ses_abcDEF123 + type: string + last_execute_at: + format: date-time + type: string + started_at: + format: date-time + type: string + required: + - execute_count + - expires_at + - id + - last_execute_at + - started_at + type: object + type: array + required: + - sessions + type: object + title: SessionListResponse type: object + + StreamOutput: + description: Outputs that were printed to stdout or stderr properties: - lr_scheduler_type: + data: type: string + type: enum: - - linear - - cosine - lr_scheduler_args: - oneOf: - - $ref: '#/components/schemas/LinearLRSchedulerArgs' - - $ref: '#/components/schemas/CosineLRSchedulerArgs' - required: - - lr_scheduler_type - CosineLRSchedulerArgs: - type: object - properties: - min_lr_ratio: - type: number - default: 0.0 - description: The ratio of the final learning rate to the peak learning rate - num_cycles: - type: number - default: 0.5 - description: Number or fraction of cycles for the cosine learning rate scheduler + - stdout + - stderr + type: string required: - - min_lr_ratio - - num_cycles - LinearLRSchedulerArgs: - type: object - properties: - min_lr_ratio: - type: number - default: 0.0 - description: The ratio of the final learning rate to the peak learning rate + - type + - data + title: StreamOutput CreateBatchRequest: type: object @@ -17921,6 +27478,20 @@ components: media: $ref: '#/components/schemas/VideoMedia' description: Media inputs for video generation. The accepted fields depend on the model type (e.g. i2v, r2v, t2v, videoedit). + frame_images: + deprecated: true + description: "Deprecated: use media.frame_images instead. Array of images to guide video generation, similar to keyframes." + example: + - [{"input_image": "aac49721-1964-481a-ae78-8a4e29b91402", "frame": 0}, {"input_image": "c00abf5f-6cdb-4642-a01d-1bfff7bc3cf7", "frame": 48}, {"input_image": "3ad204c3-a9de-4963-8a1a-c3911e3afafe", "frame": "last"}] + type: array + items: + $ref: '#/components/schemas/VideoFrameImageInput' + reference_images: + deprecated: true + description: "Deprecated: use media.reference_images instead. Unlike frame_images which constrain specific timeline positions, reference images guide the general appearance that should appear consistently across the video." + type: array + items: + type: string VideoStatus: description: Current lifecycle status of the video job. type: string @@ -19216,160 +28787,38 @@ components: type: string type: array type: object - WhoamiApiKey: - type: object - required: - - id - properties: - id: - type: string - description: The authenticated API key identifier. - WhoamiOrganization: + WhoamiResponse: type: object required: - - id - - name + - api_key_id + - project_id + - project_name + - project_slug + - organization_id + - organization_name properties: - id: + api_key_id: type: string - description: Organization identifier. - name: - type: string - description: Organization display name. - WhoamiProject: - type: object - required: - - id - - name - - slug - properties: - id: + description: The ID of the API key that authenticated the request. + project_id: type: string - description: Project identifier. - name: + description: The ID of the project the API key is scoped to. + project_name: type: string - description: Project display name. - slug: + description: Human-readable name of the project. + project_slug: type: string description: > DNS-friendly project identifier. Used with an endpoint slug as `/` to form the `model` value in dedicated endpoint inference calls. - WhoamiUser: - type: object - required: - - id - properties: - id: - type: string - description: Authenticated user identifier. - WhoamiProjectApiKey: - type: object - title: Project API key - required: - - type - - api_key - - organization - - project - properties: - type: - type: string - description: Always `project_api_key`. - enum: - - project_api_key - x-stainless-const: true - api_key: - $ref: '#/components/schemas/WhoamiApiKey' - organization: - $ref: '#/components/schemas/WhoamiOrganization' - project: - $ref: '#/components/schemas/WhoamiProject' - WhoamiOrgApiKey: - type: object - title: Organization API key - required: - - type - - api_key - - organization - properties: - type: - type: string - description: Always `org_api_key`. - enum: - - org_api_key - x-stainless-const: true - api_key: - $ref: '#/components/schemas/WhoamiApiKey' - organization: - $ref: '#/components/schemas/WhoamiOrganization' - WhoamiUserJwt: - type: object - title: User JWT - required: - - type - - user - properties: - type: + organization_id: type: string - description: Always `user_jwt`. - enum: - - user_jwt - x-stainless-const: true - user: - $ref: '#/components/schemas/WhoamiUser' - WhoamiUserOrgJwt: - type: object - title: User organization JWT - required: - - type - - user - - organization - properties: - type: + description: The ID of the organization that owns the project. + organization_name: type: string - description: Always `user_org_jwt`. - enum: - - user_org_jwt - x-stainless-const: true - user: - $ref: '#/components/schemas/WhoamiUser' - organization: - $ref: '#/components/schemas/WhoamiOrganization' - WhoamiUserOrgProjectJwt: - type: object - title: User organization project JWT - required: - - type - - user - - organization - - project - properties: - type: + description: Human-readable name of the organization. + user_id: type: string - description: Always `user_org_project_jwt`. - enum: - - user_org_project_jwt - x-stainless-const: true - user: - $ref: '#/components/schemas/WhoamiUser' - organization: - $ref: '#/components/schemas/WhoamiOrganization' - project: - $ref: '#/components/schemas/WhoamiProject' - WhoamiResponse: - description: The caller. `type` names the variant and which fields are present. - discriminator: - propertyName: type - mapping: - project_api_key: '#/components/schemas/WhoamiProjectApiKey' - org_api_key: '#/components/schemas/WhoamiOrgApiKey' - user_jwt: '#/components/schemas/WhoamiUserJwt' - user_org_jwt: '#/components/schemas/WhoamiUserOrgJwt' - user_org_project_jwt: '#/components/schemas/WhoamiUserOrgProjectJwt' - oneOf: - - $ref: '#/components/schemas/WhoamiProjectApiKey' - - $ref: '#/components/schemas/WhoamiOrgApiKey' - - $ref: '#/components/schemas/WhoamiUserJwt' - - $ref: '#/components/schemas/WhoamiUserOrgJwt' - - $ref: '#/components/schemas/WhoamiUserOrgProjectJwt' + description: The ID of the authenticated user, if available. Project: type: object description: A project the authenticated caller can access.