@h-ai/ai 1.0.0-beta.20 → 1.0.0-beta.22
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/dist/index.js +12 -6
- package/dist/index.js.map +1 -1
- package/models/agents/README.md +1 -1
- package/models/agents/codex-acp/Dockerfile +2 -1
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -13251,10 +13251,15 @@ function createRerankOperations(config) {
|
|
|
13251
13251
|
signal: AbortSignal.timeout(resolved.timeout)
|
|
13252
13252
|
});
|
|
13253
13253
|
if (!response.ok) {
|
|
13254
|
-
const
|
|
13255
|
-
|
|
13254
|
+
const requestId = response.headers.get("x-request-id");
|
|
13255
|
+
await response.body?.cancel().catch(() => {
|
|
13256
|
+
});
|
|
13257
|
+
logger27.error("Rerank API request failed", {
|
|
13258
|
+
status: response.status,
|
|
13259
|
+
providerRequestId: requestId && /^[\w.:-]{1,128}$/.test(requestId) ? requestId : void 0
|
|
13260
|
+
});
|
|
13256
13261
|
return err(HaiAIError.RERANK_API_ERROR, aiM("ai_rerankApiFailed", {
|
|
13257
|
-
params: { error: `HTTP ${response.status}
|
|
13262
|
+
params: { error: `HTTP ${response.status}` }
|
|
13258
13263
|
}));
|
|
13259
13264
|
}
|
|
13260
13265
|
const data = await response.json();
|
|
@@ -13267,10 +13272,11 @@ function createRerankOperations(config) {
|
|
|
13267
13272
|
logger27.trace("Rerank completed", { resultCount: results.length });
|
|
13268
13273
|
return ok({ model: resolved.model, results });
|
|
13269
13274
|
} catch (error) {
|
|
13270
|
-
|
|
13275
|
+
const causeName = error instanceof Error ? error.name : void 0;
|
|
13276
|
+
logger27.error("Rerank API call failed", { causeName });
|
|
13271
13277
|
return err(HaiAIError.RERANK_API_ERROR, aiM("ai_rerankApiFailed", {
|
|
13272
13278
|
params: {
|
|
13273
|
-
error:
|
|
13279
|
+
error: causeName ?? core.i18n.coreM("core_errorInternal")
|
|
13274
13280
|
}
|
|
13275
13281
|
}), error);
|
|
13276
13282
|
}
|
|
@@ -13451,7 +13457,7 @@ function createRetrievalOperations(embeddingOps, storeProvider, sourceStore, rer
|
|
|
13451
13457
|
const topK = request2.topK ?? 10;
|
|
13452
13458
|
const limitedItems = allItems.slice(0, topK);
|
|
13453
13459
|
const duration = Date.now() - startTime;
|
|
13454
|
-
logger28.trace("Retrieval completed", {
|
|
13460
|
+
logger28.trace("Retrieval completed", { queryLength: request2.query.length, resultCount: limitedItems.length, duration });
|
|
13455
13461
|
return ok({
|
|
13456
13462
|
items: limitedItems,
|
|
13457
13463
|
query: request2.query,
|