זהו מדריך מקיף שכולל את היכולות וההגדרות שזמינות ב-API בזמן אמת. בדף תחילת העבודה עם Live API מופיע סקירה כללית וקוד לדוגמה לתרחישי שימוש נפוצים.
לפני שמתחילים
- כדאי להכיר את המושגים העיקריים: אם עדיין לא עשיתם את זה, קודם כדאי לקרוא את המאמר תחילת העבודה עם Live API . במאמר הזה נסביר על העקרונות הבסיסיים של Live API, איך הוא פועל ועל גישות שונות להטמעה.
- כדאי לנסות את Live API ב-AI Studio: יכול להיות שיהיה לכם שימושי לנסות את Live API ב-Google AI Studio לפני שתתחילו לפתח. כדי להשתמש ב-Live API ב-Google AI Studio, בוחרים באפשרות Stream (שידור).
יצירת חיבור
בדוגמה הבאה מוצג איך ליצור חיבור באמצעות מפתח API:
Python
import asyncio
from google import genai
client = genai.Client()
model = "gemini-2.5-flash-native-audio-preview-09-2025"
config = {"response_modalities": ["AUDIO"]}
async def main():
async with client.aio.live.connect(model=model, config=config) as session:
print("Session started")
# Send content...
if __name__ == "__main__":
asyncio.run(main())
JavaScript
import { GoogleGenAI, Modality } from '@google/genai';
const ai = new GoogleGenAI({});
const model = 'gemini-2.5-flash-native-audio-preview-09-2025';
const config = { responseModalities: [Modality.AUDIO] };
async function main() {
const session = await ai.live.connect({
model: model,
callbacks: {
onopen: function () {
console.debug('Opened');
},
onmessage: function (message) {
console.debug(message);
},
onerror: function (e) {
console.debug('Error:', e.message);
},
onclose: function (e) {
console.debug('Close:', e.reason);
},
},
config: config,
});
console.debug("Session started");
// Send content...
session.close();
}
main();
אופני אינטראקציה
בקטעים הבאים מופיעות דוגמאות והסבר על ההקשר של אמצעי הקלט והפלט השונים שזמינים ב-Live API.
שליחה וקבלה של אודיו
הדוגמה הנפוצה ביותר לאודיו, אודיו לאודיו, מוסברת במדריך תחילת העבודה.
פורמטים של אודיו
נתוני האודיו ב-Live API הם תמיד גולמיים, בפורמט little-endian,
PCM של 16 ביט. תמיד נעשה שימוש בתדירות דגימה של 24kHz בפלט האודיו. השמע שמוזן הוא בדרך כלל 16kHz, אבל Live API ידגום מחדש אם צריך, כך שאפשר לשלוח כל תדירות דגימה. כדי לציין את תדירות הדגימה של אודיו שמוזן, צריך להגדיר את סוג ה-MIME של כל Blob שמכיל אודיו לערך כמו audio/pcm;rate=16000.
נשלחת הודעת טקסט
כך שולחים הודעת טקסט:
Python
message = "Hello, how are you?"
await session.send_client_content(turns=message, turn_complete=True)
JavaScript
const message = 'Hello, how are you?';
session.sendClientContent({ turns: message, turnComplete: true });
עדכונים מצטברים של תוכן
אפשר להשתמש בעדכונים מצטברים כדי לשלוח קלט טקסט, ליצור הקשר של סשן או לשחזר את ההקשר של סשן. בהקשרים קצרים אפשר לשלוח אינטראקציות שלב אחר שלב כדי לייצג את רצף האירועים המדויק:
Python
turns = [
{"role": "user", "parts": [{"text": "What is the capital of France?"}]},
{"role": "model", "parts": [{"text": "Paris"}]},
]
await session.send_client_content(turns=turns, turn_complete=False)
turns = [{"role": "user", "parts": [{"text": "What is the capital of Germany?"}]}]
await session.send_client_content(turns=turns, turn_complete=True)
JavaScript
let inputTurns = [
{ "role": "user", "parts": [{ "text": "What is the capital of France?" }] },
{ "role": "model", "parts": [{ "text": "Paris" }] },
]
session.sendClientContent({ turns: inputTurns, turnComplete: false })
inputTurns = [{ "role": "user", "parts": [{ "text": "What is the capital of Germany?" }] }]
session.sendClientContent({ turns: inputTurns, turnComplete: true })
בהקשרים ארוכים יותר, מומלץ לספק סיכום של הודעה אחת כדי לפנות מקום בחלון ההקשר לאינטראקציות הבאות. במאמר בנושא המשכת סשן מוסבר על שיטה נוספת לטעינת הקשר של הסשן.
תמלולי אודיו
בנוסף לתשובה של המודל, אפשר גם לקבל תמלילים של פלט האודיו ושל קלט האודיו.
כדי להפעיל תמלול של פלט האודיו של המודל, שולחים את המחרוזת
output_audio_transcription בהגדרות. שפת התמלול נקבעת לפי התשובה של המודל.
Python
import asyncio
from google import genai
from google.genai import types
client = genai.Client()
model = "gemini-2.5-flash-native-audio-preview-09-2025"
config = {
"response_modalities": ["AUDIO"],
"output_audio_transcription": {}
}
async def main():
async with client.aio.live.connect(model=model, config=config) as session:
message = "Hello? Gemini are you there?"
await session.send_client_content(
turns={"role": "user", "parts": [{"text": message}]}, turn_complete=True
)
async for response in session.receive():
if response.server_content.model_turn:
print("Model turn:", response.server_content.model_turn)
if response.server_content.output_transcription:
print("Transcript:", response.server_content.output_transcription.text)
if __name__ == "__main__":
asyncio.run(main())
JavaScript
import { GoogleGenAI, Modality } from '@google/genai';
const ai = new GoogleGenAI({});
const model = 'gemini-2.5-flash-native-audio-preview-09-2025';
const config = {
responseModalities: [Modality.AUDIO],
outputAudioTranscription: {}
};
async function live() {
const responseQueue = [];
async function waitMessage() {
let done = false;
let message = undefined;
while (!done) {
message = responseQueue.shift();
if (message) {
done = true;
} else {
await new Promise((resolve) => setTimeout(resolve, 100));
}
}
return message;
}
async function handleTurn() {
const turns = [];
let done = false;
while (!done) {
const message = await waitMessage();
turns.push(message);
if (message.serverContent && message.serverContent.turnComplete) {
done = true;
}
}
return turns;
}
const session = await ai.live.connect({
model: model,
callbacks: {
onopen: function () {
console.debug('Opened');
},
onmessage: function (message) {
responseQueue.push(message);
},
onerror: function (e) {
console.debug('Error:', e.message);
},
onclose: function (e) {
console.debug('Close:', e.reason);
},
},
config: config,
});
const inputTurns = 'Hello how are you?';
session.sendClientContent({ turns: inputTurns });
const turns = await handleTurn();
for (const turn of turns) {
if (turn.serverContent && turn.serverContent.outputTranscription) {
console.debug('Received output transcription: %s\n', turn.serverContent.outputTranscription.text);
}
}
session.close();
}
async function main() {
await live().catch((e) => console.error('got error', e));
}
main();
כדי להפעיל תמלול של קלט האודיו של המודל, שולחים את הפקודה
input_audio_transcription בהגדרות.
Python
import asyncio
from pathlib import Path
from google import genai
from google.genai import types
client = genai.Client()
model = "gemini-2.5-flash-native-audio-preview-09-2025"
config = {
"response_modalities": ["AUDIO"],
"input_audio_transcription": {},
}
async def main():
async with client.aio.live.connect(model=model, config=config) as session:
audio_data = Path("16000.pcm").read_bytes()
await session.send_realtime_input(
audio=types.Blob(data=audio_data, mime_type='audio/pcm;rate=16000')
)
async for msg in session.receive():
if msg.server_content.input_transcription:
print('Transcript:', msg.server_content.input_transcription.text)
if __name__ == "__main__":
asyncio.run(main())
JavaScript
import { GoogleGenAI, Modality } from '@google/genai';
import * as fs from "node:fs";
import pkg from 'wavefile';
const { WaveFile } = pkg;
const ai = new GoogleGenAI({});
const model = 'gemini-2.5-flash-native-audio-preview-09-2025';
const config = {
responseModalities: [Modality.AUDIO],
inputAudioTranscription: {}
};
async function live() {
const responseQueue = [];
async function waitMessage() {
let done = false;
let message = undefined;
while (!done) {
message = responseQueue.shift();
if (message) {
done = true;
} else {
await new Promise((resolve) => setTimeout(resolve, 100));
}
}
return message;
}
async function handleTurn() {
const turns = [];
let done = false;
while (!done) {
const message = await waitMessage();
turns.push(message);
if (message.serverContent && message.serverContent.turnComplete) {
done = true;
}
}
return turns;
}
const session = await ai.live.connect({
model: model,
callbacks: {
onopen: function () {
console.debug('Opened');
},
onmessage: function (message) {
responseQueue.push(message);
},
onerror: function (e) {
console.debug('Error:', e.message);
},
onclose: function (e) {
console.debug('Close:', e.reason);
},
},
config: config,
});
// Send Audio Chunk
const fileBuffer = fs.readFileSync("16000.wav");
// Ensure audio conforms to API requirements (16-bit PCM, 16kHz, mono)
const wav = new WaveFile();
wav.fromBuffer(fileBuffer);
wav.toSampleRate(16000);
wav.toBitDepth("16");
const base64Audio = wav.toBase64();
// If already in correct format, you can use this:
// const fileBuffer = fs.readFileSync("sample.pcm");
// const base64Audio = Buffer.from(fileBuffer).toString('base64');
session.sendRealtimeInput(
{
audio: {
data: base64Audio,
mimeType: "audio/pcm;rate=16000"
}
}
);
const turns = await handleTurn();
for (const turn of turns) {
if (turn.text) {
console.debug('Received text: %s\n', turn.text);
}
else if (turn.data) {
console.debug('Received inline data: %s\n', turn.data);
}
else if (turn.serverContent && turn.serverContent.inputTranscription) {
console.debug('Received input transcription: %s\n', turn.serverContent.inputTranscription.text);
}
}
session.close();
}
async function main() {
await live().catch((e) => console.error('got error', e));
}
main();
הזרמת אודיו ווידאו
שינוי הקול והשפה
מודלים של פלט אודיו מקורי תומכים בכל הקולות שזמינים במודלים של המרת טקסט לדיבור (TTS). אפשר להאזין לכל הקולות ב-AI Studio.
כדי לציין קול, מגדירים את שם הקול באובייקט speechConfig כחלק מהגדרת הסשן:
Python
config = {
"response_modalities": ["AUDIO"],
"speech_config": {
"voice_config": {"prebuilt_voice_config": {"voice_name": "Kore"}}
},
}
JavaScript
const config = {
responseModalities: [Modality.AUDIO],
speechConfig: { voiceConfig: { prebuiltVoiceConfig: { voiceName: "Kore" } } }
};
Live API תומך במספר שפות. מודלים של פלט אודיו בשפה המקורית בוחרים באופן אוטומטי את השפה המתאימה ולא תומכים בהגדרה מפורשת של קוד השפה.
יכולות אודיו מובנות
המודלים הכי חדשים שלנו כוללים פלט אודיו מקורי, שמספק דיבור טבעי וריאליסטי וביצועים משופרים בריבוי שפות. התכונה 'שמע מקורי' מאפשרת גם תכונות מתקדמות כמו דיאלוג אפקטיבי (מודע לרגשות), שמע פרואקטיבי (המודל מחליט בצורה חכמה מתי להגיב לקלט) ו'חשיבה'.
שיחה מותאמת-רגש
התכונה הזו מאפשרת ל-Gemini להתאים את סגנון התשובה שלו לניסוח ולטון של הקלט.
כדי להשתמש בדיאלוג אפקטיבי, צריך להגדיר את גרסת ה-API ל-v1alpha ולהגדיר את enable_affective_dialog ל-true בהודעת ההגדרה:
Python
client = genai.Client(http_options={"api_version": "v1alpha"})
config = types.LiveConnectConfig(
response_modalities=["AUDIO"],
enable_affective_dialog=True
)
JavaScript
const ai = new GoogleGenAI({ httpOptions: {"apiVersion": "v1alpha"} });
const config = {
responseModalities: [Modality.AUDIO],
enableAffectiveDialog: true
};
אודיו פרואקטיבי
כשהתכונה הזו מופעלת, Gemini יכול להחליט באופן יזום לא להשיב אם התוכן לא רלוונטי.
כדי להשתמש בו, צריך להגדיר את גרסת ה-API ל-v1alpha, להגדיר את השדה proactivity בהודעת ההגדרה ולהגדיר את הערך proactive_audio ל-true:
Python
client = genai.Client(http_options={"api_version": "v1alpha"})
config = types.LiveConnectConfig(
response_modalities=["AUDIO"],
proactivity={'proactive_audio': True}
)
JavaScript
const ai = new GoogleGenAI({ httpOptions: {"apiVersion": "v1alpha"} });
const config = {
responseModalities: [Modality.AUDIO],
proactivity: { proactiveAudio: true }
}
בתהליך חשיבה
המודל האחרון של פלט אודיו מקורי gemini-2.5-flash-native-audio-preview-09-2025
תומך ביכולות חשיבה, עם חשיבה דינמית שמופעלת כברירת מחדל.
הפרמטר thinkingBudget מכוון את המודל לגבי מספר הטוקנים של החשיבה שבהם צריך להשתמש כשיוצרים תשובה. כדי להשבית את החשיבה, צריך להגדיר את thinkingBudget לערך 0. למידע נוסף על פרטי ההגדרה של המודל thinkingBudget, אפשר לעיין במסמכי התיעוד בנושא תקציבי חשיבה.
Python
model = "gemini-2.5-flash-native-audio-preview-09-2025"
config = types.LiveConnectConfig(
response_modalities=["AUDIO"]
thinking_config=types.ThinkingConfig(
thinking_budget=1024,
)
)
async with client.aio.live.connect(model=model, config=config) as session:
# Send audio input and receive audio
JavaScript
const model = 'gemini-2.5-flash-native-audio-preview-09-2025';
const config = {
responseModalities: [Modality.AUDIO],
thinkingConfig: {
thinkingBudget: 1024,
},
};
async function main() {
const session = await ai.live.connect({
model: model,
config: config,
callbacks: ...,
});
// Send audio input and receive audio
session.close();
}
main();
בנוסף, אפשר להפעיל סיכומי מחשבות על ידי הגדרת includeThoughts ל-true בהגדרות. מידע נוסף על סיכומי מחשבות
Python
model = "gemini-2.5-flash-native-audio-preview-09-2025"
config = types.LiveConnectConfig(
response_modalities=["AUDIO"]
thinking_config=types.ThinkingConfig(
thinking_budget=1024,
include_thoughts=True
)
)
JavaScript
const model = 'gemini-2.5-flash-native-audio-preview-09-2025';
const config = {
responseModalities: [Modality.AUDIO],
thinkingConfig: {
thinkingBudget: 1024,
includeThoughts: true,
},
};
זיהוי פעילות קולית (VAD)
זיהוי פעילות קולית (VAD) מאפשר למודל לזהות מתי אדם מדבר. היכולת הזו חיונית ליצירת שיחות טבעיות, כי היא מאפשרת למשתמש לקטוע את המודל בכל שלב.
כש-VAD מזהה הפרעה, היצירה המתמשכת מבוטלת ומושלכת. רק המידע שכבר נשלח ללקוח נשמר בהיסטוריית הסשנים. השרת שולח הודעת BidiGenerateContentServerContent כדי לדווח על ההפרעה.
שרת Gemini מוחק את כל הקריאות לפונקציות שממתינות לשליחה, ושולח הודעת BidiGenerateContentServerContent עם מזהי השיחות שבוטלו.
Python
async for response in session.receive():
if response.server_content.interrupted is True:
# The generation was interrupted
# If realtime playback is implemented in your application,
# you should stop playing audio and clear queued playback here.
JavaScript
const turns = await handleTurn();
for (const turn of turns) {
if (turn.serverContent && turn.serverContent.interrupted) {
// The generation was interrupted
// If realtime playback is implemented in your application,
// you should stop playing audio and clear queued playback here.
}
}
VAD אוטומטי
כברירת מחדל, המודל מבצע VAD באופן אוטומטי על זרם קלט רציף של אודיו. אפשר להגדיר את ה-VAD באמצעות השדה realtimeInputConfig.automaticActivityDetection של הגדרת ההגדרה.
אם זרם האודיו מושהה למשך יותר משנייה (לדוגמה, כי המשתמש כיבה את המיקרופון), צריך לשלוח אירוע audioStreamEnd כדי לנקות את האודיו שנשמר במטמון. הלקוח יכול להמשיך לשלוח נתוני אודיו בכל שלב.
Python
# example audio file to try:
# URL = "https://storage.googleapis.com/generativeai-downloads/data/hello_are_you_there.pcm"
# !wget -q $URL -O sample.pcm
import asyncio
from pathlib import Path
from google import genai
from google.genai import types
client = genai.Client()
model = "gemini-live-2.5-flash-preview"
config = {"response_modalities": ["TEXT"]}
async def main():
async with client.aio.live.connect(model=model, config=config) as session:
audio_bytes = Path("sample.pcm").read_bytes()
await session.send_realtime_input(
audio=types.Blob(data=audio_bytes, mime_type="audio/pcm;rate=16000")
)
# if stream gets paused, send:
# await session.send_realtime_input(audio_stream_end=True)
async for response in session.receive():
if response.text is not None:
print(response.text)
if __name__ == "__main__":
asyncio.run(main())
JavaScript
// example audio file to try:
// URL = "https://storage.googleapis.com/generativeai-downloads/data/hello_are_you_there.pcm"
// !wget -q $URL -O sample.pcm
import { GoogleGenAI, Modality } from '@google/genai';
import * as fs from "node:fs";
const ai = new GoogleGenAI({});
const model = 'gemini-live-2.5-flash-preview';
const config = { responseModalities: [Modality.TEXT] };
async function live() {
const responseQueue = [];
async function waitMessage() {
let done = false;
let message = undefined;
while (!done) {
message = responseQueue.shift();
if (message) {
done = true;
} else {
await new Promise((resolve) => setTimeout(resolve, 100));
}
}
return message;
}
async function handleTurn() {
const turns = [];
let done = false;
while (!done) {
const message = await waitMessage();
turns.push(message);
if (message.serverContent && message.serverContent.turnComplete) {
done = true;
}
}
return turns;
}
const session = await ai.live.connect({
model: model,
callbacks: {
onopen: function () {
console.debug('Opened');
},
onmessage: function (message) {
responseQueue.push(message);
},
onerror: function (e) {
console.debug('Error:', e.message);
},
onclose: function (e) {
console.debug('Close:', e.reason);
},
},
config: config,
});
// Send Audio Chunk
const fileBuffer = fs.readFileSync("sample.pcm");
const base64Audio = Buffer.from(fileBuffer).toString('base64');
session.sendRealtimeInput(
{
audio: {
data: base64Audio,
mimeType: "audio/pcm;rate=16000"
}
}
);
// if stream gets paused, send:
// session.sendRealtimeInput({ audioStreamEnd: true })
const turns = await handleTurn();
for (const turn of turns) {
if (turn.text) {
console.debug('Received text: %s\n', turn.text);
}
else if (turn.data) {
console.debug('Received inline data: %s\n', turn.data);
}
}
session.close();
}
async function main() {
await live().catch((e) => console.error('got error', e));
}
main();
אם משתמשים ב-send_realtime_input, ה-API יגיב לאודיו באופן אוטומטי על סמך VAD. send_client_content מוסיף הודעות להקשר של המודל לפי הסדר, אבל send_realtime_input מותאם לתגובה מהירה על חשבון סדר קבוע.
הגדרה אוטומטית של VAD
כדי לקבל שליטה רבה יותר על פעילות ה-VAD, אפשר להגדיר את הפרמטרים הבאים. מידע נוסף זמין במאמר בנושא הפניית API.
Python
from google.genai import types
config = {
"response_modalities": ["TEXT"],
"realtime_input_config": {
"automatic_activity_detection": {
"disabled": False, # default
"start_of_speech_sensitivity": types.StartSensitivity.START_SENSITIVITY_LOW,
"end_of_speech_sensitivity": types.EndSensitivity.END_SENSITIVITY_LOW,
"prefix_padding_ms": 20,
"silence_duration_ms": 100,
}
}
}
JavaScript
import { GoogleGenAI, Modality, StartSensitivity, EndSensitivity } from '@google/genai';
const config = {
responseModalities: [Modality.TEXT],
realtimeInputConfig: {
automaticActivityDetection: {
disabled: false, // default
startOfSpeechSensitivity: StartSensitivity.START_SENSITIVITY_LOW,
endOfSpeechSensitivity: EndSensitivity.END_SENSITIVITY_LOW,
prefixPaddingMs: 20,
silenceDurationMs: 100,
}
}
};
השבתה של זיהוי דיבור אוטומטי
אפשר גם להשבית את ה-VAD האוטומטי על ידי הגדרת realtimeInputConfig.automaticActivityDetection.disabled ל-true בהודעת ההגדרה. בהגדרה הזו, הלקוח אחראי לזיהוי הדיבור של המשתמש ולשליחת ההודעות activityStart ו-activityEnd בזמנים המתאימים. לא נשלח audioStreamEnd בהגדרה הזו. במקום זאת, כל הפרעה לשידור מסומנת בהודעה activityEnd.
Python
config = {
"response_modalities": ["TEXT"],
"realtime_input_config": {"automatic_activity_detection": {"disabled": True}},
}
async with client.aio.live.connect(model=model, config=config) as session:
# ...
await session.send_realtime_input(activity_start=types.ActivityStart())
await session.send_realtime_input(
audio=types.Blob(data=audio_bytes, mime_type="audio/pcm;rate=16000")
)
await session.send_realtime_input(activity_end=types.ActivityEnd())
# ...
JavaScript
const config = {
responseModalities: [Modality.TEXT],
realtimeInputConfig: {
automaticActivityDetection: {
disabled: true,
}
}
};
session.sendRealtimeInput({ activityStart: {} })
session.sendRealtimeInput(
{
audio: {
data: base64Audio,
mimeType: "audio/pcm;rate=16000"
}
}
);
session.sendRealtimeInput({ activityEnd: {} })
ספירת הטוקנים
אפשר למצוא את המספר הכולל של הטוקנים שנצרכו בשדה usageMetadata של הודעת השרת שמוחזרת.
Python
async for message in session.receive():
# The server will periodically send messages that include UsageMetadata.
if message.usage_metadata:
usage = message.usage_metadata
print(
f"Used {usage.total_token_count} tokens in total. Response token breakdown:"
)
for detail in usage.response_tokens_details:
match detail:
case types.ModalityTokenCount(modality=modality, token_count=count):
print(f"{modality}: {count}")
JavaScript
const turns = await handleTurn();
for (const turn of turns) {
if (turn.usageMetadata) {
console.debug('Used %s tokens in total. Response token breakdown:\n', turn.usageMetadata.totalTokenCount);
for (const detail of turn.usageMetadata.responseTokensDetails) {
console.debug('%s\n', detail);
}
}
}
רזולוציית המדיה
אפשר לציין את רזולוציית המדיה של קובץ המדיה שמוזן על ידי הגדרת השדה mediaResolution כחלק מהגדרת הסשן:
Python
from google.genai import types
config = {
"response_modalities": ["AUDIO"],
"media_resolution": types.MediaResolution.MEDIA_RESOLUTION_LOW,
}
JavaScript
import { GoogleGenAI, Modality, MediaResolution } from '@google/genai';
const config = {
responseModalities: [Modality.TEXT],
mediaResolution: MediaResolution.MEDIA_RESOLUTION_LOW,
};
מגבלות
כדאי להביא בחשבון את המגבלות הבאות של Live API כשמתכננים את הפרויקט.
אופני תגובה
אפשר להגדיר רק אמצעי תקשורת אחד (TEXT או AUDIO) לכל סשן בהגדרות הסשן. הגדרת שניהם מובילה להודעת שגיאה בהגדרות. כלומר, אתם יכולים להגדיר את המודל כך שיגיב באמצעות טקסט או אודיו, אבל לא באמצעות שניהם באותה הפעלה.
אימות לקוח
כברירת מחדל, Live API מספק רק אימות משרת לשרת. אם אתם מטמיעים את אפליקציית Live API באמצעות גישה של לקוח לשרת, אתם צריכים להשתמש בטוקנים זמניים כדי לצמצם את הסיכונים לאבטחה.
משך הביקור
משך הפגישות עם אודיו בלבד מוגבל ל-15 דקות, ומשך הפגישות עם אודיו ווידאו מוגבל ל-2 דקות. עם זאת, אפשר להגדיר טכניקות שונות לניהול סשנים כדי להאריך את משך הסשן ללא הגבלה.
חלון ההקשר
לסשן יש מגבלת חלון הקשר של:
- 128,000 טוקנים למודלים של פלט אודיו מקורי
- 32,000 טוקנים בדגמי API אחרים של תרגום בזמן אמת
שפות נתמכות
ה-API של שידורים חיים תומך בשפות הבאות.
| שפה | קוד BCP-47 | שפה | קוד BCP-47 |
|---|---|---|---|
| גרמנית (גרמניה) | 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 |
| מראטהית (הודו) | mr-IN |
מלאיאלאם (הודו)* | ml-IN |
| טמילית (הודו) | ta-IN |
טלוגו (הודו) | te-IN |
| הולנדית (הולנד) | nl-NL |
קוריאנית (קוריאה הדרומית) | ko-KR |
| סינית מנדרינית (סין)* | cmn-CN |
פולנית (פולין) | pl-PL |
| רוסית (רוסיה) | ru-RU |
תאילנדית (תאילנד) | th-TH |
השפות שמסומנות בכוכבית (*) לא זמינות לשמע בשפה המקורית.
המאמרים הבאים
- כדאי לקרוא את המדריכים שימוש בכלי וניהול סשנים כדי לקבל מידע חשוב על שימוש יעיל ב-Live API.
- אפשר לנסות את ממשק ה-API הפעיל ב-Google AI Studio.
- מידע נוסף על מודלים של Live API זמין במאמר Gemini 2.5 Flash Native Audio בדף Models (מודלים).
- אפשר לנסות דוגמאות נוספות בספר המתכונים של Live API, בספר המתכונים של Live API Tools ובסקריפט לתחילת העבודה עם Live API.