openvibers/openvibe.codes Commits
Goals: ask AI for a low-effort verdict inside the synchronous wait (#425)
Changes
@@@ -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', {@@@ -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');});
@@ -23,6 +23,8 @@ const { verify } = require('../../engine/goal');
@@ -23,6 +23,8 @@ const { verify } = require('../../engine/goal');
const DEFAULT_MODEL = 'deepseek-chat';
const DEFAULT_MODEL = 'deepseek-chat';
/** Room for the answer plus a reasoning model's thinking: 300 left AI's reasoning models with no content. */
/** Room for the answer plus a reasoning model's thinking: 300 left AI's reasoning models with no content. */
const MAX_ANSWER_TOKENS = 800;
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. */
/** The answer's text from either dialect OpenVibe.AI speaks. */
function answerText(doc) {
function answerText(doc) {
@@ -60,6 +62,7 @@ function createGoalVerifier({ config = {}, fetchImpl = globalThis.fetch, log = c
@@ -60,6 +62,7 @@ function createGoalVerifier({ config = {}, fetchImpl = globalThis.fetch, log = c
};
};
let { res, doc } = await ask('/v1/chat/completions', {
let { res, doc } = await ask('/v1/chat/completions', {
model, messages: [{ role: 'user', content: prompt }], temperature: 0, max_tokens: MAX_ANSWER_TOKENS,
model, messages: [{ role: 'user', content: prompt }], temperature: 0, max_tokens: MAX_ANSWER_TOKENS,
+ reasoning_effort: REASONING_EFFORT,
});
});
if (res && res.status === 404) {
if (res && res.status === 404) {
({ res, doc } = await ask('/v1/messages', {
({ res, doc } = await ask('/v1/messages', {
@@ -48,6 +48,7 @@ function verifier(aiAnswer) {
@@ -48,6 +48,7 @@ function verifier(aiAnswer) {
const ask = calls.find((c) => c.url.endsWith('/v1/chat/completions'));
const ask = calls.find((c) => c.url.endsWith('/v1/chat/completions'));
assert.ok(ask, 'the verifier called AI');
assert.ok(ask, 'the verifier called AI');
assert.strictEqual(ask.body.max_tokens, 800);
assert.strictEqual(ask.body.max_tokens, 800);
+ assert.strictEqual(ask.body.reasoning_effort, 'low');
assert.strictEqual(ask.body.model, 'deepseek-chat');
assert.strictEqual(ask.body.model, 'deepseek-chat');
});
});