Merge branch 'master' of https://github.com/SciSharp/BotSharp into features/refine-model-settings
This commit is contained in:
commit
261a01a291
|
|
@ -44,17 +44,18 @@ public partial class AgentService
|
||||||
[SharpCache(10)]
|
[SharpCache(10)]
|
||||||
public async Task<Agent> GetAgent(string id)
|
public async Task<Agent> GetAgent(string id)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrWhiteSpace(id))
|
if (string.IsNullOrWhiteSpace(id) || id == Guid.Empty.ToString())
|
||||||
{
|
{
|
||||||
return null;
|
_logger.LogWarning($"Can't find agent {id}, AgentId is empty.");
|
||||||
}
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
var profile = _db.GetAgent(id);
|
var profile = _db.GetAgent(id);
|
||||||
if (profile == null)
|
if (profile == null)
|
||||||
{
|
{
|
||||||
_logger.LogError($"Can't find agent {id}");
|
_logger.LogError($"Can't find agent {id}");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load llm config
|
// Load llm config
|
||||||
var agentSetting = _services.GetRequiredService<AgentSettings>();
|
var agentSetting = _services.GetRequiredService<AgentSettings>();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue