@adcp/client API Reference - v3.3.3
    Preparing search index...

    Function createConditionalHandler

    • Create a conditional handler that applies different logic based on context

      Parameters

      Returns InputHandler

      const handler = createConditionalHandler([
      {
      condition: (ctx) => ctx.inputRequest.field === 'budget',
      handler: (ctx) => ctx.attempt === 1 ? 100000 : 50000
      },
      {
      condition: (ctx) => ctx.agent.name.includes('Premium'),
      handler: autoApproveHandler
      }
      ], deferAllHandler);