pub struct AnthropicHypotheticalGenerator { /* private fields */ }Expand description
Anthropic-backed HyDE generator using Claude API.
Generates hypothetical documents by prompting Claude to write a passage
that would answer the given query. Requires ANTHROPIC_API_KEY environment
variable and the eval feature flag (reuses the eval Anthropic client).
Implementations§
Source§impl AnthropicHypotheticalGenerator
impl AnthropicHypotheticalGenerator
Sourcepub fn from_env() -> Result<Self, String>
pub fn from_env() -> Result<Self, String>
Create a new Anthropic HyDE generator from environment.
Sourcepub fn with_model(self, model: impl Into<String>) -> Self
pub fn with_model(self, model: impl Into<String>) -> Self
Set the model to use for generation.
Sourcepub fn with_max_tokens(self, max_tokens: u32) -> Self
pub fn with_max_tokens(self, max_tokens: u32) -> Self
Set maximum tokens for the hypothetical document.
Trait Implementations§
Source§impl Debug for AnthropicHypotheticalGenerator
Available on crate feature eval only.
impl Debug for AnthropicHypotheticalGenerator
Available on crate feature
eval only.Source§impl HypotheticalGenerator for AnthropicHypotheticalGenerator
Available on crate feature eval only.
impl HypotheticalGenerator for AnthropicHypotheticalGenerator
Available on crate feature
eval only.Auto Trait Implementations§
impl Freeze for AnthropicHypotheticalGenerator
impl !RefUnwindSafe for AnthropicHypotheticalGenerator
impl Send for AnthropicHypotheticalGenerator
impl Sync for AnthropicHypotheticalGenerator
impl Unpin for AnthropicHypotheticalGenerator
impl UnsafeUnpin for AnthropicHypotheticalGenerator
impl !UnwindSafe for AnthropicHypotheticalGenerator
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