Skip to content

Commit a283af0

Browse files
committed
Change ConversationState to ConcurrentDictionary
1 parent b09d294 commit a283af0

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

src/Infrastructure/BotSharp.Abstraction/Conversations/Models/ConversationState.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
using System.Collections.Concurrent;
2+
13
namespace BotSharp.Abstraction.Conversations.Models;
24

3-
public class ConversationState : Dictionary<string, StateKeyValue>
5+
public class ConversationState : ConcurrentDictionary<string, StateKeyValue>
46
{
57
public ConversationState()
68
{

src/Plugins/BotSharp.Plugin.KnowledgeBase/Services/KnowledgeService.Vector.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ public async Task<IEnumerable<VectorCollectionConfig>> GetVectorCollections(stri
8080
}).ToList();
8181

8282
var vectorDb = GetVectorDb();
83+
if (vectorDb == null) return [];
8384
var dbCollections = await vectorDb.GetCollections();
8485
return configs.Where(x => dbCollections.Contains(x.Name));
8586
}

tests/BotSharp.LLM.Tests/Core/NullConversationStateService.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System.Text.Json;
1+
using System.Text.Json;
22
using BotSharp.Abstraction.Conversations;
33
using BotSharp.Abstraction.Conversations.Enums;
44
using BotSharp.Abstraction.Conversations.Models;
@@ -68,8 +68,8 @@ public void Save()
6868

6969
public ConversationState GetCurrentState()
7070
{
71-
72-
return new ConversationState { { "StateKey", new StateKeyValue { Key = "Key", Values = new List<StateValue>()} } };
71+
72+
return new ConversationState();
7373
}
7474

7575
public void SetCurrentState(ConversationState state)

tests/BotSharp.Plugin.PizzaBot/data/agents/8970b1e5-d260-4e2c-90b1-f1415a257c18/agent.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"labels": [ "experiment" ],
1414
"llmConfig": {
1515
"provider": "openai",
16-
"model": "gpt-4.1-nano"
16+
"model": "gpt-5-nano"
1717
},
1818
"routingRules": [
1919
{

0 commit comments

Comments
 (0)