เครื่องมือบริบท URL ช่วยให้คุณระบุบริบทเพิ่มเติมให้กับโมเดลในรูปแบบ URL ได้ โดยโมเดลจะเข้าถึงเนื้อหาจาก URL เหล่านั้นเพื่อแจ้งข้อมูลและปรับปรุงการตอบกลับ
บริบท URL มีประโยชน์ดังนี้
ดึงข้อมูล: ระบุข้อมูลที่เฉพาะเจาะจง เช่น ราคา ชื่อ หรือ ข้อค้นพบที่สำคัญจากบทความหรือ URL หลายรายการ
เปรียบเทียบข้อมูล: วิเคราะห์รายงาน บทความ หรือ PDF หลายรายการ เพื่อระบุความแตกต่างและติดตามแนวโน้ม
สังเคราะห์และสร้างเนื้อหา: รวมข้อมูลจาก URL แหล่งที่มาหลายรายการเพื่อสร้างข้อมูลสรุปที่ถูกต้อง บล็อกโพสต์ รายงาน หรือคำถาม ทดสอบ
วิเคราะห์โค้ดและเนื้อหาทางเทคนิค: ระบุ URL ไปยังที่เก็บ GitHub หรือ เอกสารทางเทคนิคเพื่ออธิบายโค้ด สร้างวิธีการตั้งค่า หรือ ตอบคำถาม
โปรดตรวจสอบแนวทางปฏิบัติแนะนำและ ข้อจำกัดเมื่อใช้เครื่องมือบริบท URL
โมเดลที่รองรับ
gemini-3.1-pro-previewgemini-3-flash-previewgemini-3.1-flash-lite-previewgemini-2.5-progemini-2.5-flashgemini-2.5-flash-lite
ภาษาที่รองรับ
ดูภาษาที่รองรับสำหรับGemini โมเดล
ใช้เครื่องมือบริบท URL
คุณใช้เครื่องมือบริบท URL ได้ 2 วิธีหลักๆ ดังนี้
เครื่องมือบริบท URL เท่านั้น
|
คลิกผู้ให้บริการ Gemini API เพื่อดูเนื้อหาที่เฉพาะเจาะจงของผู้ให้บริการ และโค้ดในหน้านี้ |
เมื่อสร้างอินสแตนซ์ GenerativeModel ให้ระบุ UrlContext เป็นเครื่องมือ
จากนั้นระบุ URL ที่เฉพาะเจาะจงที่คุณต้องการให้โมเดลเข้าถึงและวิเคราะห์ลงในพรอมต์โดยตรง
ตัวอย่างต่อไปนี้แสดงวิธีเปรียบเทียบสูตรอาหาร 2 สูตรจากเว็บไซต์ต่างๆ
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.");
ดูวิธีเลือกโมเดล (ไม่บังคับ) ที่เหมาะกับกรณีการใช้งานและแอปของคุณ
บริบท URL ใช้ร่วมกับการเชื่อมต่อแหล่งข้อมูลกับ Google Search
|
คลิกผู้ให้บริการ 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 ในพรอมต์เลย ดังนั้น โมเดลจึงใช้เครื่องมือการเชื่อมต่อแหล่งข้อมูลกับ Google Search เพื่อค้นหา URL ที่เกี่ยวข้อง แล้วใช้เครื่องมือบริบท URL เพื่อวิเคราะห์เนื้อหา
ตัวอย่างพรอมต์:
Recommend 3 beginner-level books to learn about the latest YOUR_SUBJECT.
ตัวอย่างต่อไปนี้แสดงวิธีเปิดใช้และใช้เครื่องมือทั้ง 2 อย่าง ได้แก่ บริบท URL และการเชื่อมต่อแหล่งข้อมูลกับ Google Search
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 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
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 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
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 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
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 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
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 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
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 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 ใช้กระบวนการดึงข้อมูล 2 ขั้นตอนเพื่อสร้างสมดุลระหว่างความเร็ว ต้นทุน และการเข้าถึงข้อมูลล่าสุด
ขั้นตอนที่ 1: เมื่อคุณระบุ URL ที่เฉพาะเจาะจง เครื่องมือจะพยายามดึงข้อมูล เนื้อหาจากแคชดัชนีภายในก่อน ซึ่งทำหน้าที่เป็นแคชที่ได้รับการเพิ่มประสิทธิภาพอย่างสูง
ขั้นตอนที่ 2: หาก URL ไม่พร้อมใช้งานในดัชนี (เช่น หากเป็นหน้าเว็บใหม่มาก ) เครื่องมือจะกลับไปดึงข้อมูลแบบสดโดยอัตโนมัติ ซึ่งจะเข้าถึง URL โดยตรงเพื่อดึงข้อมูลเนื้อหาแบบเรียลไทม์
แนวทางปฏิบัติแนะนำ
ระบุ URL ที่เฉพาะเจาะจง: เพื่อให้ได้ผลลัพธ์ที่ดีที่สุด ให้ระบุ URL โดยตรงไปยัง เนื้อหาที่คุณต้องการให้โมเดลวิเคราะห์ โมเดลจะดึงข้อมูลเนื้อหาจาก URL ที่คุณระบุเท่านั้น ไม่ดึงข้อมูลเนื้อหาจากลิงก์ที่ซ้อนกัน
ตรวจสอบการเข้าถึง: ตรวจสอบว่า URL ที่คุณระบุไม่ได้นำไปยัง หน้าเว็บที่ต้องเข้าสู่ระบบหรืออยู่หลังเพย์วอลล์
ใช้ URL แบบเต็ม: ระบุ URL แบบเต็ม รวมถึงโปรโตคอล (เช่น
https://www.example.comแทนที่จะเป็น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 สูงสุดต่อคำขอคือ 20 URL
ขีดจำกัดขนาดเนื้อหา URL: ขนาดสูงสุดของเนื้อหาที่ดึงข้อมูลจาก URL เดียวคือ 34 MB
ความสดใหม่: เครื่องมือนี้ ไม่ ดึงข้อมูลหน้าเว็บเวอร์ชันที่เผยแพร่อยู่ ดังนั้นอาจ มีปัญหาเกี่ยวกับความสดใหม่หรือข้อมูลที่อาจล้าสมัย
การเข้าถึงแบบสาธารณะของ URL: URL ที่ระบุต้องเข้าถึงได้แบบสาธารณะบน เว็บ ระบบ ไม่ รองรับเนื้อหาเพย์วอลล์ เนื้อหาที่ต้องให้ผู้ใช้ลงชื่อเข้าใช้ เครือข่ายส่วนตัว ที่อยู่ localhost (เช่น
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)PDF (
application/pdf)
ไม่รองรับ: เครื่องมือนี้ ไม่ รองรับเนื้อหาประเภทต่อไปนี้
วิดีโอ YouTube (ให้ดูวิเคราะห์วิดีโอแทน)
ไฟล์วิดีโอและไฟล์เสียง (ให้ดู วิเคราะห์วิดีโอ หรือ วิเคราะห์เสียงแทน)
ไฟล์ Google Workspace เช่น Google เอกสารหรือชีต
(หากใช้ Vertex AI Gemini API) Cloud Storage URL
ไม่รองรับ URL ประเภทนี้โดย Gemini Developer API ไม่ว่าคุณจะเข้าถึงด้วยวิธีใดก็ตามเนื้อหาที่เข้าถึงแบบสาธารณะไม่ได้ ระบบ ไม่รองรับ เนื้อหาเพย์วอลล์ เนื้อหาที่ต้องให้ผู้ใช้ลงชื่อเข้าใช้ เครือข่ายส่วนตัว ที่อยู่ localhost (เช่น
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
}
ขีดจำกัดอัตราและการกำหนดราคาจะขึ้นอยู่กับโมเดลที่ใช้ ดูข้อมูลเพิ่มเติมเกี่ยวกับการกำหนดราคาสำหรับ เครื่องมือบริบท URL ได้ในเอกสารประกอบของผู้ให้บริการ Gemini APIที่คุณเลือก: Gemini Developer API | Vertex AI Gemini API