docs: 为 CLI、网页编排器和插件协议补充学习向注释
在核心类型、图执行器、stdio 插件和前端入口写清职责与对照路径,不改运行行为。
This commit is contained in:
@@ -3,6 +3,10 @@ using System.Text;
|
||||
|
||||
namespace MAF1.Tools;
|
||||
|
||||
/// <summary>
|
||||
/// 给 LLM 调用的本地读文件工具。Description 属性会进工具 schema,模型据此决定何时调用。
|
||||
/// 路径解析会试当前目录、exe 目录、以及 MAF1_CONTENT_ROOT(插件进程由宿主注入)。
|
||||
/// </summary>
|
||||
public static class FileTools
|
||||
{
|
||||
[Description("Read the full UTF-8 text of a local file. Always call this before judging city names.")]
|
||||
@@ -28,6 +32,7 @@ public static class FileTools
|
||||
return File.ReadAllText(resolved, Encoding.UTF8);
|
||||
}
|
||||
|
||||
/// <summary>相对路径时依次试 cwd、exe 目录、内容根、再往上两级父目录(适配 bin/Debug/netX)。</summary>
|
||||
private static string? Resolve(string path)
|
||||
{
|
||||
if (Path.IsPathRooted(path) && File.Exists(path))
|
||||
|
||||
Reference in New Issue
Block a user