URL কন্টেক্সট

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

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

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

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

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

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

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

যেসব মডেলে কাজ করে

  • gemini-4-argon
  • 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-3.1-pro-preview এবং সাধারণ-ব্যবহারের 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: [.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 সহ বা ছাড়া প্রম্পট লিখতে পারবেন।

এছাড়াও, 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: [
      .urlContext(),
      .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_RETRIEVAL_STATUS_UNSAFE-এর মধ্যে url_retrieval_status পাবেন।

সীমাবদ্ধতা

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 Workspace ফাইল, যেমন Google Docs বা স্প্রেডশিট

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

  • যে কন্টেন্ট সর্বজনীনভাবে অ্যাক্সেস করা যায় না। নিম্নলিখিতগুলি কাজ করে না: পেওয়াল কন্টেন্ট, ব্যবহারকারীর সাইন-ইন প্রয়োজন এমন কন্টেন্ট, ব্যক্তিগত নেটওয়ার্ক, লোকালহোস্ট অ্যাড্রেস (যেমন 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).

ব্যবহার করেন তখন টুল-ব্যবহারের টোকেন এখনও ড্যাশবোর্ডে দেখানো হয় না