d7f0c45164
新增业务中立的 function-calling harness 与公共提示词协议 统一画布 Agent 工具路由约束和待确认控制语义 保留失败前输出并事务化收口 memory、deadline 与取消状态 迁移画布 Agent 和 API 编排并同步架构文档与项目记忆
19 lines
634 B
Rust
19 lines
634 B
Rust
use crate::agent::{Agent, LlmApiAdaptor};
|
|
use crate::hook::Hook;
|
|
use crate::memory::AgentMemory;
|
|
use crate::tool::Tool;
|
|
|
|
pub trait AgentBuilder<Message, M: LlmApiAdaptor<Message>> {
|
|
type Client;
|
|
|
|
fn new() -> Self;
|
|
fn with_client(self, client: Self::Client) -> Self;
|
|
fn system_prompt(self, system_prompt: impl Into<String>) -> Self;
|
|
fn tool(self, tool: impl Tool + Send + Sync + 'static) -> Self;
|
|
fn add_hook(self, hook: impl Hook + 'static) -> Self;
|
|
fn max_turns(self, n: usize) -> Self;
|
|
fn memory(self, memory: impl AgentMemory<Message> + 'static) -> Self;
|
|
|
|
fn build(self) -> Agent<M, Message>;
|
|
}
|