Skip to content

Latest commit

 

History

History
93 lines (50 loc) · 3.3 KB

README.md

File metadata and controls

93 lines (50 loc) · 3.3 KB

License: AGPL-3

OpenAI Connector

OpenAI Logo

This technical module provides a connector for the OpenAI API and allows integration of ChatGPT and DALL-E capabilities within Odoo. ChatGPT4 and DALL·E 3 are available.

It can be used as a playground to test OpenAI tools in Odoo but does not have standalone functionality. The module is intended to be inherited by other modules for specific use cases, such as:

To create custom OpenAI completions, edits, or images, refer to the API documentation for proper configuration of API parameters.

OpenAI API Documentation

Configuration

Create an account on https://beta.openai.com/

Generate your API key: API keys

In Settings, fill the API Key field with your generated key.

image

Usage

OpenAI Completion

To create a new OpenAI Completion, go to Settings, Technical, OpenAI Completion and create a new record.

image

Model: The model on witch the completion will be applied.

Target Field: The field where the generated value will be saved.

Domain: The domain to select the records on witch the completion will be run.

image

Check the API Documentation to set OpenAI Parameters values.

For Completion results go to Settings, Technical, OpenAI Completion Results

OpenAI Image

To create a new OpenAI Image, go to Settings, Technical, OpenAI Image and create a new record.

For results go to Settings, Technical, OpenAI Image Results

Prompt template

Write a prompt template in Qweb.

Available functions in prompt template:

  • object : Current record
  • answer_lang : Function returning the language name
  • html2plaintext : Function to convert html to text

image

Tests

Test actions use the first record of the model selected by the domain.

Test first your prompt to adjust your template, then test the result of the Completion, Edit or Image to adjust OpenAI parameters.

image

Requirements

This module requires the Python client library for OpenAI API

pip install openai>=1.6.1

Maintainer