AgentForge.Config (AgentForge v0.2.2)

View Source

Provides configuration parsing for declarative workflows. Supports loading workflows from YAML or JSON.

Summary

Functions

Loads a workflow from a YAML or JSON file. Returns a flow function that can be executed.

Loads a workflow from a YAML or JSON string. Returns a flow function that can be executed.

Functions

load_from_file(file_path)

Loads a workflow from a YAML or JSON file. Returns a flow function that can be executed.

Examples

iex> flow = AgentForge.Config.load_from_file("test/fixtures/simple_workflow.yaml")
iex> is_function(flow, 1)
true

load_from_string(content)

Loads a workflow from a YAML or JSON string. Returns a flow function that can be executed.

Examples

iex> config = """
...> flow:
...>   - type: transform
...>     fn: upcase
...>   - type: branch
...>     condition: "String.length(data) > 5"
...>     then:
...>       - type: tool
...>         name: notify
...>     else:
...>       - type: tool
...>         name: log
...> """
iex> flow = AgentForge.Config.load_from_string(config)
iex> is_function(flow, 1)
true