add ai programmer and file assistant
This commit is contained in:
parent
4e0801780b
commit
605109bcca
|
|
@ -51,4 +51,14 @@ public static class BuiltInAgentId
|
|||
/// Translates user-defined natural language rules into programmatic code
|
||||
/// </summary>
|
||||
public const string RulesInterpreter = "201e49a2-40b3-4ccd-b8cc-2476565a1b40";
|
||||
|
||||
/// <summary>
|
||||
/// Generate code script
|
||||
/// </summary>
|
||||
public const string AIProgrammer = "c2a2faf6-b8b5-47fe-807b-f4714cf25dd4";
|
||||
|
||||
/// <summary>
|
||||
/// Handle files
|
||||
/// </summary>
|
||||
public const string FileAssistant = "f1e09a73-9efe-46ce-ba02-b3aaf96d97e0";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Remove="data\agents\6745151e-6d46-4a02-8de4-1c4f21c7da95\functions\util-crontab-task_wait.json" />
|
||||
<None Remove="data\agents\6745151e-6d46-4a02-8de4-1c4f21c7da95\functions\util-crontab-schedule_task.json" />
|
||||
<None Remove="data\agents\6745151e-6d46-4a02-8de4-1c4f21c7da95\templates\util-crontab-schedule_task.fn.liquid" />
|
||||
</ItemGroup>
|
||||
|
|
|
|||
|
|
@ -96,13 +96,16 @@
|
|||
<None Remove="data\agents\dfd9b46d-d00c-40af-8a75-3fbdc2b89869\templates\instruction.simulator.liquid" />
|
||||
<None Remove="data\agents\dfd9b46d-d00c-40af-8a75-3fbdc2b89869\templates\instruction.simulator.liquid" />
|
||||
<None Remove="data\plugins\config.json" />
|
||||
|
||||
<None Remove="data\agents\6745151e-6d46-4a02-8de4-1c4f21c7da95\templates\util-file-select_file_instruction.liquid" />
|
||||
<None Remove="data\agents\01e2fc5c-2c89-4ec7-8470-7688608b496c\functions\get_weather.json" />
|
||||
<None Remove="data\agents\01e2fc5c-2c89-4ec7-8470-7688608b496c\functions\get_fun_events.json" />
|
||||
|
||||
<None Remove="data\agents\6745151e-6d46-4a02-8de4-1c4f21c7da95\functions\util-web-intelligent_search.json" />
|
||||
<None Remove="data\agents\6745151e-6d46-4a02-8de4-1c4f21c7da95\templates\util-web-intelligent_search.fn.liquid" />
|
||||
|
||||
<None Remove="data\agents\c2a2faf6-b8b5-47fe-807b-f4714cf25dd4\agent.json" />
|
||||
<None Remove="data\agents\c2a2faf6-b8b5-47fe-807b-f4714cf25dd4\instructions\instruction.liquid" />
|
||||
<None Remove="data\agents\f1e09a73-9efe-46ce-ba02-b3aaf96d97e0\agent.json" />
|
||||
<None Remove="data\agents\f1e09a73-9efe-46ce-ba02-b3aaf96d97e0\instructions\instruction.liquid" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
@ -172,6 +175,9 @@
|
|||
<Content Include="data\agents\6745151e-6d46-4a02-8de4-1c4f21c7da95\templates\util-routing-fallback_to_router.fn.liquid">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="data\agents\c2a2faf6-b8b5-47fe-807b-f4714cf25dd4\instructions\instruction.liquid">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="data\agents\dfd9b46d-d00c-40af-8a75-3fbdc2b89869\agent.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
|
|
@ -193,9 +199,6 @@
|
|||
<Content Include="data\agents\6745151e-6d46-4a02-8de4-1c4f21c7da95\instructions\instruction.liquid">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="data\agents\6745151e-6d46-4a02-8de4-1c4f21c7da95\templates\util-file-select_file_instruction.liquid">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="data\agents\dfd9b46d-d00c-40af-8a75-3fbdc2b89869\templates\instruction.simulator.liquid">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
|
|
@ -208,6 +211,18 @@
|
|||
<Content Include="data\agents\6745151e-6d46-4a02-8de4-1c4f21c7da95\functions\util-instruct-execute_template.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="data\agents\c2a2faf6-b8b5-47fe-807b-f4714cf25dd4\agent.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="data\agents\c2a2faf6-b8b5-47fe-807b-f4714cf25dd4\instructions\instruction.liquid">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="data\agents\f1e09a73-9efe-46ce-ba02-b3aaf96d97e0\agent.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="data\agents\f1e09a73-9efe-46ce-ba02-b3aaf96d97e0\instructions\instruction.liquid">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="data\plugins\config.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
|
|
|
|||
|
|
@ -114,8 +114,8 @@ public partial class FileInstructService
|
|||
return new NameDesc(text, desc);
|
||||
}).ToList();
|
||||
|
||||
var agentId = !string.IsNullOrWhiteSpace(options.AgentId) ? options.AgentId : BuiltInAgentId.UtilityAssistant;
|
||||
var template = !string.IsNullOrWhiteSpace(options.Template) ? options.Template : "util-file-select_file_instruction";
|
||||
var agentId = !string.IsNullOrWhiteSpace(options.AgentId) ? options.AgentId : BuiltInAgentId.FileAssistant;
|
||||
var template = !string.IsNullOrWhiteSpace(options.Template) ? options.Template : "select_chat_file_instruction";
|
||||
var prompt = db.GetAgentTemplate(agentId, template);
|
||||
|
||||
var data = new Dictionary<string, object>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
"id": "c2a2faf6-b8b5-47fe-807b-f4714cf25dd4",
|
||||
"name": "AI programmer",
|
||||
"description": "AI programmer is designed to generate code scripts.",
|
||||
"type": "task",
|
||||
"createdDateTime": "2025-10-07T10:39:32Z",
|
||||
"updatedDateTime": "2025-10-07T14:39:32Z",
|
||||
"iconUrl": "/images/logo.png",
|
||||
"disabled": false,
|
||||
"isPublic": true,
|
||||
"llmConfig": {
|
||||
"is_inherit": false,
|
||||
"provider": "openai",
|
||||
"model": "gpt-5",
|
||||
"max_recursion_depth": 3,
|
||||
"reasoning_effort_level": "minimal"
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
You are a AI programmer to help coding.
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
"id": "f1e09a73-9efe-46ce-ba02-b3aaf96d97e0",
|
||||
"name": "File Assistant",
|
||||
"description": "File Assistant is designed to handle files.",
|
||||
"type": "task",
|
||||
"createdDateTime": "2025-10-07T10:39:32Z",
|
||||
"updatedDateTime": "2025-10-07T14:39:32Z",
|
||||
"iconUrl": "/images/logo.png",
|
||||
"disabled": false,
|
||||
"isPublic": true,
|
||||
"llmConfig": {
|
||||
"is_inherit": false,
|
||||
"provider": "openai",
|
||||
"model": "gpt-5-mini",
|
||||
"max_recursion_depth": 3,
|
||||
"reasoning_effort_level": "minimal"
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
You are a File Assistant to help handle files.
|
||||
|
|
@ -13,7 +13,7 @@
|
|||
<ItemGroup>
|
||||
<None Remove="data\agents\6745151e-6d46-4a02-8de4-1c4f21c7da95\functions\util-chart-plot_chart.json" />
|
||||
<None Remove="data\agents\6745151e-6d46-4a02-8de4-1c4f21c7da95\templates\util-chart-plot_chart.fn.liquid" />
|
||||
<None Remove="data\agents\6745151e-6d46-4a02-8de4-1c4f21c7da95\templates\util-chart-plot_instruction.liquid" />
|
||||
<None Remove="data\agents\c2a2faf6-b8b5-47fe-807b-f4714cf25dd4\templates\chart-js-generate_instruction.liquid" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
@ -23,7 +23,7 @@
|
|||
<Content Include="data\agents\6745151e-6d46-4a02-8de4-1c4f21c7da95\templates\util-chart-plot_chart.fn.liquid">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="data\agents\6745151e-6d46-4a02-8de4-1c4f21c7da95\templates\util-chart-plot_instruction.liquid">
|
||||
<Content Include="data\agents\c2a2faf6-b8b5-47fe-807b-f4714cf25dd4\templates\chart-js-generate_instruction.liquid">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
|
|
|
|||
|
|
@ -123,8 +123,8 @@ public class PlotChartFn : IFunctionCallback
|
|||
}
|
||||
else
|
||||
{
|
||||
templateName = "util-chart-plot_instruction";
|
||||
templateContent = db.GetAgentTemplate(BuiltInAgentId.UtilityAssistant, templateName);
|
||||
templateName = "chart-js-generate_instruction";
|
||||
templateContent = db.GetAgentTemplate(BuiltInAgentId.AIProgrammer, templateName);
|
||||
}
|
||||
|
||||
return templateContent;
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
<None Remove="data\agents\6745151e-6d46-4a02-8de4-1c4f21c7da95\templates\util-file-read_pdf.fn.liquid" />
|
||||
<None Remove="data\agents\6745151e-6d46-4a02-8de4-1c4f21c7da95\functions\util-file-edit_image.json" />
|
||||
<None Remove="data\agents\6745151e-6d46-4a02-8de4-1c4f21c7da95\templates\util-file-edit_image.fn.liquid" />
|
||||
<None Remove="data\agents\f1e09a73-9efe-46ce-ba02-b3aaf96d97e0\templates\select-chat-file_instruction.liquid" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
@ -46,6 +47,9 @@
|
|||
<Content Include="data\agents\6745151e-6d46-4a02-8de4-1c4f21c7da95\templates\util-file-edit_image.fn.liquid">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="data\agents\f1e09a73-9efe-46ce-ba02-b3aaf96d97e0\templates\select-chat-file_instruction.liquid">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
|||
|
|
@ -11,7 +11,9 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Remove="data\agents\6745151e-6d46-4a02-8de4-1c4f21c7da95\templates\util-code-python_generate_instruction.liquid" />
|
||||
<None Remove="data\agents\6745151e-6d46-4a02-8de4-1c4f21c7da95\functions\util-code-python_programmer.json" />
|
||||
<None Remove="data\agents\6745151e-6d46-4a02-8de4-1c4f21c7da95\templates\util-code-python_programmer.fn.liquid" />
|
||||
<None Remove="data\agents\c2a2faf6-b8b5-47fe-807b-f4714cf25dd4\templates\py-code_generate_instruction.liquid" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
@ -21,7 +23,7 @@
|
|||
<Content Include="data\agents\6745151e-6d46-4a02-8de4-1c4f21c7da95\templates\util-code-python_programmer.fn.liquid">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="data\agents\6745151e-6d46-4a02-8de4-1c4f21c7da95\templates\util-code-python_generate_instruction.liquid">
|
||||
<Content Include="data\agents\c2a2faf6-b8b5-47fe-807b-f4714cf25dd4\templates\py-code_generate_instruction.liquid">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
|
|
|
|||
|
|
@ -177,8 +177,8 @@ public class PyProgrammerFn : IFunctionCallback
|
|||
}
|
||||
else
|
||||
{
|
||||
templateName = "util-code-python_generate_instruction";
|
||||
templateContent = db.GetAgentTemplate(BuiltInAgentId.UtilityAssistant, templateName);
|
||||
templateName = "py-code_generate_instruction";
|
||||
templateContent = db.GetAgentTemplate(BuiltInAgentId.AIProgrammer, templateName);
|
||||
}
|
||||
|
||||
return templateContent;
|
||||
|
|
|
|||
Loading…
Reference in a new issue