"GoogleGemini" (Service Connection)
This service connection requires an external account »
Use the Google Gemini API with the Wolfram Language.
Connecting & Authenticating
ServiceConnect["GoogleGemini"] creates a connection to the Google Gemini API. If a previously saved connection can be found, it will be used; otherwise, a new authentication request will be launched.
Requests
ServiceExecute["GoogleGemini","request",params] sends a request to the Google Gemini API using parameters params. The following gives possible requests.
Text
"Chat" — create a response for the given chat conversation
"Messages" | (required) | a list of messages in the conversation | |
"Model" | Automatic | name of the model to use | |
"N" | Automatic | number of completions to return (1 to 8) | |
"Temperature" | Automatic | sampling temperature (between 0 and 1) | |
"TopProbabilities" | Automatic | sample only among the k highest-probability classes | |
"TotalProbabilityCutoff" | None | sample among the most probable classes with an accumulated probability of at least p (nucleus sampling) |
"Embedding" — create an embedding vector representing the input text
"Text" | (required) | a list of messages in the conversation | |
"Model" | Automatic | name of the model to use |
"TokenCount" — run a model's tokenizer on a prompt and return the token count
"Content" | (required) | name of the model to use | |
"Model" | Automatic | name of the model to use |
Model Lists
"ChatModelList" — list models available for the "Chat" request