Merge branch 'SciSharp:master' into master
This commit is contained in:
commit
fc146d2225
|
|
@ -9,7 +9,11 @@ public static class VectorStorageExtension
|
|||
{
|
||||
if (data?.Data == null) return string.Empty;
|
||||
|
||||
return $"Question: {data.Data[KnowledgePayloadName.Text]}\r\nAnswer: {data.Data[KnowledgePayloadName.Answer]}";
|
||||
if (data.Data.TryGetValue(KnowledgePayloadName.Text, out var question)) { }
|
||||
|
||||
if (data.Data.TryGetValue(KnowledgePayloadName.Answer, out var answer)) { }
|
||||
|
||||
return $"Question: {question}\r\nAnswer: {answer}";
|
||||
}
|
||||
|
||||
public static string ToPayloadPair(this VectorSearchResult data, IList<string> payloads)
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ public partial class AgentService : IAgentService
|
|||
public string GetAgentDataDir(string agentId)
|
||||
{
|
||||
var dbSettings = _services.GetRequiredService<BotSharpDatabaseSettings>();
|
||||
var dir = Path.Combine(dbSettings.FileRepository, _agentSettings.DataDir, agentId);
|
||||
var dir = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, dbSettings.FileRepository, _agentSettings.DataDir, agentId);
|
||||
if (!Directory.Exists(dir))
|
||||
{
|
||||
Directory.CreateDirectory(dir);
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ public class RouteToAgentRoutingHandler : RoutingHandlerBase, IRoutingHandler
|
|||
if (message.FunctionName != null)
|
||||
{
|
||||
var msg = RoleDialogModel.From(message, role: AgentRole.Function);
|
||||
var ret = await routing.InvokeFunction(message.FunctionName, msg);
|
||||
await routing.InvokeFunction(message.FunctionName, msg);
|
||||
}
|
||||
|
||||
var agentId = routing.Context.GetCurrentAgentId();
|
||||
|
|
@ -83,9 +83,7 @@ public class RouteToAgentRoutingHandler : RoutingHandlerBase, IRoutingHandler
|
|||
{
|
||||
var content = $"This agent ({agent.Name}) is disabled, please install the corresponding plugin ({agent.Plugin.Name}) to activate this agent.";
|
||||
|
||||
message = RoleDialogModel.From(message,
|
||||
role: AgentRole.Assistant,
|
||||
content: content);
|
||||
message = RoleDialogModel.From(message, role: AgentRole.Assistant, content: content);
|
||||
_dialogs.Add(message);
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -8,4 +8,5 @@ Global Knowledge:
|
|||
{% for k in global_knowledges %}
|
||||
{{ k }}
|
||||
{% endfor %}
|
||||
=====
|
||||
{%- endif %}
|
||||
Loading…
Reference in a new issue