pub struct LlmClient { /* private fields */ }Expand description
LLM client for generating intelligent responses
Implementations§
Source§impl LlmClient
impl LlmClient
Sourcepub fn new(config: BehaviorModelConfig) -> Self
pub fn new(config: BehaviorModelConfig) -> Self
Create a new LLM client
Sourcepub async fn generate(&self, request: &LlmGenerationRequest) -> Result<Value>
pub async fn generate(&self, request: &LlmGenerationRequest) -> Result<Value>
Generate a response from a prompt
Sourcepub async fn generate_with_usage(
&self,
request: &LlmGenerationRequest,
) -> Result<(Value, LlmUsage)>
pub async fn generate_with_usage( &self, request: &LlmGenerationRequest, ) -> Result<(Value, LlmUsage)>
Generate a response and return usage information
Sourcepub fn config(&self) -> &BehaviorModelConfig
pub fn config(&self) -> &BehaviorModelConfig
Get configuration
Auto Trait Implementations§
impl Freeze for LlmClient
impl !RefUnwindSafe for LlmClient
impl Send for LlmClient
impl Sync for LlmClient
impl Unpin for LlmClient
impl UnsafeUnpin for LlmClient
impl !UnwindSafe for LlmClient
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