pub struct LlmTargetSet { /* private fields */ }Expand description
The set of targets an algorithm may route among. An algorithm is constructed
with one and picks targets by position (targets) or by name
(get_target).
Implementations§
Source§impl LlmTargetSet
impl LlmTargetSet
Sourcepub fn targets(&self) -> &[LlmTarget]
pub fn targets(&self) -> &[LlmTarget]
All targets in the set — e.g. for an algorithm to select among.
Sourcepub fn get_target(&self, name: &str) -> Result<LlmTarget>
pub fn get_target(&self, name: &str) -> Result<LlmTarget>
Look up a target by name; errors if no target has that name.
Sourcepub fn resolve_target(&self, name: &str, ctx: &Context) -> Result<LlmTarget>
pub fn resolve_target(&self, name: &str, ctx: &Context) -> Result<LlmTarget>
The named target, or the first one this request is not barred from when it has been
excluded (see Context::exclude_target). Errors if every target is excluded.
Sourcepub fn count_tokens_client(&self) -> Option<Arc<dyn RoutedLlmClient>>
pub fn count_tokens_client(&self) -> Option<Arc<dyn RoutedLlmClient>>
The first target’s client that can serve count_tokens (an Anthropic
upstream), or None when no target has one. Used by an algorithm’s
count_tokens_client.
Trait Implementations§
Source§impl Clone for LlmTargetSet
impl Clone for LlmTargetSet
Source§fn clone(&self) -> LlmTargetSet
fn clone(&self) -> LlmTargetSet
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for LlmTargetSet
impl !RefUnwindSafe for LlmTargetSet
impl Send for LlmTargetSet
impl Sync for LlmTargetSet
impl Unpin for LlmTargetSet
impl UnsafeUnpin for LlmTargetSet
impl !UnwindSafe for LlmTargetSet
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