v1beta ইন্টারঅ্যাকশনস এপিআই-তে কিছু বড় ধরনের পরিবর্তন আনা হচ্ছে, যা এপিআই-এর কাঠামোকে নতুন করে সাজিয়ে তুলবে। এর ফলে ভবিষ্যতে মিড-ফ্লাইট স্টিয়ারিং এবং অ্যাসিঙ্ক্রোনাস টুল কলের মতো ফিচারগুলো সাপোর্ট করা যাবে। এই পেজটিতে কী কী পরিবর্তন হচ্ছে তা ব্যাখ্যা করা হয়েছে এবং আপনাকে মাইগ্রেট করতে সাহায্য করার জন্য পরিবর্তনের আগের ও পরের কোডের উদাহরণ দেওয়া হয়েছে। পরিবর্তনগুলো দুই ধরনের:
- ধাপসমূহের কাঠামো : একটি নতুন
stepsঅ্যারেoutputsঅ্যারেটিকে প্রতিস্থাপন করে, যা প্রতিটি মিথস্ক্রিয়ার পালাক্রমের একটি সুসংগঠিত সময়রেখা প্রদান করে। - আউটপুট ফরম্যাট কনফিগারেশন : একটি নতুন পলিমরফিক
response_formatসমস্ত আউটপুট ফরম্যাট নিয়ন্ত্রণকে একত্রিত করে এবংresponse_mime_typeঅপসারণ করে।
আপনার ইন্টিগ্রেশন আপডেট করতে, নতুন স্কিমাতে কীভাবে মাইগ্রেট করবেন তার ধাপগুলো অনুসরণ করুন।
মূল পরিবর্তন: outputs steps রূপান্তর
নতুন স্কিমাটি outputs অ্যারেটিকে একটি steps অ্যারে দ্বারা প্রতিস্থাপন করে।
- লিগ্যাসি : ফেরত আসা প্রতিক্রিয়াগুলিতে একটি ফ্ল্যাট
outputsঅ্যারে থাকত, যাতে শুধুমাত্র মডেলটির তৈরি করা কন্টেন্ট থাকত। - নতুন স্কিমা : রেসপন্সগুলো একটি
steps' অ্যারে রিটার্ন করে, যাতে প্রতিধ্বনিত ইউজার ইনপুট এবং মডেল আউটপুট উভয়ই অন্তর্ভুক্ত থাকে, যা ইন্টারঅ্যাকশন টার্নের একটি সম্পূর্ণ টাইমলাইন প্রদান করে।
ইউনারি (নন-স্ট্রিমিং) রেসপন্স আপনার ইনপুটকে steps অ্যারের প্রথম ধাপ হিসেবে ফেরত পাঠায়। স্ট্রিমিং রেসপন্স ইনপুট ধাপটি এড়িয়ে যায় এবং শুধুমাত্র জেনারেটেড-কন্টেন্ট ডেল্টাগুলো নির্গত করে।
মৌলিক ইনপুট/আউটপুট (একক)
পূর্বে (উত্তরাধিকার)
পাইথন
# Request
interaction = client.interactions.create(
model="gemini-3-flash-preview", input="Tell me a joke."
)
# Response access
print(interaction.outputs[0].text)
জাভাস্ক্রিপ্ট
// 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);
বিশ্রাম
// 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?"
}
]
}
(নতুন স্কিমা) এর পরে
পাইথন
# 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
জাভাস্ক্রিপ্ট
// 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);
বিশ্রাম
// 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 বিষয়বস্তুকে কাঠামোগত ধাপ দ্বারা প্রতিস্থাপন করে।
পূর্বে (উত্তরাধিকার)
পাইথন
# Accessing function call in legacy schema
for output in interaction.outputs:
if output.type == "function_call":
print(f"Calling {output.name} with {output.arguments}")
জাভাস্ক্রিপ্ট
// 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)}`);
}
}
বিশ্রাম
// 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" }
}
]
}
(নতুন স্কিমা) এর পরে
পাইথন
# 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}")
জাভাস্ক্রিপ্ট
// 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)}`);
}
}
বিশ্রাম
// 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" }
}
]
}
সার্ভার-সাইড টুলস
সার্ভার-সাইড টুলগুলো (যেমন গুগল সার্চ বা কোড এক্সিকিউশন) এখন steps অ্যারেতে নির্দিষ্ট স্টেপ টাইপগুলো প্রদান করে। পুরোনো স্কিমা এই অপারেশনগুলোকে outputs অ্যারের মধ্যে নির্দিষ্ট কন্টেন্ট টাইপ হিসেবে দেখালেও, নতুন স্কিমা সেগুলোকে steps অ্যারেতে স্থানান্তর করেছে। নিচের উদাহরণটিতে গুগল সার্চ ব্যবহার করা হয়েছে।
পূর্বে (উত্তরাধিকার)
পাইথন
# 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}")
জাভাস্ক্রিপ্ট
// 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}`);
}
}
বিশ্রাম
// 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"
}
(নতুন স্কিমা) এর পরে
পাইথন
# 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}")
জাভাস্ক্রিপ্ট
// 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}`);
}
}
বিশ্রাম
// 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.complete→interaction.status_updatewithstatus: "completed" -
error→interaction.status_update,status: "error" -
interaction.status_update→interaction.status_update(অপরিবর্তিত, কিন্তু এখন অতিরিক্ত স্টেটগুলোও অন্তর্ভুক্ত)
স্ট্রিমিং ফাংশন কল : যখন আপনি ফাংশন কলিংয়ের সাথে স্ট্রিমিং ব্যবহার করেন, তখন step.start ইভেন্টটি ফাংশনের নাম সরবরাহ করে এবং step.delta ইভেন্টগুলো আর্গুমেন্টগুলোকে আংশিক JSON স্ট্রিং হিসেবে ( arguments_delta ব্যবহার করে) স্ট্রিম করে। সম্পূর্ণ আর্গুমেন্টগুলো পেতে আপনাকে এই ডেল্টাগুলো জমা করতে হবে। এটি ইউনিটারি কল থেকে ভিন্ন, যেখানে আপনি সম্পূর্ণ ফাংশন কল অবজেক্টটি একবারে পেয়ে যান।
উদাহরণ
পূর্বে (উত্তরাধিকার)
পাইথন
# 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)
জাভাস্ক্রিপ্ট
// 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);
}
}
}
বিশ্রাম
// 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}}
(নতুন স্কিমা) পরে
পাইথন
# 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="")
জাভাস্ক্রিপ্ট
// 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);
}
}
}
বিশ্রাম
// 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 পরিবর্তন
আপডেট করা API সমস্ত আউটপুট ফরম্যাট নিয়ন্ত্রণকে একটি একীভূত, পলিমরফিক response_format ফিল্ডে একত্রিত করে। এটি আউটপুট কনফিগারেশনকে শীর্ষ স্তরে কেন্দ্রীভূত করে এবং generation_config মডেলের আচরণের (যেমন তাপমাত্রা, top_p, এবং thinking) উপর দৃষ্টি নিবদ্ধ রাখে।
মূল পরিবর্তনগুলি
- এপিআইটি
response_mime_typeসরিয়ে দিয়েছে। এখন থেকেresponse_formatভেতরে প্রতিটি ফরম্যাট এন্ট্রির জন্য MIME টাইপ নির্দিষ্ট করতে হবে। -
response_formatএখন একটি পলিমরফিক অবজেক্ট (বা অ্যারে)। প্রতিটি এন্ট্রির একটিtypeডিসক্রিমিনেটর (text,audio,image) এবং টাইপ-নির্দিষ্ট ফিল্ড রয়েছে। একাধিক আউটপুট মোডালিটির অনুরোধ করতে, ফরম্যাট এন্ট্রিগুলোর একটি অ্যারে পাস করুন। -
image_configgeneration_configথেকেresponse_formatএ স্থানান্তরিত হয়েছে। এখন থেকে আপনিresponse_formatএন্ট্রিতে"type": "image"ব্যবহার করেaspect_ratioএবংimage_sizeএর মতো ইমেজ আউটপুট সেটিংস নির্দিষ্ট করতে পারবেন।
কাঠামোগত আউটপুট (JSON)
নতুন স্কিমা থেকে response_mime_type ফিল্ডটি সরিয়ে দেওয়া হয়েছে। এর পরিবর্তে, response_format অবজেক্টের ভিতরে "type": "text" ব্যবহার করে MIME টাইপ এবং JSON স্কিমা নির্দিষ্ট করুন।
পূর্বে (উত্তরাধিকার)
পাইথন
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)
জাভাস্ক্রিপ্ট
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);
বিশ্রাম
// 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" }
}
}
}
(নতুন স্কিমা) এর পরে
পাইথন
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)
জাভাস্ক্রিপ্ট
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);
বিশ্রাম
// 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" ব্যবহার করে ইমেজ আউটপুট সেটিংস নির্দিষ্ট করতে হবে।
পূর্বে (উত্তরাধিকার)
পাইথন
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"
}
},
)
জাভাস্ক্রিপ্ট
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'
}
},
});
বিশ্রাম
// 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"
}
}
}
(নতুন স্কিমা) এর পরে
পাইথন
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"
},
)
জাভাস্ক্রিপ্ট
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'
},
});
বিশ্রাম
// 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) ৬ জুন, ২০২৬ তারিখে লিগ্যাসি স্কিমাটি অপসারণ না করা পর্যন্ত কাজ করতে থাকবে।
REST API ব্যবহারকারীরা
এখনই নতুন স্কিমাটি গ্রহণ করতে আপনার অনুরোধগুলিতে Api-Revision: 2026-05-20 হেডারটি যোগ করুন। ২০শে মে-র পর, নতুন স্কিমাটি সমস্ত অনুরোধের জন্য ডিফল্ট হয়ে যাবে। আপনি ৬ই জুন পর্যন্ত Api-Revision: 2026-05-06 ব্যবহার করে সাময়িকভাবে এটি থেকে বেরিয়ে আসতে পারবেন, এরপর এপিআই স্থায়ীভাবে পুরোনো স্কিমাটি সরিয়ে ফেলবে।
সময়রেখা
| তারিখ | পর্যায় | এসডিকে ব্যবহারকারীরা | REST API ব্যবহারকারীরা |
|---|---|---|---|
| ৬ মে | অপ্ট ইন | নতুন প্রধান SDK সংস্করণ উপলব্ধ (Python ≥2.0.0, JS ≥2.0.0)। নতুন স্কিমা স্বয়ংক্রিয়ভাবে পেতে আপগ্রেড করুন। | অংশগ্রহণ করতে Api-Revision: 2026-05-20 হেডারটি যোগ করুন। ডিফল্ট হিসেবে লিগ্যাসিই থাকবে। |
| ২০ মে | ডিফল্ট ফ্লিপ | ইতিমধ্যে আপগ্রেড করা থাকলে কোনো পদক্ষেপের প্রয়োজন নেই। পুরোনো SDK-গুলো (Python 1.xx, JS 1.xx) এখনও কাজ করে, কিন্তু লিগ্যাসি রেসপন্স ফেরত দেয়। | নতুন স্কিমা এখন ডিফল্ট। এটি থেকে বেরিয়ে আসতে Api-Revision: 2026-05-06 হেডারটি পাঠান। |
| ৬ জুন | সূর্যাস্ত | পাইথন এবং জেএস-এর 1.xx SDK সংস্করণগুলো ইন্টারঅ্যাকশন এপিআই কলের ক্ষেত্রে কাজ করবে না। | ইন্টারঅ্যাকশনস এপিআই-এর জন্য লিগ্যাসি স্কিমা সরানো হয়েছে। Api-Revision হেডার উপেক্ষা করা হয়েছে। |
অভিবাসন চেকলিস্ট
ধাপসমূহের পরিকল্পনা ( steps )
-
outputsএর পরিবর্তেstepsঅ্যারে থেকে রেসপন্স কন্টেন্ট পড়ার জন্য কোডটি আপডেট করুন। উদাহরণগুলো দেখুন । - আপনার কোড
user_inputএবংmodel_outputউভয় ধরনের ধাপই পরিচালনা করতে পারে কিনা তা যাচাই করুন। উদাহরণ দেখুন । - (ফাংশন কলিং)
stepsঅ্যারে থেকেfunction_callধাপগুলো খুঁজে বের করার জন্য কোডটি আপডেট করুন। উদাহরণ দেখুন .. - (সার্ভার-সাইড টুলস) টুল-নির্দিষ্ট ধাপগুলো (যেমন,
google_search_call,google_search_result) পরিচালনা করার জন্য কোড আপডেট করুন। উদাহরণ দেখুন । - (স্টেটলেস হিস্ট্রি) পরবর্তী রিকোয়েস্টের
inputফিল্ডেstepsঅ্যারেটি পাস করার জন্য হিস্ট্রি ম্যানেজমেন্ট আপডেট করুন। বিস্তারিত দেখুন । - (শুধুমাত্র স্ট্রিমিংয়ের জন্য) নতুন SSE ইভেন্টের ধরনগুলো (
interaction.created,step.delta, ইত্যাদি) শোনার জন্য ক্লায়েন্টকে আপডেট করুন। উদাহরণ দেখুন ।
আউটপুট ফরম্যাট কনফিগারেশন ( response_format )
-
response_formatভিতরে থাকা একটিmime_typeফিল্ড দিয়েresponse_mime_typeপ্রতিস্থাপন করুন। উদাহরণ দেখুন । - আপনার বিদ্যমান
response_formatJSON স্কিমাটিকে একটি{"type": "text", "schema": ...}অবজেক্টের মধ্যে রাখুন। উদাহরণ দেখুন । - (ইমেজ তৈরি)
generation_configথেকেimage_configresponse_formatএকটি{"type": "image", ...}এন্ট্রিতে স্থানান্তর করুন। উদাহরণ দেখুন । - (মাল্টিমোডাল) একাধিক আউটপুট মোডালিটির অনুরোধ করার সময়
response_formatএকটি একক অবজেক্ট থেকে অ্যারেতে রূপান্তর করুন।