From 3bb50a63500799deb8fd762ab65dcc1711efe7af Mon Sep 17 00:00:00 2001 From: Jicheng Lu <103353@smsassist.com> Date: Wed, 28 May 2025 18:00:11 -0500 Subject: [PATCH] nullable --- .../Agents/Models/AgentUtility.cs | 36 ++----------------- .../Models/AgentUtilityMongoElement.cs | 2 +- .../Functions/OutboundPhoneCallFn.cs | 1 - 3 files changed, 4 insertions(+), 35 deletions(-) diff --git a/src/Infrastructure/BotSharp.Abstraction/Agents/Models/AgentUtility.cs b/src/Infrastructure/BotSharp.Abstraction/Agents/Models/AgentUtility.cs index 8fc44d7c..6233dfa7 100644 --- a/src/Infrastructure/BotSharp.Abstraction/Agents/Models/AgentUtility.cs +++ b/src/Infrastructure/BotSharp.Abstraction/Agents/Models/AgentUtility.cs @@ -26,7 +26,8 @@ public class AgentUtility public class UtilityItem { [JsonPropertyName("function_name")] - public string FunctionName { get; set; } = string.Empty; + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public string? FunctionName { get; set; } [JsonPropertyName("template_name")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] @@ -35,35 +36,4 @@ public class UtilityItem [JsonPropertyName("visibility_expression")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public string? VisibilityExpression { get; set; } -} - -//public class UtilityFunction : UtilityBase -//{ -// public UtilityFunction() -// { - -// } - -// public UtilityFunction(string name) -// { -// Name = name; -// } -//} - -//public class UtilityTemplate : UtilityBase -//{ -// public UtilityTemplate() -// { - -// } - -// public UtilityTemplate(string name) -// { -// Name = name; -// } -//} - -//public class UtilityBase -//{ -// public string Name { get; set; } -//} \ No newline at end of file +} \ No newline at end of file diff --git a/src/Plugins/BotSharp.Plugin.MongoStorage/Models/AgentUtilityMongoElement.cs b/src/Plugins/BotSharp.Plugin.MongoStorage/Models/AgentUtilityMongoElement.cs index d7ab6d2a..be052a1e 100644 --- a/src/Plugins/BotSharp.Plugin.MongoStorage/Models/AgentUtilityMongoElement.cs +++ b/src/Plugins/BotSharp.Plugin.MongoStorage/Models/AgentUtilityMongoElement.cs @@ -48,7 +48,7 @@ public class AgentUtilityMongoElement public class AgentUtilityItemMongoElement { - public string FunctionName { get; set; } = string.Empty; + public string? FunctionName { get; set; } public string? TemplateName { get; set; } public string? VisibilityExpression { get; set; } } \ No newline at end of file diff --git a/src/Plugins/BotSharp.Plugin.Twilio/OutboundPhoneCallHandler/Functions/OutboundPhoneCallFn.cs b/src/Plugins/BotSharp.Plugin.Twilio/OutboundPhoneCallHandler/Functions/OutboundPhoneCallFn.cs index 88586ea8..5ffd692e 100644 --- a/src/Plugins/BotSharp.Plugin.Twilio/OutboundPhoneCallHandler/Functions/OutboundPhoneCallFn.cs +++ b/src/Plugins/BotSharp.Plugin.Twilio/OutboundPhoneCallHandler/Functions/OutboundPhoneCallFn.cs @@ -1,5 +1,4 @@ using BotSharp.Abstraction.Files; -using BotSharp.Abstraction.Files.Models; using BotSharp.Abstraction.Infrastructures.Enums; using BotSharp.Abstraction.Options; using BotSharp.Abstraction.Routing;