pub struct RunnableConfig {
pub tags: Vec<String>,
pub metadata: HashMap<String, Value>,
pub max_concurrency: Option<usize>,
pub run_id: Option<Uuid>,
pub run_name: Option<String>,
pub callbacks: Option<Arc<CallbackManager>>,
pub cancellation_token: Option<CancellationToken>,
pub temperature: Option<f32>,
pub max_tokens: Option<usize>,
pub configurable: HashMap<String, Value>,
}Expand description
Runnable execution configuration.
Fields§
Tags for filtering and tracking.
metadata: HashMap<String, Value>Metadata - custom data (JSON serializable).
max_concurrency: Option<usize>Max concurrency for batch operations.
run_id: Option<Uuid>Run ID for tracking.
run_name: Option<String>Run name for debugging.
callbacks: Option<Arc<CallbackManager>>Callback manager for tracing and monitoring.
cancellation_token: Option<CancellationToken>Cancellation token for aborting long-running operations.
temperature: Option<f32>Sampling temperature override for the current call.
When set, takes precedence over the model’s own configured
temperature. This is how wrapper layers (e.g. LLMClient) make
with_temperature effective through a trait object (providers Q2).
max_tokens: Option<usize>Max-tokens override for the current call.
When set, takes precedence over the model’s own configured max tokens (providers Q2).
configurable: HashMap<String, Value>Configurable values — the Rust counterpart of Python LCEL’s
config["configurable"].
Runtime selection keys live here: configurable_alternatives reads
its which key from this map, and RunnableWithMessageHistory
(session mode) reads session_id from it.
Implementations§
Source§impl RunnableConfig
impl RunnableConfig
Sourcepub fn with_metadata(self, key: impl Into<String>, value: Value) -> Self
pub fn with_metadata(self, key: impl Into<String>, value: Value) -> Self
Adds metadata.
Sourcepub fn with_max_concurrency(self, max: usize) -> Self
pub fn with_max_concurrency(self, max: usize) -> Self
Sets max concurrency.
Sourcepub fn with_run_id(self, id: Uuid) -> Self
pub fn with_run_id(self, id: Uuid) -> Self
Sets run ID.
Sourcepub fn with_run_name(self, name: impl Into<String>) -> Self
pub fn with_run_name(self, name: impl Into<String>) -> Self
Sets run name.
Sourcepub fn with_callbacks(self, callbacks: Arc<CallbackManager>) -> Self
pub fn with_callbacks(self, callbacks: Arc<CallbackManager>) -> Self
Sets callback manager.
Sourcepub fn with_cancellation_token(self, token: CancellationToken) -> Self
pub fn with_cancellation_token(self, token: CancellationToken) -> Self
Sets cancellation token.
Sourcepub fn with_temperature(self, temperature: f32) -> Self
pub fn with_temperature(self, temperature: f32) -> Self
Sets a sampling temperature override for the call.
Sourcepub fn with_max_tokens(self, max_tokens: usize) -> Self
pub fn with_max_tokens(self, max_tokens: usize) -> Self
Sets a max-tokens override for the call.
Sourcepub fn with_configurable(self, key: impl Into<String>, value: Value) -> Self
pub fn with_configurable(self, key: impl Into<String>, value: Value) -> Self
Sourcepub fn configurable_value(&self, key: &str) -> Option<&Value>
pub fn configurable_value(&self, key: &str) -> Option<&Value>
Reads a configurable value by key.
Sourcepub fn is_cancelled(&self) -> bool
pub fn is_cancelled(&self) -> bool
Checks if cancellation has been requested.
Sourcepub fn merge(self, other: RunnableConfig) -> Self
pub fn merge(self, other: RunnableConfig) -> Self
Merges two configurations (later overrides earlier).
Trait Implementations§
Source§impl Clone for RunnableConfig
impl Clone for RunnableConfig
Source§fn clone(&self) -> RunnableConfig
fn clone(&self) -> RunnableConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more