Base未来技能来源(Source)

Java-friendly base for implementing a SkillSource: every engine method is a suspend returning a Result, and this base final-overrides each to await a CompletableFuture from the Java subclass, mapping a completed future to Result.success and any failure to a Result.failure of SkillSourceException. Return each future promptly and do any blocking work inside it. Complete the future exceptionally with a SkillSourceException to report a skill error whose message reaches the LLM.

构造函数(Constructors)

Link copied to clipboard
constructor()

函数

Link copied to clipboard
suspend override fun listFrontmatters(): Result<List<Frontmatter>>

返回所有可用技能的前置内容(即技能介绍或相关说明)。

Link copied to clipboard
suspend override fun listResources(skillName: String, resourceDirectoryPath: String): Result<List<String>>

返回指定技能所在目录内的一系列资源路径。

Link copied to clipboard
suspend override fun loadFrontmatter(skillName: String): Result<Frontmatter>

根据名称加载某个特定技能的前置内容(即该技能的简介或介绍信息)。

Link copied to clipboard
suspend override fun loadInstructions(skillName: String): Result<String>

根据名称加载特定技能的指令内容。

Link copied to clipboard
suspend override fun loadResource(skillName: String, resourcePath: String): Result<ByteArray>

为指定的技能加载特定的资源文件。