pub struct StatelessConfig {
pub provider: LLMProvider,
pub api_key: String,
pub model: String,
pub max_tokens: u32,
pub system_prompt: Option<String>,
pub temperature: Option<f32>,
}Expand description
Configuration for creating a stateless executor.
Fields§
§provider: LLMProviderLLM provider (Anthropic, OpenAI).
api_key: StringProvider API credentials.
model: StringDefault model for requests.
max_tokens: u32Default max tokens (0 = use DEFAULT_MAX_TOKENS).
system_prompt: Option<String>Default system prompt (can be overridden per request).
temperature: Option<f32>Default temperature (None = provider default).
Implementations§
Source§impl StatelessConfig
impl StatelessConfig
Sourcepub fn anthropic(api_key: impl Into<String>, model: impl Into<String>) -> Self
pub fn anthropic(api_key: impl Into<String>, model: impl Into<String>) -> Self
Creates a new Anthropic config with required fields.
Sourcepub fn openai(api_key: impl Into<String>, model: impl Into<String>) -> Self
pub fn openai(api_key: impl Into<String>, model: impl Into<String>) -> Self
Creates a new OpenAI config with required fields.
Sourcepub fn with_max_tokens(self, max_tokens: u32) -> Self
pub fn with_max_tokens(self, max_tokens: u32) -> Self
Sets the max tokens.
Sourcepub fn with_system_prompt(self, prompt: impl Into<String>) -> Self
pub fn with_system_prompt(self, prompt: impl Into<String>) -> Self
Sets the system prompt.
Sourcepub fn with_temperature(self, temperature: f32) -> Self
pub fn with_temperature(self, temperature: f32) -> Self
Sets the temperature.
Sourcepub fn validate(&self) -> Result<(), StatelessError>
pub fn validate(&self) -> Result<(), StatelessError>
Validates the config and returns an error if invalid.
Trait Implementations§
Source§impl Clone for StatelessConfig
impl Clone for StatelessConfig
Source§fn clone(&self) -> StatelessConfig
fn clone(&self) -> StatelessConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for StatelessConfig
impl RefUnwindSafe for StatelessConfig
impl Send for StatelessConfig
impl Sync for StatelessConfig
impl Unpin for StatelessConfig
impl UnwindSafe for StatelessConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more