diff --git a/src/Infrastructure/BotSharp.Abstraction/Conversations/Models/ConversationState.cs b/src/Infrastructure/BotSharp.Abstraction/Conversations/Models/ConversationState.cs index b56187b5..8382cdf2 100644 --- a/src/Infrastructure/BotSharp.Abstraction/Conversations/Models/ConversationState.cs +++ b/src/Infrastructure/BotSharp.Abstraction/Conversations/Models/ConversationState.cs @@ -1,6 +1,8 @@ +using System.Collections.Concurrent; + namespace BotSharp.Abstraction.Conversations.Models; -public class ConversationState : Dictionary +public class ConversationState : ConcurrentDictionary { public ConversationState() { diff --git a/src/Plugins/BotSharp.Plugin.KnowledgeBase/Services/KnowledgeService.Vector.cs b/src/Plugins/BotSharp.Plugin.KnowledgeBase/Services/KnowledgeService.Vector.cs index 498e8c99..908fdc23 100644 --- a/src/Plugins/BotSharp.Plugin.KnowledgeBase/Services/KnowledgeService.Vector.cs +++ b/src/Plugins/BotSharp.Plugin.KnowledgeBase/Services/KnowledgeService.Vector.cs @@ -80,6 +80,7 @@ public partial class KnowledgeService }).ToList(); var vectorDb = GetVectorDb(); + if (vectorDb == null) return []; var dbCollections = await vectorDb.GetCollections(); return configs.Where(x => dbCollections.Contains(x.Name)); } diff --git a/tests/BotSharp.LLM.Tests/Core/NullConversationStateService.cs b/tests/BotSharp.LLM.Tests/Core/NullConversationStateService.cs index befc6c06..bed47b24 100644 --- a/tests/BotSharp.LLM.Tests/Core/NullConversationStateService.cs +++ b/tests/BotSharp.LLM.Tests/Core/NullConversationStateService.cs @@ -1,4 +1,4 @@ -using System.Text.Json; +using System.Text.Json; using BotSharp.Abstraction.Conversations; using BotSharp.Abstraction.Conversations.Enums; using BotSharp.Abstraction.Conversations.Models; @@ -68,8 +68,8 @@ namespace BotSharp.Plugin.Google.Core public ConversationState GetCurrentState() { - - return new ConversationState { { "StateKey", new StateKeyValue { Key = "Key", Values = new List()} } }; + + return new ConversationState(); } public void SetCurrentState(ConversationState state) diff --git a/tests/BotSharp.Plugin.PizzaBot/data/agents/8970b1e5-d260-4e2c-90b1-f1415a257c18/agent.json b/tests/BotSharp.Plugin.PizzaBot/data/agents/8970b1e5-d260-4e2c-90b1-f1415a257c18/agent.json index 99f1f2fd..3826234e 100644 --- a/tests/BotSharp.Plugin.PizzaBot/data/agents/8970b1e5-d260-4e2c-90b1-f1415a257c18/agent.json +++ b/tests/BotSharp.Plugin.PizzaBot/data/agents/8970b1e5-d260-4e2c-90b1-f1415a257c18/agent.json @@ -13,7 +13,7 @@ "labels": [ "experiment" ], "llmConfig": { "provider": "openai", - "model": "gpt-4.1-nano" + "model": "gpt-5-nano" }, "routingRules": [ {