رابط برنامهنویسی کاربردی (API) جمینی (Gemini) از تولید محتوا با تصاویر، صدا، کد، ابزارها و موارد دیگر پشتیبانی میکند. برای جزئیات بیشتر در مورد هر یک از این ویژگیها، ادامه مطلب را بخوانید و نمونه کد متمرکز بر وظیفه را بررسی کنید، یا راهنماهای جامع را مطالعه کنید.
- تولید متن
- چشم انداز
- صوتی
- جاسازیها
- زمینه طولانی
- اجرای کد
- حالت JSON
- فراخوانی تابع
- System instructions
روش: models.generateContent
با دریافت ورودی GenerateContentRequest ، یک پاسخ مدل تولید میکند. برای اطلاعات دقیق در مورد نحوهی استفاده، به راهنمای تولید متن مراجعه کنید. قابلیتهای ورودی بین مدلها، از جمله مدلهای تنظیمشده، متفاوت است. برای جزئیات بیشتر به راهنمای مدل و راهنمای تنظیم مراجعه کنید.
نقطه پایانی
پستhttps: / /generativelanguage.googleapis.com /v1beta /{model=models /*}:generateContentپارامترهای مسیر
string model الزامی. نام Model که برای تولید تکمیل استفاده میشود.
قالب: models/{model} . این قالب به صورت models/{model} است.
درخواست بدنه
بدنه درخواست شامل دادههایی با ساختار زیر است:
contents[]object ( Content )الزامی. محتوای مکالمه فعلی با مدل.
برای پرسوجوهای تک نوبتی، این یک نمونه واحد است. برای پرسوجوهای چند نوبتی مانند چت ، این یک فیلد تکراری است که شامل سابقه مکالمه و آخرین درخواست است.
tools[]object ( Tool ) اختیاری. فهرستی از Tools Model ممکن است برای تولید پاسخ بعدی استفاده کند.
یک Tool ، قطعه کدی است که سیستم را قادر میسازد تا با سیستمهای خارجی تعامل داشته باشد تا یک یا مجموعهای از اقدامات را خارج از دانش و محدوده Model انجام دهد. Tool پشتیبانی شده عبارتند از Function و codeExecution . برای کسب اطلاعات بیشتر به راهنماهای فراخوانی تابع (Function) و اجرای کد (Code Execution) مراجعه کنید.
toolConfigobject ( ToolConfig ) اختیاری. پیکربندی ابزار برای هر Tool که در درخواست مشخص شده است. برای مثال استفاده به راهنمای فراخوانی تابع مراجعه کنید.
safetySettings[]object ( SafetySetting ) اختیاری. فهرستی از نمونههای منحصر به فرد SafetySetting برای مسدود کردن محتوای ناامن.
این مورد روی GenerateContentRequest.contents و GenerateContentResponse.candidates اعمال خواهد شد. برای هر نوع SafetyCategory نباید بیش از یک تنظیم وجود داشته باشد. API هر محتوا و پاسخی را که آستانههای تعیینشده توسط این تنظیمات را برآورده نکند، مسدود میکند. این لیست، تنظیمات پیشفرض برای هر SafetyCategory مشخصشده در safetySettings را لغو میکند. اگر هیچ SafetySetting برای یک SafetyCategory مشخصشده در لیست وجود نداشته باشد، API از تنظیم ایمنی پیشفرض برای آن دسته استفاده خواهد کرد. دستههای آسیب HARM_CATEGORY_HATE_SPEECH، HARM_CATEGORY_SEXUALLY_EXPLICIT، HARM_CATEGORY_DANGEROUS_CONTENT، HARM_CATEGORY_HARASSMENT، HARM_CATEGORY_CIVIC_INTEGRITY، HARM_CATEGORY_JAILBREAK پشتیبانی میشوند. برای اطلاعات دقیق در مورد تنظیمات ایمنی موجود، به راهنما مراجعه کنید. همچنین برای یادگیری نحوه لحاظ کردن ملاحظات ایمنی در برنامههای هوش مصنوعی خود، به راهنمای ایمنی مراجعه کنید.
systemInstructionobject ( Content )اختیاری. دستورالعمل(های) سیستم توسط توسعهدهنده تنظیم میشود. در حال حاضر، فقط متن.
generationConfigobject ( GenerationConfig )اختیاری. گزینههای پیکربندی برای تولید مدل و خروجیها.
string cachedContent اختیاری. نام محتوای ذخیره شده برای استفاده به عنوان زمینه برای ارائه پیشبینی. قالب: cachedContents/{cachedContent}
serviceTierenum ( ServiceTier )اختیاری. سطح سرویس درخواست.
storebooleanاختیاری. رفتار ثبت وقایع را برای یک درخواست مشخص پیکربندی میکند. در صورت تنظیم، بر پیکربندی ثبت وقایع در سطح پروژه اولویت دارد.
درخواست نمونه
متن
پایتون
نود جی اس
برو
پوسته
جاوا
تصویر
پایتون
نود جی اس
برو
پوسته
جاوا
صوتی
پایتون
نود جی اس
برو
پوسته
ویدئو
پایتون
نود جی اس
برو
پوسته
پی دی اف
پایتون
برو
پوسته
چت
پایتون
نود جی اس
برو
پوسته
جاوا
حافظه پنهان
پایتون
نود جی اس
برو
مدل تنظیمشده
پایتون
حالت JSON
پایتون
نود جی اس
برو
پوسته
جاوا
اجرای کد
پایتون
برو
جاوا
فراخوانی تابع
پایتون
برو
نود جی اس
پوسته
جاوا
پیکربندی نسل
پایتون
نود جی اس
برو
پوسته
جاوا
تنظیمات ایمنی
پایتون
نود جی اس
برو
پوسته
جاوا
System Instruction
پایتون
نود جی اس
برو
پوسته
جاوا
بدنه پاسخ
در صورت موفقیت، بدنه پاسخ شامل نمونهای از GenerateContentResponse است.
روش: models.streamGenerateContent
با دریافت ورودی GenerateContentRequest یک پاسخ استریمشده از مدل تولید میکند.
نقطه پایانی
پستhttps: / /generativelanguage.googleapis.com /v1beta /{model=models /*}:streamGenerateContentپارامترهای مسیر
string model الزامی. نام Model که برای تولید تکمیل استفاده میشود.
قالب: models/{model} . این قالب به صورت models/{model} است.
درخواست بدنه
بدنه درخواست شامل دادههایی با ساختار زیر است:
contents[]object ( Content )الزامی. محتوای مکالمه فعلی با مدل.
برای پرسوجوهای تک نوبتی، این یک نمونه واحد است. برای پرسوجوهای چند نوبتی مانند چت ، این یک فیلد تکراری است که شامل سابقه مکالمه و آخرین درخواست است.
tools[]object ( Tool ) اختیاری. فهرستی از Tools Model ممکن است برای تولید پاسخ بعدی استفاده کند.
یک Tool ، قطعه کدی است که سیستم را قادر میسازد تا با سیستمهای خارجی تعامل داشته باشد تا یک یا مجموعهای از اقدامات را خارج از دانش و محدوده Model انجام دهد. Tool پشتیبانی شده عبارتند از Function و codeExecution . برای کسب اطلاعات بیشتر به راهنماهای فراخوانی تابع (Function) و اجرای کد (Code Execution) مراجعه کنید.
toolConfigobject ( ToolConfig ) اختیاری. پیکربندی ابزار برای هر Tool که در درخواست مشخص شده است. برای مثال استفاده به راهنمای فراخوانی تابع مراجعه کنید.
safetySettings[]object ( SafetySetting ) اختیاری. فهرستی از نمونههای منحصر به فرد SafetySetting برای مسدود کردن محتوای ناامن.
این مورد روی GenerateContentRequest.contents و GenerateContentResponse.candidates اعمال خواهد شد. برای هر نوع SafetyCategory نباید بیش از یک تنظیم وجود داشته باشد. API هر محتوا و پاسخی را که آستانههای تعیینشده توسط این تنظیمات را برآورده نکند، مسدود میکند. این لیست، تنظیمات پیشفرض برای هر SafetyCategory مشخصشده در safetySettings را لغو میکند. اگر هیچ SafetySetting برای یک SafetyCategory مشخصشده در لیست وجود نداشته باشد، API از تنظیم ایمنی پیشفرض برای آن دسته استفاده خواهد کرد. دستههای آسیب HARM_CATEGORY_HATE_SPEECH، HARM_CATEGORY_SEXUALLY_EXPLICIT، HARM_CATEGORY_DANGEROUS_CONTENT، HARM_CATEGORY_HARASSMENT، HARM_CATEGORY_CIVIC_INTEGRITY، HARM_CATEGORY_JAILBREAK پشتیبانی میشوند. برای اطلاعات دقیق در مورد تنظیمات ایمنی موجود، به راهنما مراجعه کنید. همچنین برای یادگیری نحوه لحاظ کردن ملاحظات ایمنی در برنامههای هوش مصنوعی خود، به راهنمای ایمنی مراجعه کنید.
systemInstructionobject ( Content )اختیاری. دستورالعمل(های) سیستم توسط توسعهدهنده تنظیم میشود. در حال حاضر، فقط متن.
generationConfigobject ( GenerationConfig )اختیاری. گزینههای پیکربندی برای تولید مدل و خروجیها.
string cachedContent اختیاری. نام محتوای ذخیره شده برای استفاده به عنوان زمینه برای ارائه پیشبینی. قالب: cachedContents/{cachedContent}
serviceTierenum ( ServiceTier )اختیاری. سطح سرویس درخواست.
storebooleanاختیاری. رفتار ثبت وقایع را برای یک درخواست مشخص پیکربندی میکند. در صورت تنظیم، بر پیکربندی ثبت وقایع در سطح پروژه اولویت دارد.
درخواست نمونه
متن
پایتون
نود جی اس
برو
پوسته
جاوا
تصویر
پایتون
نود جی اس
برو
پوسته
جاوا
صوتی
پایتون
برو
پوسته
ویدئو
پایتون
نود جی اس
برو
پوسته
پی دی اف
پایتون
برو
پوسته
چت
پایتون
نود جی اس
برو
پوسته
بدنه پاسخ
در صورت موفقیت، بدنه پاسخ شامل جریانی از نمونههای GenerateContentResponse است.
تولید پاسخ محتوا
پاسخ از مدلی که از پاسخهای کاندید چندگانه پشتیبانی میکند.
رتبهبندیهای ایمنی و فیلترینگ محتوا برای هر دو مورد در GenerateContentResponse.prompt_feedback و برای هر کاندید در finishReason و safetyRatings گزارش میشوند. API: - یا همه کاندیدهای درخواستی یا هیچکدام از آنها را برمیگرداند. - فقط در صورتی که مشکلی در اعلان وجود داشته باشد، هیچ کاندیدی را برنمیگرداند ( promptFeedback بررسی کنید). - بازخورد مربوط به هر کاندید را در finishReason و safetyRatings گزارش میدهد.
candidates[]object ( Candidate )پاسخهای کاندیداها از مدل.
promptFeedbackobject ( PromptFeedback )بازخورد مربوط به فیلترهای محتوا را برمیگرداند.
usageMetadataobject ( UsageMetadata )فقط خروجی. فراداده در مورد استفاده از توکن در درخواستهای تولید.
string modelVersionفقط خروجی. نسخه مدل مورد استفاده برای تولید پاسخ.
string responseIdفقط خروجی. responseId برای شناسایی هر پاسخ استفاده میشود.
modelStatusobject ( ModelStatus )فقط خروجی. وضعیت فعلی مدل این مدل.
| نمایش JSON |
|---|
{ "candidates": [ { object ( |
بازخورد سریع
مجموعهای از فرادادههای بازخورد که در اعلان GenerateContentRequest.content مشخص شدهاند.
blockReasonenum ( BlockReason )اختیاری. در صورت تنظیم، اعلان مسدود شده و هیچ نامزدی بازگردانده نمیشود. اعلان را به صورت دیگری بنویسید.
safetyRatings[]object ( SafetyRating )رتبهبندیها برای ایمنی سوال. حداکثر یک رتبهبندی برای هر دسته وجود دارد.
| نمایش JSON |
|---|
{ "blockReason": enum ( |
بلاکریجن
دلیل مسدود شدن اعلان را مشخص میکند.
| انومها | |
|---|---|
BLOCK_REASON_UNSPECIFIED | مقدار پیشفرض. این مقدار استفاده نشده است. |
SAFETY | به دلایل ایمنی، درخواست مسدود شد. برای فهمیدن اینکه کدام دسته از دستهبندیهای ایمنی آن را مسدود کرده است، safetyRatings بررسی کنید. |
OTHER | به دلایل نامعلومی، پیام رسان مسدود شد. |
BLOCKLIST | به دلیل وجود اصطلاحاتی که در فهرست اصطلاحات مسدود شده وجود دارند، درخواست مسدود شد. |
PROHIBITED_CONTENT | به دلیل محتوای ممنوعه، اعلان مسدود شد. |
IMAGE_SAFETY | کاندیداها به دلیل محتوای تولید تصویر ناامن مسدود شدند. |
کاربردفراداده
فراداده در مورد استفاده از توکن درخواست تولید.
integer promptTokenCount تعداد توکنهای موجود در اعلان. وقتی cachedContent تنظیم شده باشد، این مقدار همچنان اندازه کل مؤثر اعلان است، به این معنی که شامل تعداد توکنهای موجود در محتوای ذخیره شده نیز میشود.
integer cachedContentTokenCountتعداد توکنها در بخش ذخیرهشدهی اعلان (محتوای ذخیرهشده)
integer candidatesTokenCountتعداد کل توکنها در بین تمام کاندیدهای پاسخ تولید شده.
toolUsePromptTokenCountintegerفقط خروجی. تعداد توکنهای موجود در اعلان(های) استفاده از ابزار.
integer thoughtsTokenCountفقط خروجی. تعداد توکنهای افکار برای مدلهای تفکر.
integer totalTokenCountتعداد کل توکنها برای درخواست تولید (درخواست + افکار + نامزدهای پاسخ).
promptTokensDetails[]object ( ModalityTokenCount )فقط خروجی. فهرست روشهایی که در ورودی درخواست پردازش شدهاند.
cacheTokensDetails[]object ( ModalityTokenCount )فقط خروجی. فهرستی از روشهای محتوای ذخیرهشده در ورودی درخواست.
candidatesTokensDetails[]object ( ModalityTokenCount )فقط خروجی. فهرست روشهایی که در پاسخ برگردانده شدهاند.
toolUsePromptTokensDetails[]object ( ModalityTokenCount )فقط خروجی. فهرست روشهایی که برای ورودیهای درخواست استفاده از ابزار پردازش شدهاند.
serviceTierenum ( ServiceTier )فقط خروجی. سطح سرویس درخواست.
| نمایش JSON |
|---|
{ "promptTokenCount": integer, "cachedContentTokenCount": integer, "candidatesTokenCount": integer, "toolUsePromptTokenCount": integer, "thoughtsTokenCount": integer, "totalTokenCount": integer, "promptTokensDetails": [ { object ( |
وضعیت مدل
وضعیت مدل زیربنایی. این مورد برای نشان دادن مرحله مدل زیربنایی و در صورت لزوم، زمان کنار گذاشتن مدل استفاده میشود.
modelStageenum ( ModelStage )مرحله مدل زیربنایی.
retirementTimestring ( Timestamp format)زمانی که مدل بازنشسته خواهد شد.
از RFC 3339 استفاده میکند، که در آن خروجی تولید شده همیشه به صورت Z-normalized خواهد بود و از ارقام کسری ۰، ۳، ۶ یا ۹ استفاده میکند. آفستهای غیر از "Z" نیز پذیرفته میشوند. مثالها: "2014-10-02T15:01:23Z" ، "2014-10-02T15:01:23.045123456Z" یا "2014-10-02T15:01:23+05:30" .
string messageپیامی که وضعیت مدل را توضیح میدهد.
| نمایش JSON |
|---|
{
"modelStage": enum ( |
مدل استیج
مرحله مدل زیربنایی را تعریف میکند.
| انومها | |
|---|---|
MODEL_STAGE_UNSPECIFIED | مرحله مدل نامشخص. |
UNSTABLE_EXPERIMENTAL | مدل زیربنایی دستخوش تغییرات زیادی شده است. |
EXPERIMENTAL | مدلهای این مرحله فقط برای اهداف آزمایشی هستند. |
PREVIEW | مدلهای این مرحله، بالغتر از مدلهای آزمایشی هستند. |
STABLE | مدلهای موجود در این مرحله پایدار و آماده برای استفاده در تولید در نظر گرفته میشوند. |
LEGACY | اگر مدل در این مرحله باشد، به این معنی است که این مدل در آینده نزدیک در مسیر منسوخ شدن است. فقط مشتریان فعلی میتوانند از این مدل استفاده کنند. |
DEPRECATED | مدلهای این مرحله منسوخ شدهاند. این مدلها قابل استفاده نیستند. |
RETIRED | مدلهای این مرحله از رده خارج میشوند. این مدلها قابل استفاده نیستند. |
نامزد
- نمایش JSON
- دلیل پایان
- انتساب زمینی
- شناسه منبع انتساب
- شناسه گذرگاه زمین
- SemanticRetrieverChunk
- فراداده زمینی
- جستجوی ورودی
- گراندینگ چانک
- وب
- تصویر
- بازیابیشدهزمینه
- متاداده سفارشی
- لیست رشتهای
- نقشهها
- منابع PlaceAnswer
- نقد و بررسی قطعه کد
- پشتیبانی اتصال به زمین
- بخش
- بازیابیفراداده
- نتیجهی لاگپروبز
- کاندیداهای برتر
- نامزد
- فرادادهی UrlContext
- آدرس فراداده
- وضعیت بازیابی آدرس
یک کاندید پاسخ که از مدل تولید شده است.
contentobject ( Content )فقط خروجی. محتوای تولید شده از مدل برگردانده میشود.
finishReasonenum ( FinishReason )اختیاری. فقط خروجی. دلیل اینکه مدل تولید توکنها را متوقف کرد.
اگر خالی باشد، مدل تولید توکنها را متوقف نکرده است.
safetyRatings[]object ( SafetyRating )فهرست رتبهبندیها برای ایمنی یک کاندیدای پاسخ.
حداکثر یک رتبهبندی برای هر دسته وجود دارد.
citationMetadataobject ( CitationMetadata )فقط خروجی. اطلاعات استناد برای کاندیدای تولید شده توسط مدل.
این فیلد میتواند با اطلاعات تلاوت برای هر متنی که در content وجود دارد، پر شود. اینها قطعاتی هستند که از مطالب دارای حق چاپ در دادههای آموزشی LLM پایه "تلاوت" میشوند.
integer tokenCountفقط خروجی. تعداد توکنها برای این نامزد.
groundingAttributions[]object ( GroundingAttribution )فقط خروجی. اطلاعات انتساب منابعی که در ارائه پاسخی مستدل نقش داشتهاند.
این فیلد برای فراخوانیهای GenerateAnswer پر میشود.
groundingMetadataobject ( GroundingMetadata )فقط خروجی. ابرداده پایه برای کاندیدا.
این فیلد برای فراخوانیهای GenerateContent پر میشود.
number avgLogprobsفقط خروجی. میانگین لگاریتم نمره احتمال داوطلب.
logprobsResultobject ( LogprobsResult )فقط خروجی. نمرات لگاریتم درستنمایی برای توکنهای پاسخ و توکنهای برتر
urlContextMetadataobject ( UrlContextMetadata )فقط خروجی. فراداده مربوط به ابزار بازیابی متن url.
integer indexفقط خروجی. فهرست کاندیدا در فهرست کاندیداهای پاسخ.
string finishMessage اختیاری. فقط خروجی. دلیل توقف تولید توکنها توسط مدل را شرح میدهد. این مقدار فقط زمانی پر میشود که finishReason تنظیم شده باشد.
| نمایش JSON |
|---|
{ "content": { object ( |
دلیل پایان
دلیل توقف تولید توکنها توسط مدل را تعریف میکند.
| انومها | |
|---|---|
FINISH_REASON_UNSPECIFIED | مقدار پیشفرض. این مقدار استفاده نشده است. |
STOP | نقطه توقف طبیعی مدل یا توالی توقف ارائه شده. |
MAX_TOKENS | حداکثر تعداد توکنها همانطور که در درخواست مشخص شده بود، حاصل شد. |
SAFETY | محتوای کاندید پاسخ به دلایل ایمنی علامتگذاری شد. |
RECITATION | محتوای کاندید پاسخ به دلایل تکرار علامتگذاری شد. |
LANGUAGE | محتوای کاندید پاسخ به دلیل استفاده از زبانی که پشتیبانی نمیشود، علامتگذاری شد. |
OTHER | دلیل نامعلوم. |
BLOCKLIST | تولید توکن متوقف شد زیرا محتوا حاوی عبارات ممنوعه است. |
PROHIBITED_CONTENT | تولید توکن به دلیل احتمال وجود محتوای ممنوعه متوقف شد. |
SPII | تولید توکن متوقف شد زیرا محتوا احتمالاً حاوی اطلاعات حساس قابل شناسایی شخصی (SPII) است. |
MALFORMED_FUNCTION_CALL | فراخوانی تابع تولید شده توسط مدل نامعتبر است. |
IMAGE_SAFETY | تولید توکن متوقف شد زیرا تصاویر تولید شده حاوی موارد نقض ایمنی بودند. |
IMAGE_PROHIBITED_CONTENT | تولید تصویر متوقف شد زیرا تصاویر تولید شده حاوی محتوای ممنوعه دیگری بودند. |
IMAGE_OTHER | تولید تصویر به دلیل مشکلات متفرقه دیگر متوقف شد. |
NO_IMAGE | انتظار میرفت که این مدل یک تصویر ایجاد کند، اما هیچ تصویری ایجاد نشد. |
IMAGE_RECITATION | تولید تصویر به دلیل تلاوت متوقف شد. |
UNEXPECTED_TOOL_CALL | مدل یک فراخوانی ابزار ایجاد کرد اما هیچ ابزاری در درخواست فعال نشد. |
TOO_MANY_TOOL_CALLS | مدل، ابزارهای زیادی را پشت سر هم فراخوانی کرد، بنابراین سیستم از اجرا خارج شد. |
MISSING_THOUGHT_SIGNATURE | درخواست حداقل یک امضای فکری ندارد. |
MALFORMED_RESPONSE | به دلیل پاسخ ناقص، تکمیل شد. |
ESCALATION | درخواست توسط یک قانون تشدید فیلتر شد. |
انتساب زمینی
انتساب منبعی که در پاسخ به یک سوال نقش داشته است.
sourceIdobject ( AttributionSourceId )فقط خروجی. شناسه منبعی که در این انتساب مشارکت داشته است.
contentobject ( Content )محتوای منبع پایه که این انتساب را تشکیل میدهد.
| نمایش JSON |
|---|
{ "sourceId": { object ( |
شناسه منبع انتساب
شناسه منبعی که در این انتساب مشارکت داشته است.
sourceUnion typesource میتواند فقط یکی از موارد زیر باشد: groundingPassageobject ( GroundingPassageId )شناسه برای یک متن درونخطی.
semanticRetrieverChunkobject ( SemanticRetrieverChunk ) شناسهای برای یک Chunk که از طریق بازیابی معنایی واکشی شده است.
| نمایش JSON |
|---|
{ // source "groundingPassage": { object ( |
شناسه گذرگاه زمین
شناسهای برای یک قطعه درون یک GroundingPassage .
string passageId فقط خروجی. شناسهی متنی که با GroundingPassage.id مربوط به GenerateAnswerRequest مطابقت دارد.
integer partIndex فقط خروجی. اندیس قطعه درون GroundingPassage.content مربوط به GenerateAnswerRequest .
| نمایش JSON |
|---|
{ "passageId": string, "partIndex": integer } |
SemanticRetrieverChunk
شناسهای برای یک Chunk بازیابی شده از طریق Semantic Retriever که در GenerateAnswerRequest با استفاده از SemanticRetrieverConfig مشخص شده است.
string source فقط خروجی. نام منبعی که با SemanticRetrieverConfig.source درخواست مطابقت دارد. مثال: corpora/123 یا corpora/123/documents/abc
string chunk فقط خروجی. نام Chunk که شامل متن نسبت داده شده است. مثال: corpora/123/documents/abc/chunks/xyz
| نمایش JSON |
|---|
{ "source": string, "chunk": string } |
فراداده زمینی
هنگام فعال شدن اتصال به زمین، فراداده به کلاینت بازگردانده میشود.
groundingChunks[]object ( GroundingChunk )فهرست منابع پشتیبان بازیابیشده از منبع اتصال به زمین مشخصشده. هنگام پخش، این فهرست فقط شامل بخشهای اتصال به زمین است که در فرادادههای اتصال به زمین پاسخهای قبلی گنجانده نشدهاند.
groundingSupports[]object ( GroundingSupport )فهرست پشتیبانی زمینی.
string webSearchQueries[]عبارتهای جستجوی وب برای جستجوی وب بعدی.
string imageSearchQueries[]پرسوجوهای جستجوی تصویر که برای اتصال به زمین استفاده میشوند.
searchEntryPointobject ( SearchEntryPoint )اختیاری. ورودی جستجوی گوگل برای جستجوهای وب بعدی.
retrievalMetadataobject ( RetrievalMetadata )فراداده مربوط به بازیابی در جریان اتصال به زمین.
string googleMapsWidgetContextTokenاختیاری. نام منبع توکن زمینه ویجت نقشههای گوگل که میتواند با ویجت PlacesContextElement برای رندر کردن دادههای زمینهای استفاده شود. فقط در صورتی که اتصال به زمین با نقشههای گوگل فعال باشد، مقداردهی میشود.
| نمایش JSON |
|---|
{ "groundingChunks": [ { object ( |
جستجوی ورودی
نقطه ورود جستجوی گوگل.
string renderedContentاختیاری. قطعه محتوای وب که میتواند در یک صفحه وب یا نمای وب یک برنامه جاسازی شود.
sdkBlobstring ( bytes format)اختیاری. JSON کدگذاری شده با Base64 که آرایهای از تاپلهای <search term, search url> را نشان میدهد.
یک رشته کدگذاری شده با base64.
| نمایش JSON |
|---|
{ "renderedContent": string, "sdkBlob": string } |
گراندینگ چانک
یک GroundingChunk بخشی از شواهد پشتیبان را نشان میدهد که پاسخ مدل را توجیه میکند. این میتواند یک تکه از وب، یک زمینه بازیابی شده از یک فایل یا اطلاعات از Google Maps باشد.
chunk_typeUnion typechunk_type فقط میتواند یکی از موارد زیر باشد:webobject ( Web )تکهای از تار عنکبوت که به زمین وصل میشود.
imageobject ( Image )اختیاری. قطعه اتصال به زمین از جستجوی تصویر.
retrievedContextobject ( RetrievedContext )اختیاری. تکه زمین از متن بازیابی شده توسط ابزار جستجوی فایل.
mapsobject ( Maps )اختیاری. قطعه اتصال به زمین از نقشههای گوگل.
| نمایش JSON |
|---|
{ // chunk_type "web": { object ( |
وب
تکهای از وب.
string uriفقط خروجی. مرجع URI مربوط به آن تکه داده.
string titleفقط خروجی. عنوان قطعه.
| نمایش JSON |
|---|
{ "uri": string, "title": string } |
تصویر
بخشی از جستجوی تصویر.
string sourceUriآدرس اینترنتی (URI) صفحه وب برای انتساب.
string imageUriآدرس اینترنتی (URL) تصویر.
string titleعنوان صفحه وبی که تصویر از آن گرفته شده است.
string domainدامنه اصلی صفحه وبی که تصویر از آن است، مثلاً "example.com".
| نمایش JSON |
|---|
{ "sourceUri": string, "imageUri": string, "title": string, "domain": string } |
بازیابیشدهزمینه
تکهای از متن که توسط ابزار جستجوی فایل بازیابی شده است.
customMetadata[]object ( CustomMetadata )اختیاری. فرادادههای ارائه شده توسط کاربر در مورد زمینه بازیابی شده.
string uriاختیاری. مرجع URI سند بازیابی معنایی.
string titleاختیاری. عنوان سند.
string textاختیاری. متن قطعه کد.
string fileSearchStore اختیاری. نام FileSearchStore که سند در آن قرار دارد. مثال: fileSearchStores/123
integer pageNumberاختیاری. شماره صفحه متن بازیابی شده، در صورت وجود.
string mediaIdاختیاری. نام منبع media blob برای نتایج جستجوی فایل چندوجهی. فرمت: fileSearchStores/{file_search_store_id}/media/{blobId}
| نمایش JSON |
|---|
{
"customMetadata": [
{
object ( |
متاداده سفارشی
کاربر فرادادهای در مورد GroundingFact ارائه داد.
string keyکلید فراداده.
Union type valuevalue میتواند فقط یکی از موارد زیر باشد: string stringValueاختیاری. مقدار رشتهایِ فراداده.
stringListValueobject ( StringList )اختیاری. فهرستی از مقادیر رشتهای برای فراداده.
number numericValue اختیاری. مقدار عددی فراداده. محدوده مورد انتظار برای این مقدار به key خاص مورد استفاده بستگی دارد.
| نمایش JSON |
|---|
{
"key": string,
// value
"stringValue": string,
"stringListValue": {
object ( |
لیست رشتهای
فهرستی از مقادیر رشتهای.
values[]stringمقادیر رشتهای لیست.
| نمایش JSON |
|---|
{ "values": [ string ] } |
نقشهها
یک قطعه زمین از نقشههای گوگل. یک قطعه نقشه مربوط به یک مکان واحد است.
string uriمرجع URI آن مکان.
string titleعنوان مکان.
string textپاسخ توضیحات متنی مکان.
string placeId شناسه مکان، در قالب places/{placeId} . کاربر میتواند از این شناسه برای جستجوی آن مکان استفاده کند.
placeAnswerSourcesobject ( PlaceAnswerSources )منابعی که پاسخهایی در مورد ویژگیهای یک مکان مشخص در نقشههای گوگل ارائه میدهند.
| نمایش JSON |
|---|
{
"uri": string,
"title": string,
"text": string,
"placeId": string,
"placeAnswerSources": {
object ( |
منابع PlaceAnswer
مجموعهای از منابع که پاسخهایی در مورد ویژگیهای یک مکان مشخص در نقشههای گوگل ارائه میدهند. هر پیام PlaceAnswerSources مربوط به یک مکان خاص در نقشههای گوگل است. ابزار نقشههای گوگل از این منابع برای پاسخ به سوالاتی در مورد ویژگیهای مکان استفاده کرده است (مثلاً: "آیا بار فو وایفای دارد" یا "آیا بار فو برای ویلچر قابل دسترسی است؟"). در حال حاضر ما فقط از گزیدههای نقد و بررسی به عنوان منبع پشتیبانی میکنیم.
reviewSnippets[]object ( ReviewSnippet )گزیدههایی از نظرات که برای تولید پاسخ در مورد ویژگیهای یک مکان مشخص در نقشههای گوگل استفاده میشوند.
| نمایش JSON |
|---|
{
"reviewSnippets": [
{
object ( |
نقد و بررسی قطعه کد
بخشی از نقد کاربر را که به سوالی در مورد ویژگیهای یک مکان خاص در نقشههای گوگل پاسخ میدهد، در بر میگیرد.
string reviewIdشناسهی قطعه نقد و بررسی.
string googleMapsUriلینکی که مربوط به نظر کاربر در نقشه گوگل باشد.
string titleعنوان نقد.
| نمایش JSON |
|---|
{ "reviewId": string, "googleMapsUri": string, "title": string } |
پشتیبانی اتصال به زمین
پشتیبانی زمینی.
groundingChunkIndices[]integer اختیاری. فهرستی از شاخصها (در 'grounding_chunk' در response.candidate.grounding_metadata ) که استنادهای مرتبط با ادعا را مشخص میکند. به عنوان مثال [1،3،4] به این معنی است که grounding_chunk[1]، grounding_chunk[3]، grounding_chunk[4] محتوای بازیابی شده نسبت داده شده به ادعا هستند. اگر پاسخ در حال پخش باشد، groundingChunkIndices به شاخصهای همه پاسخها اشاره دارد. این مسئولیت کلاینت است که تکههای پایه را از همه پاسخها جمعآوری کند (با حفظ همان ترتیب).
number confidenceScores[]اختیاری. امتیاز اطمینان مراجع پشتیبانی. از ۰ تا ۱ متغیر است. ۱ مطمئنترین است. این لیست باید اندازهای برابر با groundingChunkIndices داشته باشد.
integer renderedParts[] فقط خروجی. اندیسهایی در فیلد parts محتوای کاندید قرار میدهند. این اندیسها مشخص میکنند که کدام بخشهای رندر شده با این منبع پشتیبانی مرتبط هستند.
segmentobject ( Segment )بخشی از محتوایی که این پشتیبانی به آن تعلق دارد.
| نمایش JSON |
|---|
{
"groundingChunkIndices": [
integer
],
"confidenceScores": [
number
],
"renderedParts": [
integer
],
"segment": {
object ( |
بخش
بخش بندی محتوا.
integer partIndexاندیس یک شیء Part درون شیء Content والد آن.
integer startIndexاندیس شروع در قطعه داده شده، که بر حسب بایت اندازهگیری میشود. فاصله از ابتدای قطعه، شامل همه اجزا، و از صفر شروع میشود.
integer endIndexاندیس پایان در قطعه داده شده، که بر حسب بایت اندازهگیری میشود. فاصله از ابتدای قطعه، منحصراً، از صفر شروع میشود.
string textمتن مربوط به بخش مربوط به پاسخ.
| نمایش JSON |
|---|
{ "partIndex": integer, "startIndex": integer, "endIndex": integer, "text": string } |
بازیابیفراداده
فراداده مربوط به بازیابی در جریان اتصال به زمین.
number googleSearchDynamicRetrievalScoreاختیاری. امتیازی که نشان میدهد اطلاعات حاصل از جستجوی گوگل چقدر میتواند به پاسخ سوال کمک کند. امتیاز در محدوده [0، 1] است، که در آن 0 کمترین احتمال و 1 بیشترین احتمال را دارد. این امتیاز فقط زمانی پر میشود که جستجوی گوگل مبتنی بر جستجو و بازیابی پویا فعال باشد. این امتیاز با آستانه مقایسه میشود تا مشخص شود که آیا جستجوی گوگل فعال شود یا خیر.
| نمایش JSON |
|---|
{ "googleSearchDynamicRetrievalScore": number } |
نتیجهی لاگپروبز
نتیجه لاگپروبز
topCandidates[]object ( TopCandidates )طول = تعداد کل مراحل رمزگشایی.
chosenCandidates[]object ( Candidate )طول = تعداد کل مراحل رمزگشایی. کاندیداهای انتخاب شده ممکن است در topCandidates باشند یا نباشند.
number logProbabilitySumمجموع احتمالات لگاریتمی برای همه توکنها.
| نمایش JSON |
|---|
{ "topCandidates": [ { object ( |
کاندیداهای برتر
کاندیداهایی با احتمال بالای لگاریتم در هر مرحله رمزگشایی.
candidates[]object ( Candidate )بر اساس احتمال لگاریتمی به ترتیب نزولی مرتب شدهاند.
| نمایش JSON |
|---|
{
"candidates": [
{
object ( |
نامزد
کاندید برای توکن logprobs و امتیاز.
string tokenمقدار رشته توکن کاندیدا.
integer tokenIdمقدار شناسه توکن کاندیدا.
number logProbabilityلگاریتم احتمال کاندیدا.
| نمایش JSON |
|---|
{ "token": string, "tokenId": integer, "logProbability": number } |
فرادادهی UrlContext
فراداده مربوط به ابزار بازیابی متن url.
urlMetadata[]object ( UrlMetadata )فهرست زمینه آدرس اینترنتی.
| نمایش JSON |
|---|
{
"urlMetadata": [
{
object ( |
آدرس فراداده
زمینه بازیابی یک آدرس اینترنتی واحد.
string retrievedUrlآدرس اینترنتی (url) توسط ابزار بازیابی شد.
urlRetrievalStatusenum ( UrlRetrievalStatus )وضعیت بازیابی آدرس اینترنتی (URL).
| نمایش JSON |
|---|
{
"retrievedUrl": string,
"urlRetrievalStatus": enum ( |
وضعیت بازیابی آدرس
وضعیت بازیابی آدرس اینترنتی (URL).
| انومها | |
|---|---|
URL_RETRIEVAL_STATUS_UNSPECIFIED | مقدار پیشفرض. این مقدار استفاده نشده است. |
URL_RETRIEVAL_STATUS_SUCCESS | بازیابی آدرس اینترنتی (URL) با موفقیت انجام شد. |
URL_RETRIEVAL_STATUS_ERROR | بازیابی آدرس اینترنتی (URL) به دلیل خطا با شکست مواجه شد. |
URL_RETRIEVAL_STATUS_PAYWALL | بازیابی آدرس اینترنتی (URL) ناموفق است زیرا محتوا پشت دیوار پرداخت (paywall) قرار دارد. |
URL_RETRIEVAL_STATUS_UNSAFE | بازیابی آدرس اینترنتی (URL) به دلیل ناامن بودن محتوا با شکست مواجه شد. |
فراداده استناد
مجموعهای از منابع ارجاعدهنده به یک محتوا.
citationSources[]object ( CitationSource )استناد به منابع برای یک پاسخ خاص.
| نمایش JSON |
|---|
{
"citationSources": [
{
object ( |
منبع استناد
استناد به یک منبع برای بخشی از یک پاسخ خاص.
integer startIndexاختیاری. شروع بخشی از پاسخ که به این منبع نسبت داده میشود.
اندیس (index) نشاندهندهی شروع سگمنت است که بر حسب بایت اندازهگیری میشود.
endIndexintegerOptional. End of the attributed segment, exclusive.
uristringOptional. URI that is attributed as a source for a portion of the text.
licensestringOptional. License for the GitHub project that is attributed as a source for segment.
License info is required for code citations.
| نمایش JSON |
|---|
{ "startIndex": integer, "endIndex": integer, "uri": string, "license": string } |
HarmCategory
Harm categories that can be detected in user input and model responses.
| انومها | |
|---|---|
HARM_CATEGORY_UNSPECIFIED | Default value. This value is unused. |
HARM_CATEGORY_HATE_SPEECH | Content that promotes violence or incites hatred against individuals or groups based on certain attributes. |
HARM_CATEGORY_DANGEROUS_CONTENT | Content that promotes, facilitates, or enables dangerous activities. |
HARM_CATEGORY_HARASSMENT | Abusive, threatening, or content intended to bully, torment, or ridicule. |
HARM_CATEGORY_SEXUALLY_EXPLICIT | Content that contains sexually explicit material. |
HARM_CATEGORY_CIVIC_INTEGRITY | Deprecated: Election filter is not longer supported. The harm category is civic integrity. |
HARM_CATEGORY_IMAGE_HATE | Images that contain hate speech. |
HARM_CATEGORY_IMAGE_DANGEROUS_CONTENT | Images that contain dangerous content. |
HARM_CATEGORY_IMAGE_HARASSMENT | Images that contain harassment. |
HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT | Images that contain sexually explicit content. |
HARM_CATEGORY_JAILBREAK | Prompts designed to bypass safety filters. |
ModalityTokenCount
Represents token counting info for a single modality.
modalityenum ( Modality )The modality associated with this token count.
tokenCountintegerNumber of tokens.
| نمایش JSON |
|---|
{
"modality": enum ( |
روش
Content Part modality
| انومها | |
|---|---|
MODALITY_UNSPECIFIED | Unspecified modality. |
TEXT | Plain text. |
IMAGE | تصویر. |
VIDEO | ویدئو. |
AUDIO | صوتی. |
DOCUMENT | Document, eg PDF. |
SafetyRating
Safety rating for a piece of content.
The safety rating contains the category of harm and the harm probability level in that category for a piece of content. Content is classified for safety across a number of harm categories and the probability of the harm classification is included here.
categoryenum ( HarmCategory )Required. The category for this rating.
probabilityenum ( HarmProbability )Required. The probability of harm for this content.
blockedbooleanWas this content blocked because of this rating?
| نمایش JSON |
|---|
{ "category": enum ( |
HarmProbability
The probability that a piece of content is harmful.
The classification system gives the probability of the content being unsafe. This does not indicate the severity of harm for a piece of content.
| انومها | |
|---|---|
HARM_PROBABILITY_UNSPECIFIED | Probability is unspecified. |
NEGLIGIBLE | Content has a negligible chance of being unsafe. |
LOW | Content has a low chance of being unsafe. |
MEDIUM | Content has a medium chance of being unsafe. |
HIGH | Content has a high chance of being unsafe. |
SafetySetting
Safety setting, affecting the safety-blocking behavior.
Passing a safety setting for a category changes the allowed probability that content is blocked.
categoryenum ( HarmCategory )Required. The category for this setting.
thresholdenum ( HarmBlockThreshold )Required. Controls the probability threshold at which harm is blocked.
| نمایش JSON |
|---|
{ "category": enum ( |
HarmBlockThreshold
Block at and beyond a specified harm probability.
| انومها | |
|---|---|
HARM_BLOCK_THRESHOLD_UNSPECIFIED | Threshold is unspecified. |
BLOCK_LOW_AND_ABOVE | Content with NEGLIGIBLE will be allowed. |
BLOCK_MEDIUM_AND_ABOVE | Content with NEGLIGIBLE and LOW will be allowed. |
BLOCK_ONLY_HIGH | Content with NEGLIGIBLE, LOW, and MEDIUM will be allowed. |
BLOCK_NONE | All content will be allowed. |
OFF | Turn off the safety filter. |
ServiceTier
The service tier of the interaction.
| انومها | |
|---|---|
SERVICE_TIER_UNSPECIFIED | Default service tier, which is standard. |
SERVICE_TIER_FLEX | Flex service tier. |
SERVICE_TIER_STANDARD | Standard service tier. |
SERVICE_TIER_PRIORITY | Priority service tier. |
AllowedTools
The configuration for allowed tools.
modeenum ( ToolChoiceType )The mode of the tool choice.
tools[]stringThe names of the allowed tools.
| نمایش JSON |
|---|
{
"mode": enum ( |
Annotation
Citation information for model-generated content.
startIndexintegerStart of segment of the response that is attributed to this source.
Index indicates the start of the segment, measured in bytes.
endIndexintegerEnd of the attributed segment, exclusive.
typeUnion typetype can be only one of the following:urlCitationobject ( UrlCitation )A URL citation annotation.
fileCitationobject ( FileCitation )A file citation annotation.
placeCitationobject ( PlaceCitation )A place citation annotation.
| نمایش JSON |
|---|
{ "startIndex": integer, "endIndex": integer, // type "urlCitation": { object ( |
UrlCitation
A URL citation annotation.
urlstringThe URL.
titlestringThe title of the URL.
| نمایش JSON |
|---|
{ "url": string, "title": string } |
FileCitation
A file citation annotation.
documentUristringThe URI of the file.
fileNamestringThe name of the file.
sourcestringSource attributed for a portion of the text.
customMetadataobject ( Struct )User provided metadata about the retrieved context.
pageNumberintegerPage number of the cited document, if applicable.
mediaIdstringMedia ID in-case of image citations, if applicable.
| نمایش JSON |
|---|
{
"documentUri": string,
"fileName": string,
"source": string,
"customMetadata": {
object ( |
PlaceCitation
A place citation annotation.
placeIdstring The ID of the place, in places/{placeId} format.
namestringTitle of the place.
urlstringURI reference of the place.
reviewSnippets[]object ( ReviewSnippet )Snippets of reviews that are used to generate answers about the features of a given place in Google Maps.
| نمایش JSON |
|---|
{
"placeId": string,
"name": string,
"url": string,
"reviewSnippets": [
{
object ( |
AspectRatio
Supported aspect ratios for image output.
| انومها | |
|---|---|
ASPECT_RATIO_UNSPECIFIED | Default value. This value is unused. |
ASPECT_RATIO_ONE_BY_ONE | 1:1 aspect ratio. |
ASPECT_RATIO_TWO_BY_THREE | 2:3 aspect ratio. |
ASPECT_RATIO_THREE_BY_TWO | نسبت تصویر ۳:۲. |
ASPECT_RATIO_THREE_BY_FOUR | 3:4 aspect ratio. |
ASPECT_RATIO_FOUR_BY_THREE | 4:3 aspect ratio. |
ASPECT_RATIO_FOUR_BY_FIVE | 4:5 aspect ratio. |
ASPECT_RATIO_FIVE_BY_FOUR | 5:4 aspect ratio. |
ASPECT_RATIO_NINE_BY_SIXTEEN | 9:16 aspect ratio. |
ASPECT_RATIO_SIXTEEN_BY_NINE | 16:9 aspect ratio. |
ASPECT_RATIO_TWENTY_ONE_BY_NINE | 21:9 aspect ratio. |
ASPECT_RATIO_ONE_BY_EIGHT | 1:8 aspect ratio. |
ASPECT_RATIO_EIGHT_BY_ONE | 8:1 aspect ratio. |
ASPECT_RATIO_ONE_BY_FOUR | 1:4 aspect ratio. |
ASPECT_RATIO_FOUR_BY_ONE | 4:1 aspect ratio. |
AudioResponseFormat
Configuration for audio output format.
mimeTypeenum ( MimeType )The MIME type of the audio output.
deliveryenum ( Delivery )The delivery mode for the audio output.
sampleRateintegerSample rate in Hz.
bitRateintegerBit rate in bits per second (bps). Only applicable for compressed formats (MP3, Opus).
| نمایش JSON |
|---|
{ "mimeType": enum ( |
CodeExecutionCallStep
Code execution call step.
argumentsobject ( CodeExecutionCallStepArguments )Required. The arguments to pass to the code execution.
| نمایش JSON |
|---|
{
"arguments": {
object ( |
CodeExecutionCallStepArguments
The arguments to pass to the code execution.
languageenum ( Language ) Programming language of the code .
codestringThe code to be executed.
| نمایش JSON |
|---|
{
"language": enum ( |
CodeExecutionResultStep
Code execution result step.
resultstringRequired. The output of the code execution.
isErrorbooleanWhether the code execution resulted in an error.
| نمایش JSON |
|---|
{ "result": string, "isError": boolean } |
ComputerUse
A tool that can be used by the model to interact with the computer.
environmentenum ( Environment )The environment being operated.
excludedPredefinedFunctions[]stringThe list of predefined functions that are excluded from the model call.
enablePromptInjectionDetectionbooleanWhether enable the prompt injection detection check on computer-use request.
disabledSafetyPolicies[]enum ( SafetyPolicy )Optional. Disabled safety policies for computer use.
| نمایش JSON |
|---|
{ "environment": enum ( |
محتوا
- نمایش JSON
- TextContent
- ImageContent
- AudioContent
- DocumentContent
- VideoContent
- ThoughtContent
- ThoughtSummaryContent
- ToolCallContent
- FunctionCallContent
- CodeExecutionCallContent
- CodeExecutionCallArguments
- UrlContextCallContent
- UrlContextCallArguments
- McpServerToolCallContent
- GoogleSearchCallContent
- GoogleSearchCallArguments
- FileSearchCallContent
- GoogleMapsCallContent
- GoogleMapsCallArguments
- ToolResultContent
- FunctionResultContent
- FunctionResultSubcontentList
- FunctionResultSubcontent
- CodeExecutionResultContent
- UrlContextResultContent
- UrlContextResult
- GoogleSearchResultContent
- GoogleSearchResult
- McpServerToolResultContent
- FileSearchResultContent
- FileSearchResult
- GoogleMapsResultContent
- GoogleMapsResult
- مکانها
The content of the response.
typeUnion typetype can be only one of the following:textobject ( TextContent ) imageobject ( ImageContent ) audioobject ( AudioContent ) documentobject ( DocumentContent ) videoobject ( VideoContent ) thought
(deprecated)object ( ThoughtContent )toolCall
(deprecated)object ( ToolCallContent )toolResult
(deprecated)object ( ToolResultContent )| نمایش JSON |
|---|
{ // type "text": { object ( |
TextContent
A text content block.
textstringRequired. The text content.
annotations[]object ( Annotation )Citation information for model-generated content.
| نمایش JSON |
|---|
{
"text": string,
"annotations": [
{
object ( |
ImageContent
An image content block.
mimeTypeenum ( MimeType )The mime type of the image.
resolutionenum ( MediaResolution )The resolution of the media.
data_or_uriUnion typedata_or_uri can be only one of the following:datastring ( bytes format)The image content.
یک رشته کدگذاری شده با base64.
uristringThe URI of the image.
| نمایش JSON |
|---|
{ "mimeType": enum ( |
AudioContent
An audio content block.
mimeTypeenum ( MimeType )The mime type of the audio.
channelsintegerThe number of audio channels.
sampleRateintegerThe sample rate of the audio.
data_or_uriUnion typedata_or_uri can be only one of the following:datastring ( bytes format)The audio content.
یک رشته کدگذاری شده با base64.
uristringThe URI of the audio.
| نمایش JSON |
|---|
{
"mimeType": enum ( |
DocumentContent
A document content block.
mimeTypeenum ( MimeType )The mime type of the document.
data_or_uriUnion typedata_or_uri can be only one of the following:datastring ( bytes format)The document content.
یک رشته کدگذاری شده با base64.
uristringThe URI of the document.
| نمایش JSON |
|---|
{
"mimeType": enum ( |
VideoContent
A video content block.
mimeTypeenum ( MimeType )The mime type of the video.
resolutionenum ( MediaResolution )The resolution of the media.
data_or_uriUnion typedata_or_uri can be only one of the following:datastring ( bytes format)The video content.
یک رشته کدگذاری شده با base64.
uristringThe URI of the video.
| نمایش JSON |
|---|
{ "mimeType": enum ( |
ThoughtContent
A thought content block.
signaturestring ( bytes format)Signature to match the backend source to be part of the generation.
یک رشته کدگذاری شده با base64.
summary[]object ( ThoughtSummaryContent )A summary of the thought.
| نمایش JSON |
|---|
{
"signature": string,
"summary": [
{
object ( |
ThoughtSummaryContent
typeUnion type| نمایش JSON |
|---|
{ // type "text": { object ( |
ToolCallContent
Tool call content.
idstringRequired. A unique ID for this specific tool call.
signaturestring ( bytes format)A signature hash for backend validation.
یک رشته کدگذاری شده با base64.
typeUnion typetype can be only one of the following: functionCallobject ( FunctionCallContent ) codeExecutionCallobject ( CodeExecutionCallContent ) urlContextCallobject ( UrlContextCallContent ) mcpServerToolCallobject ( McpServerToolCallContent ) googleSearchCallobject ( GoogleSearchCallContent ) fileSearchCallobject ( FileSearchCallContent ) googleMapsCallobject ( GoogleMapsCallContent ) | نمایش JSON |
|---|
{ "id": string, "signature": string, // type "functionCall": { object ( |
FunctionCallContent
A function tool call content block.
namestringRequired. The name of the tool to call.
argumentsobject ( Struct )Required. The arguments to pass to the function.
| نمایش JSON |
|---|
{
"name": string,
"arguments": {
object ( |
CodeExecutionCallContent
Code execution content.
argumentsobject ( CodeExecutionCallArguments )Required. The arguments to pass to the code execution.
| نمایش JSON |
|---|
{
"arguments": {
object ( |
CodeExecutionCallArguments
The arguments to pass to the code execution.
languageenum ( Language ) Programming language of the code .
codestringThe code to be executed.
| نمایش JSON |
|---|
{
"language": enum ( |
UrlContextCallContent
URL context content.
argumentsobject ( UrlContextCallArguments )Required. The arguments to pass to the URL context.
| نمایش JSON |
|---|
{
"arguments": {
object ( |
UrlContextCallArguments
The arguments to pass to the URL context.
urls[]stringThe URLs to fetch.
| نمایش JSON |
|---|
{ "urls": [ string ] } |
McpServerToolCallContent
MCPServer tool call content.
namestringRequired. The name of the tool which was called.
serverNamestringRequired. The name of the used MCP server.
argumentsobject ( Struct )Required. The JSON object of arguments for the function.
| نمایش JSON |
|---|
{
"name": string,
"serverName": string,
"arguments": {
object ( |
GoogleSearchCallContent
Google Search content.
argumentsobject ( GoogleSearchCallArguments )Required. The arguments to pass to Google Search.
searchTypeenum ( SearchType )The type of search grounding enabled.
| نمایش JSON |
|---|
{ "arguments": { object ( |
GoogleSearchCallArguments
The arguments to pass to Google Search.
queries[]stringWeb search queries for the following-up web search.
| نمایش JSON |
|---|
{ "queries": [ string ] } |
FileSearchCallContent
This type has no fields.
File Search content.
GoogleMapsCallContent
Google Maps content.
argumentsobject ( GoogleMapsCallArguments )The arguments to pass to the Google Maps tool.
| نمایش JSON |
|---|
{
"arguments": {
object ( |
GoogleMapsCallArguments
The arguments to pass to the Google Maps tool.
queries[]stringThe queries to be executed.
| نمایش JSON |
|---|
{ "queries": [ string ] } |
ToolResultContent
Tool result content.
callIdstringRequired. ID to match the ID from the function call block.
signaturestring ( bytes format)A signature hash for backend validation.
یک رشته کدگذاری شده با base64.
typeUnion typetype can be only one of the following: functionResultobject ( FunctionResultContent ) codeExecutionResultobject ( CodeExecutionResultContent ) urlContextResultobject ( UrlContextResultContent ) googleSearchResultobject ( GoogleSearchResultContent ) mcpServerToolResultobject ( McpServerToolResultContent ) fileSearchResultobject ( FileSearchResultContent ) googleMapsResultobject ( GoogleMapsResultContent ) | نمایش JSON |
|---|
{ "callId": string, "signature": string, // type "functionResult": { object ( |
FunctionResultContent
A function tool result content block.
namestringThe name of the tool that was called.
isErrorbooleanWhether the tool call resulted in an error.
resultUnion typeresult can be only one of the following: structResultobject ( Struct ) contentListobject ( FunctionResultSubcontentList ) stringResultstring | نمایش JSON |
|---|
{ "name": string, "isError": boolean, // result "structResult": { object ( |
FunctionResultSubcontentList
contents[]object ( FunctionResultSubcontent ) | نمایش JSON |
|---|
{
"contents": [
{
object ( |
FunctionResultSubcontent
typeUnion type| JSON representation |
|---|
{ // type "text": { object ( |
CodeExecutionResultContent
Code execution result content.
resultstringRequired. The output of the code execution.
isErrorbooleanWhether the code execution resulted in an error.
| نمایش JSON |
|---|
{ "result": string, "isError": boolean } |
UrlContextResultContent
URL context result content.
result[]object ( UrlContextResult )Required. The results of the URL context.
isErrorbooleanWhether the URL context resulted in an error.
| JSON representation |
|---|
{
"result": [
{
object ( |
UrlContextResult
The result of the URL context.
urlstringThe URL that was fetched.
statusenum ( Status )The status of the URL retrieval.
| نمایش JSON |
|---|
{
"url": string,
"status": enum ( |
GoogleSearchResultContent
Google Search result content.
result[]object ( GoogleSearchResult )Required. The results of the Google Search.
isErrorbooleanWhether the Google Search resulted in an error.
| نمایش JSON |
|---|
{
"result": [
{
object ( |
GoogleSearchResult
The result of the Google Search.
searchSuggestionsstringWeb content snippet that can be embedded in a web page or an app webview.
| نمایش JSON |
|---|
{ "searchSuggestions": string } |
McpServerToolResultContent
MCPServer tool result content.
namestringName of the tool which is called for this specific tool call.
serverNamestringThe name of the used MCP server.
resultUnion typeresult can be only one of the following: structResultobject ( Struct ) contentListobject ( FunctionResultSubcontentList ) stringResultstring | نمایش JSON |
|---|
{ "name": string, "serverName": string, // result "structResult": { object ( |
FileSearchResultContent
File Search result content.
result[]object ( FileSearchResult )Optional. The results of the File Search.
| نمایش JSON |
|---|
{
"result": [
{
object ( |
FileSearchResult
This type has no fields.
The result of the File Search.
GoogleMapsResultContent
Google Maps result content.
result[]object ( GoogleMapsResult )Required. The results of the Google Maps.
| نمایش JSON |
|---|
{
"result": [
{
object ( |
GoogleMapsResult
The result of the Google Maps.
places[]object ( Places )The places that were found.
widgetContextTokenstringResource name of the Google Maps widget context token.
| نمایش JSON |
|---|
{
"places": [
{
object ( |
مکانها
placeIdstring The ID of the place, in places/{placeId} format.
namestringTitle of the place.
urlstringURI reference of the place.
reviewSnippets[]object ( ReviewSnippet )Snippets of reviews that are used to generate answers about the features of a given place in Google Maps.
| نمایش JSON |
|---|
{
"placeId": string,
"name": string,
"url": string,
"reviewSnippets": [
{
object ( |
CreateInteractionRequest
- JSON representation
- Interaction
- فهرست نوبت
- نوبت
- لیست مراحل
- قدم
- ThoughtStep
- ToolCallStep
- مرحله فراخوانی تابع
- UrlContextCallStep
- UrlContextCallStepArguments
- McpServerToolCallStep
- GoogleSearchCallStep
- GoogleSearchCallStepArguments
- جستجوی فایلفراخوانیمرحله
- GoogleMapsCallStep
- آرگومانهای GoogleMapsCallStep
- ToolResultStep
- FunctionResultStep
- UrlContextResultStep
- UrlContextResultItem
- GoogleSearchResultStep
- GoogleSearchResultItem
- ابزار نتیجه McpServerTool
- FileSearchResultStep
- مرحله نتیجه گوگل مپ
- آیتم نتیجه نقشه گوگل
- GoogleMapsResultPlaces
- مرحله ورودی کاربر
- ModelOutputStep
- لیست قالب پاسخ
- ResponseFormat
- TextResponseFormat
- ImageResponseFormat
- VideoResponseFormat
- ModelInteraction
- GenerationConfig
- ToolChoiceConfig
- SpeechConfig
- ImageConfig
- VideoConfig
- EnvironmentConfig
- EnvironmentNetworkEgressAllowlist
- EgressRule
- منبع
- پیکربندی محیط محلی
- ابزار
- عملکرد
- UrlContext
- McpServer
- GoogleSearch
- FileSearch
- GoogleMaps
- کاربرد
- توکنهای مدالیتی
- GroundingToolCount
- پیکربندی وبهوک
- SafetySetting
Configuration parameters for creating an interaction.
streambooleanInput only. Whether the interaction will be streamed.
storebooleanInput only. Whether to store the response and request for later retrieval.
interactionobject ( Interaction )The interaction to create.
backgroundbooleanInput only. Whether to run the model interaction in the background.
| JSON representation |
|---|
{
"stream": boolean,
"store": boolean,
"interaction": {
object ( |
Interaction
Response for InteractionService.CreateInteraction.
idstringRequired. Output only. A unique identifier for the interaction completion.
statusenum ( Status )Required. Output only. The status of the interaction.
createdstringRequired. Output only. The time at which the response was created in ISO 8601 format (YYYY-MM-DDThh:mm:ssZ).
updatedstringRequired. Output only. The time at which the response was last updated in ISO 8601 format (YYYY-MM-DDThh:mm:ssZ).
role
(deprecated)stringOutput only. The role of the interaction.
outputs[]
(deprecated)object ( Content )Output only. Responses from the model.
systemInstructionstringSystem instruction for the interaction.
tools[]object ( Tool )A list of tool declarations the model may call during interaction.
usageobject ( Usage )Output only. Statistics on the interaction request's token usage.
responseModalities[]
(deprecated)enum ( ResponseModality )The requested modalities of the response (TEXT, IMAGE, AUDIO).
responseMimeType
(deprecated)stringThe mime type of the response. This is required if responseFormat is set.
previousInteractionIdstringThe ID of the previous interaction, if any.
environmentIdstringOutput only. The environment ID for the interaction. Only populated if environment config is set in the request.
serviceTierenum ( ServiceTier )The service tier for the interaction.
webhookConfigobject ( WebhookConfig )Optional. Webhook configuration for receiving notifications when the interaction completes.
steps[]object ( Step )Required. Output only. The steps that make up the interaction.
inputUnion typeinput can be only one of the following:contentList
(deprecated)object ( ContentList )The inputs for the interaction.
stringContentstringA string input for the interaction, it will be processed as a single text input.
turnList
(deprecated)object ( TurnList )The turns for the interaction.
stepListobject ( StepList )Input only. The steps for the interaction.
contentobject ( Content )The content for the interaction.
response_format_configUnion typeresponse_format_config can be only one of the following: responseFormat
(deprecated)object ( Value )Enforces that the generated response is a JSON object that complies with the JSON schema specified in this field.
responseFormatListobject ( ResponseFormatList ) responseFormatSingletonobject ( ResponseFormat ) request_typeUnion typerequest_type can be only one of the following: modelInteractionobject ( ModelInteraction )Interaction for generating the completion using models.
agentInteractionobject ( AgentInteraction )Interaction for generating the completion using agents.
environmentUnion typeenvironment can be only one of the following:envIdstringThe environment ID for the interaction. Can be 'remote' for default environment.
remoteEnvironmentobject ( EnvironmentConfig ) localEnvironmentobject ( LocalEnvironmentConfig ) The agent's environment lives on the client connection: its built-in environment operations (filesystem ops and running commands) are yielded to the client to execute, instead of running in a server-managed sandbox. Mutually exclusive with remoteEnvironment . (Independent of any client-declared function tools, which are always executed on the client regardless of this field.)
| JSON representation |
|---|
{ "id": string, "status": enum ( |
فهرست نوبت
A list of Turns.
turns[]object ( Turn ) | JSON representation |
|---|
{
"turns": [
{
object ( |
نوبت
rolestringThe originator of this turn. Must be user for input or model for model output.
contentUnion typecontent can be only one of the following:contentListobject ( ContentList )The content of the turn. An array of Content objects.
contentStringstringThe content of the turn. A single string.
| JSON representation |
|---|
{
"role": string,
// content
"contentList": {
object ( |
لیست مراحل
A list of Steps.
steps[]object ( Step )The steps of the list.
| نمایش JSON |
|---|
{
"steps": [
{
object ( |
قدم
A step in the interaction.
typeUnion typetype can be only one of the following:thoughtobject ( ThoughtStep ) toolCallobject ( ToolCallStep ) toolResultobject ( ToolResultStep ) userInputobject ( UserInputStep )DO NOT USE -- These are for 3P JSON only
modelOutputobject ( ModelOutputStep ) text
(deprecated)object ( LegacyTextContent )image
(deprecated)object ( LegacyImageContent )audio
(deprecated)object ( LegacyAudioContent )document
(deprecated)object ( LegacyDocumentContent )video
(deprecated)object ( LegacyVideoContent )| JSON representation |
|---|
{ // type "thought": { object ( |
ThoughtStep
A thought step.
signaturestring ( bytes format)A signature hash for backend validation.
یک رشته کدگذاری شده با base64.
summary[]object ( Content )A summary of the thought.
| JSON representation |
|---|
{
"signature": string,
"summary": [
{
object ( |
ToolCallStep
Tool call step.
idstringRequired. A unique ID for this specific tool call.
signaturestring ( bytes format)A signature hash for backend validation.
یک رشته کدگذاری شده با base64.
typeUnion typetype can be only one of the following: functionCallobject ( FunctionCallStep ) codeExecutionCallobject ( CodeExecutionCallStep ) urlContextCallobject ( UrlContextCallStep ) mcpServerToolCallobject ( McpServerToolCallStep ) googleSearchCallobject ( GoogleSearchCallStep ) fileSearchCallobject ( FileSearchCallStep ) googleMapsCallobject ( GoogleMapsCallStep ) retrievalCallobject ( RetrievalCallStep ) | JSON representation |
|---|
{ "id": string, "signature": string, // type "functionCall": { object ( |
مرحله فراخوانی تابع
A function tool call step.
namestringRequired. The name of the tool to call.
argumentsobject ( Struct )Required. The arguments to pass to the function.
| JSON representation |
|---|
{
"name": string,
"arguments": {
object ( |
UrlContextCallStep
URL context call step.
argumentsobject ( UrlContextCallStepArguments )Required. The arguments to pass to the URL context.
| JSON representation |
|---|
{
"arguments": {
object ( |
UrlContextCallStepArguments
The arguments to pass to the URL context.
urls[]stringThe URLs to fetch.
| JSON representation |
|---|
{ "urls": [ string ] } |
McpServerToolCallStep
MCPServer tool call step.
namestringRequired. The name of the tool which was called.
serverNamestringRequired. The name of the used MCP server.
argumentsobject ( Struct )Required. The JSON object of arguments for the function.
| JSON representation |
|---|
{
"name": string,
"serverName": string,
"arguments": {
object ( |
GoogleSearchCallStep
Google Search call step.
argumentsobject ( GoogleSearchCallStepArguments )Required. The arguments to pass to Google Search.
searchTypeenum ( SearchType )The type of search grounding enabled.
| JSON representation |
|---|
{ "arguments": { object ( |
GoogleSearchCallStepArguments
The arguments to pass to Google Search.
queries[]stringWeb search queries for the following-up web search.
| JSON representation |
|---|
{ "queries": [ string ] } |
جستجوی فایلفراخوانیمرحله
This type has no fields.
File Search call step.
GoogleMapsCallStep
Google Maps call step.
argumentsobject ( GoogleMapsCallStepArguments )The arguments to pass to the Google Maps tool.
| JSON representation |
|---|
{
"arguments": {
object ( |
آرگومانهای GoogleMapsCallStep
The arguments to pass to the Google Maps tool.
queries[]stringThe queries to be executed.
| JSON representation |
|---|
{ "queries": [ string ] } |
ToolResultStep
Tool result step.
callIdstringRequired. ID to match the ID from the function call block.
signaturestring ( bytes format)A signature hash for backend validation.
یک رشته کدگذاری شده با base64.
typeUnion typetype can be only one of the following: functionResultobject ( FunctionResultStep ) codeExecutionResultobject ( CodeExecutionResultStep ) urlContextResultobject ( UrlContextResultStep ) googleSearchResultobject ( GoogleSearchResultStep ) mcpServerToolResultobject ( McpServerToolResultStep ) fileSearchResultobject ( FileSearchResultStep ) googleMapsResultobject ( GoogleMapsResultStep ) retrievalResultobject ( RetrievalResultStep ) | JSON representation |
|---|
{ "callId": string, "signature": string, // type "functionResult": { object ( |
FunctionResultStep
Result of a function tool call.
namestringThe name of the tool that was called.
isErrorbooleanWhether the tool call resulted in an error.
resultobject ( Value )Required. The result of the tool call.
| JSON representation |
|---|
{
"name": string,
"isError": boolean,
"result": {
object ( |
UrlContextResultStep
URL context result step.
result[]object ( UrlContextResultItem )Required. The results of the URL context.
isErrorbooleanWhether the URL context resulted in an error.
| JSON representation |
|---|
{
"result": [
{
object ( |
UrlContextResultItem
The result of the URL context.
urlstringThe URL that was fetched.
statusenum ( Status )The status of the URL retrieval.
| JSON representation |
|---|
{
"url": string,
"status": enum ( |
GoogleSearchResultStep
Google Search result step.
result[]object ( GoogleSearchResultItem )Required. The results of the Google Search.
isErrorbooleanWhether the Google Search resulted in an error.
| JSON representation |
|---|
{
"result": [
{
object ( |
GoogleSearchResultItem
The result of the Google Search.
searchSuggestionsstringWeb content snippet that can be embedded in a web page or an app webview.
| JSON representation |
|---|
{ "searchSuggestions": string } |
ابزار نتیجه McpServerTool
MCPServer tool result step.
namestringName of the tool which is called for this specific tool call.
serverNamestringThe name of the used MCP server.
resultobject ( Value )Required. The output from the MCP server call. Can be simple text or rich content.
| نمایش JSON |
|---|
{
"name": string,
"serverName": string,
"result": {
object ( |
FileSearchResultStep
This type has no fields.
File Search result step.
مرحله نتیجه گوگل مپ
Google Maps result step.
result[]object ( GoogleMapsResultItem ) | JSON representation |
|---|
{
"result": [
{
object ( |
آیتم نتیجه نقشه گوگل
The result of the Google Maps.
places[]object ( GoogleMapsResultPlaces ) widgetContextTokenstring | JSON representation |
|---|
{
"places": [
{
object ( |
GoogleMapsResultPlaces
placeIdstring namestring urlstring reviewSnippets[]object ( ReviewSnippet ) | JSON representation |
|---|
{
"placeId": string,
"name": string,
"url": string,
"reviewSnippets": [
{
object ( |
مرحله ورودی کاربر
Input provided by the user.
contentUnion typecontent can be only one of the following: contentListobject ( ContentList )The content of the step. An array of Content objects.
contentStringstringThe content of the step. A single string.
| JSON representation |
|---|
{
// content
"contentList": {
object ( |
ModelOutputStep
Output generated by the model.
content[]object ( Content ) | JSON representation |
|---|
{
"content": [
{
object ( |
لیست قالب پاسخ
responseFormats[]object ( ResponseFormat ) | JSON representation |
|---|
{
"responseFormats": [
{
object ( |
ResponseFormat
typeUnion typetype can be only one of the following:audioobject ( AudioResponseFormat )textobject ( TextResponseFormat ) imageobject ( ImageResponseFormat ) videoobject ( VideoResponseFormat ) structValueobject ( Struct )Multi-discriminator values is already enabled in GAOS
| JSON representation |
|---|
{ // type "audio": { object ( |
TextResponseFormat
Configuration for text output format.
mimeTypeenum ( MimeType )The MIME type of the text output.
schemaobject ( Struct )The JSON schema that the output should conform to. Only applicable when mimeType is application/json.
| JSON representation |
|---|
{ "mimeType": enum ( |
ImageResponseFormat
Configuration for image output format.
mimeTypeenum ( MimeType )The MIME type of the image output.
deliveryenum ( Delivery )The delivery mode for the image output.
aspectRatioenum ( AspectRatio )The aspect ratio for the image output.
imageSizeenum ( ImageSize )The size of the image output.
| JSON representation |
|---|
{ "mimeType": enum ( |
VideoResponseFormat
Configuration for video output format.
deliveryenum ( Delivery )The delivery mode for the video output.
aspectRatioenum ( AspectRatio )The aspect ratio for the video output.
durationstring ( Duration format)The duration for the video output.
A duration in seconds with up to nine fractional digits, ending with ' s '. Example: "3.5s" .
| JSON representation |
|---|
{ "delivery": enum ( |
ModelInteraction
Interaction for generating the completion using models.
modelstring The name of the Model used for generating the completion.
generationConfigobject ( GenerationConfig )Input only. Configuration parameters for the model interaction.
| JSON representation |
|---|
{
"model": string,
"generationConfig": {
object ( |
GenerationConfig
Configuration parameters for model interactions.
temperaturenumberControls the randomness of the output.
topPnumberThe maximum cumulative probability of tokens to consider when sampling.
seedintegerSeed used in decoding for reproducibility.
stopSequences[]stringA list of character sequences that will stop output interaction.
thinkingLevelenum ( ThinkingLevel )The level of thought tokens that the model should generate.
thinkingSummariesenum ( ThinkingSummaries )Whether to include thought summaries in the response.
maxOutputTokensintegerThe maximum number of tokens to include in the response.
speechConfig[]object ( SpeechConfig )Configuration for speech interaction.
imageConfig
(deprecated)object ( ImageConfig )Configuration for image interaction.
videoConfigobject ( VideoConfig )Configuration for video generation.
tool_choiceUnion typetool_choice can be only one of the following: toolChoiceModeenum ( ToolChoiceType )The mode of the tool choice.
toolChoiceConfigobject ( ToolChoiceConfig )The config for the tool choice.
| JSON representation |
|---|
{ "temperature": number, "topP": number, "seed": integer, "stopSequences": [ string ], "thinkingLevel": enum ( |
ToolChoiceConfig
The tool choice configuration containing allowed tools.
allowedToolsobject ( AllowedTools )The allowed tools.
| JSON representation |
|---|
{
"allowedTools": {
object ( |
SpeechConfig
The configuration for speech interaction.
voicestringThe voice of the speaker.
languagestringThe language of the speech.
speakerstringThe speaker's name, it should match the speaker name given in the prompt.
| JSON representation |
|---|
{ "voice": string, "language": string, "speaker": string } |
ImageConfig
The configuration for image interaction.
aspectRatiostringThe aspect ratio of the image to generate. Supported aspect ratios: 1:1, 2:3, 3:2, 3:4, 4:3, 9:16, 16:9, 21:9.
If not specified, the model will choose a default aspect ratio based on any reference images provided.
imageSizestring Specifies the size of generated images. Supported values are 1K , 2K , 4K . If not specified, the model will use default value 1K .
| JSON representation |
|---|
{ "aspectRatio": string, "imageSize": string } |
VideoConfig
Configuration options for video generation.
taskenum ( Task )Optional task mode for video generation. If not specified, the model automatically determines the appropriate mode based on the provided text prompt and input media.
| JSON representation |
|---|
{
"task": enum ( |
EnvironmentConfig
Configuration for a custom environment.
sources[]object ( Source ) environmentIdstringOptional. The environment ID for the interaction. If specified, the request will update the existing environment instead of creating a new one.
networkUnion typenetwork can be only one of the following: networkAllowlistobject ( EnvironmentNetworkEgressAllowlist )Allow only specific domains.
networkModeenum ( NetworkMode )Network egress mode.
| JSON representation |
|---|
{ "sources": [ { object ( |
EnvironmentNetworkEgressAllowlist
Network egress configuration for the environment.
allowlist[]object ( EgressRule )List of allowed domains and their configurations.
| JSON representation |
|---|
{
"allowlist": [
{
object ( |
EgressRule
A network egress rule that controls which external domains the environment is allowed to reach. Each rule identifies a target domain and, optionally, a set of HTTP headers to inject into every matching outbound request.
domainstring The domain pattern to match for this rule. Use an exact hostname (eg, github.com ), a wildcard prefix (eg, *.googleapis.com ), or * to match all domains.
transformmap (key: string, value: string)Headers to inject into requests matching this rule. Key: header name (eg, "Authorization"). Value: header value (eg, "Bearer your-token").
An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" } .
| JSON representation |
|---|
{ "domain": string, "transform": { string: string, ... } } |
منبع
A source to be mounted into the environment.
typeenum ( Type ) sourcestringThe source of the environment. For GCS, this is the GCS path. For GitHub, this is the GitHub path.
targetstringWhere the source should appear in the environment.
contentstring The inline content if type is INLINE .
encodingstring Optional encoding for inline content (eg base64 ).
| JSON representation |
|---|
{
"type": enum ( |
پیکربندی محیط محلی
This type has no fields.
Configuration for an environment that lives on the client connection rather than in a server-managed sandbox.
When set (via Interaction.local_environment), the agent's filesystem and shell are treated as living on the client: the agent's built-in environment operations (eg reading/listing/editing files and running commands) are suspended on the server and yielded back to the client to execute, with their results returned on a subsequent turn. This is mutually exclusive with a server-managed EnvironmentConfig (remoteEnvironment), since the environment is either on the client or in a server sandbox, never both.
This governs only the agent's built-in environment. Client-declared function tools are always executed on the client regardless of this field.
ابزار
A tool that can be used by the model.
typeUnion typetype can be only one of the following:functionobject ( Function )A function that can be used by the model.
codeExecutionobject ( CodeExecution )A tool that can be used by the model to execute code.
urlContextobject ( UrlContext )A tool that can be used by the model to fetch URL context.
computerUseobject ( ComputerUse )Tool to support the model interacting directly with the computer.
mcpServerobject ( McpServer )A MCPServer is a server that can be called by the model to perform actions.
googleSearchobject ( GoogleSearch )A tool that can be used by the model to search Google.
fileSearchobject ( FileSearch )A tool that can be used by the model to search files.
googleMapsobject ( GoogleMaps )A tool that can be used by the model to search Google Maps.
retrievalobject ( Retrieval )A tool that can be used by the model to retrieve files.
| JSON representation |
|---|
{ // type "function": { object ( |
عملکرد
A tool that can be used by the model.
namestringThe name of the function.
descriptionstringA description of the function.
parametersobject ( Value )The JSON Schema for the function's parameters.
| JSON representation |
|---|
{
"name": string,
"description": string,
"parameters": {
object ( |
UrlContext
This type has no fields.
A tool that can be used by the model to fetch URL context.
McpServer
A MCPServer is a server that can be called by the model to perform actions.
namestringThe name of the MCPServer.
urlstringThe full URL for the MCPServer endpoint. Example: "https://api.example.com/mcp"
headersmap (key: string, value: string)Optional: Fields for authentication headers, timeouts, etc., if needed.
An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" } .
allowedTools[]object ( AllowedTools )The allowed tools.
| JSON representation |
|---|
{
"name": string,
"url": string,
"headers": {
string: string,
...
},
"allowedTools": [
{
object ( |
GoogleSearch
A tool that can be used by the model to search Google.
searchTypes[]enum ( SearchType )The types of search grounding to enable.
| JSON representation |
|---|
{
"searchTypes": [
enum ( |
FileSearch
A tool that can be used by the model to search files.
fileSearchStoreNames[]stringThe file search store names to search.
topKintegerThe number of semantic retrieval chunks to retrieve.
metadataFilterstringMetadata filter to apply to the semantic retrieval documents and chunks.
| JSON representation |
|---|
{ "fileSearchStoreNames": [ string ], "topK": integer, "metadataFilter": string } |
GoogleMaps
A tool that can be used by the model to call Google Maps.
enableWidgetbooleanWhether to return a widget context token in the tool call result of the response.
latitudenumberThe latitude of the user's location.
longitudenumberThe longitude of the user's location.
| JSON representation |
|---|
{ "enableWidget": boolean, "latitude": number, "longitude": number } |
کاربرد
Statistics on the interaction request's token usage.
totalInputTokensintegerNumber of tokens in the prompt (context).
inputTokensByModality[]object ( ModalityTokens )A breakdown of input token usage by modality.
totalCachedTokensintegerNumber of tokens in the cached part of the prompt (the cached content).
cachedTokensByModality[]object ( ModalityTokens )A breakdown of cached token usage by modality.
totalOutputTokensintegerTotal number of tokens across all the generated responses.
outputTokensByModality[]object ( ModalityTokens )A breakdown of output token usage by modality.
totalToolUseTokensintegerNumber of tokens present in tool-use prompt(s).
toolUseTokensByModality[]object ( ModalityTokens )A breakdown of tool-use token usage by modality.
totalThoughtTokensintegerNumber of tokens of thoughts for thinking models.
totalTokensintegerTotal token count for the interaction request (prompt + responses + other internal tokens).
groundingToolCount[]object ( GroundingToolCount )Grounding tool count.
| JSON representation |
|---|
{ "totalInputTokens": integer, "inputTokensByModality": [ { object ( |
توکنهای مدالیتی
The token count for a single response modality.
modalityenum ( ResponseModality )The modality associated with the token count.
tokensintegerNumber of tokens for the modality.
| JSON representation |
|---|
{
"modality": enum ( |
GroundingToolCount
The number of grounding tool counts.
typeenum ( Type )The grounding tool type associated with the count.
countintegerThe number of grounding tool counts.
| JSON representation |
|---|
{
"type": enum ( |
پیکربندی وبهوک
Message for configuring webhook events for a request.
uris[]stringOptional. If set, these webhook URIs will be used for webhook events instead of the registered webhooks.
userMetadataobject ( Struct format)Optional. The user metadata that will be returned on each event emission to the webhooks.
| JSON representation |
|---|
{ "uris": [ string ], "userMetadata": { object } } |
SafetySetting
A safety setting that affects the safety-blocking behavior.
A [SafetySetting][google.cloud.aiplatform.master.SafetySetting] consists of a harm [category][google.cloud.aiplatform.master.SafetySetting.category] and a [threshold][google.cloud.aiplatform.master.SafetySetting.threshold] for that category.
typeenum ( HarmCategory )Required. The type of harm category to be blocked.
thresholdenum ( HarmBlockThreshold )Required. The threshold for blocking content. If the harm probability exceeds this threshold, the content will be blocked.
methodenum ( HarmBlockMethod )Optional. The method for blocking content. If not specified, the default behavior is to use the probability score.
| JSON representation |
|---|
{ "type": enum ( |
تحویل
Delivery mode for audio output.
| انومها | |
|---|---|
DELIVERY_UNSPECIFIED | Default value. This value is unused. |
INLINE | Audio data is returned inline in the response. |
URI | Audio data is returned as a URI. |
محیط زیست
Represents the environment being operated, such as a web browser.
| انومها | |
|---|---|
ENVIRONMENT_UNSPECIFIED | Defaults to browser. |
BROWSER | Operates in a web browser. |
MOBILE | Operates in a mobile environment. |
DESKTOP | Operates in a desktop environment. |
HarmBlockMethod
The method for blocking content.
| انومها | |
|---|---|
HARM_BLOCK_METHOD_UNSPECIFIED | The harm block method is unspecified. |
SEVERITY | The harm block method uses both probability and severity scores. |
PROBABILITY | The harm block method uses the probability score. |
HarmBlockThreshold
Thresholds for blocking content based on harm probability.
| انومها | |
|---|---|
HARM_BLOCK_THRESHOLD_UNSPECIFIED | The harm block threshold is unspecified. |
BLOCK_LOW_AND_ABOVE | Block content with a low harm probability or higher. |
BLOCK_MEDIUM_AND_ABOVE | Block content with a medium harm probability or higher. |
BLOCK_ONLY_HIGH | Block content with a high harm probability. |
BLOCK_NONE | Do not block any content, regardless of its harm probability. |
OFF | Turn off the safety filter entirely. |
ImageSize
Supported image sizes for image output.
| انومها | |
|---|---|
IMAGE_SIZE_UNSPECIFIED | Default value. This value is unused. |
IMAGE_SIZE_FIVE_TWELVE | 512px image size. |
IMAGE_SIZE_ONE_K | 1K image size. |
IMAGE_SIZE_TWO_K | 2K image size. |
IMAGE_SIZE_FOUR_K | 4K image size. |
زبان
Supported programming languages for the generated code.
| انومها | |
|---|---|
LANGUAGE_UNSPECIFIED | Unspecified language. This value should not be used. |
PYTHON | Python >= 3.10, with numpy and simpy available. |
MediaResolution
Resolution for input media (images/video).
| انومها | |
|---|---|
MEDIA_RESOLUTION_UNSPECIFIED | Default value. This value is unused. |
LOW | Low resolution. |
MEDIUM | Medium resolution. |
HIGH | High resolution. |
ULTRA_HIGH | Ultra high resolution. |
MimeType
| انومها | |
|---|---|
TYPE_UNSPECIFIED | |
TYPE_WAV | فرمت صوتی WAV |
TYPE_MP3 | MP3 audio format |
TYPE_AIFF | AIFF audio format |
TYPE_AAC | AAC audio format |
TYPE_OGG | OGG audio format |
TYPE_FLAC | FLAC audio format |
TYPE_MPEG | MPEG audio format |
TYPE_M4A | M4A audio format |
TYPE_L16 | L16 audio format |
TYPE_OPUS | OPUS audio format |
TYPE_ALAW | ALAW audio format |
TYPE_MULAW | MULAW audio format |
حالت
Defines the depth and thoroughness of the find session.
| انومها | |
|---|---|
MODE_UNSPECIFIED | Default value. This value is unused. |
MODE_SCAN | Fast scan using only the initial classifier. |
MODE_VERIFY | Performs classification followed by detailed investigation. |
حالت شبکه
Network egress mode for non-allowlist configurations.
| انومها | |
|---|---|
NETWORK_MODE_UNSPECIFIED | Default value. Unused. |
DISABLED | All network egress is blocked. |
روش پاسخ
The modality of the response.
| انومها | |
|---|---|
RESPONSE_MODALITY_UNSPECIFIED | Default value. This value is unused. |
TEXT | Indicates the model should return text. |
IMAGE | Indicates the model should return images. |
AUDIO | Indicates the model should return audio. |
VIDEO | Indicates the model should return video. |
DOCUMENT | Indicates the model should return documents. |
ReviewSnippet
Encapsulates a snippet of a user review that answers a question about the features of a specific place in Google Maps.
titlestringTitle of the review.
urlstringA link that corresponds to the user review on Google Maps.
reviewIdstringThe ID of the review snippet.
| JSON representation |
|---|
{ "title": string, "url": string, "reviewId": string } |
SafetyPolicy
| انومها | |
|---|---|
SAFETY_POLICY_UNSPECIFIED | Unspecified safety policy. |
FINANCIAL_TRANSACTIONS | Safety policy for financial transactions. |
SENSITIVE_DATA_MODIFICATION | Safety policy for sensitive data modification. |
COMMUNICATION_TOOL | Safety policy for communication tools (eg Gmail, Chat, Meet). |
ACCOUNT_CREATION | Safety policy for account creation. |
DATA_MODIFICATION | Safety policy for data modification. |
USER_CONSENT_MANAGEMENT | Safety policy for user consent management. |
LEGAL_TERMS_AND_AGREEMENTS | Safety policy for legal terms and agreements. |
طرحواره
The Schema object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. Represents a select subset of an OpenAPI 3.0 schema object .
typeenum ( Type )Required. Data type.
formatstringOptional. The format of the data. Any value is allowed, but most do not trigger any special functionality.
titlestringOptional. The title of the schema.
descriptionstringOptional. A brief description of the parameter. This could contain examples of use. Parameter description may be formatted as Markdown.
nullablebooleanOptional. Indicates if the value may be null.
enum[]stringOptional. Possible values of the element of Type.STRING with enum format. For example we can define an Enum Direction as : {type:STRING, format:enum, enum:["EAST", NORTH", "SOUTH", "WEST"]}
maxItemsstring ( int64 format)Optional. Maximum number of the elements for Type.ARRAY.
minItemsstring ( int64 format)Optional. Minimum number of the elements for Type.ARRAY.
propertiesmap (key: string, value: object ( Schema ))Optional. Properties of Type.OBJECT.
An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" } .
required[]stringOptional. Required properties of Type.OBJECT.
minPropertiesstring ( int64 format)Optional. Minimum number of the properties for Type.OBJECT.
maxPropertiesstring ( int64 format)Optional. Maximum number of the properties for Type.OBJECT.
minLengthstring ( int64 format)Optional. SCHEMA FIELDS FOR TYPE STRING Minimum length of the Type.STRING
maxLengthstring ( int64 format)Optional. Maximum length of the Type.STRING
patternstringOptional. Pattern of the Type.STRING to restrict a string to a regular expression.
examplevalue ( Value format)Optional. Example of the object. Will only populated when the object is the root.
anyOf[]object ( Schema )Optional. The value should be validated against any (one or more) of the subschemas in the list.
propertyOrdering[]stringOptional. The order of the properties. Not a standard field in open api spec. Used to determine the order of the properties in the response.
defaultvalue ( Value format) Optional. Default value of the field. Per JSON Schema, this field is intended for documentation generators and doesn't affect validation. Thus it's included here and ignored so that developers who send schemas with a default field don't get unknown-field errors.
itemsobject ( Schema )Optional. Schema of the elements of Type.ARRAY.
minimumnumberOptional. SCHEMA FIELDS FOR TYPE INTEGER and NUMBER Minimum value of the Type.INTEGER and Type.NUMBER
maximumnumberOptional. Maximum value of the Type.INTEGER and Type.NUMBER
| JSON representation |
|---|
{ "type": enum ( |
نوع
Type contains the list of OpenAPI data types as defined by https://spec.openapis.org/oas/v3.0.3#data-types
| انومها | |
|---|---|
TYPE_UNSPECIFIED | Not specified, should not be used. |
STRING | String type. |
NUMBER | Number type. |
INTEGER | Integer type. |
BOOLEAN | Boolean type. |
ARRAY | Array type. |
OBJECT | Object type. |
NULL | Null type. |
SearchType
The types of search grounding to enable.
| انومها | |
|---|---|
SEARCH_TYPE_UNSPECIFIED | Unspecified search type. This value should not be used. |
SEARCH_TYPE_WEB_SEARCH | Setting this field enables web search. Only text results are returned. |
SEARCH_TYPE_IMAGE_SEARCH | Setting this field enables image search. Image bytes are returned. |
ساختار
Struct represents a structured data value, consisting of fields which map to dynamically typed values.
fields[]object ( Field )Dynamically typed fields. List instead of map because LLMs are sensitive to ordering, and we want to give users full control.
| JSON representation |
|---|
{
"fields": [
{
object ( |
میدان
وظیفه
Supported video generation tasks.
| انومها | |
|---|---|
TASK_UNSPECIFIED | Unspecified task. The task is inferred from the input prompt and media. |
TEXT_TO_VIDEO | Generates video solely from a text prompt. |
IMAGE_TO_VIDEO | Generates video from one or two source images. The first image defines the starting frame, and the optional second image defines the ending frame. |
REFERENCE_TO_VIDEO | Generates video using reference media (such as images, audio, or video). |
EDIT | Modifies an existing input video. |
ThinkingLevel
The level of thought tokens that the model should generate.
| انومها | |
|---|---|
THINKING_LEVEL_UNSPECIFIED | Default value. This value is unused. |
THINKING_LEVEL_MINIMAL | Little to no thinking. |
THINKING_LEVEL_LOW | Low thinking level. |
THINKING_LEVEL_MEDIUM | Medium thinking level. |
THINKING_LEVEL_HIGH | High thinking level. |
ThinkingSummaries
Whether to include thought summaries in the response.
| انومها | |
|---|---|
THINKING_SUMMARIES_UNSPECIFIED | Default value. This value is unused. |
THINKING_SUMMARIES_AUTO | Auto thinking summaries. |
THINKING_SUMMARIES_NONE | No thinking summaries. |
ابزار
- JSON representation
- FunctionDeclaration
- رفتار
- GoogleSearchRetrieval
- DynamicRetrievalConfig
- حالت
- CodeExecution
- GoogleSearch
- فاصله
- SearchTypes
- WebSearch
- ImageSearch
- ComputerUse
- محیط زیست
- SafetyPolicy
- UrlContext
- FileSearch
- McpServer
- StreamableHttpTransport
- GoogleMaps
Tool details that the model may use to generate response.
A Tool is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the model.
Next ID: 16
functionDeclarations[]object ( FunctionDeclaration ) Optional. A list of FunctionDeclarations available to the model that can be used for function calling.
The model or system does not execute the function. Instead the defined function may be returned as a FunctionCall with arguments to the client side for execution. The model may decide to call a subset of these functions by populating FunctionCall in the response. The next conversation turn may contain a FunctionResponse with the Content.role "function" generation context for the next model turn.
googleSearchRetrievalobject ( GoogleSearchRetrieval )Optional. Retrieval tool that is powered by Google search.
codeExecutionobject ( CodeExecution )Optional. Enables the model to execute code as part of generation.
googleSearchobject ( GoogleSearch )Optional. GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google.
computerUseobject ( ComputerUse )Optional. Tool to support the model interacting directly with the computer. If enabled, it automatically populates computer-use specific Function Declarations.
urlContextobject ( UrlContext )Optional. Tool to support URL context retrieval.
fileSearchobject ( FileSearch )Optional. FileSearch tool type. Tool to retrieve knowledge from Semantic Retrieval corpora.
mcpServers[]object ( McpServer )Optional. MCP Servers to connect to.
googleMapsobject ( GoogleMaps )Optional. Tool that allows grounding the model's response with geospatial context related to the user's query.
| JSON representation |
|---|
{ "functionDeclarations": [ { object ( |
FunctionDeclaration
Structured representation of a function declaration as defined by the OpenAPI 3.03 specification . Included in this declaration are the function name and parameters. This FunctionDeclaration is a representation of a block of code that can be used as a Tool by the model and executed by the client.
namestringRequired. The name of the function. Must be az, AZ, 0-9, or contain underscores, colons, dots, and dashes, with a maximum length of 128.
descriptionstringRequired. A brief description of the function.
behaviorenum ( Behavior )Optional. Specifies the function Behavior. Currently only supported by the BidiGenerateContent method.
parametersobject ( Schema )Optional. Describes the parameters to this function. Reflects the Open API 3.03 Parameter Object string Key: the name of the parameter. Parameter names are case sensitive. Schema Value: the Schema defining the type used for the parameter.
parametersJsonSchemavalue ( Value format)Optional. Describes the parameters to the function in JSON Schema format. The schema must describe an object where the properties are the parameters to the function. For example:
{
"type": "object",
"properties": {
"name": { "type": "string" },
"age": { "type": "integer" }
},
"additionalProperties": false,
"required": ["name", "age"],
"propertyOrdering": ["name", "age"]
}
This field is mutually exclusive with parameters .
responseobject ( Schema )Optional. Describes the output from this function in JSON Schema format. Reflects the Open API 3.03 Response Object. The Schema defines the type used for the response value of the function.
responseJsonSchemavalue ( Value format)Optional. Describes the output from this function in JSON Schema format. The value specified by the schema is the response value of the function.
This field is mutually exclusive with response .
رفتار
Defines the function behavior. Defaults to BLOCKING .
| انومها | |
|---|---|
UNSPECIFIED | This value is unused. |
BLOCKING | If set, the system will wait to receive the function response before continuing the conversation. |
NON_BLOCKING | If set, the system will not wait to receive the function response. Instead, it will attempt to handle function responses as they become available while maintaining the conversation between the user and the model. |
GoogleSearchRetrieval
Tool to retrieve public web data for grounding, powered by Google.
dynamicRetrievalConfigobject ( DynamicRetrievalConfig )Specifies the dynamic retrieval configuration for the given source.
| JSON representation |
|---|
{
"dynamicRetrievalConfig": {
object ( |
DynamicRetrievalConfig
Describes the options to customize dynamic retrieval.
modeenum ( Mode )The mode of the predictor to be used in dynamic retrieval.
dynamicThresholdnumberThe threshold to be used in dynamic retrieval. If not set, a system default value is used.
| JSON representation |
|---|
{
"mode": enum ( |
حالت
The mode of the predictor to be used in dynamic retrieval.
| انومها | |
|---|---|
MODE_UNSPECIFIED | Always trigger retrieval. |
MODE_DYNAMIC | Run retrieval only when system decides it is necessary. |
CodeExecution
This type has no fields.
Tool that executes code generated by the model, and automatically returns the result to the model.
See also ExecutableCode and CodeExecutionResult which are only generated when using this tool.
GoogleSearch
GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google.
timeRangeFilterobject ( Interval )Optional. Filter search results to a specific time range. If customers set a start time, they must set an end time (and vice versa).
searchTypesobject ( SearchTypes )Optional. The set of search types to enable. If not set, web search is enabled by default.
| JSON representation |
|---|
{ "timeRangeFilter": { object ( |
فاصله
Represents a time interval, encoded as a Timestamp start (inclusive) and a Timestamp end (exclusive).
The start must be less than or equal to the end. When the start equals the end, the interval is empty (matches no time). When both start and end are unspecified, the interval matches any time.
startTimestring ( Timestamp format)Optional. Inclusive start of the interval.
If specified, a Timestamp matching this interval will have to be the same or after the start.
Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: "2014-10-02T15:01:23Z" , "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30" .
endTimestring ( Timestamp format)Optional. Exclusive end of the interval.
If specified, a Timestamp matching this interval will have to be before the end.
Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: "2014-10-02T15:01:23Z" , "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30" .
| JSON representation |
|---|
{ "startTime": string, "endTime": string } |
SearchTypes
Different types of search that can be enabled on the GoogleSearch tool.
webSearchobject ( WebSearch )Optional. Enables web search. Only text results are returned.
imageSearchobject ( ImageSearch )Optional. Enables image search. Image bytes are returned.
| JSON representation |
|---|
{ "webSearch": { object ( |
WebSearch
This type has no fields.
Standard web search for grounding and related configurations.
ImageSearch
This type has no fields.
Image search for grounding and related configurations.
ComputerUse
Computer Use tool type.
environmentenum ( Environment )Required. The environment being operated.
excludedPredefinedFunctions[]stringOptional. By default, predefined functions are included in the final model call. Some of them can be explicitly excluded from being automatically included. This can serve two purposes: 1. Using a more restricted / different action space. 2. Improving the definitions / instructions of predefined functions.
enablePromptInjectionDetectionbooleanOptional. Whether enable the prompt injection detection check on computer-use request.
disabledSafetyPolicies[]enum ( SafetyPolicy )Optional. Disabled safety policies for computer use.
| JSON representation |
|---|
{ "environment": enum ( |
محیط زیست
Represents the environment being operated, such as a web browser.
| انومها | |
|---|---|
ENVIRONMENT_UNSPECIFIED | Defaults to browser. |
ENVIRONMENT_BROWSER | Operates in a web browser. |
ENVIRONMENT_MOBILE | Operates in a mobile environment. |
ENVIRONMENT_DESKTOP | Operates in a desktop environment. |
SafetyPolicy
Predefined safety policies for computer use.
| انومها | |
|---|---|
SAFETY_POLICY_UNSPECIFIED | Unspecified safety policy. |
FINANCIAL_TRANSACTIONS | Safety policy for financial transactions. |
SENSITIVE_DATA_MODIFICATION | Safety policy for sensitive data modification. |
COMMUNICATION_TOOL | Safety policy for communication tools (eg Gmail, Chat, Meet). |
ACCOUNT_CREATION | Safety policy for account creation. |
DATA_MODIFICATION | Safety policy for data modification. |
USER_CONSENT_MANAGEMENT | Safety policy for user consent management. |
LEGAL_TERMS_AND_AGREEMENTS | Safety policy for legal terms and agreements. |
UrlContext
This type has no fields.
Tool to support URL context retrieval.
FileSearch
The FileSearch tool that retrieves knowledge from Semantic Retrieval corpora. Files are imported to Semantic Retrieval corpora using the ImportFile API.
fileSearchStoreNames[]string Required. The names of the fileSearchStores to retrieve from. Example: fileSearchStores/my-file-search-store-123
metadataFilterstringOptional. Metadata filter to apply to the semantic retrieval documents and chunks.
topKintegerOptional. The number of semantic retrieval chunks to retrieve.
| JSON representation |
|---|
{ "fileSearchStoreNames": [ string ], "metadataFilter": string, "topK": integer } |
McpServer
A MCPServer is a server that can be called by the model to perform actions. It is a server that implements the MCP protocol. Next ID: 6
namestringThe name of the MCPServer.
transportUnion typetransport can be only one of the following: streamableHttpTransportobject ( StreamableHttpTransport )A transport that can stream HTTP requests and responses.
| JSON representation |
|---|
{
"name": string,
// transport
"streamableHttpTransport": {
object ( |
StreamableHttpTransport
A transport that can stream HTTP requests and responses. Next ID: 6
urlstringThe full URL for the MCPServer endpoint. Example: "https://api.example.com/mcp"
headersmap (key: string, value: string)Optional: Fields for authentication headers, timeouts, etc., if needed.
An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" } .
timeoutstring ( Duration format)HTTP timeout for regular operations.
A duration in seconds with up to nine fractional digits, ending with ' s '. Example: "3.5s" .
sseReadTimeoutstring ( Duration format)Timeout for SSE read operations.
A duration in seconds with up to nine fractional digits, ending with ' s '. Example: "3.5s" .
terminateOnClosebooleanWhether to close the client session when the transport closes.
| JSON representation |
|---|
{ "url": string, "headers": { string: string, ... }, "timeout": string, "sseReadTimeout": string, "terminateOnClose": boolean } |
GoogleMaps
The GoogleMaps Tool that provides geospatial context for the user's query.
enableWidgetbooleanOptional. Whether to return a widget context token in the GroundingMetadata of the response. Developers can use the widget context token to render a Google Maps widget with geospatial context related to the places that the model references in the response.
| JSON representation |
|---|
{ "enableWidget": boolean } |
نوع انتخاب ابزار
The type of tool choice.
| انومها | |
|---|---|
TOOL_CHOICE_TYPE_UNSPECIFIED | Default value. This value is unused. |
AUTO | Auto tool choice. |
ANY | Any tool choice. |
NONE | No tool choice. |
VALIDATED | Validated tool choice. |
ارزش
Value represents a dynamically typed value which can be either null, a number, a string, a boolean, a recursive struct value, or a list of values. A producer of value is expected to set one of these variants. Absence of any variant indicates an error.
kindUnion typekind can be only one of the following:nullValuenullRepresents a null value.
numberValuenumberRepresents a double value.
stringValuestringRepresents a string value.
boolValuebooleanRepresents a boolean value.
structValueobject ( Struct )Represents a structured value.
listValueobject ( ListValue ) Represents a repeated Value .
contentValueobject ( Content )Represents rich content (text, image, etc.).
ListValue
حالت تجسم
Enum for visualization mode. Eventually we will support an interactive mode where the user can choose whether to include HTML visualizations in the response.
| انومها | |
|---|---|
UNSPECIFIED | The default visualization mode. Will default to AUTO. |
OFF | Do not include visualizations. |
AUTO | Automatically include visualizations. |
REST Resource: auth_tokens
- Resource: AuthToken
- BidiGenerateContentSetup
- GenerationConfig
- روش
- SpeechConfig
- VoiceConfig
- PrebuiltVoiceConfig
- MultiSpeakerVoiceConfig
- SpeakerVoiceConfig
- ThinkingConfig
- ThinkingLevel
- ImageConfig
- MediaResolution
- ResponseFormatConfig
- TextResponseFormat
- MimeType
- AudioResponseFormat
- MimeType
- تحویل
- ImageResponseFormat
- MimeType
- تحویل
- AspectRatio
- ImageSize
- پیکربندی ترجمه
- RealtimeInputConfig
- AutomaticActivityDetection
- StartSensitivity
- EndSensitivity
- ActivityHandling
- TurnCoverage
- SessionResumptionConfig
- ContextWindowCompressionConfig
- SlidingWindow
- AudioTranscriptionConfig
- LanguageAuto
- LanguageHints
- HistoryConfig
- روشها
Resource: AuthToken
A request to create an ephemeral authentication token.
namestringOutput only. Identifier. The token itself.
expireTimestring ( Timestamp format)Optional. Input only. Immutable. An optional time after which, when using the resulting token, messages in BidiGenerateContent sessions will be rejected. (Gemini may preemptively close the session after this time.)
If not set then this defaults to 30 minutes in the future. If set, this value must be less than 20 hours in the future.
Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: "2014-10-02T15:01:23Z" , "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30" .
newSessionExpireTimestring ( Timestamp format)Optional. Input only. Immutable. The time after which new Live API sessions using the token resulting from this request will be rejected.
If not set this defaults to 60 seconds in the future. If set, this value must be less than 20 hours in the future.
Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: "2014-10-02T15:01:23Z" , "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30" .
fieldMaskstring ( FieldMask format) Optional. Input only. Immutable. If fieldMask is empty, and bidiGenerateContentSetup is not present, then the effective BidiGenerateContentSetup message is taken from the Live API connection.
If fieldMask is empty, and bidiGenerateContentSetup is present, then the effective BidiGenerateContentSetup message is taken entirely from bidiGenerateContentSetup in this request. The setup message from the Live API connection is ignored.
If fieldMask is not empty, then the corresponding fields from bidiGenerateContentSetup will overwrite the fields from the setup message in the Live API connection.
This is a comma-separated list of fully qualified names of fields. Example: "user.displayName,photo" .
configUnion typeconfig can be only one of the following: bidiGenerateContentSetupobject ( BidiGenerateContentSetup ) Optional. Input only. Immutable. Configuration specific to BidiGenerateContent .
usesintegerOptional. Input only. Immutable. The number of times the token can be used. If this value is zero then no limit is applied. Resuming a Live API session does not count as a use. If unspecified, the default is 1.
| JSON representation |
|---|
{
"name": string,
"expireTime": string,
"newSessionExpireTime": string,
"fieldMask": string,
// config
"bidiGenerateContentSetup": {
object ( |
BidiGenerateContentSetup
Message to be sent in the first (and only in the first) BidiGenerateContentClientMessage . Contains configuration that will apply for the duration of the streaming RPC.
Clients should wait for a BidiGenerateContentSetupComplete message before sending any additional messages.
modelstringRequired. The model's resource name. This serves as an ID for the Model to use.
Format: models/{model}
generationConfigobject ( GenerationConfig )Optional. Generation config.
The following fields are not supported:
-
responseLogprobs -
responseMimeType -
logprobs -
responseSchema -
responseJsonSchema -
stop_sequence -
skipResponseCache -
routing_config -
audio_timestamp
systemInstructionobject ( Content )Optional. The user provided system instructions for the model.
Note: Only text should be used in parts and content in each part will be in a separate paragraph.
tools[]object ( Tool ) Optional. A list of Tools the model may use to generate the next response.
A Tool is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the model.
realtimeInputConfigobject ( RealtimeInputConfig )Optional. Configures the handling of realtime input.
sessionResumptionobject ( SessionResumptionConfig )Optional. Configures session resumption mechanism.
If included, the server will send SessionResumptionUpdate messages.
contextWindowCompressionobject ( ContextWindowCompressionConfig )Optional. Configures a context window compression mechanism.
If included, the server will automatically reduce the size of the context when it exceeds the configured length.
inputAudioTranscriptionobject ( AudioTranscriptionConfig )Optional. If set, enables transcription of voice input. The transcription aligns with the input audio language, if configured.
outputAudioTranscriptionobject ( AudioTranscriptionConfig )Optional. If set, enables transcription of the model's audio output. The transcription aligns with the language code specified for the output audio, if configured.
historyConfigobject ( HistoryConfig )Optional. Configures the exchange of history between the client and the server.
| JSON representation |
|---|
{ "model": string, "generationConfig": { object ( |
GenerationConfig
Configuration options for model generation and outputs. Not all parameters are configurable for every model.
stopSequences[]string Optional. The set of character sequences (up to 5) that will stop output generation. If specified, the API will stop at the first appearance of a stop_sequence . The stop sequence will not be included as part of the response.
responseMimeTypestring Optional. MIME type of the generated candidate text. Supported MIME types are: text/plain : (default) Text output. application/json : JSON response in the response candidates. text/x.enum : ENUM as a string response in the response candidates. Refer to the docs for a list of all supported text MIME types.
responseSchema
(deprecated)object ( Schema )Optional. Output schema of the generated candidate text. Schemas must be a subset of the OpenAPI schema and can be objects, primitives or arrays.
If set, a compatible responseMimeType must also be set. Compatible MIME types: application/json : Schema for JSON response. Refer to the JSON text generation guide for more details.
_responseJsonSchema
(deprecated)value ( Value format) Optional. Output schema of the generated response. This is an alternative to responseSchema that accepts JSON Schema .
If set, responseSchema must be omitted, but responseMimeType is required.
While the full JSON Schema may be sent, not all features are supported. Specifically, only the following properties are supported:
-
$id -
$defs -
$ref -
$anchor -
type -
format -
title -
description -
enum(for strings and numbers) -
items -
prefixItems -
minItems -
maxItems -
minimum -
maximum -
anyOf -
oneOf(interpreted the same asanyOf) -
properties -
additionalProperties -
required
The non-standard propertyOrdering property may also be set.
Cyclic references are unrolled to a limited degree and, as such, may only be used within non-required properties. (Nullable properties are not sufficient.) If $ref is set on a sub-schema, no other properties, except for than those starting as a $ , may be set.
responseJsonSchemavalue ( Value format) Optional. An internal detail. Use responseJsonSchema rather than this field.
responseModalities[]enum ( Modality )Optional. The requested modalities of the response. Represents the set of modalities that the model can return, and should be expected in the response. This is an exact match to the modalities of the response.
A model may have multiple combinations of supported modalities. If the requested modalities do not match any of the supported combinations, an error will be returned.
An empty list is equivalent to requesting only text.
candidateCountintegerOptional. Number of generated responses to return. If unset, this will default to 1. Please note that this doesn't work for previous generation models (Gemini 1.0 family)
maxOutputTokensintegerOptional. The maximum number of tokens to include in a response candidate.
Note: The default value varies by model, see the Model.output_token_limit attribute of the Model returned from the getModel function.
temperaturenumberOptional. Controls the randomness of the output.
Note: The default value varies by model, see the Model.temperature attribute of the Model returned from the getModel function.
Values can range from [0.0, 2.0].
topPnumberOptional. The maximum cumulative probability of tokens to consider when sampling.
The model uses combined Top-k and Top-p (nucleus) sampling.
Tokens are sorted based on their assigned probabilities so that only the most likely tokens are considered. Top-k sampling directly limits the maximum number of tokens to consider, while Nucleus sampling limits the number of tokens based on the cumulative probability.
Note: The default value varies by Model and is specified by the Model.top_p attribute returned from the getModel function. An empty topK attribute indicates that the model doesn't apply top-k sampling and doesn't allow setting topK on requests.
topKintegerOptional. The maximum number of tokens to consider when sampling.
Gemini models use Top-p (nucleus) sampling or a combination of Top-k and nucleus sampling. Top-k sampling considers the set of topK most probable tokens. Models running with nucleus sampling don't allow topK setting.
Note: The default value varies by Model and is specified by the Model.top_p attribute returned from the getModel function. An empty topK attribute indicates that the model doesn't apply top-k sampling and doesn't allow setting topK on requests.
seedintegerOptional. Seed used in decoding. If not set, the request uses a randomly generated seed.
presencePenaltynumberOptional. Presence penalty applied to the next token's logprobs if the token has already been seen in the response.
This penalty is binary on/off and not dependant on the number of times the token is used (after the first). Use frequencyPenalty for a penalty that increases with each use.
A positive penalty will discourage the use of tokens that have already been used in the response, increasing the vocabulary.
A negative penalty will encourage the use of tokens that have already been used in the response, decreasing the vocabulary.
frequencyPenaltynumberOptional. Frequency penalty applied to the next token's logprobs, multiplied by the number of times each token has been seen in the respponse so far.
A positive penalty will discourage the use of tokens that have already been used, proportional to the number of times the token has been used: The more a token is used, the more difficult it is for the model to use that token again increasing the vocabulary of responses.
Caution: A negative penalty will encourage the model to reuse tokens proportional to the number of times the token has been used. Small negative values will reduce the vocabulary of a response. Larger negative values will cause the model to start repeating a common token until it hits the maxOutputTokens limit.
responseLogprobsbooleanOptional. If true, export the logprobs results in response.
logprobsinteger Optional. Only valid if responseLogprobs=True . This sets the number of top logprobs, including the chosen candidate, to return at each decoding step in the Candidate.logprobs_result . The number must be in the range of [0, 20].
enableEnhancedCivicAnswersbooleanOptional. Enables enhanced civic answers. It may not be available for all models.
speechConfigobject ( SpeechConfig )Optional. The speech generation config.
thinkingConfigobject ( ThinkingConfig )Optional. Config for thinking features. An error will be returned if this field is set for models that don't support thinking.
imageConfigobject ( ImageConfig )Optional. Config for image generation. An error will be returned if this field is set for models that don't support these config options.
mediaResolutionenum ( MediaResolution )Optional. If specified, the media resolution specified will be used.
enableAffectiveDialogbooleanOptional. If enabled, the model will detect emotions and adapt its responses accordingly.
responseFormatobject ( ResponseFormatConfig )Optional. Configuration for the response output format. Allows specifying output configuration per modality (text, audio, image) in a flat structure.
translationConfigobject ( TranslationConfig )Optional. Config for translation.
| JSON representation |
|---|
{ "stopSequences": [ string ], "responseMimeType": string, "responseSchema": { object ( |
روش
Supported modalities of the response.
| انومها | |
|---|---|
MODALITY_UNSPECIFIED | مقدار پیشفرض. |
TEXT | Indicates the model should return text. |
IMAGE | Indicates the model should return images. |
AUDIO | Indicates the model should return audio. |
SpeechConfig
Config for speech generation and transcription.
voiceConfigobject ( VoiceConfig )The configuration in case of single-voice output.
multiSpeakerVoiceConfigobject ( MultiSpeakerVoiceConfig )Optional. The configuration for the multi-speaker setup. It is mutually exclusive with the voiceConfig field.
languageCodestringOptional. The IETF BCP-47 language code that the user configured the app to use. Used for speech recognition and synthesis.
Valid values are: de-DE , en-AU , en-GB , en-IN , en-US , es-US , fr-FR , hi-IN , pt-BR , ar-XA , es-ES , fr-CA , id-ID , it-IT , ja-JP , tr-TR , vi-VN , bn-IN , gu-IN , kn-IN , ml-IN , mr-IN , ta-IN , te-IN , nl-NL , ko-KR , cmn-CN , pl-PL , ru-RU , and th-TH .
| JSON representation |
|---|
{ "voiceConfig": { object ( |
VoiceConfig
The configuration for the voice to use.
voice_configUnion typevoice_config can be only one of the following: prebuiltVoiceConfigobject ( PrebuiltVoiceConfig )The configuration for the prebuilt voice to use.
| JSON representation |
|---|
{
// voice_config
"prebuiltVoiceConfig": {
object ( |
PrebuiltVoiceConfig
The configuration for the prebuilt speaker to use.
voiceNamestringThe name of the preset voice to use.
| JSON representation |
|---|
{ "voiceName": string } |
MultiSpeakerVoiceConfig
The configuration for the multi-speaker setup.
speakerVoiceConfigs[]object ( SpeakerVoiceConfig )Required. All the enabled speaker voices.
| JSON representation |
|---|
{
"speakerVoiceConfigs": [
{
object ( |
SpeakerVoiceConfig
The configuration for a single speaker in a multi speaker setup.
speakerstringRequired. The name of the speaker to use. Should be the same as in the prompt.
voiceConfigobject ( VoiceConfig )Required. The configuration for the voice to use.
| JSON representation |
|---|
{
"speaker": string,
"voiceConfig": {
object ( |
ThinkingConfig
Config for thinking features.
includeThoughtsbooleanIndicates whether to include thoughts in the response. If true, thoughts are returned only when available.
thinkingBudgetintegerThe number of thoughts tokens that the model should generate.
thinkingLevelenum ( ThinkingLevel )Optional. Controls the maximum depth of the model's internal reasoning process before it produces a response. The default value is model-dependent. Refer to the Thinking levels guide for more details. Recommended for Gemini 3 or later models. Use with earlier models results in an error.
| JSON representation |
|---|
{
"includeThoughts": boolean,
"thinkingBudget": integer,
"thinkingLevel": enum ( |
ThinkingLevel
Allow user to specify how much to think using enum instead of integer budget.
| انومها | |
|---|---|
THINKING_LEVEL_UNSPECIFIED | مقدار پیشفرض. |
MINIMAL | Little to no thinking. |
LOW | Low thinking level. |
MEDIUM | Medium thinking level. |
HIGH | High thinking level. |
ImageConfig
Config for image generation features.
aspectRatiostring Optional. The aspect ratio of the image to generate. Supported aspect ratios: 1:1 , 1:4 , 4:1 , 1:8 , 8:1 , 2:3 , 3:2 , 3:4 , 4:3 , 4:5 , 5:4 , 9:16 , 16:9 , or 21:9 .
If not specified, the model will choose a default aspect ratio based on any reference images provided.
imageSizestring Optional. Specifies the size of generated images. Supported values are 512 , 1K , 2K , 4K . If not specified, the model will use default value 1K .
| JSON representation |
|---|
{ "aspectRatio": string, "imageSize": string } |
MediaResolution
Media resolution for the input media.
| انومها | |
|---|---|
MEDIA_RESOLUTION_UNSPECIFIED | Media resolution has not been set. |
MEDIA_RESOLUTION_LOW | Media resolution set to low (64 tokens). |
MEDIA_RESOLUTION_MEDIUM | Media resolution set to medium (256 tokens). |
MEDIA_RESOLUTION_HIGH | Media resolution set to high (zoomed reframing with 256 tokens). |
ResponseFormatConfig
Configuration for the response output format. This is a flat object where each optional sub-field configures a specific output modality.
textobject ( TextResponseFormat )Optional. Text output format configuration.
audioobject ( AudioResponseFormat )Optional. Audio output format configuration.
imageobject ( ImageResponseFormat )Optional. Image output format configuration.
| JSON representation |
|---|
{ "text": { object ( |
TextResponseFormat
Configuration for text output format.
mimeTypeenum ( MimeType )Optional. The MIME type of the text output.
schemavalue ( Value format)Optional. The JSON schema that the output should conform to. Only applicable when mimeType is APPLICATION_JSON.
| JSON representation |
|---|
{
"mimeType": enum ( |
MimeType
Supported MIME types for text output.
| انومها | |
|---|---|
MIME_TYPE_UNSPECIFIED | Default value. This value is unused. |
APPLICATION_JSON | JSON output format. |
TEXT_PLAIN | Plain text output format. |
AudioResponseFormat
Configuration for audio output format.
mimeTypeenum ( MimeType )Optional. The MIME type of the audio output.
deliveryenum ( Delivery )Optional. The delivery mode for the audio output.
sampleRateintegerOptional. Sample rate in Hz.
bitRateintegerOptional. Bit rate in bits per second (bps). Only applicable for compressed formats (MP3, Opus).
MimeType
Supported MIME types for audio output.
| انومها | |
|---|---|
MIME_TYPE_UNSPECIFIED | Default value. This value is unused. |
AUDIO_MP3 | MP3 audio format. |
AUDIO_OGG_OPUS | OGG Opus audio format. |
AUDIO_L16 | Raw PCM (L16) audio format. |
AUDIO_WAV | WAV audio format. |
AUDIO_ALAW | A-law audio format. |
AUDIO_MULAW | Mu-law audio format. |
تحویل
Delivery mode for audio output.
| انومها | |
|---|---|
DELIVERY_UNSPECIFIED | Default value. This value is unused. |
INLINE | Audio data is returned inline in the response. |
URI | Audio data is returned as a URI. |
ImageResponseFormat
Configuration for image output format.
mimeTypeenum ( MimeType )Optional. The MIME type of the image output.
deliveryenum ( Delivery )Optional. The delivery mode for the image output.
aspectRatioenum ( AspectRatio )Optional. The aspect ratio for the image output.
imageSizeenum ( ImageSize )Optional. The size of the image output.
| JSON representation |
|---|
{ "mimeType": enum ( |
MimeType
Supported MIME types for image output.
| انومها | |
|---|---|
MIME_TYPE_UNSPECIFIED | Default value. This value is unused. |
IMAGE_JPEG | JPEG image format. |
تحویل
Delivery mode for image output.
| انومها | |
|---|---|
DELIVERY_UNSPECIFIED | Default value. This value is unused. |
INLINE | Image data is returned inline in the response. |
URI | Image data is returned as a URI. |
AspectRatio
Supported aspect ratios for image output.
| انومها | |
|---|---|
ASPECT_RATIO_UNSPECIFIED | Default value. This value is unused. |
ASPECT_RATIO_ONE_BY_ONE | 1:1 aspect ratio. |
ASPECT_RATIO_TWO_BY_THREE | 2:3 aspect ratio. |
ASPECT_RATIO_THREE_BY_TWO | نسبت تصویر ۳:۲. |
ASPECT_RATIO_THREE_BY_FOUR | 3:4 aspect ratio. |
ASPECT_RATIO_FOUR_BY_THREE | 4:3 aspect ratio. |
ASPECT_RATIO_FOUR_BY_FIVE | 4:5 aspect ratio. |
ASPECT_RATIO_FIVE_BY_FOUR | 5:4 aspect ratio. |
ASPECT_RATIO_NINE_BY_SIXTEEN | 9:16 aspect ratio. |
ASPECT_RATIO_SIXTEEN_BY_NINE | 16:9 aspect ratio. |
ASPECT_RATIO_TWENTY_ONE_BY_NINE | 21:9 aspect ratio. |
ASPECT_RATIO_ONE_BY_EIGHT | 1:8 aspect ratio. |
ASPECT_RATIO_EIGHT_BY_ONE | 8:1 aspect ratio. |
ASPECT_RATIO_ONE_BY_FOUR | 1:4 aspect ratio. |
ASPECT_RATIO_FOUR_BY_ONE | 4:1 aspect ratio. |
ImageSize
Supported image sizes for image output.
| انومها | |
|---|---|
IMAGE_SIZE_UNSPECIFIED | Default value. This value is unused. |
IMAGE_SIZE_FIVE_TWELVE | 512px image size. |
IMAGE_SIZE_ONE_K | 1K image size. |
IMAGE_SIZE_TWO_K | 2K image size. |
IMAGE_SIZE_FOUR_K | 4K image size. |
پیکربندی ترجمه
Config for translation features.
targetLanguageCodestringRequired. The target language for translation. Supported values are BCP-47 language codes (eg "en", "es", "fr").
echoTargetLanguagebooleanOptional. If true, the model will generate audio when the target language is spoken, essentially it will parrot the input. If false, we will not produce audio for the target language.
| نمایش JSON |
|---|
{ "targetLanguageCode": string, "echoTargetLanguage": boolean } |
RealtimeInputConfig
Configures the realtime input behavior in BidiGenerateContent .
automaticActivityDetectionobject ( AutomaticActivityDetection )Optional. If not set, automatic activity detection is enabled by default. If automatic voice detection is disabled, the client must send activity signals.
activityHandlingenum ( ActivityHandling )Optional. Defines what effect activity has.
turnCoverageenum ( TurnCoverage )Optional. Defines which input is included in the user's turn.
| JSON representation |
|---|
{ "automaticActivityDetection": { object ( |
AutomaticActivityDetection
Configures automatic detection of activity.
disabledbooleanOptional. If enabled (the default), detected voice and text input count as activity. If disabled, the client must send activity signals.
startOfSpeechSensitivityenum ( StartSensitivity )Optional. Determines how likely speech is to be detected.
prefixPaddingMsintegerOptional. The required duration of detected speech before start-of-speech is committed. The lower this value, the more sensitive the start-of-speech detection is and shorter speech can be recognized. However, this also increases the probability of false positives.
endOfSpeechSensitivityenum ( EndSensitivity )Optional. Determines how likely detected speech is ended.
silenceDurationMsintegerOptional. The required duration of detected non-speech (eg silence) before end-of-speech is committed. The larger this value, the longer speech gaps can be without interrupting the user's activity but this will increase the model's latency.
| JSON representation |
|---|
{ "disabled": boolean, "startOfSpeechSensitivity": enum ( |
StartSensitivity
Determines how start of speech is detected.
| انومها | |
|---|---|
START_SENSITIVITY_UNSPECIFIED | The default is START_SENSITIVITY_HIGH. |
START_SENSITIVITY_HIGH | Automatic detection will detect the start of speech more often. |
START_SENSITIVITY_LOW | Automatic detection will detect the start of speech less often. |
EndSensitivity
Determines how end of speech is detected.
| انومها | |
|---|---|
END_SENSITIVITY_UNSPECIFIED | The default is END_SENSITIVITY_HIGH. |
END_SENSITIVITY_HIGH | Automatic detection ends speech more often. |
END_SENSITIVITY_LOW | Automatic detection ends speech less often. |
ActivityHandling
The different ways of handling user activity.
| انومها | |
|---|---|
ACTIVITY_HANDLING_UNSPECIFIED | If unspecified, the default behavior is START_OF_ACTIVITY_INTERRUPTS . |
START_OF_ACTIVITY_INTERRUPTS | If true, start of activity will interrupt the model's response (also called "barge in"). The model's current response will be cut-off in the moment of the interruption. This is the default behavior. |
NO_INTERRUPTION | The model's response will not be interrupted. |
TurnCoverage
Options about which input is included in the user's turn.
| انومها | |
|---|---|
TURN_COVERAGE_UNSPECIFIED | If unspecified, a default behavior is selected based on the model. Eg, for Gemini 2.5, the default is TURN_INCLUDES_ONLY_ACTIVITY , while for Gemini 3.1 and onwards, it's TURN_INCLUDES_AUDIO_ACTIVITY_AND_ALL_VIDEO . |
TURN_INCLUDES_ONLY_ACTIVITY | Includes activity since the last turn, excluding inactivity (eg silence on the audio stream). |
TURN_INCLUDES_ALL_INPUT | Includes all realtime input since the last turn, including inactivity (eg silence on the audio stream). |
TURN_INCLUDES_AUDIO_ACTIVITY_AND_ALL_VIDEO | Includes audio activity and all video since the last turn. With automatic activity detection, audio activity means speech and excludes silence. |
SessionResumptionConfig
Session resumption configuration.
This message is included in the session configuration as BidiGenerateContentSetup.session_resumption . If configured, the server will send SessionResumptionUpdate messages.
handlestringThe handle of a previous session. If not present then a new session is created.
Session handles come from SessionResumptionUpdate.token values in previous connections.
| JSON representation |
|---|
{ "handle": string } |
ContextWindowCompressionConfig
Enables context window compression — a mechanism for managing the model's context window so that it does not exceed a given length.
compression_mechanismUnion typecompression_mechanism can be only one of the following: slidingWindowobject ( SlidingWindow )A sliding-window mechanism.
triggerTokensstring ( int64 format)The number of tokens (before running a turn) required to trigger a context window compression.
This can be used to balance quality against latency as shorter context windows may result in faster model responses. However, any compression operation will cause a temporary latency increase, so they should not be triggered frequently.
If not set, the default is 80% of the model's context window limit. This leaves 20% for the next user request/model response.
| JSON representation |
|---|
{
// compression_mechanism
"slidingWindow": {
object ( |
SlidingWindow
The SlidingWindow method operates by discarding content at the beginning of the context window. The resulting context will always begin at the start of a USER role turn. System instructions and any BidiGenerateContentSetup.prefix_turns will always remain at the beginning of the result.
targetTokensstring ( int64 format)The target number of tokens to keep. The default value is triggerTokens/2.
Discarding parts of the context window causes a temporary latency increase so this value should be calibrated to avoid frequent compression operations.
| JSON representation |
|---|
{ "targetTokens": string } |
AudioTranscriptionConfig
The audio transcription configuration.
adaptationPhrases[]
(deprecated)stringOptional. A list of phrases used for speech adaptation, which biases the ASR model to improve recognition of these specific terms.
customVocabulary[]stringOptional. A list of custom vocabulary phrases to bias the speech recognition model toward recognizing specific terms (product names, proper nouns, jargon).
language_configUnion typelanguage_config can be only one of the following: languageAutoobject ( LanguageAuto )Optional. The model will detect the language automatically.
languageHintsobject ( LanguageHints )Optional. Specifies one or more languages in the audio.
| JSON representation |
|---|
{ "adaptationPhrases": [ string ], "customVocabulary": [ string ], // language_config "languageAuto": { object ( |
LanguageAuto
This type has no fields.
Indicates the language of the audio should be automatically detected.
LanguageHints
Provides hints to the model about possible languages present in the audio.
languageCodes[]stringRequired. BCP-47 language codes.
| JSON representation |
|---|
{ "languageCodes": [ string ] } |
HistoryConfig
History configuration.
This message is included in the session configuration as BidiGenerateContentSetup.history_config . Configures the exchange of history messages.
initialHistoryInClientContentboolean Optional. If true, after sending setupComplete , the server will wait and at first process clientContent messages until turnComplete is true . This initial history will not trigger a model call and may end with role MODEL . After turnComplete is true , the client can start the realtime conversation via realtimeInput .
| نمایش JSON |
|---|
{ "initialHistoryInClientContent": boolean } |
Method: auth_tokens.create
Creates a token that can be used to constrain the behavior of a BidiGenerateContent session.
نقطه پایانی
posthttps: / /generativelanguage.googleapis.com /v1beta /auth_tokensدرخواست بدنه
The request body contains an instance of AuthToken .
expireTimestring ( Timestamp format)Optional. Input only. Immutable. An optional time after which, when using the resulting token, messages in BidiGenerateContent sessions will be rejected. (Gemini may preemptively close the session after this time.)
If not set then this defaults to 30 minutes in the future. If set, this value must be less than 20 hours in the future.
Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: "2014-10-02T15:01:23Z" , "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30" .
newSessionExpireTimestring ( Timestamp format)Optional. Input only. Immutable. The time after which new Live API sessions using the token resulting from this request will be rejected.
If not set this defaults to 60 seconds in the future. If set, this value must be less than 20 hours in the future.
Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: "2014-10-02T15:01:23Z" , "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30" .
fieldMaskstring ( FieldMask format) Optional. Input only. Immutable. If fieldMask is empty, and bidiGenerateContentSetup is not present, then the effective BidiGenerateContentSetup message is taken from the Live API connection.
If fieldMask is empty, and bidiGenerateContentSetup is present, then the effective BidiGenerateContentSetup message is taken entirely from bidiGenerateContentSetup in this request. The setup message from the Live API connection is ignored.
If fieldMask is not empty, then the corresponding fields from bidiGenerateContentSetup will overwrite the fields from the setup message in the Live API connection.
This is a comma-separated list of fully qualified names of fields. Example: "user.displayName,photo" .
configUnion typeconfig can be only one of the following: bidiGenerateContentSetupobject ( BidiGenerateContentSetup ) Optional. Input only. Immutable. Configuration specific to BidiGenerateContent .
usesintegerOptional. Input only. Immutable. The number of times the token can be used. If this value is zero then no limit is applied. Resuming a Live API session does not count as a use. If unspecified, the default is 1.
بدنه پاسخ
If successful, the response body contains a newly created instance of AuthToken .