rename
This commit is contained in:
parent
281ace8658
commit
81f2b32761
|
|
@ -44,7 +44,7 @@ public partial class AgentService
|
|||
return await Task.FromResult(agentRecord);
|
||||
}
|
||||
|
||||
private (string, List<ChannelInstruction>) FetchInstructionsFromFile(string fileDir)
|
||||
private (string, List<ChannelInstruction>) GetInstructionsFromFile(string fileDir)
|
||||
{
|
||||
var defaultInstruction = string.Empty;
|
||||
var channelInstructions = new List<ChannelInstruction>();
|
||||
|
|
@ -86,7 +86,7 @@ public partial class AgentService
|
|||
return (defaultInstruction, channelInstructions);
|
||||
}
|
||||
|
||||
private List<AgentTemplate> FetchTemplatesFromFile(string fileDir)
|
||||
private List<AgentTemplate> GetTemplatesFromFile(string fileDir)
|
||||
{
|
||||
var templates = new List<AgentTemplate>();
|
||||
var templateDir = Path.Combine(fileDir, "templates");
|
||||
|
|
@ -106,7 +106,7 @@ public partial class AgentService
|
|||
return templates;
|
||||
}
|
||||
|
||||
private List<FunctionDef> FetchFunctionsFromFile(string fileDir)
|
||||
private List<FunctionDef> GetFunctionsFromFile(string fileDir)
|
||||
{
|
||||
var functions = new List<FunctionDef>();
|
||||
var functionDir = Path.Combine(fileDir, "functions");
|
||||
|
|
@ -133,7 +133,7 @@ public partial class AgentService
|
|||
return functions;
|
||||
}
|
||||
|
||||
private List<AgentResponse> FetchResponsesFromFile(string fileDir)
|
||||
private List<AgentResponse> GetResponsesFromFile(string fileDir)
|
||||
{
|
||||
var responses = new List<AgentResponse>();
|
||||
var responseDir = Path.Combine(fileDir, "responses");
|
||||
|
|
@ -151,7 +151,7 @@ public partial class AgentService
|
|||
return responses;
|
||||
}
|
||||
|
||||
private List<string> FetchSamplesFromFile(string fileDir)
|
||||
private List<string> GetSamplesFromFile(string fileDir)
|
||||
{
|
||||
var file = Path.Combine(fileDir, "samples.txt");
|
||||
if (!File.Exists(file)) return new List<string>();
|
||||
|
|
@ -160,7 +160,7 @@ public partial class AgentService
|
|||
return samples?.ToList() ?? new List<string>();
|
||||
}
|
||||
|
||||
private List<AgentTask> FetchTasksFromFile(string fileDir)
|
||||
private List<AgentTask> GetTasksFromFile(string fileDir)
|
||||
{
|
||||
var tasks = new List<AgentTask>();
|
||||
var taskDir = Path.Combine(fileDir, "tasks");
|
||||
|
|
|
|||
|
|
@ -42,11 +42,11 @@ public partial class AgentService
|
|||
continue;
|
||||
}
|
||||
|
||||
var (defaultInstruction, channelInstructions) = FetchInstructionsFromFile(dir);
|
||||
var functions = FetchFunctionsFromFile(dir);
|
||||
var responses = FetchResponsesFromFile(dir);
|
||||
var templates = FetchTemplatesFromFile(dir);
|
||||
var samples = FetchSamplesFromFile(dir);
|
||||
var (defaultInstruction, channelInstructions) = GetInstructionsFromFile(dir);
|
||||
var functions = GetFunctionsFromFile(dir);
|
||||
var responses = GetResponsesFromFile(dir);
|
||||
var templates = GetTemplatesFromFile(dir);
|
||||
var samples = GetSamplesFromFile(dir);
|
||||
agent.SetInstruction(defaultInstruction)
|
||||
.SetChannelInstructions(channelInstructions)
|
||||
.SetTemplates(templates)
|
||||
|
|
@ -55,7 +55,7 @@ public partial class AgentService
|
|||
.SetSamples(samples);
|
||||
|
||||
var userAgent = BuildUserAgent(agent.Id, user.Id);
|
||||
var tasks = FetchTasksFromFile(dir);
|
||||
var tasks = GetTasksFromFile(dir);
|
||||
|
||||
var isAgentDeleted = _db.DeleteAgent(agent.Id);
|
||||
if (isAgentDeleted)
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ public partial class AgentService
|
|||
agentSettings.DataDir);
|
||||
|
||||
var clonedAgent = Agent.Clone(agent);
|
||||
var foundAgent = FetchAgentFileById(agent.Id, filePath);
|
||||
var foundAgent = GetAgentFileById(agent.Id, filePath);
|
||||
if (foundAgent == null)
|
||||
{
|
||||
updateResult = $"Cannot find agent {agent.Name} in file directory: {filePath}";
|
||||
|
|
@ -166,7 +166,7 @@ public partial class AgentService
|
|||
return patchResult;
|
||||
}
|
||||
|
||||
private Agent? FetchAgentFileById(string agentId, string filePath)
|
||||
private Agent? GetAgentFileById(string agentId, string filePath)
|
||||
{
|
||||
if (!Directory.Exists(filePath)) return null;
|
||||
|
||||
|
|
@ -176,11 +176,11 @@ public partial class AgentService
|
|||
var agent = JsonSerializer.Deserialize<Agent>(agentJson, _options);
|
||||
if (agent != null && agent.Id == agentId)
|
||||
{
|
||||
var (defaultInstruction, channelInstructions) = FetchInstructionsFromFile(dir);
|
||||
var functions = FetchFunctionsFromFile(dir);
|
||||
var responses = FetchResponsesFromFile(dir);
|
||||
var templates = FetchTemplatesFromFile(dir);
|
||||
var samples = FetchSamplesFromFile(dir);
|
||||
var (defaultInstruction, channelInstructions) = GetInstructionsFromFile(dir);
|
||||
var functions = GetFunctionsFromFile(dir);
|
||||
var responses = GetResponsesFromFile(dir);
|
||||
var templates = GetTemplatesFromFile(dir);
|
||||
var samples = GetSamplesFromFile(dir);
|
||||
return agent.SetInstruction(defaultInstruction)
|
||||
.SetChannelInstructions(channelInstructions)
|
||||
.SetTemplates(templates)
|
||||
|
|
|
|||
Loading…
Reference in a new issue