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 @@ -56,6 +56,9 @@ public partial interface IPredictionsClient
/// <param name="evaluationRunId">
/// Optional evaluation run ID to link this prediction as a child call
/// </param>
/// <param name="genaiSpanRef">
/// Optional GenAI span reference produced by this prediction.
/// </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::System.InvalidOperationException"></exception>
Expand All @@ -66,6 +69,7 @@ public partial interface IPredictionsClient
object inputs,
object output,
string? evaluationRunId = default,
global::Weave.GenAISpanRef? genaiSpanRef = default,
global::Weave.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
}
Expand Down
1 change: 1 addition & 0 deletions src/libs/Weave/Generated/Weave.JsonSerializerContext.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ namespace Weave
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Weave.EvalResultsSortByMode), TypeInfoPropertyName = "EvalResultsSortByMode2")]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList<global::Weave.EvalResultsEvaluationSummary>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary<string, string>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Weave.GenAISpanRef))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Weave.EvaluateModelReq))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Weave.EvaluateModelRes))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Weave.EvaluationCreateBody))]
Expand Down
322 changes: 163 additions & 159 deletions src/libs/Weave/Generated/Weave.JsonSerializerContextTypes.g.cs

Large diffs are not rendered by default.

11 changes: 10 additions & 1 deletion src/libs/Weave/Generated/Weave.Models.EvalResultsTrial.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ public sealed partial class EvalResultsTrial
[global::System.Text.Json.Serialization.JsonPropertyName("scorer_call_ids")]
public global::System.Collections.Generic.Dictionary<string, string>? ScorerCallIds { get; set; }

/// <summary>
///
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("genai_span_ref")]
public global::Weave.GenAISpanRef? GenaiSpanRef { get; set; }

/// <summary>
/// Additional properties that are not explicitly defined in the schema
/// </summary>
Expand All @@ -67,6 +73,7 @@ public sealed partial class EvalResultsTrial
/// <param name="modelLatencySeconds"></param>
/// <param name="totalTokens"></param>
/// <param name="scorerCallIds"></param>
/// <param name="genaiSpanRef"></param>
#if NET7_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
#endif
Expand All @@ -77,7 +84,8 @@ public EvalResultsTrial(
object? scores,
double? modelLatencySeconds,
int? totalTokens,
global::System.Collections.Generic.Dictionary<string, string>? scorerCallIds)
global::System.Collections.Generic.Dictionary<string, string>? scorerCallIds,
global::Weave.GenAISpanRef? genaiSpanRef)
{
this.PredictAndScoreCallId = predictAndScoreCallId ?? throw new global::System.ArgumentNullException(nameof(predictAndScoreCallId));
this.PredictCallId = predictCallId;
Expand All @@ -86,6 +94,7 @@ public EvalResultsTrial(
this.ModelLatencySeconds = modelLatencySeconds;
this.TotalTokens = totalTokens;
this.ScorerCallIds = scorerCallIds;
this.GenaiSpanRef = genaiSpanRef;
}

/// <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 EvalResultsTrialGenaiSpanRef
{
/// <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.EvalResultsTrialGenaiSpanRef? FromJson(
string json,
global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext)
{
return global::System.Text.Json.JsonSerializer.Deserialize(
json,
typeof(global::Weave.EvalResultsTrialGenaiSpanRef),
jsonSerializerContext) as global::Weave.EvalResultsTrialGenaiSpanRef;
}

/// <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.EvalResultsTrialGenaiSpanRef? FromJson(
string json,
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null)
{
return global::System.Text.Json.JsonSerializer.Deserialize<global::Weave.EvalResultsTrialGenaiSpanRef>(
json,
jsonSerializerOptions);
}

/// <summary>
/// Deserializes a JSON stream using the provided JsonSerializerContext.
/// </summary>
public static async global::System.Threading.Tasks.ValueTask<global::Weave.EvalResultsTrialGenaiSpanRef?> 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.EvalResultsTrialGenaiSpanRef),
jsonSerializerContext).ConfigureAwait(false)) as global::Weave.EvalResultsTrialGenaiSpanRef;
}

/// <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.EvalResultsTrialGenaiSpanRef?> FromJsonStreamAsync(
global::System.IO.Stream jsonStream,
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null)
{
return global::System.Text.Json.JsonSerializer.DeserializeAsync<global::Weave.EvalResultsTrialGenaiSpanRef?>(
jsonStream,
jsonSerializerOptions);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

#nullable enable

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

/// <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>();

}
}
92 changes: 92 additions & 0 deletions src/libs/Weave/Generated/Weave.Models.GenAISpanRef.Json.g.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
#nullable enable

namespace Weave
{
public sealed partial class GenAISpanRef
{
/// <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.GenAISpanRef? FromJson(
string json,
global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext)
{
return global::System.Text.Json.JsonSerializer.Deserialize(
json,
typeof(global::Weave.GenAISpanRef),
jsonSerializerContext) as global::Weave.GenAISpanRef;
}

/// <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.GenAISpanRef? FromJson(
string json,
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null)
{
return global::System.Text.Json.JsonSerializer.Deserialize<global::Weave.GenAISpanRef>(
json,
jsonSerializerOptions);
}

/// <summary>
/// Deserializes a JSON stream using the provided JsonSerializerContext.
/// </summary>
public static async global::System.Threading.Tasks.ValueTask<global::Weave.GenAISpanRef?> 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.GenAISpanRef),
jsonSerializerContext).ConfigureAwait(false)) as global::Weave.GenAISpanRef;
}

/// <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.GenAISpanRef?> FromJsonStreamAsync(
global::System.IO.Stream jsonStream,
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null)
{
return global::System.Text.Json.JsonSerializer.DeserializeAsync<global::Weave.GenAISpanRef?>(
jsonStream,
jsonSerializerOptions);
}
}
}
55 changes: 55 additions & 0 deletions src/libs/Weave/Generated/Weave.Models.GenAISpanRef.g.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@

#nullable enable

namespace Weave
{
/// <summary>
///
/// </summary>
public sealed partial class GenAISpanRef
{
/// <summary>
///
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("trace_id")]
[global::System.Text.Json.Serialization.JsonRequired]
public required string TraceId { get; set; }

/// <summary>
///
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("span_id")]
[global::System.Text.Json.Serialization.JsonRequired]
public required string SpanId { get; set; }

/// <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>();

/// <summary>
/// Initializes a new instance of the <see cref="GenAISpanRef" /> class.
/// </summary>
/// <param name="traceId"></param>
/// <param name="spanId"></param>
#if NET7_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
#endif
public GenAISpanRef(
string traceId,
string spanId)
{
this.TraceId = traceId ?? throw new global::System.ArgumentNullException(nameof(traceId));
this.SpanId = spanId ?? throw new global::System.ArgumentNullException(nameof(spanId));
}

/// <summary>
/// Initializes a new instance of the <see cref="GenAISpanRef" /> class.
/// </summary>
public GenAISpanRef()
{
}

}
}
13 changes: 12 additions & 1 deletion src/libs/Weave/Generated/Weave.Models.PredictionCreateBody.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ public sealed partial class PredictionCreateBody
[global::System.Text.Json.Serialization.JsonPropertyName("evaluation_run_id")]
public string? EvaluationRunId { get; set; }

/// <summary>
/// Optional GenAI span reference produced by this prediction.
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("genai_span_ref")]
public global::Weave.GenAISpanRef? GenaiSpanRef { get; set; }

/// <summary>
/// Additional properties that are not explicitly defined in the schema
/// </summary>
Expand All @@ -57,19 +63,24 @@ public sealed partial class PredictionCreateBody
/// <param name="evaluationRunId">
/// Optional evaluation run ID to link this prediction as a child call
/// </param>
/// <param name="genaiSpanRef">
/// Optional GenAI span reference produced by this prediction.
/// </param>
#if NET7_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
#endif
public PredictionCreateBody(
string model,
object inputs,
object output,
string? evaluationRunId)
string? evaluationRunId,
global::Weave.GenAISpanRef? genaiSpanRef)
{
this.Model = model ?? throw new global::System.ArgumentNullException(nameof(model));
this.Inputs = inputs ?? throw new global::System.ArgumentNullException(nameof(inputs));
this.Output = output ?? throw new global::System.ArgumentNullException(nameof(output));
this.EvaluationRunId = evaluationRunId;
this.GenaiSpanRef = genaiSpanRef;
}

/// <summary>
Expand Down
Loading