// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
impl super::Client {
    /// Constructs a fluent builder for the [`CountTokens`](crate::operation::count_tokens::builders::CountTokensFluentBuilder) operation.
    ///
    /// - The fluent builder is configurable:
    ///   - [`model_id(impl Into<String>)`](crate::operation::count_tokens::builders::CountTokensFluentBuilder::model_id) / [`set_model_id(Option<String>)`](crate::operation::count_tokens::builders::CountTokensFluentBuilder::set_model_id):<br>required: **true**<br><p>The unique identifier or ARN of the foundation model to use for token counting. Each model processes tokens differently, so the token count is specific to the model you specify.</p><br>
    ///   - [`input(CountTokensInput)`](crate::operation::count_tokens::builders::CountTokensFluentBuilder::input) / [`set_input(Option<CountTokensInput>)`](crate::operation::count_tokens::builders::CountTokensFluentBuilder::set_input):<br>required: **true**<br><p>The input for which to count tokens. The structure of this parameter depends on whether you're counting tokens for an <code>InvokeModel</code> or <code>Converse</code> request:</p> <ul>  <li>   <p>For <code>InvokeModel</code> requests, provide the request body in the <code>invokeModel</code> field</p></li>  <li>   <p>For <code>Converse</code> requests, provide the messages and system content in the <code>converse</code> field</p></li> </ul> <p>The input format must be compatible with the model specified in the <code>modelId</code> parameter.</p><br>
    /// - On success, responds with [`CountTokensOutput`](crate::operation::count_tokens::CountTokensOutput) with field(s):
    ///   - [`input_tokens(i32)`](crate::operation::count_tokens::CountTokensOutput::input_tokens): <p>The number of tokens in the provided input according to the specified model's tokenization rules. This count represents the number of input tokens that would be processed if the same input were sent to the model in an inference request. Use this value to estimate costs and ensure your inputs stay within model token limits.</p>
    /// - On failure, responds with [`SdkError<CountTokensError>`](crate::operation::count_tokens::CountTokensError)
    pub fn count_tokens(&self) -> crate::operation::count_tokens::builders::CountTokensFluentBuilder {
        crate::operation::count_tokens::builders::CountTokensFluentBuilder::new(self.handle.clone())
    }
}
