Jido.AI.Effects (Jido AI v2.2.0)

Copy Markdown View Source

Facade for effect policy, filtering, and state/directive application.

Summary

Functions

Applies filtered effects to an agent and returns directives.

Returns the default effect policy.

Filters result effects by policy.

Intersects agent and strategy policies (strategy may only narrow).

Builds a normalized policy struct.

Normalizes result envelope to canonical triple tuple.

Resolves an effect policy from context.

Types

policy_input()

@type policy_input() :: Jido.AI.Effects.Policy.t() | map() | keyword() | nil

Functions

apply_result(agent, result, policy)

Applies filtered effects to an agent and returns directives.

default_policy()

@spec default_policy() :: Jido.AI.Effects.Policy.t()

Returns the default effect policy.

filter_result(result, policy)

Filters result effects by policy.

intersect_policies(agent_policy, strategy_policy)

@spec intersect_policies(policy_input(), policy_input()) :: Jido.AI.Effects.Policy.t()

Intersects agent and strategy policies (strategy may only narrow).

new_policy(input)

@spec new_policy(policy_input()) :: Jido.AI.Effects.Policy.t()

Builds a normalized policy struct.

normalize_result(result)

@spec normalize_result(term()) :: Jido.AI.Effects.Applier.result_tuple()

Normalizes result envelope to canonical triple tuple.

policy_from_context(context, fallback \\ nil)

@spec policy_from_context(map(), policy_input()) :: Jido.AI.Effects.Policy.t()

Resolves an effect policy from context.

Supports maps with atom or string keys.