@ynhcj/xiaoyi-channel 0.0.147-beta → 0.0.149-beta
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.
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// Image Reading tool implementation
|
|
2
|
+
import { createHash } from "crypto";
|
|
2
3
|
import { XYFileUploadService } from "../file-upload.js";
|
|
3
4
|
import fetch from "node-fetch";
|
|
4
5
|
import fs from "fs/promises";
|
|
@@ -52,7 +53,7 @@ async function processImageInput(imageInput, uploadService) {
|
|
|
52
53
|
*/
|
|
53
54
|
async function callImageUnderstandingAPI(imageUrls, text, apiKey, uid, fileUploadUrl) {
|
|
54
55
|
const apiUrl = `${fileUploadUrl}/celia-claw/v1/sse-api/skill/execute`;
|
|
55
|
-
const traceId =
|
|
56
|
+
const traceId = `${createHash("sha256").update(uid).digest("hex").slice(0, 32)}_${Date.now()}`;
|
|
56
57
|
const headers = {
|
|
57
58
|
"Content-Type": "application/json",
|
|
58
59
|
"Accept": "text/event-stream",
|
|
@@ -60,7 +61,7 @@ async function callImageUnderstandingAPI(imageUrls, text, apiKey, uid, fileUploa
|
|
|
60
61
|
"x-api-key": apiKey,
|
|
61
62
|
"x-request-from": "openclaw",
|
|
62
63
|
"x-uid": uid,
|
|
63
|
-
"x-skill-id": "
|
|
64
|
+
"x-skill-id": "xiaoyi_image_comprehension",
|
|
64
65
|
"x-prd-pkg-name": "com.huawei.hag",
|
|
65
66
|
};
|
|
66
67
|
const payload = {
|