adk_agent/
lib.rs

1//! # adk-agent
2//!
3//! Agent implementations for ADK (LLM, Custom, Workflow agents).
4//!
5//! ## Overview
6//!
7//! This crate provides ready-to-use agent implementations:
8//!
9//! - [`LlmAgent`] - Core agent powered by LLM reasoning
10//! - [`CustomAgent`] - Define custom logic without LLM
11//! - [`SequentialAgent`] - Execute agents in sequence
12//! - [`ParallelAgent`] - Execute agents concurrently
13//! - [`LoopAgent`] - Iterate until exit condition
14//! - [`ConditionalAgent`] - Branch based on conditions
15//!
16//! ## Quick Start
17//!
18//! ```rust,no_run
19//! use adk_agent::LlmAgentBuilder;
20//! use std::sync::Arc;
21//!
22//! // LLM Agent requires a model (from adk-model)
23//! // let agent = LlmAgentBuilder::new("assistant")
24//! //     .description("Helpful AI assistant")
25//! //     .model(Arc::new(model))
26//! //     .build()?;
27//! ```
28//!
29//! ## Workflow Agents
30//!
31//! Combine agents for complex workflows:
32//!
33//! ```rust,ignore
34//! // Sequential: A -> B -> C
35//! let seq = SequentialAgent::new("pipeline", vec![a, b, c]);
36//!
37//! // Parallel: A, B, C simultaneously
38//! let par = ParallelAgent::new("team", vec![a, b, c]);
39//!
40//! // Loop: repeat until exit
41//! let loop_agent = LoopAgent::new("iterator", worker, 10);
42//! ```
43//!
44//! ## Guardrails (optional)
45//!
46//! Enable the `guardrails` feature for input/output validation:
47//!
48//! ```rust,ignore
49//! use adk_agent::{LlmAgentBuilder, guardrails::{GuardrailSet, ContentFilter, PiiRedactor}};
50//!
51//! let input_guardrails = GuardrailSet::new()
52//!     .add(ContentFilter::harmful_content())
53//!     .add(PiiRedactor::new());
54//!
55//! let agent = LlmAgentBuilder::new("assistant")
56//!     .input_guardrails(input_guardrails)
57//!     .build()?;
58//! ```
59
60mod custom_agent;
61pub mod guardrails;
62mod llm_agent;
63pub mod tool_call_markup;
64mod workflow;
65
66pub use adk_core::Agent;
67pub use custom_agent::{CustomAgent, CustomAgentBuilder};
68pub use guardrails::GuardrailSet;
69pub use llm_agent::{LlmAgent, LlmAgentBuilder};
70pub use tool_call_markup::{normalize_content, normalize_option_content};
71pub use workflow::{ConditionalAgent, LoopAgent, ParallelAgent, SequentialAgent};