BotSharp/src/Plugins/BotSharp.Plugin.MongoStorage/Models/AgentLlmConfigMongoElement.cs

41 lines
1.2 KiB
C#
Raw Normal View History

2023-12-13 20:26:46 +00:00
using BotSharp.Abstraction.Agents.Models;
namespace BotSharp.Plugin.MongoStorage.Models;
public class AgentLlmConfigMongoElement
{
public string? Provider { get; set; }
2023-12-13 20:41:47 +00:00
public string? Model { get; set; }
2024-01-16 03:26:18 +00:00
public bool IsInherit { get; set; }
2024-02-10 15:43:33 +00:00
public int MaxRecursionDepth { get; set; }
2025-02-05 23:50:32 +00:00
public int? MaxOutputTokens { get; set; }
2023-12-13 20:26:46 +00:00
public static AgentLlmConfigMongoElement? ToMongoElement(AgentLlmConfig? config)
{
if (config == null) return null;
return new AgentLlmConfigMongoElement
{
Provider = config.Provider,
2024-01-16 03:26:18 +00:00
Model = config.Model,
IsInherit = config.IsInherit,
2024-02-10 15:43:33 +00:00
MaxRecursionDepth = config.MaxRecursionDepth,
2025-02-05 23:50:32 +00:00
MaxOutputTokens = config.MaxOutputTokens,
2023-12-13 20:26:46 +00:00
};
}
public static AgentLlmConfig? ToDomainElement(AgentLlmConfigMongoElement? config)
{
if (config == null) return null;
return new AgentLlmConfig
{
Provider = config.Provider,
2024-01-16 03:26:18 +00:00
Model = config.Model,
IsInherit = config.IsInherit,
2024-02-10 15:43:33 +00:00
MaxRecursionDepth = config.MaxRecursionDepth,
2025-02-05 23:50:32 +00:00
MaxOutputTokens = config.MaxOutputTokens,
2023-12-13 20:26:46 +00:00
};
}
}