Run Agent
curl --request POST \
--url https://api.example.com/run \
--header 'Content-Type: application/json' \
--data '
{
"appName": "<string>",
"userId": "<string>",
"sessionId": "<string>",
"newMessage": {
"parts": [
{
"mediaResolution": {
"numTokens": 123
},
"codeExecutionResult": {
"output": "<string>",
"id": "<string>"
},
"executableCode": {
"code": "<string>",
"id": "<string>"
},
"fileData": {
"displayName": "<string>",
"fileUri": "<string>",
"mimeType": "<string>"
},
"functionCall": {
"id": "<string>",
"args": {},
"name": "<string>",
"partialArgs": [
{
"boolValue": true,
"jsonPath": "<string>",
"nullValue": "<string>",
"numberValue": 123,
"stringValue": "<string>",
"willContinue": true
}
],
"willContinue": true
},
"functionResponse": {
"willContinue": true,
"parts": [
{
"inlineData": {
"mimeType": "<string>",
"data": "<string>",
"displayName": "<string>"
},
"fileData": {
"fileUri": "<string>",
"mimeType": "<string>",
"displayName": "<string>"
}
}
],
"id": "<string>",
"name": "<string>",
"response": {}
},
"inlineData": {
"data": "<string>",
"displayName": "<string>",
"mimeType": "<string>"
},
"text": "<string>",
"thought": true,
"thoughtSignature": "<string>",
"videoMetadata": {
"endOffset": "<string>",
"fps": 123,
"startOffset": "<string>"
},
"toolCall": {
"id": "<string>",
"args": {}
},
"toolResponse": {
"id": "<string>",
"response": {}
},
"partMetadata": {},
"audioTranscription": {
"text": "<string>",
"finished": true,
"languageCode": "<string>",
"speakerLabel": "<string>",
"words": [
{
"word": "<string>",
"startOffset": "<string>",
"endOffset": "<string>"
}
]
}
}
],
"role": "<string>"
},
"streaming": false,
"stateDelta": {},
"functionCallEventId": "<string>",
"invocationId": "<string>"
}
'import requests
url = "https://api.example.com/run"
payload = {
"appName": "<string>",
"userId": "<string>",
"sessionId": "<string>",
"newMessage": {
"parts": [
{
"mediaResolution": { "numTokens": 123 },
"codeExecutionResult": {
"output": "<string>",
"id": "<string>"
},
"executableCode": {
"code": "<string>",
"id": "<string>"
},
"fileData": {
"displayName": "<string>",
"fileUri": "<string>",
"mimeType": "<string>"
},
"functionCall": {
"id": "<string>",
"args": {},
"name": "<string>",
"partialArgs": [
{
"boolValue": True,
"jsonPath": "<string>",
"nullValue": "<string>",
"numberValue": 123,
"stringValue": "<string>",
"willContinue": True
}
],
"willContinue": True
},
"functionResponse": {
"willContinue": True,
"parts": [
{
"inlineData": {
"mimeType": "<string>",
"data": "<string>",
"displayName": "<string>"
},
"fileData": {
"fileUri": "<string>",
"mimeType": "<string>",
"displayName": "<string>"
}
}
],
"id": "<string>",
"name": "<string>",
"response": {}
},
"inlineData": {
"data": "<string>",
"displayName": "<string>",
"mimeType": "<string>"
},
"text": "<string>",
"thought": True,
"thoughtSignature": "<string>",
"videoMetadata": {
"endOffset": "<string>",
"fps": 123,
"startOffset": "<string>"
},
"toolCall": {
"id": "<string>",
"args": {}
},
"toolResponse": {
"id": "<string>",
"response": {}
},
"partMetadata": {},
"audioTranscription": {
"text": "<string>",
"finished": True,
"languageCode": "<string>",
"speakerLabel": "<string>",
"words": [
{
"word": "<string>",
"startOffset": "<string>",
"endOffset": "<string>"
}
]
}
}
],
"role": "<string>"
},
"streaming": False,
"stateDelta": {},
"functionCallEventId": "<string>",
"invocationId": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
appName: '<string>',
userId: '<string>',
sessionId: '<string>',
newMessage: {
parts: [
{
mediaResolution: {numTokens: 123},
codeExecutionResult: {output: '<string>', id: '<string>'},
executableCode: {code: '<string>', id: '<string>'},
fileData: {displayName: '<string>', fileUri: '<string>', mimeType: '<string>'},
functionCall: {
id: '<string>',
args: {},
name: '<string>',
partialArgs: [
{
boolValue: true,
jsonPath: '<string>',
nullValue: '<string>',
numberValue: 123,
stringValue: '<string>',
willContinue: true
}
],
willContinue: true
},
functionResponse: {
willContinue: true,
parts: [
{
inlineData: {mimeType: '<string>', data: '<string>', displayName: '<string>'},
fileData: {fileUri: '<string>', mimeType: '<string>', displayName: '<string>'}
}
],
id: '<string>',
name: '<string>',
response: {}
},
inlineData: {data: '<string>', displayName: '<string>', mimeType: '<string>'},
text: '<string>',
thought: true,
thoughtSignature: '<string>',
videoMetadata: {endOffset: '<string>', fps: 123, startOffset: '<string>'},
toolCall: {id: '<string>', args: {}},
toolResponse: {id: '<string>', response: {}},
partMetadata: {},
audioTranscription: {
text: '<string>',
finished: true,
languageCode: '<string>',
speakerLabel: '<string>',
words: [{word: '<string>', startOffset: '<string>', endOffset: '<string>'}]
}
}
],
role: '<string>'
},
streaming: false,
stateDelta: {},
functionCallEventId: '<string>',
invocationId: '<string>'
})
};
fetch('https://api.example.com/run', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/run",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'appName' => '<string>',
'userId' => '<string>',
'sessionId' => '<string>',
'newMessage' => [
'parts' => [
[
'mediaResolution' => [
'numTokens' => 123
],
'codeExecutionResult' => [
'output' => '<string>',
'id' => '<string>'
],
'executableCode' => [
'code' => '<string>',
'id' => '<string>'
],
'fileData' => [
'displayName' => '<string>',
'fileUri' => '<string>',
'mimeType' => '<string>'
],
'functionCall' => [
'id' => '<string>',
'args' => [
],
'name' => '<string>',
'partialArgs' => [
[
'boolValue' => true,
'jsonPath' => '<string>',
'nullValue' => '<string>',
'numberValue' => 123,
'stringValue' => '<string>',
'willContinue' => true
]
],
'willContinue' => true
],
'functionResponse' => [
'willContinue' => true,
'parts' => [
[
'inlineData' => [
'mimeType' => '<string>',
'data' => '<string>',
'displayName' => '<string>'
],
'fileData' => [
'fileUri' => '<string>',
'mimeType' => '<string>',
'displayName' => '<string>'
]
]
],
'id' => '<string>',
'name' => '<string>',
'response' => [
]
],
'inlineData' => [
'data' => '<string>',
'displayName' => '<string>',
'mimeType' => '<string>'
],
'text' => '<string>',
'thought' => true,
'thoughtSignature' => '<string>',
'videoMetadata' => [
'endOffset' => '<string>',
'fps' => 123,
'startOffset' => '<string>'
],
'toolCall' => [
'id' => '<string>',
'args' => [
]
],
'toolResponse' => [
'id' => '<string>',
'response' => [
]
],
'partMetadata' => [
],
'audioTranscription' => [
'text' => '<string>',
'finished' => true,
'languageCode' => '<string>',
'speakerLabel' => '<string>',
'words' => [
[
'word' => '<string>',
'startOffset' => '<string>',
'endOffset' => '<string>'
]
]
]
]
],
'role' => '<string>'
],
'streaming' => false,
'stateDelta' => [
],
'functionCallEventId' => '<string>',
'invocationId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/run"
payload := strings.NewReader("{\n \"appName\": \"<string>\",\n \"userId\": \"<string>\",\n \"sessionId\": \"<string>\",\n \"newMessage\": {\n \"parts\": [\n {\n \"mediaResolution\": {\n \"numTokens\": 123\n },\n \"codeExecutionResult\": {\n \"output\": \"<string>\",\n \"id\": \"<string>\"\n },\n \"executableCode\": {\n \"code\": \"<string>\",\n \"id\": \"<string>\"\n },\n \"fileData\": {\n \"displayName\": \"<string>\",\n \"fileUri\": \"<string>\",\n \"mimeType\": \"<string>\"\n },\n \"functionCall\": {\n \"id\": \"<string>\",\n \"args\": {},\n \"name\": \"<string>\",\n \"partialArgs\": [\n {\n \"boolValue\": true,\n \"jsonPath\": \"<string>\",\n \"nullValue\": \"<string>\",\n \"numberValue\": 123,\n \"stringValue\": \"<string>\",\n \"willContinue\": true\n }\n ],\n \"willContinue\": true\n },\n \"functionResponse\": {\n \"willContinue\": true,\n \"parts\": [\n {\n \"inlineData\": {\n \"mimeType\": \"<string>\",\n \"data\": \"<string>\",\n \"displayName\": \"<string>\"\n },\n \"fileData\": {\n \"fileUri\": \"<string>\",\n \"mimeType\": \"<string>\",\n \"displayName\": \"<string>\"\n }\n }\n ],\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"response\": {}\n },\n \"inlineData\": {\n \"data\": \"<string>\",\n \"displayName\": \"<string>\",\n \"mimeType\": \"<string>\"\n },\n \"text\": \"<string>\",\n \"thought\": true,\n \"thoughtSignature\": \"<string>\",\n \"videoMetadata\": {\n \"endOffset\": \"<string>\",\n \"fps\": 123,\n \"startOffset\": \"<string>\"\n },\n \"toolCall\": {\n \"id\": \"<string>\",\n \"args\": {}\n },\n \"toolResponse\": {\n \"id\": \"<string>\",\n \"response\": {}\n },\n \"partMetadata\": {},\n \"audioTranscription\": {\n \"text\": \"<string>\",\n \"finished\": true,\n \"languageCode\": \"<string>\",\n \"speakerLabel\": \"<string>\",\n \"words\": [\n {\n \"word\": \"<string>\",\n \"startOffset\": \"<string>\",\n \"endOffset\": \"<string>\"\n }\n ]\n }\n }\n ],\n \"role\": \"<string>\"\n },\n \"streaming\": false,\n \"stateDelta\": {},\n \"functionCallEventId\": \"<string>\",\n \"invocationId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/run")
.header("Content-Type", "application/json")
.body("{\n \"appName\": \"<string>\",\n \"userId\": \"<string>\",\n \"sessionId\": \"<string>\",\n \"newMessage\": {\n \"parts\": [\n {\n \"mediaResolution\": {\n \"numTokens\": 123\n },\n \"codeExecutionResult\": {\n \"output\": \"<string>\",\n \"id\": \"<string>\"\n },\n \"executableCode\": {\n \"code\": \"<string>\",\n \"id\": \"<string>\"\n },\n \"fileData\": {\n \"displayName\": \"<string>\",\n \"fileUri\": \"<string>\",\n \"mimeType\": \"<string>\"\n },\n \"functionCall\": {\n \"id\": \"<string>\",\n \"args\": {},\n \"name\": \"<string>\",\n \"partialArgs\": [\n {\n \"boolValue\": true,\n \"jsonPath\": \"<string>\",\n \"nullValue\": \"<string>\",\n \"numberValue\": 123,\n \"stringValue\": \"<string>\",\n \"willContinue\": true\n }\n ],\n \"willContinue\": true\n },\n \"functionResponse\": {\n \"willContinue\": true,\n \"parts\": [\n {\n \"inlineData\": {\n \"mimeType\": \"<string>\",\n \"data\": \"<string>\",\n \"displayName\": \"<string>\"\n },\n \"fileData\": {\n \"fileUri\": \"<string>\",\n \"mimeType\": \"<string>\",\n \"displayName\": \"<string>\"\n }\n }\n ],\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"response\": {}\n },\n \"inlineData\": {\n \"data\": \"<string>\",\n \"displayName\": \"<string>\",\n \"mimeType\": \"<string>\"\n },\n \"text\": \"<string>\",\n \"thought\": true,\n \"thoughtSignature\": \"<string>\",\n \"videoMetadata\": {\n \"endOffset\": \"<string>\",\n \"fps\": 123,\n \"startOffset\": \"<string>\"\n },\n \"toolCall\": {\n \"id\": \"<string>\",\n \"args\": {}\n },\n \"toolResponse\": {\n \"id\": \"<string>\",\n \"response\": {}\n },\n \"partMetadata\": {},\n \"audioTranscription\": {\n \"text\": \"<string>\",\n \"finished\": true,\n \"languageCode\": \"<string>\",\n \"speakerLabel\": \"<string>\",\n \"words\": [\n {\n \"word\": \"<string>\",\n \"startOffset\": \"<string>\",\n \"endOffset\": \"<string>\"\n }\n ]\n }\n }\n ],\n \"role\": \"<string>\"\n },\n \"streaming\": false,\n \"stateDelta\": {},\n \"functionCallEventId\": \"<string>\",\n \"invocationId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/run")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"appName\": \"<string>\",\n \"userId\": \"<string>\",\n \"sessionId\": \"<string>\",\n \"newMessage\": {\n \"parts\": [\n {\n \"mediaResolution\": {\n \"numTokens\": 123\n },\n \"codeExecutionResult\": {\n \"output\": \"<string>\",\n \"id\": \"<string>\"\n },\n \"executableCode\": {\n \"code\": \"<string>\",\n \"id\": \"<string>\"\n },\n \"fileData\": {\n \"displayName\": \"<string>\",\n \"fileUri\": \"<string>\",\n \"mimeType\": \"<string>\"\n },\n \"functionCall\": {\n \"id\": \"<string>\",\n \"args\": {},\n \"name\": \"<string>\",\n \"partialArgs\": [\n {\n \"boolValue\": true,\n \"jsonPath\": \"<string>\",\n \"nullValue\": \"<string>\",\n \"numberValue\": 123,\n \"stringValue\": \"<string>\",\n \"willContinue\": true\n }\n ],\n \"willContinue\": true\n },\n \"functionResponse\": {\n \"willContinue\": true,\n \"parts\": [\n {\n \"inlineData\": {\n \"mimeType\": \"<string>\",\n \"data\": \"<string>\",\n \"displayName\": \"<string>\"\n },\n \"fileData\": {\n \"fileUri\": \"<string>\",\n \"mimeType\": \"<string>\",\n \"displayName\": \"<string>\"\n }\n }\n ],\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"response\": {}\n },\n \"inlineData\": {\n \"data\": \"<string>\",\n \"displayName\": \"<string>\",\n \"mimeType\": \"<string>\"\n },\n \"text\": \"<string>\",\n \"thought\": true,\n \"thoughtSignature\": \"<string>\",\n \"videoMetadata\": {\n \"endOffset\": \"<string>\",\n \"fps\": 123,\n \"startOffset\": \"<string>\"\n },\n \"toolCall\": {\n \"id\": \"<string>\",\n \"args\": {}\n },\n \"toolResponse\": {\n \"id\": \"<string>\",\n \"response\": {}\n },\n \"partMetadata\": {},\n \"audioTranscription\": {\n \"text\": \"<string>\",\n \"finished\": true,\n \"languageCode\": \"<string>\",\n \"speakerLabel\": \"<string>\",\n \"words\": [\n {\n \"word\": \"<string>\",\n \"startOffset\": \"<string>\",\n \"endOffset\": \"<string>\"\n }\n ]\n }\n }\n ],\n \"role\": \"<string>\"\n },\n \"streaming\": false,\n \"stateDelta\": {},\n \"functionCallEventId\": \"<string>\",\n \"invocationId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body[
{
"author": "<string>",
"modelVersion": "<string>",
"content": {
"parts": [
{
"mediaResolution": {
"numTokens": 123
},
"codeExecutionResult": {
"output": "<string>",
"id": "<string>"
},
"executableCode": {
"code": "<string>",
"id": "<string>"
},
"fileData": {
"displayName": "<string>",
"fileUri": "<string>",
"mimeType": "<string>"
},
"functionCall": {
"id": "<string>",
"args": {},
"name": "<string>",
"partialArgs": [
{
"boolValue": true,
"jsonPath": "<string>",
"nullValue": "<string>",
"numberValue": 123,
"stringValue": "<string>",
"willContinue": true
}
],
"willContinue": true
},
"functionResponse": {
"willContinue": true,
"parts": [
{
"inlineData": {
"mimeType": "<string>",
"data": "<string>",
"displayName": "<string>"
},
"fileData": {
"fileUri": "<string>",
"mimeType": "<string>",
"displayName": "<string>"
}
}
],
"id": "<string>",
"name": "<string>",
"response": {}
},
"inlineData": {
"data": "<string>",
"displayName": "<string>",
"mimeType": "<string>"
},
"text": "<string>",
"thought": true,
"thoughtSignature": "<string>",
"videoMetadata": {
"endOffset": "<string>",
"fps": 123,
"startOffset": "<string>"
},
"toolCall": {
"id": "<string>",
"args": {}
},
"toolResponse": {
"id": "<string>",
"response": {}
},
"partMetadata": {},
"audioTranscription": {
"text": "<string>",
"finished": true,
"languageCode": "<string>",
"speakerLabel": "<string>",
"words": [
{
"word": "<string>",
"startOffset": "<string>",
"endOffset": "<string>"
}
]
}
}
],
"role": "<string>"
},
"groundingMetadata": {
"imageSearchQueries": [
"<string>"
],
"groundingChunks": [
{
"image": {
"sourceUri": "<string>",
"imageUri": "<string>",
"title": "<string>",
"domain": "<string>"
},
"maps": {
"placeAnswerSources": {
"reviewSnippet": [
{
"authorAttribution": {
"displayName": "<string>",
"photoUri": "<string>",
"uri": "<string>"
},
"flagContentUri": "<string>",
"googleMapsUri": "<string>",
"relativePublishTimeDescription": "<string>",
"review": "<string>",
"reviewId": "<string>",
"title": "<string>"
}
],
"flagContentUri": "<string>",
"reviewSnippets": [
{
"authorAttribution": {
"displayName": "<string>",
"photoUri": "<string>",
"uri": "<string>"
},
"flagContentUri": "<string>",
"googleMapsUri": "<string>",
"relativePublishTimeDescription": "<string>",
"review": "<string>",
"reviewId": "<string>",
"title": "<string>"
}
]
},
"placeId": "<string>",
"text": "<string>",
"title": "<string>",
"uri": "<string>",
"route": {
"distanceMeters": 123,
"duration": "<string>",
"encodedPolyline": "<string>"
}
},
"retrievedContext": {
"documentName": "<string>",
"ragChunk": {
"pageSpan": {
"firstPage": 123,
"lastPage": 123
},
"text": "<string>",
"chunkId": "<string>",
"fileId": "<string>"
},
"text": "<string>",
"title": "<string>",
"uri": "<string>",
"customMetadata": [
{
"key": "<string>",
"numericValue": 123,
"stringListValue": {
"values": [
"<string>"
]
},
"stringValue": "<string>"
}
],
"fileSearchStore": "<string>",
"pageNumber": 123,
"mediaId": "<string>"
},
"web": {
"domain": "<string>",
"title": "<string>",
"uri": "<string>"
}
}
],
"groundingSupports": [
{
"confidenceScores": [
123
],
"groundingChunkIndices": [
123
],
"segment": {
"startIndex": 123,
"endIndex": 123,
"partIndex": 123,
"text": "<string>"
},
"renderedParts": [
123
]
}
],
"retrievalMetadata": {
"googleSearchDynamicRetrievalScore": 123
},
"searchEntryPoint": {
"renderedContent": "<string>",
"sdkBlob": "<string>"
},
"webSearchQueries": [
"<string>"
],
"googleMapsWidgetContextToken": "<string>",
"retrievalQueries": [
"<string>"
],
"sourceFlaggingUris": [
{
"flagContentUri": "<string>",
"sourceId": "<string>"
}
]
},
"partial": true,
"turnComplete": true,
"errorCode": "<string>",
"errorMessage": "<string>",
"interrupted": true,
"customMetadata": {},
"usageMetadata": {
"cacheTokensDetails": [
{
"tokenCount": 123
}
],
"cachedContentTokenCount": 123,
"candidatesTokenCount": 123,
"candidatesTokensDetails": [
{
"tokenCount": 123
}
],
"promptTokenCount": 123,
"promptTokensDetails": [
{
"tokenCount": 123
}
],
"thoughtsTokenCount": 123,
"toolUsePromptTokenCount": 123,
"toolUsePromptTokensDetails": [
{
"tokenCount": 123
}
],
"totalTokenCount": 123
},
"liveSessionResumptionUpdate": {
"newHandle": "<string>",
"resumable": true,
"lastConsumedClientMessageIndex": 123
},
"liveSessionId": "<string>",
"goAway": {
"timeLeft": "<string>"
},
"inputTranscription": {
"text": "<string>",
"finished": true,
"languageCode": "<string>",
"speakerLabel": "<string>",
"words": [
{
"word": "<string>",
"startOffset": "<string>",
"endOffset": "<string>"
}
]
},
"outputTranscription": {
"text": "<string>",
"finished": true,
"languageCode": "<string>",
"speakerLabel": "<string>",
"words": [
{
"word": "<string>",
"startOffset": "<string>",
"endOffset": "<string>"
}
]
},
"avgLogprobs": 123,
"logprobsResult": {
"chosenCandidates": [
{
"logProbability": 123,
"token": "<string>",
"tokenId": 123
}
],
"topCandidates": [
{
"candidates": [
{
"logProbability": 123,
"token": "<string>",
"tokenId": 123
}
]
}
],
"logProbabilitySum": 123
},
"cacheMetadata": {
"fingerprint": "<string>",
"contents_count": 1,
"cache_name": "<string>",
"expire_time": 123,
"invocations_used": 1,
"created_at": 123
},
"citationMetadata": {
"citations": [
{
"endIndex": 123,
"license": "<string>",
"publicationDate": {
"day": 123,
"month": 123,
"year": 123
},
"startIndex": 123,
"title": "<string>",
"uri": "<string>"
}
]
},
"interactionId": "<string>",
"invocationId": "",
"actions": {
"skipSummarization": true,
"stateDelta": {},
"artifactDelta": {},
"transferToAgent": "<string>",
"escalate": true,
"requestedAuthConfigs": {},
"requestedToolConfirmations": {},
"compaction": {
"startTimestamp": 123,
"endTimestamp": 123,
"compactedContent": {
"parts": [
{
"mediaResolution": {
"numTokens": 123
},
"codeExecutionResult": {
"output": "<string>",
"id": "<string>"
},
"executableCode": {
"code": "<string>",
"id": "<string>"
},
"fileData": {
"displayName": "<string>",
"fileUri": "<string>",
"mimeType": "<string>"
},
"functionCall": {
"id": "<string>",
"args": {},
"name": "<string>",
"partialArgs": [
{
"boolValue": true,
"jsonPath": "<string>",
"nullValue": "<string>",
"numberValue": 123,
"stringValue": "<string>",
"willContinue": true
}
],
"willContinue": true
},
"functionResponse": {
"willContinue": true,
"parts": [
{
"inlineData": {
"mimeType": "<string>",
"data": "<string>",
"displayName": "<string>"
},
"fileData": {
"fileUri": "<string>",
"mimeType": "<string>",
"displayName": "<string>"
}
}
],
"id": "<string>",
"name": "<string>",
"response": {}
},
"inlineData": {
"data": "<string>",
"displayName": "<string>",
"mimeType": "<string>"
},
"text": "<string>",
"thought": true,
"thoughtSignature": "<string>",
"videoMetadata": {
"endOffset": "<string>",
"fps": 123,
"startOffset": "<string>"
},
"toolCall": {
"id": "<string>",
"args": {}
},
"toolResponse": {
"id": "<string>",
"response": {}
},
"partMetadata": {},
"audioTranscription": {
"text": "<string>",
"finished": true,
"languageCode": "<string>",
"speakerLabel": "<string>",
"words": [
{
"word": "<string>",
"startOffset": "<string>",
"endOffset": "<string>"
}
]
}
}
],
"role": "<string>"
}
},
"endOfAgent": true,
"agentState": {},
"rewindBeforeInvocationId": "<string>",
"renderUiWidgets": [
{
"id": "<string>",
"provider": "<string>",
"payload": {}
}
]
},
"longRunningToolIds": [
"<string>"
],
"branch": "<string>",
"id": "",
"timestamp": 123
}
]{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Body
Response
Successful Response
Contains the multi-part content of a message.
Show child attributes
Show child attributes
Information for various kinds of grounding.
Show child attributes
Show child attributes
The reason why the turn is complete.
TURN_COMPLETE_REASON_UNSPECIFIED, MALFORMED_FUNCTION_CALL, RESPONSE_REJECTED, NEED_MORE_INPUT, PROHIBITED_INPUT_CONTENT, IMAGE_PROHIBITED_INPUT_CONTENT, INPUT_TEXT_CONTAIN_PROMINENT_PERSON_PROHIBITED, INPUT_IMAGE_CELEBRITY, INPUT_IMAGE_PHOTO_REALISTIC_CHILD_PROHIBITED, INPUT_TEXT_NCII_PROHIBITED, INPUT_OTHER, INPUT_IP_PROHIBITED, BLOCKLIST, UNSAFE_PROMPT_FOR_IMAGE_GENERATION, GENERATED_IMAGE_SAFETY, GENERATED_CONTENT_SAFETY, GENERATED_AUDIO_SAFETY, GENERATED_VIDEO_SAFETY, GENERATED_CONTENT_PROHIBITED, GENERATED_CONTENT_BLOCKLIST, GENERATED_IMAGE_PROHIBITED, GENERATED_IMAGE_CELEBRITY, GENERATED_IMAGE_PROMINENT_PEOPLE_DETECTED_BY_REWRITER, GENERATED_IMAGE_IDENTIFIABLE_PEOPLE, GENERATED_IMAGE_MINORS, OUTPUT_IMAGE_IP_PROHIBITED, GENERATED_OTHER, MAX_REGENERATION_REACHED Output only. The reason why the model stopped generating tokens.
If empty, the model has not stopped generating the tokens.
FINISH_REASON_UNSPECIFIED, STOP, MAX_TOKENS, SAFETY, RECITATION, LANGUAGE, OTHER, BLOCKLIST, PROHIBITED_CONTENT, SPII, MALFORMED_FUNCTION_CALL, IMAGE_SAFETY, UNEXPECTED_TOOL_CALL, IMAGE_PROHIBITED_CONTENT, NO_IMAGE, IMAGE_RECITATION, IMAGE_OTHER Usage metadata about the content generation request and response.
This message provides a detailed breakdown of token usage and other relevant metrics. This data type is not supported in Gemini API.
Show child attributes
Show child attributes
Update of the session resumption state.
Only sent if session_resumption was set in the connection config.
Show child attributes
Show child attributes
Server will not be able to service client soon.
Show child attributes
Show child attributes
Audio transcription in Server Content.
Show child attributes
Show child attributes
Audio transcription in Server Content.
Show child attributes
Show child attributes
The log probabilities of the tokens generated by the model.
This is useful for understanding the model's confidence in its predictions and for debugging. For example, you can use log probabilities to identify when the model is making a less confident prediction or to explore alternative responses that the model considered. A low log probability can also indicate that the model is "hallucinating" or generating factually incorrect information.
Show child attributes
Show child attributes
Metadata for context cache associated with LLM responses.
This class stores cache identification, usage tracking, and lifecycle information for a particular cache instance. It can be in two states:
- Active cache state: cache_name is set, all fields populated
- Fingerprint-only state: cache_name is None, only fingerprint and contents_count are set for prefix matching
Token counts (cached and total) are available in the LlmResponse.usage_metadata and should be accessed from there to avoid duplication.
Attributes: cache_name: The full resource name of the cached content (e.g., 'projects/123/locations/us-central1/cachedContents/456'). None when no active cache exists (fingerprint-only state). expire_time: Unix timestamp when the cache expires. None when no active cache exists. fingerprint: Hash of cacheable contents (instruction + tools + contents). Always present for prefix matching. invocations_used: Number of invocations this cache has been used for. None when no active cache exists. contents_count: Number of contents. When active cache exists, this is the count of cached contents. When no active cache exists, this is the total count of contents in the request. created_at: Unix timestamp when the cache was created. None when no active cache exists.
Show child attributes
Show child attributes
Citation information when the model quotes another source.
Show child attributes
Show child attributes
Represents the actions attached to an event.
Show child attributes
Show child attributes
curl --request POST \
--url https://api.example.com/run \
--header 'Content-Type: application/json' \
--data '
{
"appName": "<string>",
"userId": "<string>",
"sessionId": "<string>",
"newMessage": {
"parts": [
{
"mediaResolution": {
"numTokens": 123
},
"codeExecutionResult": {
"output": "<string>",
"id": "<string>"
},
"executableCode": {
"code": "<string>",
"id": "<string>"
},
"fileData": {
"displayName": "<string>",
"fileUri": "<string>",
"mimeType": "<string>"
},
"functionCall": {
"id": "<string>",
"args": {},
"name": "<string>",
"partialArgs": [
{
"boolValue": true,
"jsonPath": "<string>",
"nullValue": "<string>",
"numberValue": 123,
"stringValue": "<string>",
"willContinue": true
}
],
"willContinue": true
},
"functionResponse": {
"willContinue": true,
"parts": [
{
"inlineData": {
"mimeType": "<string>",
"data": "<string>",
"displayName": "<string>"
},
"fileData": {
"fileUri": "<string>",
"mimeType": "<string>",
"displayName": "<string>"
}
}
],
"id": "<string>",
"name": "<string>",
"response": {}
},
"inlineData": {
"data": "<string>",
"displayName": "<string>",
"mimeType": "<string>"
},
"text": "<string>",
"thought": true,
"thoughtSignature": "<string>",
"videoMetadata": {
"endOffset": "<string>",
"fps": 123,
"startOffset": "<string>"
},
"toolCall": {
"id": "<string>",
"args": {}
},
"toolResponse": {
"id": "<string>",
"response": {}
},
"partMetadata": {},
"audioTranscription": {
"text": "<string>",
"finished": true,
"languageCode": "<string>",
"speakerLabel": "<string>",
"words": [
{
"word": "<string>",
"startOffset": "<string>",
"endOffset": "<string>"
}
]
}
}
],
"role": "<string>"
},
"streaming": false,
"stateDelta": {},
"functionCallEventId": "<string>",
"invocationId": "<string>"
}
'import requests
url = "https://api.example.com/run"
payload = {
"appName": "<string>",
"userId": "<string>",
"sessionId": "<string>",
"newMessage": {
"parts": [
{
"mediaResolution": { "numTokens": 123 },
"codeExecutionResult": {
"output": "<string>",
"id": "<string>"
},
"executableCode": {
"code": "<string>",
"id": "<string>"
},
"fileData": {
"displayName": "<string>",
"fileUri": "<string>",
"mimeType": "<string>"
},
"functionCall": {
"id": "<string>",
"args": {},
"name": "<string>",
"partialArgs": [
{
"boolValue": True,
"jsonPath": "<string>",
"nullValue": "<string>",
"numberValue": 123,
"stringValue": "<string>",
"willContinue": True
}
],
"willContinue": True
},
"functionResponse": {
"willContinue": True,
"parts": [
{
"inlineData": {
"mimeType": "<string>",
"data": "<string>",
"displayName": "<string>"
},
"fileData": {
"fileUri": "<string>",
"mimeType": "<string>",
"displayName": "<string>"
}
}
],
"id": "<string>",
"name": "<string>",
"response": {}
},
"inlineData": {
"data": "<string>",
"displayName": "<string>",
"mimeType": "<string>"
},
"text": "<string>",
"thought": True,
"thoughtSignature": "<string>",
"videoMetadata": {
"endOffset": "<string>",
"fps": 123,
"startOffset": "<string>"
},
"toolCall": {
"id": "<string>",
"args": {}
},
"toolResponse": {
"id": "<string>",
"response": {}
},
"partMetadata": {},
"audioTranscription": {
"text": "<string>",
"finished": True,
"languageCode": "<string>",
"speakerLabel": "<string>",
"words": [
{
"word": "<string>",
"startOffset": "<string>",
"endOffset": "<string>"
}
]
}
}
],
"role": "<string>"
},
"streaming": False,
"stateDelta": {},
"functionCallEventId": "<string>",
"invocationId": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
appName: '<string>',
userId: '<string>',
sessionId: '<string>',
newMessage: {
parts: [
{
mediaResolution: {numTokens: 123},
codeExecutionResult: {output: '<string>', id: '<string>'},
executableCode: {code: '<string>', id: '<string>'},
fileData: {displayName: '<string>', fileUri: '<string>', mimeType: '<string>'},
functionCall: {
id: '<string>',
args: {},
name: '<string>',
partialArgs: [
{
boolValue: true,
jsonPath: '<string>',
nullValue: '<string>',
numberValue: 123,
stringValue: '<string>',
willContinue: true
}
],
willContinue: true
},
functionResponse: {
willContinue: true,
parts: [
{
inlineData: {mimeType: '<string>', data: '<string>', displayName: '<string>'},
fileData: {fileUri: '<string>', mimeType: '<string>', displayName: '<string>'}
}
],
id: '<string>',
name: '<string>',
response: {}
},
inlineData: {data: '<string>', displayName: '<string>', mimeType: '<string>'},
text: '<string>',
thought: true,
thoughtSignature: '<string>',
videoMetadata: {endOffset: '<string>', fps: 123, startOffset: '<string>'},
toolCall: {id: '<string>', args: {}},
toolResponse: {id: '<string>', response: {}},
partMetadata: {},
audioTranscription: {
text: '<string>',
finished: true,
languageCode: '<string>',
speakerLabel: '<string>',
words: [{word: '<string>', startOffset: '<string>', endOffset: '<string>'}]
}
}
],
role: '<string>'
},
streaming: false,
stateDelta: {},
functionCallEventId: '<string>',
invocationId: '<string>'
})
};
fetch('https://api.example.com/run', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/run",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'appName' => '<string>',
'userId' => '<string>',
'sessionId' => '<string>',
'newMessage' => [
'parts' => [
[
'mediaResolution' => [
'numTokens' => 123
],
'codeExecutionResult' => [
'output' => '<string>',
'id' => '<string>'
],
'executableCode' => [
'code' => '<string>',
'id' => '<string>'
],
'fileData' => [
'displayName' => '<string>',
'fileUri' => '<string>',
'mimeType' => '<string>'
],
'functionCall' => [
'id' => '<string>',
'args' => [
],
'name' => '<string>',
'partialArgs' => [
[
'boolValue' => true,
'jsonPath' => '<string>',
'nullValue' => '<string>',
'numberValue' => 123,
'stringValue' => '<string>',
'willContinue' => true
]
],
'willContinue' => true
],
'functionResponse' => [
'willContinue' => true,
'parts' => [
[
'inlineData' => [
'mimeType' => '<string>',
'data' => '<string>',
'displayName' => '<string>'
],
'fileData' => [
'fileUri' => '<string>',
'mimeType' => '<string>',
'displayName' => '<string>'
]
]
],
'id' => '<string>',
'name' => '<string>',
'response' => [
]
],
'inlineData' => [
'data' => '<string>',
'displayName' => '<string>',
'mimeType' => '<string>'
],
'text' => '<string>',
'thought' => true,
'thoughtSignature' => '<string>',
'videoMetadata' => [
'endOffset' => '<string>',
'fps' => 123,
'startOffset' => '<string>'
],
'toolCall' => [
'id' => '<string>',
'args' => [
]
],
'toolResponse' => [
'id' => '<string>',
'response' => [
]
],
'partMetadata' => [
],
'audioTranscription' => [
'text' => '<string>',
'finished' => true,
'languageCode' => '<string>',
'speakerLabel' => '<string>',
'words' => [
[
'word' => '<string>',
'startOffset' => '<string>',
'endOffset' => '<string>'
]
]
]
]
],
'role' => '<string>'
],
'streaming' => false,
'stateDelta' => [
],
'functionCallEventId' => '<string>',
'invocationId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/run"
payload := strings.NewReader("{\n \"appName\": \"<string>\",\n \"userId\": \"<string>\",\n \"sessionId\": \"<string>\",\n \"newMessage\": {\n \"parts\": [\n {\n \"mediaResolution\": {\n \"numTokens\": 123\n },\n \"codeExecutionResult\": {\n \"output\": \"<string>\",\n \"id\": \"<string>\"\n },\n \"executableCode\": {\n \"code\": \"<string>\",\n \"id\": \"<string>\"\n },\n \"fileData\": {\n \"displayName\": \"<string>\",\n \"fileUri\": \"<string>\",\n \"mimeType\": \"<string>\"\n },\n \"functionCall\": {\n \"id\": \"<string>\",\n \"args\": {},\n \"name\": \"<string>\",\n \"partialArgs\": [\n {\n \"boolValue\": true,\n \"jsonPath\": \"<string>\",\n \"nullValue\": \"<string>\",\n \"numberValue\": 123,\n \"stringValue\": \"<string>\",\n \"willContinue\": true\n }\n ],\n \"willContinue\": true\n },\n \"functionResponse\": {\n \"willContinue\": true,\n \"parts\": [\n {\n \"inlineData\": {\n \"mimeType\": \"<string>\",\n \"data\": \"<string>\",\n \"displayName\": \"<string>\"\n },\n \"fileData\": {\n \"fileUri\": \"<string>\",\n \"mimeType\": \"<string>\",\n \"displayName\": \"<string>\"\n }\n }\n ],\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"response\": {}\n },\n \"inlineData\": {\n \"data\": \"<string>\",\n \"displayName\": \"<string>\",\n \"mimeType\": \"<string>\"\n },\n \"text\": \"<string>\",\n \"thought\": true,\n \"thoughtSignature\": \"<string>\",\n \"videoMetadata\": {\n \"endOffset\": \"<string>\",\n \"fps\": 123,\n \"startOffset\": \"<string>\"\n },\n \"toolCall\": {\n \"id\": \"<string>\",\n \"args\": {}\n },\n \"toolResponse\": {\n \"id\": \"<string>\",\n \"response\": {}\n },\n \"partMetadata\": {},\n \"audioTranscription\": {\n \"text\": \"<string>\",\n \"finished\": true,\n \"languageCode\": \"<string>\",\n \"speakerLabel\": \"<string>\",\n \"words\": [\n {\n \"word\": \"<string>\",\n \"startOffset\": \"<string>\",\n \"endOffset\": \"<string>\"\n }\n ]\n }\n }\n ],\n \"role\": \"<string>\"\n },\n \"streaming\": false,\n \"stateDelta\": {},\n \"functionCallEventId\": \"<string>\",\n \"invocationId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/run")
.header("Content-Type", "application/json")
.body("{\n \"appName\": \"<string>\",\n \"userId\": \"<string>\",\n \"sessionId\": \"<string>\",\n \"newMessage\": {\n \"parts\": [\n {\n \"mediaResolution\": {\n \"numTokens\": 123\n },\n \"codeExecutionResult\": {\n \"output\": \"<string>\",\n \"id\": \"<string>\"\n },\n \"executableCode\": {\n \"code\": \"<string>\",\n \"id\": \"<string>\"\n },\n \"fileData\": {\n \"displayName\": \"<string>\",\n \"fileUri\": \"<string>\",\n \"mimeType\": \"<string>\"\n },\n \"functionCall\": {\n \"id\": \"<string>\",\n \"args\": {},\n \"name\": \"<string>\",\n \"partialArgs\": [\n {\n \"boolValue\": true,\n \"jsonPath\": \"<string>\",\n \"nullValue\": \"<string>\",\n \"numberValue\": 123,\n \"stringValue\": \"<string>\",\n \"willContinue\": true\n }\n ],\n \"willContinue\": true\n },\n \"functionResponse\": {\n \"willContinue\": true,\n \"parts\": [\n {\n \"inlineData\": {\n \"mimeType\": \"<string>\",\n \"data\": \"<string>\",\n \"displayName\": \"<string>\"\n },\n \"fileData\": {\n \"fileUri\": \"<string>\",\n \"mimeType\": \"<string>\",\n \"displayName\": \"<string>\"\n }\n }\n ],\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"response\": {}\n },\n \"inlineData\": {\n \"data\": \"<string>\",\n \"displayName\": \"<string>\",\n \"mimeType\": \"<string>\"\n },\n \"text\": \"<string>\",\n \"thought\": true,\n \"thoughtSignature\": \"<string>\",\n \"videoMetadata\": {\n \"endOffset\": \"<string>\",\n \"fps\": 123,\n \"startOffset\": \"<string>\"\n },\n \"toolCall\": {\n \"id\": \"<string>\",\n \"args\": {}\n },\n \"toolResponse\": {\n \"id\": \"<string>\",\n \"response\": {}\n },\n \"partMetadata\": {},\n \"audioTranscription\": {\n \"text\": \"<string>\",\n \"finished\": true,\n \"languageCode\": \"<string>\",\n \"speakerLabel\": \"<string>\",\n \"words\": [\n {\n \"word\": \"<string>\",\n \"startOffset\": \"<string>\",\n \"endOffset\": \"<string>\"\n }\n ]\n }\n }\n ],\n \"role\": \"<string>\"\n },\n \"streaming\": false,\n \"stateDelta\": {},\n \"functionCallEventId\": \"<string>\",\n \"invocationId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/run")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"appName\": \"<string>\",\n \"userId\": \"<string>\",\n \"sessionId\": \"<string>\",\n \"newMessage\": {\n \"parts\": [\n {\n \"mediaResolution\": {\n \"numTokens\": 123\n },\n \"codeExecutionResult\": {\n \"output\": \"<string>\",\n \"id\": \"<string>\"\n },\n \"executableCode\": {\n \"code\": \"<string>\",\n \"id\": \"<string>\"\n },\n \"fileData\": {\n \"displayName\": \"<string>\",\n \"fileUri\": \"<string>\",\n \"mimeType\": \"<string>\"\n },\n \"functionCall\": {\n \"id\": \"<string>\",\n \"args\": {},\n \"name\": \"<string>\",\n \"partialArgs\": [\n {\n \"boolValue\": true,\n \"jsonPath\": \"<string>\",\n \"nullValue\": \"<string>\",\n \"numberValue\": 123,\n \"stringValue\": \"<string>\",\n \"willContinue\": true\n }\n ],\n \"willContinue\": true\n },\n \"functionResponse\": {\n \"willContinue\": true,\n \"parts\": [\n {\n \"inlineData\": {\n \"mimeType\": \"<string>\",\n \"data\": \"<string>\",\n \"displayName\": \"<string>\"\n },\n \"fileData\": {\n \"fileUri\": \"<string>\",\n \"mimeType\": \"<string>\",\n \"displayName\": \"<string>\"\n }\n }\n ],\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"response\": {}\n },\n \"inlineData\": {\n \"data\": \"<string>\",\n \"displayName\": \"<string>\",\n \"mimeType\": \"<string>\"\n },\n \"text\": \"<string>\",\n \"thought\": true,\n \"thoughtSignature\": \"<string>\",\n \"videoMetadata\": {\n \"endOffset\": \"<string>\",\n \"fps\": 123,\n \"startOffset\": \"<string>\"\n },\n \"toolCall\": {\n \"id\": \"<string>\",\n \"args\": {}\n },\n \"toolResponse\": {\n \"id\": \"<string>\",\n \"response\": {}\n },\n \"partMetadata\": {},\n \"audioTranscription\": {\n \"text\": \"<string>\",\n \"finished\": true,\n \"languageCode\": \"<string>\",\n \"speakerLabel\": \"<string>\",\n \"words\": [\n {\n \"word\": \"<string>\",\n \"startOffset\": \"<string>\",\n \"endOffset\": \"<string>\"\n }\n ]\n }\n }\n ],\n \"role\": \"<string>\"\n },\n \"streaming\": false,\n \"stateDelta\": {},\n \"functionCallEventId\": \"<string>\",\n \"invocationId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body[
{
"author": "<string>",
"modelVersion": "<string>",
"content": {
"parts": [
{
"mediaResolution": {
"numTokens": 123
},
"codeExecutionResult": {
"output": "<string>",
"id": "<string>"
},
"executableCode": {
"code": "<string>",
"id": "<string>"
},
"fileData": {
"displayName": "<string>",
"fileUri": "<string>",
"mimeType": "<string>"
},
"functionCall": {
"id": "<string>",
"args": {},
"name": "<string>",
"partialArgs": [
{
"boolValue": true,
"jsonPath": "<string>",
"nullValue": "<string>",
"numberValue": 123,
"stringValue": "<string>",
"willContinue": true
}
],
"willContinue": true
},
"functionResponse": {
"willContinue": true,
"parts": [
{
"inlineData": {
"mimeType": "<string>",
"data": "<string>",
"displayName": "<string>"
},
"fileData": {
"fileUri": "<string>",
"mimeType": "<string>",
"displayName": "<string>"
}
}
],
"id": "<string>",
"name": "<string>",
"response": {}
},
"inlineData": {
"data": "<string>",
"displayName": "<string>",
"mimeType": "<string>"
},
"text": "<string>",
"thought": true,
"thoughtSignature": "<string>",
"videoMetadata": {
"endOffset": "<string>",
"fps": 123,
"startOffset": "<string>"
},
"toolCall": {
"id": "<string>",
"args": {}
},
"toolResponse": {
"id": "<string>",
"response": {}
},
"partMetadata": {},
"audioTranscription": {
"text": "<string>",
"finished": true,
"languageCode": "<string>",
"speakerLabel": "<string>",
"words": [
{
"word": "<string>",
"startOffset": "<string>",
"endOffset": "<string>"
}
]
}
}
],
"role": "<string>"
},
"groundingMetadata": {
"imageSearchQueries": [
"<string>"
],
"groundingChunks": [
{
"image": {
"sourceUri": "<string>",
"imageUri": "<string>",
"title": "<string>",
"domain": "<string>"
},
"maps": {
"placeAnswerSources": {
"reviewSnippet": [
{
"authorAttribution": {
"displayName": "<string>",
"photoUri": "<string>",
"uri": "<string>"
},
"flagContentUri": "<string>",
"googleMapsUri": "<string>",
"relativePublishTimeDescription": "<string>",
"review": "<string>",
"reviewId": "<string>",
"title": "<string>"
}
],
"flagContentUri": "<string>",
"reviewSnippets": [
{
"authorAttribution": {
"displayName": "<string>",
"photoUri": "<string>",
"uri": "<string>"
},
"flagContentUri": "<string>",
"googleMapsUri": "<string>",
"relativePublishTimeDescription": "<string>",
"review": "<string>",
"reviewId": "<string>",
"title": "<string>"
}
]
},
"placeId": "<string>",
"text": "<string>",
"title": "<string>",
"uri": "<string>",
"route": {
"distanceMeters": 123,
"duration": "<string>",
"encodedPolyline": "<string>"
}
},
"retrievedContext": {
"documentName": "<string>",
"ragChunk": {
"pageSpan": {
"firstPage": 123,
"lastPage": 123
},
"text": "<string>",
"chunkId": "<string>",
"fileId": "<string>"
},
"text": "<string>",
"title": "<string>",
"uri": "<string>",
"customMetadata": [
{
"key": "<string>",
"numericValue": 123,
"stringListValue": {
"values": [
"<string>"
]
},
"stringValue": "<string>"
}
],
"fileSearchStore": "<string>",
"pageNumber": 123,
"mediaId": "<string>"
},
"web": {
"domain": "<string>",
"title": "<string>",
"uri": "<string>"
}
}
],
"groundingSupports": [
{
"confidenceScores": [
123
],
"groundingChunkIndices": [
123
],
"segment": {
"startIndex": 123,
"endIndex": 123,
"partIndex": 123,
"text": "<string>"
},
"renderedParts": [
123
]
}
],
"retrievalMetadata": {
"googleSearchDynamicRetrievalScore": 123
},
"searchEntryPoint": {
"renderedContent": "<string>",
"sdkBlob": "<string>"
},
"webSearchQueries": [
"<string>"
],
"googleMapsWidgetContextToken": "<string>",
"retrievalQueries": [
"<string>"
],
"sourceFlaggingUris": [
{
"flagContentUri": "<string>",
"sourceId": "<string>"
}
]
},
"partial": true,
"turnComplete": true,
"errorCode": "<string>",
"errorMessage": "<string>",
"interrupted": true,
"customMetadata": {},
"usageMetadata": {
"cacheTokensDetails": [
{
"tokenCount": 123
}
],
"cachedContentTokenCount": 123,
"candidatesTokenCount": 123,
"candidatesTokensDetails": [
{
"tokenCount": 123
}
],
"promptTokenCount": 123,
"promptTokensDetails": [
{
"tokenCount": 123
}
],
"thoughtsTokenCount": 123,
"toolUsePromptTokenCount": 123,
"toolUsePromptTokensDetails": [
{
"tokenCount": 123
}
],
"totalTokenCount": 123
},
"liveSessionResumptionUpdate": {
"newHandle": "<string>",
"resumable": true,
"lastConsumedClientMessageIndex": 123
},
"liveSessionId": "<string>",
"goAway": {
"timeLeft": "<string>"
},
"inputTranscription": {
"text": "<string>",
"finished": true,
"languageCode": "<string>",
"speakerLabel": "<string>",
"words": [
{
"word": "<string>",
"startOffset": "<string>",
"endOffset": "<string>"
}
]
},
"outputTranscription": {
"text": "<string>",
"finished": true,
"languageCode": "<string>",
"speakerLabel": "<string>",
"words": [
{
"word": "<string>",
"startOffset": "<string>",
"endOffset": "<string>"
}
]
},
"avgLogprobs": 123,
"logprobsResult": {
"chosenCandidates": [
{
"logProbability": 123,
"token": "<string>",
"tokenId": 123
}
],
"topCandidates": [
{
"candidates": [
{
"logProbability": 123,
"token": "<string>",
"tokenId": 123
}
]
}
],
"logProbabilitySum": 123
},
"cacheMetadata": {
"fingerprint": "<string>",
"contents_count": 1,
"cache_name": "<string>",
"expire_time": 123,
"invocations_used": 1,
"created_at": 123
},
"citationMetadata": {
"citations": [
{
"endIndex": 123,
"license": "<string>",
"publicationDate": {
"day": 123,
"month": 123,
"year": 123
},
"startIndex": 123,
"title": "<string>",
"uri": "<string>"
}
]
},
"interactionId": "<string>",
"invocationId": "",
"actions": {
"skipSummarization": true,
"stateDelta": {},
"artifactDelta": {},
"transferToAgent": "<string>",
"escalate": true,
"requestedAuthConfigs": {},
"requestedToolConfirmations": {},
"compaction": {
"startTimestamp": 123,
"endTimestamp": 123,
"compactedContent": {
"parts": [
{
"mediaResolution": {
"numTokens": 123
},
"codeExecutionResult": {
"output": "<string>",
"id": "<string>"
},
"executableCode": {
"code": "<string>",
"id": "<string>"
},
"fileData": {
"displayName": "<string>",
"fileUri": "<string>",
"mimeType": "<string>"
},
"functionCall": {
"id": "<string>",
"args": {},
"name": "<string>",
"partialArgs": [
{
"boolValue": true,
"jsonPath": "<string>",
"nullValue": "<string>",
"numberValue": 123,
"stringValue": "<string>",
"willContinue": true
}
],
"willContinue": true
},
"functionResponse": {
"willContinue": true,
"parts": [
{
"inlineData": {
"mimeType": "<string>",
"data": "<string>",
"displayName": "<string>"
},
"fileData": {
"fileUri": "<string>",
"mimeType": "<string>",
"displayName": "<string>"
}
}
],
"id": "<string>",
"name": "<string>",
"response": {}
},
"inlineData": {
"data": "<string>",
"displayName": "<string>",
"mimeType": "<string>"
},
"text": "<string>",
"thought": true,
"thoughtSignature": "<string>",
"videoMetadata": {
"endOffset": "<string>",
"fps": 123,
"startOffset": "<string>"
},
"toolCall": {
"id": "<string>",
"args": {}
},
"toolResponse": {
"id": "<string>",
"response": {}
},
"partMetadata": {},
"audioTranscription": {
"text": "<string>",
"finished": true,
"languageCode": "<string>",
"speakerLabel": "<string>",
"words": [
{
"word": "<string>",
"startOffset": "<string>",
"endOffset": "<string>"
}
]
}
}
],
"role": "<string>"
}
},
"endOfAgent": true,
"agentState": {},
"rewindBeforeInvocationId": "<string>",
"renderUiWidgets": [
{
"id": "<string>",
"provider": "<string>",
"payload": {}
}
]
},
"longRunningToolIds": [
"<string>"
],
"branch": "<string>",
"id": "",
"timestamp": 123
}
]{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}