@xuda.io/ai_module 1.1.3861 → 1.1.3863
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 +3 -2
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -3110,6 +3110,7 @@ export const update_ai_agent_properties = async function (doc, app_id, uid) {
|
|
|
3110
3110
|
“${doc.properties.menuName}” choose only one from the list:
|
|
3111
3111
|
Artificial Intelligence,SaaS,Fintech,Healthtech,Edtech,Blockchain/Crypto,Cybersecurity,Gaming,Consulting,Marketing & Advertising,Human Resources,Legal Services,Real Estate,E-commerce,Retail,Fashion & Apparel,Consumer Goods,Healthcare,Medical,Pharmaceutical,Banking,Insurance,Investment,Manufacturing,Logistics & Supply Chain,Construction,Energy,Media,Entertainment,Sports,Education,Travel & Hospitality,Food & Beverage,Non-Profit,Government,Agriculture,Automotive,Telecommunications`,
|
|
3112
3112
|
model: 'gpt-5-nano',
|
|
3113
|
+
metadata: { agent_id: db_doc._id, func: 'get_agent_industry' },
|
|
3113
3114
|
});
|
|
3114
3115
|
|
|
3115
3116
|
return ret.data;
|
|
@@ -3983,7 +3984,7 @@ export const delete_prompt_attachment = async function (req, job_id, headers, fi
|
|
|
3983
3984
|
};
|
|
3984
3985
|
|
|
3985
3986
|
export const submit_chat_gpt_prompt = async function (req) {
|
|
3986
|
-
const { model = 'gpt-5-mini', prompt, response_format, uid } = req;
|
|
3987
|
+
const { model = 'gpt-5-mini', prompt, response_format, uid,metadata={} } = req;
|
|
3987
3988
|
|
|
3988
3989
|
let formattedParams;
|
|
3989
3990
|
if (response_format) {
|
|
@@ -3998,7 +3999,7 @@ export const submit_chat_gpt_prompt = async function (req) {
|
|
|
3998
3999
|
format: formattedParams,
|
|
3999
4000
|
},
|
|
4000
4001
|
});
|
|
4001
|
-
record_chat_usage(uid, response.usage.input_tokens, response.usage.output_tokens, 'submit chat', prompt, model
|
|
4002
|
+
record_chat_usage(uid, response.usage.input_tokens, response.usage.output_tokens, 'submit chat', prompt, model,metadata;
|
|
4002
4003
|
return { code: 5, data: response.output_text };
|
|
4003
4004
|
} catch (err) {
|
|
4004
4005
|
return { code: -5, data: err.message };
|