ব্যাচ API

জেমিনি ব্যাচ এপিআই বিপুল সংখ্যক অনুরোধ অ্যাসিঙ্ক্রোনাসভাবে স্ট্যান্ডার্ড খরচের ৫০% খরচে প্রসেস করার জন্য ডিজাইন করা হয়েছে। এর লক্ষ্যমাত্রা টার্নঅ্যারাউন্ড টাইম হলো ২৪ ঘণ্টা, কিন্তু বেশিরভাগ ক্ষেত্রেই এটি তার চেয়ে অনেক দ্রুত সম্পন্ন হয়।

ডেটা প্রি-প্রসেসিং বা মূল্যায়ন চালানোর মতো বড় আকারের ও জরুরি নয় এমন কাজের জন্য ব্যাচ এপিআই ব্যবহার করুন, যেখানে তাৎক্ষণিক প্রতিক্রিয়ার প্রয়োজন নেই।

ব্যাচ জব তৈরি করা

ব্যাচ এপিআই-তে আপনার অনুরোধ জমা দেওয়ার দুটি উপায় রয়েছে:

  • ইনলাইন রিকোয়েস্ট : আপনার ব্যাচ তৈরির রিকোয়েস্টে সরাসরি অন্তর্ভুক্ত GenerateContentRequest অবজেক্টের একটি তালিকা। এটি ছোট ব্যাচের জন্য উপযুক্ত, যা মোট রিকোয়েস্ট সাইজ ২০ মেগাবাইটের নিচে রাখে। মডেল থেকে ফেরত আসা আউটপুটটি হলো inlineResponse অবজেক্টের একটি তালিকা।
  • ইনপুট ফাইল : একটি JSON Lines (JSONL) ফাইল, যার প্রতিটি লাইনে একটি সম্পূর্ণ GenerateContentRequest অবজেক্ট থাকে। বড় আকারের অনুরোধের জন্য এই পদ্ধতিটি সুপারিশ করা হয়। মডেল থেকে ফেরত আসা আউটপুটটি একটি JSONL ফাইল, যার প্রতিটি লাইন হয় একটি GenerateContentResponse অথবা একটি status অবজেক্ট।

ইনলাইন অনুরোধ

অল্প সংখ্যক অনুরোধের জন্য, আপনি সরাসরি আপনার BatchGenerateContentRequest মধ্যে GenerateContentRequest অবজেক্টগুলো এম্বেড করতে পারেন। নিম্নলিখিত উদাহরণটি ইনলাইন অনুরোধ সহ BatchGenerateContent পদ্ধতিটিকে কল করে:

পাইথন


from google import genai
from google.genai import types

client = genai.Client()

# A list of dictionaries, where each is a GenerateContentRequest
inline_requests = [
    {
        'contents': [{
            'parts': [{'text': 'Tell me a one-sentence joke.'}],
            'role': 'user'
        }]
    },
    {
        'contents': [{
            'parts': [{'text': 'Why is the sky blue?'}],
            'role': 'user'
        }]
    }
]

inline_batch_job = client.batches.create(
    model="gemini-3-flash-preview",
    src=inline_requests,
    config={
        'display_name': "inlined-requests-job-1",
    },
)

print(f"Created batch job: {inline_batch_job.name}")

জাভাস্ক্রিপ্ট


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

const ai = new GoogleGenAI({});

const inlinedRequests = [
    {
        contents: [{
            parts: [{text: 'Tell me a one-sentence joke.'}],
            role: 'user'
        }]
    },
    {
        contents: [{
            parts: [{'text': 'Why is the sky blue?'}],
            role: 'user'
        }]
    }
]

const response = await ai.batches.create({
    model: 'gemini-3-flash-preview',
    src: inlinedRequests,
    config: {
        displayName: 'inlined-requests-job-1',
    }
});

console.log(response);

বিশ্রাম

curl https://generativelanguage.googleapis.com/v1beta/models/gemini-3-flash-preview:batchGenerateContent \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-X POST \
-H "Content-Type:application/json" \
-d '{
    "batch": {
        "display_name": "my-batch-requests",
        "input_config": {
            "requests": {
                "requests": [
                    {
                        "request": {"contents": [{"parts": [{"text": "Describe the process of photosynthesis."}]}]},
                        "metadata": {
                            "key": "request-1"
                        }
                    },
                    {
                        "request": {"contents": [{"parts": [{"text": "Describe the process of photosynthesis."}]}]},
                        "metadata": {
                            "key": "request-2"
                        }
                    }
                ]
            }
        }
    }
}'

ইনপুট ফাইল

অধিক সংখ্যক অনুরোধের জন্য, একটি JSON Lines (JSONL) ফাইল প্রস্তুত করুন। এই ফাইলের প্রতিটি লাইন অবশ্যই একটি JSON অবজেক্ট হতে হবে, যাতে একটি ব্যবহারকারী-সংজ্ঞায়িত কী (key) এবং একটি রিকোয়েস্ট অবজেক্ট থাকবে, যেখানে রিকোয়েস্টটি একটি বৈধ GenerateContentRequest অবজেক্ট। কোন অনুরোধের ফলে কোন আউটপুটটি এসেছে, তা নির্দেশ করার জন্য রেসপন্সে ব্যবহারকারী-সংজ্ঞায়িত কী-টি ব্যবহৃত হয়। উদাহরণস্বরূপ, request-1 কী-সহ অনুরোধটির রেসপন্সেও একই কী-এর নাম দিয়ে টীকা দেওয়া হবে।

এই ফাইলটি ফাইল এপিআই (File API) ব্যবহার করে আপলোড করা হয়েছে। ইনপুট ফাইলের জন্য সর্বোচ্চ অনুমোদিত ফাইলের আকার হলো ২ জিবি।

নিচে একটি JSONL ফাইলের উদাহরণ দেওয়া হলো। আপনি এটি my-batch-requests.json নামের একটি ফাইলে সংরক্ষণ করতে পারেন:

{"key": "request-1", "request": {"contents": [{"parts": [{"text": "Describe the process of photosynthesis."}]}], "generation_config": {"temperature": 0.7}}}
{"key": "request-2", "request": {"contents": [{"parts": [{"text": "What are the main ingredients in a Margherita pizza?"}]}]}}

ইনলাইন অনুরোধের মতোই, আপনি প্রতিটি অনুরোধের JSON-এ সিস্টেম নির্দেশাবলী, টুলস বা অন্যান্য কনফিগারেশনের মতো অন্যান্য প্যারামিটার নির্দিষ্ট করতে পারেন।

নিচের উদাহরণে দেখানো পদ্ধতি অনুযায়ী আপনি ফাইল এপিআই (File API) ব্যবহার করে এই ফাইলটি আপলোড করতে পারেন। আপনি যদি মাল্টিমোডাল ইনপুট (multimodal input) নিয়ে কাজ করেন, তাহলে আপনার JSONL ফাইলের মধ্যে অন্যান্য আপলোড করা ফাইলগুলোর রেফারেন্স দিতে পারেন।

পাইথন


import json
from google import genai
from google.genai import types

client = genai.Client()

# Create a sample JSONL file
with open("my-batch-requests.jsonl", "w") as f:
    requests = [
        {"key": "request-1", "request": {"contents": [{"parts": [{"text": "Describe the process of photosynthesis."}]}]}},
        {"key": "request-2", "request": {"contents": [{"parts": [{"text": "What are the main ingredients in a Margherita pizza?"}]}]}}
    ]
    for req in requests:
        f.write(json.dumps(req) + "\n")

# Upload the file to the File API
uploaded_file = client.files.upload(
    file='my-batch-requests.jsonl',
    config=types.UploadFileConfig(display_name='my-batch-requests', mime_type='jsonl')
)

print(f"Uploaded file: {uploaded_file.name}")

জাভাস্ক্রিপ্ট


import {GoogleGenAI} from '@google/genai';
import * as fs from "fs";
import * as path from "path";
import { fileURLToPath } from 'url';

const ai = new GoogleGenAI({});
const fileName = "my-batch-requests.jsonl";

// Define the requests
const requests = [
    { "key": "request-1", "request": { "contents": [{ "parts": [{ "text": "Describe the process of photosynthesis." }] }] } },
    { "key": "request-2", "request": { "contents": [{ "parts": [{ "text": "What are the main ingredients in a Margherita pizza?" }] }] } }
];

// Construct the full path to file
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const filePath = path.join(__dirname, fileName); // __dirname is the directory of the current script

async function writeBatchRequestsToFile(requests, filePath) {
    try {
        // Use a writable stream for efficiency, especially with larger files.
        const writeStream = fs.createWriteStream(filePath, { flags: 'w' });

        writeStream.on('error', (err) => {
            console.error(`Error writing to file ${filePath}:`, err);
        });

        for (const req of requests) {
            writeStream.write(JSON.stringify(req) + '\n');
        }

        writeStream.end();

        console.log(`Successfully wrote batch requests to ${filePath}`);

    } catch (error) {
        // This catch block is for errors that might occur before stream setup,
        // stream errors are handled by the 'error' event.
        console.error(`An unexpected error occurred:`, error);
    }
}

// Write to a file.
writeBatchRequestsToFile(requests, filePath);

// Upload the file to the File API.
const uploadedFile = await ai.files.upload({file: 'my-batch-requests.jsonl', config: {
    mimeType: 'jsonl',
}});
console.log(uploadedFile.name);

বিশ্রাম

tmp_batch_input_file=batch_input.tmp
echo -e '{"contents": [{"parts": [{"text": "Describe the process of photosynthesis."}]}], "generationConfig": {"temperature": 0.7}}\n{"contents": [{"parts": [{"text": "What are the main ingredients in a Margherita pizza?"}]}]}' > batch_input.tmp
MIME_TYPE=$(file -b --mime-type "${tmp_batch_input_file}")
NUM_BYTES=$(wc -c < "${tmp_batch_input_file}")
DISPLAY_NAME=BatchInput

tmp_header_file=upload-header.tmp

# Initial resumable request defining metadata.
# The upload url is in the response headers dump them to a file.
curl "https://generativelanguage.googleapis.com/upload/v1beta/files" \
-D "${tmp_header_file}" \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-H "X-Goog-Upload-Protocol: resumable" \
-H "X-Goog-Upload-Command: start" \
-H "X-Goog-Upload-Header-Content-Length: ${NUM_BYTES}" \
-H "X-Goog-Upload-Header-Content-Type: ${MIME_TYPE}" \
-H "Content-Type: application/jsonl" \
-d "{'file': {'display_name': '${DISPLAY_NAME}'}}" 2> /dev/null

upload_url=$(grep -i "x-goog-upload-url: " "${tmp_header_file}" | cut -d" " -f2 | tr -d "\r")
rm "${tmp_header_file}"

# Upload the actual bytes.
curl "${upload_url}" \
-H "Content-Length: ${NUM_BYTES}" \
-H "X-Goog-Upload-Offset: 0" \
-H "X-Goog-Upload-Command: upload, finalize" \
--data-binary "@${tmp_batch_input_file}" 2> /dev/null > file_info.json

file_uri=$(jq ".file.uri" file_info.json)

নিম্নলিখিত উদাহরণটি ফাইল এপিআই (File API) ব্যবহার করে আপলোড করা ইনপুট ফাইল দিয়ে BatchGenerateContent মেথডটিকে কল করে:

পাইথন

from google import genai

# Assumes `uploaded_file` is the file object from the previous step
client = genai.Client()
file_batch_job = client.batches.create(
    model="gemini-3-flash-preview",
    src=uploaded_file.name,
    config={
        'display_name': "file-upload-job-1",
    },
)

print(f"Created batch job: {file_batch_job.name}")

জাভাস্ক্রিপ্ট

// Assumes `uploadedFile` is the file object from the previous step
const fileBatchJob = await ai.batches.create({
    model: 'gemini-3-flash-preview',
    src: uploadedFile.name,
    config: {
        displayName: 'file-upload-job-1',
    }
});

console.log(fileBatchJob);

বিশ্রাম

# Set the File ID taken from the upload response.
BATCH_INPUT_FILE='files/123456'
curl https://generativelanguage.googleapis.com/v1beta/models/gemini-3-flash-preview:batchGenerateContent \
-X POST \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-H "Content-Type:application/json" \
-d "{
    'batch': {
        'display_name': 'my-batch-requests',
        'input_config': {
            'file_name': '${BATCH_INPUT_FILE}'
        }
    }
}"

যখন আপনি একটি ব্যাচ জব তৈরি করবেন, তখন আপনাকে একটি জবের নাম দেখানো হবে। জবের অবস্থা পর্যবেক্ষণ করতে এবং জবটি সম্পন্ন হলে এর ফলাফল সংগ্রহ করতে এই নামটি ব্যবহার করুন।

নিম্নলিখিতটি একটি উদাহরণ আউটপুট, যাতে একটি কাজের নাম রয়েছে:


Created batch job from file: batches/123456789

ব্যাচ এম্বেডিং সমর্থন

উচ্চতর থ্রুপুটের জন্য আপনি এমবেডিংস মডেলের সাথে ইন্টারঅ্যাক্ট করতে ব্যাচ এপিআই ব্যবহার করতে পারেন। ইনলাইন রিকোয়েস্ট অথবা ইনপুট ফাইল সহ একটি এমবেডিংস ব্যাচ জব তৈরি করতে, batches.create_embeddings এপিআই ব্যবহার করুন এবং এমবেডিংস মডেলটি নির্দিষ্ট করে দিন।

পাইথন

from google import genai

client = genai.Client()

# Creating an embeddings batch job with an input file request:
file_job = client.batches.create_embeddings(
    model="gemini-embedding-001",
    src={'file_name': uploaded_batch_requests.name},
    config={'display_name': "Input embeddings batch"},
)

# Creating an embeddings batch job with an inline request:
batch_job = client.batches.create_embeddings(
    model="gemini-embedding-001",
    # For a predefined list of requests `inlined_requests`
    src={'inlined_requests': inlined_requests},
    config={'display_name': "Inlined embeddings batch"},
)

জাভাস্ক্রিপ্ট

// Creating an embeddings batch job with an input file request:
let fileJob;
fileJob = await client.batches.createEmbeddings({
    model: 'gemini-embedding-001',
    src: {fileName: uploadedBatchRequests.name},
    config: {displayName: 'Input embeddings batch'},
});
console.log(`Created batch job: ${fileJob.name}`);

// Creating an embeddings batch job with an inline request:
let batchJob;
batchJob = await client.batches.createEmbeddings({
    model: 'gemini-embedding-001',
    // For a predefined a list of requests `inlinedRequests`
    src: {inlinedRequests: inlinedRequests},
    config: {displayName: 'Inlined embeddings batch'},
});
console.log(`Created batch job: ${batchJob.name}`);

আরও উদাহরণের জন্য ব্যাচ এপিআই কুকবুকের এমবেডিংস বিভাগটি পড়ুন।

কনফিগারেশন অনুরোধ করুন

আপনি একটি সাধারণ নন-ব্যাচ অনুরোধে ব্যবহৃত যেকোনো অনুরোধ কনফিগারেশন অন্তর্ভুক্ত করতে পারেন। উদাহরণস্বরূপ, আপনি তাপমাত্রা, সিস্টেম নির্দেশাবলী নির্দিষ্ট করতে পারেন বা এমনকি অন্যান্য মোডালিটিও পাস করতে পারেন। নিম্নলিখিত উদাহরণটি একটি ইনলাইন অনুরোধের নমুনা দেখায়, যেখানে অনুরোধগুলির মধ্যে একটির জন্য একটি সিস্টেম নির্দেশাবলী রয়েছে:

পাইথন

inline_requests_list = [
    {'contents': [{'parts': [{'text': 'Write a short poem about a cloud.'}]}]},
    {'contents': [{
        'parts': [{
            'text': 'Write a short poem about a cat.'
            }]
        }],
    'config': {
        'system_instruction': {'parts': [{'text': 'You are a cat. Your name is Neko.'}]}}
    }
]

জাভাস্ক্রিপ্ট

inlineRequestsList = [
    {contents: [{parts: [{text: 'Write a short poem about a cloud.'}]}]},
    {contents: [{parts: [{text: 'Write a short poem about a cat.'}]}],
     config: {systemInstruction: {parts: [{text: 'You are a cat. Your name is Neko.'}]}}}
]

একইভাবে, কোনো অনুরোধের জন্য কোন টুল ব্যবহার করা হবে তা নির্দিষ্ট করে দেওয়া যায়। নিচের উদাহরণটিতে এমন একটি অনুরোধ দেখানো হয়েছে যা গুগল সার্চ টুলটি সক্রিয় করে:

পাইথন

inlined_requests = [
{'contents': [{'parts': [{'text': 'Who won the euro 1998?'}]}]},
{'contents': [{'parts': [{'text': 'Who won the euro 2025?'}]}],
 'config':{'tools': [{'google_search': {}}]}}]

জাভাস্ক্রিপ্ট

inlineRequestsList = [
    {contents: [{parts: [{text: 'Who won the euro 1998?'}]}]},
    {contents: [{parts: [{text: 'Who won the euro 2025?'}]}],
     config: {tools: [{googleSearch: {}}]}}
]

আপনি কাঠামোগত আউটপুটও নির্দিষ্ট করতে পারেন। নিম্নলিখিত উদাহরণটি দেখায় যে কীভাবে আপনার ব্যাচ অনুরোধগুলির জন্য এটি নির্দিষ্ট করতে হয়।

পাইথন

import time
from google import genai
from pydantic import BaseModel, TypeAdapter

class Recipe(BaseModel):
    recipe_name: str
    ingredients: list[str]

client = genai.Client()

# A list of dictionaries, where each is a GenerateContentRequest
inline_requests = [
    {
        'contents': [{
            'parts': [{'text': 'List a few popular cookie recipes, and include the amounts of ingredients.'}],
            'role': 'user'
        }],
        'config': {
            'response_mime_type': 'application/json',
            'response_schema': list[Recipe]
        }
    },
    {
        'contents': [{
            'parts': [{'text': 'List a few popular gluten free cookie recipes, and include the amounts of ingredients.'}],
            'role': 'user'
        }],
        'config': {
            'response_mime_type': 'application/json',
            'response_schema': list[Recipe]
        }
    }
]

inline_batch_job = client.batches.create(
    model="gemini-3-flash-preview",
    src=inline_requests,
    config={
        'display_name': "structured-output-job-1"
    },
)

# wait for the job to finish
job_name = inline_batch_job.name
print(f"Polling status for job: {job_name}")

while True:
    batch_job_inline = client.batches.get(name=job_name)
    if batch_job_inline.state.name in ('JOB_STATE_SUCCEEDED', 'JOB_STATE_FAILED', 'JOB_STATE_CANCELLED', 'JOB_STATE_EXPIRED'):
        break
    print(f"Job not finished. Current state: {batch_job_inline.state.name}. Waiting 30 seconds...")
    time.sleep(30)

print(f"Job finished with state: {batch_job_inline.state.name}")

# print the response
for i, inline_response in enumerate(batch_job_inline.dest.inlined_responses, start=1):
    print(f"\n--- Response {i} ---")

    # Check for a successful response
    if inline_response.response:
        # The .text property is a shortcut to the generated text.
        print(inline_response.response.text)

জাভাস্ক্রিপ্ট


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

const ai = new GoogleGenAI({});

const inlinedRequests = [
    {
        contents: [{
            parts: [{text: 'List a few popular cookie recipes, and include the amounts of ingredients.'}],
            role: 'user'
        }],
        config: {
            responseMimeType: 'application/json',
            responseSchema: {
            type: Type.ARRAY,
            items: {
                type: Type.OBJECT,
                properties: {
                'recipeName': {
                    type: Type.STRING,
                    description: 'Name of the recipe',
                    nullable: false,
                },
                'ingredients': {
                    type: Type.ARRAY,
                    items: {
                    type: Type.STRING,
                    description: 'Ingredients of the recipe',
                    nullable: false,
                    },
                },
                },
                required: ['recipeName'],
            },
            },
        }
    },
    {
        contents: [{
            parts: [{text: 'List a few popular gluten free cookie recipes, and include the amounts of ingredients.'}],
            role: 'user'
        }],
        config: {
            responseMimeType: 'application/json',
            responseSchema: {
            type: Type.ARRAY,
            items: {
                type: Type.OBJECT,
                properties: {
                'recipeName': {
                    type: Type.STRING,
                    description: 'Name of the recipe',
                    nullable: false,
                },
                'ingredients': {
                    type: Type.ARRAY,
                    items: {
                    type: Type.STRING,
                    description: 'Ingredients of the recipe',
                    nullable: false,
                    },
                },
                },
                required: ['recipeName'],
            },
            },
        }
    }
]

const inlinedBatchJob = await ai.batches.create({
    model: 'gemini-3-flash-preview',
    src: inlinedRequests,
    config: {
        displayName: 'inlined-requests-job-1',
    }
});

নিচে এই কাজটি থেকে প্রাপ্ত একটি আউটপুটের উদাহরণ দেখানো হলো:

--- Response 1 ---
[
  {
    "recipe_name": "Chocolate Chip Cookies",
    "ingredients": [
      "1 cup (2 sticks) unsalted butter, softened",
      "3/4 cup granulated sugar",
      "3/4 cup packed light brown sugar",
      "1 large egg",
      "1 teaspoon vanilla extract",
      "2 1/4 cups all-purpose flour",
      "1 teaspoon baking soda",
      "1/2 teaspoon salt",
      "1 1/2 cups chocolate chips"
    ]
  },
  {
    "recipe_name": "Oatmeal Raisin Cookies",
    "ingredients": [
      "1 cup (2 sticks) unsalted butter, softened",
      "1 cup packed light brown sugar",
      "1/2 cup granulated sugar",
      "2 large eggs",
      "1 teaspoon vanilla extract",
      "1 1/2 cups all-purpose flour",
      "1 teaspoon baking soda",
      "1 teaspoon ground cinnamon",
      "1/2 teaspoon salt",
      "3 cups old-fashioned rolled oats",
      "1 cup raisins"
    ]
  },
  {
    "recipe_name": "Sugar Cookies",
    "ingredients": [
      "1 cup (2 sticks) unsalted butter, softened",
      "1 1/2 cups granulated sugar",
      "1 large egg",
      "1 teaspoon vanilla extract",
      "2 3/4 cups all-purpose flour",
      "1 teaspoon baking powder",
      "1/2 teaspoon salt"
    ]
  }
]

--- Response 2 ---
[
  {
    "recipe_name": "Gluten-Free Chocolate Chip Cookies",
    "ingredients": [
      "1 cup (2 sticks) unsalted butter, softened",
      "3/4 cup granulated sugar",
      "3/4 cup packed light brown sugar",
      "2 large eggs",
      "1 teaspoon vanilla extract",
      "2 1/4 cups gluten-free all-purpose flour blend (with xanthan gum)",
      "1 teaspoon baking soda",
      "1/2 teaspoon salt",
      "1 1/2 cups chocolate chips"
    ]
  },
  {
    "recipe_name": "Gluten-Free Peanut Butter Cookies",
    "ingredients": [
      "1 cup (250g) creamy peanut butter",
      "1/2 cup (100g) granulated sugar",
      "1/2 cup (100g) packed light brown sugar",
      "1 large egg",
      "1 teaspoon vanilla extract",
      "1/2 teaspoon baking soda",
      "1/4 teaspoon salt"
    ]
  },
  {
    "recipe_name": "Gluten-Free Oatmeal Raisin Cookies",
    "ingredients": [
      "1/2 cup (1 stick) unsalted butter, softened",
      "1/2 cup granulated sugar",
      "1/2 cup packed light brown sugar",
      "1 large egg",
      "1 teaspoon vanilla extract",
      "1 cup gluten-free all-purpose flour blend",
      "1/2 teaspoon baking soda",
      "1/2 teaspoon ground cinnamon",
      "1/4 teaspoon salt",
      "1 1/2 cups gluten-free rolled oats",
      "1/2 cup raisins"
    ]
  }
]

কাজের অবস্থা পর্যবেক্ষণ

ব্যাচ জবটি তৈরি করার সময় প্রাপ্ত অপারেশন নামটি ব্যবহার করে এর অবস্থা জানুন। ব্যাচ জবটির 'state' ফিল্ডটি এর বর্তমান অবস্থা নির্দেশ করবে। একটি ব্যাচ জব নিম্নলিখিত অবস্থাগুলোর মধ্যে যেকোনো একটিতে থাকতে পারে:

  • JOB_STATE_PENDING : জবটি তৈরি করা হয়েছে এবং সার্ভিস দ্বারা প্রসেস হওয়ার জন্য অপেক্ষা করছে।
  • JOB_STATE_RUNNING : কাজটি চলমান আছে।
  • কাজটি JOB_STATE_SUCCEEDED সম্পন্ন হয়েছে। এখন আপনি ফলাফল সংগ্রহ করতে পারেন।
  • JOB_STATE_FAILED : জবটি ব্যর্থ হয়েছে। আরও তথ্যের জন্য ত্রুটির বিবরণ দেখুন।
  • JOB_STATE_CANCELLED : কাজটি ব্যবহারকারী কর্তৃক বাতিল করা হয়েছে।
  • JOB_STATE_EXPIRED : জবটি ৪৮ ঘণ্টার বেশি সময় ধরে চলমান বা পেন্ডিং থাকার কারণে এর মেয়াদ শেষ হয়ে গেছে। জবটি থেকে আর কোনো ফলাফল পাওয়া যাবে না। আপনি জবটি পুনরায় সাবমিট করার চেষ্টা করতে পারেন অথবা রিকোয়েস্টগুলোকে ছোট ছোট ব্যাচে ভাগ করে নিতে পারেন।

কাজটি সম্পন্ন হয়েছে কিনা তা পরীক্ষা করার জন্য আপনি পর্যায়ক্রমে এর অবস্থা জানতে পারেন।

পাইথন

import time
from google import genai

client = genai.Client()

# Use the name of the job you want to check
# e.g., inline_batch_job.name from the previous step
job_name = "YOUR_BATCH_JOB_NAME"  # (e.g. 'batches/your-batch-id')
batch_job = client.batches.get(name=job_name)

completed_states = set([
    'JOB_STATE_SUCCEEDED',
    'JOB_STATE_FAILED',
    'JOB_STATE_CANCELLED',
    'JOB_STATE_EXPIRED',
])

print(f"Polling status for job: {job_name}")
batch_job = client.batches.get(name=job_name) # Initial get
while batch_job.state.name not in completed_states:
  print(f"Current state: {batch_job.state.name}")
  time.sleep(30) # Wait for 30 seconds before polling again
  batch_job = client.batches.get(name=job_name)

print(f"Job finished with state: {batch_job.state.name}")
if batch_job.state.name == 'JOB_STATE_FAILED':
    print(f"Error: {batch_job.error}")

জাভাস্ক্রিপ্ট

// Use the name of the job you want to check
// e.g., inlinedBatchJob.name from the previous step
let batchJob;
const completedStates = new Set([
    'JOB_STATE_SUCCEEDED',
    'JOB_STATE_FAILED',
    'JOB_STATE_CANCELLED',
    'JOB_STATE_EXPIRED',
]);

try {
    batchJob = await ai.batches.get({name: inlinedBatchJob.name});
    while (!completedStates.has(batchJob.state)) {
        console.log(`Current state: ${batchJob.state}`);
        // Wait for 30 seconds before polling again
        await new Promise(resolve => setTimeout(resolve, 30000));
        batchJob = await client.batches.get({ name: batchJob.name });
    }
    console.log(`Job finished with state: ${batchJob.state}`);
    if (batchJob.state === 'JOB_STATE_FAILED') {
        // The exact structure of `error` might vary depending on the SDK
        // This assumes `error` is an object with a `message` property.
        console.error(`Error: ${batchJob.state}`);
    }
} catch (error) {
    console.error(`An error occurred while polling job ${batchJob.name}:`, error);
}

ফলাফল পুনরুদ্ধার করা হচ্ছে

জবের স্ট্যাটাস থেকে আপনার ব্যাচ জবটি সফল হয়েছে বলে জানা গেলে, ফলাফলগুলো response ফিল্ডে পাওয়া যাবে।

পাইথন

import json
from google import genai

client = genai.Client()

# Use the name of the job you want to check
# e.g., inline_batch_job.name from the previous step
job_name = "YOUR_BATCH_JOB_NAME"
batch_job = client.batches.get(name=job_name)

if batch_job.state.name == 'JOB_STATE_SUCCEEDED':

    # If batch job was created with a file
    if batch_job.dest and batch_job.dest.file_name:
        # Results are in a file
        result_file_name = batch_job.dest.file_name
        print(f"Results are in file: {result_file_name}")

        print("Downloading result file content...")
        file_content = client.files.download(file=result_file_name)
        # Process file_content (bytes) as needed
        print(file_content.decode('utf-8'))

    # If batch job was created with inline request
    # (for embeddings, use batch_job.dest.inlined_embed_content_responses)
    elif batch_job.dest and batch_job.dest.inlined_responses:
        # Results are inline
        print("Results are inline:")
        for i, inline_response in enumerate(batch_job.dest.inlined_responses):
            print(f"Response {i+1}:")
            if inline_response.response:
                # Accessing response, structure may vary.
                try:
                    print(inline_response.response.text)
                except AttributeError:
                    print(inline_response.response) # Fallback
            elif inline_response.error:
                print(f"Error: {inline_response.error}")
    else:
        print("No results found (neither file nor inline).")
else:
    print(f"Job did not succeed. Final state: {batch_job.state.name}")
    if batch_job.error:
        print(f"Error: {batch_job.error}")

জাভাস্ক্রিপ্ট

// Use the name of the job you want to check
// e.g., inlinedBatchJob.name from the previous step
const jobName = "YOUR_BATCH_JOB_NAME";

try {
    const batchJob = await ai.batches.get({ name: jobName });

    if (batchJob.state === 'JOB_STATE_SUCCEEDED') {
        console.log('Found completed batch:', batchJob.displayName);
        console.log(batchJob);

        // If batch job was created with a file destination
        if (batchJob.dest?.fileName) {
            const resultFileName = batchJob.dest.fileName;
            console.log(`Results are in file: ${resultFileName}`);

            console.log("Downloading result file content...");
            const fileContentBuffer = await ai.files.download({ file: resultFileName });

            // Process fileContentBuffer (Buffer) as needed
            console.log(fileContentBuffer.toString('utf-8'));
        }

        // If batch job was created with inline responses
        else if (batchJob.dest?.inlinedResponses) {
            console.log("Results are inline:");
            for (let i = 0; i < batchJob.dest.inlinedResponses.length; i++) {
                const inlineResponse = batchJob.dest.inlinedResponses[i];
                console.log(`Response ${i + 1}:`);
                if (inlineResponse.response) {
                    // Accessing response, structure may vary.
                    if (inlineResponse.response.text !== undefined) {
                        console.log(inlineResponse.response.text);
                    } else {
                        console.log(inlineResponse.response); // Fallback
                    }
                } else if (inlineResponse.error) {
                    console.error(`Error: ${inlineResponse.error}`);
                }
            }
        }

        // If batch job was an embedding batch with inline responses
        else if (batchJob.dest?.inlinedEmbedContentResponses) {
            console.log("Embedding results found inline:");
            for (let i = 0; i < batchJob.dest.inlinedEmbedContentResponses.length; i++) {
                const inlineResponse = batchJob.dest.inlinedEmbedContentResponses[i];
                console.log(`Response ${i + 1}:`);
                if (inlineResponse.response) {
                    console.log(inlineResponse.response);
                } else if (inlineResponse.error) {
                    console.error(`Error: ${inlineResponse.error}`);
                }
            }
        } else {
            console.log("No results found (neither file nor inline).");
        }
    } else {
        console.log(`Job did not succeed. Final state: ${batchJob.state}`);
        if (batchJob.error) {
            console.error(`Error: ${typeof batchJob.error === 'string' ? batchJob.error : batchJob.error.message || JSON.stringify(batchJob.error)}`);
        }
    }
} catch (error) {
    console.error(`An error occurred while processing job ${jobName}:`, error);
}

বিশ্রাম

BATCH_NAME="batches/123456" # Your batch job name

curl https://generativelanguage.googleapis.com/v1beta/$BATCH_NAME \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-H "Content-Type:application/json" 2> /dev/null > batch_status.json

if jq -r '.done' batch_status.json | grep -q "false"; then
    echo "Batch has not finished processing"
fi

batch_state=$(jq -r '.metadata.state' batch_status.json)
if [[ $batch_state = "JOB_STATE_SUCCEEDED" ]]; then
    if [[ $(jq '.response | has("inlinedResponses")' batch_status.json) = "true" ]]; then
        jq -r '.response.inlinedResponses' batch_status.json
        exit
    fi
    responses_file_name=$(jq -r '.response.responsesFile' batch_status.json)
    curl https://generativelanguage.googleapis.com/download/v1beta/$responses_file_name:download?alt=media \
    -H "x-goog-api-key: $GEMINI_API_KEY" 2> /dev/null
elif [[ $batch_state = "JOB_STATE_FAILED" ]]; then
    jq '.error' batch_status.json
elif [[ $batch_state == "JOB_STATE_CANCELLED" ]]; then
    echo "Batch was cancelled by the user"
elif [[ $batch_state == "JOB_STATE_EXPIRED" ]]; then
    echo "Batch expired after 48 hours"
fi

ব্যাচ জব তালিকাভুক্ত করা

আপনি আপনার সাম্প্রতিক ব্যাচ জবগুলোর তালিকা দেখতে পারেন।

পাইথন

batch_jobs = client.batches.list()

# Optional query config:
# batch_jobs = client.batches.list(config={'page_size': 5})

for batch_job in batch_jobs:
    print(batch_job)

জাভাস্ক্রিপ্ট

const batchJobs = await ai.batches.list();

// Optional query config:
// const batchJobs = await ai.batches.list({config: {'pageSize': 5}});

for await (const batchJob of batchJobs) {
    console.log(batchJob);
}

বিশ্রাম

curl https://generativelanguage.googleapis.com/v1beta/batches \
-H "x-goog-api-key: $GEMINI_API_KEY"

ব্যাচ জব বাতিল করা

আপনি চলমান ব্যাচ জবটির নাম ব্যবহার করে তা বাতিল করতে পারেন। কোনো জব বাতিল করা হলে, সেটি নতুন অনুরোধ প্রসেস করা বন্ধ করে দেয়।

পাইথন

client.batches.cancel(name=batch_job_to_cancel.name)

জাভাস্ক্রিপ্ট

await ai.batches.cancel({name: batchJobToCancel.name});

বিশ্রাম

BATCH_NAME="batches/123456" # Your batch job name

# Cancel the batch
curl https://generativelanguage.googleapis.com/v1beta/$BATCH_NAME:cancel \
-H "x-goog-api-key: $GEMINI_API_KEY" \

# Confirm that the status of the batch after cancellation is JOB_STATE_CANCELLED
curl https://generativelanguage.googleapis.com/v1beta/$BATCH_NAME \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-H "Content-Type:application/json" 2> /dev/null | jq -r '.metadata.state'

ব্যাচ জব মুছে ফেলা

আপনি একটি চলমান ব্যাচ জব তার নাম ব্যবহার করে মুছে ফেলতে পারেন। যখন কোনো জব মুছে ফেলা হয়, তখন সেটি নতুন অনুরোধ প্রক্রিয়া করা বন্ধ করে দেয় এবং ব্যাচ জবের তালিকা থেকে মুছে যায়।

পাইথন

client.batches.delete(name=batch_job_to_delete.name)

জাভাস্ক্রিপ্ট

await ai.batches.delete({name: batchJobToDelete.name});

বিশ্রাম

BATCH_NAME="batches/123456" # Your batch job name

# Delete the batch job
curl https://generativelanguage.googleapis.com/v1beta/$BATCH_NAME:delete \
-H "x-goog-api-key: $GEMINI_API_KEY"

ব্যাচে ছবি তৈরি করা

আপনি যদি Gemini Nano Banana ব্যবহার করেন এবং প্রচুর পরিমাণে ইমেজ তৈরি করার প্রয়োজন হয়, তাহলে আপনি Batch API ব্যবহার করে উচ্চতর রেট লিমিট পেতে পারেন, যার বিনিময়ে সর্বোচ্চ ২৪ ঘণ্টা পর্যন্ত সময় লাগতে পারে।

আপনি অল্প সংখ্যক অনুরোধের (২০ মেগাবাইটের কম) জন্য ইনলাইন রিকোয়েস্ট অথবা বেশি সংখ্যক অনুরোধের জন্য একটি JSONL ইনপুট ফাইল ব্যবহার করতে পারেন (যা ছবি তৈরির জন্য সুপারিশ করা হয়):

পাইথন

import json
import time
import base64
from google import genai
from google.genai import types
from PIL import Image

client = genai.Client()

# 1. Create and upload file
file_name = "my-batch-image-requests.jsonl"
with open(file_name, "w") as f:
    requests = [
        {"key": "request-1", "request": {"contents": [{"parts": [{"text": "A big letter A surrounded by animals starting with the A letter"}]}], "generation_config": {"responseModalities": ["TEXT", "IMAGE"]}}},
        {"key": "request-2", "request": {"contents": [{"parts": [{"text": "A big letter B surrounded by animals starting with the B letter"}]}], "generation_config": {"responseModalities": ["TEXT", "IMAGE"]}}}
    ]
    for req in requests:
        f.write(json.dumps(req) + "\n")

uploaded_file = client.files.upload(
    file=file_name,
    config=types.UploadFileConfig(display_name='my-batch-image-requests', mime_type='jsonl')
)
print(f"Uploaded file: {uploaded_file.name}")

# 2. Create batch job
file_batch_job = client.batches.create(
    model="gemini-3-pro-image-preview",
    src=uploaded_file.name,
    config={
        'display_name': "file-image-upload-job-1",
    },
)
print(f"Created batch job: {file_batch_job.name}")

# 3. Monitor job status
job_name = file_batch_job.name
print(f"Polling status for job: {job_name}")

completed_states = set([
    'JOB_STATE_SUCCEEDED',
    'JOB_STATE_FAILED',
    'JOB_STATE_CANCELLED',
    'JOB_STATE_EXPIRED',
])

batch_job = client.batches.get(name=job_name) # Initial get
while batch_job.state.name not in completed_states:
  print(f"Current state: {batch_job.state.name}")
  time.sleep(10) # Wait for 10 seconds before polling again
  batch_job = client.batches.get(name=job_name)

print(f"Job finished with state: {batch_job.state.name}")

# 4. Retrieve results
if batch_job.state.name == 'JOB_STATE_SUCCEEDED':
    result_file_name = batch_job.dest.file_name
    print(f"Results are in file: {result_file_name}")
    print("Downloading result file content...")
    file_content_bytes = client.files.download(file=result_file_name)
    file_content = file_content_bytes.decode('utf-8')
    # The result file is also a JSONL file. Parse and print each line.
    for line in file_content.splitlines():
      if line:
        parsed_response = json.loads(line)
        if 'response' in parsed_response and parsed_response['response']:
            for part in parsed_response['response']['candidates'][0]['content']['parts']:
              if part.get('text'):
                print(part['text'])
              elif part.get('inlineData'):
                print(f"Image mime type: {part['inlineData']['mimeType']}")
                data = base64.b64decode(part['inlineData']['data'])
        elif 'error' in parsed_response:
            print(f"Error: {parsed_response['error']}")
elif batch_job.state.name == 'JOB_STATE_FAILED':
    print(f"Error: {batch_job.error}")

জাভাস্ক্রিপ্ট

import {GoogleGenAI} from '@google/genai';
import * as fs from "fs";
import * as path from "path";
import { fileURLToPath } from 'url';

const ai = new GoogleGenAI({});

async function run() {
    // 1. Create and upload file
    const fileName = "my-batch-image-requests.jsonl";
    const requests = [
        { "key": "request-1", "request": { "contents": [{ "parts": [{ "text": "A big letter A surrounded by animals starting with the A letter" }] }], "generation_config": {"responseModalities": ["TEXT", "IMAGE"]} } },
        { "key": "request-2", "request": { "contents": [{ "parts": [{ "text": "A big letter B surrounded by animals starting with the B letter" }] }], "generation_config": {"responseModalities": ["TEXT", "IMAGE"]} } }
    ];
    const __filename = fileURLToPath(import.meta.url);
    const __dirname = path.dirname(__filename);
    const filePath = path.join(__dirname, fileName);

    try {
        const writeStream = fs.createWriteStream(filePath, { flags: 'w' });
        for (const req of requests) {
            writeStream.write(JSON.stringify(req) + '\n');
        }
        writeStream.end();
        console.log(`Successfully wrote batch requests to ${filePath}`);
    } catch (error) {
        console.error(`An unexpected error occurred writing file:`, error);
        return;
    }

    const uploadedFile = await ai.files.upload({file: fileName, config: { mimeType: 'jsonl' }});
    console.log(`Uploaded file: ${uploadedFile.name}`);

    // 2. Create batch job
    const fileBatchJob = await ai.batches.create({
        model: 'gemini-3-pro-image-preview',
        src: uploadedFile.name,
        config: {
            displayName: 'file-image-upload-job-1',
        }
    });
    console.log(fileBatchJob);

    // 3. Monitor job status
    let batchJob;
    const completedStates = new Set([
        'JOB_STATE_SUCCEEDED',
        'JOB_STATE_FAILED',
        'JOB_STATE_CANCELLED',
        'JOB_STATE_EXPIRED',
    ]);

    try {
        batchJob = await ai.batches.get({name: fileBatchJob.name});
        while (!completedStates.has(batchJob.state)) {
            console.log(`Current state: ${batchJob.state}`);
            // Wait for 10 seconds before polling again
            await new Promise(resolve => setTimeout(resolve, 10000));
            batchJob = await ai.batches.get({ name: batchJob.name });
        }
        console.log(`Job finished with state: ${batchJob.state}`);
    } catch (error) {
        console.error(`An error occurred while polling job ${fileBatchJob.name}:`, error);
        return;
    }

    // 4. Retrieve results
    if (batchJob.state === 'JOB_STATE_SUCCEEDED') {
        if (batchJob.dest?.fileName) {
            const resultFileName = batchJob.dest.fileName;
            console.log(`Results are in file: ${resultFileName}`);
            console.log("Downloading result file content...");
            const fileContentBuffer = await ai.files.download({ file: resultFileName });
            const fileContent = fileContentBuffer.toString('utf-8');
            for (const line of fileContent.split('\n')) {
                if (line) {
                    const parsedResponse = JSON.parse(line);
                    if (parsedResponse.response) {
                        for (const part of parsedResponse.response.candidates[0].content.parts) {
                            if (part.text) {
                                console.log(part.text);
                            } else if (part.inlineData) {
                                console.log(`Image mime type: ${part.inlineData.mimeType}`);
                            }
                        }
                    } else if (parsedResponse.error) {
                        console.error(`Error: ${parsedResponse.error}`);
                    }
                }
            }
        } else {
            console.log("No result file found.");
        }
    } else if (batchJob.state === 'JOB_STATE_FAILED') {
         console.error(`Error: ${typeof batchJob.error === 'string' ? batchJob.error : batchJob.error.message || JSON.stringify(batchJob.error)}`);
    }
}
run();

বিশ্রাম

# 1. Create and upload file
echo '{"key": "request-1", "request": {"contents": [{"parts": [{"text": "A big letter A surrounded by animals starting with the A letter"}]}], "generation_config": {"responseModalities": ["TEXT", "IMAGE"]}}}' > my-batch-image-requests.jsonl
echo '{"key": "request-2", "request": {"contents": [{"parts": [{"text": "A big letter B surrounded by animals starting with the B letter"}]}], "generation_config": {"responseModalities": ["TEXT", "IMAGE"]}}}' >> my-batch-image-requests.jsonl

# Follow File API guide to upload: https://ai.google.dev/gemini-api/docs/files#upload_a_file
# This example assumes you have uploaded the file and set BATCH_INPUT_FILE to its name (e.g., files/abcdef123)
BATCH_INPUT_FILE="files/your-uploaded-file-name"

# 2. Create batch job
printf -v request_data '{
    "batch": {
        "display_name": "my-batch-file-image-requests",
        "input_config": { "file_name": "%s" }
    }
}' "$BATCH_INPUT_FILE"
curl https://generativelanguage.googleapis.com/v1beta/models/gemini-3-pro-image-preview:batchGenerateContent \
  -X POST \
  -H "x-goog-api-key: $GEMINI_API_KEY" \
  -H "Content-Type:application/json" \
  -d "$request_data" > created_batch.json

BATCH_NAME=$(jq -r '.name' created_batch.json)
echo "Created batch job: $BATCH_NAME"

# 3. Poll job status until completion by repeating the following command:
curl https://generativelanguage.googleapis.com/v1beta/$BATCH_NAME \
  -H "x-goog-api-key: $GEMINI_API_KEY" \
  -H "Content-Type:application/json" > batch_status.json

echo "Current status:"
jq '.' batch_status.json

# 4. If state is JOB_STATE_SUCCEEDED, download results file
batch_state=$(jq -r '.state' batch_status.json)
if [[ $batch_state = "JOB_STATE_SUCCEEDED" ]]; then
    responses_file_name=$(jq -r '.dest.fileName' batch_status.json)
    echo "Job succeeded. Downloading results from $responses_file_name..."
    curl https://generativelanguage.googleapis.com/download/v1beta/$responses_file_name:download?alt=media \
      -H "x-goog-api-key: $GEMINI_API_KEY" > batch_results.jsonl
    echo "Results saved to batch_results.jsonl"
fi

প্রযুক্তিগত বিবরণ

  • সমর্থিত মডেলসমূহ: ব্যাচ এপিআই (Batch API) বিভিন্ন জেমিনি (Gemini) মডেল সমর্থন করে। প্রতিটি মডেলে ব্যাচ এপিআই-এর সমর্থন সম্পর্কে জানতে মডেল (Models) পৃষ্ঠাটি দেখুন। ব্যাচ এপিআই-এর জন্য সমর্থিত মোডালিটিগুলো ইন্টারেক্টিভ (বা নন-ব্যাচ) এপিআই-তে সমর্থিত মোডালিটিগুলোর মতোই।
  • মূল্য নির্ধারণ: ব্যাচ এপিআই ব্যবহারের মূল্য সমতুল্য মডেলের স্ট্যান্ডার্ড ইন্টারেক্টিভ এপিআই খরচের ৫০%। বিস্তারিত জানতে প্রাইসিং পেজ দেখুন। এই ফিচারের রেট লিমিট সম্পর্কে বিস্তারিত জানতে রেট লিমিট পেজ দেখুন।
  • সার্ভিস লেভেল অবজেক্টিভ (এসএলও): ব্যাচ জবগুলো ২৪ ঘণ্টার মধ্যে সম্পন্ন করার জন্য ডিজাইন করা হয়েছে। জবের আকার এবং বর্তমান সিস্টেম লোডের উপর নির্ভর করে অনেক জব আরও দ্রুত সম্পন্ন হতে পারে।
  • ক্যাশিং: ব্যাচ অনুরোধের জন্য কনটেক্সট ক্যাশিং সক্রিয় করা আছে। যদি আপনার ব্যাচের কোনো অনুরোধের ফলে ক্যাশ হিট হয়, তাহলে ক্যাশ করা টোকেনগুলোর মূল্য নন-ব্যাচ এপিআই ট্র্যাফিকের মতোই নির্ধারণ করা হয়।

সর্বোত্তম অনুশীলন

  • বড় আকারের অনুরোধের জন্য ইনপুট ফাইল ব্যবহার করুন: অধিক সংখ্যক অনুরোধের ক্ষেত্রে, উন্নততর ব্যবস্থাপনার জন্য এবং BatchGenerateContent কলটির অনুরোধের আকারের সীমাবদ্ধতা এড়াতে সর্বদা ফাইল ইনপুট পদ্ধতি ব্যবহার করুন। উল্লেখ্য যে, প্রতিটি ইনপুট ফাইলের জন্য ২ জিবি ফাইলের আকারের সীমাবদ্ধতা রয়েছে।
  • ত্রুটি পরিচালনা: একটি কাজ সম্পন্ন হওয়ার পর failedRequestCount এর জন্য batchStats পরীক্ষা করুন। ফাইল আউটপুট ব্যবহার করলে, প্রতিটি লাইন পার্স করে দেখুন সেটি একটি GenerateContentResponse নাকি সেই নির্দিষ্ট অনুরোধের জন্য কোনো ত্রুটি নির্দেশকারী স্ট্যাটাস অবজেক্ট। ত্রুটি কোডগুলির সম্পূর্ণ সেটের জন্য ট্রাবলশুটিং গাইড দেখুন।
  • একবারই জব জমা দিন: একটি ব্যাচ জব তৈরি করা আইডম্পোটেন্ট নয়। আপনি যদি একই তৈরির অনুরোধ দুইবার পাঠান, তাহলে দুটি পৃথক ব্যাচ জব তৈরি হবে।
  • খুব বড় ব্যাচ ভেঙে নিন: যদিও লক্ষ্যমাত্রা অনুযায়ী কাজ শেষ করার সময় ২৪ ঘণ্টা, সিস্টেমের উপর চাপ এবং কাজের আকারের উপর ভিত্তি করে প্রকৃত প্রক্রিয়াকরণের সময় পরিবর্তিত হতে পারে। বড় কাজের ক্ষেত্রে, যদি অন্তর্বর্তী ফলাফল দ্রুত প্রয়োজন হয়, তবে সেগুলোকে ছোট ছোট ব্যাচে ভাগ করার কথা বিবেচনা করুন।

এরপর কী?