+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[items](./generative-ai.arrayschema.items.md) + + + | + + + | + +[Schema](./generative-ai.schema.md) + + + | + +A schema describing the entries in the array. + + + |
+ +[maxItems?](./generative-ai.arrayschema.maxitems.md) + + + | + + + | + +number + + + | + +_(Optional)_ The maximum number of items in the array. + + + |
+ +[minItems?](./generative-ai.arrayschema.minitems.md) + + + | + + + | + +number + + + | + +_(Optional)_ The minimum number of items in the array. + + + |
+ +[type](./generative-ai.arrayschema.type.md) + + + | + + + | + +typeof [SchemaType.ARRAY](./generative-ai.schematype.md) + + + | + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[generationConfig?](./generative-ai.baseparams.generationconfig.md) + + + | + + + | + +[GenerationConfig](./generative-ai.generationconfig.md) + + + | + +_(Optional)_ + + + |
+ +[safetySettings?](./generative-ai.baseparams.safetysettings.md) + + + | + + + | + +[SafetySetting](./generative-ai.safetysetting.md)\[\] + + + | + +_(Optional)_ + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[requests](./generative-ai.batchembedcontentsrequest.requests.md) + + + | + + + | + +[EmbedContentRequest](./generative-ai.embedcontentrequest.md)\[\] + + + | + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[embeddings](./generative-ai.batchembedcontentsresponse.embeddings.md) + + + | + + + | + +[ContentEmbedding](./generative-ai.contentembedding.md)\[\] + + + | + + + |
"BLOCKED_REASON_UNSPECIFIED"
| |
-| OTHER | "OTHER"
| |
-| SAFETY | "SAFETY"
| |
++Member + + + | + +Value + + + | + +Description + + + |
---|---|---|
+ +BLOCKED\_REASON\_UNSPECIFIED + + + | + +`"BLOCKED_REASON_UNSPECIFIED"` + + + | + + + |
+ +OTHER + + + | + +`"OTHER"` + + + | + + + |
+ +SAFETY + + + | + +`"SAFETY"` + + + | + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[type](./generative-ai.booleanschema.type.md) + + + | + + + | + +typeof [SchemaType.BOOLEAN](./generative-ai.schematype.md) + + + | + + + |
CachedContent
creation time in ISO string format. |
-| [name?](./generative-ai.cachedcontent.name.md) | | string | _(Optional)_ |
-| [ttl?](./generative-ai.cachedcontent.ttl.md) | | string | _(Optional)_ protobuf.Duration format (ex. "3.0001s"). |
-| [updateTime?](./generative-ai.cachedcontent.updatetime.md) | | string | _(Optional)_ CachedContent
update time in ISO string format. |
++Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[createTime?](./generative-ai.cachedcontent.createtime.md) + + + | + + + | + +string + + + | + +_(Optional)_ `CachedContent` creation time in ISO string format. + + + |
+ +[name?](./generative-ai.cachedcontent.name.md) + + + | + + + | + +string + + + | + +_(Optional)_ + + + |
+ +[ttl?](./generative-ai.cachedcontent.ttl.md) + + + | + + + | + +string + + + | + +_(Optional)_ protobuf.Duration format (ex. "3.0001s"). + + + |
+ +[updateTime?](./generative-ai.cachedcontent.updatetime.md) + + + | + + + | + +string + + + | + +_(Optional)_ `CachedContent` update time in ISO string format. + + + |
ttlSeconds
when creating a CachedContent
. |
-| [model?](./generative-ai.cachedcontentbase.model.md) | | string | _(Optional)_ |
-| [systemInstruction?](./generative-ai.cachedcontentbase.systeminstruction.md) | | string \| [Part](./generative-ai.part.md) \| [Content](./generative-ai.content.md) | _(Optional)_ |
-| [toolConfig?](./generative-ai.cachedcontentbase.toolconfig.md) | | [ToolConfig](./generative-ai.toolconfig.md) | _(Optional)_ |
-| [tools?](./generative-ai.cachedcontentbase.tools.md) | | [Tool](./generative-ai.tool.md)\[\] | _(Optional)_ |
++Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[contents](./generative-ai.cachedcontentbase.contents.md) + + + | + + + | + +[Content](./generative-ai.content.md)\[\] + + + | + + + |
+ +[displayName?](./generative-ai.cachedcontentbase.displayname.md) + + + | + + + | + +string + + + | + +_(Optional)_ + + + |
+ +[expireTime?](./generative-ai.cachedcontentbase.expiretime.md) + + + | + + + | + +string + + + | + +_(Optional)_ Expiration time in ISO string format. Specify either this or `ttlSeconds` when creating a `CachedContent`. + + + |
+ +[model?](./generative-ai.cachedcontentbase.model.md) + + + | + + + | + +string + + + | + +_(Optional)_ + + + |
+ +[systemInstruction?](./generative-ai.cachedcontentbase.systeminstruction.md) + + + | + + + | + +string \| [Part](./generative-ai.part.md) \| [Content](./generative-ai.content.md) + + + | + +_(Optional)_ + + + |
+ +[toolConfig?](./generative-ai.cachedcontentbase.toolconfig.md) + + + | + + + | + +[ToolConfig](./generative-ai.toolconfig.md) + + + | + +_(Optional)_ + + + |
+ +[tools?](./generative-ai.cachedcontentbase.tools.md) + + + | + + + | + +[Tool](./generative-ai.tool.md)\[\] + + + | + +_(Optional)_ + + + |
+Parameter + + + | + +Type + + + | + +Description + + + |
---|---|---|
+ +apiKey + + + | + +string + + + | + + + |
+ +model + + + | + +string + + + | + + + |
+ +params + + + | + +[StartChatParams](./generative-ai.startchatparams.md) + + + | + +_(Optional)_ + + + |
+ +\_requestOptions + + + | + +[RequestOptions](./generative-ai.requestoptions.md) + + + | + +_(Optional)_ + + + |
ChatSession
class |
++ +Constructor + + + | + +Modifiers + + + | + +Description + + + |
---|---|---|
+ +[(constructor)(apiKey, model, params, \_requestOptions)](./generative-ai.chatsession._constructor_.md) + + + | + + + | + +Constructs a new instance of the `ChatSession` class + + + |
+ +Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[model](./generative-ai.chatsession.model.md) + + + | + + + | + +string + + + | + + + |
+ +[params?](./generative-ai.chatsession.params.md) + + + | + + + | + +[StartChatParams](./generative-ai.startchatparams.md) + + + | + +_(Optional)_ + + + |
Sends a chat message and receives a non-streaming [GenerateContentResult](./generative-ai.generatecontentresult.md).
Fields set in the optional [SingleRequestOptions](./generative-ai.singlerequestoptions.md) parameter will take precedence over the [RequestOptions](./generative-ai.requestoptions.md) values provided to [GoogleGenerativeAI.getGenerativeModel()](./generative-ai.googlegenerativeai.getgenerativemodel.md).
| -| [sendMessageStream(request, requestOptions)](./generative-ai.chatsession.sendmessagestream.md) | |Sends a chat message and receives the response as a [GenerateContentStreamResult](./generative-ai.generatecontentstreamresult.md) containing an iterable stream and a response promise.
Fields set in the optional [SingleRequestOptions](./generative-ai.singlerequestoptions.md) parameter will take precedence over the [RequestOptions](./generative-ai.requestoptions.md) values provided to [GoogleGenerativeAI.getGenerativeModel()](./generative-ai.googlegenerativeai.getgenerativemodel.md).
| ++ +Method + + + | + +Modifiers + + + | + +Description + + + |
---|---|---|
+ +[getHistory()](./generative-ai.chatsession.gethistory.md) + + + | + + + | + +Gets the chat history so far. Blocked prompts are not added to history. Blocked candidates are not added to history, nor are the prompts that generated them. + + + |
+ +[sendMessage(request, requestOptions)](./generative-ai.chatsession.sendmessage.md) + + + | + + + | + +Sends a chat message and receives a non-streaming [GenerateContentResult](./generative-ai.generatecontentresult.md). + +Fields set in the optional [SingleRequestOptions](./generative-ai.singlerequestoptions.md) parameter will take precedence over the [RequestOptions](./generative-ai.requestoptions.md) values provided to [GoogleGenerativeAI.getGenerativeModel()](./generative-ai.googlegenerativeai.getgenerativemodel.md). + + + |
+ +[sendMessageStream(request, requestOptions)](./generative-ai.chatsession.sendmessagestream.md) + + + | + + + | + +Sends a chat message and receives the response as a [GenerateContentStreamResult](./generative-ai.generatecontentstreamresult.md) containing an iterable stream and a response promise. + +Fields set in the optional [SingleRequestOptions](./generative-ai.singlerequestoptions.md) parameter will take precedence over the [RequestOptions](./generative-ai.requestoptions.md) values provided to [GoogleGenerativeAI.getGenerativeModel()](./generative-ai.googlegenerativeai.getgenerativemodel.md). + + |
+Parameter + + + | + +Type + + + | + +Description + + + |
---|---|---|
+ +request + + + | + +string \| Array<string \| [Part](./generative-ai.part.md)> + + + | + + + |
+ +requestOptions + + + | + +[SingleRequestOptions](./generative-ai.singlerequestoptions.md) + + + | + +_(Optional)_ + + + |
+Parameter + + + | + +Type + + + | + +Description + + + |
---|---|---|
+ +request + + + | + +string \| Array<string \| [Part](./generative-ai.part.md)> + + + | + + + |
+ +requestOptions + + + | + +[SingleRequestOptions](./generative-ai.singlerequestoptions.md) + + + | + +_(Optional)_ + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[citationSources](./generative-ai.citationmetadata.citationsources.md) + + + | + + + | + +[CitationSource](./generative-ai.citationsource.md)\[\] + + + | + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[endIndex?](./generative-ai.citationsource.endindex.md) + + + | + + + | + +number + + + | + +_(Optional)_ + + + |
+ +[license?](./generative-ai.citationsource.license.md) + + + | + + + | + +string + + + | + +_(Optional)_ + + + |
+ +[startIndex?](./generative-ai.citationsource.startindex.md) + + + | + + + | + +number + + + | + +_(Optional)_ + + + |
+ +[uri?](./generative-ai.citationsource.uri.md) + + + | + + + | + +string + + + | + +_(Optional)_ + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[outcome](./generative-ai.codeexecutionresult.outcome.md) + + + | + + + | + +[Outcome](./generative-ai.outcome.md) + + + | + +Outcome of the code execution. + + + |
+ +[output](./generative-ai.codeexecutionresult.output.md) + + + | + + + | + +string + + + | + +Contains stdout when code execution is successful, stderr or other description otherwise. + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[codeExecutionResult](./generative-ai.codeexecutionresultpart.codeexecutionresult.md) + + + | + + + | + +[CodeExecutionResult](./generative-ai.codeexecutionresult.md) + + + | + + + |
+ +[executableCode?](./generative-ai.codeexecutionresultpart.executablecode.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+ +[fileData?](./generative-ai.codeexecutionresultpart.filedata.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+ +[functionCall?](./generative-ai.codeexecutionresultpart.functioncall.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+ +[functionResponse?](./generative-ai.codeexecutionresultpart.functionresponse.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+ +[inlineData?](./generative-ai.codeexecutionresultpart.inlinedata.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+ +[text?](./generative-ai.codeexecutionresultpart.text.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[codeExecution](./generative-ai.codeexecutiontool.codeexecution.md) + + + | + + + | + +{} + + + | + +Provide an empty object to enable code execution. This field may have subfields added in the future. + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[parts](./generative-ai.content.parts.md) + + + | + + + | + +[Part](./generative-ai.part.md)\[\] + + + | + + + |
+ +[role](./generative-ai.content.role.md) + + + | + + + | + +string + + + | + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[values](./generative-ai.contentembedding.values.md) + + + | + + + | + +number\[\] + + + | + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[contents?](./generative-ai.counttokensrequest.contents.md) + + + | + + + | + +[Content](./generative-ai.content.md)\[\] + + + | + +_(Optional)_ + + + |
+ +[generateContentRequest?](./generative-ai.counttokensrequest.generatecontentrequest.md) + + + | + + + | + +[GenerateContentRequest](./generative-ai.generatecontentrequest.md) + + + | + +_(Optional)_ + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[totalTokens](./generative-ai.counttokensresponse.totaltokens.md) + + + | + + + | + +number + + + | + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[dynamicThreshold?](./generative-ai.dynamicretrievalconfig.dynamicthreshold.md) + + + | + + + | + +number + + + | + +_(Optional)_ The threshold to be used in dynamic retrieval. If not set, a system default value is used. + + + |
+ +[mode?](./generative-ai.dynamicretrievalconfig.mode.md) + + + | + + + | + +[DynamicRetrievalMode](./generative-ai.dynamicretrievalmode.md) + + + | + +_(Optional)_ The mode of the predictor to be used in dynamic retrieval. + + + |
"MODE_DYNAMIC"
| |
-| MODE\_UNSPECIFIED | "MODE_UNSPECIFIED"
| |
++Member + + + | + +Value + + + | + +Description + + + |
---|---|---|
+ +MODE\_DYNAMIC + + + | + +`"MODE_DYNAMIC"` + + + | + + + |
+ +MODE\_UNSPECIFIED + + + | + +`"MODE_UNSPECIFIED"` + + + | + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[content](./generative-ai.embedcontentrequest.content.md) + + + | + + + | + +[Content](./generative-ai.content.md) + + + | + + + |
+ +[taskType?](./generative-ai.embedcontentrequest.tasktype.md) + + + | + + + | + +[TaskType](./generative-ai.tasktype.md) + + + | + +_(Optional)_ + + + |
+ +[title?](./generative-ai.embedcontentrequest.title.md) + + + | + + + | + +string + + + | + +_(Optional)_ + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[embedding](./generative-ai.embedcontentresponse.embedding.md) + + + | + + + | + +[ContentEmbedding](./generative-ai.contentembedding.md) + + + | + + + |
functionCalls()
instead. |
-| [functionCalls](./generative-ai.enhancedgeneratecontentresponse.functioncalls.md) | | () => [FunctionCall](./generative-ai.functioncall.md)\[\] \| undefined | Returns function calls found in any Part
s of the first candidate of the response, if available. Throws if the prompt or candidate was blocked. |
-| [text](./generative-ai.enhancedgeneratecontentresponse.text.md) | | () => string | Returns the text string assembled from all Part
s of the first candidate of the response, if available. Throws if the prompt or candidate was blocked. |
++Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[functionCall](./generative-ai.enhancedgeneratecontentresponse.functioncall.md) + + + | + + + | + +() => [FunctionCall](./generative-ai.functioncall.md) \| undefined + + + | + +Deprecated: use `functionCalls()` instead. + + + |
+ +[functionCalls](./generative-ai.enhancedgeneratecontentresponse.functioncalls.md) + + + | + + + | + +() => [FunctionCall](./generative-ai.functioncall.md)\[\] \| undefined + + + | + +Returns function calls found in any `Part`s of the first candidate of the response, if available. Throws if the prompt or candidate was blocked. + + + |
+ +[text](./generative-ai.enhancedgeneratecontentresponse.text.md) + + + | + + + | + +() => string + + + | + +Returns the text string assembled from all `Part`s of the first candidate of the response, if available. Throws if the prompt or candidate was blocked. + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[enum](./generative-ai.enumstringschema.enum.md) + + + | + + + | + +string\[\] + + + | + +Possible values for this enum + + + |
+ +[format](./generative-ai.enumstringschema.format.md) + + + | + + + | + +"enum" + + + | + + + |
+ +[type](./generative-ai.enumstringschema.type.md) + + + | + + + | + +typeof [SchemaType.STRING](./generative-ai.schematype.md) + + + | + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +["@type"?](./generative-ai.errordetails.__type_.md) + + + | + + + | + +string + + + | + +_(Optional)_ + + + |
+ +[domain?](./generative-ai.errordetails.domain.md) + + + | + + + | + +string + + + | + +_(Optional)_ + + + |
+ +[metadata?](./generative-ai.errordetails.metadata.md) + + + | + + + | + +Record<string, unknown> + + + | + +_(Optional)_ + + + |
+ +[reason?](./generative-ai.errordetails.reason.md) + + + | + + + | + +string + + + | + +_(Optional)_ + + + |
code
. |
++Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[code](./generative-ai.executablecode.code.md) + + + | + + + | + +string + + + | + +The code to be executed. + + + |
+ +[language](./generative-ai.executablecode.language.md) + + + | + + + | + +[ExecutableCodeLanguage](./generative-ai.executablecodelanguage.md) + + + | + +Programming language of the `code`. + + + |
"language_unspecified"
| |
-| PYTHON | "python"
| |
++Member + + + | + +Value + + + | + +Description + + + |
---|---|---|
+ +LANGUAGE\_UNSPECIFIED + + + | + +`"language_unspecified"` + + + | + + + |
+ +PYTHON + + + | + +`"python"` + + + | + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[codeExecutionResult?](./generative-ai.executablecodepart.codeexecutionresult.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+ +[executableCode](./generative-ai.executablecodepart.executablecode.md) + + + | + + + | + +[ExecutableCode](./generative-ai.executablecode.md) + + + | + + + |
+ +[fileData?](./generative-ai.executablecodepart.filedata.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+ +[functionCall?](./generative-ai.executablecodepart.functioncall.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+ +[functionResponse?](./generative-ai.executablecodepart.functionresponse.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+ +[inlineData?](./generative-ai.executablecodepart.inlinedata.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+ +[text?](./generative-ai.executablecodepart.text.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[fileUri](./generative-ai.filedata.fileuri.md) + + + | + + + | + +string + + + | + + + |
+ +[mimeType](./generative-ai.filedata.mimetype.md) + + + | + + + | + +string + + + | + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[codeExecutionResult?](./generative-ai.filedatapart.codeexecutionresult.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+ +[executableCode?](./generative-ai.filedatapart.executablecode.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+ +[fileData](./generative-ai.filedatapart.filedata.md) + + + | + + + | + +[FileData](./generative-ai.filedata.md) + + + | + + + |
+ +[functionCall?](./generative-ai.filedatapart.functioncall.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+ +[functionResponse?](./generative-ai.filedatapart.functionresponse.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+ +[inlineData?](./generative-ai.filedatapart.inlinedata.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+ +[text?](./generative-ai.filedatapart.text.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
"BLOCKLIST"
| |
-| FINISH\_REASON\_UNSPECIFIED | "FINISH_REASON_UNSPECIFIED"
| |
-| LANGUAGE | "LANGUAGE"
| |
-| MALFORMED\_FUNCTION\_CALL | "MALFORMED_FUNCTION_CALL"
| |
-| MAX\_TOKENS | "MAX_TOKENS"
| |
-| OTHER | "OTHER"
| |
-| PROHIBITED\_CONTENT | "PROHIBITED_CONTENT"
| |
-| RECITATION | "RECITATION"
| |
-| SAFETY | "SAFETY"
| |
-| SPII | "SPII"
| |
-| STOP | "STOP"
| |
++Member + + + | + +Value + + + | + +Description + + + |
---|---|---|
+ +BLOCKLIST + + + | + +`"BLOCKLIST"` + + + | + + + |
+ +FINISH\_REASON\_UNSPECIFIED + + + | + +`"FINISH_REASON_UNSPECIFIED"` + + + | + + + |
+ +LANGUAGE + + + | + +`"LANGUAGE"` + + + | + + + |
+ +MALFORMED\_FUNCTION\_CALL + + + | + +`"MALFORMED_FUNCTION_CALL"` + + + | + + + |
+ +MAX\_TOKENS + + + | + +`"MAX_TOKENS"` + + + | + + + |
+ +OTHER + + + | + +`"OTHER"` + + + | + + + |
+ +PROHIBITED\_CONTENT + + + | + +`"PROHIBITED_CONTENT"` + + + | + + + |
+ +RECITATION + + + | + +`"RECITATION"` + + + | + + + |
+ +SAFETY + + + | + +`"SAFETY"` + + + | + + + |
+ +SPII + + + | + +`"SPII"` + + + | + + + |
+ +STOP + + + | + +`"STOP"` + + + | + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[args](./generative-ai.functioncall.args.md) + + + | + + + | + +object + + + | + + + |
+ +[name](./generative-ai.functioncall.name.md) + + + | + + + | + +string + + + | + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[allowedFunctionNames?](./generative-ai.functioncallingconfig.allowedfunctionnames.md) + + + | + + + | + +string\[\] + + + | + +_(Optional)_ + + + |
+ +[mode?](./generative-ai.functioncallingconfig.mode.md) + + + | + + + | + +[FunctionCallingMode](./generative-ai.functioncallingmode.md) + + + | + +_(Optional)_ + + + |
"ANY"
| |
-| AUTO | "AUTO"
| |
-| MODE\_UNSPECIFIED | "MODE_UNSPECIFIED"
| |
-| NONE | "NONE"
| |
++Member + + + | + +Value + + + | + +Description + + + |
---|---|---|
+ +ANY + + + | + +`"ANY"` + + + | + + + |
+ +AUTO + + + | + +`"AUTO"` + + + | + + + |
+ +MODE\_UNSPECIFIED + + + | + +`"MODE_UNSPECIFIED"` + + + | + + + |
+ +NONE + + + | + +`"NONE"` + + + | + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[codeExecutionResult?](./generative-ai.functioncallpart.codeexecutionresult.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+ +[executableCode?](./generative-ai.functioncallpart.executablecode.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+ +[fileData?](./generative-ai.functioncallpart.filedata.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+ +[functionCall](./generative-ai.functioncallpart.functioncall.md) + + + | + + + | + +[FunctionCall](./generative-ai.functioncall.md) + + + | + + + |
+ +[functionResponse?](./generative-ai.functioncallpart.functionresponse.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+ +[inlineData?](./generative-ai.functioncallpart.inlinedata.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+ +[text?](./generative-ai.functioncallpart.text.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[description?](./generative-ai.functiondeclaration.description.md) + + + | + + + | + +string + + + | + +_(Optional)_ Optional. Description and purpose of the function. Model uses it to decide how and whether to call the function. + + + |
+ +[name](./generative-ai.functiondeclaration.name.md) + + + | + + + | + +string + + + | + +The name of the function to call. Must start with a letter or an underscore. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a max length of 64. + + + |
+ +[parameters?](./generative-ai.functiondeclaration.parameters.md) + + + | + + + | + +[FunctionDeclarationSchema](./generative-ai.functiondeclarationschema.md) + + + | + +_(Optional)_ Optional. Describes the parameters to this function in JSON Schema Object format. Reflects the Open API 3.03 Parameter Object. string Key: the name of the parameter. Parameter names are case sensitive. Schema Value: the Schema defining the type used for the parameter. For function with no parameters, this can be left unset. + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[description?](./generative-ai.functiondeclarationschema.description.md) + + + | + + + | + +string + + + | + +_(Optional)_ Optional. Description of the parameter. + + + |
+ +[properties](./generative-ai.functiondeclarationschema.properties.md) + + + | + + + | + +{ \[k: string\]: [FunctionDeclarationSchemaProperty](./generative-ai.functiondeclarationschemaproperty.md); } + + + | + +The format of the parameter. + + + |
+ +[required?](./generative-ai.functiondeclarationschema.required.md) + + + | + + + | + +string\[\] + + + | + +_(Optional)_ Optional. Array of required parameters. + + + |
+ +[type](./generative-ai.functiondeclarationschema.type.md) + + + | + + + | + +[SchemaType](./generative-ai.schematype.md) + + + | + +The type of the parameter. + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[functionDeclarations?](./generative-ai.functiondeclarationstool.functiondeclarations.md) + + + | + + + | + +[FunctionDeclaration](./generative-ai.functiondeclaration.md)\[\] + + + | + +_(Optional)_ Optional. One or more function declarations to be passed to the model along with the current user query. Model may decide to call a subset of these functions by populating \[FunctionCall\]\[content.part.functionCall\] in the response. User should provide a \[FunctionResponse\]\[content.part.functionResponse\] for each function call in the next turn. Based on the function responses, Model will generate the final response back to the user. Maximum 64 function declarations can be provided. + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[name](./generative-ai.functionresponse.name.md) + + + | + + + | + +string + + + | + + + |
+ +[response](./generative-ai.functionresponse.response.md) + + + | + + + | + +object + + + | + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[codeExecutionResult?](./generative-ai.functionresponsepart.codeexecutionresult.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+ +[executableCode?](./generative-ai.functionresponsepart.executablecode.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+ +[fileData?](./generative-ai.functionresponsepart.filedata.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+ +[functionCall?](./generative-ai.functionresponsepart.functioncall.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+ +[functionResponse](./generative-ai.functionresponsepart.functionresponse.md) + + + | + + + | + +[FunctionResponse](./generative-ai.functionresponse.md) + + + | + + + |
+ +[inlineData?](./generative-ai.functionresponsepart.inlinedata.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+ +[text?](./generative-ai.functionresponsepart.text.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[avgLogprobs?](./generative-ai.generatecontentcandidate.avglogprobs.md) + + + | + + + | + +number + + + | + +_(Optional)_ Average log probability score of the candidate. + + + |
+ +[citationMetadata?](./generative-ai.generatecontentcandidate.citationmetadata.md) + + + | + + + | + +[CitationMetadata](./generative-ai.citationmetadata.md) + + + | + +_(Optional)_ + + + |
+ +[content](./generative-ai.generatecontentcandidate.content.md) + + + | + + + | + +[Content](./generative-ai.content.md) + + + | + + + |
+ +[finishMessage?](./generative-ai.generatecontentcandidate.finishmessage.md) + + + | + + + | + +string + + + | + +_(Optional)_ + + + |
+ +[finishReason?](./generative-ai.generatecontentcandidate.finishreason.md) + + + | + + + | + +[FinishReason](./generative-ai.finishreason.md) + + + | + +_(Optional)_ + + + |
+ +[groundingMetadata?](./generative-ai.generatecontentcandidate.groundingmetadata.md) + + + | + + + | + +[GroundingMetadata](./generative-ai.groundingmetadata.md) + + + | + +_(Optional)_ Search grounding metadata. + + + |
+ +[index](./generative-ai.generatecontentcandidate.index.md) + + + | + + + | + +number + + + | + + + |
+ +[logprobsResult?](./generative-ai.generatecontentcandidate.logprobsresult.md) + + + | + + + | + +[LogprobsResult](./generative-ai.logprobsresult.md) + + + | + +_(Optional)_ Log-likelihood scores for the response tokens and top tokens. + + + |
+ +[safetyRatings?](./generative-ai.generatecontentcandidate.safetyratings.md) + + + | + + + | + +[SafetyRating](./generative-ai.safetyrating.md)\[\] + + + | + +_(Optional)_ + + + |
CachedContent
and not the cache object itself. |
-| [contents](./generative-ai.generatecontentrequest.contents.md) | | [Content](./generative-ai.content.md)\[\] | |
-| [systemInstruction?](./generative-ai.generatecontentrequest.systeminstruction.md) | | string \| [Part](./generative-ai.part.md) \| [Content](./generative-ai.content.md) | _(Optional)_ |
-| [toolConfig?](./generative-ai.generatecontentrequest.toolconfig.md) | | [ToolConfig](./generative-ai.toolconfig.md) | _(Optional)_ |
-| [tools?](./generative-ai.generatecontentrequest.tools.md) | | [Tool](./generative-ai.tool.md)\[\] | _(Optional)_ |
++Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[cachedContent?](./generative-ai.generatecontentrequest.cachedcontent.md) + + + | + + + | + +string + + + | + +_(Optional)_ This is the name of a `CachedContent` and not the cache object itself. + + + |
+ +[contents](./generative-ai.generatecontentrequest.contents.md) + + + | + + + | + +[Content](./generative-ai.content.md)\[\] + + + | + + + |
+ +[systemInstruction?](./generative-ai.generatecontentrequest.systeminstruction.md) + + + | + + + | + +string \| [Part](./generative-ai.part.md) \| [Content](./generative-ai.content.md) + + + | + +_(Optional)_ + + + |
+ +[toolConfig?](./generative-ai.generatecontentrequest.toolconfig.md) + + + | + + + | + +[ToolConfig](./generative-ai.toolconfig.md) + + + | + +_(Optional)_ + + + |
+ +[tools?](./generative-ai.generatecontentrequest.tools.md) + + + | + + + | + +[Tool](./generative-ai.tool.md)\[\] + + + | + +_(Optional)_ + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[candidates?](./generative-ai.generatecontentresponse.candidates.md) + + + | + + + | + +[GenerateContentCandidate](./generative-ai.generatecontentcandidate.md)\[\] + + + | + +_(Optional)_ Candidate responses from the model. + + + |
+ +[promptFeedback?](./generative-ai.generatecontentresponse.promptfeedback.md) + + + | + + + | + +[PromptFeedback](./generative-ai.promptfeedback.md) + + + | + +_(Optional)_ The prompt's feedback related to the content filters. + + + |
+ +[usageMetadata?](./generative-ai.generatecontentresponse.usagemetadata.md) + + + | + + + | + +[UsageMetadata](./generative-ai.usagemetadata.md) + + + | + +_(Optional)_ Metadata on the generation request's token usage. + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[response](./generative-ai.generatecontentresult.response.md) + + + | + + + | + +[EnhancedGenerateContentResponse](./generative-ai.enhancedgeneratecontentresponse.md) + + + | + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[response](./generative-ai.generatecontentstreamresult.response.md) + + + | + + + | + +Promise<[EnhancedGenerateContentResponse](./generative-ai.enhancedgeneratecontentresponse.md)> + + + | + + + |
+ +[stream](./generative-ai.generatecontentstreamresult.stream.md) + + + | + + + | + +AsyncGenerator<[EnhancedGenerateContentResponse](./generative-ai.enhancedgeneratecontentresponse.md)> + + + | + + + |
text/plain
: (default) Text output. application/json
: JSON response in the candidates. |
-| [responseSchema?](./generative-ai.generationconfig.responseschema.md) | | [ResponseSchema](./generative-ai.responseschema.md) | _(Optional)_ Output response schema of the generated candidate text. Note: This only applies when the specified responseMIMEType
supports a schema; currently this is limited to application/json
. |
-| [stopSequences?](./generative-ai.generationconfig.stopsequences.md) | | string\[\] | _(Optional)_ |
-| [temperature?](./generative-ai.generationconfig.temperature.md) | | number | _(Optional)_ |
-| [topK?](./generative-ai.generationconfig.topk.md) | | number | _(Optional)_ |
-| [topP?](./generative-ai.generationconfig.topp.md) | | number | _(Optional)_ |
++Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[candidateCount?](./generative-ai.generationconfig.candidatecount.md) + + + | + + + | + +number + + + | + +_(Optional)_ + + + |
+ +[frequencyPenalty?](./generative-ai.generationconfig.frequencypenalty.md) + + + | + + + | + +number + + + | + +_(Optional)_ Frequency penalty applied to the next token's logprobs, multiplied by the number of times each token has been seen in the respponse so far. + + + |
+ +[logprobs?](./generative-ai.generationconfig.logprobs.md) + + + | + + + | + +number + + + | + +_(Optional)_ Valid if responseLogProbs is set to True. This will set the number of top logprobs to return at each decoding step in the logprobsResult. + + + |
+ +[maxOutputTokens?](./generative-ai.generationconfig.maxoutputtokens.md) + + + | + + + | + +number + + + | + +_(Optional)_ + + + |
+ +[presencePenalty?](./generative-ai.generationconfig.presencepenalty.md) + + + | + + + | + +number + + + | + +_(Optional)_ Presence penalty applied to the next token's logprobs if the token has already been seen in the response. + + + |
+ +[responseLogprobs?](./generative-ai.generationconfig.responselogprobs.md) + + + | + + + | + +boolean + + + | + +_(Optional)_ If True, export the logprobs results in response. + + + |
+ +[responseMimeType?](./generative-ai.generationconfig.responsemimetype.md) + + + | + + + | + +string + + + | + +_(Optional)_ Output response mimetype of the generated candidate text. Supported mimetype: `text/plain`: (default) Text output. `application/json`: JSON response in the candidates. + + + |
+ +[responseSchema?](./generative-ai.generationconfig.responseschema.md) + + + | + + + | + +[ResponseSchema](./generative-ai.responseschema.md) + + + | + +_(Optional)_ Output response schema of the generated candidate text. Note: This only applies when the specified `responseMIMEType` supports a schema; currently this is limited to `application/json`. + + + |
+ +[stopSequences?](./generative-ai.generationconfig.stopsequences.md) + + + | + + + | + +string\[\] + + + | + +_(Optional)_ + + + |
+ +[temperature?](./generative-ai.generationconfig.temperature.md) + + + | + + + | + +number + + + | + +_(Optional)_ + + + |
+ +[topK?](./generative-ai.generationconfig.topk.md) + + + | + + + | + +number + + + | + +_(Optional)_ + + + |
+ +[topP?](./generative-ai.generationconfig.topp.md) + + + | + + + | + +number + + + | + +_(Optional)_ + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[data](./generative-ai.generativecontentblob.data.md) + + + | + + + | + +string + + + | + +Image as a base64 string. + + + |
+ +[mimeType](./generative-ai.generativecontentblob.mimetype.md) + + + | + + + | + +string + + + | + + + |
+Parameter + + + | + +Type + + + | + +Description + + + |
---|---|---|
+ +apiKey + + + | + +string + + + | + + + |
+ +modelParams + + + | + +[ModelParams](./generative-ai.modelparams.md) + + + | + + + |
+ +\_requestOptions + + + | + +[RequestOptions](./generative-ai.requestoptions.md) + + + | + +_(Optional)_ + + + |
+Parameter + + + | + +Type + + + | + +Description + + + |
---|---|---|
+ +batchEmbedContentRequest + + + | + +[BatchEmbedContentsRequest](./generative-ai.batchembedcontentsrequest.md) + + + | + + + |
+ +requestOptions + + + | + +[SingleRequestOptions](./generative-ai.singlerequestoptions.md) + + + | + +_(Optional)_ + + + |
+Parameter + + + | + +Type + + + | + +Description + + + |
---|---|---|
+ +request + + + | + +[CountTokensRequest](./generative-ai.counttokensrequest.md) \| string \| Array<string \| [Part](./generative-ai.part.md)> + + + | + + + |
+ +requestOptions + + + | + +[SingleRequestOptions](./generative-ai.singlerequestoptions.md) + + + | + +_(Optional)_ + + + |
+Parameter + + + | + +Type + + + | + +Description + + + |
---|---|---|
+ +request + + + | + +[EmbedContentRequest](./generative-ai.embedcontentrequest.md) \| string \| Array<string \| [Part](./generative-ai.part.md)> + + + | + + + |
+ +requestOptions + + + | + +[SingleRequestOptions](./generative-ai.singlerequestoptions.md) + + + | + +_(Optional)_ + + + |
+Parameter + + + | + +Type + + + | + +Description + + + |
---|---|---|
+ +request + + + | + +[GenerateContentRequest](./generative-ai.generatecontentrequest.md) \| string \| Array<string \| [Part](./generative-ai.part.md)> + + + | + + + |
+ +requestOptions + + + | + +[SingleRequestOptions](./generative-ai.singlerequestoptions.md) + + + | + +_(Optional)_ + + + |
+Parameter + + + | + +Type + + + | + +Description + + + |
---|---|---|
+ +request + + + | + +[GenerateContentRequest](./generative-ai.generatecontentrequest.md) \| string \| Array<string \| [Part](./generative-ai.part.md)> + + + | + + + |
+ +requestOptions + + + | + +[SingleRequestOptions](./generative-ai.singlerequestoptions.md) + + + | + +_(Optional)_ + + + |
GenerativeModel
class |
++ +Constructor + + + | + +Modifiers + + + | + +Description + + + |
---|---|---|
+ +[(constructor)(apiKey, modelParams, \_requestOptions)](./generative-ai.generativemodel._constructor_.md) + + + | + + + | + +Constructs a new instance of the `GenerativeModel` class + + + |
+ +Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[apiKey](./generative-ai.generativemodel.apikey.md) + + + | + + + | + +string + + + | + + + |
+ +[cachedContent](./generative-ai.generativemodel.cachedcontent.md) + + + | + + + | + +[CachedContent](./generative-ai.cachedcontent.md) + + + | + + + |
+ +[generationConfig](./generative-ai.generativemodel.generationconfig.md) + + + | + + + | + +[GenerationConfig](./generative-ai.generationconfig.md) + + + | + + + |
+ +[model](./generative-ai.generativemodel.model.md) + + + | + + + | + +string + + + | + + + |
+ +[safetySettings](./generative-ai.generativemodel.safetysettings.md) + + + | + + + | + +[SafetySetting](./generative-ai.safetysetting.md)\[\] + + + | + + + |
+ +[systemInstruction?](./generative-ai.generativemodel.systeminstruction.md) + + + | + + + | + +[Content](./generative-ai.content.md) + + + | + +_(Optional)_ + + + |
+ +[toolConfig?](./generative-ai.generativemodel.toolconfig.md) + + + | + + + | + +[ToolConfig](./generative-ai.toolconfig.md) + + + | + +_(Optional)_ + + + |
+ +[tools?](./generative-ai.generativemodel.tools.md) + + + | + + + | + +[Tool](./generative-ai.tool.md)\[\] + + + | + +_(Optional)_ + + + |
Embeds an array of [EmbedContentRequest](./generative-ai.embedcontentrequest.md)s.
Fields set in the optional [SingleRequestOptions](./generative-ai.singlerequestoptions.md) parameter will take precedence over the [RequestOptions](./generative-ai.requestoptions.md) values provided to [GoogleGenerativeAI.getGenerativeModel()](./generative-ai.googlegenerativeai.getgenerativemodel.md).
| -| [countTokens(request, requestOptions)](./generative-ai.generativemodel.counttokens.md) | |Counts the tokens in the provided request.
Fields set in the optional [SingleRequestOptions](./generative-ai.singlerequestoptions.md) parameter will take precedence over the [RequestOptions](./generative-ai.requestoptions.md) values provided to [GoogleGenerativeAI.getGenerativeModel()](./generative-ai.googlegenerativeai.getgenerativemodel.md).
| -| [embedContent(request, requestOptions)](./generative-ai.generativemodel.embedcontent.md) | |Embeds the provided content.
Fields set in the optional [SingleRequestOptions](./generative-ai.singlerequestoptions.md) parameter will take precedence over the [RequestOptions](./generative-ai.requestoptions.md) values provided to [GoogleGenerativeAI.getGenerativeModel()](./generative-ai.googlegenerativeai.getgenerativemodel.md).
| -| [generateContent(request, requestOptions)](./generative-ai.generativemodel.generatecontent.md) | |Makes a single non-streaming call to the model and returns an object containing a single [GenerateContentResponse](./generative-ai.generatecontentresponse.md).
Fields set in the optional [SingleRequestOptions](./generative-ai.singlerequestoptions.md) parameter will take precedence over the [RequestOptions](./generative-ai.requestoptions.md) values provided to [GoogleGenerativeAI.getGenerativeModel()](./generative-ai.googlegenerativeai.getgenerativemodel.md).
| -| [generateContentStream(request, requestOptions)](./generative-ai.generativemodel.generatecontentstream.md) | |Makes a single streaming call to the model and returns an object containing an iterable stream that iterates over all chunks in the streaming response as well as a promise that returns the final aggregated response.
Fields set in the optional [SingleRequestOptions](./generative-ai.singlerequestoptions.md) parameter will take precedence over the [RequestOptions](./generative-ai.requestoptions.md) values provided to [GoogleGenerativeAI.getGenerativeModel()](./generative-ai.googlegenerativeai.getgenerativemodel.md).
| -| [startChat(startChatParams)](./generative-ai.generativemodel.startchat.md) | | Gets a new [ChatSession](./generative-ai.chatsession.md) instance which can be used for multi-turn chats. | ++ +Method + + + | + +Modifiers + + + | + +Description + + + |
---|---|---|
+ +[batchEmbedContents(batchEmbedContentRequest, requestOptions)](./generative-ai.generativemodel.batchembedcontents.md) + + + | + + + | + +Embeds an array of [EmbedContentRequest](./generative-ai.embedcontentrequest.md)s. + +Fields set in the optional [SingleRequestOptions](./generative-ai.singlerequestoptions.md) parameter will take precedence over the [RequestOptions](./generative-ai.requestoptions.md) values provided to [GoogleGenerativeAI.getGenerativeModel()](./generative-ai.googlegenerativeai.getgenerativemodel.md). + + + |
+ +[countTokens(request, requestOptions)](./generative-ai.generativemodel.counttokens.md) + + + | + + + | + +Counts the tokens in the provided request. + +Fields set in the optional [SingleRequestOptions](./generative-ai.singlerequestoptions.md) parameter will take precedence over the [RequestOptions](./generative-ai.requestoptions.md) values provided to [GoogleGenerativeAI.getGenerativeModel()](./generative-ai.googlegenerativeai.getgenerativemodel.md). + + + |
+ +[embedContent(request, requestOptions)](./generative-ai.generativemodel.embedcontent.md) + + + | + + + | + +Embeds the provided content. + +Fields set in the optional [SingleRequestOptions](./generative-ai.singlerequestoptions.md) parameter will take precedence over the [RequestOptions](./generative-ai.requestoptions.md) values provided to [GoogleGenerativeAI.getGenerativeModel()](./generative-ai.googlegenerativeai.getgenerativemodel.md). + + + |
+ +[generateContent(request, requestOptions)](./generative-ai.generativemodel.generatecontent.md) + + + | + + + | + +Makes a single non-streaming call to the model and returns an object containing a single [GenerateContentResponse](./generative-ai.generatecontentresponse.md). + +Fields set in the optional [SingleRequestOptions](./generative-ai.singlerequestoptions.md) parameter will take precedence over the [RequestOptions](./generative-ai.requestoptions.md) values provided to [GoogleGenerativeAI.getGenerativeModel()](./generative-ai.googlegenerativeai.getgenerativemodel.md). + + + |
+ +[generateContentStream(request, requestOptions)](./generative-ai.generativemodel.generatecontentstream.md) + + + | + + + | + +Makes a single streaming call to the model and returns an object containing an iterable stream that iterates over all chunks in the streaming response as well as a promise that returns the final aggregated response. + +Fields set in the optional [SingleRequestOptions](./generative-ai.singlerequestoptions.md) parameter will take precedence over the [RequestOptions](./generative-ai.requestoptions.md) values provided to [GoogleGenerativeAI.getGenerativeModel()](./generative-ai.googlegenerativeai.getgenerativemodel.md). + + + |
+ +[startChat(startChatParams)](./generative-ai.generativemodel.startchat.md) + + + | + + + | + +Gets a new [ChatSession](./generative-ai.chatsession.md) instance which can be used for multi-turn chats. + + |
+Parameter + + + | + +Type + + + | + +Description + + + |
---|---|---|
+ +startChatParams + + + | + +[StartChatParams](./generative-ai.startchatparams.md) + + + | + +_(Optional)_ + + + |
+Parameter + + + | + +Type + + + | + +Description + + + |
---|---|---|
+ +apiKey + + + | + +string + + + | + + + |
+Parameter + + + | + +Type + + + | + +Description + + + |
---|---|---|
+ +modelParams + + + | + +[ModelParams](./generative-ai.modelparams.md) + + + | + + + |
+ +requestOptions + + + | + +[RequestOptions](./generative-ai.requestoptions.md) + + + | + +_(Optional)_ + + + |
+Parameter + + + | + +Type + + + | + +Description + + + |
---|---|---|
+ +cachedContent + + + | + +[CachedContent](./generative-ai.cachedcontent.md) + + + | + + + |
+ +modelParams + + + | + +Partial<[ModelParams](./generative-ai.modelparams.md)> + + + | + +_(Optional)_ + + + |
+ +requestOptions + + + | + +[RequestOptions](./generative-ai.requestoptions.md) + + + | + +_(Optional)_ + + + |
GoogleGenerativeAI
class |
++ +Constructor + + + | + +Modifiers + + + | + +Description + + + |
---|---|---|
+ +[(constructor)(apiKey)](./generative-ai.googlegenerativeai._constructor_.md) + + + | + + + | + +Constructs a new instance of the `GoogleGenerativeAI` class + + + |
+ +Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[apiKey](./generative-ai.googlegenerativeai.apikey.md) + + + | + + + | + +string + + + | + + + |
+ +Method + + + | + +Modifiers + + + | + +Description + + + |
---|---|---|
+ +[getGenerativeModel(modelParams, requestOptions)](./generative-ai.googlegenerativeai.getgenerativemodel.md) + + + | + + + | + +Gets a [GenerativeModel](./generative-ai.generativemodel.md) instance for the provided model name. + + + |
+ +[getGenerativeModelFromCachedContent(cachedContent, modelParams, requestOptions)](./generative-ai.googlegenerativeai.getgenerativemodelfromcachedcontent.md) + + + | + + + | + +Creates a [GenerativeModel](./generative-ai.generativemodel.md) instance from provided content cache. + + |
+Parameter + + + | + +Type + + + | + +Description + + + |
---|---|---|
+ +message + + + | + +string + + + | + + + |
GoogleGenerativeAIError
class |
++Constructor + + + | + +Modifiers + + + | + +Description + + + |
---|---|---|
+ +[(constructor)(message)](./generative-ai.googlegenerativeaierror._constructor_.md) + + + | + + + | + +Constructs a new instance of the `GoogleGenerativeAIError` class + + + |
+Parameter + + + | + +Type + + + | + +Description + + + |
---|---|---|
+ +message + + + | + +string + + + | + + + |
+ +status + + + | + +number + + + | + +_(Optional)_ + + + |
+ +statusText + + + | + +string + + + | + +_(Optional)_ + + + |
+ +errorDetails + + + | + +[ErrorDetails](./generative-ai.errordetails.md)\[\] + + + | + +_(Optional)_ + + + |
GoogleGenerativeAIFetchError
class |
++ +Constructor + + + | + +Modifiers + + + | + +Description + + + |
---|---|---|
+ +[(constructor)(message, status, statusText, errorDetails)](./generative-ai.googlegenerativeaifetcherror._constructor_.md) + + + | + + + | + +Constructs a new instance of the `GoogleGenerativeAIFetchError` class + + + |
+ +Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[errorDetails?](./generative-ai.googlegenerativeaifetcherror.errordetails.md) + + + | + + + | + +[ErrorDetails](./generative-ai.errordetails.md)\[\] + + + | + +_(Optional)_ + + + |
+ +[status?](./generative-ai.googlegenerativeaifetcherror.status.md) + + + | + + + | + +number + + + | + +_(Optional)_ + + + |
+ +[statusText?](./generative-ai.googlegenerativeaifetcherror.statustext.md) + + + | + + + | + +string + + + | + +_(Optional)_ + + |
+Parameter + + + | + +Type + + + | + +Description + + + |
---|---|---|
+ +message + + + | + +string + + + | + + + |
+ +response + + + | + +T + + + | + +_(Optional)_ + + + |
GoogleGenerativeAIResponseError
class |
++ +Constructor + + + | + +Modifiers + + + | + +Description + + + |
---|---|---|
+ +[(constructor)(message, response)](./generative-ai.googlegenerativeairesponseerror._constructor_.md) + + + | + + + | + +Constructs a new instance of the `GoogleGenerativeAIResponseError` class + + + |
+ +Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[response?](./generative-ai.googlegenerativeairesponseerror.response.md) + + + | + + + | + +T + + + | + +_(Optional)_ + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[dynamicRetrievalConfig?](./generative-ai.googlesearchretrieval.dynamicretrievalconfig.md) + + + | + + + | + +[DynamicRetrievalConfig](./generative-ai.dynamicretrievalconfig.md) + + + | + +_(Optional)_ Specifies the dynamic retrieval configuration for the given source. + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[googleSearchRetrieval?](./generative-ai.googlesearchretrievaltool.googlesearchretrieval.md) + + + | + + + | + +[GoogleSearchRetrieval](./generative-ai.googlesearchretrieval.md) + + + | + +_(Optional)_ Google search retrieval tool config. + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[web?](./generative-ai.groundingchunk.web.md) + + + | + + + | + +[GroundingChunkWeb](./generative-ai.groundingchunkweb.md) + + + | + +_(Optional)_ Chunk from the web. + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[title?](./generative-ai.groundingchunkweb.title.md) + + + | + + + | + +string + + + | + +_(Optional)_ Title of the chunk. + + + |
+ +[uri?](./generative-ai.groundingchunkweb.uri.md) + + + | + + + | + +string + + + | + +_(Optional)_ URI reference of the chunk. + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[groundingChunks?](./generative-ai.groundingmetadata.groundingchunks.md) + + + | + + + | + +[GroundingChunk](./generative-ai.groundingchunk.md)\[\] + + + | + +_(Optional)_ List of supporting references retrieved from specified grounding source. + + + |
+ +[groundingSupports?](./generative-ai.groundingmetadata.groundingsupports.md) + + + | + + + | + +[GroundingSupport](./generative-ai.groundingsupport.md)\[\] + + + | + +_(Optional)_ List of grounding support. + + + |
+ +[retrievalMetadata?](./generative-ai.groundingmetadata.retrievalmetadata.md) + + + | + + + | + +[RetrievalMetadata](./generative-ai.retrievalmetadata.md) + + + | + +_(Optional)_ Metadata related to retrieval in the grounding flow. + + + |
+ +[searchEntryPoint?](./generative-ai.groundingmetadata.searchentrypoint.md) + + + | + + + | + +[SearchEntryPoint](./generative-ai.searchentrypoint.md) + + + | + +_(Optional)_ Google search entry for the following-up web searches. + + + |
+ +[webSearchQueries](./generative-ai.groundingmetadata.websearchqueries.md) + + + | + + + | + +string\[\] + + + | + +\* Web search queries for the following-up web search. + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[confidenceScores?](./generative-ai.groundingsupport.confidencescores.md) + + + | + + + | + +number\[\] + + + | + +_(Optional)_ Confidence score of the support references. Ranges from 0 to 1. 1 is the most confident. This list must have the same size as the grounding\_chunk\_indices. + + + |
+ +[groundingChunckIndices?](./generative-ai.groundingsupport.groundingchunckindices.md) + + + | + + + | + +number\[\] + + + | + +_(Optional)_ A list of indices (into 'grounding\_chunk') specifying the citations associated with the claim. For instance \[1,3,4\] means that grounding\_chunk\[1\], grounding\_chunk\[3\], grounding\_chunk\[4\] are the retrieved content attributed to the claim. + + + |
+ +[segment?](./generative-ai.groundingsupport.segment.md) + + + | + + + | + +string + + + | + +_(Optional)_ URI reference of the chunk. + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[endIndex?](./generative-ai.groundingsupportsegment.endindex.md) + + + | + + + | + +number + + + | + +_(Optional)_ End index in the given Part, measured in bytes. Offset from the start of the Part, exclusive, starting at zero. + + + |
+ +[partIndex?](./generative-ai.groundingsupportsegment.partindex.md) + + + | + + + | + +number + + + | + +_(Optional)_ The index of a Part object within its parent Content object. + + + |
+ +[startIndex?](./generative-ai.groundingsupportsegment.startindex.md) + + + | + + + | + +number + + + | + +_(Optional)_ Start index in the given Part, measured in bytes. Offset from the start of the Part, inclusive, starting at zero. + + + |
+ +[text?](./generative-ai.groundingsupportsegment.text.md) + + + | + + + | + +string + + + | + +_(Optional)_ The text corresponding to the segment from the response. + + + |
"BLOCK_LOW_AND_ABOVE"
| Content with NEGLIGIBLE will be allowed. |
-| BLOCK\_MEDIUM\_AND\_ABOVE | "BLOCK_MEDIUM_AND_ABOVE"
| Content with NEGLIGIBLE and LOW will be allowed. |
-| BLOCK\_NONE | "BLOCK_NONE"
| All content will be allowed. |
-| BLOCK\_ONLY\_HIGH | "BLOCK_ONLY_HIGH"
| Content with NEGLIGIBLE, LOW, and MEDIUM will be allowed. |
-| HARM\_BLOCK\_THRESHOLD\_UNSPECIFIED | "HARM_BLOCK_THRESHOLD_UNSPECIFIED"
| Threshold is unspecified. |
++Member + + + | + +Value + + + | + +Description + + + |
---|---|---|
+ +BLOCK\_LOW\_AND\_ABOVE + + + | + +`"BLOCK_LOW_AND_ABOVE"` + + + | + +Content with NEGLIGIBLE will be allowed. + + + |
+ +BLOCK\_MEDIUM\_AND\_ABOVE + + + | + +`"BLOCK_MEDIUM_AND_ABOVE"` + + + | + +Content with NEGLIGIBLE and LOW will be allowed. + + + |
+ +BLOCK\_NONE + + + | + +`"BLOCK_NONE"` + + + | + +All content will be allowed. + + + |
+ +BLOCK\_ONLY\_HIGH + + + | + +`"BLOCK_ONLY_HIGH"` + + + | + +Content with NEGLIGIBLE, LOW, and MEDIUM will be allowed. + + + |
+ +HARM\_BLOCK\_THRESHOLD\_UNSPECIFIED + + + | + +`"HARM_BLOCK_THRESHOLD_UNSPECIFIED"` + + + | + +Threshold is unspecified. + + + |
"HARM_CATEGORY_CIVIC_INTEGRITY"
| |
-| HARM\_CATEGORY\_DANGEROUS\_CONTENT | "HARM_CATEGORY_DANGEROUS_CONTENT"
| |
-| HARM\_CATEGORY\_HARASSMENT | "HARM_CATEGORY_HARASSMENT"
| |
-| HARM\_CATEGORY\_HATE\_SPEECH | "HARM_CATEGORY_HATE_SPEECH"
| |
-| HARM\_CATEGORY\_SEXUALLY\_EXPLICIT | "HARM_CATEGORY_SEXUALLY_EXPLICIT"
| |
-| HARM\_CATEGORY\_UNSPECIFIED | "HARM_CATEGORY_UNSPECIFIED"
| |
++Member + + + | + +Value + + + | + +Description + + + |
---|---|---|
+ +HARM\_CATEGORY\_CIVIC\_INTEGRITY + + + | + +`"HARM_CATEGORY_CIVIC_INTEGRITY"` + + + | + + + |
+ +HARM\_CATEGORY\_DANGEROUS\_CONTENT + + + | + +`"HARM_CATEGORY_DANGEROUS_CONTENT"` + + + | + + + |
+ +HARM\_CATEGORY\_HARASSMENT + + + | + +`"HARM_CATEGORY_HARASSMENT"` + + + | + + + |
+ +HARM\_CATEGORY\_HATE\_SPEECH + + + | + +`"HARM_CATEGORY_HATE_SPEECH"` + + + | + + + |
+ +HARM\_CATEGORY\_SEXUALLY\_EXPLICIT + + + | + +`"HARM_CATEGORY_SEXUALLY_EXPLICIT"` + + + | + + + |
+ +HARM\_CATEGORY\_UNSPECIFIED + + + | + +`"HARM_CATEGORY_UNSPECIFIED"` + + + | + + + |
"HARM_PROBABILITY_UNSPECIFIED"
| Probability is unspecified. |
-| HIGH | "HIGH"
| Content has a high chance of being unsafe. |
-| LOW | "LOW"
| Content has a low chance of being unsafe. |
-| MEDIUM | "MEDIUM"
| Content has a medium chance of being unsafe. |
-| NEGLIGIBLE | "NEGLIGIBLE"
| Content has a negligible chance of being unsafe. |
++Member + + + | + +Value + + + | + +Description + + + |
---|---|---|
+ +HARM\_PROBABILITY\_UNSPECIFIED + + + | + +`"HARM_PROBABILITY_UNSPECIFIED"` + + + | + +Probability is unspecified. + + + |
+ +HIGH + + + | + +`"HIGH"` + + + | + +Content has a high chance of being unsafe. + + + |
+ +LOW + + + | + +`"LOW"` + + + | + +Content has a low chance of being unsafe. + + + |
+ +MEDIUM + + + | + +`"MEDIUM"` + + + | + +Content has a medium chance of being unsafe. + + + |
+ +NEGLIGIBLE + + + | + +`"NEGLIGIBLE"` + + + | + +Content has a negligible chance of being unsafe. + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[codeExecutionResult?](./generative-ai.inlinedatapart.codeexecutionresult.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+ +[executableCode?](./generative-ai.inlinedatapart.executablecode.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+ +[fileData?](./generative-ai.inlinedatapart.filedata.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+ +[functionCall?](./generative-ai.inlinedatapart.functioncall.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+ +[functionResponse?](./generative-ai.inlinedatapart.functionresponse.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+ +[inlineData](./generative-ai.inlinedatapart.inlinedata.md) + + + | + + + | + +[GenerativeContentBlob](./generative-ai.generativecontentblob.md) + + + | + + + |
+ +[text?](./generative-ai.inlinedatapart.text.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[format?](./generative-ai.integerschema.format.md) + + + | + + + | + +"int32" \| "int64" + + + | + +_(Optional)_ Optional. The format of the number. + + + |
+ +[type](./generative-ai.integerschema.type.md) + + + | + + + | + +typeof [SchemaType.INTEGER](./generative-ai.schematype.md) + + + | + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[logProbability](./generative-ai.logprobscandidate.logprobability.md) + + + | + + + | + +number + + + | + +The candidate's log probability. + + + |
+ +[token](./generative-ai.logprobscandidate.token.md) + + + | + + + | + +string + + + | + +The candidate's token string value. + + + |
+ +[tokenID](./generative-ai.logprobscandidate.tokenid.md) + + + | + + + | + +number + + + | + +The candidate's token id value. + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[chosenCandidates](./generative-ai.logprobsresult.chosencandidates.md) + + + | + + + | + +[LogprobsCandidate](./generative-ai.logprobscandidate.md)\[\] + + + | + +Length = total number of decoding steps. The chosen candidates may or may not be in topCandidates. + + + |
+ +[topCandidates](./generative-ai.logprobsresult.topcandidates.md) + + + | + + + | + +[TopCandidates](./generative-ai.topcandidates.md)\[\] + + + | + +Length = total number of decoding steps. + + + |
+ +Class + + + | + +Description + + + |
---|---|
+ +[ChatSession](./generative-ai.chatsession.md) + + + | + +ChatSession class that enables sending chat messages and stores history of sent and received messages so far. + + + |
+ +[GenerativeModel](./generative-ai.generativemodel.md) + + + | + +Class for generative model APIs. + + + |
+ +[GoogleGenerativeAI](./generative-ai.googlegenerativeai.md) + + + | + +Top-level class for this SDK + + + |
+ +[GoogleGenerativeAIAbortError](./generative-ai.googlegenerativeaiaborterror.md) + + + | + +Error thrown when a request is aborted, either due to a timeout or intentional cancellation by the user. + + + |
+ +[GoogleGenerativeAIError](./generative-ai.googlegenerativeaierror.md) + + + | + +Basic error type for this SDK. + + + |
+ +[GoogleGenerativeAIFetchError](./generative-ai.googlegenerativeaifetcherror.md) + + + | + +Error class covering HTTP errors when calling the server. Includes HTTP status, statusText, and optional details, if provided in the server response. + + + |
+ +[GoogleGenerativeAIRequestInputError](./generative-ai.googlegenerativeairequestinputerror.md) + + + | + +Errors in the contents of a request originating from user input. + + + |
+ +[GoogleGenerativeAIResponseError](./generative-ai.googlegenerativeairesponseerror.md) + + + | + +Errors in the contents of a response from the model. This includes parsing errors, or responses including a safety block reason. + + + |
+ +Enumeration + + + | + +Description + + + |
---|---|
+ +[BlockReason](./generative-ai.blockreason.md) + + + | + +Reason that a prompt was blocked. + + + |
+ +[DynamicRetrievalMode](./generative-ai.dynamicretrievalmode.md) + + + | + +The mode of the predictor to be used in dynamic retrieval. + + + |
+ +[ExecutableCodeLanguage](./generative-ai.executablecodelanguage.md) + + + | + + + + |
+ +[FinishReason](./generative-ai.finishreason.md) + + + | + +Reason that a candidate finished. + + + |
+ +[FunctionCallingMode](./generative-ai.functioncallingmode.md) + + + | + + + + |
+ +[HarmBlockThreshold](./generative-ai.harmblockthreshold.md) + + + | + +Threshold above which a prompt or candidate will be blocked. + + + |
+ +[HarmCategory](./generative-ai.harmcategory.md) + + + | + +Harm categories that would cause prompts or candidates to be blocked. + + + |
+ +[HarmProbability](./generative-ai.harmprobability.md) + + + | + +Probability that a prompt or candidate matches a harm category. + + + |
+ +[Outcome](./generative-ai.outcome.md) + + + | + +Possible outcomes of code execution. + + + |
+ +[SchemaType](./generative-ai.schematype.md) + + + | + +Contains the list of OpenAPI data types as defined by https://swagger.io/docs/specification/data-models/data-types/ + + + |
+ +[TaskType](./generative-ai.tasktype.md) + + + | + +Task type for embedding content. + + + |
+ +Interface + + + | + +Description + + + |
---|---|
+ +[ArraySchema](./generative-ai.arrayschema.md) + + + | + +Describes an array, an ordered list of values. + + + |
+ +[BaseParams](./generative-ai.baseparams.md) + + + | + +Base parameters for a number of methods. + + + |
+ +[BatchEmbedContentsRequest](./generative-ai.batchembedcontentsrequest.md) + + + | + +Params for calling [GenerativeModel.batchEmbedContents()](./generative-ai.generativemodel.batchembedcontents.md) + + + |
+ +[BatchEmbedContentsResponse](./generative-ai.batchembedcontentsresponse.md) + + + | + +Response from calling [GenerativeModel.batchEmbedContents()](./generative-ai.generativemodel.batchembedcontents.md). + + + |
+ +[BooleanSchema](./generative-ai.booleanschema.md) + + + | + +Describes a boolean, either 'true' or 'false'. + + + |
+ +[CachedContent](./generative-ai.cachedcontent.md) + + + | + +Describes `CachedContent` interface for sending to the server (if creating) or received from the server (using getters or list methods). + + + |
+ +[CachedContentBase](./generative-ai.cachedcontentbase.md) + + + | + + + + |
+ +[CitationMetadata](./generative-ai.citationmetadata.md) + + + | + +Citation metadata that may be found on a [GenerateContentCandidate](./generative-ai.generatecontentcandidate.md). + + + |
+ +[CitationSource](./generative-ai.citationsource.md) + + + | + +A single citation source. + + + |
+ +[CodeExecutionResult](./generative-ai.codeexecutionresult.md) + + + | + +Result of executing the `ExecutableCode`. Only generated when using code execution, and always follows a `Part` containing the `ExecutableCode`. + + + |
+ +[CodeExecutionResultPart](./generative-ai.codeexecutionresultpart.md) + + + | + +Content part containing the result of executed code. + + + |
+ +[CodeExecutionTool](./generative-ai.codeexecutiontool.md) + + + | + +Enables the model to execute code as part of generation. + + + |
+ +[Content](./generative-ai.content.md) + + + | + +Content type for both prompts and response candidates. + + + |
+ +[ContentEmbedding](./generative-ai.contentembedding.md) + + + | + +A single content embedding. + + + |
+ +[CountTokensRequest](./generative-ai.counttokensrequest.md) + + + | + +Params for calling [GenerativeModel.countTokens()](./generative-ai.generativemodel.counttokens.md). + +The request must contain either a [Content](./generative-ai.content.md) array or a [GenerateContentRequest](./generative-ai.generatecontentrequest.md), but not both. If both are provided then a [GoogleGenerativeAIRequestInputError](./generative-ai.googlegenerativeairequestinputerror.md) is thrown. + + + |
+ +[CountTokensResponse](./generative-ai.counttokensresponse.md) + + + | + +Response from calling [GenerativeModel.countTokens()](./generative-ai.generativemodel.counttokens.md). + + + |
+ +[DynamicRetrievalConfig](./generative-ai.dynamicretrievalconfig.md) + + + | + +Specifies the dynamic retrieval configuration for the given source. + + + |
+ +[EmbedContentRequest](./generative-ai.embedcontentrequest.md) + + + | + +Params for calling [GenerativeModel.embedContent()](./generative-ai.generativemodel.embedcontent.md) + + + |
+ +[EmbedContentResponse](./generative-ai.embedcontentresponse.md) + + + | + +Response from calling [GenerativeModel.embedContent()](./generative-ai.generativemodel.embedcontent.md). + + + |
+ +[EnhancedGenerateContentResponse](./generative-ai.enhancedgeneratecontentresponse.md) + + + | + +Response object wrapped with helper methods. + + + |
+ +[EnumStringSchema](./generative-ai.enumstringschema.md) + + + | + +Describes a string enum + + + |
+ +[ErrorDetails](./generative-ai.errordetails.md) + + + | + +Details object that may be included in an error response. + + + |
+ +[ExecutableCode](./generative-ai.executablecode.md) + + + | + +Code generated by the model that is meant to be executed, where the result is returned to the model. Only generated when using the code execution tool, in which the code will be automatically executed, and a corresponding `CodeExecutionResult` will also be generated. + + + |
+ +[ExecutableCodePart](./generative-ai.executablecodepart.md) + + + | + +Content part containing executable code generated by the model. + + + |
+ +[FileData](./generative-ai.filedata.md) + + + | + +Data pointing to a file uploaded with the Files API. + + + |
+ +[FileDataPart](./generative-ai.filedatapart.md) + + + | + +Content part interface if the part represents FileData. + + + |
+ +[FunctionCall](./generative-ai.functioncall.md) + + + | + +A predicted \[FunctionCall\] returned from the model that contains a string representing the \[FunctionDeclaration.name\] and a structured JSON object containing the parameters and their values. + + + |
+ +[FunctionCallingConfig](./generative-ai.functioncallingconfig.md) + + + | + + + + |
+ +[FunctionCallPart](./generative-ai.functioncallpart.md) + + + | + +Content part interface if the part represents a FunctionCall. + + + |
+ +[FunctionDeclaration](./generative-ai.functiondeclaration.md) + + + | + +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](./generative-ai.functiondeclarationschema.md) + + + | + +Schema for parameters passed to [FunctionDeclaration.parameters](./generative-ai.functiondeclaration.parameters.md). + + + |
+ +[FunctionDeclarationsTool](./generative-ai.functiondeclarationstool.md) + + + | + +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](./generative-ai.functionresponse.md) + + + | + +The result output from a \[FunctionCall\] that contains a string representing the \[FunctionDeclaration.name\] and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a \[FunctionCall\] made based on model prediction. + + + |
+ +[FunctionResponsePart](./generative-ai.functionresponsepart.md) + + + | + +Content part interface if the part represents FunctionResponse. + + + |
+ +[GenerateContentCandidate](./generative-ai.generatecontentcandidate.md) + + + | + +A candidate returned as part of a [GenerateContentResponse](./generative-ai.generatecontentresponse.md). + + + |
+ +[GenerateContentRequest](./generative-ai.generatecontentrequest.md) + + + | + +Request sent to `generateContent` endpoint. + + + |
+ +[GenerateContentResponse](./generative-ai.generatecontentresponse.md) + + + | + +Individual response from [GenerativeModel.generateContent()](./generative-ai.generativemodel.generatecontent.md) and [GenerativeModel.generateContentStream()](./generative-ai.generativemodel.generatecontentstream.md). `generateContentStream()` will return one in each chunk until the stream is done. + + + |
+ +[GenerateContentResult](./generative-ai.generatecontentresult.md) + + + | + +Result object returned from generateContent() call. + + + |
+ +[GenerateContentStreamResult](./generative-ai.generatecontentstreamresult.md) + + + | + +Result object returned from generateContentStream() call. Iterate over `stream` to get chunks as they come in and/or use the `response` promise to get the aggregated response when the stream is done. + + + |
+ +[GenerationConfig](./generative-ai.generationconfig.md) + + + | + +Config options for content-related requests + + + |
+ +[GenerativeContentBlob](./generative-ai.generativecontentblob.md) + + + | + +Interface for sending an image. + + + |
+ +[GoogleSearchRetrieval](./generative-ai.googlesearchretrieval.md) + + + | + +Retrieval tool that is powered by Google search. + + + |
+ +[GoogleSearchRetrievalTool](./generative-ai.googlesearchretrievaltool.md) + + + | + +Retrieval tool that is powered by Google search. + + + |
+ +[GroundingChunk](./generative-ai.groundingchunk.md) + + + | + +Grounding chunk. + + + |
+ +[GroundingChunkWeb](./generative-ai.groundingchunkweb.md) + + + | + +Chunk from the web. + + + |
+ +[GroundingMetadata](./generative-ai.groundingmetadata.md) + + + | + +Metadata returned to client when grounding is enabled. + + + |
+ +[GroundingSupport](./generative-ai.groundingsupport.md) + + + | + +Grounding support. + + + |
+ +[GroundingSupportSegment](./generative-ai.groundingsupportsegment.md) + + + | + +Segment of the content. + + + |
+ +[InlineDataPart](./generative-ai.inlinedatapart.md) + + + | + +Content part interface if the part represents an image. + + + |
+ +[IntegerSchema](./generative-ai.integerschema.md) + + + | + +Describes a JSON-encodable integer. + + + |
+ +[LogprobsCandidate](./generative-ai.logprobscandidate.md) + + + | + +Candidate for the logprobs token and score. + + + |
+ +[LogprobsResult](./generative-ai.logprobsresult.md) + + + | + +Logprobs Result + + + |
+ +[ModelParams](./generative-ai.modelparams.md) + + + | + +Params passed to [GoogleGenerativeAI.getGenerativeModel()](./generative-ai.googlegenerativeai.getgenerativemodel.md). + + + |
+ +[NumberSchema](./generative-ai.numberschema.md) + + + | + +Describes a JSON-encodable floating point number. + + + |
+ +[ObjectSchema](./generative-ai.objectschema.md) + + + | + +Describes a JSON object, a mapping of specific keys to values. + + + |
+
+[PromptFeedback](./generative-ai.promptfeedback.md)
-## Interfaces
-| Interface | Description |
-| --- | --- |
-| [ArraySchema](./generative-ai.arrayschema.md) | Describes an array, an ordered list of values. |
-| [BaseParams](./generative-ai.baseparams.md) | Base parameters for a number of methods. |
-| [BatchEmbedContentsRequest](./generative-ai.batchembedcontentsrequest.md) | Params for calling [GenerativeModel.batchEmbedContents()](./generative-ai.generativemodel.batchembedcontents.md) |
-| [BatchEmbedContentsResponse](./generative-ai.batchembedcontentsresponse.md) | Response from calling [GenerativeModel.batchEmbedContents()](./generative-ai.generativemodel.batchembedcontents.md). |
-| [BooleanSchema](./generative-ai.booleanschema.md) | Describes a boolean, either 'true' or 'false'. |
-| [CachedContent](./generative-ai.cachedcontent.md) | Describes CachedContent interface for sending to the server (if creating) or received from the server (using getters or list methods). |
-| [CachedContentBase](./generative-ai.cachedcontentbase.md) | |
-| [CitationMetadata](./generative-ai.citationmetadata.md) | Citation metadata that may be found on a [GenerateContentCandidate](./generative-ai.generatecontentcandidate.md). |
-| [CitationSource](./generative-ai.citationsource.md) | A single citation source. |
-| [CodeExecutionResult](./generative-ai.codeexecutionresult.md) | Result of executing the ExecutableCode . Only generated when using code execution, and always follows a Part containing the ExecutableCode . |
-| [CodeExecutionResultPart](./generative-ai.codeexecutionresultpart.md) | Content part containing the result of executed code. |
-| [CodeExecutionTool](./generative-ai.codeexecutiontool.md) | Enables the model to execute code as part of generation. |
-| [Content](./generative-ai.content.md) | Content type for both prompts and response candidates. |
-| [ContentEmbedding](./generative-ai.contentembedding.md) | A single content embedding. |
-| [CountTokensRequest](./generative-ai.counttokensrequest.md) | Params for calling [GenerativeModel.countTokens()](./generative-ai.generativemodel.counttokens.md). The request must contain either a [Content](./generative-ai.content.md) array or a [GenerateContentRequest](./generative-ai.generatecontentrequest.md), but not both. If both are provided then a [GoogleGenerativeAIRequestInputError](./generative-ai.googlegenerativeairequestinputerror.md) is thrown. | -| [CountTokensResponse](./generative-ai.counttokensresponse.md) | Response from calling [GenerativeModel.countTokens()](./generative-ai.generativemodel.counttokens.md). | -| [DynamicRetrievalConfig](./generative-ai.dynamicretrievalconfig.md) | Specifies the dynamic retrieval configuration for the given source. | -| [EmbedContentRequest](./generative-ai.embedcontentrequest.md) | Params for calling [GenerativeModel.embedContent()](./generative-ai.generativemodel.embedcontent.md) | -| [EmbedContentResponse](./generative-ai.embedcontentresponse.md) | Response from calling [GenerativeModel.embedContent()](./generative-ai.generativemodel.embedcontent.md). | -| [EnhancedGenerateContentResponse](./generative-ai.enhancedgeneratecontentresponse.md) | Response object wrapped with helper methods. | -| [EnumStringSchema](./generative-ai.enumstringschema.md) | Describes a string enum | -| [ErrorDetails](./generative-ai.errordetails.md) | Details object that may be included in an error response. | -| [ExecutableCode](./generative-ai.executablecode.md) | Code generated by the model that is meant to be executed, where the result is returned to the model. Only generated when using the code execution tool, in which the code will be automatically executed, and a correspondingCodeExecutionResult will also be generated. |
-| [ExecutableCodePart](./generative-ai.executablecodepart.md) | Content part containing executable code generated by the model. |
-| [FileData](./generative-ai.filedata.md) | Data pointing to a file uploaded with the Files API. |
-| [FileDataPart](./generative-ai.filedatapart.md) | Content part interface if the part represents FileData. |
-| [FunctionCall](./generative-ai.functioncall.md) | A predicted \[FunctionCall\] returned from the model that contains a string representing the \[FunctionDeclaration.name\] and a structured JSON object containing the parameters and their values. |
-| [FunctionCallingConfig](./generative-ai.functioncallingconfig.md) | |
-| [FunctionCallPart](./generative-ai.functioncallpart.md) | Content part interface if the part represents a FunctionCall. |
-| [FunctionDeclaration](./generative-ai.functiondeclaration.md) | 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](./generative-ai.functiondeclarationschema.md) | Schema for parameters passed to [FunctionDeclaration.parameters](./generative-ai.functiondeclaration.parameters.md). |
-| [FunctionDeclarationsTool](./generative-ai.functiondeclarationstool.md) | 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](./generative-ai.functionresponse.md) | The result output from a \[FunctionCall\] that contains a string representing the \[FunctionDeclaration.name\] and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a \[FunctionCall\] made based on model prediction. |
-| [FunctionResponsePart](./generative-ai.functionresponsepart.md) | Content part interface if the part represents FunctionResponse. |
-| [GenerateContentCandidate](./generative-ai.generatecontentcandidate.md) | A candidate returned as part of a [GenerateContentResponse](./generative-ai.generatecontentresponse.md). |
-| [GenerateContentRequest](./generative-ai.generatecontentrequest.md) | Request sent to generateContent endpoint. |
-| [GenerateContentResponse](./generative-ai.generatecontentresponse.md) | Individual response from [GenerativeModel.generateContent()](./generative-ai.generativemodel.generatecontent.md) and [GenerativeModel.generateContentStream()](./generative-ai.generativemodel.generatecontentstream.md). generateContentStream() will return one in each chunk until the stream is done. |
-| [GenerateContentResult](./generative-ai.generatecontentresult.md) | Result object returned from generateContent() call. |
-| [GenerateContentStreamResult](./generative-ai.generatecontentstreamresult.md) | Result object returned from generateContentStream() call. Iterate over stream to get chunks as they come in and/or use the response promise to get the aggregated response when the stream is done. |
-| [GenerationConfig](./generative-ai.generationconfig.md) | Config options for content-related requests |
-| [GenerativeContentBlob](./generative-ai.generativecontentblob.md) | Interface for sending an image. |
-| [GoogleSearchRetrieval](./generative-ai.googlesearchretrieval.md) | Retrieval tool that is powered by Google search. |
-| [GoogleSearchRetrievalTool](./generative-ai.googlesearchretrievaltool.md) | Retrieval tool that is powered by Google search. |
-| [GroundingChunk](./generative-ai.groundingchunk.md) | Grounding chunk. |
-| [GroundingChunkWeb](./generative-ai.groundingchunkweb.md) | Chunk from the web. |
-| [GroundingMetadata](./generative-ai.groundingmetadata.md) | Metadata returned to client when grounding is enabled. |
-| [GroundingSupport](./generative-ai.groundingsupport.md) | Grounding support. |
-| [GroundingSupportSegment](./generative-ai.groundingsupportsegment.md) | Segment of the content. |
-| [InlineDataPart](./generative-ai.inlinedatapart.md) | Content part interface if the part represents an image. |
-| [IntegerSchema](./generative-ai.integerschema.md) | Describes a JSON-encodable integer. |
-| [LogprobsCandidate](./generative-ai.logprobscandidate.md) | Candidate for the logprobs token and score. |
-| [LogprobsResult](./generative-ai.logprobsresult.md) | Logprobs Result |
-| [ModelParams](./generative-ai.modelparams.md) | Params passed to [GoogleGenerativeAI.getGenerativeModel()](./generative-ai.googlegenerativeai.getgenerativemodel.md). |
-| [NumberSchema](./generative-ai.numberschema.md) | Describes a JSON-encodable floating point number. |
-| [ObjectSchema](./generative-ai.objectschema.md) | Describes a JSON object, a mapping of specific keys to values. |
-| [PromptFeedback](./generative-ai.promptfeedback.md) | If the prompt was blocked, this will be populated with blockReason and the relevant safetyRatings . |
-| [RequestOptions](./generative-ai.requestoptions.md) | Params passed to getGenerativeModel() or GoogleAIFileManager(). |
-| [RetrievalMetadata](./generative-ai.retrievalmetadata.md) | Metadata related to retrieval in the grounding flow. |
-| [SafetyRating](./generative-ai.safetyrating.md) | A safety rating associated with a [GenerateContentCandidate](./generative-ai.generatecontentcandidate.md) |
-| [SafetySetting](./generative-ai.safetysetting.md) | Safety setting that can be sent as part of request parameters. |
-| [SearchEntryPoint](./generative-ai.searchentrypoint.md) | Google search entry point. |
-| [SimpleStringSchema](./generative-ai.simplestringschema.md) | Describes a simple string schema, with or without format |
-| [SingleRequestOptions](./generative-ai.singlerequestoptions.md) | Params passed to atomic asynchronous operations. |
-| [StartChatParams](./generative-ai.startchatparams.md) | Params for [GenerativeModel.startChat()](./generative-ai.generativemodel.startchat.md). |
-| [TextPart](./generative-ai.textpart.md) | Content part interface if the part represents a text string. |
-| [ToolConfig](./generative-ai.toolconfig.md) | Tool config. This config is shared for all tools provided in the request. |
-| [TopCandidates](./generative-ai.topcandidates.md) | Candidates with top log probabilities at each decoding step |
-| [UsageMetadata](./generative-ai.usagemetadata.md) | Metadata on the generation request's token usage. |
+ | + +If the prompt was blocked, this will be populated with `blockReason` and the relevant `safetyRatings`. + + + |
+ +[RequestOptions](./generative-ai.requestoptions.md) + + + | + +Params passed to getGenerativeModel() or GoogleAIFileManager(). + + + |
+ +[RetrievalMetadata](./generative-ai.retrievalmetadata.md) + + + | + +Metadata related to retrieval in the grounding flow. + + + |
+ +[SafetyRating](./generative-ai.safetyrating.md) + + + | + +A safety rating associated with a [GenerateContentCandidate](./generative-ai.generatecontentcandidate.md) + + + |
+ +[SafetySetting](./generative-ai.safetysetting.md) + + + | + +Safety setting that can be sent as part of request parameters. + + + |
+ +[SearchEntryPoint](./generative-ai.searchentrypoint.md) + + + | + +Google search entry point. + + + |
+ +[SimpleStringSchema](./generative-ai.simplestringschema.md) + + + | + +Describes a simple string schema, with or without format + + + |
+ +[SingleRequestOptions](./generative-ai.singlerequestoptions.md) + + + | + +Params passed to atomic asynchronous operations. + + + |
+ +[StartChatParams](./generative-ai.startchatparams.md) + + + | + +Params for [GenerativeModel.startChat()](./generative-ai.generativemodel.startchat.md). + + + |
+ +[TextPart](./generative-ai.textpart.md) + + + | + +Content part interface if the part represents a text string. + + + |
+ +[ToolConfig](./generative-ai.toolconfig.md) + + + | + +Tool config. This config is shared for all tools provided in the request. + + + |
+ +[TopCandidates](./generative-ai.topcandidates.md) + + + | + +Candidates with top log probabilities at each decoding step + + + |
+ +[UsageMetadata](./generative-ai.usagemetadata.md) + + + | + +Metadata on the generation request's token usage. + + + |
+ +Variable + + + | + +Description + + + |
---|---|
+ +[POSSIBLE\_ROLES](./generative-ai.possible_roles.md) + + + | + +Possible roles. + + + |
GenerationConfig.responseSchema
|
-| [Schema](./generative-ai.schema.md) | 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. |
-| [StringSchema](./generative-ai.stringschema.md) | Describes a string. |
-| [Tool](./generative-ai.tool.md) | Defines a tool that model can call to access external knowledge. |
++ +Type Alias + + + | + +Description + + + |
---|---|
+ +[FunctionDeclarationSchemaProperty](./generative-ai.functiondeclarationschemaproperty.md) + + + | + +Schema for top-level function declaration + + + |
+ +[Part](./generative-ai.part.md) + + + | + +Content part - includes text or image part types. + + + |
+ +[ResponseSchema](./generative-ai.responseschema.md) + + + | + +Schema passed to `GenerationConfig.responseSchema` + + + |
+ +[Schema](./generative-ai.schema.md) + + + | + +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. + + + |
+ +[StringSchema](./generative-ai.stringschema.md) + + + | + +Describes a string. + + + |
+ +[Tool](./generative-ai.tool.md) + + + | + +Defines a tool that model can call to access external knowledge. + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[cachedContent?](./generative-ai.modelparams.cachedcontent.md) + + + | + + + | + +[CachedContent](./generative-ai.cachedcontent.md) + + + | + +_(Optional)_ + + + |
+ +[model](./generative-ai.modelparams.model.md) + + + | + + + | + +string + + + | + + + |
+ +[systemInstruction?](./generative-ai.modelparams.systeminstruction.md) + + + | + + + | + +string \| [Part](./generative-ai.part.md) \| [Content](./generative-ai.content.md) + + + | + +_(Optional)_ + + + |
+ +[toolConfig?](./generative-ai.modelparams.toolconfig.md) + + + | + + + | + +[ToolConfig](./generative-ai.toolconfig.md) + + + | + +_(Optional)_ + + + |
+ +[tools?](./generative-ai.modelparams.tools.md) + + + | + + + | + +[Tool](./generative-ai.tool.md)\[\] + + + | + +_(Optional)_ + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[format?](./generative-ai.numberschema.format.md) + + + | + + + | + +"float" \| "double" + + + | + +_(Optional)_ Optional. The format of the number. + + + |
+ +[type](./generative-ai.numberschema.type.md) + + + | + + + | + +typeof [SchemaType.NUMBER](./generative-ai.schematype.md) + + + | + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[properties](./generative-ai.objectschema.properties.md) + + + | + + + | + +{ \[k: string\]: [Schema](./generative-ai.schema.md); } + + + | + +Describes the properties of the JSON object. Must not be empty. + + + |
+ +[required?](./generative-ai.objectschema.required.md) + + + | + + + | + +string\[\] + + + | + +_(Optional)_ A list of keys declared in the properties object. Required properties will always be present in the generated object. + + + |
+ +[type](./generative-ai.objectschema.type.md) + + + | + + + | + +typeof [SchemaType.OBJECT](./generative-ai.schematype.md) + + + | + + + |
"outcome_deadline_exceeded"
| Code execution ran for too long, and was cancelled. There may or may not be a partial output present. |
-| OUTCOME\_FAILED | "outcome_failed"
| Code execution finished but with a failure. stderr
should contain the reason. |
-| OUTCOME\_OK | "outcome_ok"
| Code execution completed successfully. |
-| OUTCOME\_UNSPECIFIED | "outcome_unspecified"
| Unspecified status. This value should not be used. |
++Member + + + | + +Value + + + | + +Description + + + |
---|---|---|
+ +OUTCOME\_DEADLINE\_EXCEEDED + + + | + +`"outcome_deadline_exceeded"` + + + | + +Code execution ran for too long, and was cancelled. There may or may not be a partial output present. + + + |
+ +OUTCOME\_FAILED + + + | + +`"outcome_failed"` + + + | + +Code execution finished but with a failure. `stderr` should contain the reason. + + + |
+ +OUTCOME\_OK + + + | + +`"outcome_ok"` + + + | + +Code execution completed successfully. + + + |
+ +OUTCOME\_UNSPECIFIED + + + | + +`"outcome_unspecified"` + + + | + +Unspecified status. This value should not be used. + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[blockReason](./generative-ai.promptfeedback.blockreason.md) + + + | + + + | + +[BlockReason](./generative-ai.blockreason.md) + + + | + + + |
+ +[blockReasonMessage?](./generative-ai.promptfeedback.blockreasonmessage.md) + + + | + + + | + +string + + + | + +_(Optional)_ + + + |
+ +[safetyRatings](./generative-ai.promptfeedback.safetyratings.md) + + + | + + + | + +[SafetyRating](./generative-ai.safetyrating.md)\[\] + + + | + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[apiClient?](./generative-ai.requestoptions.apiclient.md) + + + | + + + | + +string + + + | + +_(Optional)_ Additional attribution information to include in the x-goog-api-client header. Used by wrapper SDKs. + + + |
+ +[apiVersion?](./generative-ai.requestoptions.apiversion.md) + + + | + + + | + +string + + + | + +_(Optional)_ Version of API endpoint to call (e.g. "v1" or "v1beta"). If not specified, defaults to latest stable version. + + + |
+ +[baseUrl?](./generative-ai.requestoptions.baseurl.md) + + + | + + + | + +string + + + | + +_(Optional)_ Base endpoint url. Defaults to "https://generativelanguage.googleapis.com" + + + |
+ +[customHeaders?](./generative-ai.requestoptions.customheaders.md) + + + | + + + | + +Headers \| Record<string, string> + + + | + +_(Optional)_ Custom HTTP request headers. + + + |
+ +[timeout?](./generative-ai.requestoptions.timeout.md) + + + | + + + | + +number + + + | + +_(Optional)_ Request timeout in milliseconds. + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[googleSearchDynamicRetrievalScore?](./generative-ai.retrievalmetadata.googlesearchdynamicretrievalscore.md) + + + | + + + | + +number + + + | + +_(Optional)_ Score indicating how likely information from google search could help answer the prompt. The score is in the range \[0, 1\], where 0 is the least likely and 1 is the most likely. This score is only populated when google search grounding and dynamic retrieval is enabled. It will becompared to the threshold to determine whether to trigger google search. + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[category](./generative-ai.safetyrating.category.md) + + + | + + + | + +[HarmCategory](./generative-ai.harmcategory.md) + + + | + + + |
+ +[probability](./generative-ai.safetyrating.probability.md) + + + | + + + | + +[HarmProbability](./generative-ai.harmprobability.md) + + + | + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[category](./generative-ai.safetysetting.category.md) + + + | + + + | + +[HarmCategory](./generative-ai.harmcategory.md) + + + | + + + |
+ +[threshold](./generative-ai.safetysetting.threshold.md) + + + | + + + | + +[HarmBlockThreshold](./generative-ai.harmblockthreshold.md) + + + | + + + |
"array"
| Array type. |
-| BOOLEAN | "boolean"
| Boolean type. |
-| INTEGER | "integer"
| Integer type. |
-| NUMBER | "number"
| Number type. |
-| OBJECT | "object"
| Object type. |
-| STRING | "string"
| String type. |
++Member + + + | + +Value + + + | + +Description + + + |
---|---|---|
+ +ARRAY + + + | + +`"array"` + + + | + +Array type. + + + |
+ +BOOLEAN + + + | + +`"boolean"` + + + | + +Boolean type. + + + |
+ +INTEGER + + + | + +`"integer"` + + + | + +Integer type. + + + |
+ +NUMBER + + + | + +`"number"` + + + | + +Number type. + + + |
+ +OBJECT + + + | + +`"object"` + + + | + +Object type. + + + |
+ +STRING + + + | + +`"string"` + + + | + +String type. + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[renderedContent?](./generative-ai.searchentrypoint.renderedcontent.md) + + + | + + + | + +string + + + | + +_(Optional)_ Web content snippet that can be embedded in a web page or an app webview. + + + |
+ +[sdkBlob?](./generative-ai.searchentrypoint.sdkblob.md) + + + | + + + | + +string + + + | + +_(Optional)_ Base64 encoded JSON representing array of <search term, search url> tuple. + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[enum?](./generative-ai.simplestringschema.enum.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+ +[format?](./generative-ai.simplestringschema.format.md) + + + | + + + | + +"date-time" \| undefined + + + | + +_(Optional)_ + + + |
+ +[type](./generative-ai.simplestringschema.type.md) + + + | + + + | + +typeof [SchemaType.STRING](./generative-ai.schematype.md) + + + | + + + |
_(Optional)_ An object that may be used to abort asynchronous requests. The request may also be aborted due to the expiration of the timeout value, if provided.
NOTE: AbortSignal is a client-only operation. Using it to cancel an operation will not cancel the request in the service. You will still be charged usage for any applicable operations.
| ++Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[signal?](./generative-ai.singlerequestoptions.signal.md) + + + | + + + | + +AbortSignal + + + | + +_(Optional)_ An object that may be used to abort asynchronous requests. The request may also be aborted due to the expiration of the timeout value, if provided. + +NOTE: AbortSignal is a client-only operation. Using it to cancel an operation will not cancel the request in the service. You will still be charged usage for any applicable operations. + + + |
CachedContent
and not the cache object itself. |
-| [history?](./generative-ai.startchatparams.history.md) | | [Content](./generative-ai.content.md)\[\] | _(Optional)_ |
-| [systemInstruction?](./generative-ai.startchatparams.systeminstruction.md) | | string \| [Part](./generative-ai.part.md) \| [Content](./generative-ai.content.md) | _(Optional)_ |
-| [toolConfig?](./generative-ai.startchatparams.toolconfig.md) | | [ToolConfig](./generative-ai.toolconfig.md) | _(Optional)_ |
-| [tools?](./generative-ai.startchatparams.tools.md) | | [Tool](./generative-ai.tool.md)\[\] | _(Optional)_ |
++Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[cachedContent?](./generative-ai.startchatparams.cachedcontent.md) + + + | + + + | + +string + + + | + +_(Optional)_ This is the name of a `CachedContent` and not the cache object itself. + + + |
+ +[history?](./generative-ai.startchatparams.history.md) + + + | + + + | + +[Content](./generative-ai.content.md)\[\] + + + | + +_(Optional)_ + + + |
+ +[systemInstruction?](./generative-ai.startchatparams.systeminstruction.md) + + + | + + + | + +string \| [Part](./generative-ai.part.md) \| [Content](./generative-ai.content.md) + + + | + +_(Optional)_ + + + |
+ +[toolConfig?](./generative-ai.startchatparams.toolconfig.md) + + + | + + + | + +[ToolConfig](./generative-ai.toolconfig.md) + + + | + +_(Optional)_ + + + |
+ +[tools?](./generative-ai.startchatparams.tools.md) + + + | + + + | + +[Tool](./generative-ai.tool.md)\[\] + + + | + +_(Optional)_ + + + |
"CLASSIFICATION"
| |
-| CLUSTERING | "CLUSTERING"
| |
-| RETRIEVAL\_DOCUMENT | "RETRIEVAL_DOCUMENT"
| |
-| RETRIEVAL\_QUERY | "RETRIEVAL_QUERY"
| |
-| SEMANTIC\_SIMILARITY | "SEMANTIC_SIMILARITY"
| |
-| TASK\_TYPE\_UNSPECIFIED | "TASK_TYPE_UNSPECIFIED"
| |
++Member + + + | + +Value + + + | + +Description + + + |
---|---|---|
+ +CLASSIFICATION + + + | + +`"CLASSIFICATION"` + + + | + + + |
+ +CLUSTERING + + + | + +`"CLUSTERING"` + + + | + + + |
+ +RETRIEVAL\_DOCUMENT + + + | + +`"RETRIEVAL_DOCUMENT"` + + + | + + + |
+ +RETRIEVAL\_QUERY + + + | + +`"RETRIEVAL_QUERY"` + + + | + + + |
+ +SEMANTIC\_SIMILARITY + + + | + +`"SEMANTIC_SIMILARITY"` + + + | + + + |
+ +TASK\_TYPE\_UNSPECIFIED + + + | + +`"TASK_TYPE_UNSPECIFIED"` + + + | + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[codeExecutionResult?](./generative-ai.textpart.codeexecutionresult.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+ +[executableCode?](./generative-ai.textpart.executablecode.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+ +[fileData?](./generative-ai.textpart.filedata.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+ +[functionCall?](./generative-ai.textpart.functioncall.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+ +[functionResponse?](./generative-ai.textpart.functionresponse.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+ +[inlineData?](./generative-ai.textpart.inlinedata.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+ +[text](./generative-ai.textpart.text.md) + + + | + + + | + +string + + + | + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[functionCallingConfig](./generative-ai.toolconfig.functioncallingconfig.md) + + + | + + + | + +[FunctionCallingConfig](./generative-ai.functioncallingconfig.md) + + + | + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[candidates](./generative-ai.topcandidates.candidates.md) + + + | + + + | + +[LogprobsCandidate](./generative-ai.logprobscandidate.md)\[\] + + + | + +Sorted by log probability in descending order. + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[cachedContentTokenCount?](./generative-ai.usagemetadata.cachedcontenttokencount.md) + + + | + + + | + +number + + + | + +_(Optional)_ Total token count in the cached part of the prompt, i.e. in the cached content. + + + |
+ +[candidatesTokenCount](./generative-ai.usagemetadata.candidatestokencount.md) + + + | + + + | + +number + + + | + +Total number of tokens across the generated candidates. + + + |
+ +[promptTokenCount](./generative-ai.usagemetadata.prompttokencount.md) + + + | + + + | + +number + + + | + +Number of tokens in the prompt. + + + |
+ +[totalTokenCount](./generative-ai.usagemetadata.totaltokencount.md) + + + | + + + | + +number + + + | + +Total token count for the generation request (prompt + candidates). + + + |
+Package + + + | + +Description + + + |
---|---|
+ +[@google/generative-ai](./generative-ai.md) + + + | + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[items](./generative-ai.arrayschema.items.md) + + + | + + + | + +[Schema](./generative-ai.schema.md) + + + | + +A schema describing the entries in the array. + + + |
+ +[maxItems?](./generative-ai.arrayschema.maxitems.md) + + + | + + + | + +number + + + | + +_(Optional)_ The maximum number of items in the array. + + + |
+ +[minItems?](./generative-ai.arrayschema.minitems.md) + + + | + + + | + +number + + + | + +_(Optional)_ The minimum number of items in the array. + + + |
+ +[type](./generative-ai.arrayschema.type.md) + + + | + + + | + +typeof [SchemaType.ARRAY](./generative-ai.schematype.md) + + + | + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[type](./generative-ai.booleanschema.type.md) + + + | + + + | + +typeof [SchemaType.BOOLEAN](./generative-ai.schematype.md) + + + | + + + |
CachedContent
creation time in ISO string format. |
-| [name?](./generative-ai.cachedcontent.name.md) | | string | _(Optional)_ |
-| [ttl?](./generative-ai.cachedcontent.ttl.md) | | string | _(Optional)_ protobuf.Duration format (ex. "3.0001s"). |
-| [updateTime?](./generative-ai.cachedcontent.updatetime.md) | | string | _(Optional)_ CachedContent
update time in ISO string format. |
++Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[createTime?](./generative-ai.cachedcontent.createtime.md) + + + | + + + | + +string + + + | + +_(Optional)_ `CachedContent` creation time in ISO string format. + + + |
+ +[name?](./generative-ai.cachedcontent.name.md) + + + | + + + | + +string + + + | + +_(Optional)_ + + + |
+ +[ttl?](./generative-ai.cachedcontent.ttl.md) + + + | + + + | + +string + + + | + +_(Optional)_ protobuf.Duration format (ex. "3.0001s"). + + + |
+ +[updateTime?](./generative-ai.cachedcontent.updatetime.md) + + + | + + + | + +string + + + | + +_(Optional)_ `CachedContent` update time in ISO string format. + + + |
ttlSeconds
when creating a CachedContent
. |
-| [model?](./generative-ai.cachedcontentbase.model.md) | | string | _(Optional)_ |
-| [systemInstruction?](./generative-ai.cachedcontentbase.systeminstruction.md) | | string \| [Part](./generative-ai.part.md) \| [Content](./generative-ai.content.md) | _(Optional)_ |
-| [toolConfig?](./generative-ai.cachedcontentbase.toolconfig.md) | | [ToolConfig](./generative-ai.toolconfig.md) | _(Optional)_ |
-| [tools?](./generative-ai.cachedcontentbase.tools.md) | | [Tool](./generative-ai.tool.md)\[\] | _(Optional)_ |
++Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[contents](./generative-ai.cachedcontentbase.contents.md) + + + | + + + | + +[Content](./generative-ai.content.md)\[\] + + + | + + + |
+ +[displayName?](./generative-ai.cachedcontentbase.displayname.md) + + + | + + + | + +string + + + | + +_(Optional)_ + + + |
+ +[expireTime?](./generative-ai.cachedcontentbase.expiretime.md) + + + | + + + | + +string + + + | + +_(Optional)_ Expiration time in ISO string format. Specify either this or `ttlSeconds` when creating a `CachedContent`. + + + |
+ +[model?](./generative-ai.cachedcontentbase.model.md) + + + | + + + | + +string + + + | + +_(Optional)_ + + + |
+ +[systemInstruction?](./generative-ai.cachedcontentbase.systeminstruction.md) + + + | + + + | + +string \| [Part](./generative-ai.part.md) \| [Content](./generative-ai.content.md) + + + | + +_(Optional)_ + + + |
+ +[toolConfig?](./generative-ai.cachedcontentbase.toolconfig.md) + + + | + + + | + +[ToolConfig](./generative-ai.toolconfig.md) + + + | + +_(Optional)_ + + + |
+ +[tools?](./generative-ai.cachedcontentbase.tools.md) + + + | + + + | + +[Tool](./generative-ai.tool.md)\[\] + + + | + +_(Optional)_ + + + |
CachedContent
ttl in seconds. Specify either this or expireTime
when creating a CachedContent
. |
++Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[ttlSeconds?](./generative-ai.cachedcontentcreateparams.ttlseconds.md) + + + | + + + | + +number + + + | + +_(Optional)_ `CachedContent` ttl in seconds. Specify either this or `expireTime` when creating a `CachedContent`. + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[expireTime?](./generative-ai.cachedcontentupdateinputfields.expiretime.md) + + + | + + + | + +string + + + | + +_(Optional)_ + + + |
+ +[ttlSeconds?](./generative-ai.cachedcontentupdateinputfields.ttlseconds.md) + + + | + + + | + +number + + + | + +_(Optional)_ + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[cachedContent](./generative-ai.cachedcontentupdateparams.cachedcontent.md) + + + | + + + | + +[CachedContentUpdateInputFields](./generative-ai.cachedcontentupdateinputfields.md) + + + | + + + |
+ +[updateMask?](./generative-ai.cachedcontentupdateparams.updatemask.md) + + + | + + + | + +string\[\] + + + | + +_(Optional)_ protobuf FieldMask. If not specified, updates all provided fields. + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[outcome](./generative-ai.codeexecutionresult.outcome.md) + + + | + + + | + +[Outcome](./generative-ai.outcome.md) + + + | + +Outcome of the code execution. + + + |
+ +[output](./generative-ai.codeexecutionresult.output.md) + + + | + + + | + +string + + + | + +Contains stdout when code execution is successful, stderr or other description otherwise. + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[codeExecutionResult](./generative-ai.codeexecutionresultpart.codeexecutionresult.md) + + + | + + + | + +[CodeExecutionResult](./generative-ai.codeexecutionresult.md) + + + | + + + |
+ +[executableCode?](./generative-ai.codeexecutionresultpart.executablecode.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+ +[fileData?](./generative-ai.codeexecutionresultpart.filedata.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+ +[functionCall?](./generative-ai.codeexecutionresultpart.functioncall.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+ +[functionResponse?](./generative-ai.codeexecutionresultpart.functionresponse.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+ +[inlineData?](./generative-ai.codeexecutionresultpart.inlinedata.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+ +[text?](./generative-ai.codeexecutionresultpart.text.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[codeExecution](./generative-ai.codeexecutiontool.codeexecution.md) + + + | + + + | + +{} + + + | + +Provide an empty object to enable code execution. This field may have subfields added in the future. + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[parts](./generative-ai.content.parts.md) + + + | + + + | + +[Part](./generative-ai.part.md)\[\] + + + | + + + |
+ +[role](./generative-ai.content.role.md) + + + | + + + | + +string + + + | + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[enum](./generative-ai.enumstringschema.enum.md) + + + | + + + | + +string\[\] + + + | + +Possible values for this enum + + + |
+ +[format](./generative-ai.enumstringschema.format.md) + + + | + + + | + +"enum" + + + | + + + |
+ +[type](./generative-ai.enumstringschema.type.md) + + + | + + + | + +typeof [SchemaType.STRING](./generative-ai.schematype.md) + + + | + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +["@type"?](./generative-ai.errordetails.__type_.md) + + + | + + + | + +string + + + | + +_(Optional)_ + + + |
+ +[domain?](./generative-ai.errordetails.domain.md) + + + | + + + | + +string + + + | + +_(Optional)_ + + + |
+ +[metadata?](./generative-ai.errordetails.metadata.md) + + + | + + + | + +Record<string, unknown> + + + | + +_(Optional)_ + + + |
+ +[reason?](./generative-ai.errordetails.reason.md) + + + | + + + | + +string + + + | + +_(Optional)_ + + + |
code
. |
++Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[code](./generative-ai.executablecode.code.md) + + + | + + + | + +string + + + | + +The code to be executed. + + + |
+ +[language](./generative-ai.executablecode.language.md) + + + | + + + | + +[ExecutableCodeLanguage](./generative-ai.executablecodelanguage.md) + + + | + +Programming language of the `code`. + + + |
"language_unspecified"
| |
-| PYTHON | "python"
| |
++Member + + + | + +Value + + + | + +Description + + + |
---|---|---|
+ +LANGUAGE\_UNSPECIFIED + + + | + +`"language_unspecified"` + + + | + + + |
+ +PYTHON + + + | + +`"python"` + + + | + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[codeExecutionResult?](./generative-ai.executablecodepart.codeexecutionresult.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+ +[executableCode](./generative-ai.executablecodepart.executablecode.md) + + + | + + + | + +[ExecutableCode](./generative-ai.executablecode.md) + + + | + + + |
+ +[fileData?](./generative-ai.executablecodepart.filedata.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+ +[functionCall?](./generative-ai.executablecodepart.functioncall.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+ +[functionResponse?](./generative-ai.executablecodepart.functionresponse.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+ +[inlineData?](./generative-ai.executablecodepart.inlinedata.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+ +[text?](./generative-ai.executablecodepart.text.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[fileUri](./generative-ai.filedata.fileuri.md) + + + | + + + | + +string + + + | + + + |
+ +[mimeType](./generative-ai.filedata.mimetype.md) + + + | + + + | + +string + + + | + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[codeExecutionResult?](./generative-ai.filedatapart.codeexecutionresult.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+ +[executableCode?](./generative-ai.filedatapart.executablecode.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+ +[fileData](./generative-ai.filedatapart.filedata.md) + + + | + + + | + +[FileData](./generative-ai.filedata.md) + + + | + + + |
+ +[functionCall?](./generative-ai.filedatapart.functioncall.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+ +[functionResponse?](./generative-ai.filedatapart.functionresponse.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+ +[inlineData?](./generative-ai.filedatapart.inlinedata.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+ +[text?](./generative-ai.filedatapart.text.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[displayName?](./generative-ai.filemetadata.displayname.md) + + + | + + + | + +string + + + | + +_(Optional)_ + + + |
+ +[mimeType](./generative-ai.filemetadata.mimetype.md) + + + | + + + | + +string + + + | + + + |
+ +[name?](./generative-ai.filemetadata.name.md) + + + | + + + | + +string + + + | + +_(Optional)_ + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[createTime](./generative-ai.filemetadataresponse.createtime.md) + + + | + + + | + +string + + + | + + + |
+ +[displayName?](./generative-ai.filemetadataresponse.displayname.md) + + + | + + + | + +string + + + | + +_(Optional)_ + + + |
+ +[error?](./generative-ai.filemetadataresponse.error.md) + + + | + + + | + +[RpcStatus](./generative-ai.rpcstatus.md) + + + | + +_(Optional)_ Error populated if file processing has failed. + + + |
+ +[expirationTime](./generative-ai.filemetadataresponse.expirationtime.md) + + + | + + + | + +string + + + | + + + |
+ +[mimeType](./generative-ai.filemetadataresponse.mimetype.md) + + + | + + + | + +string + + + | + + + |
+ +[name](./generative-ai.filemetadataresponse.name.md) + + + | + + + | + +string + + + | + + + |
+ +[sha256Hash](./generative-ai.filemetadataresponse.sha256hash.md) + + + | + + + | + +string + + + | + + + |
+ +[sizeBytes](./generative-ai.filemetadataresponse.sizebytes.md) + + + | + + + | + +string + + + | + + + |
+ +[state](./generative-ai.filemetadataresponse.state.md) + + + | + + + | + +[FileState](./generative-ai.filestate.md) + + + | + + + |
+ +[updateTime](./generative-ai.filemetadataresponse.updatetime.md) + + + | + + + | + +string + + + | + + + |
+ +[uri](./generative-ai.filemetadataresponse.uri.md) + + + | + + + | + +string + + + | + + + |
+ +[videoMetadata?](./generative-ai.filemetadataresponse.videometadata.md) + + + | + + + | + +[VideoMetadata](./generative-ai.videometadata.md) + + + | + +_(Optional)_ Video metadata populated after processing is complete. + + + |
"ACTIVE"
| |
-| FAILED | "FAILED"
| |
-| PROCESSING | "PROCESSING"
| |
-| STATE\_UNSPECIFIED | "STATE_UNSPECIFIED"
| |
++Member + + + | + +Value + + + | + +Description + + + |
---|---|---|
+ +ACTIVE + + + | + +`"ACTIVE"` + + + | + + + |
+ +FAILED + + + | + +`"FAILED"` + + + | + + + |
+ +PROCESSING + + + | + +`"PROCESSING"` + + + | + + + |
+ +STATE\_UNSPECIFIED + + + | + +`"STATE_UNSPECIFIED"` + + + | + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[args](./generative-ai.functioncall.args.md) + + + | + + + | + +object + + + | + + + |
+ +[name](./generative-ai.functioncall.name.md) + + + | + + + | + +string + + + | + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[allowedFunctionNames?](./generative-ai.functioncallingconfig.allowedfunctionnames.md) + + + | + + + | + +string\[\] + + + | + +_(Optional)_ + + + |
+ +[mode?](./generative-ai.functioncallingconfig.mode.md) + + + | + + + | + +[FunctionCallingMode](./generative-ai.functioncallingmode.md) + + + | + +_(Optional)_ + + + |
"ANY"
| |
-| AUTO | "AUTO"
| |
-| MODE\_UNSPECIFIED | "MODE_UNSPECIFIED"
| |
-| NONE | "NONE"
| |
++Member + + + | + +Value + + + | + +Description + + + |
---|---|---|
+ +ANY + + + | + +`"ANY"` + + + | + + + |
+ +AUTO + + + | + +`"AUTO"` + + + | + + + |
+ +MODE\_UNSPECIFIED + + + | + +`"MODE_UNSPECIFIED"` + + + | + + + |
+ +NONE + + + | + +`"NONE"` + + + | + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[codeExecutionResult?](./generative-ai.functioncallpart.codeexecutionresult.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+ +[executableCode?](./generative-ai.functioncallpart.executablecode.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+ +[fileData?](./generative-ai.functioncallpart.filedata.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+ +[functionCall](./generative-ai.functioncallpart.functioncall.md) + + + | + + + | + +[FunctionCall](./generative-ai.functioncall.md) + + + | + + + |
+ +[functionResponse?](./generative-ai.functioncallpart.functionresponse.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+ +[inlineData?](./generative-ai.functioncallpart.inlinedata.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+ +[text?](./generative-ai.functioncallpart.text.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[description?](./generative-ai.functiondeclaration.description.md) + + + | + + + | + +string + + + | + +_(Optional)_ Optional. Description and purpose of the function. Model uses it to decide how and whether to call the function. + + + |
+ +[name](./generative-ai.functiondeclaration.name.md) + + + | + + + | + +string + + + | + +The name of the function to call. Must start with a letter or an underscore. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a max length of 64. + + + |
+ +[parameters?](./generative-ai.functiondeclaration.parameters.md) + + + | + + + | + +[FunctionDeclarationSchema](./generative-ai.functiondeclarationschema.md) + + + | + +_(Optional)_ Optional. Describes the parameters to this function in JSON Schema Object format. Reflects the Open API 3.03 Parameter Object. string Key: the name of the parameter. Parameter names are case sensitive. Schema Value: the Schema defining the type used for the parameter. For function with no parameters, this can be left unset. + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[description?](./generative-ai.functiondeclarationschema.description.md) + + + | + + + | + +string + + + | + +_(Optional)_ Optional. Description of the parameter. + + + |
+ +[properties](./generative-ai.functiondeclarationschema.properties.md) + + + | + + + | + +{ \[k: string\]: [FunctionDeclarationSchemaProperty](./generative-ai.functiondeclarationschemaproperty.md); } + + + | + +The format of the parameter. + + + |
+ +[required?](./generative-ai.functiondeclarationschema.required.md) + + + | + + + | + +string\[\] + + + | + +_(Optional)_ Optional. Array of required parameters. + + + |
+ +[type](./generative-ai.functiondeclarationschema.type.md) + + + | + + + | + +[SchemaType](./generative-ai.schematype.md) + + + | + +The type of the parameter. + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[functionDeclarations?](./generative-ai.functiondeclarationstool.functiondeclarations.md) + + + | + + + | + +[FunctionDeclaration](./generative-ai.functiondeclaration.md)\[\] + + + | + +_(Optional)_ Optional. One or more function declarations to be passed to the model along with the current user query. Model may decide to call a subset of these functions by populating \[FunctionCall\]\[content.part.functionCall\] in the response. User should provide a \[FunctionResponse\]\[content.part.functionResponse\] for each function call in the next turn. Based on the function responses, Model will generate the final response back to the user. Maximum 64 function declarations can be provided. + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[name](./generative-ai.functionresponse.name.md) + + + | + + + | + +string + + + | + + + |
+ +[response](./generative-ai.functionresponse.response.md) + + + | + + + | + +object + + + | + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[codeExecutionResult?](./generative-ai.functionresponsepart.codeexecutionresult.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+ +[executableCode?](./generative-ai.functionresponsepart.executablecode.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+ +[fileData?](./generative-ai.functionresponsepart.filedata.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+ +[functionCall?](./generative-ai.functionresponsepart.functioncall.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+ +[functionResponse](./generative-ai.functionresponsepart.functionresponse.md) + + + | + + + | + +[FunctionResponse](./generative-ai.functionresponse.md) + + + | + + + |
+ +[inlineData?](./generative-ai.functionresponsepart.inlinedata.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+ +[text?](./generative-ai.functionresponsepart.text.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[data](./generative-ai.generativecontentblob.data.md) + + + | + + + | + +string + + + | + +Image as a base64 string. + + + |
+ +[mimeType](./generative-ai.generativecontentblob.mimetype.md) + + + | + + + | + +string + + + | + + + |
+Parameter + + + | + +Type + + + | + +Description + + + |
---|---|---|
+ +apiKey + + + | + +string + + + | + + + |
+ +\_requestOptions + + + | + +[RequestOptions](./generative-ai.requestoptions.md) + + + | + +_(Optional)_ + + + |
+Parameter + + + | + +Type + + + | + +Description + + + |
---|---|---|
+ +createOptions + + + | + +[CachedContentCreateParams](./generative-ai.cachedcontentcreateparams.md) + + + | + + + |
+Parameter + + + | + +Type + + + | + +Description + + + |
---|---|---|
+ +name + + + | + +string + + + | + + + |
+Parameter + + + | + +Type + + + | + +Description + + + |
---|---|---|
+ +name + + + | + +string + + + | + + + |
+Parameter + + + | + +Type + + + | + +Description + + + |
---|---|---|
+ +listParams + + + | + +[ListParams](./generative-ai.listparams.md) + + + | + +_(Optional)_ + + + |
GoogleAICacheManager
class |
++ +Constructor + + + | + +Modifiers + + + | + +Description + + + |
---|---|---|
+ +[(constructor)(apiKey, \_requestOptions)](./generative-ai.googleaicachemanager._constructor_.md) + + + | + + + | + +Constructs a new instance of the `GoogleAICacheManager` class + + + |
+ +Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[apiKey](./generative-ai.googleaicachemanager.apikey.md) + + + | + + + | + +string + + + | + + + |
+ +Method + + + | + +Modifiers + + + | + +Description + + + |
---|---|---|
+ +[create(createOptions)](./generative-ai.googleaicachemanager.create.md) + + + | + + + | + +Upload a new content cache + + + |
+ +[delete(name)](./generative-ai.googleaicachemanager.delete.md) + + + | + + + | + +Delete content cache with given name + + + |
+ +[get(name)](./generative-ai.googleaicachemanager.get.md) + + + | + + + | + +Get a content cache + + + |
+ +[list(listParams)](./generative-ai.googleaicachemanager.list.md) + + + | + + + | + +List all uploaded content caches + + + |
+ +[update(name, updateParams)](./generative-ai.googleaicachemanager.update.md) + + + | + + + | + +Update an existing content cache + + |
+Parameter + + + | + +Type + + + | + +Description + + + |
---|---|---|
+ +apiKey + + + | + +string + + + | + + + |
+ +\_requestOptions + + + | + +[RequestOptions](./generative-ai.requestoptions.md) + + + | + +_(Optional)_ + + + |
+Parameter + + + | + +Type + + + | + +Description + + + |
---|---|---|
+ +fileId + + + | + +string + + + | + + + |
+Parameter + + + | + +Type + + + | + +Description + + + |
---|---|---|
+ +listParams + + + | + +[ListParams](./generative-ai.listparams.md) + + + | + +_(Optional)_ + + + |
+ +requestOptions + + + | + +[SingleRequestOptions](./generative-ai.singlerequestoptions.md) + + + | + +_(Optional)_ + + + |
GoogleAIFileManager
class |
++ +Constructor + + + | + +Modifiers + + + | + +Description + + + |
---|---|---|
+ +[(constructor)(apiKey, \_requestOptions)](./generative-ai.googleaifilemanager._constructor_.md) + + + | + + + | + +Constructs a new instance of the `GoogleAIFileManager` class + + + |
+ +Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[apiKey](./generative-ai.googleaifilemanager.apikey.md) + + + | + + + | + +string + + + | + + + |
Get metadata for file with given ID.
Any fields set in the optional [SingleRequestOptions](./generative-ai.singlerequestoptions.md) parameter will take precedence over the [RequestOptions](./generative-ai.requestoptions.md) values provided at the time of the [GoogleAIFileManager](./generative-ai.googleaifilemanager.md) initialization.
| -| [listFiles(listParams, requestOptions)](./generative-ai.googleaifilemanager.listfiles.md) | |List all uploaded files.
Any fields set in the optional [SingleRequestOptions](./generative-ai.singlerequestoptions.md) parameter will take precedence over the [RequestOptions](./generative-ai.requestoptions.md) values provided at the time of the [GoogleAIFileManager](./generative-ai.googleaifilemanager.md) initialization.
| -| [uploadFile(fileData, fileMetadata)](./generative-ai.googleaifilemanager.uploadfile.md) | | Upload a file. | ++ +Method + + + | + +Modifiers + + + | + +Description + + + |
---|---|---|
+ +[deleteFile(fileId)](./generative-ai.googleaifilemanager.deletefile.md) + + + | + + + | + +Delete file with given ID. + + + |
+ +[getFile(fileId, requestOptions)](./generative-ai.googleaifilemanager.getfile.md) + + + | + + + | + +Get metadata for file with given ID. + +Any fields set in the optional [SingleRequestOptions](./generative-ai.singlerequestoptions.md) parameter will take precedence over the [RequestOptions](./generative-ai.requestoptions.md) values provided at the time of the [GoogleAIFileManager](./generative-ai.googleaifilemanager.md) initialization. + + + |
+ +[listFiles(listParams, requestOptions)](./generative-ai.googleaifilemanager.listfiles.md) + + + | + + + | + +List all uploaded files. + +Any fields set in the optional [SingleRequestOptions](./generative-ai.singlerequestoptions.md) parameter will take precedence over the [RequestOptions](./generative-ai.requestoptions.md) values provided at the time of the [GoogleAIFileManager](./generative-ai.googleaifilemanager.md) initialization. + + + |
+ +[uploadFile(fileData, fileMetadata)](./generative-ai.googleaifilemanager.uploadfile.md) + + + | + + + | + +Upload a file. + + + |
+ +[uploadRemoteFile(fileUrl, fileName)](./generative-ai.googleaifilemanager.uploadremotefile.md) + + + | + + + | + +Upload a remote file from a URL. + + |
+ +Parameter + + + | + +Type + + + | + +Description + + + |
---|---|---|
+ +fileUrl + + + | + +string + + + | + + + |
+ +fileName + + + | + +string + + + | + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[codeExecutionResult?](./generative-ai.inlinedatapart.codeexecutionresult.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+ +[executableCode?](./generative-ai.inlinedatapart.executablecode.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+ +[fileData?](./generative-ai.inlinedatapart.filedata.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+ +[functionCall?](./generative-ai.inlinedatapart.functioncall.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+ +[functionResponse?](./generative-ai.inlinedatapart.functionresponse.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+ +[inlineData](./generative-ai.inlinedatapart.inlinedata.md) + + + | + + + | + +[GenerativeContentBlob](./generative-ai.generativecontentblob.md) + + + | + + + |
+ +[text?](./generative-ai.inlinedatapart.text.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[format?](./generative-ai.integerschema.format.md) + + + | + + + | + +"int32" \| "int64" + + + | + +_(Optional)_ Optional. The format of the number. + + + |
+ +[type](./generative-ai.integerschema.type.md) + + + | + + + | + +typeof [SchemaType.INTEGER](./generative-ai.schematype.md) + + + | + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[cachedContents](./generative-ai.listcacheresponse.cachedcontents.md) + + + | + + + | + +[CachedContent](./generative-ai.cachedcontent.md)\[\] + + + | + + + |
+ +[nextPageToken?](./generative-ai.listcacheresponse.nextpagetoken.md) + + + | + + + | + +string + + + | + +_(Optional)_ + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[files](./generative-ai.listfilesresponse.files.md) + + + | + + + | + +[FileMetadataResponse](./generative-ai.filemetadataresponse.md)\[\] + + + | + + + |
+ +[nextPageToken?](./generative-ai.listfilesresponse.nextpagetoken.md) + + + | + + + | + +string + + + | + +_(Optional)_ + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[pageSize?](./generative-ai.listparams.pagesize.md) + + + | + + + | + +number + + + | + +_(Optional)_ + + + |
+ +[pageToken?](./generative-ai.listparams.pagetoken.md) + + + | + + + | + +string + + + | + +_(Optional)_ + + + |
+ +Class + + + | + +Description + + + |
---|---|
+ +[GoogleAICacheManager](./generative-ai.googleaicachemanager.md) + + + | + +Class for managing GoogleAI content caches. + + + |
+ +[GoogleAIFileManager](./generative-ai.googleaifilemanager.md) + + + | + +Class for managing GoogleAI file uploads. + + + |
File
. |
-| [FunctionCallingMode](./generative-ai.functioncallingmode.md) | |
-| [Outcome](./generative-ai.outcome.md) | Possible outcomes of code execution. |
-| [SchemaType](./generative-ai.schematype.md) | Contains the list of OpenAPI data types as defined by https://swagger.io/docs/specification/data-models/data-types/ |
++ +Enumeration + + + | + +Description + + + |
---|---|
+ +[ExecutableCodeLanguage](./generative-ai.executablecodelanguage.md) + + + | + + + + |
+ +[FileState](./generative-ai.filestate.md) + + + | + +Processing state of the `File`. + + + |
+ +[FunctionCallingMode](./generative-ai.functioncallingmode.md) + + + | + + + + |
+ +[Outcome](./generative-ai.outcome.md) + + + | + +Possible outcomes of code execution. + + + |
+ +[SchemaType](./generative-ai.schematype.md) + + + | + +Contains the list of OpenAPI data types as defined by https://swagger.io/docs/specification/data-models/data-types/ + + + |
CachedContent
interface for sending to the server (if creating) or received from the server (using getters or list methods). |
-| [CachedContentBase](./generative-ai.cachedcontentbase.md) | |
-| [CachedContentCreateParams](./generative-ai.cachedcontentcreateparams.md) | Params to pass to [GoogleAICacheManager.create()](./generative-ai.googleaicachemanager.create.md). |
-| [CachedContentUpdateInputFields](./generative-ai.cachedcontentupdateinputfields.md) | Fields that can be updated in an existing content cache. |
-| [CachedContentUpdateParams](./generative-ai.cachedcontentupdateparams.md) | Params to pass to [GoogleAICacheManager.update()](./generative-ai.googleaicachemanager.update.md). |
-| [CodeExecutionResult](./generative-ai.codeexecutionresult.md) | Result of executing the ExecutableCode
. Only generated when using code execution, and always follows a Part
containing the ExecutableCode
. |
-| [CodeExecutionResultPart](./generative-ai.codeexecutionresultpart.md) | Content part containing the result of executed code. |
-| [CodeExecutionTool](./generative-ai.codeexecutiontool.md) | Enables the model to execute code as part of generation. |
-| [Content](./generative-ai.content.md) | Content type for both prompts and response candidates. |
-| [EnumStringSchema](./generative-ai.enumstringschema.md) | Describes a string enum |
-| [ErrorDetails](./generative-ai.errordetails.md) | Details object that may be included in an error response. |
-| [ExecutableCode](./generative-ai.executablecode.md) | Code generated by the model that is meant to be executed, where the result is returned to the model. Only generated when using the code execution tool, in which the code will be automatically executed, and a corresponding CodeExecutionResult
will also be generated. |
-| [ExecutableCodePart](./generative-ai.executablecodepart.md) | Content part containing executable code generated by the model. |
-| [FileData](./generative-ai.filedata.md) | Data pointing to a file uploaded with the Files API. |
-| [FileDataPart](./generative-ai.filedatapart.md) | Content part interface if the part represents FileData. |
-| [FileMetadata](./generative-ai.filemetadata.md) | Metadata to provide alongside a file upload |
-| [FileMetadataResponse](./generative-ai.filemetadataresponse.md) | File metadata response from server. |
-| [FunctionCall](./generative-ai.functioncall.md) | A predicted \[FunctionCall\] returned from the model that contains a string representing the \[FunctionDeclaration.name\] and a structured JSON object containing the parameters and their values. |
-| [FunctionCallingConfig](./generative-ai.functioncallingconfig.md) | |
-| [FunctionCallPart](./generative-ai.functioncallpart.md) | Content part interface if the part represents a FunctionCall. |
-| [FunctionDeclaration](./generative-ai.functiondeclaration.md) | 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](./generative-ai.functiondeclarationschema.md) | Schema for parameters passed to [FunctionDeclaration.parameters](./generative-ai.functiondeclaration.parameters.md). |
-| [FunctionDeclarationsTool](./generative-ai.functiondeclarationstool.md) | 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](./generative-ai.functionresponse.md) | The result output from a \[FunctionCall\] that contains a string representing the \[FunctionDeclaration.name\] and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a \[FunctionCall\] made based on model prediction. |
-| [FunctionResponsePart](./generative-ai.functionresponsepart.md) | Content part interface if the part represents FunctionResponse. |
-| [GenerativeContentBlob](./generative-ai.generativecontentblob.md) | Interface for sending an image. |
-| [InlineDataPart](./generative-ai.inlinedatapart.md) | Content part interface if the part represents an image. |
-| [IntegerSchema](./generative-ai.integerschema.md) | Describes a JSON-encodable integer. |
-| [ListCacheResponse](./generative-ai.listcacheresponse.md) | |
-| [ListFilesResponse](./generative-ai.listfilesresponse.md) | Response from calling [GoogleAIFileManager.listFiles()](./generative-ai.googleaifilemanager.listfiles.md) |
-| [ListParams](./generative-ai.listparams.md) | Params to pass to [GoogleAIFileManager.listFiles()](./generative-ai.googleaifilemanager.listfiles.md) or [GoogleAICacheManager.list()](./generative-ai.googleaicachemanager.list.md) |
-| [NumberSchema](./generative-ai.numberschema.md) | Describes a JSON-encodable floating point number. |
-| [ObjectSchema](./generative-ai.objectschema.md) | Describes a JSON object, a mapping of specific keys to values. |
-| [RequestOptions](./generative-ai.requestoptions.md) | Params passed to getGenerativeModel() or GoogleAIFileManager(). |
-| [RpcStatus](./generative-ai.rpcstatus.md) | Standard RPC error status object. |
-| [SimpleStringSchema](./generative-ai.simplestringschema.md) | Describes a simple string schema, with or without format |
-| [SingleRequestOptions](./generative-ai.singlerequestoptions.md) | Params passed to atomic asynchronous operations. |
-| [TextPart](./generative-ai.textpart.md) | Content part interface if the part represents a text string. |
-| [ToolConfig](./generative-ai.toolconfig.md) | Tool config. This config is shared for all tools provided in the request. |
-| [UploadFileResponse](./generative-ai.uploadfileresponse.md) | Response from calling [GoogleAIFileManager.uploadFile()](./generative-ai.googleaifilemanager.uploadfile.md) |
-| [VideoMetadata](./generative-ai.videometadata.md) | Metadata populated when video has been processed. |
++ +Interface + + + | + +Description + + + |
---|---|
+ +[ArraySchema](./generative-ai.arrayschema.md) + + + | + +Describes an array, an ordered list of values. + + + |
+ +[BooleanSchema](./generative-ai.booleanschema.md) + + + | + +Describes a boolean, either 'true' or 'false'. + + + |
+ +[CachedContent](./generative-ai.cachedcontent.md) + + + | + +Describes `CachedContent` interface for sending to the server (if creating) or received from the server (using getters or list methods). + + + |
+ +[CachedContentBase](./generative-ai.cachedcontentbase.md) + + + | + + + + |
+ +[CachedContentCreateParams](./generative-ai.cachedcontentcreateparams.md) + + + | + +Params to pass to [GoogleAICacheManager.create()](./generative-ai.googleaicachemanager.create.md). + + + |
+ +[CachedContentUpdateInputFields](./generative-ai.cachedcontentupdateinputfields.md) + + + | + +Fields that can be updated in an existing content cache. + + + |
+ +[CachedContentUpdateParams](./generative-ai.cachedcontentupdateparams.md) + + + | + +Params to pass to [GoogleAICacheManager.update()](./generative-ai.googleaicachemanager.update.md). + + + |
+ +[CodeExecutionResult](./generative-ai.codeexecutionresult.md) + + + | + +Result of executing the `ExecutableCode`. Only generated when using code execution, and always follows a `Part` containing the `ExecutableCode`. + + + |
+ +[CodeExecutionResultPart](./generative-ai.codeexecutionresultpart.md) + + + | + +Content part containing the result of executed code. + + + |
+ +[CodeExecutionTool](./generative-ai.codeexecutiontool.md) + + + | + +Enables the model to execute code as part of generation. + + + |
+ +[Content](./generative-ai.content.md) + + + | + +Content type for both prompts and response candidates. + + + |
+ +[EnumStringSchema](./generative-ai.enumstringschema.md) + + + | + +Describes a string enum + + + |
+ +[ErrorDetails](./generative-ai.errordetails.md) + + + | + +Details object that may be included in an error response. + + + |
+ +[ExecutableCode](./generative-ai.executablecode.md) + + + | + +Code generated by the model that is meant to be executed, where the result is returned to the model. Only generated when using the code execution tool, in which the code will be automatically executed, and a corresponding `CodeExecutionResult` will also be generated. + + + |
+ +[ExecutableCodePart](./generative-ai.executablecodepart.md) + + + | + +Content part containing executable code generated by the model. + + + |
+ +[FileData](./generative-ai.filedata.md) + + + | + +Data pointing to a file uploaded with the Files API. + + + |
+ +[FileDataPart](./generative-ai.filedatapart.md) + + + | + +Content part interface if the part represents FileData. + + + |
+ +[FileMetadata](./generative-ai.filemetadata.md) + + + | + +Metadata to provide alongside a file upload + + + |
+ +[FileMetadataResponse](./generative-ai.filemetadataresponse.md) + + + | + +File metadata response from server. + + + |
+ +[FunctionCall](./generative-ai.functioncall.md) + + + | + +A predicted \[FunctionCall\] returned from the model that contains a string representing the \[FunctionDeclaration.name\] and a structured JSON object containing the parameters and their values. + + + |
+ +[FunctionCallingConfig](./generative-ai.functioncallingconfig.md) + + + | + + + + |
+ +[FunctionCallPart](./generative-ai.functioncallpart.md) + + + | + +Content part interface if the part represents a FunctionCall. + + + |
+ +[FunctionDeclaration](./generative-ai.functiondeclaration.md) + + + | + +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](./generative-ai.functiondeclarationschema.md) + + + | + +Schema for parameters passed to [FunctionDeclaration.parameters](./generative-ai.functiondeclaration.parameters.md). + + + |
+ +[FunctionDeclarationsTool](./generative-ai.functiondeclarationstool.md) + + + | + +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](./generative-ai.functionresponse.md) + + + | + +The result output from a \[FunctionCall\] that contains a string representing the \[FunctionDeclaration.name\] and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a \[FunctionCall\] made based on model prediction. + + + |
+ +[FunctionResponsePart](./generative-ai.functionresponsepart.md) + + + | + +Content part interface if the part represents FunctionResponse. + + + |
+ +[GenerativeContentBlob](./generative-ai.generativecontentblob.md) + + + | + +Interface for sending an image. + + + |
+ +[InlineDataPart](./generative-ai.inlinedatapart.md) + + + | + +Content part interface if the part represents an image. + + + |
+ +[IntegerSchema](./generative-ai.integerschema.md) + + + | + +Describes a JSON-encodable integer. + + + |
+ +[ListCacheResponse](./generative-ai.listcacheresponse.md) + + + | + + + + |
+ +[ListFilesResponse](./generative-ai.listfilesresponse.md) + + + | + +Response from calling [GoogleAIFileManager.listFiles()](./generative-ai.googleaifilemanager.listfiles.md) + + + |
+ +[ListParams](./generative-ai.listparams.md) + + + | + +Params to pass to [GoogleAIFileManager.listFiles()](./generative-ai.googleaifilemanager.listfiles.md) or [GoogleAICacheManager.list()](./generative-ai.googleaicachemanager.list.md) + + + |
+ +[NumberSchema](./generative-ai.numberschema.md) + + + | + +Describes a JSON-encodable floating point number. + + + |
+ +[ObjectSchema](./generative-ai.objectschema.md) + + + | + +Describes a JSON object, a mapping of specific keys to values. + + + |
+ +[RequestOptions](./generative-ai.requestoptions.md) + + + | + +Params passed to getGenerativeModel() or GoogleAIFileManager(). + + + |
+ +[RpcStatus](./generative-ai.rpcstatus.md) + + + | + +Standard RPC error status object. + + + |
+ +[SimpleStringSchema](./generative-ai.simplestringschema.md) + + + | + +Describes a simple string schema, with or without format + + + |
+ +[SingleRequestOptions](./generative-ai.singlerequestoptions.md) + + + | + +Params passed to atomic asynchronous operations. + + + |
+ +[TextPart](./generative-ai.textpart.md) + + + | + +Content part interface if the part represents a text string. + + + |
+ +[ToolConfig](./generative-ai.toolconfig.md) + + + | + +Tool config. This config is shared for all tools provided in the request. + + + |
+ +[UploadFileResponse](./generative-ai.uploadfileresponse.md) + + + | + +Response from calling [GoogleAIFileManager.uploadFile()](./generative-ai.googleaifilemanager.uploadfile.md) + + + |
+ +[VideoMetadata](./generative-ai.videometadata.md) + + + | + +Metadata populated when video has been processed. + + + |
GenerationConfig.responseSchema
|
-| [Schema](./generative-ai.schema.md) | 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. |
-| [StringSchema](./generative-ai.stringschema.md) | Describes a string. |
-| [Tool](./generative-ai.tool.md) | Defines a tool that model can call to access external knowledge. |
++ +Type Alias + + + | + +Description + + + |
---|---|
+ +[FunctionDeclarationSchemaProperty](./generative-ai.functiondeclarationschemaproperty.md) + + + | + +Schema for top-level function declaration + + + |
+ +[Part](./generative-ai.part.md) + + + | + +Content part - includes text or image part types. + + + |
+ +[ResponseSchema](./generative-ai.responseschema.md) + + + | + +Schema passed to `GenerationConfig.responseSchema` + + + |
+ +[Schema](./generative-ai.schema.md) + + + | + +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. + + + |
+ +[StringSchema](./generative-ai.stringschema.md) + + + | + +Describes a string. + + + |
+ +[Tool](./generative-ai.tool.md) + + + | + +Defines a tool that model can call to access external knowledge. + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[format?](./generative-ai.numberschema.format.md) + + + | + + + | + +"float" \| "double" + + + | + +_(Optional)_ Optional. The format of the number. + + + |
+ +[type](./generative-ai.numberschema.type.md) + + + | + + + | + +typeof [SchemaType.NUMBER](./generative-ai.schematype.md) + + + | + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[properties](./generative-ai.objectschema.properties.md) + + + | + + + | + +{ \[k: string\]: [Schema](./generative-ai.schema.md); } + + + | + +Describes the properties of the JSON object. Must not be empty. + + + |
+ +[required?](./generative-ai.objectschema.required.md) + + + | + + + | + +string\[\] + + + | + +_(Optional)_ A list of keys declared in the properties object. Required properties will always be present in the generated object. + + + |
+ +[type](./generative-ai.objectschema.type.md) + + + | + + + | + +typeof [SchemaType.OBJECT](./generative-ai.schematype.md) + + + | + + + |
"outcome_deadline_exceeded"
| Code execution ran for too long, and was cancelled. There may or may not be a partial output present. |
-| OUTCOME\_FAILED | "outcome_failed"
| Code execution finished but with a failure. stderr
should contain the reason. |
-| OUTCOME\_OK | "outcome_ok"
| Code execution completed successfully. |
-| OUTCOME\_UNSPECIFIED | "outcome_unspecified"
| Unspecified status. This value should not be used. |
++Member + + + | + +Value + + + | + +Description + + + |
---|---|---|
+ +OUTCOME\_DEADLINE\_EXCEEDED + + + | + +`"outcome_deadline_exceeded"` + + + | + +Code execution ran for too long, and was cancelled. There may or may not be a partial output present. + + + |
+ +OUTCOME\_FAILED + + + | + +`"outcome_failed"` + + + | + +Code execution finished but with a failure. `stderr` should contain the reason. + + + |
+ +OUTCOME\_OK + + + | + +`"outcome_ok"` + + + | + +Code execution completed successfully. + + + |
+ +OUTCOME\_UNSPECIFIED + + + | + +`"outcome_unspecified"` + + + | + +Unspecified status. This value should not be used. + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[apiClient?](./generative-ai.requestoptions.apiclient.md) + + + | + + + | + +string + + + | + +_(Optional)_ Additional attribution information to include in the x-goog-api-client header. Used by wrapper SDKs. + + + |
+ +[apiVersion?](./generative-ai.requestoptions.apiversion.md) + + + | + + + | + +string + + + | + +_(Optional)_ Version of API endpoint to call (e.g. "v1" or "v1beta"). If not specified, defaults to latest stable version. + + + |
+ +[baseUrl?](./generative-ai.requestoptions.baseurl.md) + + + | + + + | + +string + + + | + +_(Optional)_ Base endpoint url. Defaults to "https://generativelanguage.googleapis.com" + + + |
+ +[customHeaders?](./generative-ai.requestoptions.customheaders.md) + + + | + + + | + +Headers \| Record<string, string> + + + | + +_(Optional)_ Custom HTTP request headers. + + + |
+ +[timeout?](./generative-ai.requestoptions.timeout.md) + + + | + + + | + +number + + + | + +_(Optional)_ Request timeout in milliseconds. + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[code](./generative-ai.rpcstatus.code.md) + + + | + + + | + +number + + + | + +Error status code + + + |
+ +[details?](./generative-ai.rpcstatus.details.md) + + + | + + + | + +[ErrorDetails](./generative-ai.errordetails.md)\[\] + + + | + +_(Optional)_ A list of messages that carry the error details. + + + |
+ +[message](./generative-ai.rpcstatus.message.md) + + + | + + + | + +string + + + | + +A developer-facing error message. + + + |
"array"
| Array type. |
-| BOOLEAN | "boolean"
| Boolean type. |
-| INTEGER | "integer"
| Integer type. |
-| NUMBER | "number"
| Number type. |
-| OBJECT | "object"
| Object type. |
-| STRING | "string"
| String type. |
++Member + + + | + +Value + + + | + +Description + + + |
---|---|---|
+ +ARRAY + + + | + +`"array"` + + + | + +Array type. + + + |
+ +BOOLEAN + + + | + +`"boolean"` + + + | + +Boolean type. + + + |
+ +INTEGER + + + | + +`"integer"` + + + | + +Integer type. + + + |
+ +NUMBER + + + | + +`"number"` + + + | + +Number type. + + + |
+ +OBJECT + + + | + +`"object"` + + + | + +Object type. + + + |
+ +STRING + + + | + +`"string"` + + + | + +String type. + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[enum?](./generative-ai.simplestringschema.enum.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+ +[format?](./generative-ai.simplestringschema.format.md) + + + | + + + | + +"date-time" \| undefined + + + | + +_(Optional)_ + + + |
+ +[type](./generative-ai.simplestringschema.type.md) + + + | + + + | + +typeof [SchemaType.STRING](./generative-ai.schematype.md) + + + | + + + |
_(Optional)_ An object that may be used to abort asynchronous requests. The request may also be aborted due to the expiration of the timeout value, if provided.
NOTE: AbortSignal is a client-only operation. Using it to cancel an operation will not cancel the request in the service. You will still be charged usage for any applicable operations.
| ++Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[signal?](./generative-ai.singlerequestoptions.signal.md) + + + | + + + | + +AbortSignal + + + | + +_(Optional)_ An object that may be used to abort asynchronous requests. The request may also be aborted due to the expiration of the timeout value, if provided. + +NOTE: AbortSignal is a client-only operation. Using it to cancel an operation will not cancel the request in the service. You will still be charged usage for any applicable operations. + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[codeExecutionResult?](./generative-ai.textpart.codeexecutionresult.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+ +[executableCode?](./generative-ai.textpart.executablecode.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+ +[fileData?](./generative-ai.textpart.filedata.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+ +[functionCall?](./generative-ai.textpart.functioncall.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+ +[functionResponse?](./generative-ai.textpart.functionresponse.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+ +[inlineData?](./generative-ai.textpart.inlinedata.md) + + + | + + + | + +never + + + | + +_(Optional)_ + + + |
+ +[text](./generative-ai.textpart.text.md) + + + | + + + | + +string + + + | + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[functionCallingConfig](./generative-ai.toolconfig.functioncallingconfig.md) + + + | + + + | + +[FunctionCallingConfig](./generative-ai.functioncallingconfig.md) + + + | + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[file](./generative-ai.uploadfileresponse.file.md) + + + | + + + | + +[FileMetadataResponse](./generative-ai.filemetadataresponse.md) + + + | + + + |
+Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
---|---|---|---|
+ +[videoDuration](./generative-ai.videometadata.videoduration.md) + + + | + + + | + +string + + + | + +The video duration in protobuf [Duration](https://cloud.google.com/ruby/docs/reference/google-cloud-workflows-v1/latest/Google-Protobuf-Duration#json-mapping) format. + + + |
+Package + + + | + +Description + + + |
---|---|
+ +[@google/generative-ai](./generative-ai.md) + + + | + + + |