Expand description
Lightweight types mirroring the Google Gemini API structures needed for token counting.
These types support serde serialization/deserialization for JSON interop. They are intentionally minimal — only the fields relevant to token counting are included.
Structs§
- Compute
Tokens Result - Result of computing tokens, matching the Python SDK’s
ComputeTokensResult. - Content
- A content message in a conversation, containing a role and parts.
- Count
Tokens Config - Configuration for
count_tokens, matching the Python SDK’sCountTokensConfig. - Count
Tokens Result - Result of counting tokens, matching the Python SDK’s
CountTokensResult. - Function
Call - A function call made by the model.
- Function
Declaration - A declaration of a function that the model can call.
- Function
Response - A response from a function call.
- Part
- A single part of a content message.
- Schema
- A JSON Schema definition used to describe function parameters and responses.
- Tokens
Info - Information about tokens for a single content part,
matching the Python SDK’s
TokensInfo. - Tool
- A tool definition containing function declarations.
Enums§
- Contents
- Input contents, accepting either a text string or structured Content objects.