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,13 @@ public class ChatContextJsonConverter : global::System.Text.Json.Serialization.J
throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Phoenix.PlaygroundContext)}");
playground = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
}
global::Phoenix.GraphQLContext? graphql = default;
if (discriminator?.Type == global::Phoenix.ChatContextDiscriminatorType.Graphql)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Phoenix.GraphQLContext), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Phoenix.GraphQLContext> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Phoenix.GraphQLContext)}");
graphql = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
}

var __value = new global::Phoenix.ChatContext(
discriminator?.Type,
Expand All @@ -67,7 +74,9 @@ public class ChatContextJsonConverter : global::System.Text.Json.Serialization.J

span,

playground
playground,

graphql
);

return __value;
Expand Down Expand Up @@ -112,6 +121,12 @@ public override void Write(
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Phoenix.PlaygroundContext).Name}");
global::System.Text.Json.JsonSerializer.Serialize(writer, value.Playground!, typeInfo);
}
else if (value.IsGraphql)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Phoenix.GraphQLContext), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Phoenix.GraphQLContext?> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Phoenix.GraphQLContext).Name}");
global::System.Text.Json.JsonSerializer.Serialize(writer, value.Graphql!, typeInfo);
}
}
}
}
4 changes: 2 additions & 2 deletions src/libs/Phoenix/Generated/Phoenix.JsonSerializerContext.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -434,8 +434,6 @@ namespace Phoenix
typeof(global::Phoenix.JsonConverters.UnixTimestampJsonConverter),
})]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Phoenix.JsonSerializerContextTypes))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Phoenix.AgentCapabilities))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Phoenix.AgentSpanContext))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(string))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(object))]
Expand Down Expand Up @@ -510,10 +508,12 @@ namespace Phoenix
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Phoenix.ProjectContext))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Phoenix.TraceContext))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Phoenix.PlaygroundContext))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Phoenix.GraphQLContext))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Phoenix.ChatContextDiscriminator))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Phoenix.ChatContextDiscriminatorType), TypeInfoPropertyName = "ChatContextDiscriminatorType2")]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Phoenix.ChatRegenerateMessage))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList<global::Phoenix.AssistantMetadataUIMessage>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList<global::Phoenix.ChatContext>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Phoenix.Model), TypeInfoPropertyName = "Model2_3")]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Phoenix.CustomProviderModelSelection))]
Expand Down
Loading