Merge pull request #1065 from yileicn/master

optimize CheckArgType
This commit is contained in:
Haiping 2025-05-27 13:28:40 -05:00 committed by GitHub
commit 53bf0fee19
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -419,12 +419,10 @@ public class ConversationStateService : IConversationStateService
if (AgentService.AgentParameterTypes.IsNullOrEmpty())
return true;
var agentTypes = AgentService.AgentParameterTypes
.Where(p => p.Value != null)
.SelectMany(p => p.Value)
.ToList();
if (!AgentService.AgentParameterTypes.TryGetValue(_routingContext.GetCurrentAgentId(), out var agentTypes))
return true;
if (agentTypes == null || agentTypes.Count == 0)
if (agentTypes.IsNullOrEmpty())
return true;
var found = agentTypes.FirstOrDefault(t => t.Key == name);