Developer Reference

LLM Tool Demo

Demonstration of @llm_tool decorator usage.

Learn how to create custom AI tools with practical examples

6 Examples
Best Practices
Open Source

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

Dependencies:

llm_tool, crm, sale, mail

Category:

Productivity/LLM

Purpose:

Developer reference

License:

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