Module visualization

Module visualization 

Source
Expand description

Workflow Visualization Export

This module provides functionality to export workflows to various diagram formats for visualization and documentation purposes.

Supported formats:

  • Mermaid: Popular markdown-based diagramming (flowchart syntax)
  • Graphviz DOT: Industry standard graph visualization language
  • PlantUML: UML and diagram generation tool

§Example

use oxify_model::{Workflow, WorkflowBuilder, LlmConfig, visualization::WorkflowVisualizer};

let llm_config = LlmConfig {
    provider: "openai".to_string(),
    model: "gpt-4".to_string(),
    system_prompt: None,
    prompt_template: "{{input}}".to_string(),
    temperature: Some(0.7),
    max_tokens: Some(100),
    tools: vec![],
    images: vec![],
    extra_params: serde_json::json!({}),
};

let workflow = WorkflowBuilder::new("example")
    .description("Example workflow")
    .start("Start")
    .llm("Generate text", llm_config)
    .end("End")
    .build();

let visualizer = WorkflowVisualizer::new(&workflow);
let mermaid = visualizer.to_mermaid();
println!("{}", mermaid);

Structs§

VisualizationStyle
Visual styling options for workflow diagrams
WorkflowVisualizer
Workflow visualizer for generating diagrams

Enums§

DiagramOrientation
Diagram layout orientation
VisualizationFormat
Visualization format options

Functions§

workflow_to_graphviz
Helper function to generate Graphviz DOT from workflow
workflow_to_mermaid
Helper function to generate Mermaid diagram from workflow
workflow_to_plantuml
Helper function to generate PlantUML from workflow