omnius 1.0.544 → 1.0.545
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 +13 -10
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -609852,19 +609852,22 @@ ${description}`
|
|
|
609852
609852
|
const responseText2 = firstChoice ? String(firstChoice.message?.content ?? "") : "";
|
|
609853
609853
|
const outcome = this.recordThinkOutcome(responseText2, effectiveThink === true);
|
|
609854
609854
|
const independentOutcome = effectiveThink !== true ? classifyThinkOutcome(responseText2) : null;
|
|
609855
|
-
const
|
|
609855
|
+
const emptyIndependentOutcome = independentOutcome === "empty_after_strip" || independentOutcome === "unclosed_think";
|
|
609856
|
+
const expectsVisibleContent = responseFormat !== void 0 || (request.tools ?? []).length === 0;
|
|
609857
|
+
const shouldProbeNativeOnEmpty = expectsVisibleContent && emptyIndependentOutcome;
|
|
609858
|
+
const shouldRecoverFromEmpty = request.disableEmptyContentRecovery !== true && shouldProbeNativeOnEmpty;
|
|
609856
609859
|
const justSuppressed = this._thinkSuppressed && this._thinkFailStreak === _OllamaAgenticBackend._thinkFailThreshold;
|
|
609857
609860
|
const shouldRetryThinkGuard = outcome !== null && effectiveThink === true && (justSuppressed || outcome === "empty_after_strip" || outcome === "unclosed_think");
|
|
609858
|
-
if (
|
|
609859
|
-
|
|
609860
|
-
|
|
609861
|
-
|
|
609862
|
-
|
|
609863
|
-
|
|
609864
|
-
|
|
609865
|
-
} catch {
|
|
609866
|
-
}
|
|
609861
|
+
if (shouldProbeNativeOnEmpty) {
|
|
609862
|
+
try {
|
|
609863
|
+
const _native = await this.nativeOllamaChatCompletion(request);
|
|
609864
|
+
const _nText = String(_native.choices?.[0]?.message?.content ?? "");
|
|
609865
|
+
if (_nText.trim().length >= 2)
|
|
609866
|
+
return _native;
|
|
609867
|
+
} catch {
|
|
609867
609868
|
}
|
|
609869
|
+
}
|
|
609870
|
+
if (shouldRetryThinkGuard || shouldRecoverFromEmpty) {
|
|
609868
609871
|
const retryMessages = injectNoThinkDirective(requestMessages);
|
|
609869
609872
|
const retryBody = {
|
|
609870
609873
|
model: this.model,
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "omnius",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.545",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "omnius",
|
|
9
|
-
"version": "1.0.
|
|
9
|
+
"version": "1.0.545",
|
|
10
10
|
"bundleDependencies": [
|
|
11
11
|
"image-to-ascii"
|
|
12
12
|
],
|
package/package.json
CHANGED