Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

mofa-runtime

管理智能体生命周期和执行的运行时层。

目的

mofa-runtime 提供:

  • AgentRunner 用于执行管理
  • AgentBuilder 用于构建智能体
  • SimpleRuntime 用于多智能体协调
  • 消息总线和事件路由
  • 插件管理

关键组件

组件描述
AgentRunner带生命周期执行智能体
AgentBuilder逐步构建智能体
SimpleRuntime多智能体运行时
PluginManager管理插件

用法

#![allow(unused)]
fn main() {
use mofa_runtime::AgentRunner;
use mofa_kernel::{AgentInput, AgentContext};

let mut runner = AgentRunner::new(my_agent).await?;
let output = runner.execute(AgentInput::text("你好")).await?;
runner.shutdown().await?;
}

功能标志

标志描述
doraDora-rs 分布式运行时
monitoring内置监控

另见