View Source Jido (Jido v1.0.0-rc.1)
Jido is a flexible framework for building distributed AI Agents and Workflows in Elixir. It enables intelligent automation in Elixir, with a focus on Actions, Workflows, Bots, Agents, Sensors, and Signals for creating dynamic and adaptive systems.
This module provides the main interface for interacting with Jido components, including:
- Listing and retrieving Actions, Sensors, and Domains
- Filtering and paginating results
- Generating unique slugs for components
Examples
iex> Jido.list_actions()
[%{module: MyApp.SomeAction, name: "some_action", description: "Does something", slug: "abc123de"}]
iex> Jido.get_action_by_slug("abc123de")
%{module: MyApp.SomeAction, name: "some_action", description: "Does something", slug: "abc123de"}
Summary
Functions
Retrieves an Action by its slug.
Retrieves an Agent by its slug.
Retrieves a Sensor by its slug.
Lists all Actions with optional filtering and pagination.
Lists all Agents with optional filtering and pagination.
Lists all Sensors with optional filtering and pagination.
Types
Functions
@spec get_action_by_slug(String.t()) :: component_metadata() | nil
Retrieves an Action by its slug.
Parameters
slug
: A string representing the unique identifier of the Action.
Returns
The Action metadata if found, otherwise nil
.
Examples
iex> Jido.get_action_by_slug("abc123de")
%{module: MyApp.SomeAction, name: "some_action", description: "Does something", slug: "abc123de"}
iex> Jido.get_action_by_slug("nonexistent")
nil
@spec get_agent_by_slug(String.t()) :: component_metadata() | nil
Retrieves an Agent by its slug.
Parameters
slug
: A string representing the unique identifier of the Agent.
Returns
The Agent metadata if found, otherwise nil
.
Examples
iex> Jido.get_agent_by_slug("ghi789jk")
%{module: MyApp.SomeAgent, name: "some_agent", description: "Represents an agent", slug: "ghi789jk"}
iex> Jido.get_agent_by_slug("nonexistent")
nil
@spec get_sensor_by_slug(String.t()) :: component_metadata() | nil
Retrieves a Sensor by its slug.
Parameters
slug
: A string representing the unique identifier of the Sensor.
Returns
The Sensor metadata if found, otherwise nil
.
Examples
iex> Jido.get_sensor_by_slug("def456gh")
%{module: MyApp.SomeSensor, name: "some_sensor", description: "Monitors something", slug: "def456gh"}
iex> Jido.get_sensor_by_slug("nonexistent")
nil
@spec list_actions(keyword()) :: [component_metadata()]
Lists all Actions with optional filtering and pagination.
Parameters
opts
: A keyword list of options for filtering and pagination. Available options::limit
: Maximum number of results to return.:offset
: Number of results to skip before starting to return.:name
: Filter Actions by name (partial match).:description
: Filter Actions by description (partial match).:category
: Filter Actions by category (exact match).:tag
: Filter Actions by tag (must have the exact tag).
Returns
A list of Action metadata.
Examples
iex> Jido.list_actions(limit: 10, offset: 5, category: :utility)
[%{module: MyApp.SomeAction, name: "some_action", description: "Does something", slug: "abc123de", category: :utility}]
@spec list_agents(keyword()) :: [component_metadata()]
Lists all Agents with optional filtering and pagination.
Parameters
opts
: A keyword list of options for filtering and pagination. Available options::limit
: Maximum number of results to return.:offset
: Number of results to skip before starting to return.:name
: Filter Agents by name (partial match).:description
: Filter Agents by description (partial match).:category
: Filter Agents by category (exact match).:tag
: Filter Agents by tag (must have the exact tag).
Returns
A list of Agent metadata.
Examples
iex> Jido.list_agents(limit: 10, offset: 5, category: :business)
[%{module: MyApp.SomeAgent, name: "some_agent", description: "Represents an agent", slug: "ghi789jk", category: :business}]
@spec list_sensors(keyword()) :: [component_metadata()]
Lists all Sensors with optional filtering and pagination.
Parameters
opts
: A keyword list of options for filtering and pagination. Available options::limit
: Maximum number of results to return.:offset
: Number of results to skip before starting to return.:name
: Filter Sensors by name (partial match).:description
: Filter Sensors by description (partial match).:category
: Filter Sensors by category (exact match).:tag
: Filter Sensors by tag (must have the exact tag).
Returns
A list of Sensor metadata.
Examples
iex> Jido.list_sensors(limit: 10, offset: 5, category: :monitoring)
[%{module: MyApp.SomeSensor, name: "some_sensor", description: "Monitors something", slug: "def456gh", category: :monitoring}]