pub struct CountTokensRequestBuilder { /* private fields */ }Expand description
Builder for CountTokensRequest.
Implementations§
Source§impl CountTokensRequestBuilder
impl CountTokensRequestBuilder
Sourcepub fn messages(self, msgs: Vec<MessageInput>) -> Self
pub fn messages(self, msgs: Vec<MessageInput>) -> Self
Replace the conversation history.
Sourcepub fn user(self, content: impl Into<MessageContent>) -> Self
pub fn user(self, content: impl Into<MessageContent>) -> Self
Append a user-authored message.
Sourcepub fn assistant(self, content: impl Into<MessageContent>) -> Self
pub fn assistant(self, content: impl Into<MessageContent>) -> Self
Append an assistant-authored message.
Sourcepub fn system(self, s: impl Into<SystemPrompt>) -> Self
pub fn system(self, s: impl Into<SystemPrompt>) -> Self
Set the system prompt.
Sourcepub fn tool_choice(self, choice: ToolChoice) -> Self
pub fn tool_choice(self, choice: ToolChoice) -> Self
Set the tool-use policy.
Sourcepub fn thinking(self, t: ThinkingConfig) -> Self
pub fn thinking(self, t: ThinkingConfig) -> Self
Set the extended-thinking config.
Sourcepub fn mcp_servers(self, servers: Vec<McpServerConfig>) -> Self
pub fn mcp_servers(self, servers: Vec<McpServerConfig>) -> Self
Set the MCP servers exposed.
Sourcepub fn build(self) -> Result<CountTokensRequest>
pub fn build(self) -> Result<CountTokensRequest>
Trait Implementations§
Source§impl Debug for CountTokensRequestBuilder
impl Debug for CountTokensRequestBuilder
Source§impl Default for CountTokensRequestBuilder
impl Default for CountTokensRequestBuilder
Source§fn default() -> CountTokensRequestBuilder
fn default() -> CountTokensRequestBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for CountTokensRequestBuilder
impl RefUnwindSafe for CountTokensRequestBuilder
impl Send for CountTokensRequestBuilder
impl Sync for CountTokensRequestBuilder
impl Unpin for CountTokensRequestBuilder
impl UnsafeUnpin for CountTokensRequestBuilder
impl UnwindSafe for CountTokensRequestBuilder
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 moreCreates a shared type from an unshared type.