|
| 1 | +========= |
| 2 | +AI fields |
| 3 | +========= |
| 4 | + |
| 5 | +.. |AI| replace:: :abbr:`AI (Artificial Intelligence)` |
| 6 | + |
| 7 | +|AI| fields allow users to utilize Odoo's built-in AI capabilities directly in forms and records. |
| 8 | +When an |AI| field is configured, the system can generate or suggest values automatically based on |
| 9 | +the record's context, existing data, or external information. |
| 10 | + |
| 11 | +This feature is especially useful for creating product descriptions, summarizing notes, or |
| 12 | +generating structured content from unstructured data. |
| 13 | + |
| 14 | +.. _ai/add-a-new-field: |
| 15 | + |
| 16 | +Adding a new AI field |
| 17 | +===================== |
| 18 | + |
| 19 | +|AI| fields can be added to a record through the Studio app or property field. |
| 20 | + |
| 21 | +.. warning:: |
| 22 | + :ref:`Installing Studio <general/install>` may impact the current pricing plan for a database. |
| 23 | + For more information, refer to `Odoo's pricing page <https://www.odoo.com/pricing-plan>`_ or |
| 24 | + contact your account manager. |
| 25 | + |
| 26 | +First, navigate to the page in the database where a new field is needed. Then, click on the |
| 27 | +:icon:`oi-studio` :guilabel:`studio` icon to open the app. On the left sidebar, click and drag the |
| 28 | +:guilabel:`AI Field` option and place it in the desired location on the record. |
| 29 | + |
| 30 | +.. image:: fields/new-ai-field.png |
| 31 | + :alt: Adding a new field to a record. |
| 32 | + |
| 33 | +After the field is placed, an :guilabel:`Add an AI Field` pop-up opens. Use the :guilabel:`Field |
| 34 | +Type` drop-down menu to select a :doc:`field type <../../studio/fields>`: |
| 35 | + |
| 36 | + - Text |
| 37 | + - Multiline Text |
| 38 | + - HTML |
| 39 | + - Integer |
| 40 | + - Decimal |
| 41 | + - Monetary |
| 42 | + - Date |
| 43 | + - Datetime |
| 44 | + - Checkbox |
| 45 | + - Many2one |
| 46 | + - Tags |
| 47 | + |
| 48 | +Next is the :guilabel:`Prompt` field. In Odoo, :ref:`prompts <ai/agents/prompts-in-odoo>` define the |
| 49 | +instructions that guide the |AI| when generating or improving the content of the |AI| field. The |
| 50 | +prompt tells the system what kind of information to produce, how to format it, and what tone or |
| 51 | +style to use. |
| 52 | + |
| 53 | +When creating a prompt, use the `/field` command to reference specific fields in the database. For |
| 54 | +example, to reference the :guilabel:`Company` field on a record, enter `/field`, and click the |
| 55 | +:guilabel:`Field Selector` option. Type `Company` in the search bar, and select :guilabel:`Company` |
| 56 | +from the list. |
| 57 | + |
| 58 | +.. image:: fields/prompt.png |
| 59 | + :alt: The add a field pop-up where the ai prompt is entered. |
| 60 | + |
| 61 | +Once the prompt is complete, click :guilabel:`Add Field`. Before closing **Studio**, click on the |
| 62 | +left sidebar and update the :guilabel:`Label` field with a title for the new |AI| field. Then click |
| 63 | +:guilabel:`Close` to exit **Studio**. |
| 64 | + |
| 65 | +After the field is added, click the |AI| icon to refresh the field value. |
| 66 | + |
| 67 | +.. tip:: |
| 68 | + If the |AI| is unable to complete the request, a warning message is generated. This could mean |
| 69 | + that the prompt is asking for information that is not available, in the given context, or that |
| 70 | + the prompt is providing unclear instructions. Use this as an indication to revisit the prompt and |
| 71 | + add additional context or instructions. |
| 72 | + |
| 73 | + .. image:: fields/warning.png |
| 74 | + :alt: A warning message indicating the AI was unable to complete the request. |
| 75 | + |
| 76 | +Add via edit properties |
| 77 | +----------------------- |
| 78 | + |
| 79 | +|AI| fields can also be added as property fields without opening the **Studio** app. Click on the |
| 80 | +:icon:`fa-cog` :guilabel:`Actions` icon and select :icon:`fa-cogs` :guilabel:`Edit Properties`. Tick |
| 81 | +the :guilabel:`AI` checkbox, confirm the field should be |AI|-enabled, then follow the steps |
| 82 | +:ref:`above <ai/add-a-new-field>` to define the field type and enter the prompt. |
| 83 | + |
| 84 | +.. image:: fields/edit-properties.png |
| 85 | + :alt: The edit properties pop-up on a form view. |
| 86 | + |
| 87 | +.. note:: |
| 88 | + :ref:`Property fields <property_field/add>` can only be added to form views. |
| 89 | + |
| 90 | +Computing AI fields |
| 91 | +=================== |
| 92 | + |
| 93 | +To compute, or refresh, an |AI| field, click on the |AI| icon next to the field. Clicking the button |
| 94 | +updates the field based on the prompt. |
| 95 | + |
| 96 | +Additionally, a scheduled action runs once a day to compute all |AI| fields. This action is active |
| 97 | +by default. |
| 98 | + |
| 99 | +.. tip:: |
| 100 | + To run the scheduled action manually, navigate to :menuselection:`Settings app --> Technical --> |
| 101 | + Automation --> Scheduled Actions`. Click on :guilabel:`AI Fields\:\ Compute AI fields` to open |
| 102 | + it, then click :guilabel:`Run Manually`. |
0 commit comments