image.domain\agent_kit\agent_kit.mbt
100% · 10 / 10 points · 41 linesBackground color reports the state of each line. Underlined characters mark exact instrumented byte offsets; hover them to inspect the visit count.
- 1
///| - 2
/// # Agent 工具包 Agent Kit - 3
/// - 4
/// 智能体集成工具包 - 5
/// 描述 Agent integration toolkit - 6
// Agent-Kit 高层 API — 自然语言图像处理 - 7
// nl_process: "给这张图去噪并检测边缘" → 引擎原生算子执行 - 8
- 9
///| - 10
pub fn nl_process( - 11
image : @types.Image, - 12
query : String, - 13
) -> @types.Image raise @types.LoadError { - 14●
let pipeline = nl_to_pipeline(query) - 15●
let result = @imgir.ir_execute(pipeline, @imgir.IRValue::VImage(image)) - 16●
result.as_image() - 17
} - 18
- 19
///| - 20
pub fn nl_process_value( - 21
value : @imgir.IRValue, - 22
query : String, - 23
) -> @imgir.IRValue raise @types.LoadError { - 24●
let pipeline = nl_to_pipeline(query) - 25●
@imgir.ir_execute(pipeline, value) - 26
} - 27
- 28
///| - 29
pub fn nl_preview(query : String) -> String { - 30●
nl_to_description(query) - 31
} - 32
- 33
///| - 34
pub fn nl_intents(query : String) -> Array[Intent] { - 35●
nl_parse(query) - 36
} - 37
- 38
///| - 39
pub fn nl_pipeline(query : String) -> @imgir.IRPipeline { - 40●
nl_to_pipeline(query) - 41
}