pub struct FastlyAgentConfig {
pub provider: String,
pub api_key: String,
pub model: String,
pub system_prompt: Option<String>,
pub temperature: f32,
pub max_tokens: u32,
}Expand description
Configuration for the Fastly agent
Fields§
§provider: StringLLM provider
api_key: StringAPI key
model: StringModel identifier
system_prompt: Option<String>System prompt
temperature: f32Temperature (0.0 - 2.0)
max_tokens: u32Maximum tokens to generate
Implementations§
Source§impl FastlyAgentConfig
impl FastlyAgentConfig
Sourcepub fn new(
provider: impl Into<String>,
api_key: impl Into<String>,
model: impl Into<String>,
) -> Self
pub fn new( provider: impl Into<String>, api_key: impl Into<String>, model: impl Into<String>, ) -> Self
Create a new configuration
Sourcepub fn with_system_prompt(self, prompt: impl Into<String>) -> Self
pub fn with_system_prompt(self, prompt: impl Into<String>) -> Self
Set system prompt
Sourcepub fn with_temperature(self, temp: f32) -> Self
pub fn with_temperature(self, temp: f32) -> Self
Set temperature
Sourcepub fn with_max_tokens(self, tokens: u32) -> Self
pub fn with_max_tokens(self, tokens: u32) -> Self
Set max tokens
Trait Implementations§
Source§impl Clone for FastlyAgentConfig
impl Clone for FastlyAgentConfig
Source§fn clone(&self) -> FastlyAgentConfig
fn clone(&self) -> FastlyAgentConfig
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 moreSource§impl Debug for FastlyAgentConfig
impl Debug for FastlyAgentConfig
Source§impl<'de> Deserialize<'de> for FastlyAgentConfig
impl<'de> Deserialize<'de> for FastlyAgentConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for FastlyAgentConfig
impl RefUnwindSafe for FastlyAgentConfig
impl Send for FastlyAgentConfig
impl Sync for FastlyAgentConfig
impl Unpin for FastlyAgentConfig
impl UnsafeUnpin for FastlyAgentConfig
impl UnwindSafe for FastlyAgentConfig
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