@xuda.io/ai_module 1.1.4812 → 1.1.4814
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 +8 -5
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -2525,10 +2525,12 @@ const upload_agent_files = async function (uid, agent_doc) {
|
|
|
2525
2525
|
tool.youtube.file_id = uploadedFile.id;
|
|
2526
2526
|
|
|
2527
2527
|
if (!tool.youtube.vector_file_id) {
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2528
|
+
try {
|
|
2529
|
+
const ret = await client.vectorStores.files.create(_conf.OPENAI_VECTOR_STORE_ID, {
|
|
2530
|
+
file_id: tool.youtube.file_id,
|
|
2531
|
+
});
|
|
2532
|
+
tool.youtube.vector_store_id = ret.vector_store_id;
|
|
2533
|
+
} catch (error) {}
|
|
2532
2534
|
}
|
|
2533
2535
|
await save_agent_status(uid, agent_doc._id, 3, agentConfig);
|
|
2534
2536
|
|
|
@@ -3020,11 +3022,12 @@ const transcribe = async function (uid, stream, metadata, account_profile_info)
|
|
|
3020
3022
|
language: 'en', // hint language (ISO 639-1), e.g. "he" for Hebrew
|
|
3021
3023
|
// temperature: 0 // lower = more literal
|
|
3022
3024
|
});
|
|
3025
|
+
report_ai_status(model);
|
|
3023
3026
|
account_module.record_ai_usage(uid, 0, resp.length || 0, 'transcribe', '', model, metadata, account_profile_info);
|
|
3024
3027
|
// console.log(resp); // or resp for JSON formats
|
|
3025
3028
|
return resp;
|
|
3026
3029
|
} catch (error) {
|
|
3027
|
-
|
|
3030
|
+
report_ai_status(model, error);
|
|
3028
3031
|
debugger;
|
|
3029
3032
|
}
|
|
3030
3033
|
};
|