Change ConversationState to ConcurrentDictionary
This commit is contained in:
parent
b09d294fcd
commit
a283af0623
|
|
@ -1,6 +1,8 @@
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
|
||||||
namespace BotSharp.Abstraction.Conversations.Models;
|
namespace BotSharp.Abstraction.Conversations.Models;
|
||||||
|
|
||||||
public class ConversationState : Dictionary<string, StateKeyValue>
|
public class ConversationState : ConcurrentDictionary<string, StateKeyValue>
|
||||||
{
|
{
|
||||||
public ConversationState()
|
public ConversationState()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -80,6 +80,7 @@ public partial class KnowledgeService
|
||||||
}).ToList();
|
}).ToList();
|
||||||
|
|
||||||
var vectorDb = GetVectorDb();
|
var vectorDb = GetVectorDb();
|
||||||
|
if (vectorDb == null) return [];
|
||||||
var dbCollections = await vectorDb.GetCollections();
|
var dbCollections = await vectorDb.GetCollections();
|
||||||
return configs.Where(x => dbCollections.Contains(x.Name));
|
return configs.Where(x => dbCollections.Contains(x.Name));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
using BotSharp.Abstraction.Conversations;
|
using BotSharp.Abstraction.Conversations;
|
||||||
using BotSharp.Abstraction.Conversations.Enums;
|
using BotSharp.Abstraction.Conversations.Enums;
|
||||||
using BotSharp.Abstraction.Conversations.Models;
|
using BotSharp.Abstraction.Conversations.Models;
|
||||||
|
|
@ -68,8 +68,8 @@ namespace BotSharp.Plugin.Google.Core
|
||||||
|
|
||||||
public ConversationState GetCurrentState()
|
public ConversationState GetCurrentState()
|
||||||
{
|
{
|
||||||
|
|
||||||
return new ConversationState { { "StateKey", new StateKeyValue { Key = "Key", Values = new List<StateValue>()} } };
|
return new ConversationState();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetCurrentState(ConversationState state)
|
public void SetCurrentState(ConversationState state)
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@
|
||||||
"labels": [ "experiment" ],
|
"labels": [ "experiment" ],
|
||||||
"llmConfig": {
|
"llmConfig": {
|
||||||
"provider": "openai",
|
"provider": "openai",
|
||||||
"model": "gpt-4.1-nano"
|
"model": "gpt-5-nano"
|
||||||
},
|
},
|
||||||
"routingRules": [
|
"routingRules": [
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue