ai*
This commit is contained in:
34
ai_social/data/ai_agent_data.xml
Normal file
34
ai_social/data/ai_agent_data.xml
Normal file
@@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<odoo>
|
||||
<data>
|
||||
<record id="ai_social_agent_livechat" model="ai.agent">
|
||||
<field name="name">Social Live Chat AI Agent</field>
|
||||
<field name="subtitle">Handles social media user conversations through live chat.</field>
|
||||
<field name="system_prompt">## Identity
|
||||
- Present yourself as an **AI assistant** at the beginning of the conversation
|
||||
- You are a helpful, polite, concise livechat assistant.
|
||||
- Primary goal: accurately answer customer questions using the resources available.
|
||||
|
||||
## General behavior
|
||||
- You are a live chat operator for a social media conversation. Your communication
|
||||
style must be strictly Q&A: identify the user's question and answer directly.
|
||||
- Be brief, friendly, and professional.
|
||||
- Adapt to the user's language automatically.
|
||||
- Never fabricate facts. If information is missing or uncertain, say so plainly.
|
||||
- Do not share internal system details or tool names.
|
||||
- If you have it, use the user's name naturally in the conversation.
|
||||
|
||||
## When to call a human operator
|
||||
- When you struggle to answer, say to the user that you can add a human operator in the loop if needed
|
||||
- If the user asks to talk to a human, use the tool.
|
||||
- If the tool succeeds, briefly tell the user that a human operator will take over.
|
||||
- If no human operator is available, inform the user that no one is connected and that they will answer as soon as possible.
|
||||
|
||||
## Strict constraints
|
||||
- Never claim to "look into" anything, "follow up", or "provide updates".
|
||||
- You will receive skill prompts injected below. Follow them.</field>
|
||||
<field name="skill_ids" eval="[(4, ref('ai_social.ai_skill_add_human'))]"/>
|
||||
<field name="create_uid" ref="base.user_admin"/>
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
||||
50
ai_social/data/ai_composer_data.xml
Normal file
50
ai_social/data/ai_composer_data.xml
Normal file
@@ -0,0 +1,50 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<data noupdate="1">
|
||||
|
||||
<record id="ai_prompt_button_social_post" model="ai.prompt.button">
|
||||
<field name="name">Write a social post</field>
|
||||
</record>
|
||||
|
||||
<record id="ai_prompt_button_social_post_idea" model="ai.prompt.button">
|
||||
<field name="name">Help me find ideas to post</field>
|
||||
<field name="prompt">
|
||||
Find originals ideas to post on the social medias.
|
||||
</field>
|
||||
<field name="sequence">20</field>
|
||||
</record>
|
||||
|
||||
<record id="ai_prompt_button_generate_an_image" model="ai.prompt.button">
|
||||
<field name="name">Help me generate an image</field>
|
||||
<field name="prompt">
|
||||
If a reference image is available, treat it as the strict visual anchor for the subject only. If no reference image exists,
|
||||
use the textual description and available context to precisely define the subject's appearance. Your task is to generate a high-fidelity,
|
||||
visually explicit image that reinterprets the same subject within a new, contextually meaningful scenario.
|
||||
</field>
|
||||
<field name="sequence">20</field>
|
||||
</record>
|
||||
|
||||
<record id="ai_composer_text_field_social" model="ai.composer">
|
||||
<field name="name">Social Post Message</field>
|
||||
<field name="interface_key">text_field_social</field>
|
||||
<field name="ai_agent_id" ref="ai.ai_default_agent" />
|
||||
<field name="default_prompt">
|
||||
Your job is to help create a post that will be published on social medias.
|
||||
YOUR REPLY WILL BE INSERTED AS IS in the post, DO NOT ADD ANY EXTRA COMMENTARY THAT SHOULDN'T APPEAR IN THE post.
|
||||
Give your answers succinctly and to the point, DO NOT use markdown or HTML.
|
||||
</field>
|
||||
<field name="is_system_default">True</field>
|
||||
<field name="available_prompt_ids" eval="[(4, ref('ai_social.ai_prompt_button_social_post')), (4, ref('ai_social.ai_prompt_button_social_post_idea'))]"/>
|
||||
</record>
|
||||
|
||||
<record id="ai_composer_dialog_social_post" model="ai.composer">
|
||||
<field name="name">Social Media Manager</field>
|
||||
<field name="interface_key">media_dialog</field>
|
||||
<field name="focused_model_id" ref="social.model_social_post"/>
|
||||
<field name="ai_agent_id" ref="ai.ai_default_agent"/>
|
||||
<field name="is_system_default">True</field>
|
||||
<field name="available_prompt_ids" eval="[(4, ref('ai_social.ai_prompt_button_generate_an_image'))]"/>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</odoo>
|
||||
17
ai_social/data/ai_skill_data.xml
Normal file
17
ai_social/data/ai_skill_data.xml
Normal file
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<data>
|
||||
<record id="ai_skill_add_human" model="ai.skill">
|
||||
<field name="name">AI: Social Live Chat Add Human Operator</field>
|
||||
<field name="description">Contacting an operator</field>
|
||||
<field name="instructions">
|
||||
Adds an available human operator to the current conversation
|
||||
and stops the AI agent from handling new user messages.
|
||||
Use this tool when the user asks for a human,
|
||||
or when the conversation must be escalated to a person.
|
||||
If no operator is available, the AI agent remains in the conversation.
|
||||
</field>
|
||||
<field name="tool_ids" eval="[(4, ref('ai_social.ir_actions_server_add_human'))]"/>
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
||||
28
ai_social/data/ir_actions_server_data.xml
Normal file
28
ai_social/data/ir_actions_server_data.xml
Normal file
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<data>
|
||||
<record id="ir_actions_server_add_human" model="ir.actions.server">
|
||||
<field name="name">AI: Social Live Chat Add Human Operator</field>
|
||||
<field name="ai_tool_name">ai_tool_social_livechat_add_human</field>
|
||||
<field name="state">code</field>
|
||||
<field name="use_in_ai" eval="True"/>
|
||||
<field name="code">ai['result'] = record._ai_tool_social_livechat_add_human()</field>
|
||||
<field name="model_id" ref="ai.model_ai_agent"/>
|
||||
<field name="ai_tool_thinking_text">Contacting an operator</field>
|
||||
<field name="ai_tool_description">
|
||||
Adds an available human operator to the current conversation
|
||||
and stops the AI agent from handling new user messages.
|
||||
Use this tool when the user asks for a human,
|
||||
or when the conversation must be escalated to a person.
|
||||
If no operator is available, the AI agent remains in the conversation.
|
||||
</field>
|
||||
<field name="ai_tool_schema">
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {},
|
||||
"required": []
|
||||
}
|
||||
</field>
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user