@tensor.chat/companion 0.5.0 → 0.5.1
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/package.json +1 -1
- package/src/tools/codexTurn.js +3 -1
package/package.json
CHANGED
package/src/tools/codexTurn.js
CHANGED
|
@@ -47,6 +47,7 @@ const LOCKED = {
|
|
|
47
47
|
};
|
|
48
48
|
|
|
49
49
|
const EFFORTS = new Set(['none', 'low', 'medium', 'high', 'xhigh', 'max', 'ultra']);
|
|
50
|
+
const SUMMARIES = new Set(['auto', 'concise', 'detailed', 'none']);
|
|
50
51
|
const ITEM_TYPES = new Set(['message', 'function_call', 'function_call_output']);
|
|
51
52
|
const MAX_TOOLS = 200;
|
|
52
53
|
const MAX_ITEMS = 5000;
|
|
@@ -66,6 +67,7 @@ function checkTurn(a) {
|
|
|
66
67
|
return {
|
|
67
68
|
model,
|
|
68
69
|
effort: EFFORTS.has(a.effort) ? a.effort : null,
|
|
70
|
+
summary: SUMMARIES.has(a.summary) ? a.summary : null,
|
|
69
71
|
instructions: str(a.instructions, 4 * 1024 * 1024),
|
|
70
72
|
tools,
|
|
71
73
|
items,
|
|
@@ -155,7 +157,7 @@ async function runTurn(args, { emit, toolResult, signal, env } = {}) {
|
|
|
155
157
|
if (!threadId) throw new Error('thread/start: no thread');
|
|
156
158
|
await step('thread/inject_items', { threadId, items: turn.items });
|
|
157
159
|
// The question is the last injected item: the turn starts with nothing new.
|
|
158
|
-
const started = await step('turn/start', { threadId, input: [], ...(turn.effort ? { effort: turn.effort } : {}) });
|
|
160
|
+
const started = await step('turn/start', { threadId, input: [], ...(turn.effort ? { effort: turn.effort } : {}), ...(turn.summary ? { summary: turn.summary } : {}) });
|
|
159
161
|
turnId = (started.turn && started.turn.id) || turnId;
|
|
160
162
|
const end = await Promise.race([done, stopped]);
|
|
161
163
|
const ok = end.status === 'completed';
|