@xuda.io/ai_module 1.1.4830 → 1.1.4832
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 +15 -8
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -3360,15 +3360,22 @@ export const submit_chat_gpt_prompt = async function (req) {
|
|
|
3360
3360
|
}
|
|
3361
3361
|
|
|
3362
3362
|
try {
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
|
|
3363
|
+
let response;
|
|
3364
|
+
try {
|
|
3365
|
+
response = await client.responses.create({
|
|
3366
|
+
model,
|
|
3367
|
+
input: prompt,
|
|
3368
|
+
tools,
|
|
3367
3369
|
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
|
|
3370
|
+
text: {
|
|
3371
|
+
format: formattedParams,
|
|
3372
|
+
},
|
|
3373
|
+
});
|
|
3374
|
+
report_ai_status(model);
|
|
3375
|
+
} catch (err) {
|
|
3376
|
+
report_ai_status(model, err);
|
|
3377
|
+
throw err;
|
|
3378
|
+
}
|
|
3372
3379
|
account_module.record_ai_usage(uid, response.usage.input_tokens, response.usage.output_tokens, 'submit chat', prompt, model, metadata, account_profile_info, tools);
|
|
3373
3380
|
return { code: 5, data: response.output_text };
|
|
3374
3381
|
} catch (err) {
|