Etkileşimler API'si: Önemli değişiklikler için taşıma kılavuzu (Mayıs 2026)

v1beta Interactions API, API şeklini yeniden yapılandırarak yayın sırasında yönlendirme ve eşzamansız araç çağrıları gibi gelecekteki özellikleri destekleyen, API'yi bozan değişiklikler sunuyor. Bu sayfada, nelerin değiştiği açıklanmakta ve geçiş yapmanıza yardımcı olacak öncesi ve sonrası kod örnekleri verilmektedir. İki tür değişiklik vardır:

  1. Adımlar şeması: outputs dizisinin yerini yeni bir steps dizisi alarak her etkileşim dönüşünün yapılandırılmış bir zaman çizelgesini sunar.
  2. Çıkış biçimi yapılandırması: Yeni bir polimorfik response_format, tüm çıkış biçimi kontrollerini birleştirir ve response_mime_type öğesini kaldırır.

Entegrasyonunuzu güncellemek için Yeni şemaya geçiş başlıklı makaledeki adımları uygulayın.

Temel değişiklik: outputs - steps

Yeni şema, outputs dizisini steps dizisiyle değiştirir.

  • Eski: Yanıtlarda yalnızca modelin oluşturduğu içeriği içeren düz bir outputs dizisi döndürülüyordu.
  • Yeni şema: Yanıtlar, tür ayırt edicileri içeren yapılandırılmış adımlardan oluşan bir steps dizisi döndürür.

POST /interactions yalnızca çıkış adımlarını döndürür. GET /interactions/{id} ilk user_input adımı da dahil olmak üzere tam adım zaman çizelgesini döndürür.

Temel giriş/çıkış (tekli)

Önce (eski)

Python

# Request
interaction = client.interactions.create(
    model="gemini-3.8-flash", input="Tell me a joke."
)

# Response access
print(interaction.outputs[-1].text)

JavaScript

// Request
const interaction = await client.interactions.create({
    model: 'gemini-3.8-flash',
    input: 'Tell me a joke.'
});

// Response access
console.log(interaction.outputs[-1].text);

REST

curl -X POST "https://generativelanguage.googleapis.com/v1beta/interactions?key=$GEMINI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gemini-3.8-flash",
    "input": "Tell me a joke."
  }'
// Response
{
  "id": "int_123",
  "role": "model",
  "outputs": [
    {
      "type": "text",
      "text": "Why did the chicken cross the road?"
    }
  ]
}

Sonra (yeni şema)

Python

# Request
interaction = client.interactions.create(
    model="gemini-3.8-flash", input="Tell me a joke."
)

# Response access (Recommended sugar)
print(interaction.output_text)

JavaScript

// Request
const interaction = await client.interactions.create({
    model: 'gemini-3.8-flash',
    input: 'Tell me a joke.'
});

// Response access (Recommended sugar)
console.log(interaction.output_text);

[sdk-convenience]: /gemini-api/docs/interactions-overview#sdk-sugar

REST

# Opt-in needed before May 26th
curl -X POST "https://generativelanguage.googleapis.com/v1beta/interactions?key=$GEMINI_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Api-Revision: 2026-05-20" \
  -d '{
    "model": "gemini-3.8-flash",
    "input": "Tell me a joke."
  }'
// POST Response
{
  "id": "int_123",
  "steps": [
    {
      "type": "model_output",
      "content": [
        {
          "type": "text",
          "text": "Why did the chicken cross the road?"
        }
      ]
    }
  ]
}

// GET /v1beta/interactions/int_123 (returns full timeline including input)
{
  "id": "int_123",
  "steps": [
    {
      "type": "user_input",
      "content": [
        { "type": "text", "text": "Tell me a joke." }
      ]
    },
    {
      "type": "model_output",
      "content": [
        {
          "type": "text",
          "text": "Why did the chicken cross the road?"
        }
      ]
    }
  ]
}

İşlev çağırma

İstek yapısı değişmez ancak yanıtta düz outputs içeriği yapılandırılmış adımlarla değiştirilir.

Önce (eski)

Python

# Accessing function call in legacy schema
for output in interaction.outputs:
    if output.type == "function_call":
        print(f"Calling {output.name} with {output.arguments}")

JavaScript

// Accessing function call in legacy schema
for (const output of interaction.outputs) {
    if (output.type === 'function_call') {
        console.log(`Calling ${output.name} with ${JSON.stringify(output.arguments)}`);
    }
}

REST

// Response
{
  "id": "int_001",
  "role": "model",
  "status": "requires_action",
  "outputs": [
    {
      "type": "thought",
      "signature": "abc123..."
    },
    {
      "type": "function_call",
      "id": "fc_1",
      "name": "get_weather",
      "arguments": { "location": "Boston, MA" }
    }
  ]
}

Sonra (yeni şema)

Python

# Accessing function call in new steps schema
for step in interaction.steps:
    if step.type == "function_call":
        print(f"Calling {step.name} with {step.arguments}")

JavaScript

// Accessing function call in new steps schema
for (const step of interaction.steps) {
    if (step.type === 'function_call') {
        console.log(`Calling ${step.name} with ${JSON.stringify(step.arguments)}`);
    }
}

REST

// POST Response
{
  "id": "int_001",
  "status": "requires_action",
  "steps": [
    {
      "type": "thought",
      "summary": [{
        "type": "text",
        "text": "I need to check the weather in Boston..."
      }],
      "signature": "abc123..."
    },
    {
      "type": "function_call",
      "id": "fc_1",
      "name": "get_weather",
      "arguments": { "location": "Boston, MA" }
    }
  ]
}

Sunucu tarafı araçlar

Sunucu tarafı araçlar (ör. Google Arama veya kod yürütme) artık steps dizisinde belirli adım türleri döndürüyor. Eski şema bu işlemleri outputs dizisindeki belirli içerik türleri olarak döndürürken yeni şema bunları steps dizisine taşır. Aşağıdaki örneklerde Google Arama kullanılmaktadır.

Önce (eski)

Python

# Accessing search results in legacy schema
for output in interaction.outputs:
    if output.type == "google_search_call":
        print(f"Searched for: {output.arguments.queries}")
    elif output.type == "google_search_result":
        print(f"Found results: {output.result.rendered_content}")

JavaScript

// Accessing search results in legacy schema
for (const output of interaction.outputs) {
    if (output.type === 'google_search_call') {
        console.log(`Searched for: ${output.arguments.queries}`);
    } else if (output.type === 'google_search_result') {
        console.log(`Found results: ${output.result.renderedContent}`);
    }
}

REST

curl -X POST "https://generativelanguage.googleapis.com/v1beta/interactions?key=$GEMINI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gemini-3.8-flash",
    "input": "Who won the last Super Bowl?",
    "tools": [
      { "type": "google_search" }
    ]
  }'
// Response
{
  "id": "int_456",
  "outputs": [
    {
      "type": "google_search_call",
      "id": "gs_1",
      "arguments": { "queries": ["last Super Bowl winner"] }
    },
    {
      "type": "google_search_result",
      "call_id": "gs_1",
      "result": {
        "rendered_content": "<div>...</div>",
        "url": "https://www.nfl.com/super-bowl"
      }
    },
    {
      "type": "text",
      "text": "The Kansas City Chiefs won the last Super Bowl.",
      "annotations": [
        {
          "start_index": 4,
          "end_index": 22,
          "source": "https://www.nfl.com/super-bowl"
        }
      ]
    }
  ],
  "status": "completed"
}

Sonra (yeni şema)

Python

# Accessing search results in new steps schema
for step in interaction.steps:
    if step.type == "google_search_call":
        print(f"Searched for: {step.arguments.queries}")
    elif step.type == "google_search_result":
        print(f"Found results: {step.result[0].search_suggestions}")

JavaScript

// Accessing search results in new steps schema
for (const step of interaction.steps) {
    if (step.type === 'google_search_call') {
        console.log(`Searched for: ${step.arguments.queries}`);
    } else if (step.type === 'google_search_result') {
        console.log(`Found results: ${step.result[0].search_suggestions}`);
    }
}

REST

# Opt-in needed before May 26th
curl -X POST "https://generativelanguage.googleapis.com/v1beta/interactions?key=$GEMINI_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Api-Revision: 2026-05-20" \
  -d '{
    "model": "gemini-3.8-flash",
    "input": "Who won the last Super Bowl?",
    "tools": [
      { "type": "google_search" }
    ]
  }'
// POST Response
{
  "id": "int_456",
  "steps": [
    {
      "type": "google_search_call",
      "id": "gs_1",
      "arguments": { "queries": ["last Super Bowl winner"] },
      "signature": "abc123..."
    },
    {
      "type": "google_search_result",
      "call_id": "gs_1",
      "result": {
        "search_suggestions": "<div>...</div>"
      },
      "signature": "abc123..."
    },
    {
      "type": "model_output",
      "content": [
        {
          "type": "text",
          "text": "The Kansas City Chiefs won the last Super Bowl.",
          "annotations": [
            {
              "type": "url_citation",
              "url": "https://www.nfl.com/super-bowl",
              "title": "NFL.com",
              "start_index": 4,
              "end_index": 22
            }
          ]
        }
      ]
    }
  ],
  "status": "completed"
}

Canlı Yayın

Yayın, yeni etkinlik türlerini ortaya çıkarır:

Yeni etkinlik türleri

  • interaction.created
  • interaction.completed
  • interaction.in_progress
  • interaction.requires_action
  • step.start
  • step.delta
  • step.stop

Desteği sonlandırılmış etkinlik türleri

Aşağıdaki eski etkinlik türleri, yukarıda listelenen yeni etkinliklerle değiştirilir:

  • interaction.start → interaction.created
  • content.start → step.start
  • content.delta → step.delta
  • content.stop → step.stop
  • interaction.complete → interaction.completed
  • interaction.status_update → interaction.in_progress, interaction.requires_action vb. ile değiştirildi.

Akış işlev çağrıları: İşlev çağrısıyla akış kullandığınızda step.start etkinliği, işlev adını yayınlar ve step.delta etkinlikleri, bağımsız değişkenleri kısmi JSON dizeleri olarak (arguments_delta kullanarak) yayınlar. Bağımsız değişkenlerin tamamını almak için bu deltaları biriktirmeniz gerekir. Bu, işlev çağrısı nesnesinin tamamını tek seferde aldığınız tekli çağrılardan farklıdır.

Örnekler

Önce (Eski)

Python

# Legacy streaming used content.delta
stream = client.interactions.create(
    model="gemini-3.8-flash",
    input="Explain quantum entanglement in simple terms.",
    stream=True,
)

for chunk in stream:
    if chunk.event_type == "content.delta":
        if chunk.delta.type == "text":
            print(chunk.delta.text, end="", flush=True)

JavaScript

// Legacy streaming used content.delta
const stream = await client.interactions.create({
    model: 'gemini-3.8-flash',
    input: 'Explain quantum entanglement in simple terms.',
    stream: true,
});

for await (const chunk of stream) {
    if (chunk.event_type === 'content.delta') {
        if (chunk.delta.type === 'text') {
            process.stdout.write(chunk.delta.text);
        }
    }
}

REST

curl -X POST "https://generativelanguage.googleapis.com/v1beta/interactions?key=$GEMINI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gemini-3.8-flash",
    "input": "Explain quantum entanglement in simple terms.",
    "stream": true
  }'
// Response (SSE Lines)
// event: interaction.start
// data: {"id": "int_123", "status": "in_progress"}
//
// event: content.start
// data: {"index": 0, "type": "text"}
//
// event: content.delta
// data: {"delta": {"type": "text", "text": "Quantum entanglement is..."}}
//
// event: content.stop
// data: {"index": 0}
//
// event: interaction.complete
// data: {"id": "int_123", "status": "done", "usage": {"total_tokens": 42}}
Sonra (Yeni Şema)

Python

# Consuming stream and handling new event types
for event in client.interactions.create(
    model="gemini-3.8-flash",
    input="Tell me a story.",
    stream=True,
):
    if event.event_type == "step.delta":  # CHANGED: step.delta instead of content.delta
        if event.delta.type == "text":
            print(event.delta.text, end="")

JavaScript

// Consuming stream and handling new event types
const stream = await client.interactions.create({
    model: 'gemini-3.8-flash',
    input: 'Tell me a story.',
    stream: true,
});

for await (const event of stream) {
    if (event.event_type === 'step.delta') {  // CHANGED: step.delta instead of content.delta
        if (event.delta.type === 'text') {
            process.stdout.write(event.delta.text);
        }
    }
}

REST

 # Opt-in needed before May 26th
 curl -X POST "https://generativelanguage.googleapis.com/v1beta/interactions?key=$GEMINI_API_KEY" \
   -H "Content-Type: application/json" \
   -H "Accept: text/event-stream" \
   -H "Api-Revision: 2026-05-20" \
   -d '{
     "model": "gemini-3.8-flash",
     "input": "Tell me a story.",
     "stream": true
   }'
 // Response (SSE Lines)
 // event: interaction.created
 // data: {"interaction": {"id": "int_xyz", "status": "in_progress", "object": "interaction", "model": "gemini-3.8-flash"}, "event_type": "interaction.created"}
 //
 // event: interaction.in_progress
 // data: {"interaction_id": "int_xyz", "event_type": "interaction.in_progress"}
 //
 // event: step.start
 // data: {"index": 0, "step": {"type": "thought", "signature": "abc123..."}, "event_type": "step.start"}
 //
 // event: step.stop
 // data: {"index": 0, "event_type": "step.stop"}
 //
 // event: step.start
 // data: {"index": 1, "step": {"content": [{"text": "Once upon", "type": "text"}], "type": "model_output"}, "event_type": "step.start"}
 //
 // event: step.delta
 // data: {"index": 1, "delta": {"text": " a time...", "type": "text"}, "event_type": "step.delta"}
 //
 // event: step.stop
 // data: {"type": "step.stop", "index": 1, "status": "done"}
 //
 // event: interaction.completed
 // data: {"type": "interaction.completed", "interaction": {"id": "int_xyz", "status": "completed", "usage": {"prompt_tokens": 10, "completion_tokens": 5, "total_tokens": 15}}} // NEW: Dedicated completion event

Durumsuz Sohbet Geçmişi

Görüşme geçmişini istemci tarafında manuel olarak yönetiyorsanız (durum bilgisiz kullanım alanı) önceki sıraları nasıl birleştirdiğinizi güncellemeniz gerekir.

  • Eski: Geliştiriciler genellikle yanıtlardan outputs dizisini toplar ve bir sonraki dönüşte input alanında geri gönderirdi.
  • Yeni şema: Artık yanıttan steps dizisini alıp bir sonraki isteğin input alanına iletmeniz ve yeni kullanıcı sıranızı user_input adımı olarak eklemeniz gerekir.

Çıkış biçimi yapılandırması: response_format değişiklik

Güncellenen API, tüm çıkış biçimi kontrollerini birleştirilmiş, polimorfik bir response_format alanında birleştirir. Bu sayede çıkış yapılandırması üst düzeyde merkezileştirilir ve generation_config, model davranışına (ör. sıcaklık, top_p ve düşünme) odaklanır.

Önemli değişiklikler

  • API, response_mime_type öğesini kaldırır. Artık response_format içinde biçim girişi başına MIME türünü belirtmeniz gerekir.
  • response_format artık polimorfik bir nesne (veya dizi). Her girişin bir type ayrıştırıcısı (text, audio, image) ve türe özgü alanları vardır. Birden fazla çıktı modu istemek için bir biçim girişleri dizisi iletin.
  • image_config, generation_config konumundan response_format konumuna taşınır. Artık aspect_ratio ve image_size gibi resim çıkış ayarlarını "type": "image" ile response_format girişinde belirtiyorsunuz.

Yapılandırılmış çıkış (JSON)

Yeni şemada response_mime_type alanı kaldırıldı. Bunun yerine, response_format nesnesinde MIME türünü ve JSON şemasını "type": "text" ile birlikte belirtin.

Önce (eski)

Python

interaction = client.interactions.create(
    model="gemini-3.8-flash",
    input="Summarize this article.",
    response_mime_type="application/json",
    response_format={
        "type": "object",
        "properties": {
            "summary": {"type": "string"}
        }
    },
)

print(interaction.outputs[-1].text)

JavaScript

const interaction = await client.interactions.create({
    model: 'gemini-3.8-flash',
    input: 'Summarize this article.',
    response_mime_type: 'application/json',
    response_format: {
        type: 'object',
        properties: {
            summary: { type: 'string' }
        }
    },
});

console.log(interaction.outputs[-1].text);

REST

curl -X POST "https://generativelanguage.googleapis.com/v1beta/interactions?key=$GEMINI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gemini-3.8-flash",
    "input": "Summarize this article.",
    "response_mime_type": "application/json",
    "response_format": {
      "type": "object",
      "properties": {
        "summary": { "type": "string" }
      }
    }
  }'

Sonra (yeni şema)

Python

interaction = client.interactions.create(
    model="gemini-3.8-flash",
    input="Summarize this article.",
    # response_mime_type is removed — specify mime_type inside response_format
    response_format={
        "type": "text",
        "mime_type": "application/json",
        "schema": {
            "type": "object",
            "properties": {
                "summary": {"type": "string"}
            }
        }
    },
)

# Print response
print(interaction.output_text)

JavaScript

const interaction = await client.interactions.create({
    model: 'gemini-3.8-flash',
    input: 'Summarize this article.',
    // response_mime_type is removed — specify mime_type inside response_format
    response_format: {
        type: 'text',
        mime_type: 'application/json',
        schema: {
            type: 'object',
            properties: {
                summary: { type: 'string' }
            }
        }
    },
});

// Print response
console.log(interaction.output_text);

REST

# Opt-in needed before May 26th
curl -X POST "https://generativelanguage.googleapis.com/v1beta/interactions?key=$GEMINI_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Api-Revision: 2026-05-20" \
  -d '{
    "model": "gemini-3.8-flash",
    "input": "Summarize this article.",
    "response_format": {
      "type": "text",
      "mime_type": "application/json",
      "schema": {
        "type": "object",
        "properties": {
          "summary": { "type": "string" }
        }
      }
    }
  }'

Resim yapılandırması

Yeni şema, image_config öğesini generation_config öğesinden kaldırır. Artık görüntü çıkışı ayarlarını "type": "image" ile response_format girişinde belirtiyorsunuz.

Önce (eski)

Python

interaction = client.interactions.create(
    model="gemini-3.8-flash",
    input="Generate an image of a sunset over the ocean.",
    generation_config={
        "image_config": {
            "aspect_ratio": "1:1",
            "image_size": "1K"
        }
    },
)

JavaScript

const interaction = await client.interactions.create({
    model: 'gemini-3.8-flash',
    input: 'Generate an image of a sunset over the ocean.',
    generation_config: {
        image_config: {
            aspect_ratio: '1:1',
            image_size: '1K'
        }
    },
});

REST

curl -X POST "https://generativelanguage.googleapis.com/v1beta/interactions?key=$GEMINI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gemini-3.8-flash",
    "input": "Generate an image of a sunset over the ocean.",
    "generation_config": {
      "image_config": {
        "aspect_ratio": "1:1",
        "image_size": "1K"
      }
    }
  }'

Sonra (yeni şema)

Python

interaction = client.interactions.create(
    model="gemini-3.8-flash",
    input="Generate an image of a sunset over the ocean.",
    # image_config is removed from generation_config — use response_format
    response_format={
        "type": "image",
        "mime_type": "image/jpeg",
        "aspect_ratio": "1:1",
        "image_size": "1K"
    },
)

JavaScript

const interaction = await client.interactions.create({
    model: 'gemini-3.8-flash',
    input: 'Generate an image of a sunset over the ocean.',
    // image_config is removed from generation_config — use response_format
    response_format: {
        type: 'image',
        mime_type: 'image/jpeg',
        aspect_ratio: '1:1',
        image_size: '1K'
    },
});

REST

# Opt-in needed before May 26th
curl -X POST "https://generativelanguage.googleapis.com/v1beta/interactions?key=$GEMINI_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Api-Revision: 2026-05-20" \
  -d '{
    "model": "gemini-3.8-flash",
    "input": "Generate an image of a sunset over the ocean.",
    "response_format": {
      "type": "image",
      "mime_type": "image/jpeg",
      "aspect_ratio": "1:1",
      "image_size": "1K"
    }
  }'

Ses yapılandırması

Yeni şema, response_modalities: ["audio"] yerine "type": "audio" response_format girişi kullanır.

Önce (eski)

Python

interaction = client.interactions.create(
    model="gemini-3.1-flash-tts-preview",
    input="Say cheerfully: Have a wonderful day!",
    response_modalities=["audio"],
    generation_config={
        "speech_config": [
            {"voice": "Kore"}
        ]
    }
)

JavaScript

const interaction = await client.interactions.create({
    model: 'gemini-3.1-flash-tts-preview',
    input: 'Say cheerfully: Have a wonderful day!',
    response_modalities: ['audio'],
    generation_config: {
        speech_config: [
            { voice: 'Kore' }
        ]
    },
});

REST

curl -X POST "https://generativelanguage.googleapis.com/v1beta/interactions?key=$GEMINI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gemini-3.1-flash-tts-preview",
    "input": "Say cheerfully: Have a wonderful day!",
    "response_modalities": ["audio"],
    "generation_config": {
      "speech_config": [
        { "voice": "Kore" }
      ]
    }
  }'

Sonra (yeni şema)

Python

interaction = client.interactions.create(
    model="gemini-3.1-flash-tts-preview",
    input="Say cheerfully: Have a wonderful day!",
    # response_modalities is removed — use response_format
    response_format={
        "type": "audio"
    },
    generation_config={
        "speech_config": [
            {"voice": "Kore"}
        ]
    }
)

JavaScript

const interaction = await client.interactions.create({
    model: 'gemini-3.1-flash-tts-preview',
    input: 'Say cheerfully: Have a wonderful day!',
    // response_modalities is removed — use response_format
    response_format: {
        type: 'audio'
    },
    generation_config: {
        speech_config: [
            { voice: 'Kore' }
        ]
    },
});

REST

# Opt-in needed before May 26th
curl -X POST "https://generativelanguage.googleapis.com/v1beta/interactions?key=$GEMINI_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Api-Revision: 2026-05-20" \
  -d '{
    "model": "gemini-3.1-flash-tts-preview",
    "input": "Say cheerfully: Have a wonderful day!",
    "response_format": {
      "type": "audio"
    },
    "generation_config": {
      "speech_config": [
        { "voice": "Kore" }
      ]
    }
  }'

Birden fazla çıkış modalitesi (ör. hem metin hem ses) istemek için response_format öğesine tek bir nesne yerine biçim girişlerinden oluşan bir dizi iletin.

Yeni şemaya geçiş yapma

SDK kullanıcıları

En son SDK sürümüne (Python ≥2.0.0, JavaScript ≥2.0.0) yükseltin. SDK, sizi otomatik olarak yeni şemaya dahil eder. Yanıtları okuma şeklinizi güncellemek dışında (yukarıdaki örneklere bakın) herhangi bir kod değişikliği yapmanız gerekmez. Bu SDK sürümlerinde yalnızca yeni şemanın desteklendiğini unutmayın. Eski SDK sürümleri (Python 1.x.x, JavaScript 1.x.x), eski şema 8 Haziran 2026'da kaldırılana kadar çalışmaya devam edecek.

REST API kullanıcıları

Yeni şemayı hemen kullanmaya başlamak için isteklerinize Api-Revision: 2026-05-20 üstbilgisini ekleyin. 26 Mayıs'tan sonra yeni şema, tüm istekler için varsayılan şema haline gelir. API, eski şemayı kalıcı olarak kaldırana kadar Api-Revision: 2026-05-07 ile 8 Haziran'a kadar geçici olarak devre dışı bırakabilirsiniz.

Zaman çizelgesi

Tarih Faz SDK kullanıcıları REST API kullanıcıları
7 Mayıs Etkinleştir Yeni SDK sürümü kullanıma sunuldu (Python ≥2.0.0, JS ≥2.0.0). Yeni şemayı otomatik olarak almak için yükseltin. Etkinleştirmek için Api-Revision: 2026-05-20 başlığını ekleyin. Varsayılan olarak eski sürüm kullanılır.
26 Mayıs Varsayılan çevirme Daha önce yükselttiyseniz herhangi bir işlem yapmanız gerekmez. Eski SDK'lar (Python 1.x.x, JS 1.x.x) çalışmaya devam eder ancak eski yanıtlar döndürür. Yeni şema artık varsayılan olarak ayarlandı. Kapsam dışında kalmayı seçmek için Api-Revision: 2026-05-07 üstbilgisini gönderin.
8 Haziran Gün batımı Python 1.x.x ve JS 1.x.x SDK sürümleri, Interactions API çağrıları için çalışmayacak. Interactions API için eski şema kaldırıldı. Api-Revision başlığı yoksayıldı.

Taşıma Denetim Listesi

Adım şeması (steps)

  • Kodu, yanıt içeriğini outputs yerine steps dizisinden okuyacak şekilde güncelleyin. Örnekleri inceleyin.
  • Kodunuzun hem user_input hem de model_output adım türlerini işlediğini doğrulayın. Örnekleri inceleyin.
  • (İşlev Çağırma) steps dizisinde function_call adımlarını bulmak için kodu güncelleyin. Örnekleri inceleyin.
  • (Sunucu Tarafı Araçlar) Araca özgü adımları (ör. google_search_call, google_search_result) işlemek için kodu güncelleyin. Örnekleri inceleyin.
  • (Durumsuz Geçmiş) Sonraki isteğin input alanında steps dizisini iletmek için geçmiş yönetimini güncelleyin. Ayrıntıları inceleyin.
  • (Yalnızca akış) İstemciyi yeni SSE etkinlik türlerini (interaction.created, step.delta vb.) dinleyecek şekilde güncelleyin. Örnekleri inceleyin.

Çıkış biçimi yapılandırması (response_format)

  • response_mime_type değerini response_format içindeki bir mime_type alanıyla değiştirin. Örnekleri inceleyin.
  • Mevcut response_format JSON şemanızı bir {"type": "text", "schema": ...} nesnesinin içine yerleştirin. Örnekleri inceleyin.
  • (Görüntü Üretme) image_config öğesini generation_config konumundan response_format içindeki {"type": "image", ...} girişine taşıyın. Örnekleri inceleyin.
  • (Konuşma Oluşturma) response_format içinde response_modalities=["audio"] yerine {"type": "audio"} girişi kullanın. Örnekleri inceleyin.
  • (Çok formatlı) Birden fazla çıkış biçimi istendiğinde response_format öğesini tek bir nesneden diziye dönüştürün.