Приоритетный вывод

Описание: Узнайте, как оптимизировать задержку с помощью уровня приоритетного вывода в API взаимодействий.

API Gemini Priority — это премиальный уровень обработки данных, разработанный для критически важных бизнес-задач, требующих минимальной задержки и высочайшей надежности по премиум-цене. Трафик уровня Priority имеет приоритет над трафиком стандартного API и уровня Flex.

Функция определения приоритетов доступна для всех конечных точек API взаимодействий.

Как использовать приоритет

Для использования уровня «Приоритет» установите значение поля service_tier в вашем запросе на priority . Если это поле опущено, по умолчанию будет использоваться уровень «Стандарт».

Python

from google import genai

client = genai.Client()

interaction = client.interactions.create(
    model="gemini-3.8-flash",
    input="Triage this critical customer support ticket immediately.",
    service_tier='priority'
)
print(interaction.output_text)

JavaScript

import { GoogleGenAI } from '@google/genai';

const ai = new GoogleGenAI({});

async function main() {
    const interaction = await ai.interactions.create({
        model: "gemini-3.8-flash",
        input: "Triage this critical customer support ticket immediately.",
        service_tier: "priority"
    });
    console.log(interaction.output_text);
}

await main();

Java

import com.google.genai.Client;
import com.google.genai.gaos.models.interactions.CreateModelInteraction;
import com.google.genai.gaos.models.interactions.Interaction;
import com.google.genai.gaos.models.interactions.InteractionsInput;
import com.google.genai.gaos.models.interactions.Model;
import com.google.genai.gaos.models.interactions.ServiceTier;
import com.google.genai.gaos.models.operations.CreateInteractionRequestBody;

Client client = new Client();

CreateModelInteraction params =
    CreateModelInteraction.builder()
        .model(Model.of("gemini-3.8-flash"))
        .input(InteractionsInput.of("Perform a priority inference task."))
        .serviceTier(ServiceTier.PRIORITY)
        .build();