diff --git a/src/libs/RetellAI/Generated/RetellAI.IRetellAiClient.GetCrmConfig.g.cs b/src/libs/RetellAI/Generated/RetellAI.IRetellAiClient.GetCrmConfig.g.cs
index 622a40c1..9c30cea1 100644
--- a/src/libs/RetellAI/Generated/RetellAI.IRetellAiClient.GetCrmConfig.g.cs
+++ b/src/libs/RetellAI/Generated/RetellAI.IRetellAiClient.GetCrmConfig.g.cs
@@ -5,7 +5,7 @@ namespace RetellAI
public partial interface IRetellAiClient
{
///
- /// Get the organization's CRM configuration: which CRM app is linked, the custom contact fields defined for it, and how post-call analysis data is written back to contacts. Returns an empty configuration when nothing has been set up yet.
+ /// Get the organization's CRM configuration: which CRM app is linked, the custom contact fields defined for it, and how Post Call Extraction data is written back to contacts. Returns an empty configuration when nothing has been set up yet.
///
/// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
/// The token to cancel the operation with
@@ -14,7 +14,7 @@ public partial interface IRetellAiClient
global::RetellAI.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
///
- /// Get the organization's CRM configuration: which CRM app is linked, the custom contact fields defined for it, and how post-call analysis data is written back to contacts. Returns an empty configuration when nothing has been set up yet.
+ /// Get the organization's CRM configuration: which CRM app is linked, the custom contact fields defined for it, and how Post Call Extraction data is written back to contacts. Returns an empty configuration when nothing has been set up yet.
///
/// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
/// The token to cancel the operation with
diff --git a/src/libs/RetellAI/Generated/RetellAI.IRetellAiClient.RerunCallAnalysis.g.cs b/src/libs/RetellAI/Generated/RetellAI.IRetellAiClient.RerunCallAnalysis.g.cs
index 82d4fabb..75817faf 100644
--- a/src/libs/RetellAI/Generated/RetellAI.IRetellAiClient.RerunCallAnalysis.g.cs
+++ b/src/libs/RetellAI/Generated/RetellAI.IRetellAiClient.RerunCallAnalysis.g.cs
@@ -5,7 +5,7 @@ namespace RetellAI
public partial interface IRetellAiClient
{
///
- /// Rerun post-call analysis for a specific call. This operation incurs charges.
+ /// Rerun Post Call Extraction for a specific call. This operation incurs charges.
///
///
/// Example: call_119c3f8e47135a29e65947eeb34cf12d
@@ -18,7 +18,7 @@ public partial interface IRetellAiClient
global::RetellAI.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
///
- /// Rerun post-call analysis for a specific call. This operation incurs charges.
+ /// Rerun Post Call Extraction for a specific call. This operation incurs charges.
///
///
/// Example: call_119c3f8e47135a29e65947eeb34cf12d
diff --git a/src/libs/RetellAI/Generated/RetellAI.IRetellAiClient.RerunChatAnalysis.g.cs b/src/libs/RetellAI/Generated/RetellAI.IRetellAiClient.RerunChatAnalysis.g.cs
index d9201b42..32a68b26 100644
--- a/src/libs/RetellAI/Generated/RetellAI.IRetellAiClient.RerunChatAnalysis.g.cs
+++ b/src/libs/RetellAI/Generated/RetellAI.IRetellAiClient.RerunChatAnalysis.g.cs
@@ -5,7 +5,7 @@ namespace RetellAI
public partial interface IRetellAiClient
{
///
- /// Rerun post-chat analysis for a specific chat. This operation incurs charges.
+ /// Rerun Post Chat Extraction for a specific chat. This operation incurs charges.
///
///
/// Example: chat_16b980523634a6dc504898cda492e939
@@ -18,7 +18,7 @@ public partial interface IRetellAiClient
global::RetellAI.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
///
- /// Rerun post-chat analysis for a specific chat. This operation incurs charges.
+ /// Rerun Post Chat Extraction for a specific chat. This operation incurs charges.
///
///
/// Example: chat_16b980523634a6dc504898cda492e939
diff --git a/src/libs/RetellAI/Generated/RetellAI.IRetellAiClient.UpdateAgent.g.cs b/src/libs/RetellAI/Generated/RetellAI.IRetellAiClient.UpdateAgent.g.cs
index 0f61dbb6..e8c9940e 100644
--- a/src/libs/RetellAI/Generated/RetellAI.IRetellAiClient.UpdateAgent.g.cs
+++ b/src/libs/RetellAI/Generated/RetellAI.IRetellAiClient.UpdateAgent.g.cs
@@ -219,7 +219,7 @@ public partial interface IRetellAiClient
/// If this option is set, the agent prompt will include call screen handling instructions for identity and call purpose questions. Set this to null to disable call screen prompt instructions.
///
///
- /// Post call analysis data to extract from the call. This data will augment the pre-defined variables extracted in the call analysis. This will be available after the call ends.
+ /// Post Call Extraction data to extract from the call. This data will augment the pre-defined variables extracted in the call analysis. This will be available after the call ends.
///
///
/// Available LLM models for agents.
diff --git a/src/libs/RetellAI/Generated/RetellAI.IRetellAiClient.UpdateChatAgent.g.cs b/src/libs/RetellAI/Generated/RetellAI.IRetellAiClient.UpdateChatAgent.g.cs
index acc9a1a7..095538eb 100644
--- a/src/libs/RetellAI/Generated/RetellAI.IRetellAiClient.UpdateChatAgent.g.cs
+++ b/src/libs/RetellAI/Generated/RetellAI.IRetellAiClient.UpdateChatAgent.g.cs
@@ -103,7 +103,7 @@ public partial interface IRetellAiClient
/// Example: 86400000
///
///
- /// Post chat analysis data to extract from the chat. This data will augment the pre-defined variables extracted in the chat analysis. This will be available after the chat ends.
+ /// Post Chat Extraction data to extract from the chat. This data will augment the pre-defined variables extracted in the chat analysis. This will be available after the chat ends.
///
///
/// Available LLM models for agents.
diff --git a/src/libs/RetellAI/Generated/RetellAI.JsonConverters.AgentResponse.g.cs b/src/libs/RetellAI/Generated/RetellAI.JsonConverters.AgentResponse.g.cs
index f0a9255a..f55848a0 100644
--- a/src/libs/RetellAI/Generated/RetellAI.JsonConverters.AgentResponse.g.cs
+++ b/src/libs/RetellAI/Generated/RetellAI.JsonConverters.AgentResponse.g.cs
@@ -17,221 +17,48 @@ public class AgentResponseJsonConverter : global::System.Text.Json.Serialization
using var __jsonDocument = global::System.Text.Json.JsonDocument.ParseValue(ref reader);
var __rawJson = __jsonDocument.RootElement.GetRawText();
- var __jsonProps = new global::System.Collections.Generic.HashSet();
- if (__jsonDocument.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Object)
- {
- foreach (var __jsonProp in __jsonDocument.RootElement.EnumerateObject())
- {
- __jsonProps.Add(__jsonProp.Name);
- if (__jsonProp.Value.ValueKind == global::System.Text.Json.JsonValueKind.Object)
- {
- foreach (var __nestedJsonProp in __jsonProp.Value.EnumerateObject())
- {
- __jsonProps.Add(__jsonProp.Name + "." + __nestedJsonProp.Name);
- }
- }
- }
+ global::RetellAI.AgentResponseVariant1? agentResponseVariant1 = default;
+ try
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.AgentResponseVariant1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.AgentResponseVariant1).Name}");
+ agentResponseVariant1 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
}
- var __score0 = 0;
- if (__jsonProps.Contains("agent_id")) __score0++;
- if (__jsonProps.Contains("assigned_tags")) __score0++;
- if (__jsonProps.Contains("base_version")) __score0++;
- if (__jsonProps.Contains("is_published")) __score0++;
- if (__jsonProps.Contains("version")) __score0++;
- var __score1 = 0;
- if (__jsonProps.Contains("agent_name")) __score1++;
- if (__jsonProps.Contains("allow_dtmf_interruption")) __score1++;
- if (__jsonProps.Contains("allow_user_dtmf")) __score1++;
- if (__jsonProps.Contains("ambient_sound")) __score1++;
- if (__jsonProps.Contains("ambient_sound_volume")) __score1++;
- if (__jsonProps.Contains("backchannel_frequency")) __score1++;
- if (__jsonProps.Contains("backchannel_words")) __score1++;
- if (__jsonProps.Contains("begin_message_delay_ms")) __score1++;
- if (__jsonProps.Contains("boosted_keywords")) __score1++;
- if (__jsonProps.Contains("call_screening_option")) __score1++;
- if (__jsonProps.Contains("call_screening_option.agent_identity")) __score1++;
- if (__jsonProps.Contains("call_screening_option.call_purpose")) __score1++;
- if (__jsonProps.Contains("custom_stt_config")) __score1++;
- if (__jsonProps.Contains("custom_stt_config.endpointing_ms")) __score1++;
- if (__jsonProps.Contains("custom_stt_config.provider")) __score1++;
- if (__jsonProps.Contains("data_storage_retention_days")) __score1++;
- if (__jsonProps.Contains("data_storage_setting")) __score1++;
- if (__jsonProps.Contains("denoising_mode")) __score1++;
- if (__jsonProps.Contains("enable_backchannel")) __score1++;
- if (__jsonProps.Contains("enable_dynamic_responsiveness")) __score1++;
- if (__jsonProps.Contains("enable_dynamic_voice_speed")) __score1++;
- if (__jsonProps.Contains("enable_expressive_mode")) __score1++;
- if (__jsonProps.Contains("end_call_after_silence_ms")) __score1++;
- if (__jsonProps.Contains("expressive_emotion_tags")) __score1++;
- if (__jsonProps.Contains("expressive_mode_prompt")) __score1++;
- if (__jsonProps.Contains("fallback_voice_ids")) __score1++;
- if (__jsonProps.Contains("guardrail_config")) __score1++;
- if (__jsonProps.Contains("guardrail_config.input_topics")) __score1++;
- if (__jsonProps.Contains("guardrail_config.output_topics")) __score1++;
- if (__jsonProps.Contains("handbook_config")) __score1++;
- if (__jsonProps.Contains("handbook_config.ai_disclosure")) __score1++;
- if (__jsonProps.Contains("handbook_config.conversational_personality")) __score1++;
- if (__jsonProps.Contains("handbook_config.default_personality")) __score1++;
- if (__jsonProps.Contains("handbook_config.echo_verification")) __score1++;
- if (__jsonProps.Contains("handbook_config.high_empathy")) __score1++;
- if (__jsonProps.Contains("handbook_config.nato_phonetic_alphabet")) __score1++;
- if (__jsonProps.Contains("handbook_config.natural_filler_words")) __score1++;
- if (__jsonProps.Contains("handbook_config.scope_boundaries")) __score1++;
- if (__jsonProps.Contains("handbook_config.smart_matching")) __score1++;
- if (__jsonProps.Contains("handbook_config.speech_normalization")) __score1++;
- if (__jsonProps.Contains("interruption_sensitivity")) __score1++;
- if (__jsonProps.Contains("ivr_option")) __score1++;
- if (__jsonProps.Contains("ivr_option.action")) __score1++;
- if (__jsonProps.Contains("ivr_option.detection_prompt")) __score1++;
- if (__jsonProps.Contains("language")) __score1++;
- if (__jsonProps.Contains("max_call_duration_ms")) __score1++;
- if (__jsonProps.Contains("opt_in_signed_url")) __score1++;
- if (__jsonProps.Contains("pii_config")) __score1++;
- if (__jsonProps.Contains("pii_config.categories")) __score1++;
- if (__jsonProps.Contains("pii_config.mode")) __score1++;
- if (__jsonProps.Contains("post_call_analysis_data")) __score1++;
- if (__jsonProps.Contains("post_call_analysis_model")) __score1++;
- if (__jsonProps.Contains("pronunciation_dictionary")) __score1++;
- if (__jsonProps.Contains("reminder_max_count")) __score1++;
- if (__jsonProps.Contains("reminder_trigger_ms")) __score1++;
- if (__jsonProps.Contains("response_engine")) __score1++;
- if (__jsonProps.Contains("responsiveness")) __score1++;
- if (__jsonProps.Contains("ring_duration_ms")) __score1++;
- if (__jsonProps.Contains("signed_url_expiration_ms")) __score1++;
- if (__jsonProps.Contains("stt_mode")) __score1++;
- if (__jsonProps.Contains("timezone")) __score1++;
- if (__jsonProps.Contains("user_dtmf_options")) __score1++;
- if (__jsonProps.Contains("user_dtmf_options.digit_limit")) __score1++;
- if (__jsonProps.Contains("user_dtmf_options.termination_key")) __score1++;
- if (__jsonProps.Contains("user_dtmf_options.timeout_ms")) __score1++;
- if (__jsonProps.Contains("version_description")) __score1++;
- if (__jsonProps.Contains("version_title")) __score1++;
- if (__jsonProps.Contains("vocab_specialization")) __score1++;
- if (__jsonProps.Contains("voice_emotion")) __score1++;
- if (__jsonProps.Contains("voice_id")) __score1++;
- if (__jsonProps.Contains("voice_model")) __score1++;
- if (__jsonProps.Contains("voice_speed")) __score1++;
- if (__jsonProps.Contains("voice_temperature")) __score1++;
- if (__jsonProps.Contains("voicemail_option")) __score1++;
- if (__jsonProps.Contains("voicemail_option.action")) __score1++;
- if (__jsonProps.Contains("voicemail_option.detection_prompt")) __score1++;
- if (__jsonProps.Contains("volume")) __score1++;
- if (__jsonProps.Contains("webhook_events")) __score1++;
- if (__jsonProps.Contains("webhook_timeout_ms")) __score1++;
- if (__jsonProps.Contains("webhook_url")) __score1++;
- var __score2 = 0;
- if (__jsonProps.Contains("last_modification_timestamp")) __score2++;
- var __bestScore = 0;
- var __bestIndex = -1;
- if (__score0 > __bestScore) { __bestScore = __score0; __bestIndex = 0; }
- if (__score1 > __bestScore) { __bestScore = __score1; __bestIndex = 1; }
- if (__score2 > __bestScore) { __bestScore = __score2; __bestIndex = 2; }
-
- global::RetellAI.AgentResponseVariant1? agentResponseVariant1 = default;
global::RetellAI.AgentRequest? request = default;
- global::RetellAI.AgentResponseVariant3? agentResponseVariant3 = default;
- if (__bestIndex >= 0)
+ try
{
- if (__bestIndex == 0)
- {
- try
- {
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.AgentResponseVariant1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.AgentResponseVariant1).Name}");
- agentResponseVariant1 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
- }
- catch (global::System.Text.Json.JsonException)
- {
- }
- catch (global::System.InvalidOperationException)
- {
- }
- }
- else if (__bestIndex == 1)
- {
- try
- {
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.AgentRequest), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.AgentRequest).Name}");
- request = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
- }
- catch (global::System.Text.Json.JsonException)
- {
- }
- catch (global::System.InvalidOperationException)
- {
- }
- }
- else if (__bestIndex == 2)
- {
- try
- {
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.AgentResponseVariant3), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.AgentResponseVariant3).Name}");
- agentResponseVariant3 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
- }
- catch (global::System.Text.Json.JsonException)
- {
- }
- catch (global::System.InvalidOperationException)
- {
- }
- }
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.AgentRequest), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.AgentRequest).Name}");
+ request = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
}
-
- if (agentResponseVariant1 == null && request == null && agentResponseVariant3 == null)
+ catch (global::System.Text.Json.JsonException)
{
- try
- {
-
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.AgentResponseVariant1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.AgentResponseVariant1).Name}");
- agentResponseVariant1 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
- }
- catch (global::System.Text.Json.JsonException)
- {
- }
- catch (global::System.InvalidOperationException)
- {
- }
}
-
- if (agentResponseVariant1 == null && request == null && agentResponseVariant3 == null)
+ catch (global::System.InvalidOperationException)
{
- try
- {
-
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.AgentRequest), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.AgentRequest).Name}");
- request = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
- }
- catch (global::System.Text.Json.JsonException)
- {
- }
- catch (global::System.InvalidOperationException)
- {
- }
}
- if (agentResponseVariant1 == null && request == null && agentResponseVariant3 == null)
+ global::RetellAI.AgentResponseVariant3? agentResponseVariant3 = default;
+ try
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.AgentResponseVariant3), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.AgentResponseVariant3).Name}");
+ agentResponseVariant3 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
{
- try
- {
-
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.AgentResponseVariant3), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.AgentResponseVariant3).Name}");
- agentResponseVariant3 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
- }
- catch (global::System.Text.Json.JsonException)
- {
- }
- catch (global::System.InvalidOperationException)
- {
- }
}
-
var __value = new global::RetellAI.AgentResponse(
agentResponseVariant1,
@@ -252,24 +79,64 @@ public override void Write(
options = options ?? throw new global::System.ArgumentNullException(nameof(options));
var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set.");
+
+ writer.WriteStartObject();
+ var __writtenPropertyNames = new global::System.Collections.Generic.HashSet(global::System.StringComparer.Ordinal);
if (value.IsAgentResponseVariant1)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.AgentResponseVariant1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.AgentResponseVariant1).Name}");
- global::System.Text.Json.JsonSerializer.Serialize(writer, value.AgentResponseVariant1!, typeInfo);
+ var __element0 = global::System.Text.Json.JsonSerializer.SerializeToElement(value.AgentResponseVariant1!, typeInfo);
+ if (__element0.ValueKind != global::System.Text.Json.JsonValueKind.Object)
+ {
+ throw new global::System.Text.Json.JsonException("AllOf values must serialize as JSON objects.");
+ }
+
+ foreach (var __property in __element0.EnumerateObject())
+ {
+ if (__writtenPropertyNames.Add(__property.Name))
+ {
+ __property.WriteTo(writer);
+ }
+ }
}
- else if (value.IsRequest)
+ if (value.IsRequest)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.AgentRequest), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.AgentRequest).Name}");
- global::System.Text.Json.JsonSerializer.Serialize(writer, value.Request!, typeInfo);
+ var __element1 = global::System.Text.Json.JsonSerializer.SerializeToElement(value.Request!, typeInfo);
+ if (__element1.ValueKind != global::System.Text.Json.JsonValueKind.Object)
+ {
+ throw new global::System.Text.Json.JsonException("AllOf values must serialize as JSON objects.");
+ }
+
+ foreach (var __property in __element1.EnumerateObject())
+ {
+ if (__writtenPropertyNames.Add(__property.Name))
+ {
+ __property.WriteTo(writer);
+ }
+ }
}
- else if (value.IsAgentResponseVariant3)
+ if (value.IsAgentResponseVariant3)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.AgentResponseVariant3), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.AgentResponseVariant3).Name}");
- global::System.Text.Json.JsonSerializer.Serialize(writer, value.AgentResponseVariant3!, typeInfo);
+ var __element2 = global::System.Text.Json.JsonSerializer.SerializeToElement(value.AgentResponseVariant3!, typeInfo);
+ if (__element2.ValueKind != global::System.Text.Json.JsonValueKind.Object)
+ {
+ throw new global::System.Text.Json.JsonException("AllOf values must serialize as JSON objects.");
+ }
+
+ foreach (var __property in __element2.EnumerateObject())
+ {
+ if (__writtenPropertyNames.Add(__property.Name))
+ {
+ __property.WriteTo(writer);
+ }
+ }
}
+ writer.WriteEndObject();
}
}
}
\ No newline at end of file
diff --git a/src/libs/RetellAI/Generated/RetellAI.JsonConverters.AgentSwapNode.g.cs b/src/libs/RetellAI/Generated/RetellAI.JsonConverters.AgentSwapNode.g.cs
index 2c37438c..8fdd7ef9 100644
--- a/src/libs/RetellAI/Generated/RetellAI.JsonConverters.AgentSwapNode.g.cs
+++ b/src/libs/RetellAI/Generated/RetellAI.JsonConverters.AgentSwapNode.g.cs
@@ -17,103 +17,34 @@ public class AgentSwapNodeJsonConverter : global::System.Text.Json.Serialization
using var __jsonDocument = global::System.Text.Json.JsonDocument.ParseValue(ref reader);
var __rawJson = __jsonDocument.RootElement.GetRawText();
- var __jsonProps = new global::System.Collections.Generic.HashSet();
- if (__jsonDocument.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Object)
- {
- foreach (var __jsonProp in __jsonDocument.RootElement.EnumerateObject())
- {
- __jsonProps.Add(__jsonProp.Name);
- }
+ global::RetellAI.NodeBase? @base = default;
+ try
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.NodeBase), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.NodeBase).Name}");
+ @base = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
}
- var __score0 = 0;
- var __score1 = 0;
- if (__jsonProps.Contains("agent_id")) __score1++;
- if (__jsonProps.Contains("agent_version")) __score1++;
- if (__jsonProps.Contains("edge")) __score1++;
- if (__jsonProps.Contains("instruction")) __score1++;
- if (__jsonProps.Contains("keep_current_language")) __score1++;
- if (__jsonProps.Contains("keep_current_voice")) __score1++;
- if (__jsonProps.Contains("post_call_analysis_setting")) __score1++;
- if (__jsonProps.Contains("speak_during_execution")) __score1++;
- if (__jsonProps.Contains("type")) __score1++;
- if (__jsonProps.Contains("webhook_setting")) __score1++;
- var __bestScore = 0;
- var __bestIndex = -1;
- if (__score0 > __bestScore) { __bestScore = __score0; __bestIndex = 0; }
- if (__score1 > __bestScore) { __bestScore = __score1; __bestIndex = 1; }
-
- global::RetellAI.NodeBase? @base = default;
global::RetellAI.AgentSwapNodeVariant2? agentSwapNodeVariant2 = default;
- if (__bestIndex >= 0)
+ try
{
- if (__bestIndex == 0)
- {
- try
- {
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.NodeBase), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.NodeBase).Name}");
- @base = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
- }
- catch (global::System.Text.Json.JsonException)
- {
- }
- catch (global::System.InvalidOperationException)
- {
- }
- }
- else if (__bestIndex == 1)
- {
- try
- {
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.AgentSwapNodeVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.AgentSwapNodeVariant2).Name}");
- agentSwapNodeVariant2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
- }
- catch (global::System.Text.Json.JsonException)
- {
- }
- catch (global::System.InvalidOperationException)
- {
- }
- }
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.AgentSwapNodeVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.AgentSwapNodeVariant2).Name}");
+ agentSwapNodeVariant2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
}
-
- if (@base == null && agentSwapNodeVariant2 == null)
+ catch (global::System.Text.Json.JsonException)
{
- try
- {
-
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.NodeBase), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.NodeBase).Name}");
- @base = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
- }
- catch (global::System.Text.Json.JsonException)
- {
- }
- catch (global::System.InvalidOperationException)
- {
- }
}
-
- if (@base == null && agentSwapNodeVariant2 == null)
+ catch (global::System.InvalidOperationException)
{
- try
- {
-
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.AgentSwapNodeVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.AgentSwapNodeVariant2).Name}");
- agentSwapNodeVariant2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
- }
- catch (global::System.Text.Json.JsonException)
- {
- }
- catch (global::System.InvalidOperationException)
- {
- }
}
-
var __value = new global::RetellAI.AgentSwapNode(
@base,
@@ -132,18 +63,46 @@ public override void Write(
options = options ?? throw new global::System.ArgumentNullException(nameof(options));
var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set.");
+
+ writer.WriteStartObject();
+ var __writtenPropertyNames = new global::System.Collections.Generic.HashSet(global::System.StringComparer.Ordinal);
if (value.IsBase)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.NodeBase), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.NodeBase).Name}");
- global::System.Text.Json.JsonSerializer.Serialize(writer, value.Base!.Value, typeInfo);
+ var __element0 = global::System.Text.Json.JsonSerializer.SerializeToElement(value.Base!.Value, typeInfo);
+ if (__element0.ValueKind != global::System.Text.Json.JsonValueKind.Object)
+ {
+ throw new global::System.Text.Json.JsonException("AllOf values must serialize as JSON objects.");
+ }
+
+ foreach (var __property in __element0.EnumerateObject())
+ {
+ if (__writtenPropertyNames.Add(__property.Name))
+ {
+ __property.WriteTo(writer);
+ }
+ }
}
- else if (value.IsAgentSwapNodeVariant2)
+ if (value.IsAgentSwapNodeVariant2)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.AgentSwapNodeVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.AgentSwapNodeVariant2).Name}");
- global::System.Text.Json.JsonSerializer.Serialize(writer, value.AgentSwapNodeVariant2!, typeInfo);
+ var __element1 = global::System.Text.Json.JsonSerializer.SerializeToElement(value.AgentSwapNodeVariant2!, typeInfo);
+ if (__element1.ValueKind != global::System.Text.Json.JsonValueKind.Object)
+ {
+ throw new global::System.Text.Json.JsonException("AllOf values must serialize as JSON objects.");
+ }
+
+ foreach (var __property in __element1.EnumerateObject())
+ {
+ if (__writtenPropertyNames.Add(__property.Name))
+ {
+ __property.WriteTo(writer);
+ }
+ }
}
+ writer.WriteEndObject();
}
}
}
\ No newline at end of file
diff --git a/src/libs/RetellAI/Generated/RetellAI.JsonConverters.AllOf2.g.cs b/src/libs/RetellAI/Generated/RetellAI.JsonConverters.AllOf2.g.cs
index 7ce00828..da21e0f9 100644
--- a/src/libs/RetellAI/Generated/RetellAI.JsonConverters.AllOf2.g.cs
+++ b/src/libs/RetellAI/Generated/RetellAI.JsonConverters.AllOf2.g.cs
@@ -14,118 +14,36 @@ public class AllOfJsonConverter : global::System.Text.Json.Serialization
options = options ?? throw new global::System.ArgumentNullException(nameof(options));
var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set.");
-
using var __jsonDocument = global::System.Text.Json.JsonDocument.ParseValue(ref reader);
var __rawJson = __jsonDocument.RootElement.GetRawText();
- var __jsonProps = new global::System.Collections.Generic.HashSet();
- if (__jsonDocument.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Object)
+
+ T1? value1 = default;
+ try
{
- foreach (var __jsonProp in __jsonDocument.RootElement.EnumerateObject())
- {
- __jsonProps.Add(__jsonProp.Name);
- }
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T1).Name}");
+ value1 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
}
-
- var __score0 = 0;
+ catch (global::System.Text.Json.JsonException)
{
- var __ti = typeInfoResolver.GetTypeInfo(typeof(T1), options);
- if (__ti != null && __ti.Kind == global::System.Text.Json.Serialization.Metadata.JsonTypeInfoKind.Object)
- {
- foreach (var __prop in __ti.Properties)
- {
- if (__jsonProps.Contains(__prop.Name)) __score0++;
- }
- }
}
- var __score1 = 0;
+ catch (global::System.InvalidOperationException)
{
- var __ti = typeInfoResolver.GetTypeInfo(typeof(T2), options);
- if (__ti != null && __ti.Kind == global::System.Text.Json.Serialization.Metadata.JsonTypeInfoKind.Object)
- {
- foreach (var __prop in __ti.Properties)
- {
- if (__jsonProps.Contains(__prop.Name)) __score1++;
- }
- }
}
- var __bestScore = 0;
- var __bestIndex = -1;
- if (__score0 > __bestScore) { __bestScore = __score0; __bestIndex = 0; }
- if (__score1 > __bestScore) { __bestScore = __score1; __bestIndex = 1; }
- T1? value1 = default;
T2? value2 = default;
- if (__bestIndex >= 0)
+ try
{
- if (__bestIndex == 0)
- {
- try
- {
-
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T1).Name}");
- value1 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
- }
- catch (global::System.Text.Json.JsonException)
- {
- }
- catch (global::System.InvalidOperationException)
- {
- }
- }
-
- else if (__bestIndex == 1)
- {
- try
- {
-
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T2).Name}");
- value2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
- }
- catch (global::System.Text.Json.JsonException)
- {
- }
- catch (global::System.InvalidOperationException)
- {
- }
- }
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T2).Name}");
+ value2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
}
-
- if (value1 == null && value2 == null)
+ catch (global::System.Text.Json.JsonException)
{
- try
- {
-
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T1).Name}");
- value1 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
- }
- catch (global::System.Text.Json.JsonException)
- {
- }
- catch (global::System.InvalidOperationException)
- {
- }
}
-
- if (value1 == null && value2 == null)
+ catch (global::System.InvalidOperationException)
{
- try
- {
-
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T2).Name}");
- value2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
- }
- catch (global::System.Text.Json.JsonException)
- {
- }
- catch (global::System.InvalidOperationException)
- {
- }
}
-
var __value = new global::RetellAI.AllOf(
value1,
@@ -144,18 +62,46 @@ public override void Write(
options = options ?? throw new global::System.ArgumentNullException(nameof(options));
var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set.");
+
+ writer.WriteStartObject();
+ var __writtenPropertyNames = new global::System.Collections.Generic.HashSet(global::System.StringComparer.Ordinal);
if (value.IsValue1)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T1).Name}");
- global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value1!, typeInfo);
+ var __element0 = global::System.Text.Json.JsonSerializer.SerializeToElement(value.Value1!, typeInfo);
+ if (__element0.ValueKind != global::System.Text.Json.JsonValueKind.Object)
+ {
+ throw new global::System.Text.Json.JsonException("AllOf values must serialize as JSON objects.");
+ }
+
+ foreach (var __property in __element0.EnumerateObject())
+ {
+ if (__writtenPropertyNames.Add(__property.Name))
+ {
+ __property.WriteTo(writer);
+ }
+ }
}
- else if (value.IsValue2)
+ if (value.IsValue2)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T2).Name}");
- global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value2!, typeInfo);
+ var __element1 = global::System.Text.Json.JsonSerializer.SerializeToElement(value.Value2!, typeInfo);
+ if (__element1.ValueKind != global::System.Text.Json.JsonValueKind.Object)
+ {
+ throw new global::System.Text.Json.JsonException("AllOf values must serialize as JSON objects.");
+ }
+
+ foreach (var __property in __element1.EnumerateObject())
+ {
+ if (__writtenPropertyNames.Add(__property.Name))
+ {
+ __property.WriteTo(writer);
+ }
+ }
}
+ writer.WriteEndObject();
}
}
}
\ No newline at end of file
diff --git a/src/libs/RetellAI/Generated/RetellAI.JsonConverters.AlwaysEdge.g.cs b/src/libs/RetellAI/Generated/RetellAI.JsonConverters.AlwaysEdge.g.cs
index e637e662..09356f09 100644
--- a/src/libs/RetellAI/Generated/RetellAI.JsonConverters.AlwaysEdge.g.cs
+++ b/src/libs/RetellAI/Generated/RetellAI.JsonConverters.AlwaysEdge.g.cs
@@ -17,106 +17,34 @@ public class AlwaysEdgeJsonConverter : global::System.Text.Json.Serialization.Js
using var __jsonDocument = global::System.Text.Json.JsonDocument.ParseValue(ref reader);
var __rawJson = __jsonDocument.RootElement.GetRawText();
- var __jsonProps = new global::System.Collections.Generic.HashSet();
- if (__jsonDocument.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Object)
- {
- foreach (var __jsonProp in __jsonDocument.RootElement.EnumerateObject())
- {
- __jsonProps.Add(__jsonProp.Name);
- if (__jsonProp.Value.ValueKind == global::System.Text.Json.JsonValueKind.Object)
- {
- foreach (var __nestedJsonProp in __jsonProp.Value.EnumerateObject())
- {
- __jsonProps.Add(__jsonProp.Name + "." + __nestedJsonProp.Name);
- }
- }
- }
+ global::RetellAI.NodeEdge? node = default;
+ try
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.NodeEdge), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.NodeEdge).Name}");
+ node = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
}
- var __score0 = 0;
- if (__jsonProps.Contains("destination_node_id")) __score0++;
- if (__jsonProps.Contains("id")) __score0++;
- if (__jsonProps.Contains("transition_condition")) __score0++;
- var __score1 = 0;
- if (__jsonProps.Contains("transition_condition")) __score1++;
- if (__jsonProps.Contains("transition_condition.prompt")) __score1++;
- if (__jsonProps.Contains("transition_condition.type")) __score1++;
- var __bestScore = 0;
- var __bestIndex = -1;
- if (__score0 > __bestScore) { __bestScore = __score0; __bestIndex = 0; }
- if (__score1 > __bestScore) { __bestScore = __score1; __bestIndex = 1; }
-
- global::RetellAI.NodeEdge? node = default;
global::RetellAI.AlwaysEdgeVariant2? alwaysEdgeVariant2 = default;
- if (__bestIndex >= 0)
+ try
{
- if (__bestIndex == 0)
- {
- try
- {
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.NodeEdge), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.NodeEdge).Name}");
- node = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
- }
- catch (global::System.Text.Json.JsonException)
- {
- }
- catch (global::System.InvalidOperationException)
- {
- }
- }
- else if (__bestIndex == 1)
- {
- try
- {
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.AlwaysEdgeVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.AlwaysEdgeVariant2).Name}");
- alwaysEdgeVariant2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
- }
- catch (global::System.Text.Json.JsonException)
- {
- }
- catch (global::System.InvalidOperationException)
- {
- }
- }
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.AlwaysEdgeVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.AlwaysEdgeVariant2).Name}");
+ alwaysEdgeVariant2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
}
-
- if (node == null && alwaysEdgeVariant2 == null)
+ catch (global::System.Text.Json.JsonException)
{
- try
- {
-
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.NodeEdge), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.NodeEdge).Name}");
- node = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
- }
- catch (global::System.Text.Json.JsonException)
- {
- }
- catch (global::System.InvalidOperationException)
- {
- }
}
-
- if (node == null && alwaysEdgeVariant2 == null)
+ catch (global::System.InvalidOperationException)
{
- try
- {
-
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.AlwaysEdgeVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.AlwaysEdgeVariant2).Name}");
- alwaysEdgeVariant2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
- }
- catch (global::System.Text.Json.JsonException)
- {
- }
- catch (global::System.InvalidOperationException)
- {
- }
}
-
var __value = new global::RetellAI.AlwaysEdge(
node,
@@ -135,18 +63,46 @@ public override void Write(
options = options ?? throw new global::System.ArgumentNullException(nameof(options));
var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set.");
+
+ writer.WriteStartObject();
+ var __writtenPropertyNames = new global::System.Collections.Generic.HashSet(global::System.StringComparer.Ordinal);
if (value.IsNode)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.NodeEdge), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.NodeEdge).Name}");
- global::System.Text.Json.JsonSerializer.Serialize(writer, value.Node!, typeInfo);
+ var __element0 = global::System.Text.Json.JsonSerializer.SerializeToElement(value.Node!, typeInfo);
+ if (__element0.ValueKind != global::System.Text.Json.JsonValueKind.Object)
+ {
+ throw new global::System.Text.Json.JsonException("AllOf values must serialize as JSON objects.");
+ }
+
+ foreach (var __property in __element0.EnumerateObject())
+ {
+ if (__writtenPropertyNames.Add(__property.Name))
+ {
+ __property.WriteTo(writer);
+ }
+ }
}
- else if (value.IsAlwaysEdgeVariant2)
+ if (value.IsAlwaysEdgeVariant2)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.AlwaysEdgeVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.AlwaysEdgeVariant2).Name}");
- global::System.Text.Json.JsonSerializer.Serialize(writer, value.AlwaysEdgeVariant2!, typeInfo);
+ var __element1 = global::System.Text.Json.JsonSerializer.SerializeToElement(value.AlwaysEdgeVariant2!, typeInfo);
+ if (__element1.ValueKind != global::System.Text.Json.JsonValueKind.Object)
+ {
+ throw new global::System.Text.Json.JsonException("AllOf values must serialize as JSON objects.");
+ }
+
+ foreach (var __property in __element1.EnumerateObject())
+ {
+ if (__writtenPropertyNames.Add(__property.Name))
+ {
+ __property.WriteTo(writer);
+ }
+ }
}
+ writer.WriteEndObject();
}
}
}
\ No newline at end of file
diff --git a/src/libs/RetellAI/Generated/RetellAI.JsonConverters.BranchNode.g.cs b/src/libs/RetellAI/Generated/RetellAI.JsonConverters.BranchNode.g.cs
index 0bd47d9f..ab17820a 100644
--- a/src/libs/RetellAI/Generated/RetellAI.JsonConverters.BranchNode.g.cs
+++ b/src/libs/RetellAI/Generated/RetellAI.JsonConverters.BranchNode.g.cs
@@ -17,97 +17,34 @@ public class BranchNodeJsonConverter : global::System.Text.Json.Serialization.Js
using var __jsonDocument = global::System.Text.Json.JsonDocument.ParseValue(ref reader);
var __rawJson = __jsonDocument.RootElement.GetRawText();
- var __jsonProps = new global::System.Collections.Generic.HashSet();
- if (__jsonDocument.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Object)
- {
- foreach (var __jsonProp in __jsonDocument.RootElement.EnumerateObject())
- {
- __jsonProps.Add(__jsonProp.Name);
- }
+ global::RetellAI.NodeBase? @base = default;
+ try
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.NodeBase), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.NodeBase).Name}");
+ @base = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
}
- var __score0 = 0;
- var __score1 = 0;
- if (__jsonProps.Contains("edges")) __score1++;
- if (__jsonProps.Contains("else_edge")) __score1++;
- if (__jsonProps.Contains("finetune_transition_examples")) __score1++;
- if (__jsonProps.Contains("type")) __score1++;
- var __bestScore = 0;
- var __bestIndex = -1;
- if (__score0 > __bestScore) { __bestScore = __score0; __bestIndex = 0; }
- if (__score1 > __bestScore) { __bestScore = __score1; __bestIndex = 1; }
-
- global::RetellAI.NodeBase? @base = default;
global::RetellAI.BranchNodeVariant2? branchNodeVariant2 = default;
- if (__bestIndex >= 0)
+ try
{
- if (__bestIndex == 0)
- {
- try
- {
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.NodeBase), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.NodeBase).Name}");
- @base = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
- }
- catch (global::System.Text.Json.JsonException)
- {
- }
- catch (global::System.InvalidOperationException)
- {
- }
- }
- else if (__bestIndex == 1)
- {
- try
- {
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.BranchNodeVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.BranchNodeVariant2).Name}");
- branchNodeVariant2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
- }
- catch (global::System.Text.Json.JsonException)
- {
- }
- catch (global::System.InvalidOperationException)
- {
- }
- }
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.BranchNodeVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.BranchNodeVariant2).Name}");
+ branchNodeVariant2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
}
-
- if (@base == null && branchNodeVariant2 == null)
+ catch (global::System.Text.Json.JsonException)
{
- try
- {
-
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.NodeBase), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.NodeBase).Name}");
- @base = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
- }
- catch (global::System.Text.Json.JsonException)
- {
- }
- catch (global::System.InvalidOperationException)
- {
- }
}
-
- if (@base == null && branchNodeVariant2 == null)
+ catch (global::System.InvalidOperationException)
{
- try
- {
-
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.BranchNodeVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.BranchNodeVariant2).Name}");
- branchNodeVariant2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
- }
- catch (global::System.Text.Json.JsonException)
- {
- }
- catch (global::System.InvalidOperationException)
- {
- }
}
-
var __value = new global::RetellAI.BranchNode(
@base,
@@ -126,18 +63,46 @@ public override void Write(
options = options ?? throw new global::System.ArgumentNullException(nameof(options));
var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set.");
+
+ writer.WriteStartObject();
+ var __writtenPropertyNames = new global::System.Collections.Generic.HashSet(global::System.StringComparer.Ordinal);
if (value.IsBase)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.NodeBase), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.NodeBase).Name}");
- global::System.Text.Json.JsonSerializer.Serialize(writer, value.Base!.Value, typeInfo);
+ var __element0 = global::System.Text.Json.JsonSerializer.SerializeToElement(value.Base!.Value, typeInfo);
+ if (__element0.ValueKind != global::System.Text.Json.JsonValueKind.Object)
+ {
+ throw new global::System.Text.Json.JsonException("AllOf values must serialize as JSON objects.");
+ }
+
+ foreach (var __property in __element0.EnumerateObject())
+ {
+ if (__writtenPropertyNames.Add(__property.Name))
+ {
+ __property.WriteTo(writer);
+ }
+ }
}
- else if (value.IsBranchNodeVariant2)
+ if (value.IsBranchNodeVariant2)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.BranchNodeVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.BranchNodeVariant2).Name}");
- global::System.Text.Json.JsonSerializer.Serialize(writer, value.BranchNodeVariant2!, typeInfo);
+ var __element1 = global::System.Text.Json.JsonSerializer.SerializeToElement(value.BranchNodeVariant2!, typeInfo);
+ if (__element1.ValueKind != global::System.Text.Json.JsonValueKind.Object)
+ {
+ throw new global::System.Text.Json.JsonException("AllOf values must serialize as JSON objects.");
+ }
+
+ foreach (var __property in __element1.EnumerateObject())
+ {
+ if (__writtenPropertyNames.Add(__property.Name))
+ {
+ __property.WriteTo(writer);
+ }
+ }
}
+ writer.WriteEndObject();
}
}
}
\ No newline at end of file
diff --git a/src/libs/RetellAI/Generated/RetellAI.JsonConverters.BridgeTransferNode.g.cs b/src/libs/RetellAI/Generated/RetellAI.JsonConverters.BridgeTransferNode.g.cs
index 1dd6d6b0..7d4c7812 100644
--- a/src/libs/RetellAI/Generated/RetellAI.JsonConverters.BridgeTransferNode.g.cs
+++ b/src/libs/RetellAI/Generated/RetellAI.JsonConverters.BridgeTransferNode.g.cs
@@ -17,96 +17,34 @@ public class BridgeTransferNodeJsonConverter : global::System.Text.Json.Serializ
using var __jsonDocument = global::System.Text.Json.JsonDocument.ParseValue(ref reader);
var __rawJson = __jsonDocument.RootElement.GetRawText();
- var __jsonProps = new global::System.Collections.Generic.HashSet();
- if (__jsonDocument.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Object)
- {
- foreach (var __jsonProp in __jsonDocument.RootElement.EnumerateObject())
- {
- __jsonProps.Add(__jsonProp.Name);
- }
+ global::RetellAI.NodeBase? @base = default;
+ try
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.NodeBase), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.NodeBase).Name}");
+ @base = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
}
- var __score0 = 0;
- var __score1 = 0;
- if (__jsonProps.Contains("instruction")) __score1++;
- if (__jsonProps.Contains("speak_during_execution")) __score1++;
- if (__jsonProps.Contains("type")) __score1++;
- var __bestScore = 0;
- var __bestIndex = -1;
- if (__score0 > __bestScore) { __bestScore = __score0; __bestIndex = 0; }
- if (__score1 > __bestScore) { __bestScore = __score1; __bestIndex = 1; }
-
- global::RetellAI.NodeBase? @base = default;
global::RetellAI.BridgeTransferNodeVariant2? bridgeTransferNodeVariant2 = default;
- if (__bestIndex >= 0)
+ try
{
- if (__bestIndex == 0)
- {
- try
- {
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.NodeBase), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.NodeBase).Name}");
- @base = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
- }
- catch (global::System.Text.Json.JsonException)
- {
- }
- catch (global::System.InvalidOperationException)
- {
- }
- }
- else if (__bestIndex == 1)
- {
- try
- {
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.BridgeTransferNodeVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.BridgeTransferNodeVariant2).Name}");
- bridgeTransferNodeVariant2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
- }
- catch (global::System.Text.Json.JsonException)
- {
- }
- catch (global::System.InvalidOperationException)
- {
- }
- }
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.BridgeTransferNodeVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.BridgeTransferNodeVariant2).Name}");
+ bridgeTransferNodeVariant2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
}
-
- if (@base == null && bridgeTransferNodeVariant2 == null)
+ catch (global::System.Text.Json.JsonException)
{
- try
- {
-
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.NodeBase), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.NodeBase).Name}");
- @base = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
- }
- catch (global::System.Text.Json.JsonException)
- {
- }
- catch (global::System.InvalidOperationException)
- {
- }
}
-
- if (@base == null && bridgeTransferNodeVariant2 == null)
+ catch (global::System.InvalidOperationException)
{
- try
- {
-
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.BridgeTransferNodeVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.BridgeTransferNodeVariant2).Name}");
- bridgeTransferNodeVariant2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
- }
- catch (global::System.Text.Json.JsonException)
- {
- }
- catch (global::System.InvalidOperationException)
- {
- }
}
-
var __value = new global::RetellAI.BridgeTransferNode(
@base,
@@ -125,18 +63,46 @@ public override void Write(
options = options ?? throw new global::System.ArgumentNullException(nameof(options));
var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set.");
+
+ writer.WriteStartObject();
+ var __writtenPropertyNames = new global::System.Collections.Generic.HashSet(global::System.StringComparer.Ordinal);
if (value.IsBase)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.NodeBase), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.NodeBase).Name}");
- global::System.Text.Json.JsonSerializer.Serialize(writer, value.Base!.Value, typeInfo);
+ var __element0 = global::System.Text.Json.JsonSerializer.SerializeToElement(value.Base!.Value, typeInfo);
+ if (__element0.ValueKind != global::System.Text.Json.JsonValueKind.Object)
+ {
+ throw new global::System.Text.Json.JsonException("AllOf values must serialize as JSON objects.");
+ }
+
+ foreach (var __property in __element0.EnumerateObject())
+ {
+ if (__writtenPropertyNames.Add(__property.Name))
+ {
+ __property.WriteTo(writer);
+ }
+ }
}
- else if (value.IsBridgeTransferNodeVariant2)
+ if (value.IsBridgeTransferNodeVariant2)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.BridgeTransferNodeVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.BridgeTransferNodeVariant2).Name}");
- global::System.Text.Json.JsonSerializer.Serialize(writer, value.BridgeTransferNodeVariant2!, typeInfo);
+ var __element1 = global::System.Text.Json.JsonSerializer.SerializeToElement(value.BridgeTransferNodeVariant2!, typeInfo);
+ if (__element1.ValueKind != global::System.Text.Json.JsonValueKind.Object)
+ {
+ throw new global::System.Text.Json.JsonException("AllOf values must serialize as JSON objects.");
+ }
+
+ foreach (var __property in __element1.EnumerateObject())
+ {
+ if (__writtenPropertyNames.Add(__property.Name))
+ {
+ __property.WriteTo(writer);
+ }
+ }
}
+ writer.WriteEndObject();
}
}
}
\ No newline at end of file
diff --git a/src/libs/RetellAI/Generated/RetellAI.JsonConverters.CancelTransferNode.g.cs b/src/libs/RetellAI/Generated/RetellAI.JsonConverters.CancelTransferNode.g.cs
index ac4b0ff9..8ceeb9f5 100644
--- a/src/libs/RetellAI/Generated/RetellAI.JsonConverters.CancelTransferNode.g.cs
+++ b/src/libs/RetellAI/Generated/RetellAI.JsonConverters.CancelTransferNode.g.cs
@@ -17,96 +17,34 @@ public class CancelTransferNodeJsonConverter : global::System.Text.Json.Serializ
using var __jsonDocument = global::System.Text.Json.JsonDocument.ParseValue(ref reader);
var __rawJson = __jsonDocument.RootElement.GetRawText();
- var __jsonProps = new global::System.Collections.Generic.HashSet();
- if (__jsonDocument.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Object)
- {
- foreach (var __jsonProp in __jsonDocument.RootElement.EnumerateObject())
- {
- __jsonProps.Add(__jsonProp.Name);
- }
+ global::RetellAI.NodeBase? @base = default;
+ try
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.NodeBase), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.NodeBase).Name}");
+ @base = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
}
- var __score0 = 0;
- var __score1 = 0;
- if (__jsonProps.Contains("instruction")) __score1++;
- if (__jsonProps.Contains("speak_during_execution")) __score1++;
- if (__jsonProps.Contains("type")) __score1++;
- var __bestScore = 0;
- var __bestIndex = -1;
- if (__score0 > __bestScore) { __bestScore = __score0; __bestIndex = 0; }
- if (__score1 > __bestScore) { __bestScore = __score1; __bestIndex = 1; }
-
- global::RetellAI.NodeBase? @base = default;
global::RetellAI.CancelTransferNodeVariant2? cancelTransferNodeVariant2 = default;
- if (__bestIndex >= 0)
+ try
{
- if (__bestIndex == 0)
- {
- try
- {
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.NodeBase), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.NodeBase).Name}");
- @base = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
- }
- catch (global::System.Text.Json.JsonException)
- {
- }
- catch (global::System.InvalidOperationException)
- {
- }
- }
- else if (__bestIndex == 1)
- {
- try
- {
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.CancelTransferNodeVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.CancelTransferNodeVariant2).Name}");
- cancelTransferNodeVariant2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
- }
- catch (global::System.Text.Json.JsonException)
- {
- }
- catch (global::System.InvalidOperationException)
- {
- }
- }
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.CancelTransferNodeVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.CancelTransferNodeVariant2).Name}");
+ cancelTransferNodeVariant2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
}
-
- if (@base == null && cancelTransferNodeVariant2 == null)
+ catch (global::System.Text.Json.JsonException)
{
- try
- {
-
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.NodeBase), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.NodeBase).Name}");
- @base = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
- }
- catch (global::System.Text.Json.JsonException)
- {
- }
- catch (global::System.InvalidOperationException)
- {
- }
}
-
- if (@base == null && cancelTransferNodeVariant2 == null)
+ catch (global::System.InvalidOperationException)
{
- try
- {
-
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.CancelTransferNodeVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.CancelTransferNodeVariant2).Name}");
- cancelTransferNodeVariant2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
- }
- catch (global::System.Text.Json.JsonException)
- {
- }
- catch (global::System.InvalidOperationException)
- {
- }
}
-
var __value = new global::RetellAI.CancelTransferNode(
@base,
@@ -125,18 +63,46 @@ public override void Write(
options = options ?? throw new global::System.ArgumentNullException(nameof(options));
var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set.");
+
+ writer.WriteStartObject();
+ var __writtenPropertyNames = new global::System.Collections.Generic.HashSet(global::System.StringComparer.Ordinal);
if (value.IsBase)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.NodeBase), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.NodeBase).Name}");
- global::System.Text.Json.JsonSerializer.Serialize(writer, value.Base!.Value, typeInfo);
+ var __element0 = global::System.Text.Json.JsonSerializer.SerializeToElement(value.Base!.Value, typeInfo);
+ if (__element0.ValueKind != global::System.Text.Json.JsonValueKind.Object)
+ {
+ throw new global::System.Text.Json.JsonException("AllOf values must serialize as JSON objects.");
+ }
+
+ foreach (var __property in __element0.EnumerateObject())
+ {
+ if (__writtenPropertyNames.Add(__property.Name))
+ {
+ __property.WriteTo(writer);
+ }
+ }
}
- else if (value.IsCancelTransferNodeVariant2)
+ if (value.IsCancelTransferNodeVariant2)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.CancelTransferNodeVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.CancelTransferNodeVariant2).Name}");
- global::System.Text.Json.JsonSerializer.Serialize(writer, value.CancelTransferNodeVariant2!, typeInfo);
+ var __element1 = global::System.Text.Json.JsonSerializer.SerializeToElement(value.CancelTransferNodeVariant2!, typeInfo);
+ if (__element1.ValueKind != global::System.Text.Json.JsonValueKind.Object)
+ {
+ throw new global::System.Text.Json.JsonException("AllOf values must serialize as JSON objects.");
+ }
+
+ foreach (var __property in __element1.EnumerateObject())
+ {
+ if (__writtenPropertyNames.Add(__property.Name))
+ {
+ __property.WriteTo(writer);
+ }
+ }
}
+ writer.WriteEndObject();
}
}
}
\ No newline at end of file
diff --git a/src/libs/RetellAI/Generated/RetellAI.JsonConverters.ChatAgentResponse.g.cs b/src/libs/RetellAI/Generated/RetellAI.JsonConverters.ChatAgentResponse.g.cs
index 9e193175..b3f486c4 100644
--- a/src/libs/RetellAI/Generated/RetellAI.JsonConverters.ChatAgentResponse.g.cs
+++ b/src/libs/RetellAI/Generated/RetellAI.JsonConverters.ChatAgentResponse.g.cs
@@ -17,168 +17,48 @@ public class ChatAgentResponseJsonConverter : global::System.Text.Json.Serializa
using var __jsonDocument = global::System.Text.Json.JsonDocument.ParseValue(ref reader);
var __rawJson = __jsonDocument.RootElement.GetRawText();
- var __jsonProps = new global::System.Collections.Generic.HashSet();
- if (__jsonDocument.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Object)
- {
- foreach (var __jsonProp in __jsonDocument.RootElement.EnumerateObject())
- {
- __jsonProps.Add(__jsonProp.Name);
- if (__jsonProp.Value.ValueKind == global::System.Text.Json.JsonValueKind.Object)
- {
- foreach (var __nestedJsonProp in __jsonProp.Value.EnumerateObject())
- {
- __jsonProps.Add(__jsonProp.Name + "." + __nestedJsonProp.Name);
- }
- }
- }
+ global::RetellAI.ChatAgentResponseVariant1? chatAgentResponseVariant1 = default;
+ try
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.ChatAgentResponseVariant1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.ChatAgentResponseVariant1).Name}");
+ chatAgentResponseVariant1 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
}
- var __score0 = 0;
- if (__jsonProps.Contains("agent_id")) __score0++;
- if (__jsonProps.Contains("assigned_tags")) __score0++;
- if (__jsonProps.Contains("base_version")) __score0++;
- if (__jsonProps.Contains("is_published")) __score0++;
- if (__jsonProps.Contains("version")) __score0++;
- var __score1 = 0;
- if (__jsonProps.Contains("agent_name")) __score1++;
- if (__jsonProps.Contains("auto_close_message")) __score1++;
- if (__jsonProps.Contains("data_storage_retention_days")) __score1++;
- if (__jsonProps.Contains("data_storage_setting")) __score1++;
- if (__jsonProps.Contains("end_chat_after_silence_ms")) __score1++;
- if (__jsonProps.Contains("guardrail_config")) __score1++;
- if (__jsonProps.Contains("guardrail_config.input_topics")) __score1++;
- if (__jsonProps.Contains("guardrail_config.output_topics")) __score1++;
- if (__jsonProps.Contains("handbook_config")) __score1++;
- if (__jsonProps.Contains("handbook_config.ai_disclosure")) __score1++;
- if (__jsonProps.Contains("handbook_config.default_personality")) __score1++;
- if (__jsonProps.Contains("handbook_config.high_empathy")) __score1++;
- if (__jsonProps.Contains("handbook_config.scope_boundaries")) __score1++;
- if (__jsonProps.Contains("language")) __score1++;
- if (__jsonProps.Contains("opt_in_signed_url")) __score1++;
- if (__jsonProps.Contains("pii_config")) __score1++;
- if (__jsonProps.Contains("pii_config.categories")) __score1++;
- if (__jsonProps.Contains("pii_config.mode")) __score1++;
- if (__jsonProps.Contains("post_chat_analysis_data")) __score1++;
- if (__jsonProps.Contains("post_chat_analysis_model")) __score1++;
- if (__jsonProps.Contains("response_engine")) __score1++;
- if (__jsonProps.Contains("signed_url_expiration_ms")) __score1++;
- if (__jsonProps.Contains("timezone")) __score1++;
- if (__jsonProps.Contains("version_title")) __score1++;
- if (__jsonProps.Contains("webhook_events")) __score1++;
- if (__jsonProps.Contains("webhook_timeout_ms")) __score1++;
- if (__jsonProps.Contains("webhook_url")) __score1++;
- var __score2 = 0;
- if (__jsonProps.Contains("last_modification_timestamp")) __score2++;
- var __bestScore = 0;
- var __bestIndex = -1;
- if (__score0 > __bestScore) { __bestScore = __score0; __bestIndex = 0; }
- if (__score1 > __bestScore) { __bestScore = __score1; __bestIndex = 1; }
- if (__score2 > __bestScore) { __bestScore = __score2; __bestIndex = 2; }
-
- global::RetellAI.ChatAgentResponseVariant1? chatAgentResponseVariant1 = default;
global::RetellAI.ChatAgentRequest? request = default;
- global::RetellAI.ChatAgentResponseVariant3? chatAgentResponseVariant3 = default;
- if (__bestIndex >= 0)
+ try
{
- if (__bestIndex == 0)
- {
- try
- {
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.ChatAgentResponseVariant1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.ChatAgentResponseVariant1).Name}");
- chatAgentResponseVariant1 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
- }
- catch (global::System.Text.Json.JsonException)
- {
- }
- catch (global::System.InvalidOperationException)
- {
- }
- }
- else if (__bestIndex == 1)
- {
- try
- {
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.ChatAgentRequest), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.ChatAgentRequest).Name}");
- request = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
- }
- catch (global::System.Text.Json.JsonException)
- {
- }
- catch (global::System.InvalidOperationException)
- {
- }
- }
- else if (__bestIndex == 2)
- {
- try
- {
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.ChatAgentResponseVariant3), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.ChatAgentResponseVariant3).Name}");
- chatAgentResponseVariant3 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
- }
- catch (global::System.Text.Json.JsonException)
- {
- }
- catch (global::System.InvalidOperationException)
- {
- }
- }
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.ChatAgentRequest), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.ChatAgentRequest).Name}");
+ request = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
}
-
- if (chatAgentResponseVariant1 == null && request == null && chatAgentResponseVariant3 == null)
+ catch (global::System.Text.Json.JsonException)
{
- try
- {
-
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.ChatAgentResponseVariant1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.ChatAgentResponseVariant1).Name}");
- chatAgentResponseVariant1 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
- }
- catch (global::System.Text.Json.JsonException)
- {
- }
- catch (global::System.InvalidOperationException)
- {
- }
}
-
- if (chatAgentResponseVariant1 == null && request == null && chatAgentResponseVariant3 == null)
+ catch (global::System.InvalidOperationException)
{
- try
- {
-
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.ChatAgentRequest), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.ChatAgentRequest).Name}");
- request = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
- }
- catch (global::System.Text.Json.JsonException)
- {
- }
- catch (global::System.InvalidOperationException)
- {
- }
}
- if (chatAgentResponseVariant1 == null && request == null && chatAgentResponseVariant3 == null)
+ global::RetellAI.ChatAgentResponseVariant3? chatAgentResponseVariant3 = default;
+ try
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.ChatAgentResponseVariant3), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.ChatAgentResponseVariant3).Name}");
+ chatAgentResponseVariant3 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
{
- try
- {
-
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.ChatAgentResponseVariant3), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.ChatAgentResponseVariant3).Name}");
- chatAgentResponseVariant3 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
- }
- catch (global::System.Text.Json.JsonException)
- {
- }
- catch (global::System.InvalidOperationException)
- {
- }
}
-
var __value = new global::RetellAI.ChatAgentResponse(
chatAgentResponseVariant1,
@@ -199,24 +79,64 @@ public override void Write(
options = options ?? throw new global::System.ArgumentNullException(nameof(options));
var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set.");
+
+ writer.WriteStartObject();
+ var __writtenPropertyNames = new global::System.Collections.Generic.HashSet(global::System.StringComparer.Ordinal);
if (value.IsChatAgentResponseVariant1)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.ChatAgentResponseVariant1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.ChatAgentResponseVariant1).Name}");
- global::System.Text.Json.JsonSerializer.Serialize(writer, value.ChatAgentResponseVariant1!, typeInfo);
+ var __element0 = global::System.Text.Json.JsonSerializer.SerializeToElement(value.ChatAgentResponseVariant1!, typeInfo);
+ if (__element0.ValueKind != global::System.Text.Json.JsonValueKind.Object)
+ {
+ throw new global::System.Text.Json.JsonException("AllOf values must serialize as JSON objects.");
+ }
+
+ foreach (var __property in __element0.EnumerateObject())
+ {
+ if (__writtenPropertyNames.Add(__property.Name))
+ {
+ __property.WriteTo(writer);
+ }
+ }
}
- else if (value.IsRequest)
+ if (value.IsRequest)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.ChatAgentRequest), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.ChatAgentRequest).Name}");
- global::System.Text.Json.JsonSerializer.Serialize(writer, value.Request!, typeInfo);
+ var __element1 = global::System.Text.Json.JsonSerializer.SerializeToElement(value.Request!, typeInfo);
+ if (__element1.ValueKind != global::System.Text.Json.JsonValueKind.Object)
+ {
+ throw new global::System.Text.Json.JsonException("AllOf values must serialize as JSON objects.");
+ }
+
+ foreach (var __property in __element1.EnumerateObject())
+ {
+ if (__writtenPropertyNames.Add(__property.Name))
+ {
+ __property.WriteTo(writer);
+ }
+ }
}
- else if (value.IsChatAgentResponseVariant3)
+ if (value.IsChatAgentResponseVariant3)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.ChatAgentResponseVariant3), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.ChatAgentResponseVariant3).Name}");
- global::System.Text.Json.JsonSerializer.Serialize(writer, value.ChatAgentResponseVariant3!, typeInfo);
+ var __element2 = global::System.Text.Json.JsonSerializer.SerializeToElement(value.ChatAgentResponseVariant3!, typeInfo);
+ if (__element2.ValueKind != global::System.Text.Json.JsonValueKind.Object)
+ {
+ throw new global::System.Text.Json.JsonException("AllOf values must serialize as JSON objects.");
+ }
+
+ foreach (var __property in __element2.EnumerateObject())
+ {
+ if (__writtenPropertyNames.Add(__property.Name))
+ {
+ __property.WriteTo(writer);
+ }
+ }
}
+ writer.WriteEndObject();
}
}
}
\ No newline at end of file
diff --git a/src/libs/RetellAI/Generated/RetellAI.JsonConverters.CodeNode.g.cs b/src/libs/RetellAI/Generated/RetellAI.JsonConverters.CodeNode.g.cs
index 6a9d9c56..9271be14 100644
--- a/src/libs/RetellAI/Generated/RetellAI.JsonConverters.CodeNode.g.cs
+++ b/src/libs/RetellAI/Generated/RetellAI.JsonConverters.CodeNode.g.cs
@@ -17,104 +17,34 @@ public class CodeNodeJsonConverter : global::System.Text.Json.Serialization.Json
using var __jsonDocument = global::System.Text.Json.JsonDocument.ParseValue(ref reader);
var __rawJson = __jsonDocument.RootElement.GetRawText();
- var __jsonProps = new global::System.Collections.Generic.HashSet();
- if (__jsonDocument.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Object)
- {
- foreach (var __jsonProp in __jsonDocument.RootElement.EnumerateObject())
- {
- __jsonProps.Add(__jsonProp.Name);
- }
+ global::RetellAI.NodeBase? @base = default;
+ try
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.NodeBase), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.NodeBase).Name}");
+ @base = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
}
- var __score0 = 0;
- var __score1 = 0;
- if (__jsonProps.Contains("code")) __score1++;
- if (__jsonProps.Contains("edges")) __score1++;
- if (__jsonProps.Contains("else_edge")) __score1++;
- if (__jsonProps.Contains("enable_typing_sound")) __score1++;
- if (__jsonProps.Contains("finetune_transition_examples")) __score1++;
- if (__jsonProps.Contains("instruction")) __score1++;
- if (__jsonProps.Contains("response_variables")) __score1++;
- if (__jsonProps.Contains("speak_during_execution")) __score1++;
- if (__jsonProps.Contains("timeout_ms")) __score1++;
- if (__jsonProps.Contains("type")) __score1++;
- if (__jsonProps.Contains("wait_for_result")) __score1++;
- var __bestScore = 0;
- var __bestIndex = -1;
- if (__score0 > __bestScore) { __bestScore = __score0; __bestIndex = 0; }
- if (__score1 > __bestScore) { __bestScore = __score1; __bestIndex = 1; }
-
- global::RetellAI.NodeBase? @base = default;
global::RetellAI.CodeNodeVariant2? codeNodeVariant2 = default;
- if (__bestIndex >= 0)
+ try
{
- if (__bestIndex == 0)
- {
- try
- {
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.NodeBase), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.NodeBase).Name}");
- @base = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
- }
- catch (global::System.Text.Json.JsonException)
- {
- }
- catch (global::System.InvalidOperationException)
- {
- }
- }
- else if (__bestIndex == 1)
- {
- try
- {
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.CodeNodeVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.CodeNodeVariant2).Name}");
- codeNodeVariant2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
- }
- catch (global::System.Text.Json.JsonException)
- {
- }
- catch (global::System.InvalidOperationException)
- {
- }
- }
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.CodeNodeVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.CodeNodeVariant2).Name}");
+ codeNodeVariant2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
}
-
- if (@base == null && codeNodeVariant2 == null)
+ catch (global::System.Text.Json.JsonException)
{
- try
- {
-
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.NodeBase), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.NodeBase).Name}");
- @base = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
- }
- catch (global::System.Text.Json.JsonException)
- {
- }
- catch (global::System.InvalidOperationException)
- {
- }
}
-
- if (@base == null && codeNodeVariant2 == null)
+ catch (global::System.InvalidOperationException)
{
- try
- {
-
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.CodeNodeVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.CodeNodeVariant2).Name}");
- codeNodeVariant2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
- }
- catch (global::System.Text.Json.JsonException)
- {
- }
- catch (global::System.InvalidOperationException)
- {
- }
}
-
var __value = new global::RetellAI.CodeNode(
@base,
@@ -133,18 +63,46 @@ public override void Write(
options = options ?? throw new global::System.ArgumentNullException(nameof(options));
var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set.");
+
+ writer.WriteStartObject();
+ var __writtenPropertyNames = new global::System.Collections.Generic.HashSet(global::System.StringComparer.Ordinal);
if (value.IsBase)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.NodeBase), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.NodeBase).Name}");
- global::System.Text.Json.JsonSerializer.Serialize(writer, value.Base!.Value, typeInfo);
+ var __element0 = global::System.Text.Json.JsonSerializer.SerializeToElement(value.Base!.Value, typeInfo);
+ if (__element0.ValueKind != global::System.Text.Json.JsonValueKind.Object)
+ {
+ throw new global::System.Text.Json.JsonException("AllOf values must serialize as JSON objects.");
+ }
+
+ foreach (var __property in __element0.EnumerateObject())
+ {
+ if (__writtenPropertyNames.Add(__property.Name))
+ {
+ __property.WriteTo(writer);
+ }
+ }
}
- else if (value.IsCodeNodeVariant2)
+ if (value.IsCodeNodeVariant2)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.CodeNodeVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.CodeNodeVariant2).Name}");
- global::System.Text.Json.JsonSerializer.Serialize(writer, value.CodeNodeVariant2!, typeInfo);
+ var __element1 = global::System.Text.Json.JsonSerializer.SerializeToElement(value.CodeNodeVariant2!, typeInfo);
+ if (__element1.ValueKind != global::System.Text.Json.JsonValueKind.Object)
+ {
+ throw new global::System.Text.Json.JsonException("AllOf values must serialize as JSON objects.");
+ }
+
+ foreach (var __property in __element1.EnumerateObject())
+ {
+ if (__writtenPropertyNames.Add(__property.Name))
+ {
+ __property.WriteTo(writer);
+ }
+ }
}
+ writer.WriteEndObject();
}
}
}
\ No newline at end of file
diff --git a/src/libs/RetellAI/Generated/RetellAI.JsonConverters.ComponentNode.g.cs b/src/libs/RetellAI/Generated/RetellAI.JsonConverters.ComponentNode.g.cs
index 3093e684..a6a5dc6f 100644
--- a/src/libs/RetellAI/Generated/RetellAI.JsonConverters.ComponentNode.g.cs
+++ b/src/libs/RetellAI/Generated/RetellAI.JsonConverters.ComponentNode.g.cs
@@ -17,117 +17,34 @@ public class ComponentNodeJsonConverter : global::System.Text.Json.Serialization
using var __jsonDocument = global::System.Text.Json.JsonDocument.ParseValue(ref reader);
var __rawJson = __jsonDocument.RootElement.GetRawText();
- var __jsonProps = new global::System.Collections.Generic.HashSet();
- if (__jsonDocument.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Object)
- {
- foreach (var __jsonProp in __jsonDocument.RootElement.EnumerateObject())
- {
- __jsonProps.Add(__jsonProp.Name);
- if (__jsonProp.Value.ValueKind == global::System.Text.Json.JsonValueKind.Object)
- {
- foreach (var __nestedJsonProp in __jsonProp.Value.EnumerateObject())
- {
- __jsonProps.Add(__jsonProp.Name + "." + __nestedJsonProp.Name);
- }
- }
- }
+ global::RetellAI.NodeBaseCommon? baseCommon = default;
+ try
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.NodeBaseCommon), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.NodeBaseCommon).Name}");
+ baseCommon = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
}
- var __score0 = 0;
- if (__jsonProps.Contains("display_position")) __score0++;
- if (__jsonProps.Contains("display_position.x")) __score0++;
- if (__jsonProps.Contains("display_position.y")) __score0++;
- if (__jsonProps.Contains("global_node_setting")) __score0++;
- if (__jsonProps.Contains("global_node_setting.condition")) __score0++;
- if (__jsonProps.Contains("global_node_setting.cool_down")) __score0++;
- if (__jsonProps.Contains("global_node_setting.go_back_conditions")) __score0++;
- if (__jsonProps.Contains("global_node_setting.negative_finetune_examples")) __score0++;
- if (__jsonProps.Contains("global_node_setting.positive_finetune_examples")) __score0++;
- if (__jsonProps.Contains("id")) __score0++;
- if (__jsonProps.Contains("name")) __score0++;
- var __score1 = 0;
- if (__jsonProps.Contains("component_id")) __score1++;
- if (__jsonProps.Contains("component_type")) __score1++;
- if (__jsonProps.Contains("edges")) __score1++;
- if (__jsonProps.Contains("else_edge")) __score1++;
- if (__jsonProps.Contains("finetune_transition_examples")) __score1++;
- if (__jsonProps.Contains("type")) __score1++;
- var __bestScore = 0;
- var __bestIndex = -1;
- if (__score0 > __bestScore) { __bestScore = __score0; __bestIndex = 0; }
- if (__score1 > __bestScore) { __bestScore = __score1; __bestIndex = 1; }
-
- global::RetellAI.NodeBaseCommon? baseCommon = default;
global::RetellAI.ComponentNodeVariant2? componentNodeVariant2 = default;
- if (__bestIndex >= 0)
+ try
{
- if (__bestIndex == 0)
- {
- try
- {
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.NodeBaseCommon), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.NodeBaseCommon).Name}");
- baseCommon = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
- }
- catch (global::System.Text.Json.JsonException)
- {
- }
- catch (global::System.InvalidOperationException)
- {
- }
- }
- else if (__bestIndex == 1)
- {
- try
- {
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.ComponentNodeVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.ComponentNodeVariant2).Name}");
- componentNodeVariant2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
- }
- catch (global::System.Text.Json.JsonException)
- {
- }
- catch (global::System.InvalidOperationException)
- {
- }
- }
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.ComponentNodeVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.ComponentNodeVariant2).Name}");
+ componentNodeVariant2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
}
-
- if (baseCommon == null && componentNodeVariant2 == null)
+ catch (global::System.Text.Json.JsonException)
{
- try
- {
-
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.NodeBaseCommon), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.NodeBaseCommon).Name}");
- baseCommon = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
- }
- catch (global::System.Text.Json.JsonException)
- {
- }
- catch (global::System.InvalidOperationException)
- {
- }
}
-
- if (baseCommon == null && componentNodeVariant2 == null)
+ catch (global::System.InvalidOperationException)
{
- try
- {
-
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.ComponentNodeVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.ComponentNodeVariant2).Name}");
- componentNodeVariant2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
- }
- catch (global::System.Text.Json.JsonException)
- {
- }
- catch (global::System.InvalidOperationException)
- {
- }
}
-
var __value = new global::RetellAI.ComponentNode(
baseCommon,
@@ -146,18 +63,46 @@ public override void Write(
options = options ?? throw new global::System.ArgumentNullException(nameof(options));
var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set.");
+
+ writer.WriteStartObject();
+ var __writtenPropertyNames = new global::System.Collections.Generic.HashSet(global::System.StringComparer.Ordinal);
if (value.IsBaseCommon)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.NodeBaseCommon), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.NodeBaseCommon).Name}");
- global::System.Text.Json.JsonSerializer.Serialize(writer, value.BaseCommon!, typeInfo);
+ var __element0 = global::System.Text.Json.JsonSerializer.SerializeToElement(value.BaseCommon!, typeInfo);
+ if (__element0.ValueKind != global::System.Text.Json.JsonValueKind.Object)
+ {
+ throw new global::System.Text.Json.JsonException("AllOf values must serialize as JSON objects.");
+ }
+
+ foreach (var __property in __element0.EnumerateObject())
+ {
+ if (__writtenPropertyNames.Add(__property.Name))
+ {
+ __property.WriteTo(writer);
+ }
+ }
}
- else if (value.IsComponentNodeVariant2)
+ if (value.IsComponentNodeVariant2)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.ComponentNodeVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.ComponentNodeVariant2).Name}");
- global::System.Text.Json.JsonSerializer.Serialize(writer, value.ComponentNodeVariant2!, typeInfo);
+ var __element1 = global::System.Text.Json.JsonSerializer.SerializeToElement(value.ComponentNodeVariant2!, typeInfo);
+ if (__element1.ValueKind != global::System.Text.Json.JsonValueKind.Object)
+ {
+ throw new global::System.Text.Json.JsonException("AllOf values must serialize as JSON objects.");
+ }
+
+ foreach (var __property in __element1.EnumerateObject())
+ {
+ if (__writtenPropertyNames.Add(__property.Name))
+ {
+ __property.WriteTo(writer);
+ }
+ }
}
+ writer.WriteEndObject();
}
}
}
\ No newline at end of file
diff --git a/src/libs/RetellAI/Generated/RetellAI.JsonConverters.ConversationFlow.g.cs b/src/libs/RetellAI/Generated/RetellAI.JsonConverters.ConversationFlow.g.cs
index cffbaa68..e79ee2b9 100644
--- a/src/libs/RetellAI/Generated/RetellAI.JsonConverters.ConversationFlow.g.cs
+++ b/src/libs/RetellAI/Generated/RetellAI.JsonConverters.ConversationFlow.g.cs
@@ -17,122 +17,34 @@ public class ConversationFlowJsonConverter : global::System.Text.Json.Serializat
using var __jsonDocument = global::System.Text.Json.JsonDocument.ParseValue(ref reader);
var __rawJson = __jsonDocument.RootElement.GetRawText();
- var __jsonProps = new global::System.Collections.Generic.HashSet();
- if (__jsonDocument.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Object)
- {
- foreach (var __jsonProp in __jsonDocument.RootElement.EnumerateObject())
- {
- __jsonProps.Add(__jsonProp.Name);
- if (__jsonProp.Value.ValueKind == global::System.Text.Json.JsonValueKind.Object)
- {
- foreach (var __nestedJsonProp in __jsonProp.Value.EnumerateObject())
- {
- __jsonProps.Add(__jsonProp.Name + "." + __nestedJsonProp.Name);
- }
- }
- }
+ global::RetellAI.ConversationFlowOverride? @override = default;
+ try
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.ConversationFlowOverride), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.ConversationFlowOverride).Name}");
+ @override = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
}
- var __score0 = 0;
- if (__jsonProps.Contains("begin_after_user_silence_ms")) __score0++;
- if (__jsonProps.Contains("kb_config")) __score0++;
- if (__jsonProps.Contains("kb_config.filter_score")) __score0++;
- if (__jsonProps.Contains("kb_config.top_k")) __score0++;
- if (__jsonProps.Contains("knowledge_base_ids")) __score0++;
- if (__jsonProps.Contains("model_choice")) __score0++;
- if (__jsonProps.Contains("model_temperature")) __score0++;
- if (__jsonProps.Contains("start_speaker")) __score0++;
- if (__jsonProps.Contains("tool_call_strict_mode")) __score0++;
- var __score1 = 0;
- if (__jsonProps.Contains("begin_tag_display_position")) __score1++;
- if (__jsonProps.Contains("begin_tag_display_position.x")) __score1++;
- if (__jsonProps.Contains("begin_tag_display_position.y")) __score1++;
- if (__jsonProps.Contains("components")) __score1++;
- if (__jsonProps.Contains("default_dynamic_variables")) __score1++;
- if (__jsonProps.Contains("flex_mode")) __score1++;
- if (__jsonProps.Contains("global_prompt")) __score1++;
- if (__jsonProps.Contains("is_transfer_cf")) __score1++;
- if (__jsonProps.Contains("mcps")) __score1++;
- if (__jsonProps.Contains("nodes")) __score1++;
- if (__jsonProps.Contains("notes")) __score1++;
- if (__jsonProps.Contains("start_node_id")) __score1++;
- if (__jsonProps.Contains("tools")) __score1++;
- var __bestScore = 0;
- var __bestIndex = -1;
- if (__score0 > __bestScore) { __bestScore = __score0; __bestIndex = 0; }
- if (__score1 > __bestScore) { __bestScore = __score1; __bestIndex = 1; }
-
- global::RetellAI.ConversationFlowOverride? @override = default;
global::RetellAI.ConversationFlowVariant2? conversationFlowVariant2 = default;
- if (__bestIndex >= 0)
+ try
{
- if (__bestIndex == 0)
- {
- try
- {
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.ConversationFlowOverride), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.ConversationFlowOverride).Name}");
- @override = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
- }
- catch (global::System.Text.Json.JsonException)
- {
- }
- catch (global::System.InvalidOperationException)
- {
- }
- }
- else if (__bestIndex == 1)
- {
- try
- {
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.ConversationFlowVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.ConversationFlowVariant2).Name}");
- conversationFlowVariant2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
- }
- catch (global::System.Text.Json.JsonException)
- {
- }
- catch (global::System.InvalidOperationException)
- {
- }
- }
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.ConversationFlowVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.ConversationFlowVariant2).Name}");
+ conversationFlowVariant2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
}
-
- if (@override == null && conversationFlowVariant2 == null)
+ catch (global::System.Text.Json.JsonException)
{
- try
- {
-
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.ConversationFlowOverride), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.ConversationFlowOverride).Name}");
- @override = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
- }
- catch (global::System.Text.Json.JsonException)
- {
- }
- catch (global::System.InvalidOperationException)
- {
- }
}
-
- if (@override == null && conversationFlowVariant2 == null)
+ catch (global::System.InvalidOperationException)
{
- try
- {
-
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.ConversationFlowVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.ConversationFlowVariant2).Name}");
- conversationFlowVariant2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
- }
- catch (global::System.Text.Json.JsonException)
- {
- }
- catch (global::System.InvalidOperationException)
- {
- }
}
-
var __value = new global::RetellAI.ConversationFlow(
@override,
@@ -151,18 +63,46 @@ public override void Write(
options = options ?? throw new global::System.ArgumentNullException(nameof(options));
var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set.");
+
+ writer.WriteStartObject();
+ var __writtenPropertyNames = new global::System.Collections.Generic.HashSet(global::System.StringComparer.Ordinal);
if (value.IsOverride)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.ConversationFlowOverride), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.ConversationFlowOverride).Name}");
- global::System.Text.Json.JsonSerializer.Serialize(writer, value.Override!, typeInfo);
+ var __element0 = global::System.Text.Json.JsonSerializer.SerializeToElement(value.Override!, typeInfo);
+ if (__element0.ValueKind != global::System.Text.Json.JsonValueKind.Object)
+ {
+ throw new global::System.Text.Json.JsonException("AllOf values must serialize as JSON objects.");
+ }
+
+ foreach (var __property in __element0.EnumerateObject())
+ {
+ if (__writtenPropertyNames.Add(__property.Name))
+ {
+ __property.WriteTo(writer);
+ }
+ }
}
- else if (value.IsConversationFlowVariant2)
+ if (value.IsConversationFlowVariant2)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.ConversationFlowVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.ConversationFlowVariant2).Name}");
- global::System.Text.Json.JsonSerializer.Serialize(writer, value.ConversationFlowVariant2!, typeInfo);
+ var __element1 = global::System.Text.Json.JsonSerializer.SerializeToElement(value.ConversationFlowVariant2!, typeInfo);
+ if (__element1.ValueKind != global::System.Text.Json.JsonValueKind.Object)
+ {
+ throw new global::System.Text.Json.JsonException("AllOf values must serialize as JSON objects.");
+ }
+
+ foreach (var __property in __element1.EnumerateObject())
+ {
+ if (__writtenPropertyNames.Add(__property.Name))
+ {
+ __property.WriteTo(writer);
+ }
+ }
}
+ writer.WriteEndObject();
}
}
}
\ No newline at end of file
diff --git a/src/libs/RetellAI/Generated/RetellAI.JsonConverters.ConversationFlowComponentResponse.g.cs b/src/libs/RetellAI/Generated/RetellAI.JsonConverters.ConversationFlowComponentResponse.g.cs
index 6670653d..e927c5fd 100644
--- a/src/libs/RetellAI/Generated/RetellAI.JsonConverters.ConversationFlowComponentResponse.g.cs
+++ b/src/libs/RetellAI/Generated/RetellAI.JsonConverters.ConversationFlowComponentResponse.g.cs
@@ -17,96 +17,34 @@ public class ConversationFlowComponentResponseJsonConverter : global::System.Tex
using var __jsonDocument = global::System.Text.Json.JsonDocument.ParseValue(ref reader);
var __rawJson = __jsonDocument.RootElement.GetRawText();
- var __jsonProps = new global::System.Collections.Generic.HashSet();
- if (__jsonDocument.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Object)
- {
- foreach (var __jsonProp in __jsonDocument.RootElement.EnumerateObject())
- {
- __jsonProps.Add(__jsonProp.Name);
- }
+ global::RetellAI.CreateConversationFlowComponentRequest? createRequest = default;
+ try
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.CreateConversationFlowComponentRequest), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.CreateConversationFlowComponentRequest).Name}");
+ createRequest = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
}
- var __score0 = 0;
- var __score1 = 0;
- if (__jsonProps.Contains("conversation_flow_component_id")) __score1++;
- if (__jsonProps.Contains("linked_conversation_flow_ids")) __score1++;
- if (__jsonProps.Contains("user_modified_timestamp")) __score1++;
- var __bestScore = 0;
- var __bestIndex = -1;
- if (__score0 > __bestScore) { __bestScore = __score0; __bestIndex = 0; }
- if (__score1 > __bestScore) { __bestScore = __score1; __bestIndex = 1; }
-
- global::RetellAI.CreateConversationFlowComponentRequest? createRequest = default;
global::RetellAI.ConversationFlowComponentResponseVariant2? conversationFlowComponentResponseVariant2 = default;
- if (__bestIndex >= 0)
+ try
{
- if (__bestIndex == 0)
- {
- try
- {
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.CreateConversationFlowComponentRequest), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.CreateConversationFlowComponentRequest).Name}");
- createRequest = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
- }
- catch (global::System.Text.Json.JsonException)
- {
- }
- catch (global::System.InvalidOperationException)
- {
- }
- }
- else if (__bestIndex == 1)
- {
- try
- {
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.ConversationFlowComponentResponseVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.ConversationFlowComponentResponseVariant2).Name}");
- conversationFlowComponentResponseVariant2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
- }
- catch (global::System.Text.Json.JsonException)
- {
- }
- catch (global::System.InvalidOperationException)
- {
- }
- }
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.ConversationFlowComponentResponseVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.ConversationFlowComponentResponseVariant2).Name}");
+ conversationFlowComponentResponseVariant2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
}
-
- if (createRequest == null && conversationFlowComponentResponseVariant2 == null)
+ catch (global::System.Text.Json.JsonException)
{
- try
- {
-
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.CreateConversationFlowComponentRequest), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.CreateConversationFlowComponentRequest).Name}");
- createRequest = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
- }
- catch (global::System.Text.Json.JsonException)
- {
- }
- catch (global::System.InvalidOperationException)
- {
- }
}
-
- if (createRequest == null && conversationFlowComponentResponseVariant2 == null)
+ catch (global::System.InvalidOperationException)
{
- try
- {
-
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.ConversationFlowComponentResponseVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.ConversationFlowComponentResponseVariant2).Name}");
- conversationFlowComponentResponseVariant2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
- }
- catch (global::System.Text.Json.JsonException)
- {
- }
- catch (global::System.InvalidOperationException)
- {
- }
}
-
var __value = new global::RetellAI.ConversationFlowComponentResponse(
createRequest,
@@ -125,18 +63,46 @@ public override void Write(
options = options ?? throw new global::System.ArgumentNullException(nameof(options));
var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set.");
+
+ writer.WriteStartObject();
+ var __writtenPropertyNames = new global::System.Collections.Generic.HashSet(global::System.StringComparer.Ordinal);
if (value.IsCreateRequest)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.CreateConversationFlowComponentRequest), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.CreateConversationFlowComponentRequest).Name}");
- global::System.Text.Json.JsonSerializer.Serialize(writer, value.CreateRequest!.Value, typeInfo);
+ var __element0 = global::System.Text.Json.JsonSerializer.SerializeToElement(value.CreateRequest!.Value, typeInfo);
+ if (__element0.ValueKind != global::System.Text.Json.JsonValueKind.Object)
+ {
+ throw new global::System.Text.Json.JsonException("AllOf values must serialize as JSON objects.");
+ }
+
+ foreach (var __property in __element0.EnumerateObject())
+ {
+ if (__writtenPropertyNames.Add(__property.Name))
+ {
+ __property.WriteTo(writer);
+ }
+ }
}
- else if (value.IsConversationFlowComponentResponseVariant2)
+ if (value.IsConversationFlowComponentResponseVariant2)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.ConversationFlowComponentResponseVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.ConversationFlowComponentResponseVariant2).Name}");
- global::System.Text.Json.JsonSerializer.Serialize(writer, value.ConversationFlowComponentResponseVariant2!, typeInfo);
+ var __element1 = global::System.Text.Json.JsonSerializer.SerializeToElement(value.ConversationFlowComponentResponseVariant2!, typeInfo);
+ if (__element1.ValueKind != global::System.Text.Json.JsonValueKind.Object)
+ {
+ throw new global::System.Text.Json.JsonException("AllOf values must serialize as JSON objects.");
+ }
+
+ foreach (var __property in __element1.EnumerateObject())
+ {
+ if (__writtenPropertyNames.Add(__property.Name))
+ {
+ __property.WriteTo(writer);
+ }
+ }
}
+ writer.WriteEndObject();
}
}
}
\ No newline at end of file
diff --git a/src/libs/RetellAI/Generated/RetellAI.JsonConverters.ConversationFlowResponse.g.cs b/src/libs/RetellAI/Generated/RetellAI.JsonConverters.ConversationFlowResponse.g.cs
index cdf5422d..f1f53362 100644
--- a/src/libs/RetellAI/Generated/RetellAI.JsonConverters.ConversationFlowResponse.g.cs
+++ b/src/libs/RetellAI/Generated/RetellAI.JsonConverters.ConversationFlowResponse.g.cs
@@ -17,96 +17,34 @@ public class ConversationFlowResponseJsonConverter : global::System.Text.Json.Se
using var __jsonDocument = global::System.Text.Json.JsonDocument.ParseValue(ref reader);
var __rawJson = __jsonDocument.RootElement.GetRawText();
- var __jsonProps = new global::System.Collections.Generic.HashSet();
- if (__jsonDocument.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Object)
- {
- foreach (var __jsonProp in __jsonDocument.RootElement.EnumerateObject())
- {
- __jsonProps.Add(__jsonProp.Name);
- }
+ global::RetellAI.ConversationFlow? conversationFlow = default;
+ try
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.ConversationFlow), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.ConversationFlow).Name}");
+ conversationFlow = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
}
- var __score0 = 0;
- var __score1 = 0;
- if (__jsonProps.Contains("conversation_flow_id")) __score1++;
- if (__jsonProps.Contains("last_modification_timestamp")) __score1++;
- if (__jsonProps.Contains("version")) __score1++;
- var __bestScore = 0;
- var __bestIndex = -1;
- if (__score0 > __bestScore) { __bestScore = __score0; __bestIndex = 0; }
- if (__score1 > __bestScore) { __bestScore = __score1; __bestIndex = 1; }
-
- global::RetellAI.ConversationFlow? conversationFlow = default;
global::RetellAI.ConversationFlowResponseVariant2? conversationFlowResponseVariant2 = default;
- if (__bestIndex >= 0)
+ try
{
- if (__bestIndex == 0)
- {
- try
- {
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.ConversationFlow), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.ConversationFlow).Name}");
- conversationFlow = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
- }
- catch (global::System.Text.Json.JsonException)
- {
- }
- catch (global::System.InvalidOperationException)
- {
- }
- }
- else if (__bestIndex == 1)
- {
- try
- {
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.ConversationFlowResponseVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.ConversationFlowResponseVariant2).Name}");
- conversationFlowResponseVariant2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
- }
- catch (global::System.Text.Json.JsonException)
- {
- }
- catch (global::System.InvalidOperationException)
- {
- }
- }
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.ConversationFlowResponseVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.ConversationFlowResponseVariant2).Name}");
+ conversationFlowResponseVariant2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
}
-
- if (conversationFlow == null && conversationFlowResponseVariant2 == null)
+ catch (global::System.Text.Json.JsonException)
{
- try
- {
-
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.ConversationFlow), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.ConversationFlow).Name}");
- conversationFlow = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
- }
- catch (global::System.Text.Json.JsonException)
- {
- }
- catch (global::System.InvalidOperationException)
- {
- }
}
-
- if (conversationFlow == null && conversationFlowResponseVariant2 == null)
+ catch (global::System.InvalidOperationException)
{
- try
- {
-
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.ConversationFlowResponseVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.ConversationFlowResponseVariant2).Name}");
- conversationFlowResponseVariant2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
- }
- catch (global::System.Text.Json.JsonException)
- {
- }
- catch (global::System.InvalidOperationException)
- {
- }
}
-
var __value = new global::RetellAI.ConversationFlowResponse(
conversationFlow,
@@ -125,18 +63,46 @@ public override void Write(
options = options ?? throw new global::System.ArgumentNullException(nameof(options));
var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set.");
+
+ writer.WriteStartObject();
+ var __writtenPropertyNames = new global::System.Collections.Generic.HashSet(global::System.StringComparer.Ordinal);
if (value.IsConversationFlow)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.ConversationFlow), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.ConversationFlow).Name}");
- global::System.Text.Json.JsonSerializer.Serialize(writer, value.ConversationFlow!.Value, typeInfo);
+ var __element0 = global::System.Text.Json.JsonSerializer.SerializeToElement(value.ConversationFlow!.Value, typeInfo);
+ if (__element0.ValueKind != global::System.Text.Json.JsonValueKind.Object)
+ {
+ throw new global::System.Text.Json.JsonException("AllOf values must serialize as JSON objects.");
+ }
+
+ foreach (var __property in __element0.EnumerateObject())
+ {
+ if (__writtenPropertyNames.Add(__property.Name))
+ {
+ __property.WriteTo(writer);
+ }
+ }
}
- else if (value.IsConversationFlowResponseVariant2)
+ if (value.IsConversationFlowResponseVariant2)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.ConversationFlowResponseVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.ConversationFlowResponseVariant2).Name}");
- global::System.Text.Json.JsonSerializer.Serialize(writer, value.ConversationFlowResponseVariant2!, typeInfo);
+ var __element1 = global::System.Text.Json.JsonSerializer.SerializeToElement(value.ConversationFlowResponseVariant2!, typeInfo);
+ if (__element1.ValueKind != global::System.Text.Json.JsonValueKind.Object)
+ {
+ throw new global::System.Text.Json.JsonException("AllOf values must serialize as JSON objects.");
+ }
+
+ foreach (var __property in __element1.EnumerateObject())
+ {
+ if (__writtenPropertyNames.Add(__property.Name))
+ {
+ __property.WriteTo(writer);
+ }
+ }
}
+ writer.WriteEndObject();
}
}
}
\ No newline at end of file
diff --git a/src/libs/RetellAI/Generated/RetellAI.JsonConverters.ConversationNode.g.cs b/src/libs/RetellAI/Generated/RetellAI.JsonConverters.ConversationNode.g.cs
index d9dabcb2..6fb8907b 100644
--- a/src/libs/RetellAI/Generated/RetellAI.JsonConverters.ConversationNode.g.cs
+++ b/src/libs/RetellAI/Generated/RetellAI.JsonConverters.ConversationNode.g.cs
@@ -17,153 +17,48 @@ public class ConversationNodeJsonConverter : global::System.Text.Json.Serializat
using var __jsonDocument = global::System.Text.Json.JsonDocument.ParseValue(ref reader);
var __rawJson = __jsonDocument.RootElement.GetRawText();
- var __jsonProps = new global::System.Collections.Generic.HashSet();
- if (__jsonDocument.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Object)
- {
- foreach (var __jsonProp in __jsonDocument.RootElement.EnumerateObject())
- {
- __jsonProps.Add(__jsonProp.Name);
- if (__jsonProp.Value.ValueKind == global::System.Text.Json.JsonValueKind.Object)
- {
- foreach (var __nestedJsonProp in __jsonProp.Value.EnumerateObject())
- {
- __jsonProps.Add(__jsonProp.Name + "." + __nestedJsonProp.Name);
- }
- }
- }
+ global::RetellAI.NodeBase? @base = default;
+ try
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.NodeBase), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.NodeBase).Name}");
+ @base = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
}
- var __score0 = 0;
- var __score1 = 0;
- if (__jsonProps.Contains("allow_dtmf_interruption")) __score1++;
- if (__jsonProps.Contains("interruption_sensitivity")) __score1++;
- if (__jsonProps.Contains("reminder_max_count")) __score1++;
- if (__jsonProps.Contains("reminder_trigger_ms")) __score1++;
- if (__jsonProps.Contains("responsiveness")) __score1++;
- if (__jsonProps.Contains("voice_speed")) __score1++;
- var __score2 = 0;
- if (__jsonProps.Contains("always_edge")) __score2++;
- if (__jsonProps.Contains("edges")) __score2++;
- if (__jsonProps.Contains("else_edge")) __score2++;
- if (__jsonProps.Contains("finetune_conversation_examples")) __score2++;
- if (__jsonProps.Contains("finetune_transition_examples")) __score2++;
- if (__jsonProps.Contains("instruction")) __score2++;
- if (__jsonProps.Contains("kb_config")) __score2++;
- if (__jsonProps.Contains("kb_config.filter_score")) __score2++;
- if (__jsonProps.Contains("kb_config.top_k")) __score2++;
- if (__jsonProps.Contains("knowledge_base_ids")) __score2++;
- if (__jsonProps.Contains("skip_response_edge")) __score2++;
- if (__jsonProps.Contains("type")) __score2++;
- var __bestScore = 0;
- var __bestIndex = -1;
- if (__score0 > __bestScore) { __bestScore = __score0; __bestIndex = 0; }
- if (__score1 > __bestScore) { __bestScore = __score1; __bestIndex = 1; }
- if (__score2 > __bestScore) { __bestScore = __score2; __bestIndex = 2; }
-
- global::RetellAI.NodeBase? @base = default;
global::RetellAI.AgentOverrideConfig? agentOverrideConfig = default;
- global::RetellAI.ConversationNodeVariant3? conversationNodeVariant3 = default;
- if (__bestIndex >= 0)
+ try
{
- if (__bestIndex == 0)
- {
- try
- {
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.NodeBase), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.NodeBase).Name}");
- @base = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
- }
- catch (global::System.Text.Json.JsonException)
- {
- }
- catch (global::System.InvalidOperationException)
- {
- }
- }
- else if (__bestIndex == 1)
- {
- try
- {
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.AgentOverrideConfig), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.AgentOverrideConfig).Name}");
- agentOverrideConfig = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
- }
- catch (global::System.Text.Json.JsonException)
- {
- }
- catch (global::System.InvalidOperationException)
- {
- }
- }
- else if (__bestIndex == 2)
- {
- try
- {
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.ConversationNodeVariant3), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.ConversationNodeVariant3).Name}");
- conversationNodeVariant3 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
- }
- catch (global::System.Text.Json.JsonException)
- {
- }
- catch (global::System.InvalidOperationException)
- {
- }
- }
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.AgentOverrideConfig), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.AgentOverrideConfig).Name}");
+ agentOverrideConfig = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
}
-
- if (@base == null && agentOverrideConfig == null && conversationNodeVariant3 == null)
+ catch (global::System.Text.Json.JsonException)
{
- try
- {
-
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.NodeBase), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.NodeBase).Name}");
- @base = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
- }
- catch (global::System.Text.Json.JsonException)
- {
- }
- catch (global::System.InvalidOperationException)
- {
- }
}
-
- if (@base == null && agentOverrideConfig == null && conversationNodeVariant3 == null)
+ catch (global::System.InvalidOperationException)
{
- try
- {
-
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.AgentOverrideConfig), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.AgentOverrideConfig).Name}");
- agentOverrideConfig = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
- }
- catch (global::System.Text.Json.JsonException)
- {
- }
- catch (global::System.InvalidOperationException)
- {
- }
}
- if (@base == null && agentOverrideConfig == null && conversationNodeVariant3 == null)
+ global::RetellAI.ConversationNodeVariant3? conversationNodeVariant3 = default;
+ try
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.ConversationNodeVariant3), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.ConversationNodeVariant3).Name}");
+ conversationNodeVariant3 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
{
- try
- {
-
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.ConversationNodeVariant3), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.ConversationNodeVariant3).Name}");
- conversationNodeVariant3 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
- }
- catch (global::System.Text.Json.JsonException)
- {
- }
- catch (global::System.InvalidOperationException)
- {
- }
}
-
var __value = new global::RetellAI.ConversationNode(
@base,
@@ -184,24 +79,64 @@ public override void Write(
options = options ?? throw new global::System.ArgumentNullException(nameof(options));
var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set.");
+
+ writer.WriteStartObject();
+ var __writtenPropertyNames = new global::System.Collections.Generic.HashSet(global::System.StringComparer.Ordinal);
if (value.IsBase)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.NodeBase), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.NodeBase).Name}");
- global::System.Text.Json.JsonSerializer.Serialize(writer, value.Base!.Value, typeInfo);
+ var __element0 = global::System.Text.Json.JsonSerializer.SerializeToElement(value.Base!.Value, typeInfo);
+ if (__element0.ValueKind != global::System.Text.Json.JsonValueKind.Object)
+ {
+ throw new global::System.Text.Json.JsonException("AllOf values must serialize as JSON objects.");
+ }
+
+ foreach (var __property in __element0.EnumerateObject())
+ {
+ if (__writtenPropertyNames.Add(__property.Name))
+ {
+ __property.WriteTo(writer);
+ }
+ }
}
- else if (value.IsAgentOverrideConfig)
+ if (value.IsAgentOverrideConfig)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.AgentOverrideConfig), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.AgentOverrideConfig).Name}");
- global::System.Text.Json.JsonSerializer.Serialize(writer, value.AgentOverrideConfig!, typeInfo);
+ var __element1 = global::System.Text.Json.JsonSerializer.SerializeToElement(value.AgentOverrideConfig!, typeInfo);
+ if (__element1.ValueKind != global::System.Text.Json.JsonValueKind.Object)
+ {
+ throw new global::System.Text.Json.JsonException("AllOf values must serialize as JSON objects.");
+ }
+
+ foreach (var __property in __element1.EnumerateObject())
+ {
+ if (__writtenPropertyNames.Add(__property.Name))
+ {
+ __property.WriteTo(writer);
+ }
+ }
}
- else if (value.IsConversationNodeVariant3)
+ if (value.IsConversationNodeVariant3)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.ConversationNodeVariant3), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.ConversationNodeVariant3).Name}");
- global::System.Text.Json.JsonSerializer.Serialize(writer, value.ConversationNodeVariant3!, typeInfo);
+ var __element2 = global::System.Text.Json.JsonSerializer.SerializeToElement(value.ConversationNodeVariant3!, typeInfo);
+ if (__element2.ValueKind != global::System.Text.Json.JsonValueKind.Object)
+ {
+ throw new global::System.Text.Json.JsonException("AllOf values must serialize as JSON objects.");
+ }
+
+ foreach (var __property in __element2.EnumerateObject())
+ {
+ if (__writtenPropertyNames.Add(__property.Name))
+ {
+ __property.WriteTo(writer);
+ }
+ }
}
+ writer.WriteEndObject();
}
}
}
\ No newline at end of file
diff --git a/src/libs/RetellAI/Generated/RetellAI.JsonConverters.CreateConversationFlowComponentRequest.g.cs b/src/libs/RetellAI/Generated/RetellAI.JsonConverters.CreateConversationFlowComponentRequest.g.cs
index 08f6a59a..9a593d55 100644
--- a/src/libs/RetellAI/Generated/RetellAI.JsonConverters.CreateConversationFlowComponentRequest.g.cs
+++ b/src/libs/RetellAI/Generated/RetellAI.JsonConverters.CreateConversationFlowComponentRequest.g.cs
@@ -17,110 +17,34 @@ public class CreateConversationFlowComponentRequestJsonConverter : global::Syste
using var __jsonDocument = global::System.Text.Json.JsonDocument.ParseValue(ref reader);
var __rawJson = __jsonDocument.RootElement.GetRawText();
- var __jsonProps = new global::System.Collections.Generic.HashSet();
- if (__jsonDocument.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Object)
- {
- foreach (var __jsonProp in __jsonDocument.RootElement.EnumerateObject())
- {
- __jsonProps.Add(__jsonProp.Name);
- if (__jsonProp.Value.ValueKind == global::System.Text.Json.JsonValueKind.Object)
- {
- foreach (var __nestedJsonProp in __jsonProp.Value.EnumerateObject())
- {
- __jsonProps.Add(__jsonProp.Name + "." + __nestedJsonProp.Name);
- }
- }
- }
+ global::RetellAI.ConversationFlowComponent? conversationFlowComponent = default;
+ try
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.ConversationFlowComponent), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.ConversationFlowComponent).Name}");
+ conversationFlowComponent = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
}
- var __score0 = 0;
- if (__jsonProps.Contains("begin_tag_display_position")) __score0++;
- if (__jsonProps.Contains("begin_tag_display_position.x")) __score0++;
- if (__jsonProps.Contains("begin_tag_display_position.y")) __score0++;
- if (__jsonProps.Contains("flex_mode")) __score0++;
- if (__jsonProps.Contains("mcps")) __score0++;
- if (__jsonProps.Contains("name")) __score0++;
- if (__jsonProps.Contains("nodes")) __score0++;
- if (__jsonProps.Contains("notes")) __score0++;
- if (__jsonProps.Contains("start_node_id")) __score0++;
- if (__jsonProps.Contains("tools")) __score0++;
- var __score1 = 0;
- var __bestScore = 0;
- var __bestIndex = -1;
- if (__score0 > __bestScore) { __bestScore = __score0; __bestIndex = 0; }
- if (__score1 > __bestScore) { __bestScore = __score1; __bestIndex = 1; }
-
- global::RetellAI.ConversationFlowComponent? conversationFlowComponent = default;
object? createConversationFlowComponentRequestVariant2 = default;
- if (__bestIndex >= 0)
+ try
{
- if (__bestIndex == 0)
- {
- try
- {
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::RetellAI.ConversationFlowComponent), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::RetellAI.ConversationFlowComponent).Name}");
- conversationFlowComponent = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
- }
- catch (global::System.Text.Json.JsonException)
- {
- }
- catch (global::System.InvalidOperationException)
- {
- }
- }
- else if (__bestIndex == 1)
- {
- try
- {
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(object), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo