Skip to main content

Crate funera

Crate funera 

Source
Expand description

§funera

High-level LLM agent framework for Rust. Build AI agents with tools, skills, middleware, and pluggable LLM backends — all with multi-layered security.

§Quick Start

use funera::{Agent, AgentRuntime, DeepSeekProvider};

let runtime = AgentRuntime::<DeepSeekProvider>::builder()
    .api_key(std::env::var("DEEPSEEK_API_KEY")?)
    .model("deepseek-v4-flash")
    .build()?;

let agent = Agent::builder()
    .system_prompt("You are a helpful assistant.")
    .build();

let resp = agent.fire("Hello!", &runtime).await?;
println!("{}", resp.content);

§Security Configuration

Enable the security feature to restrict tool execution:

use funera::{AgentRuntime, DeepSeekProvider, ToolPolicy, ShellPolicy};

let runtime = AgentRuntime::<DeepSeekProvider>::builder()
    .api_key(std::env::var("DEEPSEEK_API_KEY")?)
    .model("deepseek-v4-flash")
    .with_tool_policy(ToolPolicy::strict())
    .build()?;

See the examples/tool_policy.rs example for a comprehensive walk-through of all policy configuration options.

§Accessing the core layer

Lower-level APIs from funera_core are available under core:

use funera::core::re_act::tool::Tool;
use funera::core::security::policy::ToolPolicy;
use funera::core::middleware::MiddlewareChain;

Re-exports§

pub use funera_core as core;

Modules§

agent
Re-export of the public orchestration API.
dispatcher
Re-export of the public orchestration API.
error
Re-export of the public orchestration API.
event
Re-export of the public orchestration API.
response
Re-export of the public orchestration API.
runtime
Re-export of the public orchestration API.
send_handle
Re-export of the public orchestration API.

Structs§

Acquired
Re-export of the public orchestration API.
Agent
Re-export of the public orchestration API.
AgentBuilder
Re-export of the public orchestration API.
AgentRuntime
Re-export of the public orchestration API.
AgentRuntimeBuilder
Re-export of the public orchestration API.
CallbackRegistry
Re-export of the public orchestration API.
ChatResponse
Re-export of the public orchestration API.
DeepSeekProvider
Re-export of the public orchestration API.
FireStreamHandle
Re-export of the public orchestration API.
Idle
Re-export of the public orchestration API.
SendHandle
Re-export of the public orchestration API.
SendStreamHandle
Re-export of the public orchestration API.
ToolCallErrorInfo
Re-export of the public orchestration API.
ToolCallInfo
Re-export of the public orchestration API.
ToolCallRequest
Re-export of the public orchestration API.
ToolCallResponse
Re-export of the public orchestration API.

Enums§

AgentEvent
Re-export of the public orchestration API.
EnvStateEvent
Re-export of the public orchestration API.
OrchestrateError
Re-export of the public orchestration API.
RawAgentEvent
Re-export of the public orchestration API.
ReactEvent
Re-export of the public orchestration API.
TokenEvent
Re-export of the public orchestration API.