新增原生工具调用数据结构与解析:SimpleAIClient.cs

AITool 增加 Schema 构造器与函数定义生成,所有工具补齐 GetParametersSchema():AITool.cs 与 *.cs
This commit is contained in:
2025-12-31 15:44:57 +08:00
parent 244ba3d354
commit 1e64302d21
21 changed files with 936 additions and 4 deletions

View File

@@ -15,6 +15,15 @@ namespace WulaFallenEmpire.EventSystem.AI.Tools
"Analyze the current game screen screenshot. Provide an instruction to guide the analysis.";
public override string UsageSchema => "{\"instruction\":\"Describe the current screen\"}";
public override Dictionary<string, object> GetParametersSchema()
{
var properties = new Dictionary<string, object>
{
["instruction"] = SchemaString("Instruction for image analysis.", nullable: true),
["context"] = SchemaString("Alias for instruction.", nullable: true)
};
return SchemaObject(properties, RequiredList("instruction", "context"));
}
private const string BaseVisionSystemPrompt = "You are a seasoned RimWorld assistant. Analyze the screenshot per instruction. Keep replies concise. Do not output tool call JSON unless explicitly asked.";