<!--
This file was generated by Spark. Do not edit it by hand.
-->
# AshAi
Documentation for `AshAi`.
## tools
### Nested DSLs
* [tool](#tools-tool)
### tools.tool
```elixir
tool name, resource, action
```
### Arguments
| Name | Type | Default | Docs |
|------|------|---------|------|
| [`name`](#tools-tool-name){: #tools-tool-name .spark-required} | `atom` | | |
| [`resource`](#tools-tool-resource){: #tools-tool-resource .spark-required} | `module` | | |
| [`action`](#tools-tool-action){: #tools-tool-action .spark-required} | `atom` | | |
### Options
| Name | Type | Default | Docs |
|------|------|---------|------|
| [`load`](#tools-tool-load){: #tools-tool-load } | `any` | `[]` | |
| [`async`](#tools-tool-async){: #tools-tool-async } | `boolean` | `true` | |
| [`description`](#tools-tool-description){: #tools-tool-description } | `String.t` | | A description for the tool. Defaults to the action's description. |
| [`identity`](#tools-tool-identity){: #tools-tool-identity } | `atom` | | The 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
* [full_text](#vectorize-full_text)
### Options
| Name | Type | Default | Docs |
|------|------|---------|------|
| [`embedding_model`](#vectorize-embedding_model){: #vectorize-embedding_model .spark-required} | `module` | | |
| [`attributes`](#vectorize-attributes){: #vectorize-attributes } | `keyword` | `[]` | A keyword list of attributes to vectorize, and the name of the attribute to store the vector in |
| [`strategy`](#vectorize-strategy){: #vectorize-strategy } | `:after_action \| :manual \| :ash_oban \| :ash_oban_manual` | `:after_action` | How to compute the vector. Currently supported strategies are `:after_action`, `:manual`, and `:ash_oban`. |
| [`define_update_action_for_manual_strategy?`](#vectorize-define_update_action_for_manual_strategy?){: #vectorize-define_update_action_for_manual_strategy? } | `boolean` | `true` | If true, an `ash_ai_update_embeddings` update action will be defined, which will automatically update the embeddings when run. |
| [`ash_oban_trigger_name`](#vectorize-ash_oban_trigger_name){: #vectorize-ash_oban_trigger_name } | `atom` | `: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`. |
### vectorize.full_text
### Options
| Name | Type | Default | Docs |
|------|------|---------|------|
| [`text`](#vectorize-full_text-text){: #vectorize-full_text-text .spark-required} | `(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. |
| [`name`](#vectorize-full_text-name){: #vectorize-full_text-name } | `atom` | `:full_text_vector` | The name of the attribute to store the text vector in |
| [`used_attributes`](#vectorize-full_text-used_attributes){: #vectorize-full_text-used_attributes } | `list(atom)` | | If set, a vector is only regenerated when these attributes are changed |
<style type="text/css">.spark-required::after { content: "*"; color: red !important; }</style>