AshAi.Info (ash_ai v0.2.2)

View Source

Introspection functions for the AshAi extension.

Summary

Functions

tools DSL entities

The name of the AshOban-trigger that will be run in order to update the record's embeddings. Defaults to :ash_ai_update_embeddings.

The name of the AshOban-trigger that will be run in order to update the record's embeddings. Defaults to :ash_ai_update_embeddings.

A keyword list of attributes to vectorize, and the name of the attribute to store the vector in

A keyword list of attributes to vectorize, and the name of the attribute to store the vector in

If true, an ash_ai_update_embeddings update action will be defined, which will automatically update the embeddings when run.

The name of the attribute to store the text vector in

The name of the attribute to store the text vector in

vectorize.full_text DSL options

A function or expr that takes a list of records and computes a full text string that will be vectorized. If given an expr, use atomic_ref to refer to new values, as this is set as an atomic update.

A function or expr that takes a list of records and computes a full text string that will be vectorized. If given an expr, use atomic_ref to refer to new values, as this is set as an atomic update.

If set, a vector is only regenerated when these attributes are changed

If set, a vector is only regenerated when these attributes are changed

vectorize DSL options

How to compute the vector. Currently supported strategies are :after_action, :manual, and :ash_oban.

How to compute the vector. Currently supported strategies are :after_action, :manual, and :ash_oban.

Functions

tools(dsl_or_extended)

@spec tools(dsl_or_extended :: module() | map()) :: [struct()]

tools DSL entities

vectorize_ash_oban_trigger_name(dsl_or_extended)

@spec vectorize_ash_oban_trigger_name(dsl_or_extended :: module() | map()) ::
  {:ok, atom()} | :error

The name of the AshOban-trigger that will be run in order to update the record's embeddings. Defaults to :ash_ai_update_embeddings.

vectorize_ash_oban_trigger_name!(dsl_or_extended)

@spec vectorize_ash_oban_trigger_name!(dsl_or_extended :: module() | map()) ::
  atom() | no_return()

The name of the AshOban-trigger that will be run in order to update the record's embeddings. Defaults to :ash_ai_update_embeddings.

vectorize_attributes(dsl_or_extended)

@spec vectorize_attributes(dsl_or_extended :: module() | map()) ::
  {:ok, keyword()} | :error

A keyword list of attributes to vectorize, and the name of the attribute to store the vector in

vectorize_attributes!(dsl_or_extended)

@spec vectorize_attributes!(dsl_or_extended :: module() | map()) ::
  keyword() | no_return()

A keyword list of attributes to vectorize, and the name of the attribute to store the vector in

vectorize_define_update_action_for_manual_strategy?(dsl_or_extended)

@spec vectorize_define_update_action_for_manual_strategy?(
  dsl_or_extended :: module() | map()
) ::
  boolean()

If true, an ash_ai_update_embeddings update action will be defined, which will automatically update the embeddings when run.

vectorize_full_text_name(dsl_or_extended)

@spec vectorize_full_text_name(dsl_or_extended :: module() | map()) ::
  {:ok, atom()} | :error

The name of the attribute to store the text vector in

vectorize_full_text_name!(dsl_or_extended)

@spec vectorize_full_text_name!(dsl_or_extended :: module() | map()) ::
  atom() | no_return()

The name of the attribute to store the text vector in

vectorize_full_text_options(dsl_or_extended)

@spec vectorize_full_text_options(dsl_or_extended :: module() | map()) :: %{
  required(atom()) => any()
}

vectorize.full_text DSL options

Returns a map containing the and any configured or default values.

vectorize_full_text_text(dsl_or_extended)

@spec vectorize_full_text_text(dsl_or_extended :: module() | map()) ::
  {:ok, (any() -> any())} | :error

A function or expr that takes a list of records and computes a full text string that will be vectorized. If given an expr, use atomic_ref to refer to new values, as this is set as an atomic update.

vectorize_full_text_text!(dsl_or_extended)

@spec vectorize_full_text_text!(dsl_or_extended :: module() | map()) ::
  (any() -> any()) | no_return()

A function or expr that takes a list of records and computes a full text string that will be vectorized. If given an expr, use atomic_ref to refer to new values, as this is set as an atomic update.

vectorize_full_text_used_attributes(dsl_or_extended)

@spec vectorize_full_text_used_attributes(dsl_or_extended :: module() | map()) ::
  {:ok, [atom()]} | :error

If set, a vector is only regenerated when these attributes are changed

vectorize_full_text_used_attributes!(dsl_or_extended)

@spec vectorize_full_text_used_attributes!(dsl_or_extended :: module() | map()) ::
  [atom()] | no_return()

If set, a vector is only regenerated when these attributes are changed

vectorize_options(dsl_or_extended)

@spec vectorize_options(dsl_or_extended :: module() | map()) :: %{
  required(atom()) => any()
}

vectorize DSL options

Returns a map containing the and any configured or default values.

vectorize_strategy(dsl_or_extended)

@spec vectorize_strategy(dsl_or_extended :: module() | map()) ::
  {:ok, :ash_oban_manual | :ash_oban | :manual | :after_action} | :error

How to compute the vector. Currently supported strategies are :after_action, :manual, and :ash_oban.

vectorize_strategy!(dsl_or_extended)

@spec vectorize_strategy!(dsl_or_extended :: module() | map()) ::
  (:ash_oban_manual | :ash_oban | :manual | :after_action) | no_return()

How to compute the vector. Currently supported strategies are :after_action, :manual, and :ash_oban.