@xuda.io/ai_module 1.1.4984 → 1.1.4986
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.mjs +5 -3
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -3508,7 +3508,7 @@ const process_conversation = async function (uid, conversation_id, account_profi
|
|
|
3508
3508
|
}
|
|
3509
3509
|
/// categorize prompt
|
|
3510
3510
|
let category_info = {};
|
|
3511
|
-
if (prompt?.length >
|
|
3511
|
+
if (prompt?.length > 1) {
|
|
3512
3512
|
switch (conversation_type) {
|
|
3513
3513
|
case 'ai': {
|
|
3514
3514
|
category_info = await categorize_ai_prompt(uid, prompt, account_profile_info);
|
|
@@ -3534,6 +3534,8 @@ const process_conversation = async function (uid, conversation_id, account_profi
|
|
|
3534
3534
|
category_info = { category: 'unknown' };
|
|
3535
3535
|
break;
|
|
3536
3536
|
}
|
|
3537
|
+
} else {
|
|
3538
|
+
category_info.category = 'unknown';
|
|
3537
3539
|
}
|
|
3538
3540
|
|
|
3539
3541
|
conversation_doc = await db_module.get_app_couch_doc_native(account_profile_info.app_id, conversation_doc._id);
|
|
@@ -3933,8 +3935,8 @@ const chat_email = async function (req, job_id, headers) {
|
|
|
3933
3935
|
const ai_chat_conversation = async function (req, job_id, headers) {
|
|
3934
3936
|
const { uid, gtp_token, profile_id } = req;
|
|
3935
3937
|
const account_profile_info = await get_active_account_profile_info(uid, profile_id);
|
|
3936
|
-
let { prompt, conversation_doc, attachments = [], ai_agents, output_format = 'md', stream = true, with_context = true,
|
|
3937
|
-
|
|
3938
|
+
let { prompt, conversation_doc, attachments = [], ai_agents, output_format = 'md', stream = true, with_context = true, ai_model = _conf.default_ai_model } = req;
|
|
3939
|
+
let model = ai_model;
|
|
3938
3940
|
if (!_conf.ai_models[model]) {
|
|
3939
3941
|
throw new Error('model not supported');
|
|
3940
3942
|
}
|