browser-assistant 2.9.4 → 2.9.5
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/extension/manifest.json +1 -1
- package/package.json +1 -1
- package/server/main.py +1 -1
- package/server/vision_images.py +13 -1
package/extension/manifest.json
CHANGED
package/package.json
CHANGED
package/server/main.py
CHANGED
|
@@ -191,7 +191,7 @@ async def lifespan(_app: FastAPI):
|
|
|
191
191
|
client.close()
|
|
192
192
|
|
|
193
193
|
|
|
194
|
-
app = FastAPI(title="Browser Assistant API", version="2.9.
|
|
194
|
+
app = FastAPI(title="Browser Assistant API", version="2.9.5", lifespan=lifespan)
|
|
195
195
|
install_local_guards(app)
|
|
196
196
|
|
|
197
197
|
@app.exception_handler(HTTPException)
|
package/server/vision_images.py
CHANGED
|
@@ -469,8 +469,20 @@ async def cross_check_text_answers(messages, results, complete, *, question_text
|
|
|
469
469
|
'role': 'user',
|
|
470
470
|
'content': 'Solve again using the original question and options. Return the full verification JSON with the required ids.',
|
|
471
471
|
}]
|
|
472
|
+
# When both independent verifications failed to parse, prefer delivering the
|
|
473
|
+
# primary answer over blocking the automation entirely. The primary solve was
|
|
474
|
+
# validated and the verification provider returned unusable JSON — a parsing
|
|
475
|
+
# failure, not a disagreement — so a hard 422 is disproportionate.
|
|
472
476
|
if current is None and previous is None:
|
|
473
|
-
|
|
477
|
+
return results
|
|
478
|
+
# For multi-answer questions (fill-in-the-blank), accept the primary answers
|
|
479
|
+
# when the majority of individual answers agree with any independent solve.
|
|
480
|
+
if not choices and first is not None and len(first) > 1:
|
|
481
|
+
best = current or previous
|
|
482
|
+
if best is not None:
|
|
483
|
+
agreed = sum(a == b for a, b in zip(first, best))
|
|
484
|
+
if agreed > len(first) // 2:
|
|
485
|
+
return results
|
|
474
486
|
raise VisionUnconfirmedError('The independent solves could not agree on the displayed answer.')
|
|
475
487
|
|
|
476
488
|
|