| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Lines of code | 581 |
| Technical Name |
nk_openai_base |
| License | LGPL-3 |
| Website | https://www.odoo.com |
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Lines of code | 581 |
| Technical Name |
nk_openai_base |
| License | LGPL-3 |
| Website | https://www.odoo.com |
🤖 NK OpenAI Base
Centralized OpenAI Integration for Odoo v17
Base module providing centralized OpenAI API configuration and service for all NK modules. Required for NK AI Report Builder and other NK AI-powered modules.
Version 17.0.1.0.0 | Compatible with Odoo Community v17.0 | Enterprise edition not required
⚠️ IMPORTANT: API Requirements and Costs
🔑 API Key Required
This module REQUIRES a valid OpenAI API key to function.
You must obtain your own API key from OpenAI Platform. The module price does NOT include OpenAI API usage costs.
💰 Who Pays for API Usage?
OpenAI usage costs are NOT included in the module price.
You are responsible for all OpenAI API costs. Usage is billed directly by OpenAI based on:
- Model selected (GPT-4, GPT-3.5, etc.)
- Number of tokens used (input + output)
- Your OpenAI account's pricing tier
Without valid API credits, the module will not function. The app requires an active OpenAI account with available credits.
🔒 Data Privacy and Security
What data is sent to OpenAI?
Yes, data is sent externally to OpenAI's servers. The following information is transmitted:
- Model metadata: Field names, types, and relationships (up to 3 levels deep)
- User queries: Your natural language report requests
- Context information: Date ranges and additional context you provide
- System prompts: Instructions for SQL generation
⚠️ Actual database records are NOT sent to OpenAI. Only metadata (field names, types) and your queries are transmitted.
Is it safe? OpenAI uses industry-standard encryption (HTTPS/TLS) for all API communications. However, you should review OpenAI's Privacy Policy and Data Usage Policies to understand how they handle API data.
📋 Overview
NK OpenAI Base is a foundational module that provides centralized OpenAI API configuration and service for all NK modules. This module eliminates the need for each module to manage its own OpenAI settings, providing a single point of configuration and a unified service interface.
By using this base module, other NK modules can easily integrate AI-powered features without duplicating configuration code or managing API keys separately.
✨ Features
🔑 Centralized API Key Management
Single configuration point for OpenAI API key. All NK modules using AI features share the same configuration.
⚙️ Flexible Configuration
Configure model selection, base URL, timeout, and token limits. Support for OpenAI and compatible APIs (Ollama, LocalAI).
🔌 Unified Service Interface
Provides a standard service interface that all NK modules can use for AI functionality.
🛡️ Security
API key is stored securely with proper access controls. Only system administrators can configure settings.
📥 Installation
Prerequisites
- Odoo Version: 17.0 Community Edition or Enterprise Edition
- OpenAI API Key: Get your API key from OpenAI Platform
Installation Steps
- Install the Module
Install NK OpenAI Base from the Odoo App Store or from the repository.
- Configure OpenAI Settings
Navigate to Settings → OpenAI Integration section.
- Enable OpenAI Integration
Check the "Enable OpenAI Integration" checkbox.
- Enter API Key
Enter your OpenAI API key in the "OpenAI API Key" field.
- Configure Model and Settings
Select your preferred model and adjust timeout/token limits as needed.
⚙️ Configuration
Configure OpenAI settings through the Odoo Settings menu. Navigate to Settings → OpenAI Integration to access the configuration panel.
💻 Usage
For Module Developers
Other NK modules can use this base module to access OpenAI functionality:
# In your module's __manifest__.py
'depends': ['nk_openai_base'],
# In your Python code
openai_service = self.env['nk.openai.service']
config = openai_service.get_openai_config()
# Call OpenAI API
response = openai_service.call_openai(
prompt="Your prompt here",
system_message="You are a helpful assistant"
)
Service Methods
get_openai_config()
Returns dictionary with OpenAI configuration (enabled, api_key, model, base_url, timeout, max_tokens)
call_openai(prompt, system_message)
Calls OpenAI API with the provided prompt and returns the response text
parse_json_response(response_text)
Parses JSON from OpenAI response, handling markdown code blocks
✅ Compatibility
Odoo Versions
- ✅ Odoo Community v17.0 (Fully tested and supported)
- ✅ Odoo Enterprise v17.0 (Compatible, but Enterprise edition not required)
✓ Compatible with Odoo Community v17.0
✓ Enterprise edition NOT required
Dependencies
- ✅ base (core Odoo)
- ✅ openai Python package (external - install with: pip install openai)
- ✅ Valid OpenAI API key (required for functionality)
📝 Release Notes
Version 17.0.1.0.0 (2025-12-16)
✨ New Features
- Initial release of NK OpenAI Base module
- Centralized OpenAI API configuration
- Support for 60+ OpenAI models
- Chat Completions and Responses API support
- Organization and Project ID support
- Custom model name support
- Rate limit handling with retry logic
🔧 Improvements
- Enhanced error messages with TPM/RPM details
- Better context length exceeded handling
- Improved API response parsing
- Request ID tracking for debugging
🐛 Fixes
- Fixed URL normalization and validation
- Fixed base URL joining with endpoints
- Improved error messages
🗑️ Removed
- Removed manual requests library usage
- Removed temperature parameter
⚠️ Current Limitations
🔧 Technical
- Requires external Python package: openai
- API rate limits depend on OpenAI account tier
- Context window limits vary by model
⚙️ Configuration
- API key must be configured manually
- Model selection limited to predefined list
- Custom models require manual entry
🚀 Future Planning
Planned Improvements
We're continuously working to improve NK OpenAI Base. Planned improvements include:
- Enhanced rate limit management with automatic retry strategies
- Support for streaming responses
- Built-in prompt templates library
- Usage analytics and cost tracking
- Multi-provider support (Anthropic, Google, etc.)
- Advanced caching mechanisms
- Batch request support
- Improved error recovery and fallback mechanisms
Support & Resources
Need help? Have questions? We're here to assist you!
📧 Support
Contact our support team for assistance with installation, configuration, or any questions.
📚 Documentation
Comprehensive documentation is available in the module's README file and inline help texts.
© 2025 NK Interactive. All rights reserved.
NK OpenAI Base for Odoo v17 | License: LGPL-3 (GNU Lesser General Public License v3.0)
Please log in to comment on this module