Panggilan fungsi, yang juga dikenal sebagai penggunaan alat, memberi LLM definisi alat eksternal (misalnya, fungsi get_current_weather
). Saat memproses perintah, model akan menentukan secara cerdas apakah alat diperlukan dan, jika ya, menghasilkan data terstruktur yang menentukan alat yang akan dipanggil dan parameternya (misalnya, get_current_weather(location='Boston')
). Aplikasi Anda kemudian akan mengeksekusi alat ini, memasukkan hasilnya kembali ke model, sehingga memungkinkannya menyelesaikan responsnya dengan informasi dunia nyata yang dinamis atau hasil tindakan. Hal ini secara efektif menjembatani LLM dengan sistem Anda dan memperluas kemampuannya.
Panggilan fungsi memungkinkan dua kasus penggunaan utama:
Mengambil data: Mengambil informasi terbaru untuk respons model, seperti cuaca saat ini, konversi mata uang, atau data tertentu dari pusat informasi dan API (RAG).
Mengambil tindakan: Melakukan operasi eksternal seperti mengirimkan formulir, memperbarui status aplikasi, atau mengatur alur kerja agen (misalnya, pengalihan percakapan). Anda dapat melihat lebih banyak kasus penggunaan dan contoh yang didukung oleh panggilan fungsi di sini.
Fitur dan batasan
Model berikut mendukung panggilan fungsi:
- Gemini 2.5 Flash dengan Audio native Live API
Pratinjau - Gemini 2.0 Flash dengan Live API
Pratinjau - Vertex AI Model Optimizer
Eksperimental - Gemini 2.5 Pro
Pratinjau - Gemini 2.5 Flash
Pratinjau - Gemini 2.0 Flash
- Gemini 2.0 Flash-Lite
- Gemini 2.5 Flash dengan Audio native Live API
Anda dapat menentukan hingga 128
FunctionDeclarations
Tentukan fungsi Anda dalam format skema OpenAPI.
Untuk praktik terbaik terkait deklarasi fungsi, termasuk tips untuk nama dan deskripsi, lihat Praktik terbaik.
Cara membuat aplikasi panggilan fungsi
Untuk menggunakan panggilan fungsi, lakukan tugas berikut:
Langkah 1: Kirim perintah dan deklarasi fungsi ke model
Deklarasikan Tool
dalam format skema yang kompatibel dengan skema OpenAPI. Untuk mengetahui informasi selengkapnya, lihat Contoh skema.
Contoh berikut mengirimkan perintah dan deklarasi fungsi ke model.
REST
PROJECT_ID=myproject
LOCATION=us-central1
MODEL_ID=gemini-2.0-flash-001
curl -X POST \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
https://${LOCATION}-aiplatform.googleapis.com/v1/projects/${PROJECT_ID}/locations/${LOCATION}/publishers/google/models/${MODEL_ID}:generateContent \
-d '{
"contents": [{
"role": "user",
"parts": [{
"text": "What is the weather in Boston?"
}]
}],
"tools": [{
"functionDeclarations": [
{
"name": "get_current_weather",
"description": "Get the current weather in a given location",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The city name of the location for which to get the weather.",
"default": {
"string_value": "Boston, MA"
}
}
},
"required": [
"location"
]
}
}
]
}]
}'
Python
Anda dapat menentukan skema secara manual menggunakan kamus Python atau secara otomatis dengan fungsi bantuan from_func
. Contoh berikut menunjukkan cara mendeklarasikan fungsi secara manual.
import vertexai
from vertexai.generative_models import (
Content,
FunctionDeclaration,
GenerationConfig,
GenerativeModel,
Part,
Tool,
ToolConfig
)
# Initialize Vertex AI
# TODO(developer): Update the project
vertexai.init(project="PROJECT_ID", location="us-central1")
# Initialize Gemini model
model = GenerativeModel(model_name="gemini-2.0-flash")
# Manual function declaration
get_current_weather_func = FunctionDeclaration(
name="get_current_weather",
description="Get the current weather in a given location",
# Function parameters are specified in JSON schema format
parameters={
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The city name of the location for which to get the weather.",
"default": {
"string_value": "Boston, MA"
}
}
},
},
)
response = model.generate_content(
contents = [
Content(
role="user",
parts=[
Part.from_text("What is the weather like in Boston?"),
],
)
],
generation_config = GenerationConfig(temperature=0),
tools = [
Tool(
function_declarations=[get_current_weather_func],
)
]
)
Atau, Anda dapat mendeklarasikan fungsi secara otomatis dengan fungsi helper from_func
seperti yang ditunjukkan dalam contoh berikut:
def get_current_weather(location: str = "Boston, MA"):
"""
Get the current weather in a given location
Args:
location: The city name of the location for which to get the weather.
"""
# This example uses a mock implementation.
# You can define a local function or import the requests library to call an API
return {
"location": "Boston, MA",
"temperature": 38,
"description": "Partly Cloudy",
"icon": "partly-cloudy",
"humidity": 65,
"wind": {
"speed": 10,
"direction": "NW"
}
}
get_current_weather_func = FunctionDeclaration.from_func(get_current_weather)
Node.js
Contoh ini menunjukkan skenario teks dengan satu fungsi dan satu perintah.
Node.js
Sebelum mencoba contoh ini, ikuti petunjuk penyiapan Node.js di Panduan memulai Vertex AI menggunakan library klien. Untuk mengetahui informasi selengkapnya, lihat Dokumentasi referensi API Node.js Vertex AI.
Untuk melakukan autentikasi ke Vertex AI, siapkan Kredensial Default Aplikasi. Untuk mengetahui informasi selengkapnya, baca Menyiapkan autentikasi untuk lingkungan pengembangan lokal.
Go
Contoh ini menunjukkan skenario teks dengan satu fungsi dan satu perintah.
Pelajari cara menginstal atau mengupdate Gen AI SDK for Go.
Untuk mempelajari lebih lanjut, lihat dokumentasi referensi SDK.
Tetapkan variabel lingkungan untuk menggunakan Gen AI SDK dengan Vertex AI:
# Replace the `GOOGLE_CLOUD_PROJECT` and `GOOGLE_CLOUD_LOCATION` values # with appropriate values for your project. export GOOGLE_CLOUD_PROJECT=GOOGLE_CLOUD_PROJECT export GOOGLE_CLOUD_LOCATION=global export GOOGLE_GENAI_USE_VERTEXAI=True
C#
Contoh ini menunjukkan skenario teks dengan satu fungsi dan satu perintah.
C#
Sebelum mencoba contoh ini, ikuti petunjuk penyiapan C# di Panduan memulai Vertex AI menggunakan library klien. Untuk mengetahui informasi selengkapnya, lihat Dokumentasi referensi API C# Vertex AI.
Untuk melakukan autentikasi ke Vertex AI, siapkan Kredensial Default Aplikasi. Untuk mengetahui informasi selengkapnya, baca Menyiapkan autentikasi untuk lingkungan pengembangan lokal.
Java
Java
Sebelum mencoba contoh ini, ikuti petunjuk penyiapan Java di Panduan memulai Vertex AI menggunakan library klien. Untuk mengetahui informasi selengkapnya, lihat Dokumentasi referensi API Java Vertex AI.
Untuk melakukan autentikasi ke Vertex AI, siapkan Kredensial Default Aplikasi. Untuk mengetahui informasi selengkapnya, baca Menyiapkan autentikasi untuk lingkungan pengembangan lokal.
Jika model menentukan bahwa model memerlukan output fungsi tertentu, respons yang diterima aplikasi dari model akan berisi nama fungsi dan nilai parameter yang digunakan untuk memanggil fungsi.
Berikut adalah contoh respons model terhadap perintah pengguna "Bagaimana cuaca di Boston?". Model ini mengusulkan untuk memanggil
fungsi get_current_weather
dengan parameter Boston, MA
.
candidates { content { role: "model" parts { function_call { name: "get_current_weather" args { fields { key: "location" value { string_value: "Boston, MA" } } } } } } ... }
Langkah 2: Berikan output API ke model
Panggil API eksternal dan teruskan output API kembali ke model.
Contoh berikut menggunakan data sintetis untuk menyimulasikan payload respons dari API eksternal dan mengirimkan output kembali ke model.
REST
PROJECT_ID=myproject
MODEL_ID=gemini-2.0-flash
LOCATION="us-central1"
curl -X POST \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
https://${LOCATION}-aiplatform.googleapis.com/v1/projects/${PROJECT_ID}/locations/${LOCATION}/publishers/google/models/${MODEL_ID}:generateContent \
-d '{
"contents": [
{
"role": "user",
"parts": {
"text": "What is the weather in Boston?"
}
},
{
"role": "model",
"parts": [
{
"functionCall": {
"name": "get_current_weather",
"args": {
"location": "Boston, MA"
}
}
}
]
},
{
"role": "user",
"parts": [
{
"functionResponse": {
"name": "get_current_weather",
"response": {
"temperature": 20,
"unit": "C"
}
}
}
]
}
],
"tools": [
{
"function_declarations": [
{
"name": "get_current_weather",
"description": "Get the current weather in a specific location",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The city name of the location for which to get the weather."
}
},
"required": [
"location"
]
}
}
]
}
]
}'
Python
function_response_contents = []
function_response_parts = []
# Iterates through the function calls in the response in case there are parallel function call requests
for function_call in response.candidates[0].function_calls:
print(f"Function call: {function_call.name}")
# In this example, we'll use synthetic data to simulate a response payload from an external API
if (function_call.args['location'] == "Boston, MA"):
api_response = { "location": "Boston, MA", "temperature": 38, "description": "Partly Cloudy" }
if (function_call.args['location'] == "San Francisco, CA"):
api_response = { "location": "San Francisco, CA", "temperature": 58, "description": "Sunny" }
function_response_parts.append(
Part.from_function_response(
name=function_call.name,
response={"contents": api_response}
)
)
# Add the function call response to the contents
function_response_contents = Content(role="user", parts=function_response_parts)
# Submit the User's prompt, model's response, and API output back to the model
response = model.generate_content(
[
Content( # User prompt
role="user",
parts=[
Part.from_text("What is the weather like in Boston?"),
],
),
response.candidates[0].content, # Function call response
function_response_contents # API output
],
tools=[
Tool(
function_declarations=[get_current_weather_func],
)
],
)
# Get the model summary response
print(response.text)
Untuk praktik terbaik terkait pemanggilan API, lihat Praktik terbaik - Pemanggilan API.
Jika model telah mengusulkan beberapa panggilan fungsi paralel, aplikasi harus memberikan semua respons kembali ke model. Untuk mempelajari lebih lanjut, lihat Contoh pemanggilan fungsi paralel.
Model dapat menentukan bahwa output fungsi lain diperlukan untuk merespons perintah. Dalam hal ini, respons yang diterima aplikasi dari model berisi nama fungsi lain dan kumpulan nilai parameter lainnya.
Jika model menentukan bahwa respons API cukup untuk merespons perintah pengguna, model akan membuat respons bahasa alami dan menampilkannya ke aplikasi. Dalam hal ini, aplikasi harus meneruskan respons kembali ke pengguna. Berikut adalah contoh respons bahasa alami:
It is currently 38 degrees Fahrenheit in Boston, MA with partly cloudy skies.
Pemanggilan fungsi paralel
Untuk perintah seperti "Dapatkan detail cuaca di Boston dan San Francisco?", model dapat mengusulkan beberapa panggilan fungsi paralel. Untuk mengetahui daftar model yang mendukung panggilan fungsi paralel, lihat Model yang didukung.
REST
Contoh ini menunjukkan skenario dengan satu fungsi get_current_weather
.
Perintah pengguna adalah "Dapatkan detail cuaca di Boston dan San Francisco?". Model
ini mengusulkan dua panggilan fungsi get_current_weather
paralel: satu dengan
parameter Boston
dan yang lainnya dengan parameter San Francisco
.
Untuk mempelajari parameter permintaan lebih lanjut, lihat Gemini API.
{ "candidates": [ { "content": { "role": "model", "parts": [ { "functionCall": { "name": "get_current_weather", "args": { "location": "Boston" } } }, { "functionCall": { "name": "get_current_weather", "args": { "location": "San Francisco" } } } ] }, ... } ], ... }
Perintah berikut menunjukkan cara memberikan output fungsi ke model. Ganti my-project dengan nama project Google Cloud Anda.
Permintaan model
PROJECT_ID=my-project MODEL_ID=gemini-2.0-flash LOCATION="us-central1" curl -X POST \ -H "Authorization: Bearer $(gcloud auth print-access-token)" \ -H "Content-Type: application/json" \ https://${LOCATION}-aiplatform.googleapis.com/v1/projects/${PROJECT_ID}/locations/${LOCATION}/publishers/google/models/${MODEL_ID}:generateContent \ -d '{ "contents": [ { "role": "user", "parts": { "text": "What is difference in temperature in Boston and San Francisco?" } }, { "role": "model", "parts": [ { "functionCall": { "name": "get_current_weather", "args": { "location": "Boston" } } }, { "functionCall": { "name": "get_current_weather", "args": { "location": "San Francisco" } } } ] }, { "role": "user", "parts": [ { "functionResponse": { "name": "get_current_weather", "response": { "temperature": 30.5, "unit": "C" } } }, { "functionResponse": { "name": "get_current_weather", "response": { "temperature": 20, "unit": "C" } } } ] } ], "tools": [ { "function_declarations": [ { "name": "get_current_weather", "description": "Get the current weather in a specific location", "parameters": { "type": "object", "properties": { "location": { "type": "string", "description": "The city name of the location for which to get the weather." } }, "required": [ "location" ] } } ] } ] }'
Respons bahasa alami yang dibuat oleh model mirip dengan berikut ini:
Respons model
[ { "candidates": [ { "content": { "parts": [ { "text": "The temperature in Boston is 30.5C and the temperature in San Francisco is 20C. The difference is 10.5C. \n" } ] }, "finishReason": "STOP", ... } ] ... } ]
Python
Contoh ini menunjukkan skenario dengan satu fungsi get_current_weather
.
Perintah pengguna adalah "Bagaimana cuaca di Boston dan San Francisco?".
Ganti my-project dengan nama project Google Cloud Anda.
import vertexai
from vertexai.generative_models import (
Content,
FunctionDeclaration,
GenerationConfig,
GenerativeModel,
Part,
Tool,
ToolConfig
)
# Initialize Vertex AI
# TODO(developer): Update the project
vertexai.init(project="my-project", location="us-central1")
# Initialize Gemini model
model = GenerativeModel(model_name="gemini-2.0-flash")
# Manual function declaration
get_current_weather_func = FunctionDeclaration(
name="get_current_weather",
description="Get the current weather in a given location",
# Function parameters are specified in JSON schema format
parameters={
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The city name of the location for which to get the weather.",
"default": {
"string_value": "Boston, MA"
}
}
},
},
)
response = model.generate_content(
contents = [
Content(
role="user",
parts=[
Part.from_text("What is the weather like in Boston and San Francisco?"),
],
)
],
generation_config = GenerationConfig(temperature=0),
tools = [
Tool(
function_declarations=[get_current_weather_func],
)
]
)
Perintah berikut menunjukkan cara memberikan output fungsi ke model.
function_response_contents = []
function_response_parts = []
# You can have parallel function call requests for the same function type.
# For example, 'location_to_lat_long("London")' and 'location_to_lat_long("Paris")'
# In that case, collect API responses in parts and send them back to the model
for function_call in response.candidates[0].function_calls:
print(f"Function call: {function_call.name}")
# In this example, we'll use synthetic data to simulate a response payload from an external API
if (function_call.args['location'] == "Boston, MA"):
api_response = { "location": "Boston, MA", "temperature": 38, "description": "Partly Cloudy" }
if (function_call.args['location'] == "San Francisco, CA"):
api_response = { "location": "San Francisco, CA", "temperature": 58, "description": "Sunny" }
function_response_parts.append(
Part.from_function_response(
name=function_call.name,
response={"contents": api_response}
)
)
# Add the function call response to the contents
function_response_contents = Content(role="user", parts=function_response_parts)
function_response_contents
response = model.generate_content(
contents = [
Content(
role="user",
parts=[
Part.from_text("What is the weather like in Boston and San Francisco?"),
],
), # User prompt
response.candidates[0].content, # Function call response
function_response_contents, # Function response
],
tools = [
Tool(
function_declarations=[get_current_weather_func],
)
]
)
# Get the model summary response
print(response.text)
Go
Pemanggilan fungsi paksa
Daripada mengizinkan model memilih antara respons bahasa alami dan panggilan fungsi, Anda dapat memaksanya untuk hanya memprediksi panggilan fungsi. Hal ini dikenal sebagai panggilan fungsi paksa. Anda juga dapat memilih untuk memberikan kumpulan deklarasi fungsi lengkap ke model, tetapi membatasi responsnya ke sebagian fungsi ini.
Mode | Deskripsi |
---|---|
AUTO |
Perilaku model default. Model memutuskan apakah akan memprediksi panggilan fungsi atau respons bahasa alami. |
ANY |
Model dibatasi untuk selalu memprediksi panggilan fungsi. Jika allowed_function_names tidak diberikan, model akan memilih dari semua deklarasi fungsi yang tersedia. Jika allowed_function_names disediakan, model akan memilih dari kumpulan fungsi yang diizinkan. |
NONE |
Model tidak boleh memprediksi panggilan fungsi. Perilaku ini setara dengan permintaan model tanpa deklarasi fungsi terkait. |
Contoh berikut dipaksa untuk hanya memprediksi panggilan fungsi get_weather
.
Python
response = model.generate_content(
contents = [
Content(
role="user",
parts=[
Part.from_text("What is the weather like in Boston?"),
],
)
],
generation_config = GenerationConfig(temperature=0),
tools = [
Tool(
function_declarations=[get_weather_func, some_other_function],
)
],
tool_config=ToolConfig(
function_calling_config=ToolConfig.FunctionCallingConfig(
# ANY mode forces the model to predict only function calls
mode=ToolConfig.FunctionCallingConfig.Mode.ANY,
# Allowed function calls to predict when the mode is ANY. If empty, any of
# the provided function calls will be predicted.
allowed_function_names=["get_weather"],
)
)
)
Contoh skema fungsi
Deklarasi fungsi kompatibel dengan skema OpenAPI. Kami mendukung atribut berikut: type
, nullable
, required
, format
, description
, properties
, items
, enum
, anyOf
, $ref
, dan $defs
. Atribut yang tersisa tidak didukung.
Fungsi dengan parameter objek dan array
Contoh berikut menggunakan kamus Python untuk mendeklarasikan fungsi yang menggunakan parameter objek dan array:
extract_sale_records_func = FunctionDeclaration( name="extract_sale_records", description="Extract sale records from a document.", parameters={ "type": "object", "properties": { "records": { "type": "array", "description": "A list of sale records", "items": { "description": "Data for a sale record", "type": "object", "properties": { "id": {"type": "integer", "description": "The unique id of the sale."}, "date": {"type": "string", "description": "Date of the sale, in the format of MMDDYY, e.g., 031023"}, "total_amount": {"type": "number", "description": "The total amount of the sale."}, "customer_name": {"type": "string", "description": "The name of the customer, including first name and last name."}, "customer_contact": {"type": "string", "description": "The phone number of the customer, e.g., 650-123-4567."}, }, "required": ["id", "date", "total_amount"], }, }, }, "required": ["records"], }, )
Fungsi dengan parameter enum
Contoh berikut menggunakan kamus Python untuk mendeklarasikan fungsi yang menggunakan parameter enum
bilangan bulat:
set_status_func = FunctionDeclaration( name="set_status", description="set a ticket's status field", # Function parameters are specified in JSON schema format parameters={ "type": "object", "properties": { "status": { "type": "integer", "enum": [ "10", "20", "30" ], # Provide integer (or any other type) values as strings. } }, }, )
Fungsi dengan ref dan def
Deklarasi fungsi JSON berikut menggunakan atribut ref
dan defs
:
{ "contents": ..., "tools": [ { "function_declarations": [ { "name": "get_customer", "description": "Search for a customer by name", "parameters": { "type": "object", "properties": { "first_name": { "ref": "#/defs/name" }, "last_name": { "ref": "#/defs/name" } }, "defs": { "name": { "type": "string" } } } } ] } ] }
Catatan penggunaan:
- Tidak seperti skema OpenAPI, tentukan
ref
dandefs
tanpa simbol$
. ref
harus merujuk ke turunan langsungdefs
; tidak ada referensi eksternal.- Kedalaman maksimum skema bertingkat adalah 32.
- Kedalaman rekursi di
defs
(referensi mandiri) dibatasi hingga dua.
from_func
dengan parameter array
Contoh kode berikut mendeklarasikan fungsi yang mengalikan array angka dan menggunakan from_func
untuk membuat skema FunctionDeclaration
.
from typing import List # Define a function. Could be a local function or you can import the requests library to call an API def multiply_numbers(numbers: List[int] = [1, 1]) -> int: """ Calculates the product of all numbers in an array. Args: numbers: An array of numbers to be multiplied. Returns: The product of all the numbers. If the array is empty, returns 1. """ if not numbers: # Handle empty array return 1 product = 1 for num in numbers: product *= num return product multiply_number_func = FunctionDeclaration.from_func(multiply_numbers) """ multiply_number_func contains the following schema: {'name': 'multiply_numbers', 'description': 'Calculates the product of all numbers in an array.', 'parameters': {'properties': {'numbers': {'items': {'type': 'INTEGER'}, 'description': 'list of numbers', 'default': [1.0, 1.0], 'title': 'Numbers', 'type': 'ARRAY'}}, 'description': 'Calculates the product of all numbers in an array.', 'title': 'multiply_numbers', 'property_ordering': ['numbers'], 'type': 'OBJECT'}} """
Praktik terbaik untuk panggilan fungsi
Menulis nama fungsi, deskripsi parameter, dan petunjuk yang jelas dan mendetail
Nama fungsi harus diawali dengan huruf atau garis bawah dan hanya boleh berisi karakter a-z, A-Z, 0-9, garis bawah, titik, atau tanda hubung dengan panjang maksimum 64.
Deskripsi fungsi harus jelas dan panjang. Misalnya, fungsi
book_flight_ticket
dapat memiliki deskripsibook flight tickets after confirming users' specific requirements, such as time, departure, destination, party size and preferred airline
Menggunakan parameter dengan jenis yang kuat
Jika nilai parameter berasal dari kumpulan terbatas, tambahkan kolom enum
, bukan memasukkan kumpulan nilai ke dalam deskripsi. Jika nilai parameter selalu berupa bilangan bulat, tetapkan jenisnya ke integer
, bukan number
.
Menggunakan petunjuk sistem
Saat menggunakan fungsi dengan parameter tanggal, waktu, atau lokasi, sertakan tanggal, waktu, atau informasi lokasi yang relevan saat ini (misalnya, kota dan negara) dalam petunjuk sistem. Hal ini memberi model konteks yang diperlukan untuk memproses permintaan secara akurat, meskipun perintah pengguna tidak memiliki detail.
Memperbarui perintah pengguna
Untuk hasil terbaik, tambahkan perintah pengguna dengan detail berikut:
- Konteks tambahan untuk model-misalnya,
You are a flight API assistant to help with searching flights based on user preferences.
- Detail atau petunjuk tentang cara dan waktu menggunakan fungsi-misalnya,
Don't make assumptions on the departure or destination airports. Always use a future date for the departure or destination time.
- Petunjuk untuk mengajukan pertanyaan klarifikasi jika kueri pengguna ambigu-misalnya,
Ask clarifying questions if not enough information is available.
Menggunakan konfigurasi pembuatan
Untuk parameter suhu, gunakan 0
atau nilai rendah lainnya. Hal ini akan memerintahkan
model untuk menghasilkan hasil yang lebih meyakinkan dan mengurangi halusinasi.
Memvalidasi panggilan API
Jika model mengusulkan pemanggilan fungsi yang akan mengirim pesanan, memperbarui database, atau memiliki konsekuensi yang signifikan, validasikan panggilan fungsi dengan pengguna sebelum mengeksekusinya.
Harga
Harga untuk panggilan fungsi didasarkan pada jumlah karakter dalam input dan output teks. Untuk mempelajari lebih lanjut, lihat Harga Vertex AI.
Di sini, input teks (perintah) mengacu pada perintah pengguna untuk giliran percakapan saat ini, deklarasi fungsi untuk giliran percakapan saat ini, dan histori percakapan. Histori percakapan mencakup kueri, panggilan fungsi, dan respons fungsi dari putaran percakapan sebelumnya. Vertex AI memotong histori percakapan pada 32.000 karakter.
Output teks (respons) mengacu pada panggilan fungsi dan respons teks untuk giliran percakapan saat ini.
Langkah berikutnya
Pelajari Vertex AI Agent Engine.