Gemini Interactions API

The Gemini Interactions API allows developers to build generative AI applications using Gemini models. Gemini is our most capable model, built from the ground up to be multimodal. It can generalize and seamlessly understand, operate across, and combine different types of information including language, images, audio, video, and code. You can use the Gemini API for use cases like reasoning across text and images, content generation, dialogue agents, summarization and classification systems, and more.

Версия API: v1beta v1

Создание взаимодействия

публикация https://generativelanguage.googleapis.com/v1beta/interactions

Создает новое взаимодействие.

Путь / Параметры запроса

api_version строка (обязательно)

Какую версию API использовать?

Текст запроса

Тело запроса содержит данные следующей структуры:

модель ModelOption (необязательно)

Название модели, использованной для генерации взаимодействия.
Обязательно, если параметр `agent` не указан.

Модель, которая выполнит ваш запрос.\n\nДополнительную информацию см. в разделе [модели](https://ai.google.dev/gemini-api/docs/models).

Возможные значения

  • gemini-2.5-flash

    Наша первая гибридная модель рассуждений, поддерживающая контекстное окно в 1 миллион токенов и имеющая бюджеты мышления.

  • gemini-2.5-pro

    Наша передовая многоцелевая модель, превосходно справляющаяся с задачами программирования и сложным логическим мышлением.

  • gemma-4-26b-a4b-it

    Джемма 4 26B A4B IT

  • gemma-4-31b-it

    Джемма 4 31B IT

  • gemini-flash-latest

    Последняя версия Gemini Flash

  • gemini-flash-lite-latest

    Новейшая версия фонарика Gemini Flash-Lite

  • gemini-pro-latest

    Последняя версия Gemini Pro

  • gemini-2.5-flash-lite

    Наша самая компактная и экономичная модель, предназначенная для масштабного использования.

  • gemini-2.5-flash-image

    Наша собственная модель генерации изображений, оптимизированная для скорости, гибкости и контекстного понимания. Стоимость ввода и вывода текста такая же, как у 2,5-дюймовой версии Flash.

  • gemini-3-flash-preview

    Наша самая интеллектуальная модель, созданная для скорости, сочетает в себе передовые методы разведки с превосходными возможностями поиска и посадки на землю.

  • gemini-3.1-pro-preview

    Наша новейшая, передовая модель логического мышления с беспрецедентной глубиной и детализацией, а также мощными возможностями многомодального понимания и кодирования.

  • gemini-3.1-pro-preview-customtools

    Gemini 3.1 Pro Preview оптимизирован для использования пользовательских инструментов.

  • gemini-3.1-flash-lite

    Наша наиболее экономичная модель, оптимизированная для выполнения больших объемов агентских задач, перевода и простой обработки данных.

  • gemini-3-pro-image

    Изображение Gemini 3 Pro

  • nano-banana-pro-preview

    Предварительный просмотр изображения Gemini 3 Pro

  • gemini-3.1-flash-image

    Изображение Gemini 3.1 Flash.

  • gemini-3.5-flash

    Наша наиболее интеллектуальная модель для достижения устойчиво высоких результатов в задачах, связанных с агентным программированием и кодированием.

  • gemini-3.6-flash

    Наша наиболее интеллектуальная модель для достижения устойчиво высоких результатов в задачах, связанных с агентным программированием и кодированием.

  • gemini-3.7-flash

    Наша наиболее интеллектуальная модель для достижения устойчиво высоких результатов в задачах, связанных с агентным программированием и кодированием.

  • lyria-3-clip-preview

    Наша модель генерации музыки с низкой задержкой оптимизирована для высококачественных аудиоклипов и точного контроля ритма.

  • lyria-3-pro-preview

    Наша передовая генеративная модель, способная обрабатывать целые композиции и обладающая глубоким пониманием композиции, оптимизирована для точного структурного контроля и сложных переходов между различными музыкальными стилями.

  • gemini-robotics-er-1.6-preview

    Gemini Robotics-ER 1.6 Preview

  • gemini-robotics-er-2-preview

    Предварительный обзор Gemini Robotics Embodied Reasoning 2

агент AgentOption (необязательно)

Имя агента, использованного для генерации взаимодействия.
Обязательно, если параметр `model` не указан.

Агент, с которым необходимо взаимодействовать.

Возможные значения

  • deep-research-pro-preview-12-2025

    Агент по глубоким исследованиям компании Gemini

  • deep-research-preview-04-2026

    Агент по глубоким исследованиям компании Gemini

  • deep-research-max-preview-04-2026

    Gemini Deep Research Max Agent

  • antigravity-preview-05-2026

    Используйте управляемый агент Antigravity для выполнения многоэтапных задач, требующих логического мышления, работы с файлами и использования инструментов.

Входные данные: Content или array ( Content ) или array ( Step ) или string (обязательно)

Входные данные для взаимодействия (общие для модели и агента).

строка системной инструкции (необязательно)

Системная инструкция для взаимодействия.

массив инструментов ( Инструмент ) (необязательно)

Список объявлений инструментов, которые модель может вызывать во время взаимодействия.

response_format ResponseFormat или массив ( ResponseFormat ) (необязательно)

Обеспечивает, чтобы сгенерированный ответ представлял собой объект JSON, соответствующий схеме JSON, указанной в этом поле.

потоковое логическое значение (необязательно)

Только ввод данных. Будет ли взаимодействие передаваться в потоковом режиме.

хранить логическое значение (необязательно)

Только ввод. Следует ли сохранять ответ и запрос для последующего получения.

фоновое логическое значение (необязательно)

Только ввод данных. Следует ли запускать взаимодействие с моделью в фоновом режиме.

generation_config GenerationConfig (необязательно)

Конфигурация модели
Параметры конфигурации для взаимодействия модели.
Альтернатива `agent_config`. Применимо только при заданном `model`.

Параметры конфигурации для взаимодействия моделей.

Поля

max_output_tokens — целое число (необязательно)

Максимальное количество токенов, которые можно включить в ответ.

Начальное целое число (необязательно)

Исходные данные используются при декодировании для обеспечения воспроизводимости.

speech_config SpeakerConfig или массив (SpeechConfig) (необязательно)

Дополнительно. Настройка речи и работы с несколькими говорящими.

Настройка для работы с несколькими говорящими и генерации речи.

Поля

Массив динамиков (SpeechConfig) (необязательно)

Индивидуальные настройки акустических систем.

Настройки для речевого взаимодействия.

Поля

языковая строка (необязательно)

Язык речи.

Кабель для подключения динамика (опционально)

Имя выступающего должно совпадать с именем выступающего, указанным в задании.

голосовая строка (необязательно)

Голос говорящего.

массив stop_sequences (строка) (необязательно)

Список последовательностей символов, которые прекратят взаимодействие с выводом.

thinking_level ThinkingLevel (необязательно)

Уровень мыслительных токенов, которые должна генерировать модель.

Возможные значения

  • minimal

    Практически никакого размышления.

  • low

    Низкий уровень мышления.

  • medium

    Средний уровень сложности мышления.

  • high

    Высокий уровень мыслительных способностей.

thinking_summaries ThinkingSummaries (необязательно)

Стоит ли включать в ответ краткое изложение мыслей?

Возможные значения

  • auto

    Краткие обзоры автоматического мышления.

  • none

    Никаких кратких изложений мысли.

tool_choice ToolChoiceConfig или перечисление (строка) (необязательно)

Конфигурация выбора инструмента.

Возможные значения:

  • auto

    Автоматический выбор инструмента.

  • any

    Любой выбор инструмента.

  • none

    Выбор инструментов отсутствует.

  • validated

    Выбор инструмента подтвержден.

transcription_config TranscriptionConfig (необязательно)

Необязательно. Настройки для распознавания речи (транскрипции). Если присутствует, функция автоматического распознавания речи (ASR) включена.

Настройка распознавания речи (транскрипции).

Поля

массив custom_vocabulary (строка) (необязательно)

Необязательно. Список пользовательских лексических фраз, которые помогут модели распознавания речи сместить акцент в сторону распознавания конкретных терминов.

массив language_codes (строка) (необязательно)

Необязательно. Коды языков BCP-47, указывающие на языки, присутствующие в аудиозаписи. Если поле опущено или пустое, по умолчанию используется автоматическое определение языка.

режим TranscriptionMode или перечисление (строка) (необязательно)

Параметры или перечисление режима дифференцированной транскрипции.

Настройки режима транскрипции.

Возможные типы

SmartTranscriptionMode

Настройки для режима интеллектуальной транскрипции.

тип объекта (обязательно)

Описание отсутствует.

Всегда устанавливать режим "smart" .

Режим дословной транскрипции

Настройки для режима дословной транскрипции.

diarization_mode string (необязательно)

Необязательный параметр. Настраивает диаризацию говорящих. Поддерживаемые значения: "speaker".

массив timestamp_granularities (строка) (необязательно)

Необязательный параметр. Укажите степень детализации временных меток, которые будут включены в выходные данные транскрипции. Поддерживаемые значения: "word". Если поле пустое, временные метки не генерируются.

тип объекта (обязательно)

Описание отсутствует.

Всегда устанавливайте значение "verbatim" .

video_config VideoConfig (необязательно)

Настройки для генерации видео.

Параметры конфигурации для генерации видео.

Поля

перечисление задач (строка) (необязательно)

Дополнительный режим работы для генерации видео. Если не указан, модель автоматически определяет соответствующий режим на основе предоставленной текстовой подсказки и входных данных.

Возможные значения:

  • text_to_video

    Создает видео исключительно на основе текстовой подсказки.

  • image_to_video

    Создает видео из одного или двух исходных изображений. Первое изображение определяет начальный кадр, а дополнительное второе изображение определяет конечный кадр.

  • reference_to_video

    Создает видео, используя исходные медиафайлы (такие как изображения, аудио или видео).

  • edit

    Изменяет существующее входное видео.

  • extend

    Расширяет возможности существующего входного видео.

объект agent_config (необязательно)

Конфигурация агента
Настройки агента.
Альтернатива `generation_config`. Применимо только при заданном `agent`.

Возможные типы

Полиморфный дискриминатор: type

AntigravityAgentConfig

Настройки среды выполнения агента Antigravity. Обеспечивают управление средой выполнения агента и конфигурацией инструментов на стороне сервера.

max_total_tokens строка (необязательно)

Максимальное общее количество токенов для выполнения задания агентом.

строка модели (необязательно)

Модель, используемая для рассуждений агента.

тип объекта (обязательно)

Описание отсутствует.

Всегда устанавливайте режим "antigravity" .

CodeMenderAgentConfig

Настройки агента CodeMender.

find_request FindRequest (необязательно)

Параметры для поиска уязвимостей.

Параметры запроса, специфичные для сессий FIND, используются для обнаружения уязвимостей в кодовой базе.

Поля

строка описания (необязательно)

Дополнительный контекст или пользовательские инструкции, предоставленные пользователем для проведения анализа уязвимостей.

finding_id строка (необязательно)

Идентификатор конкретной уязвимости, подлежащей проверке. В основном используется в режиме ПРОВЕРКИ (VERIFY) для того, чтобы сосредоточить проверку агента на выполнении на одной конкретной уязвимости.

режим перечисления (строка) (необязательно)

Режим работы поисковой сессии.

Возможные значения:

  • scan

    Быстрое сканирование с использованием только исходного классификатора.

  • verify

    Проводит классификацию с последующим детальным исследованием.

массив source_files (FileContent) (необязательно)

Список исходных файлов, которые необходимо предоставить в качестве контекста для сканирования.

Содержимое отдельного файла в кодовой базе.

Поля

строка содержимого (необязательно)

Содержимое файла, закодированное в UTF-8.

строка пути (необязательно)

Относительный путь к файлу относительно корневого каталога проекта.

fix_request FixRequest (необязательно)

Параметры для устранения уязвимостей.

Параметры запроса, специфичные для FIX-сессий, используются для генерации и проверки обновлений безопасности.

Поля

строка описания (необязательно)

Дополнительный контекст или пользовательские инструкции, предоставленные пользователем для управления процессом создания патча.

finding_id строка (необязательно)

Идентификатор конкретной уязвимости, подлежащей устранению. Этот идентификатор соответствует ранее обнаруженной уязвимости.

массив source_files (FileContent) (необязательно)

Список исходных файлов, предоставляющих контекст для устранения проблемы. Как правило, это файлы, содержащие выявленную уязвимость.

Содержимое отдельного файла в кодовой базе.

Поля

строка содержимого (необязательно)

Содержимое файла, закодированное в UTF-8.

строка пути (необязательно)

Относительный путь к файлу относительно корневого каталога проекта.

строка модели (необязательно)

Название модели, используемой для агента CodeMender. Одна сессия CodeMender будет использовать только одну модель.

session_config SessionConfig (необязательно)

Дополнительные параметры конфигурации, специфичные для каждой сессии, позволяют переопределить поведение агента по умолчанию.

Настройка сессий CodeMender.

Поля

max_rounds — целое число (необязательно)

Максимальное количество раундов взаимодействия, которое агент может выполнить до истечения тайм-аута.

session_id строка (необязательно)

Параметр для группировки нескольких взаимодействий, относящихся к одной и той же сессии CodeMender.

тип объекта (обязательно)

Описание отсутствует.

Всегда устанавливайте значение "code-mender" .

DeepResearchAgentConfig

Настройки агента Deep Research.

collaborative_planning логическое значение (необязательно)

Включает планирование с участием человека для агента Deep Research. Если установлено значение true, агент Deep Research предоставит план исследования в своем ответе. Затем агент продолжит работу только в том случае, если пользователь подтвердит план на следующем ходу.

enable_bigquery_tool boolean (необязательно)

Включает инструмент BigQuery для агента Deep Research.

thinking_summaries ThinkingSummaries (необязательно)

Стоит ли включать в ответ краткое изложение мыслей?

Возможные значения

  • auto

    Краткие обзоры автоматического мышления.

  • none

    Никаких кратких изложений мысли.

тип объекта (обязательно)

Описание отсутствует.

Всегда устанавливайте значение "deep-research" .

перечисление визуализации (строка) (необязательно)

Стоит ли включать визуализации в ответ.

Возможные значения:

  • off

    Не включайте визуализации.

  • auto

    Автоматическое добавление визуализаций.

DynamicAgentConfig

Настройка для динамических агентов.

тип объекта (обязательно)

Описание отсутствует.

Всегда устанавливайте значение "dynamic" .

среда EnvironmentConfig или строка (необязательно)

Конфигурация среды для взаимодействия. Может представлять собой объект, указывающий на удаленные источники среды, или строку, ссылающуюся на существующий идентификатор среды.

объект меток (необязательно)

Метки с заданными пользователем метаданными для запроса.

previous_interaction_id строка (необязательно)

Идентификатор предыдущего взаимодействия, если таковое имелось.

массив safety_settings (SafetySetting) (необязательно)

Настройки безопасности для взаимодействия.

Параметр безопасности, влияющий на поведение блокировки безопасности. Параметр безопасности состоит из категории вреда и порогового значения для этой категории.

Поля

метод перечисления (строка) (необязательно)

Необязательный параметр. Способ блокировки контента. Если не указан, по умолчанию используется оценка вероятности.

Возможные значения:

  • severity

    Метод блокировки вреда использует как вероятностные оценки, так и оценки тяжести последствий.

  • probability

    Метод блокировки вреда использует показатель вероятности.

пороговое значение перечисления (строка) (необязательно)

Обязательно. Пороговое значение для блокировки контента. Если вероятность причинения вреда превысит этот порог, контент будет заблокирован.

Возможные значения:

  • block_low_and_above

    Блокируйте контент с низкой или высокой вероятностью причинения вреда.

  • block_medium_and_above

    Блокируйте контент со средней или высокой вероятностью причинения вреда.

  • block_only_high

    Блокируйте контент с высокой вероятностью причинения вреда.

  • block_none

    Не блокируйте никакой контент, независимо от вероятности его нанесения вреда.

  • off

    Полностью отключите защитный фильтр.

тип HarmCategory (необязательно)

Обязательно. Категория вреда, подлежащая блокировке.

Возможные значения

  • hate_speech

    Контент, пропагандирующий насилие или разжигающий ненависть к отдельным лицам или группам на основе определенных признаков.

  • dangerous_content

    Контент, который пропагандирует, способствует или поощряет опасные действия.

  • harassment

    Оскорбительный, угрожающий контент, направленный на запугивание, мучение или высмеивание.

  • sexually_explicit

    Контент, содержащий материалы сексуального характера.

  • civic_integrity

    Устарело: фильтр выборов больше не поддерживается. Категория причинения вреда — гражданская неприкосновенность.

  • image_hate

    Изображения, содержащие разжигающие ненависть высказывания.

  • image_dangerous_content

    Изображения, содержащие опасный контент.

  • image_harassment

    Изображения, содержащие элементы домогательств.

  • image_sexually_explicit

    Изображения, содержащие материалы сексуального характера.

  • jailbreak

    Подсказки, предназначенные для обхода защитных фильтров.

service_tier ServiceTier (необязательно)

Уровень обслуживания для данного взаимодействия.

Возможные значения

  • flex

    Гибкий уровень обслуживания.

  • standard

    Стандартный уровень обслуживания.

  • priority

    Приоритетный уровень обслуживания.

  • deferred

    Отложенный уровень обслуживания.

webhook_config WebhookConfig (необязательно)

Необязательно. Настройка веб-перехватчика для получения уведомлений по завершении взаимодействия.

Сообщение для настройки событий веб-перехватчика для запроса.

Поля

Массив URIS (строка) (необязательно)

Необязательно. Если задано, эти URI веб-перехватчиков будут использоваться для событий веб-перехватчиков вместо зарегистрированных веб-перехватчиков.

Объект user_metadata (необязательно)

Необязательно. Метаданные пользователя, которые будут возвращаться веб-хукам при каждом срабатывании события.

Ответ

Возвращает ресурс " Взаимодействие" .

Простая просьба

Пример ответа

{
  "created": "2025-11-26T12:25:15Z",
  "id": "v1_ChdPU0F4YWFtNkFwS2kxZThQZ05lbXdROBIXT1NBeGFhbTZBcEtpMWU4UGdOZW13UTg",
  "model": "gemini-3.6-flash",
  "object": "interaction",
  "status": "completed",
  "steps": [
    {
      "type": "model_output",
      "content": [
        {
          "type": "text",
          "text": "Hello! I'm functioning perfectly and ready to assist you.\n\nHow are you doing today?"
        }
      ]
    }
  ],
  "updated": "2025-11-26T12:25:15Z",
  "usage": {
    "input_tokens_by_modality": [
      {
        "modality": "text",
        "tokens": 7
      }
    ],
    "total_cached_tokens": 0,
    "total_input_tokens": 7,
    "total_output_tokens": 20,
    "total_thought_tokens": 22,
    "total_tokens": 49,
    "total_tool_use_tokens": 0
  }
}

Многооборотный

Пример ответа

{
  "created": "2025-11-26T12:22:47Z",
  "id": "v1_ChdPU0F4YWFtNkFwS2kxZThQZ05lbXdROBIXT1NBeGFhbTZBcEtpMWU4UGdOZW13UTg",
  "model": "gemini-3.6-flash",
  "object": "interaction",
  "status": "completed",
  "steps": [
    {
      "type": "model_output",
      "content": [
        {
          "type": "text",
          "text": "The capital of France is Paris."
        }
      ]
    }
  ],
  "updated": "2025-11-26T12:22:47Z",
  "usage": {
    "input_tokens_by_modality": [
      {
        "modality": "text",
        "tokens": 50
      }
    ],
    "total_cached_tokens": 0,
    "total_input_tokens": 50,
    "total_output_tokens": 10,
    "total_thought_tokens": 0,
    "total_tokens": 60,
    "total_tool_use_tokens": 0
  }
}

Ввод изображения

Пример ответа

{
  "created": "2025-11-26T12:22:47Z",
  "id": "v1_ChdPU0F4YWFtNkFwS2kxZThQZ05lbXdROBIXT1NBeGFhbTZBcEtpMWU4UGdOZW13UTg",
  "model": "gemini-3.6-flash",
  "object": "interaction",
  "status": "completed",
  "steps": [
    {
      "type": "model_output",
      "content": [
        {
          "type": "text",
          "text": "A white humanoid robot with glowing blue eyes stands holding a red skateboard."
        }
      ]
    }
  ],
  "updated": "2025-11-26T12:22:47Z",
  "usage": {
    "input_tokens_by_modality": [
      {
        "modality": "text",
        "tokens": 10
      },
      {
        "modality": "image",
        "tokens": 258
      }
    ],
    "total_cached_tokens": 0,
    "total_input_tokens": 268,
    "total_output_tokens": 20,
    "total_thought_tokens": 0,
    "total_tokens": 288,
    "total_tool_use_tokens": 0
  }
}

Вызов функции

Пример ответа

{
  "created": "2025-11-26T12:22:47Z",
  "id": "v1_ChdPU0F4YWFtNkFwS2kxZThQZ05lbXdROBIXT1NBeGFhbTZBcEtpMWU4UGdOZW13UTg",
  "model": "gemini-3.6-flash",
  "object": "interaction",
  "status": "requires_action",
  "steps": [
    {
      "name": "get_weather",
      "type": "function_call",
      "arguments": {
        "location": "Boston, MA"
      },
      "id": "gth23981"
    }
  ],
  "updated": "2025-11-26T12:22:47Z",
  "usage": {
    "input_tokens_by_modality": [
      {
        "modality": "text",
        "tokens": 100
      }
    ],
    "total_cached_tokens": 0,
    "total_input_tokens": 100,
    "total_output_tokens": 25,
    "total_thought_tokens": 0,
    "total_tokens": 125,
    "total_tool_use_tokens": 50
  }
}

Глубокое исследование

Пример ответа

{
  "agent": "deep-research-pro-preview-12-2025",
  "created": "2025-11-26T12:22:47Z",
  "id": "v1_ChdPU0F4YWFtNkFwS2kxZThQZ05lbXdROBIXT1NBeGFhbTZBcEtpMWU4UGdOZW13UTg",
  "object": "interaction",
  "status": "completed",
  "steps": [
    {
      "type": "model_output",
      "content": [
        {
          "type": "text",
          "text": "Here is a comprehensive research report on the current state of cancer research..."
        }
      ]
    }
  ],
  "updated": "2025-11-26T12:22:47Z",
  "usage": {
    "input_tokens_by_modality": [
      {
        "modality": "text",
        "tokens": 20
      }
    ],
    "total_cached_tokens": 0,
    "total_input_tokens": 20,
    "total_output_tokens": 1000,
    "total_thought_tokens": 500,
    "total_tokens": 1520,
    "total_tool_use_tokens": 0
  }
}

Антигравитационный агент

Пример ответа

{
  "agent": "antigravity-preview-05-2026",
  "created": "2025-11-26T12:22:47Z",
  "environment_id": "env_abc123",
  "id": "v1_ChdPU0F4YWFtNkFwS2kxZThQZ05lbXdROBIXT1NBeGFhbTZBcEtpMWU4UGdOZW13UTg",
  "object": "interaction",
  "status": "completed",
  "steps": [
    {
      "type": "model_output",
      "content": [
        {
          "type": "text",
          "text": "I've summarized the top 5 Hacker News stories and saved the results to /workspace/summary.md."
        }
      ]
    }
  ],
  "updated": "2025-11-26T12:22:47Z",
  "usage": {
    "input_tokens_by_modality": [
      {
        "modality": "text",
        "tokens": 50
      }
    ],
    "total_cached_tokens": 0,
    "total_input_tokens": 50,
    "total_output_tokens": 500,
    "total_thought_tokens": 200,
    "total_tokens": 750,
    "total_tool_use_tokens": 0
  }
}

Среда повторного использования

Пример ответа

{
  "agent": "antigravity-preview-05-2026",
  "created": "2025-11-26T12:23:00Z",
  "environment_id": "env_abc123",
  "id": "v1_Chd2ZTJhYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkwMTIzNDU2Nzg",
  "object": "interaction",
  "status": "completed",
  "steps": [
    {
      "type": "model_output",
      "content": [
        {
          "type": "text",
          "text": "I've updated /workspace/hello.py to accept a name argument and greet the user."
        }
      ]
    }
  ],
  "updated": "2025-11-26T12:23:00Z",
  "usage": {
    "input_tokens_by_modality": [
      {
        "modality": "text",
        "tokens": 80
      }
    ],
    "total_cached_tokens": 0,
    "total_input_tokens": 80,
    "total_output_tokens": 200,
    "total_thought_tokens": 100,
    "total_tokens": 380,
    "total_tool_use_tokens": 0
  }
}

С использованием источников.

Агент по работе с клиентами

Отмена взаимодействия

post https://generativelanguage.googleapis.com/v1beta/interactions/{id}/cancel

Отменяет взаимодействие по идентификатору. Это относится только к фоновым взаимодействиям, которые все еще выполняются.

Путь / Параметры запроса

api_version строка (обязательно)

Какую версию API использовать?

строковый идентификатор (обязательно)

Уникальный идентификатор взаимодействия, которое необходимо отменить.

Ответ

Возвращает ресурс " Взаимодействие" .

Отменить взаимодействие

Пример ответа

{
  "agent": "deep-research-pro-preview-12-2025",
  "created": "2026-06-22T04:55:47Z",
  "id": "v1_ChdVc0E0YXJTYk1zYlV6N0lQcXRXVG1BYxIXVXNBNGFyU2JNc2JVejdJUHF0V1RtQWM",
  "status": "cancelled",
  "steps": [
    {
      "type": "user_input",
      "content": [
        {
          "type": "text",
          "text": "Research the history of the Google TPUs with a focus on 2025 specs."
        }
      ]
    }
  ],
  "updated": "2026-06-22T04:55:47Z"
}

Получение информации о взаимодействии

получить https://generativelanguage.googleapis.com/v1beta/interactions/{id}

Получает полную информацию об одном взаимодействии на основе его `Interaction.id`.

Путь / Параметры запроса

api_version строка (обязательно)

Какую версию API использовать?

строковый идентификатор (обязательно)

Уникальный идентификатор взаимодействия, который необходимо получить.

last_event_id строка (необязательно)

Необязательный параметр. Если задан, возобновляет поток взаимодействия со следующего фрагмента после события, отмеченного идентификатором события. Может использоваться только в том случае, если `stream` имеет значение true.

потоковое логическое значение (необязательно)

Если установить значение true, сгенерированный контент будет передаваться потоком инкрементально.

Значение по умолчанию: False

Ответ

Возвращает ресурс " Взаимодействие" .

Получить взаимодействие

Пример ответа

{
  "created": "2025-11-26T12:25:15Z",
  "id": "v1_ChdPU0F4YWFtNkFwS2kxZThQZ05lbXdROBIXT1NBeGFhbTZBcEtpMWU4UGdOZW13UTg",
  "model": "gemini-3.6-flash",
  "object": "interaction",
  "status": "completed",
  "steps": [
    {
      "type": "model_output",
      "content": [
        {
          "type": "text",
          "text": "I'm doing great, thank you for asking! How can I help you today?"
        }
      ]
    }
  ],
  "updated": "2025-11-26T12:25:15Z"
}

Удаление взаимодействия

удалить https://generativelanguage.googleapis.com/v1beta/interactions/{id}

Удаляет взаимодействие по идентификатору.

Путь / Параметры запроса

api_version строка (обязательно)

Какую версию API использовать?

строковый идентификатор (обязательно)

Уникальный идентификатор взаимодействия, которое необходимо удалить.

Ответ

В случае успеха ответ будет пустым.

Удалить

Ресурсы

Взаимодействие

Ресурс "Взаимодействие".

Поля

агент AgentOption (необязательно)

Имя агента, использованного для генерации взаимодействия.

Агент, с которым необходимо взаимодействовать.

Возможные значения

  • deep-research-pro-preview-12-2025

    Агент по глубоким исследованиям компании Gemini

  • deep-research-preview-04-2026

    Агент по глубоким исследованиям компании Gemini

  • deep-research-max-preview-04-2026

    Gemini Deep Research Max Agent

  • antigravity-preview-05-2026

    Используйте управляемый агент Antigravity для выполнения многоэтапных задач, требующих логического мышления, работы с файлами и использования инструментов.

объект agent_config (необязательно)

Параметры конфигурации для взаимодействия с агентом.

Возможные типы

Полиморфный дискриминатор: type

AntigravityAgentConfig

Настройки среды выполнения агента Antigravity. Обеспечивают управление средой выполнения агента и конфигурацией инструментов на стороне сервера.

max_total_tokens строка (необязательно)

Максимальное общее количество токенов для выполнения задания агентом.

строка модели (необязательно)

Модель, используемая для рассуждений агента.

тип объекта (обязательно)

Описание отсутствует.

Всегда устанавливайте режим "antigravity" .

CodeMenderAgentConfig

Настройки агента CodeMender.

find_request FindRequest (необязательно)

Параметры для поиска уязвимостей.

Параметры запроса, специфичные для сессий FIND, используются для обнаружения уязвимостей в кодовой базе.

Поля

строка описания (необязательно)

Дополнительный контекст или пользовательские инструкции, предоставленные пользователем для проведения анализа уязвимостей.

finding_id строка (необязательно)

Идентификатор конкретной уязвимости, подлежащей проверке. В основном используется в режиме ПРОВЕРКИ (VERIFY) для того, чтобы сосредоточить проверку агента на выполнении на одной конкретной уязвимости.

режим перечисления (строка) (необязательно)

Режим работы поисковой сессии.

Возможные значения:

  • scan

    Быстрое сканирование с использованием только исходного классификатора.

  • verify

    Проводит классификацию с последующим детальным исследованием.

массив source_files (FileContent) (необязательно)

Список исходных файлов, которые необходимо предоставить в качестве контекста для сканирования.

Содержимое отдельного файла в кодовой базе.

Поля

строка содержимого (необязательно)

Содержимое файла, закодированное в UTF-8.

строка пути (необязательно)

Относительный путь к файлу относительно корневого каталога проекта.

fix_request FixRequest (необязательно)

Параметры для устранения уязвимостей.

Параметры запроса, специфичные для FIX-сессий, используются для генерации и проверки обновлений безопасности.

Поля

строка описания (необязательно)

Дополнительный контекст или пользовательские инструкции, предоставленные пользователем для управления процессом создания патча.

finding_id строка (необязательно)

Идентификатор конкретной уязвимости, подлежащей устранению. Этот идентификатор соответствует ранее обнаруженной уязвимости.

массив source_files (FileContent) (необязательно)

Список исходных файлов, предоставляющих контекст для устранения проблемы. Как правило, это файлы, содержащие выявленную уязвимость.

Содержимое отдельного файла в кодовой базе.

Поля

строка содержимого (необязательно)

Содержимое файла, закодированное в UTF-8.

строка пути (необязательно)

Относительный путь к файлу относительно корневого каталога проекта.

строка модели (необязательно)

Название модели, используемой для агента CodeMender. Одна сессия CodeMender будет использовать только одну модель.

session_config SessionConfig (необязательно)

Дополнительные параметры конфигурации, специфичные для каждой сессии, позволяют переопределить поведение агента по умолчанию.

Настройка сессий CodeMender.

Поля

max_rounds — целое число (необязательно)

Максимальное количество раундов взаимодействия, которое агент может выполнить до истечения тайм-аута.

session_id строка (необязательно)

Параметр для группировки нескольких взаимодействий, относящихся к одной и той же сессии CodeMender.

тип объекта (обязательно)

Описание отсутствует.

Всегда устанавливайте значение "code-mender" .

DeepResearchAgentConfig

Настройки агента Deep Research.

collaborative_planning логическое значение (необязательно)

Включает планирование с участием человека для агента Deep Research. Если установлено значение true, агент Deep Research предоставит план исследования в своем ответе. Затем агент продолжит работу только в том случае, если пользователь подтвердит план на следующем ходу.

enable_bigquery_tool boolean (необязательно)

Включает инструмент BigQuery для агента Deep Research.

thinking_summaries ThinkingSummaries (необязательно)

Стоит ли включать в ответ краткое изложение мыслей?

Возможные значения

  • auto

    Краткие обзоры автоматического мышления.

  • none

    Никаких кратких изложений мысли.

тип объекта (обязательно)

Описание отсутствует.

Всегда устанавливайте значение "deep-research" .

перечисление визуализации (строка) (необязательно)

Стоит ли включать визуализации в ответ.

Возможные значения:

  • off

    Не включайте визуализации.

  • auto

    Автоматическое добавление визуализаций.

DynamicAgentConfig

Настройка для динамических агентов.

тип объекта (обязательно)

Описание отсутствует.

Всегда устанавливайте значение "dynamic" .

созданная строка (необязательно)

Только вывод. Время создания ответа в формате ISO 8601 (ГГГГ-ММ-ДДЧч:мм:ссЗ).

среда EnvironmentConfig или строка (необязательно)

Конфигурация среды для взаимодействия. Может представлять собой объект, указывающий на удаленные источники среды, или строку, ссылающуюся на существующий идентификатор среды.

environment_id строка (необязательно)

Только для вывода. Идентификатор среды для взаимодействия. Заполняется только в том случае, если в запросе задана конфигурация среды.

массив ошибок (Ошибка) (необязательно)

Только вывод. Диагностические ошибки / ошибки платформы, зафиксированные во время взаимодействия.

Сообщение об ошибке, возникшей в результате взаимодействия.

Поля

строка кода (необязательно)

URI, определяющий тип ошибки.

строка сообщения (необязательно)

Удобочитаемое сообщение об ошибке.

строка идентификатора (необязательно)

Обязательно. Только для вывода. Уникальный идентификатор завершения взаимодействия.

По умолчанию:

Входные данные: Content или массив ( Content ), массив ( Step ) или строка (необязательно).

Входные данные для взаимодействия.

объект меток (необязательно)

Метки с заданными пользователем метаданными для запроса.

модель ModelOption (необязательно)

Название модели, использованной для генерации взаимодействия.

Модель, которая выполнит ваш запрос.\n\nДополнительную информацию см. в разделе [модели](https://ai.google.dev/gemini-api/docs/models).

Возможные значения

  • gemini-2.5-flash

    Наша первая гибридная модель рассуждений, поддерживающая контекстное окно в 1 миллион токенов и имеющая бюджеты мышления.

  • gemini-2.5-pro

    Наша передовая многоцелевая модель, превосходно справляющаяся с задачами программирования и сложным логическим мышлением.

  • gemma-4-26b-a4b-it

    Джемма 4 26B A4B IT

  • gemma-4-31b-it

    Джемма 4 31B IT

  • gemini-flash-latest

    Последняя версия Gemini Flash

  • gemini-flash-lite-latest

    Новейшая версия фонарика Gemini Flash-Lite

  • gemini-pro-latest

    Последняя версия Gemini Pro

  • gemini-2.5-flash-lite

    Наша самая компактная и экономичная модель, предназначенная для масштабного использования.

  • gemini-2.5-flash-image

    Наша собственная модель генерации изображений, оптимизированная для скорости, гибкости и контекстного понимания. Стоимость ввода и вывода текста такая же, как у 2,5-дюймовой версии Flash.

  • gemini-3-flash-preview

    Наша самая интеллектуальная модель, созданная для скорости, сочетает в себе передовые методы разведки с превосходными возможностями поиска и посадки на землю.

  • gemini-3.1-pro-preview

    Наша новейшая, передовая модель логического мышления с беспрецедентной глубиной и детализацией, а также мощными возможностями многомодального понимания и кодирования.

  • gemini-3.1-pro-preview-customtools

    Gemini 3.1 Pro Preview оптимизирован для использования пользовательских инструментов.

  • gemini-3.1-flash-lite

    Наша наиболее экономичная модель, оптимизированная для выполнения больших объемов агентских задач, перевода и простой обработки данных.

  • gemini-3-pro-image

    Изображение Gemini 3 Pro

  • nano-banana-pro-preview

    Предварительный просмотр изображения Gemini 3 Pro

  • gemini-3.1-flash-image

    Изображение Gemini 3.1 Flash.

  • gemini-3.5-flash

    Наша наиболее интеллектуальная модель для достижения устойчиво высоких результатов в задачах, связанных с агентным программированием и кодированием.

  • gemini-3.6-flash

    Наша наиболее интеллектуальная модель для достижения устойчиво высоких результатов в задачах, связанных с агентным программированием и кодированием.

  • gemini-3.7-flash

    Наша наиболее интеллектуальная модель для достижения устойчиво высоких результатов в задачах, связанных с агентным программированием и кодированием.

  • lyria-3-clip-preview

    Наша модель генерации музыки с низкой задержкой оптимизирована для высококачественных аудиоклипов и точного контроля ритма.

  • lyria-3-pro-preview

    Наша передовая генеративная модель, способная обрабатывать целые композиции и обладающая глубоким пониманием композиции, оптимизирована для точного структурного контроля и сложных переходов между различными музыкальными стилями.

  • gemini-robotics-er-1.6-preview

    Gemini Robotics-ER 1.6 Preview

  • gemini-robotics-er-2-preview

    Предварительный обзор Gemini Robotics Embodied Reasoning 2

previous_interaction_id строка (необязательно)

Идентификатор предыдущего взаимодействия, если таковое имелось.

response_format ResponseFormat или массив ( ResponseFormat ) (необязательно)

Обеспечивает, чтобы сгенерированный ответ представлял собой объект JSON, соответствующий схеме JSON, указанной в этом поле.

массив safety_settings (SafetySetting) (необязательно)

Настройки безопасности для взаимодействия.

Параметр безопасности, влияющий на поведение блокировки безопасности. Параметр безопасности состоит из категории вреда и порогового значения для этой категории.

Поля

метод перечисления (строка) (необязательно)

Необязательный параметр. Способ блокировки контента. Если не указан, по умолчанию используется оценка вероятности.

Возможные значения:

  • severity

    Метод блокировки вреда использует как вероятностные оценки, так и оценки тяжести последствий.

  • probability

    Метод блокировки вреда использует показатель вероятности.

пороговое значение перечисления (строка) (необязательно)

Обязательно. Пороговое значение для блокировки контента. Если вероятность причинения вреда превысит этот порог, контент будет заблокирован.

Возможные значения:

  • block_low_and_above

    Блокируйте контент с низкой или высокой вероятностью причинения вреда.

  • block_medium_and_above

    Блокируйте контент со средней или высокой вероятностью причинения вреда.

  • block_only_high

    Блокируйте контент с высокой вероятностью причинения вреда.

  • block_none

    Не блокируйте никакой контент, независимо от вероятности его нанесения вреда.

  • off

    Полностью отключите защитный фильтр.

тип HarmCategory (необязательно)

Обязательно. Категория вреда, подлежащая блокировке.

Возможные значения

  • hate_speech

    Контент, пропагандирующий насилие или разжигающий ненависть к отдельным лицам или группам на основе определенных признаков.

  • dangerous_content

    Контент, который пропагандирует, способствует или поощряет опасные действия.

  • harassment

    Оскорбительный, угрожающий контент, направленный на запугивание, мучение или высмеивание.

  • sexually_explicit

    Контент, содержащий материалы сексуального характера.

  • civic_integrity

    Устарело: фильтр выборов больше не поддерживается. Категория причинения вреда — гражданская неприкосновенность.

  • image_hate

    Изображения, содержащие разжигающие ненависть высказывания.

  • image_dangerous_content

    Изображения, содержащие опасный контент.

  • image_harassment

    Изображения, содержащие элементы домогательств.

  • image_sexually_explicit

    Изображения, содержащие материалы сексуального характера.

  • jailbreak

    Подсказки, предназначенные для обхода защитных фильтров.

service_tier ServiceTier (необязательно)

Уровень обслуживания для данного взаимодействия.

Возможные значения

  • flex

    Гибкий уровень обслуживания.

  • standard

    Стандартный уровень обслуживания.

  • priority

    Приоритетный уровень обслуживания.

  • deferred

    Отложенный уровень обслуживания.

перечисление статуса (строка) (необязательно)

Обязательный параметр. Только вывод. Статус взаимодействия.

Возможные значения:

  • in_progress

    Взаимодействие продолжается.

  • requires_action

    Для взаимодействия требуется действие/ввод данных от пользователя.

  • completed

    Взаимодействие завершено.

  • failed

    Взаимодействие не удалось.

  • cancelled

    Встреча была отменена.

  • incomplete

    Взаимодействие завершено, но результаты неполные (например, достигнуто значение max_tokens).

  • budget_exceeded

    Взаимодействие было прервано из-за превышения лимита токенов.

  • queued

    Взаимодействие поставлено в очередь и ожидает обработки.

массив шагов ( Шаг ) (необязательно)

Только вывод. Этапы взаимодействия, если они включены в ответ.

строка системной инструкции (необязательно)

Системная инструкция для взаимодействия.

массив инструментов ( Инструмент ) (необязательно)

Список объявлений инструментов, которые модель может вызывать во время взаимодействия.

обновленная строка (необязательно)

Только вывод. Время последнего обновления ответа в формате ISO 8601 (ГГГГ-ММ-ДДТч:мм:ссЗ).

Использование (необязательно )

Только вывод. Статистика использования токенов в запросе на взаимодействие.

Статистика использования токенов в запросах на взаимодействие.

Поля

массив cached_tokens_by_modality (ModalityTokens) (необязательно)

Анализ использования кэшированных токенов по способам доступа.

Количество токенов для одного варианта ответа.

Поля

модальность ResponseModality (необязательно)

Способ отображения количества токенов.

Возможные значения

  • text

    Указывает, что модель должна возвращать текст.

  • image

    Указывает, что модель должна возвращать изображения.

  • audio

    Указывает, что модель должна возвращать аудиоданные.

  • video

    Указывает, что модель должна возвращать видео.

  • document

    Указывает, что модель должна возвращать документы.

токены целое число (необязательно)

Количество токенов для данного режима.

массив grounding_tool_count (GroundingToolCount) (необязательно)

Количество инструментов для заземления.

Количество заземляющих инструментов подсчитывается.

Поля

count целое число (необязательно)

Количество заземляющих инструментов подсчитывается.

тип перечисления (строка) (необязательно)

Тип заземляющего инструмента, связанный с подсчетом.

Возможные значения:

  • google_search

    Интеграция веб-поиска Google и поиска изображений, а также интеграция веб-поиска с корпоративными приложениями.

  • google_maps

    Определить местоположение с помощью Google Maps.

  • retrieval

    Использование данных клиента, например, VertexAISearch.

input_tokens_by_modality array (ModalityTokens) (optional)

Анализ использования входных токенов в зависимости от модальности ввода.

Количество токенов для одного варианта ответа.

Поля

модальность ResponseModality (необязательно)

Способ отображения количества токенов.

Возможные значения

  • text

    Указывает, что модель должна возвращать текст.

  • image

    Указывает, что модель должна возвращать изображения.

  • audio

    Указывает, что модель должна возвращать аудиоданные.

  • video

    Указывает, что модель должна возвращать видео.

  • document

    Указывает, что модель должна возвращать документы.

токены целое число (необязательно)

Количество токенов для данного режима.

output_tokens_by_modality array (ModalityTokens) (optional)

Анализ использования выходных токенов по видам модальностей.

Количество токенов для одного варианта ответа.

Поля

модальность ResponseModality (необязательно)

Способ отображения количества токенов.

Возможные значения

  • text

    Указывает, что модель должна возвращать текст.

  • image

    Указывает, что модель должна возвращать изображения.

  • audio

    Указывает, что модель должна возвращать аудиоданные.

  • video

    Указывает, что модель должна возвращать видео.

  • document

    Указывает, что модель должна возвращать документы.

токены целое число (необязательно)

Количество токенов для данного режима.

tool_use_tokens_by_modality array (ModalityTokens) (optional)

Анализ использования токенов инструментов в зависимости от модальности.

Количество токенов для одного варианта ответа.

Поля

модальность ResponseModality (необязательно)

Способ отображения количества токенов.

Возможные значения

  • text

    Указывает, что модель должна возвращать текст.

  • image

    Указывает, что модель должна возвращать изображения.

  • audio

    Указывает, что модель должна возвращать аудиоданные.

  • video

    Указывает, что модель должна возвращать видео.

  • document

    Указывает, что модель должна возвращать документы.

токены целое число (необязательно)

Количество токенов для данного режима.

total_cached_tokens — целое число (необязательно)

Количество токенов в кэшированной части запроса (кэшированное содержимое).

total_input_tokens целое число (необязательно)

Количество токенов в подсказке (контексте).

total_output_tokens целое число (необязательно)

Общее количество токенов во всех сгенерированных ответах.

total_thought_tokens целое число (необязательно)

Количество токенов мыслей для моделей мышления.

total_tokens целое число (необязательно)

Общее количество токенов для запроса на взаимодействие (запрос + ответы + другие внутренние токены).

total_tool_use_tokens целое число (необязательно)

Количество токенов, присутствующих в подсказках использования инструмента.

webhook_config WebhookConfig (необязательно)

Необязательно. Настройка веб-перехватчика для получения уведомлений по завершении взаимодействия.

Сообщение для настройки событий веб-перехватчика для запроса.

Поля

Массив URIS (строка) (необязательно)

Необязательно. Если задано, эти URI веб-перехватчиков будут использоваться для событий веб-перехватчиков вместо зарегистрированных веб-перехватчиков.

Объект user_metadata (необязательно)

Необязательно. Метаданные пользователя, которые будут возвращаться веб-хукам при каждом срабатывании события.

Примеры

Пример

{
  "created": "2025-12-04T15:01:45Z",
  "id": "v1_ChdXS0l4YWZXTk9xbk0xZThQczhEcmlROBIXV0tJeGFmV05PcW5NMWU4UHM4RHJpUTg",
  "model": "gemini-3.6-flash",
  "object": "interaction",
  "status": "completed",
  "steps": [
    {
      "type": "model_output",
      "content": [
        {
          "type": "text",
          "text": "Hello! I'm doing well, functioning as expected. Thank you for asking! How are you doing today?"
        }
      ]
    }
  ],
  "updated": "2025-12-04T15:01:45Z",
  "usage": {
    "input_tokens_by_modality": [
      {
        "modality": "text",
        "tokens": 7
      }
    ],
    "total_cached_tokens": 0,
    "total_input_tokens": 7,
    "total_output_tokens": 23,
    "total_thought_tokens": 49,
    "total_tokens": 79,
    "total_tool_use_tokens": 0
  }
}

Модели данных

Содержание

Содержание ответа.

Возможные типы

Аудиоконтент

Блок аудиоконтента.

каналы целое число (необязательно)

Количество аудиоканалов.

строка данных (необязательно)

Аудиоконтент.

перечисление mime_type (строка) (необязательно)

MIME-тип аудиофайла.

Возможные значения:

  • audio/wav

    аудиоформат WAV

  • audio/mp3

    аудиоформат MP3

  • audio/aiff

    аудиоформат AIFF

  • audio/aac

    аудиоформат AAC

  • audio/ogg

    Аудиоформат OGG

  • audio/flac

    аудиоформат FLAC

  • audio/mpeg

    аудиоформат MPEG

  • audio/m4a

    аудиоформат M4A

  • audio/l16

    аудиоформат L16

  • audio/opus

    Аудиоформат OPUS

  • audio/alaw

    Аудиоформат ALAW

  • audio/mulaw

    Аудиоформат MULAW

sample_rate — целое число (необязательно)

Частота дискретизации аудиосигнала.

тип объекта (обязательно)

Описание отсутствует.

Всегда устанавливайте значение "audio" .

строка URI (необязательно)

URI аудиофайла.

Содержимое документа

Блок содержимого документа.

строка данных (необязательно)

Содержание документа.

перечисление mime_type (строка) (необязательно)

MIME-тип документа.

Возможные значения:

  • application/pdf

    PDF-документ

  • text/csv

    формат документа CSV

тип объекта (обязательно)

Описание отсутствует.

Всегда устанавливайте значение "document" .

строка URI (необязательно)

URI документа.

ImageContent

Блок с графическим содержимым.

строка данных (необязательно)

Содержание изображения.

перечисление mime_type (строка) (необязательно)

MIME-тип изображения.

Возможные значения:

  • image/png

    формат изображения PNG

  • image/jpeg

    формат изображения JPEG

  • image/webp

    формат изображений WebP

  • image/heic

    формат изображения HEIC

  • image/heif

    формат изображения HEIF

  • image/gif

    формат изображения GIF

  • image/bmp

    формат изображения BMP

  • image/tiff

    формат изображения TIFF

разрешение MediaResolution (необязательно)

Разрешение средств массовой информации.

Возможные значения

  • low

    Низкое разрешение.

  • medium

    Среднее разрешение.

  • high

    Высокое разрешение.

  • ultra_high

    Сверхвысокое разрешение.

тип объекта (обязательно)

Описание отсутствует.

Всегда устанавливайте значение "image" .

строка URI (необязательно)

URI изображения.

Текстовое содержимое

Блок текстового содержимого.

массив аннотаций (Аннотация) (необязательно)

Информация об источниках для контента, сгенерированного моделью.

Информация об источниках для контента, сгенерированного моделью.

Возможные типы

FileCitation

Аннотация к файлу.

объект custom_metadata (необязательно)

Пользователь предоставил метаданные о полученном контексте.

document_uri строка (необязательно)

URI файла.

end_index целое число (необязательно)

Конец выделенного сегмента, без учета каких-либо ограничений.

file_name string (необязательно)

Название файла.

media_id строка (необязательно)

В случае цитирования изображений, пожалуйста, укажите идентификатор медиафайла (Media ID), если таковой имеется.

page_number целое число (необязательно)

Номер страницы цитируемого документа, если таковой имеется.

исходная строка (необязательно)

Источник указан для части текста.

start_index — целое число (необязательно)

Начало сегмента ответа, который относится к данному источнику. Индекс указывает начало сегмента, измеряемое в байтах.

тип объекта (обязательно)

Описание отсутствует.

Всегда устанавливайте значение "file_citation" .

PlaceCitation

Аннотация к географическому местоположению.

end_index целое число (необязательно)

Конец выделенного сегмента, без учета каких-либо ограничений.

строковое имя (необязательно)

Название места.

place_id строка (необязательно)

Идентификатор места в формате `places/{place_id}`.

массив review_snippets (ReviewSnippet) (необязательно)

Фрагменты отзывов, используемые для генерации ответов об особенностях того или иного места в Google Maps.

Представляет собой фрагмент отзыва пользователя, отвечающего на вопрос об особенностях конкретного места на Google Maps.

Поля

review_id строка (необязательно)

Идентификатор фрагмента отзыва.

заголовок (необязательно )

Заголовок рецензии.

строка URL (необязательно)

Ссылка, соответствующая отзыву пользователя на Google Maps.

start_index — целое число (необязательно)

Начало сегмента ответа, который относится к данному источнику. Индекс указывает начало сегмента, измеряемое в байтах.

тип объекта (обязательно)

Описание отсутствует.

Всегда устанавливайте значение "place_citation" .

строка URL (необязательно)

URI-ссылка на это место.

URLCitation

Аннотация URL-адреса.

end_index целое число (необязательно)

Конец выделенного сегмента, без учета каких-либо ограничений.

start_index — целое число (необязательно)

Начало сегмента ответа, который относится к данному источнику. Индекс указывает начало сегмента, измеряемое в байтах.

заголовок (необязательно )

Заголовок URL-адреса.

тип объекта (обязательно)

Описание отсутствует.

Всегда устанавливайте значение "url_citation" .

строка URL (необязательно)

URL.

WordInfo

Аннотации автоматического распознавания речи на уровне слов для вывода транскрипции. Содержат текст слова, необязательное время и необязательное указание говорящего.

end_index целое число (необязательно)

Конец выделенного сегмента, без учета каких-либо ограничений.

end_offset string (необязательно)

Смещение в конце слова относительно начала аудиозаписи. Присутствует, если timestamp_granularities содержит "word".

Кабель для подключения динамика (опционально)

Необязательно. Метка говорящего для этого слова (например, "spk_1", "spk_2"). Присутствует, если в TranscriptionConfig установлен параметр diarization_mode.

start_index — целое число (необязательно)

Начало сегмента ответа, который относится к данному источнику. Индекс указывает начало сегмента, измеряемое в байтах.

строка начального смещения (необязательно)

Начальное смещение слова относительно начала аудиозаписи. Присутствует, если timestamp_granularities содержит "word".

текстовая строка (необязательно)

Записанное слово.

тип объекта (обязательно)

Описание отсутствует.

Всегда устанавливайте значение "word_info" .

текстовая строка (обязательно)

Обязательно. Текстовое содержимое.

тип объекта (обязательно)

Описание отсутствует.

Всегда устанавливайте значение "text" .

Видеоконтент

A video content block.

data string (optional)

The video content.

mime_type enum (string) (optional)

The mime type of the video.

Возможные значения:

  • video/mp4

    MP4 video format

  • video/mpeg

    MPEG video format

  • video/mpg

    MPG video format

  • video/mov

    MOV video format

  • video/avi

    AVI video format

  • video/x-flv

    FLV video format

  • video/webm

    WebM video format

  • video/wmv

    WMV video format

  • video/3gpp

    3GPP video format

name string (optional)

A user-defined name for this content block. Can be referenced by the model in the final response.

processing MediaProcessing or enum (string) (optional)

How the model processes this video for understanding.

resolution MediaResolution (optional)

The resolution of the media.

Возможные значения

  • low

    Низкое разрешение.

  • medium

    Medium resolution.

  • high

    Высокое разрешение.

  • ultra_high

    Ultra high resolution.

type object (required)

Описание отсутствует.

Always set to "video" .

uri string (optional)

The URI of the video.

Примеры

Аудио

{
  "type": "audio",
  "data": "BASE64_ENCODED_AUDIO",
  "mime_type": "audio/wav"
}

Документ

{
  "type": "document",
  "data": "BASE64_ENCODED_DOCUMENT",
  "mime_type": "application/pdf"
}

Изображение

{
  "type": "image",
  "data": "BASE64_ENCODED_IMAGE",
  "mime_type": "image/png"
}

Текст

{
  "type": "text",
  "text": "Hello, how are you?"
}

Видео

{
  "type": "video",
  "uri": "https://www.youtube.com/watch?v=9hE5-98ZeCg"
}

Инструмент

Инструмент, который может быть использован моделью.

Возможные типы

Выполнение кода

Инструмент, который может использоваться моделью для выполнения кода.

type object (required)

Описание отсутствует.

Always set to "code_execution" .

ComputerUse

A tool that can be used by the model to interact with the computer.

disabled_safety_policies array (enum (string)) (optional)

Optional. Disabled safety policies for computer use.

Возможные значения:

  • financial_transactions

    Safety policy for financial transactions.

  • sensitive_data_modification

    Safety policy for sensitive data modification.

  • communication_tool

    Safety policy for communication tools (eg Gmail, Chat, Meet).

  • account_creation

    Safety policy for account creation.

  • data_modification

    Safety policy for data modification.

  • user_consent_management

    Safety policy for user consent management.

  • legal_terms_and_agreements

    Safety policy for legal terms and agreements.

enable_prompt_injection_detection boolean (optional)

Whether enable the prompt injection detection check on computer-use request.

environment enum (string) (optional)

The environment being operated.

Возможные значения:

  • browser

    Operates in a web browser.

  • mobile

    Operates in a mobile environment.

  • desktop

    Operates in a desktop environment.

excluded_predefined_functions array (string) (optional)

The list of predefined functions that are excluded from the model call.

type object (required)

Описание отсутствует.

Always set to "computer_use" .

FileSearch

A tool that can be used by the model to search files.

file_search_store_names array (string) (optional)

The file search store names to search.

metadata_filter string (optional)

Metadata filter to apply to the semantic retrieval documents and chunks.

top_k integer (optional)

The number of semantic retrieval chunks to retrieve.

type object (required)

Описание отсутствует.

Always set to "file_search" .

Функция

Инструмент, который может быть использован моделью.

description string (optional)

Описание функции.

name string (optional)

Название функции.

parameters object (optional)

JSON-схема для параметров функции.

type object (required)

Описание отсутствует.

Always set to "function" .

Google Карты

A tool that can be used by the model to call Google Maps.

enable_widget boolean (optional)

Whether to return a widget context token in the tool call result of the response.

latitude number (optional)

The latitude of the user's location.

longitude number (optional)

The longitude of the user's location.

type object (required)

Описание отсутствует.

Always set to "google_maps" .

GoogleПоиск

Инструмент, который модель может использовать для поиска в Google.

search_types array (enum (string)) (optional)

Типы поиска, которые необходимо включить.

Возможные значения:

  • web_search

    Включение этого поля активирует веб-поиск. Возвращаются только текстовые результаты.

  • image_search

    Установив это поле, можно включить поиск изображений. Возвращаются байты изображения.

  • enterprise_web_search

    Включение корпоративного веб-поиска.

type object (required)

Описание отсутствует.

Always set to "google_search" .

McpServer

MCPServer — это сервер, который может быть вызван моделью для выполнения действий.

allowed_tools array (AllowedTools) (optional)

Разрешенные инструменты.

The configuration for allowed tools.

Поля

mode enum (string) (optional)

Способ выбора инструмента.

Возможные значения:

  • auto

    Автоматический выбор инструмента.

  • any

    Любой выбор инструмента.

  • none

    Выбор инструментов отсутствует.

  • validated

    Выбор инструмента подтвержден.

tools array (string) (optional)

Названия разрешенных инструментов.

headers object (optional)

Необязательно: поля для заголовков аутентификации, тайм-аутов и т. д., если необходимо.

name string (optional)

Имя MCPServer.

type object (required)

Описание отсутствует.

Always set to "mcp_server" .

url string (optional)

Полный URL-адрес конечной точки MCPServer. Пример: "https://api.example.com/mcp"

Извлечение

A tool that can be used by the model to retrieve files.

exa_ai_search_config ExaAISearchConfig (optional)

Used to specify configuration for ExaAISearch.

Used to specify configuration for ExaAISearch.

Поля

api_key string (optional)

Required. The API key for ExaAiSearch.

custom_config object (optional)

Optional. This field can be used to pass any parameter from the Exa.ai Search API.

parallel_ai_search_config ParallelAISearchConfig (optional)

Used to specify configuration for ParallelAISearch.

Used to specify configuration for ParallelAISearch.

Поля

api_key string (optional)

Optional. The API key for ParallelAiSearch.

custom_config object (optional)

Optional. Custom configs for ParallelAiSearch.

rag_store_config RagStoreConfig (optional)

Used to specify configuration for RagStore.

Use to specify configuration for RAG Store.

Поля

rag_resources array (RagResource) (optional)

Optional. The representation of the rag source.

The definition of the Rag resource.

Поля

rag_corpus string (optional)

Optional. RagCorpora resource name.

rag_file_ids array (string) (optional)

Optional. rag_file_id. The files should be in the same rag_corpus set in rag_corpus field.

rag_retrieval_config RagRetrievalConfig (optional)

Optional. The retrieval config for the Rag query.

Specifies the context retrieval config.

Поля

filter Filter (optional)

Optional. Config for filters.

Config for filters.

Поля

metadata_filter string (optional)

Optional. String for metadata filtering.

vector_distance_threshold number (optional)

Optional. Only returns contexts with vector distance smaller than the threshold.

vector_similarity_threshold number (optional)

Optional. Only returns contexts with vector similarity larger than the threshold.

hybrid_search HybridSearch (optional)

Optional. Config for Hybrid Search.

Config for Hybrid Search.

Поля

alpha number (optional)

Optional. Alpha value controls the weight between dense and sparse vector search results.

ranking Ranking (optional)

Optional. Config for ranking and reranking.

Config for ranking and reranking.

top_k integer (optional)

Optional. The number of contexts to retrieve.

retrieval_types array (enum (string)) (optional)

The types of file retrieval to enable.

Возможные значения:

  • rag_store
  • exa_ai_search
  • parallel_ai_search
type object (required)

Описание отсутствует.

Always set to "retrieval" .

UrlContext

Инструмент, который может использоваться моделью для получения контекста URL-адреса.

type object (required)

Описание отсутствует.

Always set to "url_context" .

Примеры

Выполнение кода

ComputerUse

FileSearch

Функция

Google Карты

GoogleПоиск

McpServer

Извлечение

No examples available for this type.

UrlContext

InteractionSseEvent

Возможные типы

Polymorphic discriminator: event_type

ErrorEvent

error Error (optional)

Описание отсутствует.

Error message from an interaction.

Поля

code string (optional)

A URI that identifies the error type.

message string (optional)

Удобочитаемое сообщение об ошибке.

event_id string (optional)

The event_id token to be used to resume the interaction stream, from this event.

event_type object (required)

Описание отсутствует.

Always set to "error" .

InteractionCompletedEvent

event_id string (optional)

The event_id token to be used to resume the interaction stream, from this event.

event_type object (required)

Описание отсутствует.

Always set to "interaction.completed" .

interaction InteractionSseEventInteraction (required)

Partial completed interaction resource emitted at the end of the stream.

Partial interaction resource emitted by interaction lifecycle SSE events. Streaming lifecycle payloads may omit fields that are only available on full non-streaming Interaction responses.

Поля

agent string (optional)

The agent to interact with.

created string (optional)

Output only. The time at which the response was created in ISO 8601 format.

id string (optional)

Required. Output only. A unique identifier for the interaction completion.

model string (optional)

The model that will complete your prompt.

object string (optional)

Output only. The resource type.

service_tier ServiceTier (optional)

The service tier for the interaction.

Возможные значения

  • flex

    Flex service tier.

  • standard

    Standard service tier.

  • priority

    Priority service tier.

  • deferred

    Deferred service tier.

status enum (string) (optional)

Required. Output only. The status of the interaction.

Возможные значения:

  • in_progress

    The interaction is in progress.

  • requires_action

    The interaction requires action/input from the user.

  • completed

    The interaction is completed.

  • failed

    The interaction failed.

  • cancelled

    The interaction was cancelled.

  • incomplete

    The interaction is completed, but contains incomplete results (eg hitting max_tokens).

steps array ( Step ) (optional)

Output only. The steps that make up the interaction, if included in this event.

updated string (optional)

Output only. The time at which the response was last updated in ISO 8601 format.

usage Usage (optional)

Output only. Statistics on the interaction request's token usage.

Statistics on the interaction request's token usage.

Поля

cached_tokens_by_modality array (ModalityTokens) (optional)

A breakdown of cached token usage by modality.

The token count for a single response modality.

Поля

modality ResponseModality (optional)

The modality associated with the token count.

Возможные значения

  • text

    Indicates the model should return text.

  • image

    Indicates the model should return images.

  • audio

    Indicates the model should return audio.

  • video

    Indicates the model should return video.

  • document

    Indicates the model should return documents.

tokens integer (optional)

Number of tokens for the modality.

grounding_tool_count array (GroundingToolCount) (optional)

Grounding tool count.

The number of grounding tool counts.

Поля

count integer (optional)

The number of grounding tool counts.

type enum (string) (optional)

The grounding tool type associated with the count.

Возможные значения:

  • google_search

    Grounding with Google Web Search and Image Search, & Web Grounding for Enterprise.

  • google_maps

    Grounding with Google Maps.

  • retrieval

    Grounding with customer's data, for example, VertexAISearch.

input_tokens_by_modality array (ModalityTokens) (optional)

A breakdown of input token usage by modality.

The token count for a single response modality.

Поля

modality ResponseModality (optional)

The modality associated with the token count.

Возможные значения

  • text

    Indicates the model should return text.

  • image

    Indicates the model should return images.

  • audio

    Indicates the model should return audio.

  • video

    Indicates the model should return video.

  • document

    Indicates the model should return documents.

tokens integer (optional)

Number of tokens for the modality.

output_tokens_by_modality array (ModalityTokens) (optional)

A breakdown of output token usage by modality.

The token count for a single response modality.

Поля

modality ResponseModality (optional)

The modality associated with the token count.

Возможные значения

  • text

    Indicates the model should return text.

  • image

    Indicates the model should return images.

  • audio

    Indicates the model should return audio.

  • video

    Indicates the model should return video.

  • document

    Indicates the model should return documents.

tokens integer (optional)

Number of tokens for the modality.

tool_use_tokens_by_modality array (ModalityTokens) (optional)

A breakdown of tool-use token usage by modality.

The token count for a single response modality.

Поля

modality ResponseModality (optional)

The modality associated with the token count.

Возможные значения

  • text

    Indicates the model should return text.

  • image

    Indicates the model should return images.

  • audio

    Indicates the model should return audio.

  • video

    Indicates the model should return video.

  • document

    Indicates the model should return documents.

tokens integer (optional)

Number of tokens for the modality.

total_cached_tokens integer (optional)

Number of tokens in the cached part of the prompt (the cached content).

total_input_tokens integer (optional)

Number of tokens in the prompt (context).

total_output_tokens integer (optional)

Total number of tokens across all the generated responses.

total_thought_tokens integer (optional)

Number of tokens of thoughts for thinking models.

total_tokens integer (optional)

Total token count for the interaction request (prompt + responses + other internal tokens).

total_tool_use_tokens integer (optional)

Number of tokens present in tool-use prompt(s).

InteractionCreatedEvent

event_id string (optional)

The event_id token to be used to resume the interaction stream, from this event.

event_type object (required)

Описание отсутствует.

Always set to "interaction.created" .

interaction InteractionSseEventInteraction (required)

Partial interaction resource emitted when the stream is created.

Partial interaction resource emitted by interaction lifecycle SSE events. Streaming lifecycle payloads may omit fields that are only available on full non-streaming Interaction responses.

Поля

agent string (optional)

The agent to interact with.

created string (optional)

Output only. The time at which the response was created in ISO 8601 format.

id string (optional)

Required. Output only. A unique identifier for the interaction completion.

model string (optional)

The model that will complete your prompt.

object string (optional)

Output only. The resource type.

service_tier ServiceTier (optional)

The service tier for the interaction.

Возможные значения

  • flex

    Flex service tier.

  • standard

    Standard service tier.

  • priority

    Priority service tier.

  • deferred

    Deferred service tier.

status enum (string) (optional)

Required. Output only. The status of the interaction.

Возможные значения:

  • in_progress

    The interaction is in progress.

  • requires_action

    The interaction requires action/input from the user.

  • completed

    The interaction is completed.

  • failed

    The interaction failed.

  • cancelled

    The interaction was cancelled.

  • incomplete

    The interaction is completed, but contains incomplete results (eg hitting max_tokens).

steps array ( Step ) (optional)

Output only. The steps that make up the interaction, if included in this event.

updated string (optional)

Output only. The time at which the response was last updated in ISO 8601 format.

usage Usage (optional)

Output only. Statistics on the interaction request's token usage.

Statistics on the interaction request's token usage.

Поля

cached_tokens_by_modality array (ModalityTokens) (optional)

A breakdown of cached token usage by modality.

The token count for a single response modality.

Поля

modality ResponseModality (optional)

The modality associated with the token count.

Возможные значения

  • text

    Indicates the model should return text.

  • image

    Indicates the model should return images.

  • audio

    Indicates the model should return audio.

  • video

    Indicates the model should return video.

  • document

    Indicates the model should return documents.

tokens integer (optional)

Number of tokens for the modality.

grounding_tool_count array (GroundingToolCount) (optional)

Grounding tool count.

The number of grounding tool counts.

Поля

count integer (optional)

The number of grounding tool counts.

type enum (string) (optional)

The grounding tool type associated with the count.

Возможные значения:

  • google_search

    Grounding with Google Web Search and Image Search, & Web Grounding for Enterprise.

  • google_maps

    Grounding with Google Maps.

  • retrieval

    Grounding with customer's data, for example, VertexAISearch.

input_tokens_by_modality array (ModalityTokens) (optional)

A breakdown of input token usage by modality.

The token count for a single response modality.

Поля

modality ResponseModality (optional)

The modality associated with the token count.

Возможные значения

  • text

    Indicates the model should return text.

  • image

    Indicates the model should return images.

  • audio

    Indicates the model should return audio.

  • video

    Indicates the model should return video.

  • document

    Indicates the model should return documents.

tokens integer (optional)

Number of tokens for the modality.

output_tokens_by_modality array (ModalityTokens) (optional)

A breakdown of output token usage by modality.

The token count for a single response modality.

Поля

modality ResponseModality (optional)

The modality associated with the token count.

Возможные значения

  • text

    Indicates the model should return text.

  • image

    Indicates the model should return images.

  • audio

    Indicates the model should return audio.

  • video

    Indicates the model should return video.

  • document

    Indicates the model should return documents.

tokens integer (optional)

Number of tokens for the modality.

tool_use_tokens_by_modality array (ModalityTokens) (optional)

A breakdown of tool-use token usage by modality.

The token count for a single response modality.

Поля

modality ResponseModality (optional)

The modality associated with the token count.

Возможные значения

  • text

    Indicates the model should return text.

  • image

    Indicates the model should return images.

  • audio

    Indicates the model should return audio.

  • video

    Indicates the model should return video.

  • document

    Indicates the model should return documents.

tokens integer (optional)

Number of tokens for the modality.

total_cached_tokens integer (optional)

Number of tokens in the cached part of the prompt (the cached content).

total_input_tokens integer (optional)

Number of tokens in the prompt (context).

total_output_tokens integer (optional)

Total number of tokens across all the generated responses.

total_thought_tokens integer (optional)

Number of tokens of thoughts for thinking models.

total_tokens integer (optional)

Total token count for the interaction request (prompt + responses + other internal tokens).

total_tool_use_tokens integer (optional)

Number of tokens present in tool-use prompt(s).

InteractionStatusUpdate

event_id string (optional)

The event_id token to be used to resume the interaction stream, from this event.

event_type object (required)

Описание отсутствует.

Always set to "interaction.status_update" .

interaction_id string (required)

Описание отсутствует.

status enum (string) (required)

Описание отсутствует.

Возможные значения:

  • in_progress

    The interaction is in progress.

  • requires_action

    The interaction requires action/input from the user.

  • completed

    The interaction is completed.

  • failed

    The interaction failed.

  • cancelled

    The interaction was cancelled.

  • incomplete

    The interaction is completed, but contains incomplete results (eg hitting max_tokens).

  • budget_exceeded

    The interaction was halted because the token budget was exceeded.

  • queued

    The interaction is queued, waiting for processing (eg waiting for off-peak capacity).

StepDelta

delta StepDeltaData (required)

Описание отсутствует.

Возможные типы

ArgumentsDelta

arguments string (optional)

Описание отсутствует.

type object (required)

Описание отсутствует.

Always set to "arguments_delta" .

AudioDelta

channels integer (optional)

The number of audio channels.

data string (optional)

Описание отсутствует.

mime_type enum (string) (optional)

Описание отсутствует.

Возможные значения:

  • audio/wav

    аудиоформат WAV

  • audio/mp3

    MP3 audio format

  • audio/aiff

    AIFF audio format

  • audio/aac

    AAC audio format

  • audio/ogg

    OGG audio format

  • audio/flac

    FLAC audio format

  • audio/mpeg

    MPEG audio format

  • audio/m4a

    M4A audio format

  • audio/l16

    L16 audio format

  • audio/opus

    OPUS audio format

  • audio/alaw

    ALAW audio format

  • audio/mulaw

    MULAW audio format

sample_rate integer (optional)

The sample rate of the audio.

type object (required)

Описание отсутствует.

Always set to "audio" .

uri string (optional)

Описание отсутствует.

CodeExecutionCallDelta

arguments CodeExecutionCallArguments (required)

Описание отсутствует.

The arguments to pass to the code execution.

Поля

code string (optional)

Код, который необходимо выполнить.

language enum (string) (optional)

Programming language of the `code`.

Возможные значения:

  • python

    Python >= 3.10, with numpy and simpy available.

signature string (optional)

A signature hash for backend validation.

type object (required)

Описание отсутствует.

Always set to "code_execution_call" .

CodeExecutionResultDelta

is_error boolean (optional)

Описание отсутствует.

result string (required)

Описание отсутствует.

signature string (optional)

A signature hash for backend validation.

type object (required)

Описание отсутствует.

Always set to "code_execution_result" .

DocumentDelta

data string (optional)

Описание отсутствует.

mime_type enum (string) (optional)

Описание отсутствует.

Возможные значения:

  • application/pdf

    PDF document format

  • text/csv

    CSV document format

type object (required)

Описание отсутствует.

Always set to "document" .

uri string (optional)

Описание отсутствует.

FileSearchCallDelta

signature string (optional)

A signature hash for backend validation.

type object (required)

Описание отсутствует.

Always set to "file_search_call" .

FileSearchResultDelta

result array (FileSearchResult) (required)

Описание отсутствует.

The result of the File Search.

signature string (optional)

A signature hash for backend validation.

type object (required)

Описание отсутствует.

Always set to "file_search_result" .

FunctionResultDelta

call_id string (required)

Required. ID to match the ID from the function call block.

is_error boolean (optional)

Описание отсутствует.

name string (optional)

Описание отсутствует.

result array ( ImageContent or TextContent ) or object or string (required)

Описание отсутствует.

type object (required)

Описание отсутствует.

Always set to "function_result" .

GoogleMapsCallDelta

arguments GoogleMapsCallArguments (optional)

The arguments to pass to the Google Maps tool.

The arguments to pass to the Google Maps tool.

Поля

queries array (string) (optional)

The queries to be executed.

signature string (optional)

A signature hash for backend validation.

type object (required)

Описание отсутствует.

Always set to "google_maps_call" .

GoogleMapsResultDelta

result array (GoogleMapsResult) (optional)

The results of the Google Maps.

The result of the Google Maps.

Поля

places array (Places) (optional)

The places that were found.

Поля

name string (optional)

Title of the place.

place_id string (optional)

The ID of the place, in `places/{place_id}` format.

review_snippets array (ReviewSnippet) (optional)

Snippets of reviews that are used to generate answers about the features of a given place in Google Maps.

Encapsulates a snippet of a user review that answers a question about the features of a specific place in Google Maps.

Поля

review_id string (optional)

The ID of the review snippet.

title string (optional)

Заголовок рецензии.

url string (optional)

A link that corresponds to the user review on Google Maps.

url string (optional)

URI reference of the place.

widget_context_token string (optional)

Resource name of the Google Maps widget context token.

signature string (optional)

A signature hash for backend validation.

type object (required)

Описание отсутствует.

Always set to "google_maps_result" .

GoogleSearchCallDelta

arguments GoogleSearchCallArguments (required)

Описание отсутствует.

The arguments to pass to Google Search.

Поля

queries array (string) (optional)

Web search queries for the following-up web search.

signature string (optional)

A signature hash for backend validation.

type object (required)

Описание отсутствует.

Always set to "google_search_call" .

GoogleSearchResultDelta

is_error boolean (optional)

Описание отсутствует.

result array (GoogleSearchResult) (required)

Описание отсутствует.

The result of the Google Search.

Поля

search_suggestions string (optional)

Web content snippet that can be embedded in a web page or an app webview.

signature string (optional)

A signature hash for backend validation.

type object (required)

Описание отсутствует.

Always set to "google_search_result" .

ImageDelta

data string (optional)

Описание отсутствует.

mime_type enum (string) (optional)

Описание отсутствует.

Возможные значения:

  • image/png

    PNG image format

  • image/jpeg

    формат изображения JPEG

  • image/webp

    WebP image format

  • image/heic

    HEIC image format

  • image/heif

    HEIF image format

  • image/gif

    GIF image format

  • image/bmp

    BMP image format

  • image/tiff

    TIFF image format

resolution MediaResolution (optional)

The resolution of the media.

Возможные значения

  • low

    Низкое разрешение.

  • medium

    Medium resolution.

  • high

    Высокое разрешение.

  • ultra_high

    Ultra high resolution.

type object (required)

Описание отсутствует.

Always set to "image" .

uri string (optional)

Описание отсутствует.

McpServerToolCallDelta

arguments object (required)

Описание отсутствует.

name string (required)

Описание отсутствует.

server_name string (required)

Описание отсутствует.

type object (required)

Описание отсутствует.

Always set to "mcp_server_tool_call" .

McpServerToolResultDelta

name string (optional)

Описание отсутствует.

result array ( ImageContent or TextContent ) or object or string (required)

Описание отсутствует.

server_name string (optional)

Описание отсутствует.

type object (required)

Описание отсутствует.

Always set to "mcp_server_tool_result" .

ProcessingCallDelta

Streaming delta for a server-initiated media processing step.

signature string (optional)

A signature hash for backend validation.

type object (required)

Описание отсутствует.

Always set to "processing_call" .

ProcessingResultDelta

Streaming delta for the result of a server-initiated media processing step.

signature string (optional)

A signature hash for backend validation.

type object (required)

Описание отсутствует.

Always set to "processing_result" .

RetrievalCallDelta

Used by Vertex Retrieval tools such as Parallel AI, Exa AI, Vertex AI Search, etc. RetrievalType decides which tool is used.

arguments RetrievalStepArguments (required)

Required. The arguments to pass to the Retrieval tool.

The arguments to pass to Retrieval tools.

Поля

queries array (string) (optional)

Queries for Retrieval information.

retrieval_type enum (string) (optional)

The type of retrieval tools.

Возможные значения:

  • rag_store

    The type of retrieval tools.

  • exa_ai_search

    The type of retrieval tools.

  • parallel_ai_search

    The type of retrieval tools.

signature string (optional)

A signature hash for backend validation.

type object (required)

Описание отсутствует.

Always set to "retrieval_call" .

RetrievalResultDelta

Used by Vertex Retrieval tools such as Parallel AI, Exa AI, Vertex AI Search, etc. ToolResultDelta.type

is_error boolean (optional)

Whether the retrieval resulted in an error.

signature string (optional)

A signature hash for backend validation.

type object (required)

Описание отсутствует.

Always set to "retrieval_result" .

TextAnnotationDelta

annotations array (Annotation) (optional)

Citation information for model-generated content.

Citation information for model-generated content.

Возможные типы

FileCitation

A file citation annotation.

custom_metadata object (optional)

User provided metadata about the retrieved context.

document_uri string (optional)

The URI of the file.

end_index integer (optional)

End of the attributed segment, exclusive.

file_name string (optional)

Название файла.

media_id string (optional)

Media ID in-case of image citations, if applicable.

page_number integer (optional)

Page number of the cited document, if applicable.

source string (optional)

Source attributed for a portion of the text.

start_index integer (optional)

Start of segment of the response that is attributed to this source. Index indicates the start of the segment, measured in bytes.

type object (required)

Описание отсутствует.

Always set to "file_citation" .

PlaceCitation

A place citation annotation.

end_index integer (optional)

End of the attributed segment, exclusive.

name string (optional)

Title of the place.

place_id string (optional)

The ID of the place, in `places/{place_id}` format.

review_snippets array (ReviewSnippet) (optional)

Snippets of reviews that are used to generate answers about the features of a given place in Google Maps.

Encapsulates a snippet of a user review that answers a question about the features of a specific place in Google Maps.

Поля

review_id string (optional)

The ID of the review snippet.

title string (optional)

Заголовок рецензии.

url string (optional)

A link that corresponds to the user review on Google Maps.

start_index integer (optional)

Start of segment of the response that is attributed to this source. Index indicates the start of the segment, measured in bytes.

type object (required)

Описание отсутствует.

Always set to "place_citation" .

url string (optional)

URI reference of the place.

UrlCitation

A URL citation annotation.

end_index integer (optional)

End of the attributed segment, exclusive.

start_index integer (optional)

Start of segment of the response that is attributed to this source. Index indicates the start of the segment, measured in bytes.

title string (optional)

The title of the URL.

type object (required)

Описание отсутствует.

Always set to "url_citation" .

url string (optional)

The URL.

WordInfo

Word-level ASR annotation for transcription output. Carries the word text, optional timing, and optional speaker attribution.

end_index integer (optional)

End of the attributed segment, exclusive.

end_offset string (optional)

End offset in time of the word relative to the start of the audio. Present when timestamp_granularities contains "word".

speaker string (optional)

Optional. Speaker label for this word (eg "spk_1", "spk_2"). Present when diarization_mode is set in TranscriptionConfig.

start_index integer (optional)

Start of segment of the response that is attributed to this source. Index indicates the start of the segment, measured in bytes.

start_offset string (optional)

Start offset in time of the word relative to the start of the audio. Present when timestamp_granularities contains "word".

text string (optional)

The transcribed word.

type object (required)

Описание отсутствует.

Always set to "word_info" .

type object (required)

Описание отсутствует.

Always set to "text_annotation_delta" .

TextDelta

text string (required)

Описание отсутствует.

type object (required)

Описание отсутствует.

Always set to "text" .

ThoughtSignatureDelta

signature string (optional)

Signature to match the backend source to be part of the generation.

type object (required)

Описание отсутствует.

Always set to "thought_signature" .

ThoughtSummaryDelta

content Content (optional)

A new summary item to be added to the thought.

type object (required)

Описание отсутствует.

Always set to "thought_summary" .

UrlContextCallDelta

arguments UrlContextCallArguments (required)

Описание отсутствует.

The arguments to pass to the URL context.

Поля

urls array (string) (optional)

The URLs to fetch.

signature string (optional)

A signature hash for backend validation.

type object (required)

Описание отсутствует.

Always set to "url_context_call" .

UrlContextResultDelta

is_error boolean (optional)

Описание отсутствует.

result array (UrlContextResult) (required)

Описание отсутствует.

The result of the URL context.

Поля

status enum (string) (optional)

The status of the URL retrieval.

Возможные значения:

  • success

    Url retrieval is successful.

  • error

    Url retrieval is failed due to error.

  • paywall

    Url retrieval is failed because the content is behind paywall.

  • unsafe

    Url retrieval is failed because the content is unsafe.

url string (optional)

The URL that was fetched.

signature string (optional)

A signature hash for backend validation.

type object (required)

Описание отсутствует.

Always set to "url_context_result" .

VideoDelta

data string (optional)

Описание отсутствует.

mime_type enum (string) (optional)

Описание отсутствует.

Возможные значения:

  • video/mp4

    MP4 video format

  • video/mpeg

    MPEG video format

  • video/mpg

    MPG video format

  • video/mov

    MOV video format

  • video/avi

    AVI video format

  • video/x-flv

    FLV video format

  • video/webm

    WebM video format

  • video/wmv

    WMV video format

  • video/3gpp

    3GPP video format

  • video/jpeg2000

    JPEG 2000 video format

resolution MediaResolution (optional)

The resolution of the media.

Возможные значения

  • low

    Низкое разрешение.

  • medium

    Medium resolution.

  • high

    Высокое разрешение.

  • ultra_high

    Ultra high resolution.

type object (required)

Описание отсутствует.

Always set to "video" .

uri string (optional)

Описание отсутствует.

event_id string (optional)

The event_id token to be used to resume the interaction stream, from this event.

event_type object (required)

Описание отсутствует.

Always set to "step.delta" .

index integer (required)

Описание отсутствует.

metadata StepDeltaMetadata (optional)

Описание отсутствует.

Optional metadata accompanying ANY streamed event.

Поля

total_usage Usage (optional)

Statistics on the interaction request's token usage.

Statistics on the interaction request's token usage.

Поля

cached_tokens_by_modality array (ModalityTokens) (optional)

A breakdown of cached token usage by modality.

The token count for a single response modality.

Поля

modality ResponseModality (optional)

The modality associated with the token count.

Возможные значения

  • text

    Indicates the model should return text.

  • image

    Indicates the model should return images.

  • audio

    Indicates the model should return audio.

  • video

    Indicates the model should return video.

  • document

    Indicates the model should return documents.

tokens integer (optional)

Number of tokens for the modality.

grounding_tool_count array (GroundingToolCount) (optional)

Grounding tool count.

The number of grounding tool counts.

Поля

count integer (optional)

The number of grounding tool counts.

type enum (string) (optional)

The grounding tool type associated with the count.

Возможные значения:

  • google_search

    Grounding with Google Web Search and Image Search, & Web Grounding for Enterprise.

  • google_maps

    Grounding with Google Maps.

  • retrieval

    Grounding with customer's data, for example, VertexAISearch.

input_tokens_by_modality array (ModalityTokens) (optional)

A breakdown of input token usage by modality.

The token count for a single response modality.

Поля

modality ResponseModality (optional)

The modality associated with the token count.

Возможные значения

  • text

    Indicates the model should return text.

  • image

    Indicates the model should return images.

  • audio

    Indicates the model should return audio.

  • video

    Indicates the model should return video.

  • document

    Indicates the model should return documents.

tokens integer (optional)

Number of tokens for the modality.

output_tokens_by_modality array (ModalityTokens) (optional)

A breakdown of output token usage by modality.

The token count for a single response modality.

Поля

modality ResponseModality (optional)

The modality associated with the token count.

Возможные значения

  • text

    Indicates the model should return text.

  • image

    Indicates the model should return images.

  • audio

    Indicates the model should return audio.

  • video

    Indicates the model should return video.

  • document

    Indicates the model should return documents.

tokens integer (optional)

Number of tokens for the modality.

tool_use_tokens_by_modality array (ModalityTokens) (optional)

A breakdown of tool-use token usage by modality.

The token count for a single response modality.

Поля

modality ResponseModality (optional)

The modality associated with the token count.

Возможные значения

  • text

    Indicates the model should return text.

  • image

    Indicates the model should return images.

  • audio

    Indicates the model should return audio.

  • video

    Indicates the model should return video.

  • document

    Indicates the model should return documents.

tokens integer (optional)

Number of tokens for the modality.

total_cached_tokens integer (optional)

Number of tokens in the cached part of the prompt (the cached content).

total_input_tokens integer (optional)

Number of tokens in the prompt (context).

total_output_tokens integer (optional)

Total number of tokens across all the generated responses.

total_thought_tokens integer (optional)

Number of tokens of thoughts for thinking models.

total_tokens integer (optional)

Total token count for the interaction request (prompt + responses + other internal tokens).

total_tool_use_tokens integer (optional)

Number of tokens present in tool-use prompt(s).

StepStart

event_id string (optional)

The event_id token to be used to resume the interaction stream, from this event.

event_type object (required)

Описание отсутствует.

Always set to "step.start" .

index integer (required)

Описание отсутствует.

step Step (required)

Описание отсутствует.

StepStop

event_id string (optional)

The event_id token to be used to resume the interaction stream, from this event.

event_type object (required)

Описание отсутствует.

Always set to "step.stop" .

index integer (required)

Описание отсутствует.

step_usage Usage (optional)

Model usage stats for this specific step.

Statistics on the interaction request's token usage.

Поля

cached_tokens_by_modality array (ModalityTokens) (optional)

A breakdown of cached token usage by modality.

The token count for a single response modality.

Поля

modality ResponseModality (optional)

The modality associated with the token count.

Возможные значения

  • text

    Indicates the model should return text.

  • image

    Indicates the model should return images.

  • audio

    Indicates the model should return audio.

  • video

    Indicates the model should return video.

  • document

    Indicates the model should return documents.

tokens integer (optional)

Number of tokens for the modality.

grounding_tool_count array (GroundingToolCount) (optional)

Grounding tool count.

The number of grounding tool counts.

Поля

count integer (optional)

The number of grounding tool counts.

type enum (string) (optional)

The grounding tool type associated with the count.

Возможные значения:

  • google_search

    Grounding with Google Web Search and Image Search, & Web Grounding for Enterprise.

  • google_maps

    Grounding with Google Maps.

  • retrieval

    Grounding with customer's data, for example, VertexAISearch.

input_tokens_by_modality array (ModalityTokens) (optional)

A breakdown of input token usage by modality.

The token count for a single response modality.

Поля

modality ResponseModality (optional)

The modality associated with the token count.

Возможные значения

  • text

    Indicates the model should return text.

  • image

    Indicates the model should return images.

  • audio

    Indicates the model should return audio.

  • video

    Indicates the model should return video.

  • document

    Indicates the model should return documents.

tokens integer (optional)

Number of tokens for the modality.

output_tokens_by_modality array (ModalityTokens) (optional)

A breakdown of output token usage by modality.

The token count for a single response modality.

Поля

modality ResponseModality (optional)

The modality associated with the token count.

Возможные значения

  • text

    Indicates the model should return text.

  • image

    Indicates the model should return images.

  • audio

    Indicates the model should return audio.

  • video

    Indicates the model should return video.

  • document

    Indicates the model should return documents.

tokens integer (optional)

Number of tokens for the modality.

tool_use_tokens_by_modality array (ModalityTokens) (optional)

A breakdown of tool-use token usage by modality.

The token count for a single response modality.

Поля

modality ResponseModality (optional)

The modality associated with the token count.

Возможные значения

  • text

    Indicates the model should return text.

  • image

    Indicates the model should return images.

  • audio

    Indicates the model should return audio.

  • video

    Indicates the model should return video.

  • document

    Indicates the model should return documents.

tokens integer (optional)

Number of tokens for the modality.

total_cached_tokens integer (optional)

Number of tokens in the cached part of the prompt (the cached content).

total_input_tokens integer (optional)

Number of tokens in the prompt (context).

total_output_tokens integer (optional)

Total number of tokens across all the generated responses.

total_thought_tokens integer (optional)

Number of tokens of thoughts for thinking models.

total_tokens integer (optional)

Total token count for the interaction request (prompt + responses + other internal tokens).

total_tool_use_tokens integer (optional)

Number of tokens present in tool-use prompt(s).

usage Usage (optional)

Cumulative model usage stats from the start of the session.

Statistics on the interaction request's token usage.

Поля

cached_tokens_by_modality array (ModalityTokens) (optional)

A breakdown of cached token usage by modality.

The token count for a single response modality.

Поля

modality ResponseModality (optional)

The modality associated with the token count.

Возможные значения

  • text

    Indicates the model should return text.

  • image

    Indicates the model should return images.

  • audio

    Indicates the model should return audio.

  • video

    Indicates the model should return video.

  • document

    Indicates the model should return documents.

tokens integer (optional)

Number of tokens for the modality.

grounding_tool_count array (GroundingToolCount) (optional)

Grounding tool count.

The number of grounding tool counts.

Поля

count integer (optional)

The number of grounding tool counts.

type enum (string) (optional)

The grounding tool type associated with the count.

Возможные значения:

  • google_search

    Grounding with Google Web Search and Image Search, & Web Grounding for Enterprise.

  • google_maps

    Grounding with Google Maps.

  • retrieval

    Grounding with customer's data, for example, VertexAISearch.

input_tokens_by_modality array (ModalityTokens) (optional)

A breakdown of input token usage by modality.

The token count for a single response modality.

Поля

modality ResponseModality (optional)

The modality associated with the token count.

Возможные значения

  • text

    Indicates the model should return text.

  • image

    Indicates the model should return images.

  • audio

    Indicates the model should return audio.

  • video

    Indicates the model should return video.

  • document

    Indicates the model should return documents.

tokens integer (optional)

Number of tokens for the modality.

output_tokens_by_modality array (ModalityTokens) (optional)

A breakdown of output token usage by modality.

The token count for a single response modality.

Поля

modality ResponseModality (optional)

The modality associated with the token count.

Возможные значения

  • text

    Indicates the model should return text.

  • image

    Indicates the model should return images.

  • audio

    Indicates the model should return audio.

  • video

    Indicates the model should return video.

  • document

    Indicates the model should return documents.

tokens integer (optional)

Number of tokens for the modality.

tool_use_tokens_by_modality array (ModalityTokens) (optional)

A breakdown of tool-use token usage by modality.

The token count for a single response modality.

Поля

modality ResponseModality (optional)

The modality associated with the token count.

Возможные значения

  • text

    Indicates the model should return text.

  • image

    Indicates the model should return images.

  • audio

    Indicates the model should return audio.

  • video

    Indicates the model should return video.

  • document

    Indicates the model should return documents.

tokens integer (optional)

Number of tokens for the modality.

total_cached_tokens integer (optional)

Number of tokens in the cached part of the prompt (the cached content).

total_input_tokens integer (optional)

Number of tokens in the prompt (context).

total_output_tokens integer (optional)

Total number of tokens across all the generated responses.

total_thought_tokens integer (optional)

Number of tokens of thoughts for thinking models.

total_tokens integer (optional)

Total token count for the interaction request (prompt + responses + other internal tokens).

total_tool_use_tokens integer (optional)

Number of tokens present in tool-use prompt(s).

Примеры

Error Event

{
  "error": {
    "code": "not_found",
    "message": "Failed to get completed interaction: Result not found."
  },
  "event_type": "error"
}

Interaction Completed

{
  "event_id": "evt_123",
  "event_type": "interaction.completed",
  "interaction": {
    "created": "2025-12-04T15:01:45Z",
    "id": "v1_ChdXS0l4YWZXTk9xbk0xZThQczhEcmlROBIXV0tJeGFmV05PcW5NMWU4UHM4RHJpUTg",
    "model": "gemini-3.6-flash",
    "status": "completed",
    "updated": "2025-12-04T15:01:45Z"
  }
}

Interaction Completed

{
  "event_id": "evt_123",
  "event_type": "interaction.completed",
  "interaction": {
    "created": "2025-12-04T15:01:45Z",
    "id": "v1_ChdXS0l4YWZXTk9xbk0xZThQczhEcmlROBIXV0tJeGFmV05PcW5NMWU4UHM4RHJpUTg",
    "model": "gemini-3-flash-preview",
    "object": "interaction",
    "status": "completed",
    "updated": "2025-12-04T15:01:45Z"
  }
}

Interaction Created

{
  "event_id": "evt_123",
  "event_type": "interaction.created",
  "interaction": {
    "created": "2025-12-04T15:01:45Z",
    "id": "v1_ChdXS0l4YWZXTk9xbk0xZThQczhEcmlROBIXV0tJeGFmV05PcW5NMWU4UHM4RHJpUTg",
    "model": "gemini-3.6-flash",
    "status": "in_progress",
    "updated": "2025-12-04T15:01:45Z"
  }
}

Interaction Created

{
  "event_id": "evt_123",
  "event_type": "interaction.created",
  "interaction": {
    "id": "v1_ChdXS0l4YWZXTk9xbk0xZThQczhEcmlROBIXV0tJeGFmV05PcW5NMWU4UHM4RHJpUTg",
    "model": "gemini-3-flash-preview",
    "object": "interaction",
    "status": "in_progress"
  }
}

Interaction Status Update

{
  "event_type": "interaction.status_update",
  "interaction_id": "v1_ChdTMjQ0YWJ5TUF1TzcxZThQdjRpcnFRcxIXUzI0NGFieU1BdU83MWU4UHY0aXJxUXM",
  "status": "in_progress"
}

Step Delta

{
  "delta": {
    "type": "text",
    "text": "Hello"
  },
  "event_type": "step.delta",
  "index": 0
}

Step Start

{
  "event_type": "step.start",
  "index": 0,
  "step": {
    "type": "model_output"
  }
}

Step Stop

{
  "event_type": "step.stop",
  "index": 0
}

ResponseFormat

Возможные типы

AudioResponseFormat

Configuration for audio output format.

bit_rate integer (optional)

Bit rate in bits per second (bps). Only applicable for compressed formats (MP3, Opus).

delivery enum (string) (optional)

The delivery mode for the audio output.

Возможные значения:

  • inline

    Audio data is returned inline in the response.

  • uri

    Audio data is returned as a URI.

mime_type enum (string) (optional)

The MIME type of the audio output.

Возможные значения:

  • audio/mp3

    MP3 audio format.

  • audio/ogg_opus

    OGG Opus audio format.

  • audio/l16

    Raw PCM (L16) audio format.

  • audio/wav

    WAV audio format.

  • audio/alaw

    A-law audio format.

  • audio/mulaw

    Mu-law audio format.

sample_rate integer (optional)

Sample rate in Hz.

type object (required)

Описание отсутствует.

Always set to "audio" .

ImageResponseFormat

Configuration for image output format.

aspect_ratio enum (string) (optional)

The aspect ratio for the image output.

Возможные значения:

  • 1:1

    1:1 aspect ratio.

  • 2:3

    2:3 aspect ratio.

  • 3:2

    Соотношение сторон 3:2.

  • 3:4

    3:4 aspect ratio.

  • 4:3

    Соотношение сторон 4:3.

  • 4:5

    Соотношение сторон 4:5.

  • 5:4

    5:4 aspect ratio.

  • 9:16

    9:16 aspect ratio.

  • 16:9

    16:9 aspect ratio.

  • 21:9

    21:9 aspect ratio.

  • 1:8

    1:8 aspect ratio.

  • 8:1

    8:1 aspect ratio.

  • 1:4

    1:4 aspect ratio.

  • 4:1

    4:1 aspect ratio.

delivery enum (string) (optional)

The delivery mode for the image output.

Возможные значения:

  • inline

    Image data is returned inline in the response.

  • uri

    Image data is returned as a URI.

image_size enum (string) (optional)

The size of the image output.

Возможные значения:

  • 512

    512px image size.

  • 1K

    1K image size.

  • 2K

    2K image size.

  • 4K

    4K image size.

mime_type enum (string) (optional)

The MIME type of the image output.

Возможные значения:

  • image/jpeg

    JPEG image format.

type object (required)

Описание отсутствует.

Always set to "image" .

TextResponseFormat

Configuration for text output format.

mime_type enum (string) (optional)

The MIME type of the text output.

Возможные значения:

  • application/json

    JSON output format.

  • text/plain

    Plain text output format.

schema object (optional)

The JSON schema that the output should conform to. Only applicable when mime_type is application/json.

type object (required)

Описание отсутствует.

Always set to "text" .

VideoResponseFormat

Configuration for video output format.

aspect_ratio enum (string) (optional)

The aspect ratio for the video output.

Возможные значения:

  • 16:9

    16:9 aspect ratio.

  • 9:16

    9:16 aspect ratio.

delivery enum (string) (optional)

The delivery mode for the video output.

Возможные значения:

  • inline

    Video data is returned inline in the response.

  • uri

    Video data is returned as a URI.

duration string (optional)

The duration for the video output.

gcs_uri string (optional)

The Cloud Storage URI to store the video output. Required for Vertex if delivery mode is URI.

resolution enum (string) (optional)

The video output resolution. Defaults to 720p.

Возможные значения:

  • 360p

    360p resolution.

  • 720p

    720p resolution.

  • 1080p

    1080p resolution.

  • 4k

    Разрешение 4K.

type object (required)

Описание отсутствует.

Always set to "video" .

Примеры

Аудиовыход

{
  "type": "audio",
  "sample_rate": 24000
}

Вывод изображения

{
  "type": "image",
  "aspect_ratio": "16:9",
  "image_size": "1K",
  "mime_type": "image/jpeg"
}

Text Output (JSON Schema)

{
  "type": "text",
  "mime_type": "application/json",
  "schema": {
    "type": "object",
    "properties": {
      "ingredients": {
        "type": "array",
        "items": {
          "type": "string"
        }
      },
      "recipe_name": {
        "type": "string"
      }
    },
    "required": [
      "ingredients",
      "recipe_name"
    ]
  }
}

Видеовыход

{
  "type": "video",
  "aspect_ratio": "16:9",
  "delivery": "inline"
}

Шаг

A step in the interaction.

Возможные типы

CodeExecutionCallStep

Code execution call step.

arguments CodeExecutionCallStepArguments (required)

Required. The arguments to pass to the code execution.

The arguments to pass to the code execution.

Поля

code string (optional)

Код, который необходимо выполнить.

language enum (string) (optional)

Programming language of the `code`.

Возможные значения:

  • python

    Python >= 3.10, with numpy and simpy available.

id string (required)

Required. A unique ID for this specific tool call.

signature string (optional)

A signature hash for backend validation.

type object (required)

Описание отсутствует.

Always set to "code_execution_call" .

CodeExecutionResultStep

Code execution result step.

call_id string (required)

Required. ID to match the ID from the function call block.

is_error boolean (optional)

Whether the code execution resulted in an error.

result string (required)

Required. The output of the code execution.

signature string (optional)

A signature hash for backend validation.

type object (required)

Описание отсутствует.

Always set to "code_execution_result" .

FileSearchCallStep

File Search call step.

id string (required)

Required. A unique ID for this specific tool call.

signature string (optional)

A signature hash for backend validation.

type object (required)

Описание отсутствует.

Always set to "file_search_call" .

FileSearchResultStep

File Search result step.

call_id string (required)

Required. ID to match the ID from the function call block.

signature string (optional)

A signature hash for backend validation.

type object (required)

Описание отсутствует.

Always set to "file_search_result" .

FunctionCallStep

A function tool call step.

arguments object (required)

Required. The arguments to pass to the function.

id string (required)

Required. A unique ID for this specific tool call.

name string (required)

Required. The name of the tool to call.

type object (required)

Описание отсутствует.

Always set to "function_call" .

FunctionResultStep

Result of a function tool call.

call_id string (required)

Required. ID to match the ID from the function call block.

is_error boolean (optional)

Whether the tool call resulted in an error.

name string (optional)

The name of the tool that was called.

result array ( ImageContent or TextContent ) or object or string (required)

Required. The result of the tool call.

type object (required)

Описание отсутствует.

Always set to "function_result" .

GoogleMapsCallStep

Google Maps call step.

arguments GoogleMapsCallStepArguments (optional)

The arguments to pass to the Google Maps tool.

The arguments to pass to the Google Maps tool.

Поля

queries array (string) (optional)

The queries to be executed.

id string (required)

Required. A unique ID for this specific tool call.

signature string (optional)

A signature hash for backend validation.

type object (required)

Описание отсутствует.

Always set to "google_maps_call" .

GoogleMapsResultStep

Google Maps result step.

call_id string (required)

Required. ID to match the ID from the function call block.

result array (GoogleMapsResultItem) (required)

Описание отсутствует.

The result of the Google Maps.

Поля

places array (GoogleMapsResultPlaces) (optional)

Описание отсутствует.

Поля

name string (optional)

Описание отсутствует.

place_id string (optional)

Описание отсутствует.

review_snippets array (ReviewSnippet) (optional)

Описание отсутствует.

Encapsulates a snippet of a user review that answers a question about the features of a specific place in Google Maps.

Поля

review_id string (optional)

The ID of the review snippet.

title string (optional)

Заголовок рецензии.

url string (optional)

A link that corresponds to the user review on Google Maps.

url string (optional)

Описание отсутствует.

widget_context_token string (optional)

Описание отсутствует.

signature string (optional)

A signature hash for backend validation.

type object (required)

Описание отсутствует.

Always set to "google_maps_result" .

GoogleSearchCallStep

Google Search call step.

arguments GoogleSearchCallStepArguments (required)

Required. The arguments to pass to Google Search.

The arguments to pass to Google Search.

Поля

queries array (string) (optional)

Web search queries for the following-up web search.

id string (required)

Required. A unique ID for this specific tool call.

search_type enum (string) (optional)

The type of search grounding enabled.

Возможные значения:

  • web_search

    Включение этого поля активирует веб-поиск. Возвращаются только текстовые результаты.

  • image_search

    Установив это поле, можно включить поиск изображений. Возвращаются байты изображения.

  • enterprise_web_search

    Включение корпоративного веб-поиска.

signature string (optional)

A signature hash for backend validation.

type object (required)

Описание отсутствует.

Always set to "google_search_call" .

GoogleSearchResultStep

Google Search result step.

call_id string (required)

Required. ID to match the ID from the function call block.

is_error boolean (optional)

Whether the Google Search resulted in an error.

result array (GoogleSearchResultItem) (required)

Required. The results of the Google Search.

The result of the Google Search.

Поля

search_suggestions string (optional)

Web content snippet that can be embedded in a web page or an app webview.

signature string (optional)

A signature hash for backend validation.

type object (required)

Описание отсутствует.

Always set to "google_search_result" .

McpServerToolCallStep

MCPServer tool call step.

arguments object (required)

Required. The JSON object of arguments for the function.

id string (required)

Required. A unique ID for this specific tool call.

name string (required)

Required. The name of the tool which was called.

server_name string (required)

Required. The name of the used MCP server.

type object (required)

Описание отсутствует.

Always set to "mcp_server_tool_call" .

McpServerToolResultStep

MCPServer tool result step.

call_id string (required)

Required. ID to match the ID from the function call block.

name string (optional)

Name of the tool which is called for this specific tool call.

result array ( ImageContent or TextContent ) or object or string (required)

Required. The output from the MCP server call. Can be simple text or rich content.

server_name string (optional)

The name of the used MCP server.

type object (required)

Описание отсутствует.

Always set to "mcp_server_tool_result" .

ModelOutputStep

Output generated by the model.

content array ( Content ) (optional)

Описание отсутствует.

type object (required)

Описание отсутствует.

Always set to "model_output" .

ThoughtStep

A thought step.

signature string (optional)

A signature hash for backend validation.

summary array (ThoughtSummaryContent) (optional)

A summary of the thought.

Возможные типы

ImageContent

An image content block.

data string (optional)

The image content.

mime_type enum (string) (optional)

The mime type of the image.

Возможные значения:

  • image/png

    PNG image format

  • image/jpeg

    формат изображения JPEG

  • image/webp

    WebP image format

  • image/heic

    HEIC image format

  • image/heif

    HEIF image format

  • image/gif

    GIF image format

  • image/bmp

    BMP image format

  • image/tiff

    TIFF image format

resolution MediaResolution (optional)

The resolution of the media.

Возможные значения

  • low

    Низкое разрешение.

  • medium

    Medium resolution.

  • high

    Высокое разрешение.

  • ultra_high

    Ultra high resolution.

type object (required)

Описание отсутствует.

Always set to "image" .

uri string (optional)

The URI of the image.

Текстовое содержимое

A text content block.

annotations array (Annotation) (optional)

Citation information for model-generated content.

Citation information for model-generated content.

Возможные типы

FileCitation

A file citation annotation.

custom_metadata object (optional)

User provided metadata about the retrieved context.

document_uri string (optional)

The URI of the file.

end_index integer (optional)

End of the attributed segment, exclusive.

file_name string (optional)

Название файла.

media_id string (optional)

Media ID in-case of image citations, if applicable.

page_number integer (optional)

Page number of the cited document, if applicable.

source string (optional)

Source attributed for a portion of the text.

start_index integer (optional)

Start of segment of the response that is attributed to this source. Index indicates the start of the segment, measured in bytes.

type object (required)

Описание отсутствует.

Always set to "file_citation" .

PlaceCitation

A place citation annotation.

end_index integer (optional)

End of the attributed segment, exclusive.

name string (optional)

Title of the place.

place_id string (optional)

The ID of the place, in `places/{place_id}` format.

review_snippets array (ReviewSnippet) (optional)

Snippets of reviews that are used to generate answers about the features of a given place in Google Maps.

Encapsulates a snippet of a user review that answers a question about the features of a specific place in Google Maps.

Поля

review_id string (optional)

The ID of the review snippet.

title string (optional)

Заголовок рецензии.

url string (optional)

A link that corresponds to the user review on Google Maps.

start_index integer (optional)

Start of segment of the response that is attributed to this source. Index indicates the start of the segment, measured in bytes.

type object (required)

Описание отсутствует.

Always set to "place_citation" .

url string (optional)

URI reference of the place.

UrlCitation

A URL citation annotation.

end_index integer (optional)

End of the attributed segment, exclusive.

start_index integer (optional)

Start of segment of the response that is attributed to this source. Index indicates the start of the segment, measured in bytes.

title string (optional)

The title of the URL.

type object (required)

Описание отсутствует.

Always set to "url_citation" .

url string (optional)

The URL.

WordInfo

Word-level ASR annotation for transcription output. Carries the word text, optional timing, and optional speaker attribution.

end_index integer (optional)

End of the attributed segment, exclusive.

end_offset string (optional)

End offset in time of the word relative to the start of the audio. Present when timestamp_granularities contains "word".

speaker string (optional)

Optional. Speaker label for this word (eg "spk_1", "spk_2"). Present when diarization_mode is set in TranscriptionConfig.

start_index integer (optional)

Start of segment of the response that is attributed to this source. Index indicates the start of the segment, measured in bytes.

start_offset string (optional)

Start offset in time of the word relative to the start of the audio. Present when timestamp_granularities contains "word".

text string (optional)

The transcribed word.

type object (required)

Описание отсутствует.

Always set to "word_info" .

text string (required)

Required. The text content.

type object (required)

Описание отсутствует.

Always set to "text" .

type object (required)

Описание отсутствует.

Always set to "thought" .

UrlContextCallStep

URL context call step.

arguments UrlContextCallArguments (required)

Required. The arguments to pass to the URL context.

The arguments to pass to the URL context.

Поля

urls array (string) (optional)

The URLs to fetch.

id string (required)

Required. A unique ID for this specific tool call.

signature string (optional)

A signature hash for backend validation.

type object (required)

Описание отсутствует.

Always set to "url_context_call" .

UrlContextResultStep

URL context result step.

call_id string (required)

Required. ID to match the ID from the function call block.

is_error boolean (optional)

Whether the URL context resulted in an error.

result array (UrlContextResult) (required)

Required. The results of the URL context.

The result of the URL context.

Поля

status enum (string) (optional)

The status of the URL retrieval.

Возможные значения:

  • success

    Url retrieval is successful.

  • error

    Url retrieval is failed due to error.

  • paywall

    Url retrieval is failed because the content is behind paywall.

  • unsafe

    Url retrieval is failed because the content is unsafe.

url string (optional)

The URL that was fetched.

signature string (optional)

A signature hash for backend validation.

type object (required)

Описание отсутствует.

Always set to "url_context_result" .

UserInputStep

Input provided by the user.

content array ( Content ) (optional)

Описание отсутствует.

type object (required)

Описание отсутствует.

Always set to "user_input" .

Примеры

CodeExecutionCallStep

{
  "type": "code_execution_call",
  "arguments": {
    "code": "print(sum(range(1, 11)))"
  },
  "id": "code_call_71021"
}

CodeExecutionResultStep

{
  "type": "code_execution_result",
  "call_id": "code_call_71021",
  "result": "55\n"
}

FileSearchCallStep

{
  "type": "file_search_call",
  "id": "file_call_88192"
}

FileSearchResultStep

{
  "type": "file_search_result",
  "call_id": "file_call_88192"
}

FunctionCallStep

{
  "name": "get_weather",
  "type": "function_call",
  "arguments": {
    "location": "Boston, MA"
  },
  "id": "call_98231"
}

FunctionResultStep

{
  "name": "get_weather",
  "type": "function_result",
  "call_id": "call_98231",
  "result": [
    {
      "type": "text",
      "text": "{\"weather\":\"sunny\"}"
    }
  ]
}

GoogleMapsCallStep

{
  "type": "google_maps_call",
  "arguments": {
    "latitude": 37.7749,
    "longitude": -122.4194
  },
  "id": "maps_call_39201"
}

GoogleMapsResultStep

{
  "type": "google_maps_result",
  "call_id": "maps_call_39201",
  "result": [
    {
      "name": "Golden Gate Park",
      "place_id": "ChIJIQBpAG2ahYAR9R7bNdTLg8M",
      "rating": 4.8
    }
  ]
}

GoogleSearchCallStep

{
  "type": "google_search_call",
  "arguments": {
    "query": "Who won the men's 100m in Paris 2024?"
  },
  "id": "search_call_19201"
}

GoogleSearchResultStep

{
  "type": "google_search_result",
  "call_id": "search_call_19201",
  "result": [
    {
      "title": "Paris 2024 Olympics: Noah Lyles wins men's 100m gold",
      "url": "https://olympics.com/en/news/paris-2024-noah-lyles-wins-mens-100m-gold",
      "snippet": "American Noah Lyles won the Olympic men's 100m gold medal in a photo finish."
    }
  ]
}

McpServerToolCallStep

{
  "name": "calculate_tax",
  "type": "mcp_server_tool_call",
  "arguments": {
    "income": 120000,
    "state": "CA"
  },
  "id": "mcp_call_29012",
  "server_name": "financial_mcp_server"
}

McpServerToolResultStep

{
  "type": "mcp_server_tool_result",
  "call_id": "mcp_call_29012",
  "result": {
    "tax_due": 32400
  }
}

ModelOutputStep

{
  "type": "model_output",
  "content": [
    {
      "type": "text",
      "text": "The capital of France is Paris."
    }
  ]
}

ThoughtStep

{
  "type": "thought",
  "signature": "thought_sig_abcd1234",
  "summary": [
    {
      "type": "text",
      "text": "The model is searching Google for the capital of France."
    }
  ]
}

UrlContextCallStep

{
  "type": "url_context_call",
  "arguments": {
    "urls": [
      "https://www.example.com"
    ]
  },
  "id": "url_call_10219"
}

UrlContextResultStep

{
  "type": "url_context_result",
  "call_id": "url_call_10219",
  "result": [
    {
      "title": "Example Domain",
      "url": "https://www.example.com",
      "snippet": "This domain is for use in illustrative examples in documents."
    }
  ]
}

UserInputStep

{
  "type": "user_input",
  "content": [
    {
      "type": "text",
      "text": "What is the capital of France?"
    }
  ]
}

EnvironmentConfig

Configuration for a custom environment.

Поля

environment_id string (optional)

Необязательный параметр. Идентификатор среды для взаимодействия. Если указан, запрос обновит существующую среду вместо создания новой.

network EnvironmentNetworkEgressAllowlist or enum (string) (optional)

Network configuration for the environment.

Возможные значения:

  • disabled

    Отключает всю сеть.

sources array (Source) (optional)

Описание отсутствует.

A source to be mounted into the environment.

Поля

content string (optional)

Встроенное содержимое, если `type` имеет значение `INLINE`.

encoding string (optional)

Дополнительная кодировка для встроенного контента (например, `base64`).

source string (optional)

Источник среды. Для Cloud Storage это путь к Cloud Storage. Для GitHub это путь к GitHub.

target string (optional)

Где в среде должен отображаться исходный код.

type enum (string) (optional)

Описание отсутствует.

Возможные значения:

  • gcs

    Сегмент облачного хранилища.

  • inline

    Встроенный контент.

  • repository

    Универсальный репозиторий. Префикс протокола в URL-адресе источника идентифицирует поставщика (например, github://, gcs://).

  • skill_registry

    Ресурс навыков из службы регистрации навыков. Навык: projects/{project}/locations/{location}/skills/{skill} Ревизия навыка: projects/{project}/locations/{location}/skills/{skill}/revisions/{revision} Поддерживается подключение всех навыков в рамках проекта: projects/{project}/locations/{location}/skills.

type object (optional)

Описание отсутствует.

Always set to "remote" .

Примеры

Inline Sources

{
  "type": "remote",
  "sources": [
    {
      "type": "inline",
      "content": "You are a data analyst. Always include visualizations and export results as PDF.",
      "target": ".agents/AGENTS.md"
    },
    {
      "type": "inline",
      "content": "---\nname: slide-maker\ndescription: Create HTML slide decks\n---\n# Slide Maker\n\nWhen asked to create a presentation:\n1. Analyze the input data\n2. Create an HTML slide deck with reveal.js\n3. Save to /workspace/output/slides.html",
      "target": ".agents/skills/slide-maker/SKILL.md"
    }
  ]
}

Внешние источники

{
  "type": "remote",
  "sources": [
    {
      "type": "repository",
      "source": "https://github.com/my-org/my-skills.git",
      "target": ".agents/skills"
    },
    {
      "type": "gcs",
      "source": "gs://my-bucket/my-folder",
      "target": "/workspace/data"
    }
  ]
}

Network Allowlist

{
  "type": "remote",
  "network": {
    "allowlist": [
      {
        "domain": "pypi.org"
      },
      {
        "domain": "*.github.com"
      }
    ]
  }
}

Proxy Credentials

{
  "type": "remote",
  "network": {
    "allowlist": [
      {
        "domain": "api.github.com",
        "transform": {
          "Authorization": "Bearer YOUR_GITHUB_TOKEN"
        }
      }
    ]
  }
}

EnvironmentNetworkEgressAllowlist

Outbound networking configuration for the sandbox. Accepts an object with an 'allowlist' array to restrict traffic, or the string 'disabled' to turn off all network access. Omit entirely to allow all outbound traffic with no header injection.

Возможные типы

объект

Настройки исходящей сети для песочницы. При указании ограничивает доступ песочницы к внешним доменам. Полное исключение позволяет разрешить весь исходящий трафик без внедрения заголовков.

allowlist array (AllowlistEntry) (optional)

Список разрешенных исходящих доменов. Разрешены только запросы к перечисленным доменам. Используйте [{'domain': '*'}], чтобы разрешить все домены, но при этом добавить заголовки только к определенным.

A single domain allowlist rule with optional header injection.

Поля

domain string (optional)

Домен, разрешающий исходящие запросы. Поддерживаются подстановочные знаки (например, '*.googleapis.com'). Используйте '*' для разрешения всех доменов.

transform array (object) or object (optional)

Заголовки для добавления во все исходящие запросы, соответствующие этому домену. Принимает один словарь или список словарей. Исходящий прокси добавляет их автоматически.

нить

Отключает всю сеть.

Возможные значения

  • disabled

    Отключает всю сеть.

Примеры

Пример

{
  "allowlist": [
    {
      "domain": "github.com",
      "transform": [
        {
          "Authorization": "Bearer your-token"
        }
      ]
    },
    {
      "domain": "*.googleapis.com"
    }
  ]
}

ToolChoiceConfig

The tool choice configuration containing allowed tools.

Поля

allowed_tools AllowedTools (optional)

Разрешенные инструменты.

The configuration for allowed tools.

Поля

mode enum (string) (optional)

Способ выбора инструмента.

Возможные значения:

  • auto

    Автоматический выбор инструмента.

  • any

    Любой выбор инструмента.

  • none

    Выбор инструментов отсутствует.

  • validated

    Выбор инструмента подтвержден.

tools array (string) (optional)

Названия разрешенных инструментов.

Примеры

Пример

{
  "allowed_tools": {
    "mode": "any",
    "tools": [
      "my_tool"
    ]
  }
}

ImageContent

An image content block.

Поля

data string (optional)

The image content.

mime_type enum (string) (optional)

The mime type of the image.

Возможные значения:

  • image/png

    PNG image format

  • image/jpeg

    формат изображения JPEG

  • image/webp

    WebP image format

  • image/heic

    HEIC image format

  • image/heif

    HEIF image format

  • image/gif

    GIF image format

  • image/bmp

    BMP image format

  • image/tiff

    TIFF image format

resolution MediaResolution (optional)

The resolution of the media.

Возможные значения

  • low

    Низкое разрешение.

  • medium

    Medium resolution.

  • high

    Высокое разрешение.

  • ultra_high

    Ultra high resolution.

type object (optional)

Описание отсутствует.

Always set to "image" .

uri string (optional)

The URI of the image.

Примеры

Изображение

{
  "type": "image",
  "data": "BASE64_ENCODED_IMAGE",
  "mime_type": "image/png"
}

Текстовое содержимое

A text content block.

Поля

annotations array (Annotation) (optional)

Citation information for model-generated content.

Citation information for model-generated content.

Возможные типы

FileCitation

A file citation annotation.

custom_metadata object (optional)

User provided metadata about the retrieved context.

document_uri string (optional)

The URI of the file.

end_index integer (optional)

End of the attributed segment, exclusive.

file_name string (optional)

Название файла.

media_id string (optional)

Media ID in-case of image citations, if applicable.

page_number integer (optional)

Page number of the cited document, if applicable.

source string (optional)

Source attributed for a portion of the text.

start_index integer (optional)

Start of segment of the response that is attributed to this source. Index indicates the start of the segment, measured in bytes.

type object (required)

Описание отсутствует.

Always set to "file_citation" .

PlaceCitation

A place citation annotation.

end_index integer (optional)

End of the attributed segment, exclusive.

name string (optional)

Title of the place.

place_id string (optional)

The ID of the place, in `places/{place_id}` format.

review_snippets array (ReviewSnippet) (optional)

Snippets of reviews that are used to generate answers about the features of a given place in Google Maps.

Encapsulates a snippet of a user review that answers a question about the features of a specific place in Google Maps.

Поля

review_id string (optional)

The ID of the review snippet.

title string (optional)

Заголовок рецензии.

url string (optional)

A link that corresponds to the user review on Google Maps.

start_index integer (optional)

Start of segment of the response that is attributed to this source. Index indicates the start of the segment, measured in bytes.

type object (required)

Описание отсутствует.

Always set to "place_citation" .

url string (optional)

URI reference of the place.

UrlCitation

A URL citation annotation.

end_index integer (optional)

End of the attributed segment, exclusive.

start_index integer (optional)

Start of segment of the response that is attributed to this source. Index indicates the start of the segment, measured in bytes.

title string (optional)

The title of the URL.

type object (required)

Описание отсутствует.

Always set to "url_citation" .

url string (optional)

The URL.

WordInfo

Word-level ASR annotation for transcription output. Carries the word text, optional timing, and optional speaker attribution.

end_index integer (optional)

End of the attributed segment, exclusive.

end_offset string (optional)

End offset in time of the word relative to the start of the audio. Present when timestamp_granularities contains "word".

speaker string (optional)

Optional. Speaker label for this word (eg "spk_1", "spk_2"). Present when diarization_mode is set in TranscriptionConfig.

start_index integer (optional)

Start of segment of the response that is attributed to this source. Index indicates the start of the segment, measured in bytes.

start_offset string (optional)

Start offset in time of the word relative to the start of the audio. Present when timestamp_granularities contains "word".

text string (optional)

The transcribed word.

type object (required)

Описание отсутствует.

Always set to "word_info" .

text string (optional)

Required. The text content.

type object (optional)

Описание отсутствует.

Always set to "text" .

Примеры

Текст

{
  "type": "text",
  "text": "Hello, how are you?"
}