Skip to content

Budget

Namespace: E2E.Decision

public static class Budget

Upstream’s budget.ts.

Inheritance: object

View source

RecordedAsync<T>(StepExecutorContext, string, string, Func<Task<Recorded<T>>>)

Section titled “RecordedAsync<T>(StepExecutorContext, string, string, Func<Task<Recorded<T>>>)”
public static Task<T> RecordedAsync<T>(StepExecutorContext ctx, string provider, string modelId, Func<Task<Recorded<T>>> call)

Upstream’s recorded. Runs one model call against the step budget: cancelled before it starts or after it returns, and recorded with its timing and tokens even when it throws. Errors propagate untouched for the caller to map.

Type parameters

Name Description
T

Parameters

Name Type Description
ctx StepExecutorContext
provider string
modelId string
call Func<Task<Recorded<T>>>

Returns: Task<T>

RecordedAsync<T>(StepExecutorContext, string, string, CancellationToken, Func<Task<Recorded<T>>>)

Section titled “RecordedAsync<T>(StepExecutorContext, string, string, CancellationToken, Func<Task<Recorded<T>>>)”
public static Task<T> RecordedAsync<T>(StepExecutorContext ctx, string provider, string modelId, CancellationToken signal, Func<Task<Recorded<T>>> call)

RecordedAsync&lt;T&gt; under <code class=“paramref”>signal</code>: the attempt’s token linked with the caller’s (.NET-only: the runtime hands an executor both).

Type parameters

Name Description
T

Parameters

Name Type Description
ctx StepExecutorContext
provider string
modelId string
signal CancellationToken
call Func<Task<Recorded<T>>>

Returns: Task<T>