push
This commit is contained in:
487
dn_ai/data/ir_actions_server_data.xml
Normal file
487
dn_ai/data/ir_actions_server_data.xml
Normal file
@@ -0,0 +1,487 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<!--
|
||||
Every tool is a `code` server action exposing an ai.tool method.
|
||||
The JSON schema drives argument validation and is what the model sees.
|
||||
-->
|
||||
|
||||
<!-- ================= read: models & schema ================= -->
|
||||
<record id="ir_actions_server_get_models" model="ir.actions.server">
|
||||
<field name="name">AI Tool: Get Models</field>
|
||||
<field name="model_id" ref="model_ai_tool"/>
|
||||
<field name="state">code</field>
|
||||
<field name="use_in_ai" eval="True"/>
|
||||
<field name="ai_tool_name">get_models</field>
|
||||
<field name="ai_tool_thinking_text">Looking up available models</field>
|
||||
<field name="ai_tool_description">List every database model the current user is allowed to read. Call this first when you do not know the technical name of a model.</field>
|
||||
<field name="ai_tool_schema">{
|
||||
"type": "object",
|
||||
"properties": {},
|
||||
"required": []
|
||||
}</field>
|
||||
<field name="code">ai["result"] = record._ai_tool_get_models()</field>
|
||||
</record>
|
||||
|
||||
<record id="ir_actions_server_get_fields" model="ir.actions.server">
|
||||
<field name="name">AI Tool: Get Fields</field>
|
||||
<field name="model_id" ref="model_ai_tool"/>
|
||||
<field name="state">code</field>
|
||||
<field name="use_in_ai" eval="True"/>
|
||||
<field name="ai_tool_name">get_fields</field>
|
||||
<field name="ai_tool_thinking_text">Inspecting the fields of the model</field>
|
||||
<field name="ai_tool_description">Return the technical fields of a model: name, type, label, relations, selection values. Always call this before searching, grouping or writing on a model you have not inspected yet.</field>
|
||||
<field name="ai_tool_schema">{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"model_name": {"type": "string", "description": "Technical model name, e.g. res.partner"},
|
||||
"include_description": {"type": "boolean", "description": "Include the help text of each field"}
|
||||
},
|
||||
"required": ["model_name"]
|
||||
}</field>
|
||||
<field name="code">ai["result"] = record._ai_tool_get_fields(model_name, include_description)</field>
|
||||
</record>
|
||||
|
||||
<!-- ================= menus ================= -->
|
||||
<record id="ir_actions_server_get_menus" model="ir.actions.server">
|
||||
<field name="name">AI Tool: Get Menus</field>
|
||||
<field name="model_id" ref="model_ai_tool"/>
|
||||
<field name="state">code</field>
|
||||
<field name="use_in_ai" eval="True"/>
|
||||
<field name="ai_tool_name">get_menus</field>
|
||||
<field name="ai_tool_thinking_text">Reading the menu tree</field>
|
||||
<field name="ai_tool_description">List the menus the current user can open, with their action, model and available view types. Use it to navigate the user to the right screen.</field>
|
||||
<field name="ai_tool_schema">{
|
||||
"type": "object",
|
||||
"properties": {},
|
||||
"required": []
|
||||
}</field>
|
||||
<field name="code">ai["result"] = record._ai_tool_get_menus()</field>
|
||||
</record>
|
||||
|
||||
<record id="ir_actions_server_get_menu_details" model="ir.actions.server">
|
||||
<field name="name">AI Tool: Get Menu Details</field>
|
||||
<field name="model_id" ref="model_ai_tool"/>
|
||||
<field name="state">code</field>
|
||||
<field name="use_in_ai" eval="True"/>
|
||||
<field name="ai_tool_name">get_menu_details</field>
|
||||
<field name="ai_tool_thinking_text">Inspecting the selected menus</field>
|
||||
<field name="ai_tool_description">Return the action, model and fields behind one or more menus.</field>
|
||||
<field name="ai_tool_schema">{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"menu_ids": {"type": "array", "items": {"type": "integer"}, "description": "Menu ids returned by get_menus"},
|
||||
"include_model_fields": {"type": "boolean", "description": "Also list the fields of the target model"}
|
||||
},
|
||||
"required": ["menu_ids"]
|
||||
}</field>
|
||||
<field name="code">ai["result"] = record._ai_tool_get_menu_details(menu_ids, include_model_fields)</field>
|
||||
</record>
|
||||
|
||||
<!-- ================= data ================= -->
|
||||
<record id="ir_actions_server_search" model="ir.actions.server">
|
||||
<field name="name">AI Tool: Search</field>
|
||||
<field name="model_id" ref="model_ai_tool"/>
|
||||
<field name="state">code</field>
|
||||
<field name="use_in_ai" eval="True"/>
|
||||
<field name="ai_tool_name">search</field>
|
||||
<field name="ai_tool_thinking_text">Searching records</field>
|
||||
<field name="ai_tool_description">Search and read records of a model. Provide an Odoo domain as JSON (e.g. [["name","ilike","Acme"]]) and the exact field names to read.</field>
|
||||
<field name="ai_tool_schema">{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"model_name": {"type": "string"},
|
||||
"domain": {"type": "string", "description": "Odoo domain as a JSON string. Use [] for all records."},
|
||||
"fields": {"type": "array", "items": {"type": "string"}, "description": "Field names to read"},
|
||||
"offset": {"type": "integer"},
|
||||
"limit": {"type": "integer", "description": "Max 200, default 40"},
|
||||
"order": {"type": "string", "description": "e.g. create_date desc"}
|
||||
},
|
||||
"required": ["model_name", "fields"]
|
||||
}</field>
|
||||
<field name="code">ai["result"] = record._ai_tool_search(model_name, domain, fields, offset, limit, order)</field>
|
||||
</record>
|
||||
|
||||
<record id="ir_actions_server_read_group" model="ir.actions.server">
|
||||
<field name="name">AI Tool: Read Group</field>
|
||||
<field name="model_id" ref="model_ai_tool"/>
|
||||
<field name="state">code</field>
|
||||
<field name="use_in_ai" eval="True"/>
|
||||
<field name="ai_tool_name">read_group</field>
|
||||
<field name="ai_tool_thinking_text">Aggregating records</field>
|
||||
<field name="ai_tool_description">Group records and compute aggregates. Use it for counts, sums and averages instead of reading every record.</field>
|
||||
<field name="ai_tool_schema">{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"model_name": {"type": "string"},
|
||||
"domain": {"type": "string", "description": "Odoo domain as JSON"},
|
||||
"groupby": {"type": "array", "items": {"type": "string"}, "description": "e.g. [\"partner_id\", \"create_date:month\"]"},
|
||||
"aggregates": {"type": "array", "items": {"type": "string"}, "description": "e.g. [\"__count\", \"amount_total:sum\"]"}
|
||||
},
|
||||
"required": ["model_name", "domain", "groupby"]
|
||||
}</field>
|
||||
<field name="code">ai["result"] = record._ai_tool_read_group(model_name, domain, groupby, aggregates)</field>
|
||||
</record>
|
||||
|
||||
<record id="ir_actions_server_compute_date" model="ir.actions.server">
|
||||
<field name="name">AI Tool: Compute Date</field>
|
||||
<field name="model_id" ref="model_ai_tool"/>
|
||||
<field name="state">code</field>
|
||||
<field name="use_in_ai" eval="True"/>
|
||||
<field name="ai_tool_name">compute_date</field>
|
||||
<field name="ai_tool_thinking_text">Computing the date</field>
|
||||
<field name="ai_tool_description">Turn a relative expression ("next Monday", "start of last quarter") into an absolute date or datetime in the user's timezone. Use it whenever a domain filters on a date, because "today" on the server is UTC.</field>
|
||||
<field name="ai_tool_schema">{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"model_name": {"type": "string", "description": "Model owning the date field"},
|
||||
"field_name": {"type": "string", "description": "Date or datetime field name"},
|
||||
"operations": {
|
||||
"type": "array",
|
||||
"description": "Ordered operations. navigate moves by a period, find_next/find_previous jump to a weekday (0=Monday).",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {"type": "string", "enum": ["navigate", "find_next", "find_previous"]},
|
||||
"period": {"type": "string", "enum": ["minute", "hour", "day", "week", "month", "quarter", "year"]},
|
||||
"offset": {"type": "integer", "description": "-100 to 100"},
|
||||
"boundary": {"type": "string", "enum": ["start", "end"]},
|
||||
"weekday": {"type": "integer", "description": "0=Monday … 6=Sunday"}
|
||||
}
|
||||
}
|
||||
},
|
||||
"pin": {
|
||||
"type": "object",
|
||||
"description": "Final anchoring: day (1-31 or {weekday, occurrence}) and time (HH:MM)",
|
||||
"properties": {
|
||||
"day": {},
|
||||
"time": {"type": "string"}
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": ["model_name", "field_name"]
|
||||
}</field>
|
||||
<field name="code">ai["result"] = record._ai_tool_compute_date(model_name, field_name, operations, pin)</field>
|
||||
</record>
|
||||
|
||||
<!-- ================= navigation ================= -->
|
||||
<record id="ir_actions_server_open_menu_list" model="ir.actions.server">
|
||||
<field name="name">AI Tool: Open Menu List</field>
|
||||
<field name="model_id" ref="model_ai_tool"/>
|
||||
<field name="state">code</field>
|
||||
<field name="use_in_ai" eval="True"/>
|
||||
<field name="ai_tool_name">open_menu_list</field>
|
||||
<field name="ai_tool_thinking_text">Opening the list view</field>
|
||||
<field name="ai_tool_description">Open the list view of a menu in the user's browser, optionally filtered by a domain.</field>
|
||||
<field name="ai_tool_schema">{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"menu_id": {"type": "integer"},
|
||||
"model_name": {"type": "string"},
|
||||
"custom_domain": {"type": "string", "description": "Extra domain as JSON"},
|
||||
"selected_filters": {"type": "array", "items": {"type": "string"}, "description": "Search filter xml ids to activate"},
|
||||
"selected_groupbys": {"type": "array", "items": {"type": "string"}, "description": "Group by fields"},
|
||||
"search": {"type": "string", "description": "Free text search term"}
|
||||
},
|
||||
"required": ["menu_id", "model_name"]
|
||||
}</field>
|
||||
<field name="code">ai["result"] = record._ai_tool_open_menu_list(menu_id, model_name, selected_filters, selected_groupbys, search, custom_domain)</field>
|
||||
</record>
|
||||
|
||||
<record id="ir_actions_server_open_menu_kanban" model="ir.actions.server">
|
||||
<field name="name">AI Tool: Open Menu Kanban</field>
|
||||
<field name="model_id" ref="model_ai_tool"/>
|
||||
<field name="state">code</field>
|
||||
<field name="use_in_ai" eval="True"/>
|
||||
<field name="ai_tool_name">open_menu_kanban</field>
|
||||
<field name="ai_tool_thinking_text">Opening the kanban view</field>
|
||||
<field name="ai_tool_description">Open the kanban view of a menu in the user's browser.</field>
|
||||
<field name="ai_tool_schema">{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"menu_id": {"type": "integer"},
|
||||
"model_name": {"type": "string"},
|
||||
"custom_domain": {"type": "string"},
|
||||
"selected_filters": {"type": "array", "items": {"type": "string"}},
|
||||
"selected_groupbys": {"type": "array", "items": {"type": "string"}},
|
||||
"search": {"type": "string"}
|
||||
},
|
||||
"required": ["menu_id", "model_name"]
|
||||
}</field>
|
||||
<field name="code">ai["result"] = record._ai_tool_open_menu_kanban(menu_id, model_name, selected_filters, selected_groupbys, search, custom_domain)</field>
|
||||
</record>
|
||||
|
||||
<record id="ir_actions_server_open_menu_pivot" model="ir.actions.server">
|
||||
<field name="name">AI Tool: Open Menu Pivot</field>
|
||||
<field name="model_id" ref="model_ai_tool"/>
|
||||
<field name="state">code</field>
|
||||
<field name="use_in_ai" eval="True"/>
|
||||
<field name="ai_tool_name">open_menu_pivot</field>
|
||||
<field name="ai_tool_thinking_text">Building the pivot view</field>
|
||||
<field name="ai_tool_description">Open a pivot view for a menu with the given rows, columns and measures.</field>
|
||||
<field name="ai_tool_schema">{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"menu_id": {"type": "integer"},
|
||||
"model_name": {"type": "string"},
|
||||
"row_groupbys": {"type": "array", "items": {"type": "string"}},
|
||||
"col_groupbys": {"type": "array", "items": {"type": "string"}},
|
||||
"measures": {"type": "array", "items": {"type": "string"}},
|
||||
"selected_filters": {"type": "array", "items": {"type": "string"}},
|
||||
"selected_groupbys": {"type": "array", "items": {"type": "string"}},
|
||||
"search": {"type": "string"},
|
||||
"custom_domain": {"type": "string"}
|
||||
},
|
||||
"required": ["menu_id", "model_name"]
|
||||
}</field>
|
||||
<field name="code">ai["result"] = record._ai_tool_open_menu_pivot(menu_id, model_name, selected_filters, selected_groupbys, row_groupbys, col_groupbys, measures, search, custom_domain)</field>
|
||||
</record>
|
||||
|
||||
<record id="ir_actions_server_open_menu_graph" model="ir.actions.server">
|
||||
<field name="name">AI Tool: Open Menu Graph</field>
|
||||
<field name="model_id" ref="model_ai_tool"/>
|
||||
<field name="state">code</field>
|
||||
<field name="use_in_ai" eval="True"/>
|
||||
<field name="ai_tool_name">open_menu_graph</field>
|
||||
<field name="ai_tool_thinking_text">Drawing the chart</field>
|
||||
<field name="ai_tool_description">Open a graph view for a menu. Choose the chart type, the group by and the measures.</field>
|
||||
<field name="ai_tool_schema">{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"menu_id": {"type": "integer"},
|
||||
"model_name": {"type": "string"},
|
||||
"row_groupbys": {"type": "array", "items": {"type": "string"}},
|
||||
"measures": {"type": "array", "items": {"type": "string"}},
|
||||
"chart_type": {"type": "string", "enum": ["bar", "line", "pie"]},
|
||||
"selected_filters": {"type": "array", "items": {"type": "string"}},
|
||||
"selected_groupbys": {"type": "array", "items": {"type": "string"}},
|
||||
"search": {"type": "string"},
|
||||
"custom_domain": {"type": "string"}
|
||||
},
|
||||
"required": ["menu_id", "model_name"]
|
||||
}</field>
|
||||
<field name="code">ai["result"] = record._ai_tool_open_menu_graph(menu_id, model_name, selected_filters, selected_groupbys, row_groupbys, measures, chart_type, search, custom_domain)</field>
|
||||
</record>
|
||||
|
||||
<record id="ir_actions_server_adjust_search" model="ir.actions.server">
|
||||
<field name="name">AI Tool: Adjust Search</field>
|
||||
<field name="model_id" ref="model_ai_tool"/>
|
||||
<field name="state">code</field>
|
||||
<field name="use_in_ai" eval="True"/>
|
||||
<field name="ai_tool_name">adjust_search</field>
|
||||
<field name="ai_tool_thinking_text">Refining the current view</field>
|
||||
<field name="ai_tool_description">Modify the view the user is currently looking at: add or remove filters, change group by, switch view type.</field>
|
||||
<field name="ai_tool_schema">{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"model_name": {"type": "string"},
|
||||
"remove_facets": {"type": "array", "items": {"type": "integer"}, "description": "Search item group ids to deactivate"},
|
||||
"toggle_filters": {"type": "array", "items": {"type": "string"}, "description": "Filter names or xml ids to toggle"},
|
||||
"toggle_groupbys": {"type": "array", "items": {"type": "string"}, "description": "Group by field names to toggle"},
|
||||
"apply_searches": {
|
||||
"type": "array",
|
||||
"description": "Simulates typing into the search bar, e.g. [{\"search_field\": \"name\", \"value\": \"SO001\"}]",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"search_field": {"type": "string"},
|
||||
"value": {"type": "string"}
|
||||
},
|
||||
"required": ["search_field", "value"]
|
||||
}
|
||||
},
|
||||
"measures": {"type": "array", "items": {"type": "string"}},
|
||||
"mode": {"type": "string", "enum": ["reset", "add", "remove"], "description": "Pivot/graph display mode"},
|
||||
"order": {"type": "string", "enum": ["ASC", "DESC"]},
|
||||
"stacked": {"type": "boolean", "description": "Graph only: stack the bars"},
|
||||
"cumulated": {"type": "boolean", "description": "Graph only, line mode: cumulative values"},
|
||||
"custom_domain": {"type": "string", "description": "Extra domain as JSON"},
|
||||
"switch_view_type": {"type": "string", "enum": ["list", "kanban", "pivot", "graph"]}
|
||||
},
|
||||
"required": ["model_name"]
|
||||
}</field>
|
||||
<field name="code">ai["result"] = record._ai_tool_adjust_search(model_name, remove_facets, toggle_filters, toggle_groupbys, apply_searches, measures, mode, order, stacked, cumulated, custom_domain, switch_view_type)</field>
|
||||
</record>
|
||||
|
||||
<record id="ir_actions_server_compute_report_measures" model="ir.actions.server">
|
||||
<field name="name">AI Tool: Compute Report Measures</field>
|
||||
<field name="model_id" ref="model_ai_tool"/>
|
||||
<field name="state">code</field>
|
||||
<field name="use_in_ai" eval="True"/>
|
||||
<field name="ai_tool_name">compute_report_measures</field>
|
||||
<field name="ai_tool_thinking_text">Listing the available measures</field>
|
||||
<field name="ai_tool_description">List the numeric fields that can be used as measures in a pivot or graph view.</field>
|
||||
<field name="ai_tool_schema">{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"action_id": {"type": "integer"},
|
||||
"model": {"type": "string"}
|
||||
},
|
||||
"required": ["model"]
|
||||
}</field>
|
||||
<field name="code">ai["result"] = record._ai_tool_compute_report_measures(action_id, model)</field>
|
||||
</record>
|
||||
|
||||
<record id="ir_actions_server_run_view_action" model="ir.actions.server">
|
||||
<field name="name">AI Tool: Run View Action</field>
|
||||
<field name="model_id" ref="model_ai_tool"/>
|
||||
<field name="state">code</field>
|
||||
<field name="use_in_ai" eval="True"/>
|
||||
<field name="ai_tool_name">run_view_action</field>
|
||||
<field name="ai_tool_thinking_text">Opening the view</field>
|
||||
<field name="ai_tool_description">Open a menu using its default action and view type.</field>
|
||||
<field name="ai_tool_schema">{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"menu_id": {"type": "integer"},
|
||||
"action_type": {"type": "string", "enum": ["list", "kanban", "form", "pivot", "graph"]}
|
||||
},
|
||||
"required": ["menu_id", "action_type"]
|
||||
}</field>
|
||||
<field name="code">ai["result"] = record._ai_tool_run_view_action(menu_id, action_type)</field>
|
||||
</record>
|
||||
|
||||
<!-- ================= previews & writes ================= -->
|
||||
<record id="ir_actions_server_preview_records" model="ir.actions.server">
|
||||
<field name="name">AI Tool: Prepare Record Previews</field>
|
||||
<field name="model_id" ref="model_ai_tool"/>
|
||||
<field name="state">code</field>
|
||||
<field name="use_in_ai" eval="True"/>
|
||||
<field name="ai_tool_name">prepare_record_previews</field>
|
||||
<field name="ai_tool_thinking_text">Preparing the preview</field>
|
||||
<field name="ai_tool_description">Prepare clickable previews of records so the user can open them from the chat.</field>
|
||||
<field name="ai_tool_schema">{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"model_name": {"type": "string"},
|
||||
"record_ids": {"type": "array", "items": {"type": "integer"}},
|
||||
"preview_label": {"type": "string"}
|
||||
},
|
||||
"required": ["model_name", "record_ids"]
|
||||
}</field>
|
||||
<field name="code">ai["result"] = record._ai_tool_prepare_record_previews(model_name, record_ids, preview_label)</field>
|
||||
</record>
|
||||
|
||||
<record id="ir_actions_server_read_binary_content" model="ir.actions.server">
|
||||
<field name="name">AI Tool: Read Binary Content</field>
|
||||
<field name="model_id" ref="model_ai_tool"/>
|
||||
<field name="state">code</field>
|
||||
<field name="use_in_ai" eval="True"/>
|
||||
<field name="ai_tool_name">read_binary_content</field>
|
||||
<field name="ai_tool_thinking_text">Reading the attached file</field>
|
||||
<field name="ai_tool_description">Read the text content of a binary field (PDF, image, attachment) linked to a record.</field>
|
||||
<field name="ai_tool_schema">{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"model_name": {"type": "string"},
|
||||
"record_ids": {"type": "array", "items": {"type": "integer"}},
|
||||
"field_name": {"type": "string"}
|
||||
},
|
||||
"required": ["model_name", "record_ids"]
|
||||
}</field>
|
||||
<field name="code">ai["result"] = record._ai_tool_read_binary_content(model_name, record_ids, field_name)</field>
|
||||
</record>
|
||||
|
||||
<record id="ir_actions_server_create_records" model="ir.actions.server">
|
||||
<field name="name">AI Tool: Create Records</field>
|
||||
<field name="model_id" ref="model_ai_tool"/>
|
||||
<field name="state">code</field>
|
||||
<field name="use_in_ai" eval="True"/>
|
||||
<field name="ai_tool_name">create_records</field>
|
||||
<field name="ai_tool_thinking_text">Creating the record</field>
|
||||
<field name="ai_tool_requires_confirmation" eval="True"/>
|
||||
<field name="ai_tool_description">Create one or more records. The user is asked to confirm before anything is written.</field>
|
||||
<field name="ai_tool_schema">{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"explanation": {"type": "string", "description": "One sentence shown to the user explaining what will be created"},
|
||||
"preview_menu_id": {"type": "integer"},
|
||||
"model_name": {"type": "string"},
|
||||
"values": {"type": "object", "description": "Field values, using exact technical field names"}
|
||||
},
|
||||
"required": ["explanation", "model_name", "values"]
|
||||
}</field>
|
||||
<field name="code">ai["result"] = record._ai_tool_create_records(ai, explanation, preview_menu_id, model_name, values)</field>
|
||||
</record>
|
||||
|
||||
<record id="ir_actions_server_update_records" model="ir.actions.server">
|
||||
<field name="name">AI Tool: Update Records</field>
|
||||
<field name="model_id" ref="model_ai_tool"/>
|
||||
<field name="state">code</field>
|
||||
<field name="use_in_ai" eval="True"/>
|
||||
<field name="ai_tool_name">update_records</field>
|
||||
<field name="ai_tool_thinking_text">Updating the records</field>
|
||||
<field name="ai_tool_requires_confirmation" eval="True"/>
|
||||
<field name="ai_tool_description">Update fields on existing records. Always pass a precise domain; updating every record is refused. The user confirms first.</field>
|
||||
<field name="ai_tool_schema">{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"explanation": {"type": "string"},
|
||||
"preview_menus": {"type": "array", "items": {"type": "integer"}},
|
||||
"updates": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"model_name": {"type": "string"},
|
||||
"domain": {"type": "string"},
|
||||
"changes": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"field": {"type": "string"},
|
||||
"value": {}
|
||||
},
|
||||
"required": ["field", "value"]
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": ["model_name", "domain", "changes"]
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": ["explanation", "updates"]
|
||||
}</field>
|
||||
<field name="code">ai["result"] = record._ai_tool_update_records(ai, explanation, preview_menus, updates)</field>
|
||||
</record>
|
||||
|
||||
<!-- ================= interaction & skills ================= -->
|
||||
<record id="ir_actions_server_ask_user_question" model="ir.actions.server">
|
||||
<field name="name">AI Tool: Ask User Question</field>
|
||||
<field name="model_id" ref="model_ai_tool"/>
|
||||
<field name="state">code</field>
|
||||
<field name="use_in_ai" eval="True"/>
|
||||
<field name="ai_tool_name">ask_user_question</field>
|
||||
<field name="ai_tool_thinking_text">Asking you a question</field>
|
||||
<field name="ai_tool_description">Ask the user a question and wait. Use it only when the answer cannot be resolved by searching the database.</field>
|
||||
<field name="ai_tool_schema">{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"question": {"type": "string"},
|
||||
"choices": {"type": "array", "items": {"type": "string"}},
|
||||
"multi_select": {"type": "boolean"},
|
||||
"allow_free_text": {"type": "boolean"}
|
||||
},
|
||||
"required": ["question"]
|
||||
}</field>
|
||||
<field name="code">ai["result"] = record._ai_tool_ask_user_question(ai, question, choices, multi_select, allow_free_text)</field>
|
||||
</record>
|
||||
|
||||
<record id="ir_actions_server_load_skills" model="ir.actions.server">
|
||||
<field name="name">AI Tool: Load Skills</field>
|
||||
<field name="model_id" ref="model_ai_tool"/>
|
||||
<field name="state">code</field>
|
||||
<field name="use_in_ai" eval="True"/>
|
||||
<field name="ai_tool_name">load_skills</field>
|
||||
<field name="ai_tool_thinking_text">Loading the relevant skill</field>
|
||||
<field name="ai_tool_description">Load one or more skills by id. Their instructions are returned and their tools become available. Call it at most once per request.</field>
|
||||
<field name="ai_tool_schema">{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"skill_ids": {"type": "array", "items": {"type": "integer"}}
|
||||
},
|
||||
"required": ["skill_ids"]
|
||||
}</field>
|
||||
<field name="code">ai["result"] = record._ai_tool_load_skills(ai, skill_ids)</field>
|
||||
</record>
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user