gemini_sendMessage
Send a text message to an active Gemini chat session via sessionId. Receive the model's response, which may include generated text or a function call request, enabling dynamic interaction with the AI model.
Instructions
Sends a message to an existing Gemini chat session, identified by its sessionId. Returns the model's response, which might include text or a function call request.
Input Schema
Name | Required | Description | Default |
---|---|---|---|
generationConfig | No | Optional. Per-request generation configuration settings to override session defaults for this turn. | |
message | Yes | Required. The text message content to send to the model. (Note: Currently only supports text input; complex Part types like images are not yet supported by this tool parameter). | |
safetySettings | No | Optional. Per-request safety settings to override session defaults for this turn. | |
sessionId | Yes | Required. The unique identifier of the chat session to send the message to. | |
toolConfig | No | Optional. Per-request tool configuration, e.g., to force function calling mode. | |
tools | No | Optional. Per-request tools definition (e.g., function declarations) to override session defaults for this turn. |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"generationConfig": {
"additionalProperties": false,
"description": "Optional. Per-request generation configuration settings to override session defaults for this turn.",
"properties": {
"maxOutputTokens": {
"description": "Maximum number of tokens to generate in the response.",
"minimum": 1,
"type": "integer"
},
"stopSequences": {
"description": "Sequences where the API will stop generating further tokens.",
"items": {
"type": "string"
},
"type": "array"
},
"temperature": {
"description": "Controls randomness. Lower values (~0.2) make output more deterministic, higher values (~0.8) make it more creative. Default varies by model.",
"maximum": 1,
"minimum": 0,
"type": "number"
},
"topK": {
"description": "Top-k sampling parameter. The model considers the k most probable tokens. Default varies by model.",
"minimum": 1,
"type": "integer"
},
"topP": {
"description": "Nucleus sampling parameter. The model considers only tokens with probability mass summing to this value. Default varies by model.",
"maximum": 1,
"minimum": 0,
"type": "number"
}
},
"type": "object"
},
"message": {
"description": "Required. The text message content to send to the model. (Note: Currently only supports text input; complex Part types like images are not yet supported by this tool parameter).",
"minLength": 1,
"type": "string"
},
"safetySettings": {
"description": "Optional. Per-request safety settings to override session defaults for this turn.",
"items": {
"additionalProperties": false,
"description": "Setting for controlling content safety for a specific harm category.",
"properties": {
"category": {
"description": "Category of harmful content to apply safety settings for.",
"enum": [
"HARM_CATEGORY_UNSPECIFIED",
"HARM_CATEGORY_HATE_SPEECH",
"HARM_CATEGORY_SEXUALLY_EXPLICIT",
"HARM_CATEGORY_HARASSMENT",
"HARM_CATEGORY_DANGEROUS_CONTENT"
],
"type": "string"
},
"threshold": {
"description": "Threshold for blocking harmful content. Higher thresholds block more content.",
"enum": [
"HARM_BLOCK_THRESHOLD_UNSPECIFIED",
"BLOCK_LOW_AND_ABOVE",
"BLOCK_MEDIUM_AND_ABOVE",
"BLOCK_ONLY_HIGH",
"BLOCK_NONE"
],
"type": "string"
}
},
"required": [
"category",
"threshold"
],
"type": "object"
},
"type": "array"
},
"sessionId": {
"description": "Required. The unique identifier of the chat session to send the message to.",
"format": "uuid",
"type": "string"
},
"toolConfig": {
"additionalProperties": false,
"description": "Optional. Per-request tool configuration, e.g., to force function calling mode.",
"properties": {
"functionCallingConfig": {
"additionalProperties": false,
"properties": {
"allowedFunctionNames": {
"description": "Optional list of function names allowed.",
"items": {
"type": "string"
},
"type": "array"
},
"mode": {
"description": "The function calling mode.",
"enum": [
"AUTO",
"ANY",
"NONE"
],
"type": "string"
}
},
"type": "object"
}
},
"type": "object"
},
"tools": {
"description": "Optional. Per-request tools definition (e.g., function declarations) to override session defaults for this turn.",
"items": {
"additionalProperties": false,
"properties": {
"functionDeclarations": {
"items": {
"additionalProperties": false,
"properties": {
"description": {
"minLength": 1,
"type": "string"
},
"name": {
"minLength": 1,
"type": "string"
},
"parameters": {
"additionalProperties": false,
"properties": {
"properties": {
"additionalProperties": {},
"type": "object"
},
"required": {
"items": {
"type": "string"
},
"type": "array"
},
"type": {
"const": "OBJECT",
"type": "string"
}
},
"required": [
"type",
"properties"
],
"type": "object"
}
},
"required": [
"name",
"description",
"parameters"
],
"type": "object"
},
"type": "array"
}
},
"type": "object"
},
"type": "array"
}
},
"required": [
"sessionId",
"message"
],
"type": "object"
}