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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ namespace SmallestAI
[global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(double))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary<string, double>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.WavesV1ChatCompletionsPostParametersXExpireContent), TypeInfoPropertyName = "WavesV1ChatCompletionsPostParametersXExpireContent2")]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.ElectronToolCallType), TypeInfoPropertyName = "ElectronToolCallType2")]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.ElectronToolCallFunction))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.ElectronToolCall))]
Expand Down Expand Up @@ -51,6 +52,7 @@ namespace SmallestAI
[global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(double?))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.WavesV1ChatCompletionsPostParametersXExpireContent?), TypeInfoPropertyName = "NullableWavesV1ChatCompletionsPostParametersXExpireContent2")]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.ElectronToolCallType?), TypeInfoPropertyName = "NullableElectronToolCallType2")]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.ChatCompletionRequestToolChoice0?), TypeInfoPropertyName = "NullableChatCompletionRequestToolChoice02")]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.ChatCompletionRequestToolChoiceOneOf1Type?), TypeInfoPropertyName = "NullableChatCompletionRequestToolChoiceOneOf1Type2")]
Expand Down Expand Up @@ -135,7 +137,11 @@ private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Ser
public override bool CanConvert(global::System.Type typeToConvert)
{
return
typeToConvert == typeof(global::SmallestAI.ElectronToolCallType)
typeToConvert == typeof(global::SmallestAI.WavesV1ChatCompletionsPostParametersXExpireContent)

|| typeToConvert == typeof(global::SmallestAI.WavesV1ChatCompletionsPostParametersXExpireContent?)

|| typeToConvert == typeof(global::SmallestAI.ElectronToolCallType)

|| typeToConvert == typeof(global::SmallestAI.ElectronToolCallType?)

Expand Down Expand Up @@ -164,6 +170,16 @@ public override bool CanConvert(global::System.Type typeToConvert)
global::System.Type typeToConvert,
global::System.Text.Json.JsonSerializerOptions options)
{
if (typeToConvert == typeof(global::SmallestAI.WavesV1ChatCompletionsPostParametersXExpireContent))
{
return new global::SmallestAI.JsonConverters.WavesV1ChatCompletionsPostParametersXExpireContentJsonConverter();
}

if (typeToConvert == typeof(global::SmallestAI.WavesV1ChatCompletionsPostParametersXExpireContent?))
{
return new global::SmallestAI.JsonConverters.WavesV1ChatCompletionsPostParametersXExpireContentNullableJsonConverter();
}

if (typeToConvert == typeof(global::SmallestAI.ElectronToolCallType))
{
return new global::SmallestAI.JsonConverters.ElectronToolCallTypeJsonConverter();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@ public partial class ElectronClient
};
partial void PrepareCompleteArguments(
global::System.Net.Http.HttpClient httpClient,
ref global::SmallestAI.WavesV1ChatCompletionsPostParametersXExpireContent? xExpireContent,
global::SmallestAI.ChatCompletionRequest request);
partial void PrepareCompleteRequest(
global::System.Net.Http.HttpClient httpClient,
global::System.Net.Http.HttpRequestMessage httpRequestMessage,
global::SmallestAI.WavesV1ChatCompletionsPostParametersXExpireContent? xExpireContent,
global::SmallestAI.ChatCompletionRequest request);
partial void ProcessCompleteResponse(
global::System.Net.Http.HttpClient httpClient,
Expand Down Expand Up @@ -119,19 +121,22 @@ partial void ProcessCompleteResponseContent(
/// - **`n &gt; 1` and `prompt_logprobs` are rejected.** Use multiple requests if you need parallel completions.<br/>
/// - **Auth header is `Authorization: Bearer $SMALLEST_API_KEY`** — get the key from the [Smallest AI Console](https://app.smallest.ai/dashboard/api-keys).
/// </summary>
/// <param name="xExpireContent"></param>
/// <param name="request"></param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::SmallestAI.ApiException"></exception>
public async global::System.Threading.Tasks.Task<global::SmallestAI.ChatCompletion> CompleteAsync(

global::SmallestAI.ChatCompletionRequest request,
global::SmallestAI.WavesV1ChatCompletionsPostParametersXExpireContent? xExpireContent = default,
global::SmallestAI.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
var __response = await CompleteAsResponseAsync(

request: request,
xExpireContent: xExpireContent,
requestOptions: requestOptions,
cancellationToken: cancellationToken
).ConfigureAwait(false);
Expand Down Expand Up @@ -216,13 +221,15 @@ partial void ProcessCompleteResponseContent(
/// - **`n &gt; 1` and `prompt_logprobs` are rejected.** Use multiple requests if you need parallel completions.<br/>
/// - **Auth header is `Authorization: Bearer $SMALLEST_API_KEY`** — get the key from the [Smallest AI Console](https://app.smallest.ai/dashboard/api-keys).
/// </summary>
/// <param name="xExpireContent"></param>
/// <param name="request"></param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::SmallestAI.ApiException"></exception>
public async global::System.Threading.Tasks.Task<global::SmallestAI.AutoSDKHttpResponse<global::SmallestAI.ChatCompletion>> CompleteAsResponseAsync(

global::SmallestAI.ChatCompletionRequest request,
global::SmallestAI.WavesV1ChatCompletionsPostParametersXExpireContent? xExpireContent = default,
global::SmallestAI.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
Expand All @@ -232,6 +239,7 @@ partial void ProcessCompleteResponseContent(
client: HttpClient);
PrepareCompleteArguments(
httpClient: HttpClient,
xExpireContent: ref xExpireContent,
request: request);


Expand Down Expand Up @@ -289,6 +297,12 @@ partial void ProcessCompleteResponseContent(
__httpRequest.Headers.Add(__authorization.Name, __authorization.Value);
}
}

if (xExpireContent != default)
{
__httpRequest.Headers.TryAddWithoutValidation("x-expire-content", xExpireContent?.ToValueString() ?? string.Empty);
}

var __httpRequestContentBody = request.ToJson(JsonSerializerContext);
var __httpRequestContent = new global::System.Net.Http.StringContent(
content: __httpRequestContentBody,
Expand All @@ -306,6 +320,7 @@ partial void ProcessCompleteResponseContent(
PrepareCompleteRequest(
httpClient: HttpClient,
httpRequestMessage: __httpRequest,
xExpireContent: xExpireContent,
request: request);

return __httpRequest;
Expand Down Expand Up @@ -881,6 +896,7 @@ partial void ProcessCompleteResponseContent(
/// - **`n &gt; 1` and `prompt_logprobs` are rejected.** Use multiple requests if you need parallel completions.<br/>
/// - **Auth header is `Authorization: Bearer $SMALLEST_API_KEY`** — get the key from the [Smallest AI Console](https://app.smallest.ai/dashboard/api-keys).
/// </summary>
/// <param name="xExpireContent"></param>
/// <param name="model">
/// Model ID. Currently only `"electron"`.
/// </param>
Expand Down Expand Up @@ -942,6 +958,7 @@ partial void ProcessCompleteResponseContent(
public async global::System.Threading.Tasks.Task<global::SmallestAI.ChatCompletion> CompleteAsync(
string model,
global::System.Collections.Generic.IList<global::SmallestAI.ElectronMessage> messages,
global::SmallestAI.WavesV1ChatCompletionsPostParametersXExpireContent? xExpireContent = default,
double? temperature = default,
double? topP = default,
int? maxTokens = default,
Expand Down Expand Up @@ -984,6 +1001,7 @@ partial void ProcessCompleteResponseContent(
};

return await CompleteAsync(
xExpireContent: xExpireContent,
request: __request,
requestOptions: requestOptions,
cancellationToken: cancellationToken).ConfigureAwait(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,15 @@ public partial interface IElectronClient
/// - **`n &gt; 1` and `prompt_logprobs` are rejected.** Use multiple requests if you need parallel completions.<br/>
/// - **Auth header is `Authorization: Bearer $SMALLEST_API_KEY`** — get the key from the [Smallest AI Console](https://app.smallest.ai/dashboard/api-keys).
/// </summary>
/// <param name="xExpireContent"></param>
/// <param name="request"></param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::SmallestAI.ApiException"></exception>
global::System.Threading.Tasks.Task<global::SmallestAI.ChatCompletion> CompleteAsync(

global::SmallestAI.ChatCompletionRequest request,
global::SmallestAI.WavesV1ChatCompletionsPostParametersXExpireContent? xExpireContent = default,
global::SmallestAI.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
/// <summary>
Expand Down Expand Up @@ -169,13 +171,15 @@ public partial interface IElectronClient
/// - **`n &gt; 1` and `prompt_logprobs` are rejected.** Use multiple requests if you need parallel completions.<br/>
/// - **Auth header is `Authorization: Bearer $SMALLEST_API_KEY`** — get the key from the [Smallest AI Console](https://app.smallest.ai/dashboard/api-keys).
/// </summary>
/// <param name="xExpireContent"></param>
/// <param name="request"></param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::SmallestAI.ApiException"></exception>
global::System.Threading.Tasks.Task<global::SmallestAI.AutoSDKHttpResponse<global::SmallestAI.ChatCompletion>> CompleteAsResponseAsync(

global::SmallestAI.ChatCompletionRequest request,
global::SmallestAI.WavesV1ChatCompletionsPostParametersXExpireContent? xExpireContent = default,
global::SmallestAI.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
/// <summary>
Expand Down Expand Up @@ -256,6 +260,7 @@ public partial interface IElectronClient
/// - **`n &gt; 1` and `prompt_logprobs` are rejected.** Use multiple requests if you need parallel completions.<br/>
/// - **Auth header is `Authorization: Bearer $SMALLEST_API_KEY`** — get the key from the [Smallest AI Console](https://app.smallest.ai/dashboard/api-keys).
/// </summary>
/// <param name="xExpireContent"></param>
/// <param name="model">
/// Model ID. Currently only `"electron"`.
/// </param>
Expand Down Expand Up @@ -317,6 +322,7 @@ public partial interface IElectronClient
global::System.Threading.Tasks.Task<global::SmallestAI.ChatCompletion> CompleteAsync(
string model,
global::System.Collections.Generic.IList<global::SmallestAI.ElectronMessage> messages,
global::SmallestAI.WavesV1ChatCompletionsPostParametersXExpireContent? xExpireContent = default,
double? temperature = default,
double? topP = default,
int? maxTokens = default,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#nullable enable

namespace SmallestAI.JsonConverters
{
/// <inheritdoc />
public sealed class WavesV1ChatCompletionsPostParametersXExpireContentJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::SmallestAI.WavesV1ChatCompletionsPostParametersXExpireContent>
{
/// <inheritdoc />
public override global::SmallestAI.WavesV1ChatCompletionsPostParametersXExpireContent 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::SmallestAI.WavesV1ChatCompletionsPostParametersXExpireContentExtensions.ToEnum(stringValue) ?? default;
}

break;
}
case global::System.Text.Json.JsonTokenType.Number:
{
var numValue = reader.GetInt32();
return (global::SmallestAI.WavesV1ChatCompletionsPostParametersXExpireContent)numValue;
}
case global::System.Text.Json.JsonTokenType.Null:
{
return default(global::SmallestAI.WavesV1ChatCompletionsPostParametersXExpireContent);
}
default:
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
}

return default;
}

/// <inheritdoc />
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
global::SmallestAI.WavesV1ChatCompletionsPostParametersXExpireContent value,
global::System.Text.Json.JsonSerializerOptions options)
{
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));

writer.WriteStringValue(global::SmallestAI.WavesV1ChatCompletionsPostParametersXExpireContentExtensions.ToValueString(value));
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#nullable enable

namespace SmallestAI.JsonConverters
{
/// <inheritdoc />
public sealed class WavesV1ChatCompletionsPostParametersXExpireContentNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::SmallestAI.WavesV1ChatCompletionsPostParametersXExpireContent?>
{
/// <inheritdoc />
public override global::SmallestAI.WavesV1ChatCompletionsPostParametersXExpireContent? 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::SmallestAI.WavesV1ChatCompletionsPostParametersXExpireContentExtensions.ToEnum(stringValue);
}

break;
}
case global::System.Text.Json.JsonTokenType.Number:
{
var numValue = reader.GetInt32();
return (global::SmallestAI.WavesV1ChatCompletionsPostParametersXExpireContent)numValue;
}
case global::System.Text.Json.JsonTokenType.Null:
{
return default(global::SmallestAI.WavesV1ChatCompletionsPostParametersXExpireContent?);
}
default:
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
}

return default;
}

/// <inheritdoc />
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
global::SmallestAI.WavesV1ChatCompletionsPostParametersXExpireContent? 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::SmallestAI.WavesV1ChatCompletionsPostParametersXExpireContentExtensions.ToValueString(value.Value));
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ namespace SmallestAI

typeof(global::SmallestAI.JsonConverters.SttErrorResponseStatusNullableJsonConverter),

typeof(global::SmallestAI.JsonConverters.WavesV1ChatCompletionsPostParametersXExpireContentJsonConverter),

typeof(global::SmallestAI.JsonConverters.WavesV1ChatCompletionsPostParametersXExpireContentNullableJsonConverter),

typeof(global::SmallestAI.JsonConverters.ElectronToolCallTypeJsonConverter),

typeof(global::SmallestAI.JsonConverters.ElectronToolCallTypeNullableJsonConverter),
Expand Down Expand Up @@ -249,6 +253,7 @@ namespace SmallestAI
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList<global::SmallestAI.SttErrorResponseErrorsOneOf0Items>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.SttErrorResponseErrors), TypeInfoPropertyName = "SttErrorResponseErrors2")]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.SttErrorResponse))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.WavesV1ChatCompletionsPostParametersXExpireContent), TypeInfoPropertyName = "WavesV1ChatCompletionsPostParametersXExpireContent2")]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.ElectronToolCallType), TypeInfoPropertyName = "ElectronToolCallType2")]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.ElectronToolCallFunction))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::SmallestAI.ElectronToolCall))]
Expand Down
Loading
Loading