intellibrix v1.0.0
    Preparing search index...

    Function textToolCalls

    • Wraps a Provider so models that write tool calls as plain text (instead of using the API's native tool calling) still drive the agent loop.

      Only a step that returns no native tool calls is inspected; recognized calls are lifted out of the text into real tool-call parts and the step's finishReason becomes 'tool-calls'. Everything else (approvals, schema validation, Unknown tool errors) then happens in loop.ts exactly as for a native call. Still one model step per call.

      Parameters

      Returns Provider

      const intelligence = new Intelligence({
      provider: textToolCalls(compatibleProvider(model, { baseURL, apiKey })),
      model,
      })