Merge remote-tracking branch 'origin/18.0' into 18.0

This commit is contained in:
Ivan Office
2025-01-06 21:25:54 +08:00
4 changed files with 22 additions and 28 deletions

View File

@@ -10,7 +10,7 @@
{
'name': 'ChatGPT4, China Ali,AiGC Center.Ai服务中心聚合全网Ai',
'version': '18.0.24.12.26',
'version': '18.0.25.01.06',
'author': 'odooai.cn',
'company': 'odooai.cn',
'maintainer': 'odooai.cn',

View File

@@ -3,6 +3,7 @@
import openai
import requests, json
import datetime
from markupsafe import Markup
# from transformers import TextDavinciTokenizer, TextDavinciModel
from odoo import api, fields, models, tools, _
from odoo.exceptions import UserError
@@ -126,7 +127,7 @@ class Channel(models.Model):
'content': ai_content,
})
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, {
'role': 'user',
'content': user_content,
@@ -147,6 +148,7 @@ class Channel(models.Model):
if get_ua_type() != 'wxweb':
# 处理当微信语音返回时,是直接回文本信息,不需要转换回车
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)
if usage:
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
else:
# 不能用 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()
if not msg:
@@ -318,7 +320,7 @@ class Channel(models.Model):
# else:
# self.with_delay().get_ai_response(ai, messages, channel, user_id, message)
except Exception as e:
raise UserError(_(e))
raise UserError(e)
return rdata

View File

@@ -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>
<h3 class="oe_slogan"> Support chatgpt 4 32k. 3.5 turbo, text-davinci, Integration All ChatGpt Api. </h3>
<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">
Add Alibaba Qwen support(search 'app_ai_ali'), update chatgpt api

View File

@@ -31,31 +31,23 @@
<field name="image_avatar"/>
<field name="active"/>
<templates>
<t t-name="card">
<div class="oe_kanban_card oe_kanban_global_click">
<div class="o_kanban_image me-1">
<img t-att-src="kanban_image('ai.robot', 'image_avatar', record.id.raw_value)" alt="Robot Provider" class="o_image_64_contain"/>
<t t-name="card" class="flex-row">
<aside class="col-2 my-auto">
<field name="image_avatar" widget="image" options="{'size': [50, 50]}" alt="Channel"/>
</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 class="oe_kanban_details">
<div class="o_kanban_record_top mb-0">
<div class="o_kanban_record_headings">
<strong class="o_kanban_record_title">
<field name="name"/>
</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 class="mt-1">
<strong>
<t t-esc="record.partner_count.value"/>
</strong>
Bind Partner
</div>
</div>
</main>
</t>
</templates>
</kanban>