@ax-llm/ax 11.0.53 → 11.0.54
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.cjs +1 -76
- package/index.cjs.map +1 -1
- package/index.d.cts +1 -69
- package/index.d.ts +1 -69
- package/index.js +1 -75
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.cjs
CHANGED
|
@@ -75,7 +75,6 @@ __export(index_exports, {
|
|
|
75
75
|
AxAIServiceStreamTerminatedError: () => AxAIServiceStreamTerminatedError,
|
|
76
76
|
AxAIServiceTimeoutError: () => AxAIServiceTimeoutError,
|
|
77
77
|
AxAITogether: () => AxAITogether,
|
|
78
|
-
AxAbortableAI: () => AxAbortableAI,
|
|
79
78
|
AxAgent: () => AxAgent,
|
|
80
79
|
AxApacheTika: () => AxApacheTika,
|
|
81
80
|
AxAssertionError: () => AxAssertionError,
|
|
@@ -3411,7 +3410,7 @@ var AxAIGoogleGeminiImpl = class {
|
|
|
3411
3410
|
candidateCount: 1,
|
|
3412
3411
|
stopSequences: req.modelConfig?.stopSequences ?? this.config.stopSequences,
|
|
3413
3412
|
responseMimeType: "text/plain",
|
|
3414
|
-
...thinkingConfig ? { thinkingConfig } : {}
|
|
3413
|
+
...Object.keys(thinkingConfig).length > 0 ? { thinkingConfig } : {}
|
|
3415
3414
|
};
|
|
3416
3415
|
const safetySettings2 = this.config.safetySettings;
|
|
3417
3416
|
const reqValue = {
|
|
@@ -11642,79 +11641,6 @@ var AxTestPrompt = class {
|
|
|
11642
11641
|
}
|
|
11643
11642
|
};
|
|
11644
11643
|
|
|
11645
|
-
// ai/abortable.ts
|
|
11646
|
-
var AxAbortableAI = class {
|
|
11647
|
-
abortController;
|
|
11648
|
-
ai;
|
|
11649
|
-
constructor(ai) {
|
|
11650
|
-
this.ai = ai;
|
|
11651
|
-
this.abortController = new AbortController();
|
|
11652
|
-
}
|
|
11653
|
-
/**
|
|
11654
|
-
* Get the current abort signal
|
|
11655
|
-
*/
|
|
11656
|
-
get signal() {
|
|
11657
|
-
return this.abortController.signal;
|
|
11658
|
-
}
|
|
11659
|
-
/**
|
|
11660
|
-
* Check if the request has been aborted
|
|
11661
|
-
*/
|
|
11662
|
-
get aborted() {
|
|
11663
|
-
return this.abortController.signal.aborted;
|
|
11664
|
-
}
|
|
11665
|
-
/**
|
|
11666
|
-
* Abort the ongoing request
|
|
11667
|
-
* @param reason Optional reason for the abort
|
|
11668
|
-
*/
|
|
11669
|
-
abort(reason) {
|
|
11670
|
-
this.abortController.abort(reason);
|
|
11671
|
-
}
|
|
11672
|
-
/**
|
|
11673
|
-
* Reset the abort controller to allow new requests
|
|
11674
|
-
* This creates a new AbortController, allowing fresh requests
|
|
11675
|
-
*/
|
|
11676
|
-
reset() {
|
|
11677
|
-
this.abortController = new AbortController();
|
|
11678
|
-
}
|
|
11679
|
-
/**
|
|
11680
|
-
* Send a chat request with abort support
|
|
11681
|
-
*/
|
|
11682
|
-
async chat(req, options) {
|
|
11683
|
-
return this.ai.chat(req, {
|
|
11684
|
-
...options,
|
|
11685
|
-
abortSignal: this.abortController.signal
|
|
11686
|
-
});
|
|
11687
|
-
}
|
|
11688
|
-
/**
|
|
11689
|
-
* Send an embed request with abort support
|
|
11690
|
-
*/
|
|
11691
|
-
async embed(req, options) {
|
|
11692
|
-
return this.ai.embed(req, {
|
|
11693
|
-
...options,
|
|
11694
|
-
abortSignal: this.abortController.signal
|
|
11695
|
-
});
|
|
11696
|
-
}
|
|
11697
|
-
/**
|
|
11698
|
-
* Create a timeout-based abort after specified milliseconds
|
|
11699
|
-
* @param timeoutMs Timeout in milliseconds
|
|
11700
|
-
* @param reason Optional reason for the timeout abort
|
|
11701
|
-
* @returns Timeout ID that can be cleared
|
|
11702
|
-
*/
|
|
11703
|
-
abortAfter(timeoutMs, reason = "Request timeout") {
|
|
11704
|
-
return setTimeout(() => {
|
|
11705
|
-
this.abort(reason);
|
|
11706
|
-
}, timeoutMs);
|
|
11707
|
-
}
|
|
11708
|
-
/**
|
|
11709
|
-
* Add an event listener for abort events
|
|
11710
|
-
*/
|
|
11711
|
-
onAbort(callback) {
|
|
11712
|
-
this.abortController.signal.addEventListener("abort", () => {
|
|
11713
|
-
callback(this.abortController.signal.reason);
|
|
11714
|
-
});
|
|
11715
|
-
}
|
|
11716
|
-
};
|
|
11717
|
-
|
|
11718
11644
|
// prompts/cot.ts
|
|
11719
11645
|
var AxChainOfThought = class extends AxGen {
|
|
11720
11646
|
constructor(signature, options) {
|
|
@@ -13617,7 +13543,6 @@ var AxRAG = class extends AxChainOfThought {
|
|
|
13617
13543
|
AxAIServiceStreamTerminatedError,
|
|
13618
13544
|
AxAIServiceTimeoutError,
|
|
13619
13545
|
AxAITogether,
|
|
13620
|
-
AxAbortableAI,
|
|
13621
13546
|
AxAgent,
|
|
13622
13547
|
AxApacheTika,
|
|
13623
13548
|
AxAssertionError,
|