pub struct LlmClient { /* private fields */ }Expand description
OpenAI-compatible LLM client
Implementations§
Source§impl LlmClient
impl LlmClient
Sourcepub async fn from_pool(pool: &SqlitePool) -> Result<Self>
pub async fn from_pool(pool: &SqlitePool) -> Result<Self>
Create a new LlmClient from database config. Returns an error if LLM is not fully configured.
Sourcepub async fn is_configured(pool: &SqlitePool) -> bool
pub async fn is_configured(pool: &SqlitePool) -> bool
Check whether LLM is fully configured (all three fields present)
Sourcepub async fn chat(&self, prompt: &str) -> Result<String>
pub async fn chat(&self, prompt: &str) -> Result<String>
Simple chat: send a single user prompt and get a response
Sourcepub async fn chat_with_messages(
&self,
messages: Vec<ChatMessage>,
) -> Result<String>
pub async fn chat_with_messages( &self, messages: Vec<ChatMessage>, ) -> Result<String>
Chat with full message history
Sourcepub async fn synthesize_task_description(
&self,
task_name: &str,
original_spec: Option<&str>,
events: &[Event],
) -> Result<String>
pub async fn synthesize_task_description( &self, task_name: &str, original_spec: Option<&str>, events: &[Event], ) -> Result<String>
Synthesize task description from accumulated events
This function takes a task and its event history, and uses the LLM to generate a structured summary in markdown format.
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
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