docs: 为 CLI、网页编排器和插件协议补充学习向注释

在核心类型、图执行器、stdio 插件和前端入口写清职责与对照路径,不改运行行为。
This commit is contained in:
2026-08-28 11:51:48 +08:00
parent a3cca78592
commit 950d09ddb0
38 changed files with 206 additions and 3 deletions
+5
View File
@@ -5,8 +5,12 @@ using Microsoft.Extensions.AI;
namespace MAF1.Agents.Weather;
/// <summary>
/// 「按城市查天气」Agent。真正的 HTTP 查询在 WeatherTools.GetWeather,模型只负责决定调几次工具并写成中文摘要。
/// </summary>
public static class WeatherAgent
{
/// <summary>创建带 GetWeather 工具的 Agent。instructions 要求每个城市都调工具,禁止编造气温。</summary>
public static AIAgent Create(AgentFactory factory, WeatherTools weatherTools)
{
return factory.CreateAgent(
@@ -19,6 +23,7 @@ public static class WeatherAgent
tools: [AIFunctionFactory.Create(weatherTools.GetWeather)]);
}
/// <summary>需要上游把 cities 连到本节点。空列表直接抛错,避免无意义地打 LLM。</summary>
public static async Task<AgentStepResult> RunAsync(
AIAgent agent,
IReadOnlyDictionary<string, object?> inputs,