واجهة برمجة التطبيقات Interactions API: دليل نقل التغييرات غير المتوافقة (مايو 2026)

تُجري v1beta Interactions API تغييرات غير متوافقة تعيد هيكلة شكل واجهة برمجة التطبيقات لتوفير إمكانات مستقبلية، مثل التوجيه أثناء الرحلة واستدعاء الأدوات بشكل غير متزامن. توضّح هذه الصفحة التغييرات وتقدّم أمثلة على الرموز البرمجية قبل التغيير وبعده لمساعدتك في نقل البيانات. هناك فئتان من التغييرات:

  1. مخطط الخطوات: يحلّ صفيف steps جديد محلّ صفيف outputs، ما يوفّر مخططًا زمنيًا منظَّمًا لكل خطوة من خطوات التفاعل.
  2. إعداد تنسيق الإخراج: يدمج هذا الإعداد الجديد جميع عناصر التحكّم في تنسيق الإخراج ويزيل response_mime_type.response_format

اتّبِع الخطوات الواردة في كيفية الانتقال إلى المخطط الجديد لتعديل عملية الدمج.

التغيير الأساسي: outputs إلى steps

يستبدل المخطط الجديد مصفوفة outputs بمصفوفة steps.

  • الإصدار القديم: كانت الردود تعرض مصفوفة outputs مسطّحة تحتوي على المحتوى الذي أنشأه النموذج فقط.
  • المخطط الجديد: تعرض الردود مصفوفة steps تتضمّن كلاً من المدخلات التي أدخلها المستخدم والمخرجات التي قدّمها النموذج، ما يوفّر جدولاً زمنيًا كاملاً لجولة التفاعل.

تعكس الردود الأحادية (غير المتدفقة) إدخالك كخطوة أولى في مصفوفة steps. تتخطى الردود المتدفقة خطوة الإدخال ولا تعرض سوى دلتا المحتوى الذي تم إنشاؤه.

الإدخال/الإخراج الأساسي (أحادي)

قبل (قديم)

Python

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

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

JavaScript

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

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

REST

// Request: POST /v1beta/interactions
{
  "model": "gemini-3-flash-preview",
  "input": "Tell me a joke."
}

// Response
{
  "id": "int_123",
  "role": "model",
  "outputs": [
    {
      "type": "text",
      "text": "Why did the chicken cross the road?"
    }
  ]
}

بعد (المخطط الجديد)

Python

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

# Response access
print(interaction.steps[-1].content[0].text)  # CHANGED: steps instead of outputs

JavaScript

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

// Response access
console.log(interaction.steps.at(-1).content[0].text);

REST

// Request: POST /v1beta/interactions
{
  "model": "gemini-3-flash-preview",
  "input": "Tell me a joke."
}

// Response
{
  "id": "int_123",
  "steps": [
    {
      "type": "user_input",
      "status": "done",
      "content": [
        {
          "type": "text",
          "text": "Tell me a joke."
        }
      ]
    },
    {
      "type": "model_output",
      "status": "done",
      "content": [
        {
          "type": "text",
          "text": "Why did the chicken cross the road?"
        }
      ]
    }
  ]
}

استدعاء الدالة

ستبقى بنية الطلب بدون تغيير، ولكن سيتم استبدال المحتوى العادي outputs بالخطوات المنظَّمة في الرد.

قبل (قديم)

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" }
    }
  ]
}

بعد (المخطط الجديد)

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

// Response
{
  "id": "int_001",
  "status": "requires_action",
  "steps": [
    {
      "type": "user_input",
      "status": "done",
      "content": [
        { "type": "text", "text": "What's the weather in Boston?" }
      ]
    },
    {
      "type": "thought",
      "status": "done",
      "signature": "abc123..."
    },
    {
      "type": "function_call",
      "status": "waiting",
      "id": "fc_1",
      "name": "get_weather",
      "arguments": { "location": "Boston, MA" }
    }
  ]
}

الأدوات من جهة الخادم

توفّر أدوات من جهة الخادم (مثل "بحث Google" أو "تنفيذ الرموز البرمجية") الآن أنواعًا محدّدة من الخطوات في مصفوفة steps. في حين أنّ المخطط القديم كان يعرض هذه العمليات كأنواع محتوى محدّدة ضمن مصفوفة outputs، ينقلها المخطط الجديد إلى مصفوفة steps. تستخدِم الأمثلة التالية "بحث Google".

قبل (قديم)

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

// Request: POST /v1beta/interactions
{
  "model": "gemini-3-flash-preview",
  "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"
}

بعد (المخطط الجديد)

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.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.searchSuggestions}`);
    }
}

REST

// Request: POST /v1beta/interactions
{
  "model": "gemini-3-flash-preview",
  "input": "Who won the last Super Bowl?",
  "tools": [
    { "type": "google_search" }
  ]
}

// Response
{
  "id": "int_456",
  "steps": [
    {
      "type": "user_input",
      "status": "done",
      "content": [
        { "type": "text", "text": "Who won the last Super Bowl?" }
      ]
    },
    {
      "type": "google_search_call",
      "status": "done",
      "id": "gs_1",
      "arguments": { "queries": ["last Super Bowl winner"] },
      "signature": "abc123..."
    },
    {
      "type": "google_search_result",
      "status": "done",
      "call_id": "gs_1",
      "result": {
        "search_suggestions": "<div>...</div>"
      },
      "signature": "abc123..."
    },
    {
      "type": "model_output",
      "status": "done",
      "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"
}

البث

تعرض ميزة البث أنواعًا جديدة من الأحداث:

أنواع الأحداث الجديدة

  • interaction.created
  • interaction.status_update: يغطي الآن جميع حالات مراحل النشاط، بما في ذلك حالات الإكمال والأخطاء (راجِع الحالات أدناه)
  • step.start
  • step.delta
  • step.stop
interaction.status_update حالات
  • in_progress
  • active
  • completed
  • interrupted
  • requires_action
  • error

أنواع الأحداث المتوقّفة نهائيًا

تم استبدال أنواع الأحداث القديمة التالية بالأحداث الجديدة المدرَجة أعلاه:

  • interaction.start ‏← interaction.created
  • content.start ‏← step.start
  • content.delta ‏← step.delta
  • content.stop ‏← step.stop
  • interaction.completeinteraction.status_update مع status: "completed"
  • errorinteraction.status_update مع status: "error"
  • interaction.status_updateinteraction.status_update (لم يتغيّر، ولكنّه يشمل الآن ولايات إضافية)

استدعاء الدوال أثناء البث: عند استخدام البث مع استدعاء الدوال، يقدّم حدث step.start اسم الدالة، وتبث أحداث step.delta الوسيطات كسلاسل JSON جزئية (باستخدام arguments_delta). عليك تجميع هذه التغييرات للحصول على الوسيطات الكاملة. ويختلف ذلك عن المكالمات الأحادية التي تتلقّى فيها كائن استدعاء الدالة الكامل مرة واحدة.

أمثلة

قبل (طريقة قديمة)

Python

# Legacy streaming used content.delta
stream = client.interactions.create(
    model="gemini-3-flash-preview",
    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-flash-preview',
    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

// Request: POST /v1beta/interactions
{
  "model": "gemini-3-flash-preview",
  "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}}
بعد (المخطط الجديد)

Python

# Consuming stream and handling new event types
for event in client.interactions.create(
    model="gemini-3-flash-preview",
    input="Tell me a story.",
    stream=True,
):
    if 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-flash-preview',
    input: 'Tell me a story.',
    stream: true,
});

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

REST

 // Request: POST /v1beta/interactions
 // Accept: text/event-stream
 {
   "model": "gemini-3-flash-preview",
   "input": "Tell me a story."
 }

 // Response (SSE Lines)
 // event: interaction.created
 // data: {"type": "interaction.created", "interaction": {"id": "int_xyz", "status": "created"}} // CHANGED: 'type' instead of 'event_type'
 //
 // event: interaction.status_update
 // data: {"type": "interaction.status_update", "status": "in_progress"} // NEW: Lifecycle status updates in stream (postpone until Sessions launch dependency)
 //
 // event: step.start
 // data: {"type": "step.start", "index": 0, "step": {"type": "thought"}} // NEW: Replaces content.start, 'step' instead of 'content'
 //
 // event: step.delta
 // data: {"type": "step.delta", "index": 0, "delta": {"type": "thought", "text": "User wants an explanation."}} // NEW: Delta type matches step type
 //
 // event: step.stop
 // data: {"type": "step.stop", "index": 0, "status": "done"} // NEW: Includes status
 //
 // event: step.start
 // data: {"type": "step.start", "index": 1, "step": {"type": "model_output"}} // NEW: Step wrapper for output
 //
 // event: step.delta
 // data: {"type": "step.delta", "index": 1, "delta": {"type": "text", "text": "Hello"}}
 //
 // event: step.stop
 // data: {"type": "step.stop", "index": 1, "status": "done"}
 //
 // event: interaction.complete
 // data: {"type": "interaction.complete", "interaction": {"id": "int_xyz", "status": "completed", "usage": {"prompt_tokens": 10, "completion_tokens": 5, "total_tokens": 15}}} // NEW: End of stream event with interaction details

سجلّ المحادثات بدون حالة

إذا كنت تدير سجلّ المحادثات يدويًا من جهة العميل (حالة استخدام بدون حالة)، عليك تعديل طريقة ربط الأدوار السابقة.

  • الإصدار القديم: كان المطوّرون غالبًا يجمعون مصفوفة outputs من الردود ويرسلونها مرة أخرى في الحقل input في الجولة التالية.
  • مخطط جديد: عليك الآن جمع مصفوفة steps من الرد وتمريرها في الحقل input للطلب التالي، مع إضافة دور المستخدم الجديد كخطوة user_input.

تغييرات في إعدادات تنسيق الإخراج: response_format

تدمج واجهة برمجة التطبيقات المعدَّلة جميع عناصر التحكّم في تنسيق الإخراج في حقل response_format موحّد ومتعدد الأشكال. يؤدي ذلك إلى تركيز إعدادات الإخراج في المستوى الأعلى، وإبقاء generation_config مركّزًا على سلوك النموذج (مثل درجة العشوائية وأعلى احتمال تراكمي والتفكير).

أهم التغييرات

  • تزيل واجهة برمجة التطبيقات response_mime_type. يمكنك الآن تحديد نوع MIME لكل إدخال تنسيق داخل response_format.
  • أصبح response_format الآن كائنًا (أو مصفوفة) متعدد الأشكال. يحتوي كل إدخال على مميِّز type (text وaudio وimage) وحقول خاصة بنوع الإدخال. لطلب وسائط إخراج متعددة، مرِّر مصفوفة من إدخالات التنسيق.
  • يتم نقل image_config من generation_config إلى response_format. يمكنك الآن تحديد إعدادات إخراج الصور، مثل aspect_ratio وimage_size، في إدخال response_format باستخدام "type": "image".

الناتج المنظَّم (JSON)

يزيل المخطط الجديد الحقل response_mime_type. بدلاً من ذلك، حدِّد نوع MIME ومخطط JSON داخل العنصر response_format باستخدام "type": "text".

قبل (قديم)

Python

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

print(interaction.outputs[0].text)

JavaScript

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

console.log(interaction.outputs[0].text);

REST

// Request: POST /v1beta/interactions
{
  "model": "gemini-3-flash-preview",
  "input": "Summarize this article.",
  "response_mime_type": "application/json",
  "response_format": {
    "type": "object",
    "properties": {
      "summary": { "type": "string" }
    }
  }
}

بعد (المخطط الجديد)

Python

interaction = client.interactions.create(
    model="gemini-3-flash-preview",
    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(interaction.steps[-1].content[0].text)

JavaScript

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

console.log(interaction.steps.at(-1).content[0].text);

REST

// Request: POST /v1beta/interactions
{
  "model": "gemini-3-flash-preview",
  "input": "Summarize this article.",
  // response_mime_type is removed
  "response_format": {
    "type": "text",                          // NEW: type discriminator
    "mime_type": "application/json",          // MOVED: from response_mime_type
    "schema": {                              // RENAMED: was response_format directly
      "type": "object",
      "properties": {
        "summary": { "type": "string" }
      }
    }
  }
}

إعدادات الصور

يزيل المخطط الجديد image_config من generation_config. يمكنك الآن تحديد إعدادات إخراج الصور في إدخال response_format باستخدام "type": "image".

قبل (قديم)

Python

interaction = client.interactions.create(
    model="gemini-3-flash-preview",
    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-flash-preview',
    input: 'Generate an image of a sunset over the ocean.',
    generationConfig: {
        imageConfig: {
            aspectRatio: '1:1',
            imageSize: '1K'
        }
    },
});

REST

// Request: POST /v1beta/interactions
{
  "model": "gemini-3-flash-preview",
  "input": "Generate an image of a sunset over the ocean.",
  "generation_config": {
    "image_config": {
      "aspect_ratio": "1:1",
      "image_size": "1K"
    }
  }
}

بعد (المخطط الجديد)

Python

interaction = client.interactions.create(
    model="gemini-3-flash-preview",
    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",
        "delivery": "inline",
        "aspect_ratio": "1:1",
        "image_size": "1K"
    },
)

JavaScript

const interaction = await client.interactions.create({
    model: 'gemini-3-flash-preview',
    input: 'Generate an image of a sunset over the ocean.',
    // imageConfig is removed from generationConfig — use responseFormat
    responseFormat: {
        type: 'image',
        mimeType: 'image/jpeg',
        delivery: 'inline',
        aspectRatio: '1:1',
        imageSize: '1K'
    },
});

REST

// Request: POST /v1beta/interactions
{
  "model": "gemini-3-flash-preview",
  "input": "Generate an image of a sunset over the ocean.",
  // image_config removed from generation_config
  "response_format": {
    "type": "image",                         // NEW: type discriminator
    "mime_type": "image/jpeg",
    "delivery": "inline",
    "aspect_ratio": "1:1",                   // MOVED: from generation_config.image_config
    "image_size": "1K"                       // MOVED: from generation_config.image_config
  }
}

لطلب وسائط إخراج متعددة (مثل النص والصوت معًا)، مرِّر مصفوفة من إدخالات التنسيق إلى response_format بدلاً من كائن واحد.

كيفية الانتقال إلى المخطط الجديد

مستخدمو حزمة تطوير البرامج (SDK)

يجب الترقية إلى أحدث إصدار من حزمة تطوير البرامج (Python ≥1.76.0 وJavaScript ≥1.53.0). يتم تلقائيًا تفعيل المخطط الجديد في حزمة تطوير البرامج (SDK)، بدون الحاجة إلى إجراء أي تغييرات على الرمز باستثناء تعديل طريقة قراءة الردود (راجِع الأمثلة أعلاه). يُرجى العِلم أنّه لا يتوفّر في إصدارات حزمة تطوير البرامج (SDK) هذه سوى المخطط الجديد. ستظل إصدارات حزمة تطوير البرامج (SDK) القديمة (Python ≤1.73.1 وJavaScript ≤1.50.1) تعمل إلى أن تتم إزالة المخطط القديم في 6 يونيو 2026.

مستخدمو REST API

أضِف العنوان Api-Revision: 2026-05-20 إلى طلباتك للاستفادة من المخطط الجديد الآن. بعد 20 أيار (مايو)، سيصبح المخطط الجديد هو المخطط التلقائي لجميع الطلبات. يمكنك إيقافها مؤقتًا باستخدام Api-Revision: 2026-05-06 حتى 6 يونيو، وهو الموعد الذي ستزيل فيه واجهة برمجة التطبيقات المخطط القديم نهائيًا.

المخطط الزمني

التاريخ المرحلة مستخدمو حزمة تطوير البرامج (SDK) مستخدمو REST API
‫6 مايو اشتراك يتوفّر إصدار رئيسي جديد من حزمة تطوير البرامج (Python ≥2.0.0 وJS ≥2.0.0). يمكنك الترقية للحصول على المخطط الجديد تلقائيًا. أضِف العنوان Api-Revision: 2026-05-20 للموافقة على المشاركة. يبقى الإعداد التلقائي هو الإصدار القديم.
‫20 مايو الانعكاس التلقائي ليس عليك اتّخاذ أي إجراء إذا سبق لك الترقية. لا تزال حِزم تطوير البرامج (SDK) القديمة (Python 1.x.x وJS 1.x.x) تعمل ولكنها تعرض ردودًا قديمة. أصبح المخطط الجديد هو المخطط التلقائي. أرسِل عنوان Api-Revision: 2026-05-06 لإيقاف هذه الميزة.
6 يونيو الغروب لن تعمل إصدارات حزمة تطوير البرامج (SDK) 1.x.x للغة Python وJavaScript مع طلبات البيانات من واجهة Interactions API. تمت إزالة المخطط القديم لواجهة برمجة التطبيقات Interactions API. تم تجاهل العنوان Api-Revision.

قائمة التحقق من الترحيل

مخطط الخطوات (steps)

  • عدِّل الرمز البرمجي لقراءة محتوى الردّ من مصفوفة steps بدلاً من outputs. الاطّلاع على أمثلة
  • تأكَّد من أنّ الرمز البرمجي يعالج نوعَي الخطوات user_input وmodel_output. الاطّلاع على أمثلة
  • (استدعاء الدوال) تعديل الرمز البرمجي للعثور على function_call خطوة في مصفوفة steps الاطّلاع على أمثلة
  • (الأدوات من جهة الخادم) عدِّل الرمز البرمجي للتعامل مع الخطوات الخاصة بالأداة (مثل google_search_call وgoogle_search_result). الاطّلاع على الأمثلة
  • (سجلّ بدون حالة) عدِّل إدارة السجلّ لتمرير مصفوفة steps في الحقل input للطلب التالي. الاطّلاع على التفاصيل
  • (البث فقط) تعديل العميل للاستماع إلى أنواع أحداث جديدة في البث المباشر من جهة الخادم (interaction.created وstep.delta وما إلى ذلك) الاطّلاع على أمثلة

إعدادات تنسيق الإخراج (response_format)

  • استبدِل response_mime_type بحقل mime_type داخل response_format. الاطّلاع على أمثلة
  • غلِّف مخطّط response_format JSON الحالي داخل عنصر {"type": "text", "schema": ...}. الاطّلاع على أمثلة
  • (إنشاء الصور) نقل image_config من generation_config إلى إدخال {"type": "image", ...} في response_format الاطّلاع على أمثلة
  • (متعدد الوسائط) تحويل response_format من عنصر واحد إلى مصفوفة عند طلب وسائط إخراج متعددة.