prepare #I92TI8 app_chatgpt升级到17.默认不队列 置顶

This commit is contained in:
Ivan Office
2024-03-28 02:04:54 +08:00
parent a69397835a
commit 369e7fd5ba
7 changed files with 60 additions and 21955 deletions

View File

@@ -1,64 +0,0 @@
/** @odoo-module **/
import { EmojiPicker } from "@web/core/emoji_picker/emoji_picker";
import { loader } from "@web/core/emoji_picker/emoji_picker";
patch(EmojiPicker.prototype, {
async loadEmoji() {
try {
await loader.loadEmoji();
return odoo.loader.modules.get("@web/core/emoji_picker/emoji_data");
} catch {
// Could be intentional (tour ended successfully while emoji still loading)
return {emojis: [], categories: []};
}
},
});
// import { insert } from '@mail/model/model_field_command';
// import { getBundle, loadBundle} from '@web/core/assets';
// import {registerPatch} from '@mail/model/model_core';
//
// registerPatch({
// name: 'EmojiRegistry',
// recordMethods: {
// async loadEmojiData() {
// this.update({isLoading: true});
// await getBundle('mail.assets_model_data').then(loadBundle);
// //优化 data 文件
// const {emojiCategoriesData, emojisData} = await odoo.runtimeImport("@app_chatgpt/models_data/emoji_data");
// if (!this.exists()) {
// return;
// }
// this._populateFromEmojiData(emojiCategoriesData, emojisData);
// },
// async _populateFromEmojiData(dataCategories, dataEmojis) {
// dataCategories.map(category => {
// const emojiCount = dataEmojis.reduce((acc, emoji) => emoji.category === category.name ? acc + 1 : acc, 0);
// this.update({
// dataCategories: insert({
// name: category.name,
// displayName: category.displayName,
// title: category.title,
// sortId: category.sortId,
// emojiCount,
// }),
// });
// });
// this.models['Emoji'].insert(dataEmojis.map(emojiData => ({
// codepoints: emojiData.codepoints,
// shortcodes: emojiData.shortcodes,
// emoticons: emojiData.emoticons,
// name: emojiData.name,
// keywords: emojiData.keywords,
// emojiDataCategory: {name: emojiData.category},
// })));
// this.update({
// isLoaded: true,
// isLoading: false,
// });
// },
// },
// }
// )

View File

@@ -1,13 +1,15 @@
/** @odoo-module **/
import { Message } from "@mail/core/common/message_model";
import { assignDefined } from "@mail/utils/common/misc";
import { patch } from "@web/core/utils/patch";
patch(Message, {
/** @type {number} */
human_prompt_tokens,
/** @type {number} */
ai_completion_tokens,
/** @type {boolean} */
is_ai,
// 参考模块 whatsapp
patch(Message.prototype, {
update(data) {
assignDefined(this, data, ["human_prompt_tokens", "ai_completion_tokens", "is_ai"]);
super.update(data);
},
});
//