Class LlmCallBuilder

Assembly: redb.Route.Llm.dll

Builder for the inline step.

public sealed class LlmCallBuilder

Inheritance

Object→LlmCallBuilder

Properties

BudgetCostUsd

Per-run cost ceiling in USD. Null = no ceiling. Needs an

public decimal? BudgetCostUsd { get; set; }

BudgetInputTokens

Per-run input-token ceiling (summed across iterations). Null = no ceiling.

public int? BudgetInputTokens { get; set; }

BudgetOutputTokens

Per-run output-token ceiling (summed across iterations). Null = no ceiling.

public int? BudgetOutputTokens { get; set; }

ConversationHeaderName

When set, conversation id is read from this header on the incoming

public string? ConversationHeaderName { get; set; }

ConversationId

Conversation id (when conversation tracking is on).

public string? ConversationId { get; set; }

MaxIterations

Maximum tool-loop iterations.

public int MaxIterations { get; set; }

MaxTokens

Per-call max-tokens override.

public int? MaxTokens { get; set; }

PropagateToolHeaders

Extra header names propagated from the exchange to every tool call

public List<string> PropagateToolHeaders { get; }

SystemPrompt

System prompt for this call.

public string? SystemPrompt { get; set; }

Temperature

Per-call temperature override.

public double? Temperature { get; set; }

ToolNames

Tool names to resolve from the registry at dispatch time.

public List<string> ToolNames { get; }

Tools

Tools available for this call. Empty when no opt-in was made.

public List<ILlmToolDescriptor> Tools { get; }

UseAllTools

When true, every descriptor in the registry is exposed for this call.

public bool UseAllTools { get; set; }

UserContentFactory

Optional factory for the initial user content. When null, the body of

public Func<IExchange, IReadOnlyList<LlmContentBlock>>? UserContentFactory { get; set; }

Methods

UseAllRegisteredTools()

Exposes every descriptor in the global registry to this call.

public LlmCallBuilder UseAllRegisteredTools()

UseTools(params string[])

Resolves tools by name from the global registry at dispatch time.

public LlmCallBuilder UseTools(params string[] names)

WithBudget(int?, int?, decimal?)

Sets the per-run budget. Only the dimensions you pass are limited; the cost ceiling requires a

public LlmCallBuilder WithBudget(int? inputTokens = null, int? outputTokens = null, decimal? costUsd = null)

WithConversation(string)

Sets the conversation id explicitly.

public LlmCallBuilder WithConversation(string id)

WithConversationFromHeader(string)

Reads the conversation id from the named header on the inbound exchange.

public LlmCallBuilder WithConversationFromHeader(string headerName)

WithMaxIterations(int)

Sets max tool-loop iterations.

public LlmCallBuilder WithMaxIterations(int n)

WithMaxTokens(int)

Sets per-call max-tokens.

public LlmCallBuilder WithMaxTokens(int n)

WithPropagatedToolHeaders(params string[])

Opts extra headers into propagation from this exchange to the tool calls of

public LlmCallBuilder WithPropagatedToolHeaders(params string[] names)

WithSystemPrompt(string)

Sets the system prompt.

public LlmCallBuilder WithSystemPrompt(string prompt)

WithTemperature(double)

Sets per-call temperature.

public LlmCallBuilder WithTemperature(double t)

WithTool(ILlmToolDescriptor)

Adds a tool to this call by descriptor instance.

public LlmCallBuilder WithTool(ILlmToolDescriptor tool)

WithTools(params ILlmToolDescriptor[])

Adds multiple tools at once by descriptor instance.

public LlmCallBuilder WithTools(params ILlmToolDescriptor[] tools)

WithUserContent(Func<IExchange, IReadOnlyList<LlmContentBlock>>)

Overrides the user content with a custom factory. Use for multi-block

public LlmCallBuilder WithUserContent(Func<IExchange, IReadOnlyList<LlmContentBlock>> factory)