Module: google.generativeai.types

A collection of type definitions used throughout the library.

Classes

class AsyncGenerateContentResponse: This is the async version of genai.GenerateContentResponse.

class AuthorError: Raised by the chat (or reply) functions when the author list can't be normalized.

class BlobDict: dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object's (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list.

class BlockedPromptException: Common base class for all non-exit exceptions.

class BlockedReason: A list of reasons why content may have been blocked.

class BrokenResponseError: Common base class for all non-exit exceptions.

class CallableFunctionDeclaration: An extension of FunctionDeclaration that can be built from a python function, and is callable.

class ChatResponse: A chat response from the model.

class CitationMetadataDict: A collection of source attributions for a piece of content.

class CitationSourceDict: A citation to a source for a portion of a specific response.

class Completion: The result returned by generativeai.generate_text.

class ContentDict: dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object's (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list.

class ContentFilterDict: Content filtering metadata associated with processing a single request.

class ExampleDict: A dict representation of a glm.Example.

class File

class FunctionDeclaration

class FunctionLibrary: A container for a set of Tool objects, manages lookup and execution of their functions.

class GenerateContentResponse: Instances of this class manage the response of the generate_content method.

class GenerationConfig: A simple dataclass used to configure the generation parameters of GenerativeModel.generate_content.

class GenerationConfigDict: dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object's (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list.

class HarmBlockThreshold: Block at and beyond a specified harm probability.

class HarmCategory: The category of a rating.

class HarmProbability: The probability that a piece of content is harmful.

class IncompleteIterationError: Common base class for all non-exit exceptions.

class MessageDict: A dict representation of a glm.Message.

class MessagePromptDict: A dict representation of a glm.MessagePrompt.

class Model: A dataclass representation of a glm.Model.

class PartDict: dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object's (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list.

class ResponseDict: A dict representation of a glm.GenerateMessageResponse.

class SafetyFeedbackDict: Safety feedback for an entire request.

class SafetyRatingDict: Safety rating for a piece of content.

class SafetySettingDict: Safety setting, affecting the safety-blocking behavior.

class StopCandidateException: Common base class for all non-exit exceptions.

class Tool: A wrapper for glm.Tool, Contains a collection of related FunctionDeclaration objects.

class ToolDict: dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object's (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list.

class TunedModel: A dataclass representation of a glm.TunedModel.

class TunedModelState: The state of the tuned model.

Functions

get_default_file_client(...)

Type Aliases

AnyModelNameOptions

BaseModelNameOptions

BlobType

ContentType

ContentsType

ExampleOptions

ExamplesOptions

FunctionDeclarationType

FunctionLibraryType

GenerationConfigType

MessageOptions

MessagePromptOptions

MessagesOptions

ModelNameOptions

ModelsIterable

PartType

StrictContentType

ToolsType

TunedModelNameOptions

annotations Instance of __future__._Feature