pub struct TogetherProvider;Expand description
Provider for Together.ai-hosted models (together/* slugs), served behind the
OpenAI-compatible /chat/completions schema.
Why: gives build_request a Together-correct normalisation profile so the
wire payload matches what Together accepts (no OpenRouter-only directives, no
cache_control breakpoints).
What: zero-sized marker type implementing Provider.
Test: together::tests::*.
Implementations§
Trait Implementations§
Source§impl Clone for TogetherProvider
impl Clone for TogetherProvider
Source§fn clone(&self) -> TogetherProvider
fn clone(&self) -> TogetherProvider
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TogetherProvider
impl Debug for TogetherProvider
Source§impl Default for TogetherProvider
impl Default for TogetherProvider
Source§fn default() -> TogetherProvider
fn default() -> TogetherProvider
Source§impl Provider for TogetherProvider
impl Provider for TogetherProvider
Source§fn map_tool_choice(&self, choice: ToolChoice) -> Value
fn map_tool_choice(&self, choice: ToolChoice) -> Value
Translate a neutral ToolChoice into OpenAI-dialect wire JSON.
Why: Together uses the OpenAI tool_choice spelling (string policies +
{type:function, function:{name}} object), identical to OpenRouter and
Fireworks.
What: the OpenAI mapping.
Test: together::tests::map_tool_choice_scalars.
Source§fn extract_usage(&self, response: &ChatResponse) -> TokenUsage
fn extract_usage(&self, response: &ChatResponse) -> TokenUsage
Extract canonical token usage from a Together response.
Why: Together returns the standard OpenAI usage block, already
normalised into ChatResponse.usage by the shared adapter’s parse.
What: delegates to ChatResponse::token_usage (identical to the other
OpenAI-dialect providers).
Test: together::tests::extract_usage_maps_fields.
Source§fn supports_native_tools(&self) -> bool
fn supports_native_tools(&self) -> bool
Source§fn supports_prompt_caching(&self) -> bool
fn supports_prompt_caching(&self) -> bool
cache_control
prompt-cache breakpoints (#2156). Read moreSource§fn wants_detailed_usage(&self) -> bool
fn wants_detailed_usage(&self) -> bool
Auto Trait Implementations§
impl Freeze for TogetherProvider
impl RefUnwindSafe for TogetherProvider
impl Send for TogetherProvider
impl Sync for TogetherProvider
impl Unpin for TogetherProvider
impl UnsafeUnpin for TogetherProvider
impl UnwindSafe for TogetherProvider
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
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> ⓘ
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