Classes
ChatSession
Chat session to make multi-turn send message request. Users can instantiate this using startChat method in GenerativeModel class. sendMessage
method makes async call to get response of a chat message. sendMessageStream
method makes async call to stream response of a chat message.
ChatSessionPreview
Chat session to make multi-turn send message request. sendMessage
method makes async call to get response of a chat message. sendMessageStream
method makes async call to stream response of a chat message.
ClientError
ClientError is thrown when http 4XX status is received. For details please refer to https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#client_error_responses
GenerativeModel
Base class for generative models. NOTE: this class should not be instantiated directly. Use vertexai.getGenerativeModel()
instead.
GenerativeModelPreview
Base class for generative models in preview. NOTE: this class should not be instantiated directly. Use vertexai.getGenerativeModel()
instead.
GoogleAuthError
GoogleAuthError is thrown when there is authentication issue with the request
GoogleGenerativeAIError
GoogleGenerativeAIError is thrown when http response is not ok and status code is not 4XX For details please refer to https://developer.mozilla.org/en-US/docs/Web/HTTP/Status
VertexAI
Base class for authenticating to Vertex, creates the preview namespace. Users use getGenerativeModel method to start using Google's generative models in GA.
Interfaces
BaseModelParams
Base params for initializing a model or calling GenerateContent.
BasePart
A part of a turn in a conversation with the model with a fixed MIME type. It has one of the following mutually exclusive fields: 1. text 2. inline_data 3. file_data 4. functionResponse 5. functionCall
CitationMetadata
A collection of source attributions for a piece of content.
CitationSource
Source attributions for content.
Content
The base structured datatype containing multi-part content of a message.
CountTokensRequest
Params used to call the countTokens method.
CountTokensResponse
Response returned from countTokens method.
FileData
URI based data.
FileDataPart
A file data part of a conversation with the model.
FunctionCall
A predicted FunctionCall returned from the model that contains a string representating the FunctionDeclaration.name with the parameters and their values.
FunctionCallPart
A function call part of a conversation with the model.
FunctionDeclaration
Structured representation of a function declaration as defined by the [OpenAPI 3.0 specification](https://spec.openapis.org/oas/v3.0.3). Included in this declaration are the function name and parameters. This FunctionDeclaration is a representation of a block of code that can be used as a Tool by the model and executed by the client.
FunctionDeclarationSchema
Schema for parameters passed to FunctionDeclaration.parameters.
FunctionDeclarationSchemaProperty
Schema is used to define the format of input/output data. Represents a select subset of an OpenAPI 3.0 schema object. More fields may be added in the future as needed.
FunctionDeclarationsTool
A FunctionDeclarationsTool is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the model.
FunctionResponse
The result output of a FunctionCall that contains a string representing the FunctionDeclaration.name and a structured JSON object containing any output from the function call. It is used as context to the model.
FunctionResponsePart
A function response part of a conversation with the model.
GenerateContentCandidate
A response candidate generated from the model.
GenerateContentRequest
Params used to call the generateContent method.
GenerateContentResponse
Response from the model supporting multiple candidates.
GenerateContentResult
Wrapper for respones from a generateContent request.
GenerationConfig
Configuration options for model generation and outputs.
GenerativeContentBlob
Raw media bytes sent directly in the request. Text should not be sent as raw bytes.
GetGenerativeModelParams
Params used to call the getGenerativeModel method.
GoogleSearchRetrieval
Tool to retrieve public web data for grounding, powered by Google.
GoogleSearchRetrievalTool
Defines a retrieval tool that model can call to access external knowledge.
GroundingAttribution
Grounding attribution.
GroundingAttributionSegment
Segment of the content this attribution belongs to.
GroundingAttributionWeb
Attribution from the web.
GroundingMetadata
A collection of grounding attributions for a piece of content.
InlineDataPart
An inline data part of a conversation with the model.
ModelParams
Configuration for initializing a model, for example via getGenerativeModel in VertexAI class.
PromptFeedback
Content filter results for a prompt sent in the request.
RequestOptions
Request options params passed to getGenerativeModel method in VertexAI class.
Retrieval
Defines a retrieval tool that model can call to access external knowledge.
RetrievalTool
Defines a retrieval tool that model can call to access external knowledge.
SafetyRating
Safety rating corresponding to the generated content.
SafetySetting
Safety feedback for an entire request.
StartChatParams
Params to initiate a multiturn chat with the model via startChat.
StartChatSessionRequest
All params passed to initiate multiturn chat via startChat.
StreamGenerateContentResult
Wrapper for respones from a generateContent method when steam
parameter is true
.
TextPart
A text part of a conversation with the model.
UsageMetadata
Usage metadata about response(s).
VertexAISearch
Retrieve from Vertex AI Search datastore for grounding.
VertexInit
Params used to initialize the Vertex SDK.
Enums
BlockedReason
The reason why the reponse is blocked.
FinishReason
The reason why the model stopped generating tokens. If empty, the model has not stopped generating the tokens.
FunctionDeclarationSchemaType
Contains the list of OpenAPI data types as defined by https://swagger.io/docs/specification/data-models/data-types/
HarmBlockThreshold
Probability based thresholds levels for blocking.
HarmCategory
Harm categories that will block the content.
HarmProbability
Harm probability levels in the content.
Type Aliases
Part
export declare type Part = TextPart | InlineDataPart | FileDataPart | FunctionResponsePart | FunctionCallPart;
A datatype containing media that is part of a multi-part Content message. A Part
is a union type of TextPart, InlineDataPart, FileDataPart, and FunctionResponsePart. A Part
has one of the following mutually exclusive fields: 1. text 2. inline_data 3. file_data 4. functionResponse
Tool
export declare type Tool = FunctionDeclarationsTool | RetrievalTool | GoogleSearchRetrievalTool;
Defines a tool that model can call to access external knowledge.