Skip to content

v1.2.0

Choose a tag to compare

@eloquentanalytics eloquentanalytics released this 03 Mar 05:25
· 7 commits to main since this release

DIAL 1.2.0

New

  • ProposerStrategyResult now accepts four optional metric fields: costUSD, latencyMsec, numInputTokens, numOutputTokens. If your strategyFn already returns { transitionName, toState, reasoning }, no changes needed — the new fields are optional and default to undefined. To report metrics from your strategy:

    const strategyFn = async (ctx: ProposerContext): Promise<ProposerStrategyResult> => {
      const start = Date.now();
      // ... your logic ...
      return {
        transitionName: "approve",
        toState: "approved",
        reasoning: "looks good",
        latencyMsec: Date.now() - start,
        numInputTokens: 500,
        numOutputTokens: 100,
        costUSD: 0.01,
      };
    };
  • When submitProposal is called without a transitionName (triggering strategy invocation), metrics returned by the strategy are now automatically merged into the stored Proposal. If you also pass metrics via SubmitProposalOptions, those values take precedence — strategy values fill any gaps. If you currently pass metrics via opts and your strategy also returns them, your opts values still win. No call-site changes required.

  • executeProposerLlm (the built-in LLM proposer path) now automatically captures latencyMsec, numInputTokens, and numOutputTokens from the LLM response. If you use contextFn + modelId or contextWebhookUrl + modelId execution modes, proposals from those specialists will now include token and latency data without any code changes on your part.