Documentation for AshAi.

tools

Nested DSLs

tools.tool

tool name, resource, action

Arguments

NameTypeDefaultDocs
nameatom
resourcemodule
actionatom

Options

NameTypeDefaultDocs
loadany[]
asyncbooleantrue
descriptionString.tA description for the tool. Defaults to the action's description.
identityatomThe identity to use for update/destroy actions. Defaults to the primary key. Set to false to disable entirely.

Introspection

Target: AshAi.Tool

vectorize

Nested DSLs

Options

NameTypeDefaultDocs
embedding_modelmodule
attributeskeyword[]A keyword list of attributes to vectorize, and the name of the attribute to store the vector in
strategy:after_action | :manual | :ash_oban | :ash_oban_manual:after_actionHow to compute the vector. Currently supported strategies are :after_action, :manual, and :ash_oban.
define_update_action_for_manual_strategy?booleantrueIf true, an ash_ai_update_embeddings update action will be defined, which will automatically update the embeddings when run.
ash_oban_trigger_nameatom:ash_ai_update_embeddingsThe name of the AshOban-trigger that will be run in order to update the record's embeddings. Defaults to :ash_ai_update_embeddings.

vectorize.full_text

Options

NameTypeDefaultDocs
text(any -> any)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.
nameatom:full_text_vectorThe name of the attribute to store the text vector in
used_attributeslist(atom)If set, a vector is only regenerated when these attributes are changed