pub struct FastlyAgent { /* private fields */ }Expand description
AI Agent for Fastly Compute
Implementations§
Source§impl FastlyAgent
impl FastlyAgent
Sourcepub fn new(
config: FastlyAgentConfig,
backend_name: impl Into<String>,
) -> Result<Self>
pub fn new( config: FastlyAgentConfig, backend_name: impl Into<String>, ) -> Result<Self>
Create a new Fastly agent
§Arguments
config- Agent configurationbackend_name- Name of the Fastly backend configured for LLM API
Sourcepub fn chat(&mut self, message: &str) -> Result<LlmResponse>
pub fn chat(&mut self, message: &str) -> Result<LlmResponse>
Send a message and get a response
Sourcepub fn chat_stream(&mut self, message: &str) -> Result<StreamingResponse>
pub fn chat_stream(&mut self, message: &str) -> Result<StreamingResponse>
Send a message and get a streaming response
Returns an iterator over stream chunks
Sourcepub fn add_assistant_message(&mut self, content: impl Into<String>)
pub fn add_assistant_message(&mut self, content: impl Into<String>)
Add assistant response to history (for streaming)
Auto Trait Implementations§
impl Freeze for FastlyAgent
impl RefUnwindSafe for FastlyAgent
impl Send for FastlyAgent
impl Sync for FastlyAgent
impl Unpin for FastlyAgent
impl UnsafeUnpin for FastlyAgent
impl UnwindSafe for FastlyAgent
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