URL কন্টেক্সট

URL প্রসঙ্গ টুল আপনাকে URL-এর মাধ্যমে মডেলকে অতিরিক্ত প্রসঙ্গ প্রদান করতে দেয়। মডেলটি সেইসব URL থেকে কন্টেন্ট অ্যাক্সেস করতে পারে এবং এর উত্তরকে আরও তথ্যপূর্ণ ও উন্নত করে তুলতে পারে।

URL কনটেক্সটের নিম্নলিখিত সুবিধাগুলি রয়েছে:

  • ডেটা এক্সট্র্যাক্ট করা: কোনও নিবন্ধ বা একাধিক URL থেকে পাওয়া দাম, নাম বা গুরুত্বপূর্ণ তথ্যের মতো নির্দিষ্ট তথ্য প্রদান করো।

  • তথ্য তুলনা করা: পার্থক্য শনাক্ত করতে এবং ট্রেন্ড ট্র্যাক করতে একাধিক রিপোর্ট, নিবন্ধ বা PDF বিশ্লেষণ করুন।

  • কন্টেন্ট সিন্থেসাইজ ও তৈরি করা: সঠিক সারসংক্ষেপ, ব্লগ পোস্ট, রিপোর্ট বা পরীক্ষার প্রশ্ন তৈরি করতে একাধিক সোর্স URL থেকে পাওয়া তথ্য একত্রিত করুন।

  • কোড ও টেকনিক্যাল কন্টেন্ট বিশ্লেষণ করা: কোড ব্যাখ্যা করতে, সেট-আপ সংক্রান্ত নির্দেশাবলী তৈরি করতে অথবা প্রশ্নের উত্তর দিতে, GitHub রিপোজিটরি বা টেকনিক্যাল ডকুমেন্টেশনের URL প্রদান করুন।

URL প্রসঙ্গ টুল ব্যবহার করার সময় পেশাদার পদ্ধতি এবং সীমাবদ্ধতা পর্যালোচনা করতে ভুলবেন না।

মানানসই মডেল

  • gemini-3.1-pro-preview
  • gemini-3.8-flash (এবং এর আগের gemini-3.7-flash, gemini-3.6-flash ও gemini-3.5-flash)
  • gemini-3.5-flash-lite (এবং পুরনো gemini-3.1-flash-lite)

সাধারণ-ব্যবহারের Gemini 2.5 মডেলগুলিতে এই কেপেবিলিটি কাজ করে, তবে সেগুলি সবকটিই বাতিল করা হয়েছে।

সমর্থিত ভাষাগুলি

Gemini মডেলের জন্য কাজ করে এমন ভাষা দেখুন।

URL কন্টেক্সট টুল ব্যবহার করা

আপনি দুটি প্রধান উপায়ে URL কন্টেক্সট টুল ব্যবহার করতে পারবেন:

শুধুমাত্র URL কন্টেক্সট টুল

এই পৃষ্ঠায় প্রদানকারী-নির্দিষ্ট কন্টেন্ট ও কোড দেখতে আপনার Gemini API প্রদানকারীর আইকনে ক্লিক করুন।

GenerativeModel ইনস্ট্যান্স তৈরি করার সময়, টুল হিসেবে UrlContext প্রদান করুন। তারপর, আপনার প্রম্পটে সরাসরি সেইসব নির্দিষ্ট URL দিন যেগুলি আপনি চান যে মডেল অ্যাক্সেস ও বিশ্লেষণ করুক।

কীভাবে আলাদা আলাদা ওয়েবসাইট থেকে দুটি রেসিপি তুলনা করতে হয় তা নিম্নলিখিত উদাহরণ থেকে দেখুন:

Swift


import FirebaseAILogic

// Initialize the Gemini Developer API backend service.
let ai = FirebaseAI.firebaseAI(backend: .googleAI())

// Create a `GenerativeModel` instance with a model that supports your use case.
let model = ai.generativeModel(
    modelName: "GEMINI_MODEL_NAME",
    // Enable the URL context tool.
    tools: [Tool.urlContext()]
)

// Specify one or more URLs for the tool to access.
let url1 = "FIRST_RECIPE_URL"
let url2 = "SECOND_RECIPE_URL"

// Provide the URLs in the prompt sent in the request.
let prompt = "Compare the ingredients and cooking times from the recipes at \(url1) and \(url2)"

// Get and handle the model's response.
let response = try await model.generateContent(prompt)
print(response.text ?? "No text in response.")

Kotlin


// Initialize the Gemini Developer API backend service.
// Create a `GenerativeModel` instance with a model that supports your use case.
val model = Firebase.ai(backend = GenerativeBackend.googleAI()).generativeModel(
    modelName = "GEMINI_MODEL_NAME",
    // Enable the URL context tool.
    tools = listOf(Tool.urlContext())
)

// Specify one or more URLs for the tool to access.
val url1 = "FIRST_RECIPE_URL"
val url2 = "SECOND_RECIPE_URL"

// Provide the URLs in the prompt sent in the request.
val prompt = "Compare the ingredients and cooking times from the recipes at $url1 and $url2"

// Get and handle the model's response.
val response = model.generateContent(prompt)
print(response.text)

Java


// Initialize the Gemini Developer API backend service.
// Create a `GenerativeModel` instance with a model that supports your use case.
GenerativeModel ai = FirebaseAI.getInstance(GenerativeBackend.googleAI())
                .generativeModel("GEMINI_MODEL_NAME",
                        null,
                        null,
                        // Enable the URL context tool.
                        List.of(Tool.urlContext(new UrlContext())));

// Use the GenerativeModelFutures Java compatibility layer which offers
// support for ListenableFuture and Publisher APIs
GenerativeModelFutures model = GenerativeModelFutures.from(ai);

// Specify one or more URLs for the tool to access.
String url1 = "FIRST_RECIPE_URL";
String url2 = "SECOND_RECIPE_URL";

// Provide the URLs in the prompt sent in the request.
String prompt = "Compare the ingredients and cooking times from the recipes at " + url1 + " and " + url2 + "";

ListenableFuture response = model.generateContent(prompt);
  Futures.addCallback(response, new FutureCallback() {
      @Override
      public void onSuccess(GenerateContentResponse result) {
          String resultText = result.getText();
          System.out.println(resultText);
      }

      @Override
      public void onFailure(Throwable t) {
          t.printStackTrace();
      }
  }, executor);

Web


import { initializeApp } from "firebase/app";
import { getAI, getGenerativeModel, GoogleAIBackend } from "firebase/ai";

// TODO(developer): Replace the following with your app's Firebase configuration
// See: https://firebase.google.com/docs/web/learn-more#config-object
const firebaseConfig = {
  // ...
};

// Initialize FirebaseApp
const firebaseApp = initializeApp(firebaseConfig);

// Initialize the Gemini Developer API backend service.
const ai = getAI(firebaseApp, { backend: new GoogleAIBackend() });

// Create a `GenerativeModel` instance with a model that supports your use case.
const model = getGenerativeModel(
  ai,
  {
    model: "GEMINI_MODEL_NAME",
    // Enable the URL context tool.
    tools: [{ urlContext: {} }]
  }
);

// Specify one or more URLs for the tool to access.
const url1 = "FIRST_RECIPE_URL"
const url2 = "SECOND_RECIPE_URL"

// Provide the URLs in the prompt sent in the request.
const prompt = `Compare the ingredients and cooking times from the recipes at ${url1} and ${url2}`

// Get and handle the model's response.
const result = await model.generateContent(prompt);
console.log(result.response.text());

Dart


import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_ai/firebase_ai.dart';
import 'firebase_options.dart';

// Initialize FirebaseApp
await Firebase.initializeApp(
  options: DefaultFirebaseOptions.currentPlatform,
);

// Initialize the Gemini Developer API backend service.
// Create a `GenerativeModel` instance with a model that supports your use case.
final model = FirebaseAI.googleAI().generativeModel(
  model: 'GEMINI_MODEL_NAME',
  // Enable the URL context tool.
  tools: [
    Tool.urlContext(),
  ],
);

// Specify one or more URLs for the tool to access.
final url1 = "FIRST_RECIPE_URL";
final url2 = "SECOND_RECIPE_URL";

// Provide the URLs in the prompt sent in the request.
final prompt = "Compare the ingredients and cooking times from the recipes at $url1 and $url2";

// Get and handle the model's response.
final response = await model.generateContent([Content.text(prompt)]);
print(response.text);

Unity


using Firebase;
using Firebase.AI;

// Initialize the Gemini Developer API backend service.
var ai = FirebaseAI.GetInstance(FirebaseAI.Backend.GoogleAI());

// Create a `GenerativeModel` instance with a model that supports your use case.
var model = ai.GetGenerativeModel(
  modelName: "GEMINI_MODEL_NAME",
  // Enable the URL context tool.
  tools: new[] { new Tool(new UrlContext()) }
);

// Specify one or more URLs for the tool to access.
var url1 = "FIRST_RECIPE_URL";
var url2 = "SECOND_RECIPE_URL";

// Provide the URLs in the prompt sent in the request.
var prompt = $"Compare the ingredients and cooking times from the recipes at {url1} and {url2}";

// Get and handle the model's response.
var response = await model.GenerateContentAsync(prompt);
UnityEngine.Debug.Log(response.Text ?? "No text in response.");

আপনার ব্যবহারিক ক্ষেত্র ও অ্যাপের জন্য উপযুক্ত মডেল কীভাবে বেছে নিতে হয় তা জানুন।

এই পৃষ্ঠায় প্রদানকারী-নির্দিষ্ট কন্টেন্ট ও কোড দেখতে আপনার Gemini API প্রদানকারীর আইকনে ক্লিক করুন।

আপনি URL প্রসঙ্গ ও Google Search-এর মাধ্যমে গ্রাউন্ডিং, দুটিই চালু করতে পারবেন। এই কনফিগারেশনের সাহায্যে, আপনি নির্দিষ্ট URL সহ বা URL ছাড়া প্রম্পট লিখতে পারবেন।

Google Search-এর সাথে গ্রাউন্ডিং চালু করা থাকলে, মডেলটি প্রথমে Google Search ব্যবহার করে প্রাসঙ্গিক তথ্য খুঁজে নিতে পারে এবং তারপরে URL কনটেক্সট টুল ব্যবহার করে আরও গভীরভাবে তথ্য বোঝার জন্য সার্চ ফলাফলের কন্টেন্ট পড়তে পারে। এই পদ্ধতি সেইসব প্রম্পটের জন্য খুব উপযোগী যেগুলিতে ব্যাপক সার্চিং ও নির্দিষ্ট পৃষ্ঠার গভীর বিশ্লেষণ, দুটিই প্রয়োজন।

এর কয়েকটি উদাহরণ দেখুন:

  • জেনারেট করা উত্তরের কিছু অংশকে সাহায্য করার জন্য আপনি প্রম্পটে একটি URL প্রদান করেন। তবে, সঠিক উত্তর তৈরি করার জন্য, মডেলটিকে এখনও অন্যান্য বিষয় সম্পর্কে আরও তথ্য পেতে হবে, তাই এটি Google Search টুল ব্যবহার করে গ্রাউন্ডিং করে।

    প্রম্পটের উদাহরণ:
    Give me a three day event schedule based on YOUR_URL. Also what do I need to pack according to the weather?

  • আপনি প্রম্পটে কোনও URL দেননি। তাই, সঠিক উত্তর তৈরি করতে, মডেলটি প্রাসঙ্গিক URL খুঁজে পেতে Google Searchটুল সহ গ্রাউন্ডিং ব্যবহার করে এবং তারপরে URL কনটেক্সট টুল ব্যবহার করে সেগুলির কন্টেন্ট বিশ্লেষণ করে।

    প্রম্পটের উদাহরণ:
    Recommend 3 beginner-level books to learn about the latest YOUR_SUBJECT.

নিচের উদাহরণে দেখানো হয়েছে কীভাবে URL কনটেক্সট ও Google Search-এর মাধ্যমে গ্রাউন্ডিং — এই দুটি টুলই চালু ও ব্যবহার করতে হয়:


import FirebaseAILogic

// Initialize the Gemini Developer API backend service.
let ai = FirebaseAI.firebaseAI(backend: .googleAI())

// Create a `GenerativeModel` instance with a model that supports your use case.
let model = ai.generativeModel(
    modelName: "GEMINI_MODEL_NAME",
    // Enable both the URL context tool and Google Search tool.
    tools: [
      Tool.urlContex(),
      Tool.googleSearch()
    ]
)

// Specify one or more URLs for the tool to access.
let url = "YOUR_URL"

// Provide the URLs in the prompt sent in the request.
// If the model can't generate a response using its own knowledge or the content in the specified URL,
// then the model will use the grounding with Google Search tool.
let prompt = "Give me a three day event schedule based on \(url). Also what do I need to pack according to the weather?"

// Get and handle the model's response.
let response = try await model.generateContent(prompt)
print(response.text ?? "No text in response.")

// Make sure to comply with the "Grounding with Google Search" usage requirements,
// which includes how you use and display the grounded result


// Initialize the Gemini Developer API backend service.
// Create a `GenerativeModel` instance with a model that supports your use case.
val model = Firebase.ai(backend = GenerativeBackend.googleAI()).generativeModel(
    modelName = "GEMINI_MODEL_NAME",
    // Enable both the URL context tool and Google Search tool.
    tools = listOf(Tool.urlContext(), Tool.googleSearch())
)

// Specify one or more URLs for the tool to access.
val url = "YOUR_URL"

// Provide the URLs in the prompt sent in the request.
// If the model can't generate a response using its own knowledge or the content in the specified URL,
// then the model will use the grounding with Google Search tool.
val prompt = "Give me a three day event schedule based on $url. Also what do I need to pack according to the weather?"

// Get and handle the model's response.
val response = model.generateContent(prompt)
print(response.text)

// Make sure to comply with the "Grounding with Google Search" usage requirements,
// which includes how you use and display the grounded result


// Initialize the Gemini Developer API backend service.
// Create a `GenerativeModel` instance with a model that supports your use case.
GenerativeModel ai = FirebaseAI.getInstance(GenerativeBackend.googleAI())
                .generativeModel("GEMINI_MODEL_NAME",
                        null,
                        null,
                        // Enable both the URL context tool and Google Search tool.
                        List.of(Tool.urlContext(new UrlContext()), Tool.googleSearch(new GoogleSearch())));

// Use the GenerativeModelFutures Java compatibility layer which offers
// support for ListenableFuture and Publisher APIs
GenerativeModelFutures model = GenerativeModelFutures.from(ai);

// Specify one or more URLs for the tool to access.
String url = "YOUR_URL";

// Provide the URLs in the prompt sent in the request.
// If the model can't generate a response using its own knowledge or the content in the specified URL,
// then the model will use the grounding with Google Search tool.
String prompt = "Give me a three day event schedule based on " + url + ". Also what do I need to pack according to the weather?";

ListenableFuture response = model.generateContent(prompt);
  Futures.addCallback(response, new FutureCallback() {
      @Override
      public void onSuccess(GenerateContentResponse result) {
          String resultText = result.getText();
          System.out.println(resultText);
      }

      @Override
      public void onFailure(Throwable t) {
          t.printStackTrace();
      }
  }, executor);

// Make sure to comply with the "Grounding with Google Search" usage requirements,
// which includes how you use and display the grounded result


import { initializeApp } from "firebase/app";
import { getAI, getGenerativeModel, GoogleAIBackend } from "firebase/ai";

// TODO(developer): Replace the following with your app's Firebase configuration
// See: https://firebase.google.com/docs/web/learn-more#config-object
const firebaseConfig = {
  // ...
};

// Initialize FirebaseApp
const firebaseApp = initializeApp(firebaseConfig);

// Initialize the Gemini Developer API backend service.
const ai = getAI(firebaseApp, { backend: new GoogleAIBackend() });

// Create a `GenerativeModel` instance with a model that supports your use case.
const model = getGenerativeModel(
  ai,
  {
    model: "GEMINI_MODEL_NAME",
    // Enable both the URL context tool and Google Search tool.
    tools: [{ urlContext: {} }, { googleSearch: {} }],
  }
);

// Specify one or more URLs for the tool to access.
const url = "YOUR_URL"

// Provide the URLs in the prompt sent in the request.
// If the model can't generate a response using its own knowledge or the content in the specified URL,
// then the model will use the grounding with Google Search tool.
const prompt = `Give me a three day event schedule based on ${url}. Also what do I need to pack according to the weather?`

// Get and handle the model's response.
const result = await model.generateContent(prompt);
console.log(result.response.text());

// Make sure to comply with the "Grounding with Google Search" usage requirements,
// which includes how you use and display the grounded result


import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_ai/firebase_ai.dart';
import 'firebase_options.dart';

// Initialize FirebaseApp.
await Firebase.initializeApp(
  options: DefaultFirebaseOptions.currentPlatform,
);

// Initialize the Gemini Developer API backend service.
// Create a `GenerativeModel` instance with a model that supports your use case.
final model = FirebaseAI.googleAI().generativeModel(
  model: 'GEMINI_MODEL_NAME',
  // Enable both the URL context tool and Google Search tool.
  tools: [
    Tool.urlContext(),
    Tool.googleSearch(),
  ],
);

// Specify one or more URLs for the tool to access.
final url = "YOUR_URL";

// Provide the URLs in the prompt sent in the request.
// If the model can't generate a response using its own knowledge or the content in the specified URL,
// then the model will use the grounding with Google Search tool.
final prompt = "Give me a three day event schedule based on $url. Also what do I need to pack according to the weather?";

final response = await model.generateContent([Content.text(prompt)]);
print(response.text);

// Make sure to comply with the "Grounding with Google Search" usage requirements,
// which includes how you use and display the grounded result


using Firebase;
using Firebase.AI;

// Initialize the Gemini Developer API backend service.
var ai = FirebaseAI.GetInstance(FirebaseAI.Backend.GoogleAI());

// Create a `GenerativeModel` instance with a model that supports your use case.
var model = ai.GetGenerativeModel(
  modelName: "GEMINI_MODEL_NAME",
  // Enable both the URL context tool and Google Search tool.
  tools: new[] { new Tool(new GoogleSearch()), new Tool(new UrlContext()) }
);

// Specify one or more URLs for the tool to access.
var url = "YOUR_URL";

// Provide the URLs in the prompt sent in the request.
// If the model can't generate a response using its own knowledge or the content in the specified URL,
// then the model will use the grounding with Google Search tool.
var prompt = $"Give me a three day event schedule based on {url}. Also what do I need to pack according to the weather?";

// Get and handle the model's response.
var response = await model.GenerateContentAsync(prompt);
UnityEngine.Debug.Log(response.Text ?? "No text in response.");

// Make sure to comply with the "Grounding with Google Search" usage requirements,
// which includes how you use and display the grounded result

আপনার ব্যবহারিক ক্ষেত্র ও অ্যাপের জন্য উপযুক্ত মডেল কীভাবে বেছে নিতে হয় তা জানুন।

URL কনটেক্সট টুল কীভাবে কাজ করে

URL কন্টেক্সট টুল, স্পিড, খরচ এবং ফ্রেশ ডেটা অ্যাক্সেস করার মধ্যে ব্যালেন্স বজায় রাখতে, দুটি ধাপের রিট্রিভাল প্রসেস ব্যবহার করে।

ধাপ ১: আপনি কোনও নির্দিষ্ট URL দিলে, টুলটি প্রথমে ইন্টার্নাল ইন্ডেক্স ক্যাশে থেকে কন্টেন্ট ফেচ করার চেষ্টা করে। এটি অত্যন্ত অপ্টিমাইজ করা ক্যাশে হিসেবে কাজ করে।

ধাপ ২: কোনও URL ইন্ডেক্সে উপলভ্য না থাকলে (যেমন, এটি খুব নতুন পৃষ্ঠা হলে), টুলটি অটোমেটিক লাইভ ফেচ করার বিকল্পে ফিরে যায়। এটি সরাসরি URL অ্যাক্সেস করে রিয়েল-টাইমে কন্টেন্ট রিট্রিভ করে।

পেশাদার পদ্ধতি

  • নির্দিষ্ট URL দিন: সবচেয়ে ভাল ফলাফল পেতে, আপনি যে কন্টেন্ট মডেলকে বিশ্লেষণ করতে দিতে চান, সেটির সরাসরি URL দিন। মডেলটি শুধুমাত্র আপনার দেওয়া URL থেকে কন্টেন্ট রিট্রিভ করবে, নেস্ট করা লিঙ্ক থেকে কোনও কন্টেন্ট নয়।

  • অ্যাক্সেসিবিলিটি চেক করুন: আপনার দেওয়া URL যেন লগ-ইন করতে হয় বা পেওয়ালের পিছনে থাকে এমন কোনও পৃষ্ঠায় নিয়ে না যায় তা যাচাই করুন।

  • সম্পূর্ণ URL ব্যবহার করুন: প্রোটোকল সহ সম্পূর্ণ URL দিন (যেমন, শুধু example.com-এর পরিবর্তে https://www.example.com)।

উত্তরটি বোঝা

URL থেকে মডেল যে কন্টেন্ট পেয়েছে তার উপর ভিত্তি করে উত্তর দেবে।

মডেলটি URL থেকে কন্টেন্ট রিট্রিভ করলে, উত্তরে url_context_metadata অন্তর্ভুক্ত থাকবে। এই ধরনের উত্তরটি নিচে দেওয়া উদাহরণের মতো হতে পারে (উত্তরটি সংক্ষিপ্ত করার জন্য কিছু অংশ বাদ দেওয়া হয়েছে):

{
  "candidates": [
    {
      "content": {
        "parts": [
          {
            "text": "... \n"
          }
        ],
        "role": "model"
      },
      ...
      "url_context_metadata":
      {
          "url_metadata":
          [
            {
              "retrieved_url": "https://www.example.com",
              "url_retrieval_status": "URL_RETRIEVAL_STATUS_SUCCESS"
            },
            {
              "retrieved_url": "https://www.example.org",
              "url_retrieval_status": "URL_RETRIEVAL_STATUS_SUCCESS"
            },
          ]
        }
    }
  ]
}

নিরাপত্তা সংক্রান্ত পরীক্ষা

URL নিরাপত্তা সংক্রান্ত মাপকাঠি পূরণ করছে কিনা তা কনফার্ম করতে সিস্টেম URL-এ কন্টেন্ট মডারেশন চেক করে। আপনার দেওয়া URL এই চেকিংয়ে উত্তীর্ণ হতে না পারলে, আপনি একটি url_retrieval_status পাবেন URL_RETRIEVAL_STATUS_UNSAFE.

সীমাবদ্ধতা

URL কনটেক্সট টুলের কিছু সীমাবদ্ধতা এখানে দেওয়া হল:

  • ফাংশন কলিংয়ের সাথে একত্রিত করা: URL কনটেক্সট টুলটি এমন অনুরোধে ব্যবহার করা যাবে না যেখানে ফাংশন কলিংও ব্যবহার করা হয়েছে।

  • প্রতিটি অনুরোধে URL-এর সীমা: প্রতিটি অনুরোধে সর্বাধিক ২০টি URL দেওয়া যায়।

  • URL কন্টেন্টের সাইজ সংক্রান্ত সীমা: একটি URL থেকে পাওয়া কন্টেন্টের সর্বাধিক সাইজ হল ৩৪ এমবি।

  • নতুনত্ব: টুলটি ওয়েবপেজের লাইভ ভার্সন ফেচ করে না, তাই নতুনত্ব বা সম্ভাব্য পুরনো তথ্য সংক্রান্ত কিছু সমস্যা থাকতে পারে।

  • URL-এর সর্বজনীন অ্যাক্সেসিবিলিটি: প্রদান করা URL অবশ্যই ওয়েবে সর্বজনীনভাবে অ্যাক্সেস করা যেতে হবে। নিম্নলিখিত বিষয়গুলি কাজ করে না: পেওয়ালযুক্ত কন্টেন্ট, ব্যবহারকারীকে সাইন-ইন করতে হয় এমন কন্টেন্ট, প্রাইভেট নেটওয়ার্ক, লোকালহোস্ট অ্যাড্রেস (যেমন, localhost বা 127.0.0.1) এবং টানেলিং পরিষেবা (যেমন, ngrok বা pinggy)।

কাজ করে ও কাজ করে না এমন কন্টেন্টের ধরন

কাজ করে: টুলটি নিম্নলিখিত কন্টেন্টের ধরন সহ URL থেকে কন্টেন্ট এক্সট্র্যাক্ট করতে পারে:

  • টেক্সট (text/html, application/json, text/plain, text/xml, text/css, text/javascript, text/csv, text/rtf)

  • ছবি (image/png, image/jpeg, image/bmp, image/webp)

  • পিডিএফ (application/pdf)

কাজ করে না: টুলটি নিম্নলিখিত কন্টেন্টের ধরন সাপোর্ট করে না:

  • YouTube ভিডিও (পরিবর্তে, ভিডিও বিশ্লেষণ করুন দেখুন)

  • ভিডিও ও অডিও ফাইল (পরিবর্তে, দেখুন ভিডিও বিশ্লেষণ করুন অথবা অডিও বিশ্লেষণ করুন)

  • Google Docs বা স্প্রেডশিটের মতো Google Workspace ফাইল

  • (Agent Platform Gemini API (formerly Vertex AI) ব্যবহার করলে) Cloud Storage URL
    আপনি যেভাবে এটি অ্যাক্সেস করুন না কেন, Gemini Developer API-এ এই ধরনের URL কাজ করে না।

  • সর্বজনীনভাবে অ্যাক্সেস করা যায় না এমন কন্টেন্ট। নিম্নলিখিত বিষয়গুলি কাজ করে না: পেওয়ালযুক্ত কন্টেন্ট, ব্যবহারকারীকে সাইন-ইন করতে হয় এমন কন্টেন্ট, ব্যক্তিগত নেটওয়ার্ক, লোকালহোস্ট অ্যাড্রেস (যেমন localhost বা 127.0.0.1) এবং টানেলিং পরিষেবা (যেমন ngrok বা pinggy)।

প্রাইসিং ও কাউন্টিং টুল টোকেন

URL থেকে পাওয়া কন্টেন্টকে ইনপুট টোকেন হিসেবে গণ্য করা হয়।

আপনি usage_metadata মডেল আউটপুটের অবজেক্টে আপনার প্রম্পটের জন্য টোকেনের সংখ্যা এবং টুলের ব্যবহার দেখতে পাবেন। নিচে আউটপুটের একটি উদাহরণ দেওয়া হল:

'usage_metadata': {
  'candidates_token_count': 45,
  'prompt_token_count': 27,
  'prompt_tokens_details': [{'modality': <MediaModality.TEXT: 'TEXT'>,
    'token_count': 27}],
  'thoughts_token_count': 31,
  'tool_use_prompt_token_count': 10309,
  'tool_use_prompt_tokens_details': [{'modality': <MediaModality.TEXT: 'TEXT'>,
    'token_count': 10309}],
  'total_token_count': 10412
  }

ব্যবহৃত মডেলের উপর ভিত্তি করে রেট সীমা ও প্রাইসিং নির্ধারণ করা হয়। আপনার বেছে নেওয়া Gemini API প্রদানকারীর ডকুমেন্টেশনে URL কনটেক্সট টুলের দাম সম্পর্কে আরও জানুন: Gemini Developer API | Agent Platform Gemini API (formerly Vertex AI).