-
Notifications
You must be signed in to change notification settings - Fork 3
[5192][ADD] openai_connector, product_name_generator #161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
61 commits
Select commit
Hold shift + click to select a range
d3e2078
[5192][ADD] openai_connector
nobuQuartile db7d6f8
for pre-commit
nobuQuartile 4e47071
delete chatgpt_integration
nobuQuartile 2db4688
upd
nobuQuartile 979c976
add log and creater module, delete message
nobuQuartile a5522ca
delete openai_vission_session_log model
nobuQuartile 894acb6
adj
AungKoKoLin1997 f8a00e4
add readme openai_connector and fix some ci error
nobuQuartile f8ea52d
fix product_name_generator data error
nobuQuartile f21583e
fix
nobuQuartile 1577760
fix
nobuQuartile d748bfd
AGPL to LGPL
nobuQuartile e250bb5
upd
nobuQuartile 833277d
upd
nobuQuartile 4274e22
upd
nobuQuartile 21064ab
upd
nobuQuartile 02e0db0
upd
nobuQuartile ed4bb9f
use json dump and loads for inputs
nobuQuartile 5ce3adc
update image_url from data to url
nobuQuartile ab17260
pre-commit run
nobuQuartile e253058
adj
AungKoKoLin1997 d2e6f1a
adj
AungKoKoLin1997 195912d
adj
AungKoKoLin1997 1828ec9
add readonly
AungKoKoLin1997 f4f6598
adj
AungKoKoLin1997 c2cd518
change license
AungKoKoLin1997 dbff0c4
fix
nobuQuartile 3c2b3ba
upd readme
nobuQuartile ef29002
xml indent
nobuQuartile 23c088c
format xml
nobuQuartile 173b10f
format xml
nobuQuartile 60dd560
upd please dont review
nobuQuartile acdba34
upd depends on webservice
nobuQuartile d5007ec
upd pre-commit
nobuQuartile 5cb6ab8
upd
nobuQuartile 8dd982c
upd readme & add api_connecter data
nobuQuartile 64f82d0
upd field's help
nobuQuartile f712668
requirements.txt
nobuQuartile 98d27b1
upd about most of Yoshi-san review
nobuQuartile e7e700d
delete requirement.txt
nobuQuartile 7556814
readme
nobuQuartile 308789f
adj
AungKoKoLin1997 0b8113e
upd product_name_generator's readme
nobuQuartile fc6f173
translation
nobuQuartile 866051e
upd
nobuQuartile 0b1b084
upd readme
nobuQuartile b81ef97
upd readme
nobuQuartile eb6ef97
upd ja.po
nobuQuartile 2416835
Update ja.po about Visionセッション
nobuQuartile bbaf425
add RetryableJobError
nobuQuartile a71e3c0
upd error
nobuQuartile 79acfe3
Update product_name_generator/models/product_template.py
nobuQuartile 43c68e8
error handling Timeout while downloading
nobuQuartile 2ac710b
upd product_name_generator data key name
nobuQuartile 22b2d95
upd endpoint
nobuQuartile e7ec5a4
imp
AungKoKoLin1997 f389c82
upd
nobuQuartile 9f954b8
[test
nobuQuartile 1f9d695
upd test 2
nobuQuartile 1dea9ee
upd
nobuQuartile 234b43a
upd test-requirement
nobuQuartile File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,102 @@ | ||
| ================ | ||
| OpenAI Connector | ||
| ================ | ||
|
|
||
| .. | ||
| !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
| !! This file is generated by oca-gen-addon-readme !! | ||
| !! changes will be overwritten. !! | ||
| !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
| !! source digest: sha256:30c53be77f7ad65281a7975a7a3cf834cc69470e0b2c9844b12f0a5a81ebae7d | ||
| !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
|
|
||
| .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png | ||
| :target: https://odoo-community.org/page/development-status | ||
| :alt: Beta | ||
| .. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png | ||
| :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html | ||
| :alt: License: AGPL-3 | ||
| .. |badge3| image:: https://img.shields.io/badge/github-qrtl%2Frmm--custom-lightgray.png?logo=github | ||
| :target: https://github.com/qrtl/rmm-custom/tree/15.0/openai_connector | ||
| :alt: qrtl/rmm-custom | ||
|
|
||
| |badge1| |badge2| |badge3| | ||
|
|
||
| This module defines openai.vision.session, which enables programmatic | ||
| access to OpenAI. It supports multimodal input (images and text), | ||
| optional web search, and structured output via JSON Schema. | ||
|
|
||
| The module is designed as a backend service and is intended to be | ||
| invoked by other modules. | ||
|
|
||
| **Table of contents** | ||
|
|
||
| .. contents:: | ||
| :local: | ||
|
|
||
| Configuration | ||
| ============= | ||
|
|
||
| For the OpenAI API configuration: | ||
|
|
||
| - Only the api_key field is required to be set. | ||
| - The base_url, token_type, and header_api_key_string are prefilled by | ||
| this module. | ||
|
|
||
| Basically, the OpenAI session should be added by a specific module that | ||
| depends on this one. Adjust the session attributes: | ||
|
|
||
| - Go to Settings → Technical →OpenAI Vision Sessions. | ||
|
|
||
| For additional options and usage details, refer to the official | ||
| documentation: https://platform.openai.com/docs | ||
|
|
||
| Usage | ||
| ===== | ||
|
|
||
| This module is intended to be used programmatically by other Odoo | ||
| modules. You create and configure ``openai.vision.session`` records and | ||
| call the method ``call_openai()`` from your own business logic. | ||
|
|
||
| For example, a product name generator module may call this module's | ||
| session as follows: | ||
|
|
||
| .. code:: python | ||
|
|
||
| session = self.env["openai.vision.session"].search( | ||
| [("reference_code", "=", "product_name_generation")], | ||
| limit=1, | ||
| ) | ||
| input_image = f"{base_url}/web/image/{self._name}/{self.id}/image_1920" | ||
| input_data = json.dumps([ | ||
| {"role": "user", "content": [{"type": "input_image", "image_url": image_url}]} | ||
| ]) | ||
| response = session.call_openai(input_data) | ||
|
|
||
| It is advised to delegate execution to background job queues (e.g., | ||
| queue.job) for asynchronous and fault-tolerant processing. | ||
|
|
||
| Bug Tracker | ||
| =========== | ||
|
|
||
| Bugs are tracked on `GitHub Issues <https://github.com/qrtl/rmm-custom/issues>`_. | ||
| In case of trouble, please check there if your issue has already been reported. | ||
| If you spotted it first, help us to smash it by providing a detailed and welcomed | ||
| `feedback <https://github.com/qrtl/rmm-custom/issues/new?body=module:%20openai_connector%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. | ||
|
|
||
| Do not contact contributors directly about support or help with technical issues. | ||
|
|
||
| Credits | ||
| ======= | ||
|
|
||
| Authors | ||
| ------- | ||
|
|
||
| * Quartile | ||
|
|
||
| Maintainers | ||
| ----------- | ||
|
|
||
| This module is part of the `qrtl/rmm-custom <https://github.com/qrtl/rmm-custom/tree/15.0/openai_connector>`_ project on GitHub. | ||
|
|
||
| You are welcome to contribute. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| from . import models |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| # Copyright 2025 Quartile (https://www.quartile.co) | ||
| # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
|
||
| { | ||
| "name": "OpenAI Connector", | ||
| "version": "15.0.1.0.0", | ||
| "author": "Quartile", | ||
| "license": "AGPL-3", | ||
| "website": "https://www.quartile.co", | ||
| "depends": ["base_api_connection"], | ||
| "data": [ | ||
| "data/api_config.xml", | ||
| "security/ir.model.access.csv", | ||
| "views/openai_vision_session_views.xml", | ||
| ], | ||
| "installable": True, | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| <odoo noupdate="1"> | ||
| <record id="api_config_openai" model="api.config"> | ||
| <field name="name">OpenAI</field> | ||
| <field name="base_url">https://api.openai.com/v1</field> | ||
| <field name="code">openai</field> | ||
| <field name="header_api_key_string">Authorization</field> | ||
| <field name="token_type">Bearer</field> | ||
| <field name="api_key">Dummy Key</field> | ||
| </record> | ||
| </odoo> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,215 @@ | ||
| # Translation of Odoo Server. | ||
| # This file contains the translation of the following modules: | ||
| # * openai_connector | ||
| # | ||
| msgid "" | ||
| msgstr "" | ||
| "Project-Id-Version: Odoo Server 15.0\n" | ||
| "Report-Msgid-Bugs-To: \n" | ||
| "POT-Creation-Date: 2025-08-20 03:08+0000\n" | ||
| "PO-Revision-Date: 2025-08-20 03:08+0000\n" | ||
| "Last-Translator: \n" | ||
| "Language-Team: \n" | ||
| "MIME-Version: 1.0\n" | ||
| "Content-Type: text/plain; charset=UTF-8\n" | ||
| "Content-Transfer-Encoding: \n" | ||
| "Plural-Forms: \n" | ||
|
|
||
| #. module: openai_connector | ||
| #: model:ir.model.fields,field_description:openai_connector.field_openai_vision_session__create_uid | ||
| msgid "Created by" | ||
| msgstr "作成者" | ||
|
|
||
| #. module: openai_connector | ||
| #: model:ir.model.fields,field_description:openai_connector.field_openai_vision_session__create_date | ||
| msgid "Created on" | ||
| msgstr "作成日" | ||
|
|
||
| #. module: openai_connector | ||
| #: model:ir.model.fields,help:openai_connector.field_openai_vision_session__reference_code | ||
| msgid "Defines the specific purpose of the OpenAI Vision session." | ||
| msgstr "OpenAI Vissionセッションの利用方法を目的を定義します" | ||
|
|
||
| #. module: openai_connector | ||
| #: model:ir.model.fields,field_description:openai_connector.field_openai_vision_session__display_name | ||
| msgid "Display Name" | ||
| msgstr "表示名" | ||
|
|
||
| #. module: openai_connector | ||
| #: model:ir.model.fields.selection,name:openai_connector.selection__openai_vision_session__llm_model__gpt-4o | ||
| msgid "GPT-4o" | ||
| msgstr "GPT-4o" | ||
|
|
||
| #. module: openai_connector | ||
| #: model:ir.model.fields,field_description:openai_connector.field_openai_vision_session__id | ||
| msgid "ID" | ||
| msgstr "ID" | ||
|
|
||
| #. module: openai_connector | ||
| #: model:ir.model.fields,help:openai_connector.field_openai_vision_session__previous_response_id | ||
| msgid "ID of previous response to continue chat (expires in 30 days)." | ||
| msgstr "チャット継続用の前回のレスポンスID(30日で期限が切れる)" | ||
|
|
||
| #. module: openai_connector | ||
| #: model:ir.model.fields,help:openai_connector.field_openai_vision_session__store_response | ||
| msgid "" | ||
| "If enabled, the API response is stored and the response ID is saved for " | ||
| "session continuity, allowing the conversation context to be preserved across" | ||
| " multiple calls." | ||
| msgstr "" | ||
| "有効にすると、APIレスポンスが保存され、レスポンスIDも保持されます。これにより複数回の呼び出しにまたがって会話のコンテキストが維持されます。" | ||
|
|
||
| #. module: openai_connector | ||
| #: model:ir.model.fields,help:openai_connector.field_openai_vision_session__web_search | ||
| msgid "" | ||
| "If enabled, the model can use web search to find information beyond its " | ||
| "training data." | ||
| msgstr "有効にすると、モデルはトレーニングデータ以外の情報をウェブ検索で取得できます。" | ||
|
|
||
| #. module: openai_connector | ||
| #: model:ir.model.fields,help:openai_connector.field_openai_vision_session__response_format_enabled | ||
| msgid "" | ||
| "If enabled, the response will be structured according to the Response Format" | ||
| " Schema (JSON)" | ||
| msgstr "有効にすると、レスポンスはJSON形式のスキーマに従って構造化されます。" | ||
|
|
||
| #. module: openai_connector | ||
| #: model:ir.model.fields,field_description:openai_connector.field_openai_vision_session__instruction | ||
| msgid "Instruction" | ||
| msgstr "システム指示" | ||
|
|
||
| #. module: openai_connector | ||
| #: model:ir.model.fields,field_description:openai_connector.field_openai_vision_session____last_update | ||
| msgid "Last Modified on" | ||
| msgstr "最終変更日" | ||
|
|
||
| #. module: openai_connector | ||
| #: model:ir.model.fields,field_description:openai_connector.field_openai_vision_session__write_uid | ||
| msgid "Last Updated by" | ||
| msgstr "最終更新者" | ||
|
|
||
| #. module: openai_connector | ||
| #: model:ir.model.fields,field_description:openai_connector.field_openai_vision_session__write_date | ||
| msgid "Last Updated on" | ||
| msgstr "最終更新日" | ||
|
|
||
| #. module: openai_connector | ||
| #: model:ir.model.fields,field_description:openai_connector.field_openai_vision_session__llm_model | ||
| msgid "Model" | ||
| msgstr "モデル" | ||
|
|
||
| #. module: openai_connector | ||
| #: model:ir.model.fields,field_description:openai_connector.field_openai_vision_session__name | ||
| msgid "Name" | ||
| msgstr "名称" | ||
|
|
||
| #. module: openai_connector | ||
| #: model:ir.ui.menu,name:openai_connector.menu_openai_root | ||
| msgid "OpenAI" | ||
| msgstr "OpenAI" | ||
|
|
||
| #. module: openai_connector | ||
| #: model:ir.model,name:openai_connector.model_openai_vision_session | ||
| msgid "OpenAI Vision Session" | ||
| msgstr "OpenAI Visionセッション" | ||
|
|
||
| #. module: openai_connector | ||
| #: model:ir.ui.menu,name:openai_connector.menu_openai_vision_sessions | ||
| msgid "OpenAI Vision Sessions" | ||
| msgstr "OpenAI Visionセッション" | ||
|
|
||
| #. module: openai_connector | ||
| #: code:addons/openai_connector/models/openai_vision_session.py:0 | ||
| #, python-format | ||
| msgid "" | ||
| "OpenAI refused the request:\n" | ||
| "{}" | ||
| msgstr "" | ||
| "OpenAIがリクエストを拒否しました:\n" | ||
| "{}" | ||
|
|
||
| #. module: openai_connector | ||
| #: code:addons/openai_connector/models/openai_vision_session.py:0 | ||
| #, python-format | ||
| msgid "OpenAI returned invalid JSON." | ||
| msgstr "OpenAI から無効な JSON が返されました" | ||
|
|
||
| #. module: openai_connector | ||
| #: model:ir.model.fields,field_description:openai_connector.field_openai_vision_session__previous_response_id | ||
| msgid "Previous Response ID" | ||
| msgstr "前回のレスポンスID" | ||
|
|
||
| #. module: openai_connector | ||
| #: model:ir.model.fields,field_description:openai_connector.field_openai_vision_session__reference_code | ||
| msgid "Reference Code" | ||
| msgstr "参照コード" | ||
|
|
||
| #. module: openai_connector | ||
| #: model_terms:ir.ui.view,arch_db:openai_connector.view_openai_vision_session_form | ||
| msgid "Response Format" | ||
| msgstr "レスポンス形式" | ||
|
|
||
| #. module: openai_connector | ||
| #: model:ir.model.fields,field_description:openai_connector.field_openai_vision_session__response_format_schema | ||
| msgid "Response Format Schema (JSON)" | ||
| msgstr "レスポンス形式スキーマ(JSON)" | ||
|
|
||
| #. module: openai_connector | ||
| #: model:ir.model.fields,help:openai_connector.field_openai_vision_session__temperature | ||
| msgid "" | ||
| "Sets response randomness (0–2). Higher is more creative, lower is more " | ||
| "focused." | ||
| msgstr "レスポンスのランダム性を設定します(0〜2)。数値が高いほど創造的になり、低いほど正確な応答になります。" | ||
|
|
||
| #. module: openai_connector | ||
| #: model:ir.model.fields,field_description:openai_connector.field_openai_vision_session__store_response | ||
| msgid "Store Response" | ||
| msgstr "レスポンスを保存" | ||
|
|
||
| #. module: openai_connector | ||
| #: model:ir.model.fields,help:openai_connector.field_openai_vision_session__instruction | ||
| msgid "" | ||
| "System-level instruction for the assistant. Example: You are a helpful " | ||
| "assistant that answers in Japanese." | ||
| msgstr "OpenAIへのシステムレベルの指示。例:「あなたは日本語で答える親切なアシスタントです。」" | ||
|
|
||
| #. module: openai_connector | ||
| #: model:ir.model.fields,field_description:openai_connector.field_openai_vision_session__temperature | ||
| msgid "Temperature" | ||
| msgstr "創造性" | ||
|
|
||
| #. module: openai_connector | ||
| #: code:addons/openai_connector/models/openai_vision_session.py:0 | ||
| #, python-format | ||
| msgid "" | ||
| "The JSON schema is invalid:\n" | ||
| "{}" | ||
| msgstr "" | ||
| "JSON スキーマが無効です:\n" | ||
| "{}" | ||
|
|
||
| #. module: openai_connector | ||
| #: code:addons/openai_connector/models/openai_vision_session.py:0 | ||
| #, python-format | ||
| msgid "The inputs are invalid: %s" | ||
| msgstr "Inputsが無効です: %s" | ||
|
|
||
| #. module: openai_connector | ||
| #: model:ir.model.fields,field_description:openai_connector.field_openai_vision_session__response_format_enabled | ||
| msgid "Use Structured Output (JSON Schema)" | ||
| msgstr "構造化出力(JSON スキーマ)を使用" | ||
|
|
||
| #. module: openai_connector | ||
| #: model:ir.model.fields,field_description:openai_connector.field_openai_vision_session__web_search | ||
| msgid "Use Web Search" | ||
| msgstr "ウェブ検索を使用" | ||
|
|
||
| #. module: openai_connector | ||
| #: model_terms:ir.ui.view,arch_db:openai_connector.view_openai_vision_session_form | ||
| msgid "Vision Session" | ||
| msgstr "Visionセッション" | ||
|
|
||
| #. module: openai_connector | ||
| #: model:ir.actions.act_window,name:openai_connector.action_openai_vision_sessions | ||
| msgid "Vision Sessions" | ||
| msgstr "Visionセッション" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| from . import openai_vision_session |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.