Crate actflow_agent_sdk

Crate actflow_agent_sdk 

Source
Expand description

§Actflow Agent SDK

A Rust SDK for building agents for Actflow workflow engine.

§Quick Start

use actflow_agent_sdk::{Agent, AgentServer, Context, Inputs, LogSender};
use actflow_agent_sdk::{AgentOutput, NodeExecutionStatus};

struct MyAgent;

impl Agent for MyAgent {
    async fn run(
        &self,
        nid: String,
        ctx: Context,
        inputs: Inputs,
        log: LogSender,
    ) -> AgentOutput {
        log.send("Starting agent...").await;
        // Your agent logic here
        AgentOutput::success(serde_json::json!({"result": "done"}))
    }
}

#[tokio::main]
async fn main() {
    AgentServer::new(MyAgent)
        .serve("0.0.0.0:50051")
        .await
        .unwrap();
}

Modules§

pb

Structs§

AgentOutput
Agent output result.
AgentServer
Agent gRPC server.
Context
Execution context for agent.
LogSender
A sender for streaming log messages during agent execution.

Enums§

ExecutionStatus
Agent execution status.

Traits§

Agent
Trait for implementing an Actflow agent.

Type Aliases§

Inputs
Agent inputs as JSON value.