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; }
|
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,
|
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,
|
2023-12-13 20:26:46 +00:00
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|