URL প্রসঙ্গ

ইউআরএল কনটেক্সট টুল আপনাকে ইউআরএল-এর আকারে মডেলে অতিরিক্ত কনটেক্সট প্রদান করতে দেয়। মডেলটি তার প্রতিক্রিয়াকে সমৃদ্ধ ও উন্নত করার জন্য সেই ইউআরএলগুলো থেকে কন্টেন্ট অ্যাক্সেস করতে পারে।

ইউআরএল কনটেক্সটের নিম্নলিখিত সুবিধাগুলো রয়েছে:

  • ডেটা সংগ্রহ করুন : কোনো নিবন্ধ বা একাধিক ইউআরএল থেকে মূল্য, নাম বা মূল তথ্যের মতো সুনির্দিষ্ট তথ্য প্রদান করুন।

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

  • বিষয়বস্তু সংশ্লেষণ ও তৈরি করুন : নির্ভুল সারসংক্ষেপ, ব্লগ পোস্ট, প্রতিবেদন বা পরীক্ষার প্রশ্ন তৈরি করতে একাধিক উৎস ইউআরএল থেকে তথ্য একত্রিত করুন।

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

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

সমর্থিত মডেল

  • gemini-3.1-pro-preview
  • gemini-3-flash-preview
  • gemini-3.1-flash-lite-preview
  • gemini-2.5-pro
  • gemini-2.5-flash
  • gemini-2.5-flash-lite

সমর্থিত ভাষা

জেমিনি মডেলগুলির জন্য সমর্থিত ভাষাগুলি দেখুন।

ইউআরএল কনটেক্সট টুল ব্যবহার করুন

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

শুধুমাত্র URL প্রসঙ্গ সরঞ্জাম

এই পৃষ্ঠায় প্রদানকারী-নির্দিষ্ট বিষয়বস্তু এবং কোড দেখতে আপনার জেমিনি এপিআই প্রদানকারীর উপর ক্লিক করুন।

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

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

সুইফট


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);

ঐক্য


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.");

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

এই পৃষ্ঠায় প্রদানকারী-নির্দিষ্ট বিষয়বস্তু এবং কোড দেখতে আপনার জেমিনি এপিআই প্রদানকারীর উপর ক্লিক করুন।

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

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

এখানে কিছু ব্যবহারের উদাহরণ দেওয়া হলো:

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

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

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

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

নিম্নলিখিত উদাহরণটি দেখায় কিভাবে গুগল সার্চের সাথে ইউআরএল কনটেক্সট এবং গ্রাউন্ডিং উভয় টুল সক্রিয় ও ব্যবহার করতে হয়:


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-টি দিন (উদাহরণস্বরূপ, শুধু example.com এর পরিবর্তে https://www.example.com )।

প্রতিক্রিয়াটি বুঝুন

মডেলটির প্রতিক্রিয়া ইউআরএলগুলো থেকে প্রাপ্ত বিষয়বস্তুর উপর ভিত্তি করে হবে।

যদি মডেলটি 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_RETRIEVAL_STATUS_UNSAFE url_retrieval_status পাবেন।

সীমাবদ্ধতা

ইউআরএল কনটেক্সট টুলের কিছু সীমাবদ্ধতা নিচে দেওয়া হলো:

  • ফাংশন কলিং-এর সাথে সমন্বয় : যে অনুরোধে ফাংশন কলিংও ব্যবহার করা হয়, সেই অনুরোধে ইউআরএল কনটেক্সট টুল ব্যবহার করা যাবে না

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

  • ইউআরএল কন্টেন্টের আকারের সীমা : একটি একক ইউআরএল থেকে প্রাপ্ত কন্টেন্টের সর্বোচ্চ আকার হলো ৩৪ মেগাবাইট।

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

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

সমর্থিত এবং অসমর্থিত বিষয়বস্তুর প্রকারভেদ

সমর্থিত : টুলটি নিম্নলিখিত কন্টেন্ট টাইপ সহ 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 )

সমর্থিত নয় : টুলটি নিম্নলিখিত কন্টেন্ট টাইপগুলো সমর্থন করে না :

  • ইউটিউব ভিডিও (এর পরিবর্তে, ভিডিও বিশ্লেষণ দেখুন)

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

  • গুগল ওয়ার্কস্পেস ফাইল, যেমন গুগল ডক্স বা স্প্রেডশীট

  • (যদি Vertex AI Gemini API ব্যবহার করা হয়) Cloud Storage ইউআরএল
    আপনি যেভাবেই অ্যাক্সেস করুন না কেন , জেমিনি ডেভেলপার এপিআই এই ধরনের ইউআরএল সমর্থন করে না।

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

মূল্য নির্ধারণ এবং গণনা সরঞ্জাম টোকেন

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 |Vertex AI Gemini API