Change ConversationState to ConcurrentDictionary

This commit is contained in:
Haiping Chen 2025-09-18 19:20:58 -05:00
parent b09d294fcd
commit a283af0623
4 changed files with 8 additions and 5 deletions

View file

@ -1,6 +1,8 @@
using System.Collections.Concurrent;
namespace BotSharp.Abstraction.Conversations.Models;
public class ConversationState : Dictionary<string, StateKeyValue>
public class ConversationState : ConcurrentDictionary<string, StateKeyValue>
{
public ConversationState()
{

View file

@ -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));
}

View file

@ -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<StateValue>()} } };
return new ConversationState();
}
public void SetCurrentState(ConversationState state)

View file

@ -13,7 +13,7 @@
"labels": [ "experiment" ],
"llmConfig": {
"provider": "openai",
"model": "gpt-4.1-nano"
"model": "gpt-5-nano"
},
"routingRules": [
{