Skip to main content

Module codegen

Module codegen 

Source
Expand description

Rust code generation from project schemas - Always uses adk-graph

This module provides code generation for ADK Studio projects, converting visual workflow definitions into compilable Rust code using adk-graph.

§ADK 0.5.0 Features

  • Action nodes use adk-graph’s ActionNodeExecutor with feature-gated deps
  • WorkflowSchema::build_graph() for action-node-only workflows
  • adk-action shared types for cross-crate compatibility
  • Provider auto-detection with provider_from_env() support
  • Structured error envelope (AdkError) with retry hints

§Features

  • Workflow validation before code generation (Requirements 12.4, 12.5)
  • Explanatory comments in generated code (Requirement 12.2)
  • Environment variable warnings (Requirement 12.10)
  • Support for all agent types: LLM, Sequential, Loop, Parallel, Router
  • Action node code generation (Requirements 13.1, 13.2, 13.3)

Re-exports§

pub use action_node_codegen as action_nodes;

Modules§

action_node_codegen
Action Node Code Generation
action_node_types
Action Node Type Definitions

Structs§

EnvVarRequirement
Environment variable requirement
EnvVarWarning
Warning about a missing environment variable
GeneratedFile
GeneratedProject
ValidationError
Validation error with specific details
ValidationResult
Result of workflow validation

Enums§

ValidationErrorCode
Error codes for validation errors

Functions§

check_env_vars
Check for missing required environment variables
generate_rust_project
Generate a Rust project from a project schema
generate_rust_project_with_validation
Generate a Rust project with validation result
get_required_env_vars
Get a list of required environment variables for a project
validate_project
Validate a project schema before code generation