@xuda.io/ai_module 1.1.3862 → 1.1.3864
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 -3
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -3984,7 +3984,7 @@ export const delete_prompt_attachment = async function (req, job_id, headers, fi
|
|
|
3984
3984
|
};
|
|
3985
3985
|
|
|
3986
3986
|
export const submit_chat_gpt_prompt = async function (req) {
|
|
3987
|
-
const { model = 'gpt-5-mini', prompt, response_format, uid } = req;
|
|
3987
|
+
const { model = 'gpt-5-mini', prompt, response_format, uid,metadata={} } = req;
|
|
3988
3988
|
|
|
3989
3989
|
let formattedParams;
|
|
3990
3990
|
if (response_format) {
|
|
@@ -3999,7 +3999,7 @@ export const submit_chat_gpt_prompt = async function (req) {
|
|
|
3999
3999
|
format: formattedParams,
|
|
4000
4000
|
},
|
|
4001
4001
|
});
|
|
4002
|
-
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;
|
|
4003
4003
|
return { code: 5, data: response.output_text };
|
|
4004
4004
|
} catch (err) {
|
|
4005
4005
|
return { code: -5, data: err.message };
|
|
@@ -4059,7 +4059,7 @@ export const create_conversation = async function (req, job_id, headers) {
|
|
|
4059
4059
|
|
|
4060
4060
|
setTimeout(async () => {
|
|
4061
4061
|
// Ask GPT for title
|
|
4062
|
-
const title = await submit_chat_gpt_prompt({ uid, prompt: `create title for the prompt return 5 words result maximum text only without options : ${prompt}`, model: 'gpt-5-nano', metadata: { conversation_id: conversation_doc._id } });
|
|
4062
|
+
const title = await submit_chat_gpt_prompt({ uid, prompt: `create title for the prompt return 5 words result maximum text only without options : ${prompt}`, model: 'gpt-5-nano', metadata: { conversation_id: conversation_doc._id,func:"create_conversation" } });
|
|
4063
4063
|
|
|
4064
4064
|
conversation_doc = await db_module.get_app_couch_doc_native(app_id, conversation_obj.id);
|
|
4065
4065
|
conversation_doc.title = title.data;
|