mirror of
https://github.com/guohuadeng/app-odoo.git
synced 2025-02-23 04:11:36 +02:00
Merge remote-tracking branch 'origin/18.0' into 18.0
This commit is contained in:
@@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
{
|
{
|
||||||
'name': 'ChatGPT4, China Ali,AiGC Center.Ai服务中心,聚合全网Ai',
|
'name': 'ChatGPT4, China Ali,AiGC Center.Ai服务中心,聚合全网Ai',
|
||||||
'version': '18.0.24.12.26',
|
'version': '18.0.25.01.06',
|
||||||
'author': 'odooai.cn',
|
'author': 'odooai.cn',
|
||||||
'company': 'odooai.cn',
|
'company': 'odooai.cn',
|
||||||
'maintainer': 'odooai.cn',
|
'maintainer': 'odooai.cn',
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
import openai
|
import openai
|
||||||
import requests, json
|
import requests, json
|
||||||
import datetime
|
import datetime
|
||||||
|
from markupsafe import Markup
|
||||||
# from transformers import TextDavinciTokenizer, TextDavinciModel
|
# from transformers import TextDavinciTokenizer, TextDavinciModel
|
||||||
from odoo import api, fields, models, tools, _
|
from odoo import api, fields, models, tools, _
|
||||||
from odoo.exceptions import UserError
|
from odoo.exceptions import UserError
|
||||||
@@ -126,7 +127,7 @@ class Channel(models.Model):
|
|||||||
'content': ai_content,
|
'content': ai_content,
|
||||||
})
|
})
|
||||||
if not user_msg.author_id.gpt_id:
|
if not user_msg.author_id.gpt_id:
|
||||||
user_content = user_msg.description.replace("<p>", "").replace("</p>", "").replace('@%s' % answer_id.name, '').lstrip()
|
user_content = user_msg.body.replace("<p>", "").replace("</p>", "").replace('@%s' % answer_id.name, '').lstrip()
|
||||||
context_history.insert(0, {
|
context_history.insert(0, {
|
||||||
'role': 'user',
|
'role': 'user',
|
||||||
'content': user_content,
|
'content': user_content,
|
||||||
@@ -147,6 +148,7 @@ class Channel(models.Model):
|
|||||||
if get_ua_type() != 'wxweb':
|
if get_ua_type() != 'wxweb':
|
||||||
# 处理当微信语音返回时,是直接回文本信息,不需要转换回车
|
# 处理当微信语音返回时,是直接回文本信息,不需要转换回车
|
||||||
res = res.replace('\n', '<br/>')
|
res = res.replace('\n', '<br/>')
|
||||||
|
res = Markup(res)
|
||||||
new_msg = channel.with_user(user_id).message_post(body=res, message_type='comment', subtype_xmlid='mail.mt_comment', parent_id=message.id)
|
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:
|
if usage:
|
||||||
if ai.provider == 'ali':
|
if ai.provider == 'ali':
|
||||||
@@ -246,7 +248,7 @@ class Channel(models.Model):
|
|||||||
msg = _("Please warmly welcome our new partner %s and send him the best wishes.") % message.author_id.name
|
msg = _("Please warmly welcome our new partner %s and send him the best wishes.") % message.author_id.name
|
||||||
else:
|
else:
|
||||||
# 不能用 preview, 如果用 : 提示词则 preview信息丢失
|
# 不能用 preview, 如果用 : 提示词则 preview信息丢失
|
||||||
plaintext_ct = tools.html_to_inner_content(message.body)
|
plaintext_ct = tools.mail.html_to_inner_content(message.body)
|
||||||
msg = plaintext_ct.replace('@%s' % answer_id.name, '').lstrip()
|
msg = plaintext_ct.replace('@%s' % answer_id.name, '').lstrip()
|
||||||
|
|
||||||
if not msg:
|
if not msg:
|
||||||
@@ -318,7 +320,7 @@ class Channel(models.Model):
|
|||||||
# else:
|
# else:
|
||||||
# self.with_delay().get_ai_response(ai, messages, channel, user_id, message)
|
# self.with_delay().get_ai_response(ai, messages, channel, user_id, message)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
raise UserError(_(e))
|
raise UserError(e)
|
||||||
|
|
||||||
return rdata
|
return rdata
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<h2 class="oe_slogan"> Latest ChatGPT AI Center. GPT 3.5, Ali Ai, Baidu Ai, Multi Robot Support. Chat and Training </h2>
|
<h2 class="oe_slogan"> Latest ChatGPT AI Center. GPT 3.5, Ali Ai, Baidu Ai, Multi Robot Support. Chat and Training </h2>
|
||||||
<h3 class="oe_slogan"> Support chatgpt 4 32k. 3.5 turbo, text-davinci, Integration All ChatGpt Api. </h3>
|
<h3 class="oe_slogan"> Support chatgpt 4 32k. 3.5 turbo, text-davinci, Integration All ChatGpt Api. </h3>
|
||||||
<div class="oe_row">
|
<div class="oe_row">
|
||||||
<h3>Latest update: v18.24.12.26</h3>
|
<h3>Latest update: v18.25.01.06</h3>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
Add Alibaba Qwen support(search 'app_ai_ali'), update chatgpt api
|
Add Alibaba Qwen support(search 'app_ai_ali'), update chatgpt api
|
||||||
|
|||||||
@@ -31,31 +31,23 @@
|
|||||||
<field name="image_avatar"/>
|
<field name="image_avatar"/>
|
||||||
<field name="active"/>
|
<field name="active"/>
|
||||||
<templates>
|
<templates>
|
||||||
<t t-name="card">
|
<t t-name="card" class="flex-row">
|
||||||
<div class="oe_kanban_card oe_kanban_global_click">
|
<aside class="col-2 my-auto">
|
||||||
<div class="o_kanban_image me-1">
|
<field name="image_avatar" widget="image" options="{'size': [50, 50]}" alt="Channel"/>
|
||||||
<img t-att-src="kanban_image('ai.robot', 'image_avatar', record.id.raw_value)" alt="Robot Provider" class="o_image_64_contain"/>
|
</aside>
|
||||||
|
<main class="col me-4 ms-2">
|
||||||
|
<span class="fw-bold fs-5"><field name="name"/></span>
|
||||||
|
<div class="mt-3">
|
||||||
|
Model:
|
||||||
|
<field name="ai_model"/>
|
||||||
</div>
|
</div>
|
||||||
<div class="oe_kanban_details">
|
<div class="mt-1">
|
||||||
<div class="o_kanban_record_top mb-0">
|
<strong>
|
||||||
<div class="o_kanban_record_headings">
|
<t t-esc="record.partner_count.value"/>
|
||||||
<strong class="o_kanban_record_title">
|
</strong>
|
||||||
<field name="name"/>
|
Bind Partner
|
||||||
</strong>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="mt-3">
|
|
||||||
Model:
|
|
||||||
<field name="ai_model"/>
|
|
||||||
</div>
|
|
||||||
<div class="mt-1">
|
|
||||||
<strong>
|
|
||||||
<t t-esc="record.partner_count.value"/>
|
|
||||||
</strong>
|
|
||||||
Bind Partner
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</main>
|
||||||
</t>
|
</t>
|
||||||
</templates>
|
</templates>
|
||||||
</kanban>
|
</kanban>
|
||||||
|
|||||||
Reference in New Issue
Block a user