fix odoo 13 gpt

This commit is contained in:
ivan deng
2023-04-11 04:59:22 +08:00
parent f9728fd6f8
commit 9368b3818b
28 changed files with 15312 additions and 201 deletions

View File

@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2020-Present InTechual Solutions. (<https://intechualsolutions.com/>)
from . import mail_channel
from . import res_config_settings

View File

@@ -1,7 +1,13 @@
# -*- coding: utf-8 -*-
import requests
import requests, json
import openai
from odoo import api, fields, models, _
from odoo.exceptions import UserError
from .lib.WordsSearch import WordsSearch
import logging
_logger = logging.getLogger(__name__)
class AiRobot(models.Model):
@@ -9,9 +15,10 @@ class AiRobot(models.Model):
_description = 'Gpt Robot'
_order = 'sequence, name'
name = fields.Char(string='Name', translate=True)
provider = fields.Selection(string="AI Provider", selection=[('openai', 'OpenAI')], required=True, default='openai')
name = fields.Char(string='Name', translate=True, required=True)
provider = fields.Selection(string="AI Provider", selection=[('openai', 'OpenAI'), ('azure', 'Azure')], required=True, default='openai')
ai_model = fields.Selection(string="AI Model", selection=[
('gpt-4', 'Chatgpt 4'),
('gpt-3.5-turbo', 'Chatgpt 3.5 Turbo'),
('gpt-3.5-turbo-0301', 'Chatgpt 3.5 Turbo on 20230301'),
('text-davinci-003', 'Chatgpt 3 Davinci'),
@@ -20,6 +27,7 @@ class AiRobot(models.Model):
('dall-e2', 'Dall-E Image'),
], required=True, default='gpt-3.5-turbo',
help="""
GPT-4: Can understand Image, generate natural language or code.
GPT-3.5: A set of models that improve on GPT-3 and can understand as well as generate natural language or code
DALL·E: A model that can generate and edit images given a natural language prompt
Whisper: A model that can convert audio into text
@@ -30,10 +38,126 @@ GPT-3 A set of models that can understand and generate natural language
""")
openapi_api_key = fields.Char(string="API Key", help="Provide the API key here")
temperature = fields.Float(string='Temperature', default=0.9)
max_length = fields.Integer('Max Length', default=300)
endpoint = fields.Char('End Point', default='https://api.openai.com/v1/chat/completions')
engine = fields.Char('Engine', help='If use Azure, Please input the Model deployment name.')
api_version = fields.Char('API Version', default='2022-12-01')
sequence = fields.Integer('Sequence', help="Determine the display order", default=10)
sensitive_words = fields.Text('Sensitive Words Plus', help='Sensitive word filtering. Separate keywords with a carriage return.')
is_filtering = fields.Boolean('Filter Sensitive Words', default=False, help='Use base Filter in dir models/lib/sensi_words.txt')
def action_disconnect(self):
requests.delete('https://chatgpt.com/v1/disconnect')
def get_ai(self, data, partner_name='odoo', *args):
# 通用方法
self.ensure_one()
if hasattr(self, 'get_%s' % self.provider):
return getattr(self, 'get_%s' % self.provider)(data, partner_name, *args)
else:
return _('No robot provider found')
def get_openai(self, data, partner_name='odoo', *args):
self.ensure_one()
headers = {"Content-Type": "application/json", "Authorization": f"Bearer {self.openapi_api_key}"}
R_TIMEOUT = 300
o_url = self.endpoint or "https://api.openai.com/v1/chat/completions"
# 以下处理 open ai
# 获取模型信息
# list_model = requests.get("https://api.openai.com/v1/models", headers=headers)
# model_info = requests.get("https://api.openai.com/v1/models/%s" % ai_model, headers=headers)
if self.ai_model == 'dall-e2':
# todo: 处理 图像引擎,主要是返回参数到聊天中
# image_url = response['data'][0]['url']
# https://platform.openai.com/docs/guides/images/introduction
pdata = {
"prompt": data,
"n": 3,
"size": "1024x1024",
}
return '建设中'
elif self.ai_model in ['gpt-3.5-turbo', 'gpt-3.5-turbo-0301']:
pdata = {
"model": self.ai_model,
"messages": [{"role": "user", "content": data}],
"temperature": 0.9,
"max_tokens": self.max_length or 1000,
"top_p": 1,
"frequency_penalty": 0.0,
"presence_penalty": 0.6,
"user": partner_name,
"stop": ["Human:", "AI:"]
}
_logger.warning('=====================open input pdata: %s' % pdata)
response = requests.post(o_url, data=json.dumps(pdata), headers=headers, timeout=R_TIMEOUT)
res = response.json()
if 'choices' in res:
# for rec in res:
# res = rec['message']['content']
res = '\n'.join([x['message']['content'] for x in res['choices']])
res = self.filter_sensitive_words(res)
return res
else:
pdata = {
"model": self.ai_model,
"prompt": data,
"temperature": 0.9,
"max_tokens": self.max_length or 1000,
"top_p": 1,
"frequency_penalty": 0.0,
"presence_penalty": 0.6,
"user": partner_name,
"stop": ["Human:", "AI:"]
}
response = requests.post(o_url, data=json.dumps(pdata), headers=headers, timeout=R_TIMEOUT)
res = response.json()
if 'choices' in res:
res = '\n'.join([x['text'] for x in res['choices']])
res = self.filter_sensitive_words(res)
return res
return "获取结果超时,请重新跟我聊聊。"
def get_azure(self, data, partner_name='odoo', *args):
self.ensure_one()
# only for azure
openai.api_type = self.provider
if not self.endpoint:
raise UserError(_("Please Set your AI robot's endpoint first."))
openai.api_base = self.endpoint
if not self.api_version:
raise UserError(_("Please Set your AI robot's API Version first."))
openai.api_version = self.api_version
openai.api_key = self.openapi_api_key
response = openai.Completion.create(
engine=self.engine,
prompt=data,
temperature=self.temperature or 0.9,
max_tokens=self.max_length or 600,
top_p=0.5,
frequency_penalty=0,
presence_penalty=0, stop=["Human:", "AI:"])
_logger.warning('=====================azure input data: %s' % data)
if 'choices' in response:
res = response['choices'][0]['text'].replace(' .', '.').strip()
res = self.filter_sensitive_words(res)
return res
@api.onchange('provider')
def _onchange_provider(self):
if self.provider == 'openai':
self.endpoint = 'https://api.openai.com/v1/chat/completions'
elif self.provider == 'azure':
self.endpoint = 'https://odoo.openai.azure.com'
def filter_sensitive_words(self, data):
if self.is_filtering:
search = WordsSearch()
s = self.sensitive_words
search.SetKeywords(s.split('\n'))
result = search.Replace(text=data)
return result
else:
return data

View File

@@ -0,0 +1,296 @@
#!/usr/bin/env python
# -*- coding:utf-8 -*-
# ToolGood.Words.WordsSearch.py
# 2020, Lin Zhijun, https://github.com/toolgood/ToolGood.Words
# Licensed under the Apache License 2.0
# 更新日志
# 2020.04.06 第一次提交
# 2020.05.16 修改支持大于0xffff的字符
import os
__all__ = ['WordsSearch']
__author__ = 'Lin Zhijun'
__date__ = '2020.05.16'
class TrieNode():
def __init__(self):
self.Index = 0
self.Index = 0
self.Layer = 0
self.End = False
self.Char = ''
self.Results = []
self.m_values = {}
self.Failure = None
self.Parent = None
def Add(self, c):
if c in self.m_values:
return self.m_values[c]
node = TrieNode()
node.Parent = self
node.Char = c
self.m_values[c] = node
return node
def SetResults(self, index):
if (self.End == False):
self.End = True
self.Results.append(index)
class TrieNode2():
def __init__(self):
self.End = False
self.Results = []
self.m_values = {}
self.minflag = 0xffff
self.maxflag = 0
def Add(self, c, node3):
if (self.minflag > c):
self.minflag = c
if (self.maxflag < c):
self.maxflag = c
self.m_values[c] = node3
def SetResults(self, index):
if (self.End == False):
self.End = True
if (index in self.Results) == False:
self.Results.append(index)
def HasKey(self, c):
return c in self.m_values
def TryGetValue(self, c):
if (self.minflag <= c and self.maxflag >= c):
if c in self.m_values:
return self.m_values[c]
return None
class WordsSearch():
def __init__(self):
self._first = {}
self._keywords = []
self._indexs = []
def SetKeywords(self, keywords):
keyword_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'sensi_words.txt')
s = open(keyword_path, 'r+', encoding='utf-8').read().split('\n')
self._keywords = s + keywords
# self._keywords = keywords
self._indexs = []
for i in range(len(keywords)):
self._indexs.append(i)
root = TrieNode()
allNodeLayer = {}
for i in range(len(self._keywords)): # for (i = 0; i < _keywords.length; i++)
p = self._keywords[i]
nd = root
for j in range(len(p)): # for (j = 0; j < p.length; j++)
nd = nd.Add(ord(p[j]))
if (nd.Layer == 0):
nd.Layer = j + 1
if nd.Layer in allNodeLayer:
allNodeLayer[nd.Layer].append(nd)
else:
allNodeLayer[nd.Layer] = []
allNodeLayer[nd.Layer].append(nd)
nd.SetResults(i)
allNode = []
allNode.append(root)
for key in allNodeLayer.keys():
for nd in allNodeLayer[key]:
allNode.append(nd)
allNodeLayer = None
for i in range(len(allNode)): # for (i = 0; i < allNode.length; i++)
if i == 0:
continue
nd = allNode[i]
nd.Index = i
r = nd.Parent.Failure
c = nd.Char
while (r != None and (c in r.m_values) == False):
r = r.Failure
if (r == None):
nd.Failure = root
else:
nd.Failure = r.m_values[c]
for key2 in nd.Failure.Results:
nd.SetResults(key2)
root.Failure = root
allNode2 = []
for i in range(len(allNode)): # for (i = 0; i < allNode.length; i++)
allNode2.append(TrieNode2())
for i in range(len(allNode2)): # for (i = 0; i < allNode2.length; i++)
oldNode = allNode[i]
newNode = allNode2[i]
for key in oldNode.m_values:
index = oldNode.m_values[key].Index
newNode.Add(key, allNode2[index])
for index in range(len(oldNode.Results)): # for (index = 0; index < oldNode.Results.length; index++)
item = oldNode.Results[index]
newNode.SetResults(item)
oldNode = oldNode.Failure
while oldNode != root:
for key in oldNode.m_values:
if (newNode.HasKey(key) == False):
index = oldNode.m_values[key].Index
newNode.Add(key, allNode2[index])
for index in range(len(oldNode.Results)):
item = oldNode.Results[index]
newNode.SetResults(item)
oldNode = oldNode.Failure
allNode = None
root = None
# first = []
# for index in range(65535):# for (index = 0; index < 0xffff; index++)
# first.append(None)
# for key in allNode2[0].m_values :
# first[key] = allNode2[0].m_values[key]
self._first = allNode2[0]
def FindFirst(self, text):
ptr = None
for index in range(len(text)): # for (index = 0; index < text.length; index++)
t = ord(text[index]) # text.charCodeAt(index)
tn = None
if (ptr == None):
tn = self._first.TryGetValue(t)
else:
tn = ptr.TryGetValue(t)
if (tn == None):
tn = self._first.TryGetValue(t)
if (tn != None):
if (tn.End):
item = tn.Results[0]
keyword = self._keywords[item]
return {"Keyword": keyword, "Success": True, "End": index, "Start": index + 1 - len(keyword), "Index": self._indexs[item]}
ptr = tn
return None
def FindAll(self, text):
ptr = None
list = []
for index in range(len(text)): # for (index = 0; index < text.length; index++)
t = ord(text[index]) # text.charCodeAt(index)
tn = None
if (ptr == None):
tn = self._first.TryGetValue(t)
else:
tn = ptr.TryGetValue(t)
if (tn == None):
tn = self._first.TryGetValue(t)
if (tn != None):
if (tn.End):
for j in range(len(tn.Results)): # for (j = 0; j < tn.Results.length; j++)
item = tn.Results[j]
keyword = self._keywords[item]
list.append({"Keyword": keyword, "Success": True, "End": index, "Start": index + 1 - len(keyword), "Index": self._indexs[item]})
ptr = tn
return list
def ContainsAny(self, text):
ptr = None
for index in range(len(text)): # for (index = 0; index < text.length; index++)
t = ord(text[index]) # text.charCodeAt(index)
tn = None
if (ptr == None):
tn = self._first.TryGetValue(t)
else:
tn = ptr.TryGetValue(t)
if (tn == None):
tn = self._first.TryGetValue(t)
if (tn != None):
if (tn.End):
return True
ptr = tn
return False
def Replace(self, text, replaceChar='*'):
result = list(text)
ptr = None
for i in range(len(text)): # for (i = 0; i < text.length; i++)
t = ord(text[i]) # text.charCodeAt(index)
tn = None
if (ptr == None):
tn = self._first.TryGetValue(t)
else:
tn = ptr.TryGetValue(t)
if (tn == None):
tn = self._first.TryGetValue(t)
if (tn != None):
if (tn.End):
maxLength = len(self._keywords[tn.Results[0]])
start = i + 1 - maxLength
for j in range(start, i + 1): # for (j = start; j <= i; j++)
result[j] = replaceChar
ptr = tn
return ''.join(result)
if __name__ == "__main__":
s = "中国|国人|zg人|乾清宫"
test = "我是中国人"
search = WordsSearch()
search.SetKeywords(s.split('|'))
print("----------------------------------- WordsSearch -----------------------------------")
print("WordsSearch FindFirst is run.")
f = search.FindFirst(test)
if f["Keyword"] != "中国":
print("WordsSearch FindFirst is error.............................")
print("WordsSearch FindFirst is run.")
all = search.FindAll("乾清宫")
if all[0]["Keyword"] != "乾清宫":
print("WordsSearch FindFirst is error.............................")
print("WordsSearch FindAll is run.")
all = search.FindAll(test)
if all[0]["Keyword"] != "中国":
print("WordsSearch FindAll is error.............................")
if all[1]["Keyword"] != "国人":
print("WordsSearch FindAll is error.............................")
if all[0]["Start"] != 2:
print("WordsSearch FindAll is error.............................")
if all[0]["End"] != 3:
print("WordsSearch FindAll is error.............................")
if len(all) != 2:
print("WordsSearch FindAll is error.............................")
print("WordsSearch ContainsAny is run.")
b = search.ContainsAny(test)
if b == False:
print("WordsSearch ContainsAny is error.............................")
print("WordsSearch Replace is run.")
txt = search.Replace(test)
if (txt != "我是***"):
print("WordsSearch Replace is error.............................")
print("----------------------------------- Test End -----------------------------------")

File diff suppressed because it is too large Load Diff

View File

@@ -1,12 +1,12 @@
# -*- coding: utf-8 -*-
import openai
import requests,json
import requests, json
import datetime
# from transformers import TextDavinciTokenizer, TextDavinciModel
from odoo import api, fields, models, _
from odoo.exceptions import UserError
import logging
_logger = logging.getLogger(__name__)
@@ -14,63 +14,6 @@ _logger = logging.getLogger(__name__)
class Channel(models.Model):
_inherit = 'mail.channel'
@api.model
def get_openai(self, api_key, ai_model, data, user="Odoo"):
headers = {"Content-Type": "application/json", "Authorization": f"Bearer {api_key}"}
R_TIMEOUT = 5
if ai_model == 'dall-e2':
# todo: 处理 图像引擎,主要是返回参数到聊天中
# image_url = response['data'][0]['url']
# https://platform.openai.com/docs/guides/images/introduction
pdata = {
"prompt": data,
"n": 3,
"size": "1024x1024",
}
return '建设中'
elif ai_model in ['gpt-3.5-turbo', 'gpt-3.5-turbo-0301']:
pdata = {
"model": ai_model,
"messages": [{"role": "user", "content": data}],
"temperature": 0.9,
"max_tokens": 2000,
"top_p": 1,
"frequency_penalty": 0.0,
"presence_penalty": 0.6,
"user": user,
"stop": ["Human:", "AI:"]
}
response = requests.post("https://api.openai.com/v1/chat/completions", data=json.dumps(pdata), headers=headers, timeout=R_TIMEOUT)
res = response.json()
if 'choices' in res:
# for rec in res:
# res = rec['message']['content']
res = '\n'.join([x['message']['content'] for x in res['choices']])
return res
else:
pdata = {
"model": ai_model,
"prompt": data,
"temperature": 0.9,
"max_tokens": 2000,
"top_p": 1,
"frequency_penalty": 0.0,
"presence_penalty": 0.6,
"user": user,
"stop": ["Human:", "AI:"]
}
response = requests.post("https://api.openai.com/v1/completions", data=json.dumps(pdata), headers=headers, timeout=R_TIMEOUT)
res = response.json()
if 'choices' in res:
res = '\n'.join([x['text'] for x in res['choices']])
return res
# 获取模型信息
# list_model = requests.get("https://api.openai.com/v1/models", headers=headers)
# model_info = requests.get("https://api.openai.com/v1/models/%s" % ai_model, headers=headers)
return "获取结果超时,请重新跟我聊聊。"
@api.model
def get_openai_context(self, channel_id, partner_chatgpt, current_prompt, seconds=600):
afterTime = fields.Datetime.now() - datetime.timedelta(seconds=seconds)
@@ -101,19 +44,11 @@ class Channel(models.Model):
return '\n'.join(prompt[::-1])
def get_chatgpt_answer(self, prompt, partner_name):
response = openai.Completion.create(
model="text-davinci-003",
prompt=prompt,
temperature=0.6,
max_tokens=3000,
top_p=1,
frequency_penalty=0,
presence_penalty=0,
user=partner_name,
)
res = response['choices'][0]['text']
return res
def get_ai(self, ai, prompt, partner_name, channel, user_id, message):
res = ai.get_ai(prompt, partner_name)
if res:
res = res.replace('\n', '<br/>')
channel.with_user(user_id).message_post(body=res, message_type='comment', subtype_xmlid='mail.mt_comment', parent_id=message.id)
def _notify_thread(self, message, msg_vals=False, **kwargs):
rdata = super(Channel, self)._notify_thread(message, msg_vals=msg_vals, **kwargs)
@@ -121,7 +56,7 @@ class Channel(models.Model):
to_partner_id = self.env['res.partner']
user_id = self.env['res.users']
author_id = msg_vals.get('author_id')
gpt_id = self.env['ai.robot']
ai = self.env['ai.robot']
channel_type = self.channel_type
if channel_type == 'chat':
channel_partner_ids = self.channel_partner_ids
@@ -132,7 +67,7 @@ class Channel(models.Model):
gpt_wl_users = user_id.gpt_wl_users
is_allow = message.create_uid.id in gpt_wl_users.ids
if gpt_policy == 'all' or (gpt_policy == 'limit' and is_allow):
gpt_id = user_id.gpt_id
ai = user_id.gpt_id
elif channel_type in ['group', 'channel']:
# partner_ids = @ ids
@@ -147,14 +82,10 @@ class Channel(models.Model):
is_allow = message.create_uid.id in gpt_wl_users.ids
to_partner_id = user_id.partner_id
if gpt_policy == 'all' or (gpt_policy == 'limit' and is_allow):
gpt_id = user_id.gpt_id
ai = user_id.gpt_id
chatgpt_channel_id = self.env.ref('app_chatgpt.channel_chatgpt')
# print('author_id:',author_id)
# print('partner_chatgpt.id:',partner_chatgpt.id)
prompt = msg_vals.get('body')
# print('prompt:', prompt)
# print('-----')
@@ -162,8 +93,8 @@ class Channel(models.Model):
return rdata
# api_key = self.env['ir.config_parameter'].sudo().get_param('app_chatgpt.openapi_api_key')
api_key = ''
if gpt_id:
api_key = gpt_id.openapi_api_key
if ai:
api_key = ai.openapi_api_key
if not api_key:
_logger.warning(_("ChatGPT Robot【%s】have not set open api key."))
return rdata
@@ -171,29 +102,29 @@ class Channel(models.Model):
openapi_context_timeout = int(self.env['ir.config_parameter'].sudo().get_param('app_chatgpt.openapi_context_timeout')) or 600
except:
openapi_context_timeout = 600
sync_config = self.env['ir.config_parameter'].sudo().get_param('app_chatgpt.openai_sync_config')
openai.api_key = api_key
partner_name = ''
# print(msg_vals)
# print(msg_vals.get('record_name', ''))
# print('self.channel_type :',self.channel_type)
if gpt_id:
ai_model = gpt_id.ai_model or 'text-davinci-003'
# print('chatgpt_name:', chatgpt_name)
# if author_id != to_partner_id.id and (chatgpt_name in msg_vals.get('record_name', '') or 'ChatGPT' in msg_vals.get('record_name', '') ) and self.channel_type == 'chat':
if ai:
if author_id != to_partner_id.id and self.channel_type == 'chat':
_logger.info(f'私聊:author_id:{author_id},partner_chatgpt.id:{to_partner_id.id}')
try:
channel = self.env[msg_vals.get('model')].browse(msg_vals.get('res_id'))
if ai_model not in ['gpt-3.5-turbo', 'gpt-3.5-turbo-0301']:
prompt = self.get_openai_context(channel.id, to_partner_id.id, prompt, openapi_context_timeout)
# if ai_model not in ['gpt-3.5-turbo', 'gpt-3.5-turbo-0301']:
prompt = self.get_openai_context(channel.id, to_partner_id.id, prompt, openapi_context_timeout)
print(prompt)
# res = self.get_chatgpt_answer(prompt,partner_name)
res = self.get_openai(api_key, ai_model, prompt, partner_name)
res = res.replace('\n', '<br/>')
if sync_config == 'sync':
self.get_ai(ai, prompt, partner_name, channel, user_id, message)
else:
self.with_delay().get_ai(ai, prompt, partner_name, channel, user_id, message)
# res = ai.get_ai(prompt, partner_name)
# res = res.replace('\n', '<br/>')
# print('res:',res)
# print('channel:',channel)
channel.with_user(user_id).message_post(body=res, message_type='comment',subtype_xmlid='mail.mt_comment', parent_id=message.id)
# channel.with_user(user_id).message_post(body=res, message_type='comment',subtype_xmlid='mail.mt_comment', parent_id=message.id)
# channel.with_user(user_chatgpt).message_post(body=res, message_type='notification', subtype_xmlid='mail.mt_comment')
# channel.sudo().message_post(
# body=res,
@@ -204,17 +135,19 @@ class Channel(models.Model):
# self.with_user(user_chatgpt).message_post(body=res, message_type='comment', subtype_xmlid='mail.mt_comment')
except Exception as e:
raise UserError(_(e))
elif author_id != to_partner_id.id and msg_vals.get('model', '') == 'mail.channel' and msg_vals.get('res_id', 0) == chatgpt_channel_id.id:
_logger.info(f'频道群聊:author_id:{author_id},partner_chatgpt.id:{to_partner_id.id}')
try:
prompt = self.get_openai_context(chatgpt_channel_id.id, to_partner_id.id, prompt, openapi_context_timeout)
# print(prompt)
# res = self.get_chatgpt_answer(prompt, partner_name)
res = self.get_openai(api_key, ai_model, prompt, partner_name)
res = res.replace('\n', '<br/>')
chatgpt_channel_id.with_user(user_id).message_post(body=res, message_type='comment', subtype_xmlid='mail.mt_comment',parent_id=message.id)
if sync_config == 'sync':
self.get_ai(ai, prompt, 'odoo', chatgpt_channel_id, user_id, message)
else:
self.with_delay().get_ai(ai, prompt, 'odoo', chatgpt_channel_id, user_id, message)
# res = ai.get_ai(prompt, 'odoo')
# res = res.replace('\n', '<br/>')
# chatgpt_channel_id.with_user(user_id).message_post(body=res, message_type='comment', subtype_xmlid='mail.mt_comment', parent_id=message.id)
except Exception as e:
raise UserError(_(e))
return rdata

View File

@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2020-Present InTechual Solutions. (<https://intechualsolutions.com/>)
from odoo import fields, models
@@ -7,4 +6,8 @@ from odoo import fields, models
class ResConfigSettings(models.TransientModel):
_inherit = "res.config.settings"
openapi_context_timeout = fields.Integer(string="上下文连接超时", help="多少秒以内的聊天信息作为上下文继续", config_parameter="app_chatgpt.openapi_context_timeout")
openapi_context_timeout = fields.Integer(string="Connect Timout", help="多少秒以内的聊天信息作为上下文继续", config_parameter="app_chatgpt.openapi_context_timeout")
openai_sync_config = fields.Selection([
('sync', 'Synchronous'),
('async', 'Asynchronous')
], string='Sync Config', default='sync', config_parameter="app_chatgpt.openai_sync_config")