pub enum CompressProvider {
Ollama {
base_url: String,
model: String,
client: Client,
},
OpenAi {
base_url: String,
model: String,
api_key: String,
client: Client,
},
Anthropic {
api_key: String,
model: String,
client: Client,
},
None,
}Variants§
Implementations§
Source§impl CompressProvider
impl CompressProvider
Sourcepub fn from_env() -> Self
pub fn from_env() -> Self
Create a provider from environment variables.
Note: each call constructs a new reqwest::blocking::Client. Callers
should invoke this once and cache the returned provider rather than
calling it repeatedly.
Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Whether compression is enabled.
Sourcepub fn compress(
&self,
content: &str,
tool: &str,
file_path: Option<&str>,
) -> Option<String>
pub fn compress( &self, content: &str, tool: &str, file_path: Option<&str>, ) -> Option<String>
Compress a tool observation into a concise summary.
Returns None if compression is disabled, content is too short,
or the LLM call fails (caller should use raw content as fallback).
Sourcepub fn summarize_batch(&self, raw_summary: &str) -> Option<String>
pub fn summarize_batch(&self, raw_summary: &str) -> Option<String>
Summarize a batch of file changes into a one-sentence developer intent summary.
Returns None if compression is disabled or the LLM call fails.
Auto Trait Implementations§
impl Freeze for CompressProvider
impl !RefUnwindSafe for CompressProvider
impl Send for CompressProvider
impl Sync for CompressProvider
impl Unpin for CompressProvider
impl UnsafeUnpin for CompressProvider
impl !UnwindSafe for CompressProvider
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