openvibers/openvibe.codes Commits

Goals: ask AI for a low-effort verdict inside the synchronous wait (#425)

OP OpenVibers committed 1 days ago · 8748536de0 · 2 files, +4 −0

* Goals: give the independent verifier room for a reasoning answer

* Goals: ask AI for a low-effort verdict inside the synchronous wait

* Merge remote-tracking branch 'origin/main' into leftovers-b-1111-codes

# Conflicts:
#	server/domain/goal-verifier.js
#	test/goal-verifier.test.js

Changes

ddiff --git a/server/domain/goal-verifier.js b/server/domain/goal-verifier.js
iindex 9879abd..8706304 100644
---- a/server/domain/goal-verifier.js
++++ b/server/domain/goal-verifier.js
@@@ -23,6 +23,8 @@ const { verify } = require('../../engine/goal');
const DEFAULT_MODEL = 'deepseek-chat';
/** Room for the answer plus a reasoning model's thinking: 300 left AI's reasoning models with no content. */
const MAX_ANSWER_TOKENS = 800;
++/** A short verdict needs no long deliberation; "low" keeps the reasoning model inside the synchronous wait. */
++const REASONING_EFFORT = 'low';
/** The answer's text from either dialect OpenVibe.AI speaks. */
function answerText(doc) {
@@@ -60,6 +62,7 @@ function createGoalVerifier({ config = {}, fetchImpl = globalThis.fetch, log = c
};
let { res, doc } = await ask('/v1/chat/completions', {
model, messages: [{ role: 'user', content: prompt }], temperature: 0, max_tokens: MAX_ANSWER_TOKENS,
++ reasoning_effort: REASONING_EFFORT,
});
if (res && res.status === 404) {
({ res, doc } = await ask('/v1/messages', {
ddiff --git a/test/goal-verifier.test.js b/test/goal-verifier.test.js
iindex d54a8c4..4fdcf06 100644
---- a/test/goal-verifier.test.js
++++ b/test/goal-verifier.test.js
@@@ -48,6 +48,7 @@ function verifier(aiAnswer) {
const ask = calls.find((c) => c.url.endsWith('/v1/chat/completions'));
assert.ok(ask, 'the verifier called AI');
assert.strictEqual(ask.body.max_tokens, 800);
++ assert.strictEqual(ask.body.reasoning_effort, 'low');
assert.strictEqual(ask.body.model, 'deepseek-chat');
});