Giter Site home page Giter Site logo

thespino / odoogpt Goto Github PK

View Code? Open in Web Editor NEW
19.0 19.0 13.0 926 KB

Integrate Odoo with OpenAI and GPT Models. Make OdooBot finally useful by integrating with OpenAI ChatGPT-3!

Home Page: https://odoogpt.thespino.dev

License: GNU General Public License v3.0

Python 80.32% JavaScript 1.13% HTML 18.55%
chatgpt chatgpt-api gpt gpt3 odoo openai

odoogpt's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

odoogpt's Issues

Html documentation

  • Price
    • odoogpt
    • odoogpt_base
    • odoogpt_files
    • odoogpt_fine_tune
  • Documentation static/description/index.html
    • odoogpt
    • odoogpt_base
    • odoogpt_files
    • odoogpt_fine_tune
  • Images (for thumbnail)
    • odoogpt
    • odoogpt_base
    • odoogpt_files
    • odoogpt_fine_tune
  • Installation instructions in readme
    • odoogpt
    • odoogpt_base
    • odoogpt_files
    • odoogpt_fine_tune
  • Bump all versions (but keep under 1.0.0 for beta version)
    • odoogpt
    • odoogpt_base
    • odoogpt_files
    • odoogpt_fine_tune

[apps.odoo] Corrections and fixes

  • Correct prices: make all modules cost the same (and in general make odoogpt_base free or with low price) -- maybe make odoogpt_base 19.99 and all other free?
  • Add text-right alongside text-end
  • Make cards texts small
  • thespino link not working...
    • Consider adding thespino logo
    • Fuck off, ignore it
  • Bump versions

Add extensible and configurable methods to build the prompt

  • Add setting "OpenAI Prompt prefix" (company setting)
    • Default: "In Odoo: "
    • Models
    • View
  • Add setting "OpenAI Prompt suffix" (company setting)
    • Default: False
    • Models
    • View
  • Add method in mail.channel model to build the prompt before sending it (extensible)
  • In views: explain why that's needed
  • Bump version

Unify code and names

  • odoogpt.openai.models
    • _get_models_as_dict → _get_as_dict
    • odoogpt_openai_model_refresh_from_api → refresh_from_api
    • Settings menu structure like files
    • Unify fields name (openai_id, etc...)
  • Create base AbstractModel with openai_id and dict?
  • Bump version

Split odoogpt and odoogpt_base, add dependencies

  • Create new structure: move everithing into modules folder. The repo should contain main information and all the modules inside
    • Add main readme with connection to versions
  • Move essential stuff outside of OdooGPT
    • Create odoogpt_base module
    • Move dependencies here
    • Move OpenAI Models here
    • Move Utils here
    • Move Settings here
    • Create logo, settings image
    • Add readme
  • Add dependency on odoogpt → odoogpt_base module
  • Add readme to odoogpt
  • Bump versions

Keep into OdooGPT only the stuff related to the chat:

  • Prefix configuration
  • Mail

Settings: add view to show all models and interactions

  • Add views for models
    • List (readonly, only delete)
    • Form (readonly, only delete)
    • Action
  • Add views for interactions
    • List (readonly, only delete)
    • Form (readonly, only delete)
    • Action
  • Menuitems in Settings
    • OdooGPT
      • OpenAI Models
      • OpenAI Interactions
      • Refresh OpenAI Models (with server action)
  • Bump version

[FEATURE REQUEST] [15.0] [16.0] User-based custom settings

Allow to customize the OdooGPT settings for each user, so that each user can have, for example, a custom AI bot with a different tone, etc...
So it should be possible to customize ALL OdooGPT settings on an user-basis.

Target:

  • 15.0
  • 16.0

FUNCTIONALITIES

  • Add button in OdooGPT settings to access a customization table, like → User settings
  • The table displays all the users
  • Open an user and directly edit its settings
  • Under this, display all OdooGPT settings with a checkbox near it
    • Checkbox selected = customize for the user
    • Checkbox deselected = take system-wide parameter
      So it's possible to customize only the needed settings by marking them, the other ones will be taken from the system parameters.
  • Use the created settings

OTHER FUNCTIONALITIES

Some tought on other fancy functionalities

  • Add some levels of permissions to allow users to customize their own settings
    • None: don't allow
    • Basic: allow editing Chat method, Prefix, Suffix or System Message
    • Medium: allow Basic + Model, Temperature
      • Above this, add access to READ openai models & selector
    • All: allow Medium + OpenAI Token, Max Tokens. Warning! This will allow the user to see the OpenAI token associated with him.

OTHER

  • Docs

Better checks and tests with EMPTY api token

  • Update Models → Nothing happens
  • Ask something → Oops! Something went wrong!

After fix:

  • Update Models → returns ValidationError
  • Also checked for WRONG api key
  • Bump version

[BUG] Fixes on odoogpt_files

  • Fix files updates:
                odoogpt_record.write({
                    'filename': odoogpt_records.get('filename', odoogpt_record.filename),
                    'purpose': odoogpt_records.get('purpose', odoogpt_record.filename),
                })

into refresh_from_api must use openai_record instead + the purpose should be the purpose, not filename! Were you sleeping while doing this?

  • If possible, upload also the filename. Otherwise, use the openai id as _rec_name
  • Bump version

[FEATURE] Implement ChatCompletition Api

Todo

  • Setting to select which type of api using:
    • Completitions
    • ChatCompletitions
  • When ChatCompletitions is selected, use a special field for the first system message instead of the prefix
  • Mark the prefix way as "deprecating", push to use the ChatCompletition api.
  • Implement ChatCompletitions in utils
  • Use the selected option
  • Check openai python module version to prevent stupid errors. Since v0.27.0

Refer to:
https://www.youtube.com/watch?v=e2uvhJ7r1UQ
https://platform.openai.com/docs/guides/chat


Then

  • UPDATE DOCS

Add module odoogpt_files to manage files

  • Module odoogpt_files (depends on odoogpt_base)
  • Add apis in utils to get, read, read content, create, delete files
  • Model: odoogpt.openai.file with file data
  • Menu "Settings > OdooGPT > OpenAI Files"
    • Sub-Menu "OpenAI Files" → List all files
    • Sub-Menu "Refresh OpenAI Files" → Get files from API
  • Wizard "Upload File"
    • File selector
    • Purpose
    • UPLOAD, Cancel buttons
  • Button Delete file from api + Unlink from Odoo. Unlink doesn't remove the file from api
  • Button Read Content → Cannot do: error "To help mitigate abuse, downloading of fine-tune training files is disabled for free accounts."

  • Bump versions

Add ability to fine-tune models from settings - odoogpt_fine_tune

See https://www.notion.so/thespino/https-github-com-thespino-odoogpt-issues-17-ea7354aad4884e04adc87e647a66d743

  • REBASE BEFORE STARTING!
  • Allow uploading
    • jsonl
    • json (not for now)
    • csv (not for now)
  • Call the fine_tunes.prepare_data, if needed (ask with a flag)
  • Call the fine api (https://beta.openai.com/docs/api-reference/fine-tunes/create) with additional parameters
  • Update and Open the table with all fine tunes
  • Ability to upload file from the wizard
  • Ability to refresh files from api
  • Ability to refresh models from api

  • New module odoogpt_fine_tune
    • Depends on odoogpt_files (Not required for odoogpt)
    • Add readme
    • Add in main readme

  • Bump versions + readme

Where to add apis for fine_tune? I think it's better in base (utils), so we can use them everywhere

Look at https://pypi.org/project/jsonlines/

Maybe we can make jsonlines available only if the module is installed.
But, hey! We do not need to parse the file!


In future: it would be good to integrate with the spreadsheets module of Odoo

Odoo 15

Hi, I forked your project and trying to work in a Odoo 15 version. When installing the module it gives AttributeError: module 'odoo.fields' has no attribute 'Json' related to OdoogptOpenaiModel.py file, permission = fields.Json(). As far as I read, json fields are available since Odoo 14 so I am not sure what is happening. Your comment is appreciatted.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.