pub struct StatelessConfig {Show 14 fields
pub provider: LLMProvider,
pub api_key: String,
pub model: String,
pub base_url: Option<String>,
pub max_tokens: u32,
pub system_prompt: Option<String>,
pub temperature: Option<f32>,
pub azure_resource: Option<String>,
pub azure_deployment: Option<String>,
pub azure_api_version: Option<String>,
pub bedrock_region: Option<String>,
pub bedrock_access_key_id: Option<String>,
pub bedrock_secret_access_key: Option<String>,
pub bedrock_session_token: Option<String>,
}Expand description
Configuration for creating a stateless executor.
Fields§
§provider: LLMProviderLLM provider (Anthropic, OpenAI, Google, Cohere, Bedrock).
api_key: StringProvider API credentials.
model: StringDefault model for requests.
base_url: Option<String>Custom base URL for OpenAI-compatible providers. Only used when provider is OpenAI. If None, uses default OpenAI endpoint.
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).
azure_resource: Option<String>Azure OpenAI resource name (e.g., “my-resource”). When set, the provider uses Azure OpenAI instead of standard OpenAI.
azure_deployment: Option<String>Azure OpenAI deployment name (e.g., “gpt-4-deployment”).
azure_api_version: Option<String>Azure OpenAI API version (e.g., “2024-10-21”).
bedrock_region: Option<String>AWS region for Bedrock (e.g., “us-east-1”).
bedrock_access_key_id: Option<String>AWS access key ID for Bedrock.
bedrock_secret_access_key: Option<String>AWS secret access key for Bedrock.
bedrock_session_token: Option<String>AWS session token for Bedrock (optional, for temporary credentials).
Implementations§
Source§impl StatelessConfig
impl StatelessConfig
Sourcepub fn anthropic(
api_key: impl Into<String>,
model: impl Into<String>,
) -> StatelessConfig
pub fn anthropic( api_key: impl Into<String>, model: impl Into<String>, ) -> StatelessConfig
Creates a new Anthropic config with required fields.
Sourcepub fn openai(
api_key: impl Into<String>,
model: impl Into<String>,
) -> StatelessConfig
pub fn openai( api_key: impl Into<String>, model: impl Into<String>, ) -> StatelessConfig
Creates a new OpenAI config with required fields.
Sourcepub fn openai_compatible(
api_key: impl Into<String>,
model: impl Into<String>,
base_url: impl Into<String>,
) -> StatelessConfig
pub fn openai_compatible( api_key: impl Into<String>, model: impl Into<String>, base_url: impl Into<String>, ) -> StatelessConfig
Creates a new OpenAI-compatible config with a custom base URL.
Use this for providers like Groq, Together, Fireworks, etc. that have OpenAI-compatible APIs.
Sourcepub fn google(
api_key: impl Into<String>,
model: impl Into<String>,
) -> StatelessConfig
pub fn google( api_key: impl Into<String>, model: impl Into<String>, ) -> StatelessConfig
Creates a new Google (Gemini) config with required fields.
Sourcepub fn azure_openai(
api_key: impl Into<String>,
resource: impl Into<String>,
deployment: impl Into<String>,
) -> StatelessConfig
pub fn azure_openai( api_key: impl Into<String>, resource: impl Into<String>, deployment: impl Into<String>, ) -> StatelessConfig
Creates a new Azure OpenAI config.
Azure OpenAI uses a different URL format and authentication method.
Sourcepub fn with_azure_api_version(
self,
version: impl Into<String>,
) -> StatelessConfig
pub fn with_azure_api_version( self, version: impl Into<String>, ) -> StatelessConfig
Sets the Azure API version.
Sourcepub fn cohere(
api_key: impl Into<String>,
model: impl Into<String>,
) -> StatelessConfig
pub fn cohere( api_key: impl Into<String>, model: impl Into<String>, ) -> StatelessConfig
Creates a new Cohere config with required fields.
Sourcepub fn bedrock(
access_key_id: impl Into<String>,
secret_access_key: impl Into<String>,
region: impl Into<String>,
model: impl Into<String>,
) -> StatelessConfig
pub fn bedrock( access_key_id: impl Into<String>, secret_access_key: impl Into<String>, region: impl Into<String>, model: impl Into<String>, ) -> StatelessConfig
Creates a new Amazon Bedrock config.
§Arguments
access_key_id- AWS access key IDsecret_access_key- AWS secret access keyregion- AWS region (e.g., “us-east-1”)model- Bedrock model ID (e.g., “anthropic.claude-3-sonnet-20240229-v1:0”)
Sourcepub fn with_bedrock_session_token(
self,
token: impl Into<String>,
) -> StatelessConfig
pub fn with_bedrock_session_token( self, token: impl Into<String>, ) -> StatelessConfig
Sets the Bedrock session token for temporary credentials.
Sourcepub fn with_max_tokens(self, max_tokens: u32) -> StatelessConfig
pub fn with_max_tokens(self, max_tokens: u32) -> StatelessConfig
Sets the max tokens.
Sourcepub fn with_system_prompt(self, prompt: impl Into<String>) -> StatelessConfig
pub fn with_system_prompt(self, prompt: impl Into<String>) -> StatelessConfig
Sets the system prompt.
Sourcepub fn with_temperature(self, temperature: f32) -> StatelessConfig
pub fn with_temperature(self, temperature: f32) -> StatelessConfig
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
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
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
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>
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>
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