mirror of
https://github.com/guohuadeng/app-odoo.git
synced 2025-02-23 04:11:36 +02:00
Merge branch '16.0' of https://github.com/guohuadeng/app-odoo into 16.0
This commit is contained in:
@@ -204,15 +204,28 @@ GPT-3 A set of models that can understand and generate natural language
|
||||
# azure 格式
|
||||
usage = json.loads(json.dumps(res['usage']))
|
||||
content = json.loads(json.dumps(res['choices'][0]['message']['content']))
|
||||
elif self.provider == 'ali':
|
||||
# ali 格式
|
||||
usage = res['usage']
|
||||
content = res['output']['text']
|
||||
elif self.provider == 'baidu':
|
||||
# baidu 格式
|
||||
usage = res['usage']
|
||||
content = res['result']
|
||||
else:
|
||||
usage = False
|
||||
content = res
|
||||
data = content.replace(' .', '.').strip()
|
||||
answer_user = answer_id.mapped('user_ids')[:1]
|
||||
if usage:
|
||||
prompt_tokens = usage['prompt_tokens']
|
||||
completion_tokens = usage['completion_tokens']
|
||||
total_tokens = usage['total_tokens']
|
||||
if self.provider == 'ali':
|
||||
prompt_tokens = usage['input_tokens']
|
||||
completion_tokens = usage['output_tokens']
|
||||
total_tokens = usage['input_tokens'] + usage['output_tokens']
|
||||
else:
|
||||
prompt_tokens = usage['prompt_tokens']
|
||||
completion_tokens = usage['completion_tokens']
|
||||
total_tokens = usage['total_tokens']
|
||||
# 不是写到 user ,是要写到指定 m2m 相关模型, 如: res.partner.ai.use
|
||||
ai_use = self.env['res.partner.ai.use'].search([('name', '=', author_id.id)], limit=1)
|
||||
ask_date = fields.Datetime.now()
|
||||
|
||||
@@ -152,9 +152,14 @@ class Channel(models.Model):
|
||||
res = res.replace('\n', '<br/>')
|
||||
new_msg = channel.with_user(user_id).message_post(body=res, message_type='comment', subtype_xmlid='mail.mt_comment', parent_id=message.id)
|
||||
if usage:
|
||||
prompt_tokens = usage['prompt_tokens']
|
||||
completion_tokens = usage['completion_tokens']
|
||||
total_tokens = usage['total_tokens']
|
||||
if ai.provider == 'ali':
|
||||
prompt_tokens = usage['input_tokens']
|
||||
completion_tokens = usage['output_tokens']
|
||||
total_tokens = usage['input_tokens'] + usage['output_tokens']
|
||||
else:
|
||||
prompt_tokens = usage['prompt_tokens']
|
||||
completion_tokens = usage['completion_tokens']
|
||||
total_tokens = usage['total_tokens']
|
||||
new_msg.write({
|
||||
'human_prompt_tokens': prompt_tokens,
|
||||
'ai_completion_tokens': completion_tokens,
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
# description:
|
||||
|
||||
{
|
||||
'name': 'odoo Tweak,Boost,Customize,Ai All in One. Customize,UI,Boost,Security,Data,Development Enhance',
|
||||
'version': '16.23.08.28',
|
||||
'name': 'odoo Ai Employee,Tweak,Boost,Customize,Ai All in One. Customize,UI,Boost,Security,Data,Development Enhance',
|
||||
'version': '16.23.09.17',
|
||||
'author': 'odooai.cn',
|
||||
'category': 'Extra Tools',
|
||||
'website': 'https://www.odooai.cn',
|
||||
@@ -32,9 +32,9 @@
|
||||
'sequence': 2,
|
||||
'images': ['static/description/banner.gif'],
|
||||
'summary': """
|
||||
1 click Tweak odoo. 45 Functions odoo enhancement. for Customize, UI, Boost, Security, Development.
|
||||
Ai as employee. 1 click Tweak odoo. 48 Functions odoo enhancement. for Customize, UI, Boost, Security, Development.
|
||||
Easy reset data, clear data, reset account chart, reset Demo data.
|
||||
For quick debug. Set brand, Language Switcher. odoo improve all.
|
||||
For quick debug. Set brand, Language Switcher all in one.
|
||||
""",
|
||||
'depends': [
|
||||
'app_common',
|
||||
@@ -140,6 +140,7 @@
|
||||
44. Check to stop subscribe and follow. This to make odoo speed up.
|
||||
45. Add addons path info to module.
|
||||
46. Add Help documentation anywhere. easy get help for any odoo operation or action.
|
||||
47. Add ai robot app integration. Use Ai as your employee.
|
||||
|
||||
This module can help to white label the Odoo.
|
||||
Also helpful for training and support for your odoo end-user.
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 450 KiB After Width: | Height: | Size: 502 KiB |
BIN
app_odoo_customize/static/description/banner_ai.png
Normal file
BIN
app_odoo_customize/static/description/banner_ai.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 563 KiB |
Reference in New Issue
Block a user