| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
CRM (crm)
• Discuss (mail) • Calendar (calendar) • Contacts (contacts) • Invoicing (account) |
| Community Apps Dependencies | Show |
| Lines of code | 2776 |
| Technical Name |
llm_tool_demo |
| License | LGPL-3 |
| Website | https://github.com/apexive/odoo-llm |
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
CRM (crm)
• Discuss (mail) • Calendar (calendar) • Contacts (contacts) • Invoicing (account) |
| Community Apps Dependencies | Show |
| Lines of code | 2776 |
| Technical Name |
llm_tool_demo |
| License | LGPL-3 |
| Website | https://github.com/apexive/odoo-llm |
LLM Tool Demo
Demonstration of @llm_tool decorator usage.
Learn how to create custom AI tools with practical examples
What is LLM Tool Demo?
Your guide to creating custom AI tools for Odoo
This module demonstrates how to create LLM tools using the @llm_tool decorator. It provides 6 example tools showing different decorator patterns and best practices for tool development. Use this as a reference when creating your own AI tools for Odoo.
Included Examples
6 example tools demonstrating different patterns
get_system_info
Simple read-only tool example showing basic decorator usage.
calculate_business_days
Utility tool with type hints for automatic schema generation.
create_lead_from_description
Business logic tool showing CRM integration patterns.
generate_sales_report
Complex reporting tool demonstrating Sales module integration.
legacy_example
Manual schema example for integrating with legacy code.
send_notification_to_user
User interaction tool showing Mail integration for notifications.
What You'll Learn
Best practices demonstrated in these examples
Tool Types
Read-only, destructive, and idempotent tool patterns for safe AI operations.
Type Hints
Use Python type hints for automatic schema generation and validation.
Business Logic
Integration with CRM, Sales, and Mail modules for real-world use cases.
Technical Details
Requirements and dependencies
Module Information
llm_tool, crm, sale, mail
Productivity/LLM
Developer reference
LGPL-3
How to Use
Install this module, explore the code in the models directory, and use the patterns in your own modules.
Related Modules
Explore other modules in the Odoo LLM suite
LLM Tool Demo Module
Learn how to create LLM tools with examples.
Module Type: 📖 Demo/Tutorial (Tool Development)
Architecture
┌───────────────────────────────────────────────────────────────┐
│ Consumers of Tools │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────────────┐ │
│ │llm_assistant│ │ llm_letta │ │ llm_mcp_server │ │
│ └──────┬──────┘ └──────┬──────┘ └──────────┬──────────┘ │
└─────────┼────────────────┼────────────────────┼──────────────┘
└────────────────┼────────────────────┘
▼
┌───────────────────────────────────────────┐
│ llm_tool │
│ (Tool Framework) │
└─────────────────────┬─────────────────────┘
│
▼
┌───────────────────────────────────────────┐
│ ★ llm_tool_demo (This Module) ★ │
│ Example Tool Implementations │
│ 📖 6 Examples │ Best Practices │ Learn │
└─────────────────────┬─────────────────────┘
│
▼
┌───────────────────────────────────────────┐
│ llm │
│ (Core Base Module) │
└───────────────────────────────────────────┘
Installation
What to Install
For learning tool development:
odoo-bin -d your_db -i llm_tool_demo
Auto-Installed Dependencies
- llm (core infrastructure)
- llm_tool (tool framework)
What You'll Learn
Demo Tools
1. get_system_info
Location: models/res_users.py
Simple read-only tool to get Odoo system information.
@llm_tool(read_only_hint=True, idempotent_hint=True) def get_system_info(self) -> dict: """Get basic Odoo system information..."""
2. calculate_business_days
Location: models/utility_tools.py
Utility tool with type hints for automatic schema generation.
3. create_lead_from_description
Location: models/crm_lead.py
Business logic tool that creates CRM leads (destructive operation).
4. generate_sales_report
Location: models/sale_order.py
Complex reporting tool with data aggregation.
5. get_record_info
Location: models/ir_model.py
Legacy code example with manual JSON schema.
6. send_notification_to_user
Location: models/res_users.py
User interaction tool for in-app notifications.
Key Concepts
Type Hints for Schema Generation
def my_tool(self, name: str, count: int = 10) -> dict: ...
Metadata Hints
- read_only_hint=True - Doesn't modify data
- idempotent_hint=True - Safe to call multiple times
- destructive_hint=True - Modifies/creates/deletes data
Technical Specifications
- Version: 18.0.1.0.0
- License: LGPL-3
- Dependencies: llm, llm_tool, crm, sale
License
LGPL-3
© 2025 Apexive Solutions LLC
Please log in to comment on this module