BotSharp/src/Infrastructure/BotSharp.Abstraction/VectorStorage/Models/VectorSearchOptions.cs

27 lines
824 B
C#
Raw Normal View History

using BotSharp.Abstraction.Knowledges.Enums;
2024-08-15 23:19:10 +00:00
namespace BotSharp.Abstraction.VectorStorage.Models;
2023-06-18 18:15:00 +00:00
2024-08-15 23:19:10 +00:00
public class VectorSearchOptions
2023-06-18 18:15:00 +00:00
{
2025-08-05 20:46:07 +00:00
public IEnumerable<string>? Fields { get; set; } = [KnowledgePayloadName.Text, KnowledgePayloadName.Answer];
public IEnumerable<KeyValue>? Filters { get; set; }
2025-08-06 21:36:36 +00:00
public string FilterOperator { get; set; } = "or";
public int? Limit { get; set; } = 5;
public float? Confidence { get; set; } = 0.5f;
public bool WithVector { get; set; }
2025-08-05 20:46:07 +00:00
public static VectorSearchOptions Default()
{
return new()
{
Fields = [KnowledgePayloadName.Text, KnowledgePayloadName.Answer],
Filters = null,
2025-08-06 21:36:36 +00:00
FilterOperator = "or",
2025-08-05 20:46:07 +00:00
Limit = 5,
Confidence = 0.5f,
WithVector = false
};
}
2023-06-18 18:15:00 +00:00
}