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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,7 @@
#nullable enable

namespace Together
{
/// <summary>
///
/// </summary>
[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<string, string>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary<string, object>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List<object>), 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::Together.DeABExperimentMember>))]
[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::Together.DeABExperiment>))]
[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::Together.DeABExperimentMember>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List<global::Together.DeABExperiment>))]
internal sealed partial class ABExperimentServiceSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext
{
}
/// <summary>
{ /// <summary>
///
/// </summary>
public sealed partial class ABExperimentServiceSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext
Expand Down Expand Up @@ -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<string, int?>());
options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter<string, int?>());
options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter<string, int?>());
options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter<string, int?>());
options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter<string, int?>());
options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter<string, int?>());
options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter<string, int?>());
options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter<string, int?>());
options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter<string, int?>());
options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter<string, int?>());
options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter<string, int?>());
options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter<string, int?>());
options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter<string, int?>());
options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter<string, long?>());
options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter<global::System.Collections.Generic.IList<object>, global::System.Collections.Generic.IList<string>>());
options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter<byte[], string>());
options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter<byte[], string>());
options.Converters.Add(new global::Together.JsonConverters.OneOfJsonConverter<string, global::System.Collections.Generic.IList<string>>());
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()
Expand All @@ -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();
Expand Down Expand Up @@ -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)),
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -59,6 +67,29 @@ partial void ProcessABExperimentServiceCreateABExperimentResponseContent(
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::Together.ApiException"></exception>
/// <remarks>
/// from together import Together<br/>
/// client = Together()<br/>
/// project_id = client.whoami().project_id<br/>
/// experiment = client.beta.endpoints.ab_experiments.create(<br/>
/// "ep_abc123",<br/>
/// project_id=project_id,<br/>
/// name="new-config-test",<br/>
/// members=[<br/>
/// {<br/>
/// "deployment_id": "dep_abc123",<br/>
/// "role": "AB_EXPERIMENT_MEMBER_ROLE_CONTROL",<br/>
/// "percent": 90,<br/>
/// },<br/>
/// {<br/>
/// "deployment_id": "dep_def456",<br/>
/// "role": "AB_EXPERIMENT_MEMBER_ROLE_VARIANT",<br/>
/// "percent": 10,<br/>
/// },<br/>
/// ],<br/>
/// )<br/>
/// print(experiment.id)
/// </remarks>
public async global::System.Threading.Tasks.Task<global::Together.DeABExperiment> ABExperimentServiceCreateABExperimentAsync(
string projectId,
string endpointId,
Expand Down Expand Up @@ -92,6 +123,29 @@ partial void ProcessABExperimentServiceCreateABExperimentResponseContent(
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::Together.ApiException"></exception>
/// <remarks>
/// from together import Together<br/>
/// client = Together()<br/>
/// project_id = client.whoami().project_id<br/>
/// experiment = client.beta.endpoints.ab_experiments.create(<br/>
/// "ep_abc123",<br/>
/// project_id=project_id,<br/>
/// name="new-config-test",<br/>
/// members=[<br/>
/// {<br/>
/// "deployment_id": "dep_abc123",<br/>
/// "role": "AB_EXPERIMENT_MEMBER_ROLE_CONTROL",<br/>
/// "percent": 90,<br/>
/// },<br/>
/// {<br/>
/// "deployment_id": "dep_def456",<br/>
/// "role": "AB_EXPERIMENT_MEMBER_ROLE_VARIANT",<br/>
/// "percent": 10,<br/>
/// },<br/>
/// ],<br/>
/// )<br/>
/// print(experiment.id)
/// </remarks>
public async global::System.Threading.Tasks.Task<global::Together.AutoSDKHttpResponse<global::Together.DeABExperiment>> ABExperimentServiceCreateABExperimentAsResponseAsync(
string projectId,
string endpointId,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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."),
Expand Down Expand Up @@ -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."),
Expand Down Expand Up @@ -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."),
Expand Down Expand Up @@ -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."),
Expand All @@ -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."),
Expand Down
Loading
Loading