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
22 changes: 22 additions & 0 deletions src/libs/Weave/Generated/Weave.Models.CostCreateInput.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,18 @@ public sealed partial class CostCreateInput
[global::System.Text.Json.Serialization.JsonRequired]
public required double CompletionTokenCost { get; set; }

/// <summary>
/// Default Value: 0
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("cache_read_input_token_cost")]
public double? CacheReadInputTokenCost { get; set; }

/// <summary>
/// Default Value: 0
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("cache_creation_input_token_cost")]
public double? CacheCreationInputTokenCost { get; set; }

/// <summary>
/// The unit of the cost for the prompt tokens<br/>
/// Default Value: USD
Expand Down Expand Up @@ -59,6 +71,12 @@ public sealed partial class CostCreateInput
/// </summary>
/// <param name="promptTokenCost"></param>
/// <param name="completionTokenCost"></param>
/// <param name="cacheReadInputTokenCost">
/// Default Value: 0
/// </param>
/// <param name="cacheCreationInputTokenCost">
/// Default Value: 0
/// </param>
/// <param name="promptTokenCostUnit">
/// The unit of the cost for the prompt tokens<br/>
/// Default Value: USD
Expand All @@ -79,13 +97,17 @@ public sealed partial class CostCreateInput
public CostCreateInput(
double promptTokenCost,
double completionTokenCost,
double? cacheReadInputTokenCost,
double? cacheCreationInputTokenCost,
string? promptTokenCostUnit,
string? completionTokenCostUnit,
global::System.DateTime? effectiveDate,
string? providerId)
{
this.PromptTokenCost = promptTokenCost;
this.CompletionTokenCost = completionTokenCost;
this.CacheReadInputTokenCost = cacheReadInputTokenCost;
this.CacheCreationInputTokenCost = cacheCreationInputTokenCost;
this.PromptTokenCostUnit = promptTokenCostUnit;
this.CompletionTokenCostUnit = completionTokenCostUnit;
this.EffectiveDate = effectiveDate;
Expand Down
42 changes: 41 additions & 1 deletion src/libs/Weave/Generated/Weave.Models.LLMAggregatedUsage.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,18 @@ public sealed partial class LLMAggregatedUsage
[global::System.Text.Json.Serialization.JsonPropertyName("total_tokens")]
public int? TotalTokens { get; set; }

/// <summary>
/// Default Value: 0
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("cache_read_input_tokens")]
public int? CacheReadInputTokens { get; set; }

/// <summary>
/// Default Value: 0
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("cache_creation_input_tokens")]
public int? CacheCreationInputTokens { get; set; }

/// <summary>
///
/// </summary>
Expand All @@ -44,6 +56,18 @@ public sealed partial class LLMAggregatedUsage
[global::System.Text.Json.Serialization.JsonPropertyName("completion_tokens_total_cost")]
public double? CompletionTokensTotalCost { get; set; }

/// <summary>
///
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("cache_read_input_tokens_total_cost")]
public double? CacheReadInputTokensTotalCost { get; set; }

/// <summary>
///
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("cache_creation_input_tokens_total_cost")]
public double? CacheCreationInputTokensTotalCost { get; set; }

/// <summary>
/// Additional properties that are not explicitly defined in the schema
/// </summary>
Expand All @@ -65,8 +89,16 @@ public sealed partial class LLMAggregatedUsage
/// <param name="totalTokens">
/// Default Value: 0
/// </param>
/// <param name="cacheReadInputTokens">
/// Default Value: 0
/// </param>
/// <param name="cacheCreationInputTokens">
/// Default Value: 0
/// </param>
/// <param name="promptTokensTotalCost"></param>
/// <param name="completionTokensTotalCost"></param>
/// <param name="cacheReadInputTokensTotalCost"></param>
/// <param name="cacheCreationInputTokensTotalCost"></param>
#if NET7_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
#endif
Expand All @@ -75,15 +107,23 @@ public LLMAggregatedUsage(
int? promptTokens,
int? completionTokens,
int? totalTokens,
int? cacheReadInputTokens,
int? cacheCreationInputTokens,
double? promptTokensTotalCost,
double? completionTokensTotalCost)
double? completionTokensTotalCost,
double? cacheReadInputTokensTotalCost,
double? cacheCreationInputTokensTotalCost)
{
this.Requests = requests;
this.PromptTokens = promptTokens;
this.CompletionTokens = completionTokens;
this.TotalTokens = totalTokens;
this.CacheReadInputTokens = cacheReadInputTokens;
this.CacheCreationInputTokens = cacheCreationInputTokens;
this.PromptTokensTotalCost = promptTokensTotalCost;
this.CompletionTokensTotalCost = completionTokensTotalCost;
this.CacheReadInputTokensTotalCost = cacheReadInputTokensTotalCost;
this.CacheCreationInputTokensTotalCost = cacheCreationInputTokensTotalCost;
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
#nullable enable

namespace Weave
{
public sealed partial class LLMAggregatedUsageCacheCreationInputTokensTotalCost
{
/// <summary>
/// Serializes the current instance to a JSON string using the provided JsonSerializerContext.
/// </summary>
public string ToJson(
global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext)
{
return global::System.Text.Json.JsonSerializer.Serialize(
this,
this.GetType(),
jsonSerializerContext);
}

/// <summary>
/// Serializes the current instance to a JSON string using the provided JsonSerializerOptions.
/// </summary>
#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)
{
return global::System.Text.Json.JsonSerializer.Serialize(
this,
jsonSerializerOptions);
}

/// <summary>
/// Deserializes a JSON string using the provided JsonSerializerContext.
/// </summary>
public static global::Weave.LLMAggregatedUsageCacheCreationInputTokensTotalCost? FromJson(
string json,
global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext)
{
return global::System.Text.Json.JsonSerializer.Deserialize(
json,
typeof(global::Weave.LLMAggregatedUsageCacheCreationInputTokensTotalCost),
jsonSerializerContext) as global::Weave.LLMAggregatedUsageCacheCreationInputTokensTotalCost;
}

/// <summary>
/// Deserializes a JSON string using the provided JsonSerializerOptions.
/// </summary>
#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::Weave.LLMAggregatedUsageCacheCreationInputTokensTotalCost? FromJson(
string json,
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null)
{
return global::System.Text.Json.JsonSerializer.Deserialize<global::Weave.LLMAggregatedUsageCacheCreationInputTokensTotalCost>(
json,
jsonSerializerOptions);
}

/// <summary>
/// Deserializes a JSON stream using the provided JsonSerializerContext.
/// </summary>
public static async global::System.Threading.Tasks.ValueTask<global::Weave.LLMAggregatedUsageCacheCreationInputTokensTotalCost?> FromJsonStreamAsync(
global::System.IO.Stream jsonStream,
global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext)
{
return (await global::System.Text.Json.JsonSerializer.DeserializeAsync(
jsonStream,
typeof(global::Weave.LLMAggregatedUsageCacheCreationInputTokensTotalCost),
jsonSerializerContext).ConfigureAwait(false)) as global::Weave.LLMAggregatedUsageCacheCreationInputTokensTotalCost;
}

/// <summary>
/// Deserializes a JSON stream using the provided JsonSerializerOptions.
/// </summary>
#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<global::Weave.LLMAggregatedUsageCacheCreationInputTokensTotalCost?> FromJsonStreamAsync(
global::System.IO.Stream jsonStream,
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null)
{
return global::System.Text.Json.JsonSerializer.DeserializeAsync<global::Weave.LLMAggregatedUsageCacheCreationInputTokensTotalCost?>(
jsonStream,
jsonSerializerOptions);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

#nullable enable

namespace Weave
{
/// <summary>
///
/// </summary>
public sealed partial class LLMAggregatedUsageCacheCreationInputTokensTotalCost
{

/// <summary>
/// Additional properties that are not explicitly defined in the schema
/// </summary>
[global::System.Text.Json.Serialization.JsonExtensionData]
public global::System.Collections.Generic.IDictionary<string, object> AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary<string, object>();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
#nullable enable

namespace Weave
{
public sealed partial class LLMAggregatedUsageCacheReadInputTokensTotalCost
{
/// <summary>
/// Serializes the current instance to a JSON string using the provided JsonSerializerContext.
/// </summary>
public string ToJson(
global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext)
{
return global::System.Text.Json.JsonSerializer.Serialize(
this,
this.GetType(),
jsonSerializerContext);
}

/// <summary>
/// Serializes the current instance to a JSON string using the provided JsonSerializerOptions.
/// </summary>
#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)
{
return global::System.Text.Json.JsonSerializer.Serialize(
this,
jsonSerializerOptions);
}

/// <summary>
/// Deserializes a JSON string using the provided JsonSerializerContext.
/// </summary>
public static global::Weave.LLMAggregatedUsageCacheReadInputTokensTotalCost? FromJson(
string json,
global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext)
{
return global::System.Text.Json.JsonSerializer.Deserialize(
json,
typeof(global::Weave.LLMAggregatedUsageCacheReadInputTokensTotalCost),
jsonSerializerContext) as global::Weave.LLMAggregatedUsageCacheReadInputTokensTotalCost;
}

/// <summary>
/// Deserializes a JSON string using the provided JsonSerializerOptions.
/// </summary>
#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::Weave.LLMAggregatedUsageCacheReadInputTokensTotalCost? FromJson(
string json,
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null)
{
return global::System.Text.Json.JsonSerializer.Deserialize<global::Weave.LLMAggregatedUsageCacheReadInputTokensTotalCost>(
json,
jsonSerializerOptions);
}

/// <summary>
/// Deserializes a JSON stream using the provided JsonSerializerContext.
/// </summary>
public static async global::System.Threading.Tasks.ValueTask<global::Weave.LLMAggregatedUsageCacheReadInputTokensTotalCost?> FromJsonStreamAsync(
global::System.IO.Stream jsonStream,
global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext)
{
return (await global::System.Text.Json.JsonSerializer.DeserializeAsync(
jsonStream,
typeof(global::Weave.LLMAggregatedUsageCacheReadInputTokensTotalCost),
jsonSerializerContext).ConfigureAwait(false)) as global::Weave.LLMAggregatedUsageCacheReadInputTokensTotalCost;
}

/// <summary>
/// Deserializes a JSON stream using the provided JsonSerializerOptions.
/// </summary>
#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<global::Weave.LLMAggregatedUsageCacheReadInputTokensTotalCost?> FromJsonStreamAsync(
global::System.IO.Stream jsonStream,
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null)
{
return global::System.Text.Json.JsonSerializer.DeserializeAsync<global::Weave.LLMAggregatedUsageCacheReadInputTokensTotalCost?>(
jsonStream,
jsonSerializerOptions);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

#nullable enable

namespace Weave
{
/// <summary>
///
/// </summary>
public sealed partial class LLMAggregatedUsageCacheReadInputTokensTotalCost
{

/// <summary>
/// Additional properties that are not explicitly defined in the schema
/// </summary>
[global::System.Text.Json.Serialization.JsonExtensionData]
public global::System.Collections.Generic.IDictionary<string, object> AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary<string, object>();
}
}
12 changes: 12 additions & 0 deletions src/libs/Weave/Generated/Weave.Models.UsageMetricSpecMetric.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ namespace Weave
/// </summary>
public enum UsageMetricSpecMetric
{
/// <summary>
///
/// </summary>
CacheCreationInputTokens,
/// <summary>
///
/// </summary>
CacheReadInputTokens,
/// <summary>
///
/// </summary>
Expand Down Expand Up @@ -46,6 +54,8 @@ public static string ToValueString(this UsageMetricSpecMetric value)
{
return value switch
{
UsageMetricSpecMetric.CacheCreationInputTokens => "cache_creation_input_tokens",
UsageMetricSpecMetric.CacheReadInputTokens => "cache_read_input_tokens",
UsageMetricSpecMetric.InputCost => "input_cost",
UsageMetricSpecMetric.InputTokens => "input_tokens",
UsageMetricSpecMetric.OutputCost => "output_cost",
Expand All @@ -62,6 +72,8 @@ public static string ToValueString(this UsageMetricSpecMetric value)
{
return value switch
{
"cache_creation_input_tokens" => UsageMetricSpecMetric.CacheCreationInputTokens,
"cache_read_input_tokens" => UsageMetricSpecMetric.CacheReadInputTokens,
"input_cost" => UsageMetricSpecMetric.InputCost,
"input_tokens" => UsageMetricSpecMetric.InputTokens,
"output_cost" => UsageMetricSpecMetric.OutputCost,
Expand Down
Loading