feat: connect controlled engines to owned Tasks, approvals and budget ledger
This commit is contained in:
@@ -59,6 +59,7 @@ export async function apply(ctx, config) {
|
||||
tools: options.tools ?? [], toolHistory: options.toolHistory ?? null,
|
||||
model: options.model, maxTokens: options.maxTokens ?? config.maxOutputTokens }, options.signal);
|
||||
const message = result.message;
|
||||
if (result.finishReason === 'length') throw new Error('Owned model output reached its bound; incomplete tools are not executed.');
|
||||
if (!message || message.role !== 'assistant' || typeof message.content !== 'string'
|
||||
|| message.tool_calls !== undefined && !Array.isArray(message.tool_calls)) throw new Error('Invalid owned model result.');
|
||||
let index = 0;
|
||||
|
||||
Reference in New Issue
Block a user