Live API ช่วยให้สามารถโต้ตอบด้วยเสียงและวิดีโอแบบ 2 ทิศทางที่มีเวลาในการตอบสนองต่ำกับ Gemini เมื่อใช้ Live API คุณจะมอบประสบการณ์การสนทนาด้วยเสียงที่เป็นธรรมชาติซึ่งคล้ายกับเสียงของมนุษย์ให้แก่ผู้ใช้ปลายทางได้ รวมถึงสามารถขัดจังหวะคำตอบของโมเดลโดยใช้คำสั่งเสียง โมเดลนี้สามารถประมวลผลอินพุตข้อความ เสียง และวิดีโอ รวมถึงแสดงผลลัพธ์เป็นข้อความและเสียง
คุณลองใช้ API แบบเรียลไทม์ได้ใน Google AI Studio
มีอะไรใหม่
ดูบันทึกการเปลี่ยนแปลงเพื่อดูฟีเจอร์และความสามารถใหม่ๆ ของ Live API
ใช้ Live API
ส่วนนี้จะอธิบายวิธีใช้ Live API กับ SDK ของเรา ดูข้อมูลเพิ่มเติมเกี่ยวกับ WebSockets API พื้นฐานได้ที่ข้อมูลอ้างอิง WebSockets API
หากต้องการใช้ฟีเจอร์ทั้งหมด โปรดตรวจสอบว่าได้ติดตั้ง SDK เวอร์ชันล่าสุดแล้ว เช่น
pip install -U google-genai
ส่งและรับข้อความ
import asyncio
from google import genai
client = genai.Client(api_key="GEMINI_API_KEY")
model = "gemini-2.0-flash-live-001"
config = {"response_modalities": ["TEXT"]}
async def main():
async with client.aio.live.connect(model=model, config=config) as session:
while True:
message = input("User> ")
if message.lower() == "exit":
break
await session.send_client_content(
turns={"role": "user", "parts": [{"text": message}]}, turn_complete=True
)
async for response in session.receive():
if response.text is not None:
print(response.text, end="")
if __name__ == "__main__":
asyncio.run(main())
รับเสียง
ตัวอย่างต่อไปนี้แสดงวิธีรับข้อมูลเสียงและเขียนลงในไฟล์ .wav
import asyncio
import wave
from google import genai
client = genai.Client(api_key="GEMINI_API_KEY")
model = "gemini-2.0-flash-live-001"
config = {"response_modalities": ["AUDIO"]}
async def main():
async with client.aio.live.connect(model=model, config=config) as session:
wf = wave.open("audio.wav", "wb")
wf.setnchannels(1)
wf.setsampwidth(2)
wf.setframerate(24000)
message = "Hello? Gemini are you there?"
await session.send_client_content(
turns={"role": "user", "parts": [{"text": message}]}, turn_complete=True
)
async for idx,response in async_enumerate(session.receive()):
if response.data is not None:
wf.writeframes(response.data)
# Un-comment this code to print audio data info
# if response.server_content.model_turn is not None:
# print(response.server_content.model_turn.parts[0].inline_data.mime_type)
wf.close()
if __name__ == "__main__":
asyncio.run(main())
รูปแบบเสียง
Live API รองรับรูปแบบเสียงต่อไปนี้
- รูปแบบเสียงอินพุต: เสียง PCM 16 บิตดิบที่ 16kHz แบบ Little-endian
- รูปแบบเสียงเอาต์พุต: เสียง PCM 16 บิตดิบที่ 24 kHz แบบ Little-endian
สตรีมเสียงและวิดีโอ
วิธีการของระบบ
คำสั่งของระบบช่วยให้คุณควบคุมลักษณะการทํางานของโมเดลตามความต้องการและกรณีการใช้งานที่เฉพาะเจาะจง คุณสามารถตั้งค่าวิธีการของระบบในการกําหนดค่าการตั้งค่าได้ และจะมีผลตลอดทั้งเซสชัน
from google.genai import types
config = {
"system_instruction": types.Content(
parts=[
types.Part(
text="You are a helpful assistant and answer in a friendly tone."
)
]
),
"response_modalities": ["TEXT"],
}
การอัปเดตเนื้อหาเพิ่มเติม
ใช้การอัปเดตแบบเพิ่มเพื่อส่งอินพุตข้อความ สร้างบริบทของเซสชัน หรือกู้คืนบริบทของเซสชัน สำหรับบริบทสั้นๆ คุณสามารถส่งการโต้ตอบแบบทีละขั้นเพื่อแสดงลำดับเหตุการณ์ที่แน่นอนได้ ดังนี้
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)
{
"clientContent": {
"turns": [
{
"parts":[
{
"text": ""
}
],
"role":"user"
},
{
"parts":[
{
"text": ""
}
],
"role":"model"
}
],
"turnComplete": true
}
}
สำหรับบริบทที่ยาวขึ้น เราขอแนะนำให้ระบุสรุปข้อความเดียวเพื่อเพิ่มพื้นที่ว่างในกรอบเวลาบริบทสำหรับการโต้ตอบครั้งต่อๆ ไป
เปลี่ยนเสียง
Live API รองรับเสียง Puck, Charon, Kore, Fenrir, Aoede, Leda, Orus และ Zephyr
หากต้องการระบุเสียง ให้ตั้งค่าชื่อเสียงภายในออบเจ็กต์ speechConfig
โดยเป็นส่วนหนึ่งของการกำหนดค่าเซสชัน
from google.genai import types
config = types.LiveConnectConfig(
response_modalities=["AUDIO"],
speech_config=types.SpeechConfig(
voice_config=types.VoiceConfig(
prebuilt_voice_config=types.PrebuiltVoiceConfig(voice_name="Kore")
)
)
)
{
"voiceConfig": {
"prebuiltVoiceConfig": {
"voiceName": "Kore"
}
}
}
เปลี่ยนภาษา
Live API รองรับหลายภาษา
หากต้องการเปลี่ยนภาษา ให้ตั้งค่ารหัสภาษาภายในออบเจ็กต์ speechConfig
เป็นส่วนหนึ่งของการกำหนดค่าเซสชัน ดังนี้
from google.genai import types
config = types.LiveConnectConfig(
response_modalities=["AUDIO"],
speech_config=types.SpeechConfig(
language_code="de-DE",
)
)
ใช้เครื่องมือ
คุณสามารถกําหนดเครื่องมือต่างๆ เช่น การเรียกฟังก์ชัน การเรียกใช้โค้ด และ Google Search ด้วย Live API
ใช้การเรียกใช้ฟังก์ชัน
คุณสามารถกําหนดการประกาศฟังก์ชันเป็นส่วนหนึ่งของการกําหนดค่าเซสชันได้ ดูข้อมูลเพิ่มเติมได้ในบทแนะนำการเรียกใช้ฟังก์ชัน
หลังจากได้รับการเรียกใช้เครื่องมือแล้ว ไคลเอ็นต์ควรตอบกลับด้วยรายการออบเจ็กต์ FunctionResponse
โดยใช้เมธอด session.send_tool_response
import asyncio
from google import genai
from google.genai import types
client = genai.Client(api_key="GEMINI_API_KEY")
model = "gemini-2.0-flash-live-001"
# Simple function definitions
turn_on_the_lights = {"name": "turn_on_the_lights"}
turn_off_the_lights = {"name": "turn_off_the_lights"}
tools = [{"function_declarations": [turn_on_the_lights, turn_off_the_lights]}]
config = {"response_modalities": ["TEXT"], "tools": tools}
async def main():
async with client.aio.live.connect(model=model, config=config) as session:
prompt = "Turn on the lights please"
await session.send_client_content(turns={"parts": [{"text": prompt}]})
async for chunk in session.receive():
if chunk.server_content:
if chunk.text is not None:
print(chunk.text)
elif chunk.tool_call:
function_responses = []
for fc in tool_call.function_calls:
function_response = types.FunctionResponse(
id=fc.id,
name=fc.name,
response={ "result": "ok" } # simple, hard-coded function response
)
function_responses.append(function_response)
await session.send_tool_response(function_responses=function_responses)
if __name__ == "__main__":
asyncio.run(main())
จากพรอมต์เดียว โมเดลสามารถสร้างการเรียกฟังก์ชันหลายรายการและโค้ดที่จําเป็นต่อเชื่อมเอาต์พุต โค้ดนี้จะทํางานในสภาพแวดล้อมแซนด์บ็อกซ์ ซึ่งจะสร้างข้อความ BidiGenerateContentToolCall ตามมา การดำเนินการจะหยุดชั่วคราวจนกว่าผลลัพธ์ของการเรียกฟังก์ชันแต่ละรายการจะพร้อมใช้งาน ซึ่งช่วยให้การประมวลผลเป็นไปตามลำดับ
อินพุตและเอาต์พุตเสียงส่งผลเสียต่อความสามารถของโมเดลในการใช้การเรียกใช้ฟังก์ชัน
ใช้การเรียกใช้โค้ด
คุณสามารถกําหนดการเรียกใช้โค้ดเป็นส่วนหนึ่งของการกําหนดค่าเซสชันได้ ดูข้อมูลเพิ่มเติมได้ในบทแนะนำการเรียกใช้โค้ด
import asyncio
from google import genai
from google.genai import types
client = genai.Client(api_key="GEMINI_API_KEY")
model = "gemini-2.0-flash-live-001"
tools = [{'code_execution': {}}]
config = {"response_modalities": ["TEXT"], "tools": tools}
async def main():
async with client.aio.live.connect(model=model, config=config) as session:
prompt = "Compute the largest prime palindrome under 100000."
await session.send_client_content(turns={"parts": [{"text": prompt}]})
async for chunk in session.receive():
if chunk.server_content:
if chunk.text is not None:
print(chunk.text)
model_turn = chunk.server_content.model_turn
if model_turn:
for part in model_turn.parts:
if part.executable_code is not None:
print(part.executable_code.code)
if part.code_execution_result is not None:
print(part.code_execution_result.output)
if __name__ == "__main__":
asyncio.run(main())
ใช้การกราวด์กับ Google Search
คุณสามารถเปิดใช้การกราวด์กับ Google Search เป็นส่วนหนึ่งของการกำหนดค่าเซสชันได้ ดูข้อมูลเพิ่มเติมได้ในบทแนะนำการต่อกราวด์
import asyncio
from google import genai
from google.genai import types
client = genai.Client(api_key="GEMINI_API_KEY")
model = "gemini-2.0-flash-live-001"
tools = [{'google_search': {}}]
config = {"response_modalities": ["TEXT"], "tools": tools}
async def main():
async with client.aio.live.connect(model=model, config=config) as session:
prompt = "When did the last Brazil vs. Argentina soccer match happen?"
await session.send_client_content(turns={"parts": [{"text": prompt}]})
async for chunk in session.receive():
if chunk.server_content:
if chunk.text is not None:
print(chunk.text)
# The model might generate and execute Python code to use Search
model_turn = chunk.server_content.model_turn
if model_turn:
for part in model_turn.parts:
if part.executable_code is not None:
print(part.executable_code.code)
if part.code_execution_result is not None:
print(part.code_execution_result.output)
if __name__ == "__main__":
asyncio.run(main())
รวมเครื่องมือหลายรายการ
คุณรวมเครื่องมือหลายอย่างภายใน Live API ได้ ดังนี้
prompt = """
Hey, I need you to do three things for me.
1. Compute the largest prime palindrome under 100000.
2. Then use Google Search to look up information about the largest earthquake in California the week of Dec 5 2024?
3. Turn on the lights
Thanks!
"""
tools = [
{"google_search": {}},
{"code_execution": {}},
{"function_declarations": [turn_on_the_lights, turn_off_the_lights]},
]
config = {"response_modalities": ["TEXT"], "tools": tools}
จัดการสิ่งรบกวน
ผู้ใช้สามารถขัดจังหวะเอาต์พุตของโมเดลได้ทุกเมื่อ เมื่อการตรวจจับกิจกรรมเสียงพูด (VAD) ตรวจพบการหยุดชะงัก ระบบจะยกเลิกและทิ้งการสร้างที่กำลังดำเนินอยู่ เฉพาะข้อมูลที่ส่งไปยังไคลเอ็นต์แล้วเท่านั้นที่จะยังคงอยู่ในประวัติเซสชัน จากนั้นเซิร์ฟเวอร์จะส่งข้อความ BidiGenerateContentServerContent เพื่อรายงานการหยุดชะงัก
นอกจากนี้ เซิร์ฟเวอร์ Gemini จะทิ้งการเรียกฟังก์ชันที่รอดำเนินการและส่งข้อความ BidiGenerateContentServerContent
พร้อมรหัสของการเรียกที่ถูกยกเลิก
async for response in session.receive():
if response.server_content.interrupted is True:
# The generation was interrupted
กำหนดค่าการตรวจจับกิจกรรมเสียงพูด (VAD)
คุณสามารถกำหนดค่าหรือปิดใช้การตรวจจับกิจกรรมเสียง (VAD) ได้
ใช้ VAD อัตโนมัติ
โดยค่าเริ่มต้น โมเดลจะดำเนินการ VAD กับสตรีมอินพุตเสียงแบบต่อเนื่องโดยอัตโนมัติ คุณสามารถกําหนดค่า VAD ได้ด้วยช่อง realtimeInputConfig.automaticActivityDetection
ของการกําหนดค่าการตั้งค่า
เมื่อสตรีมเสียงหยุดชั่วคราวนานกว่า 1 วินาที (เช่น เนื่องจากผู้ใช้ปิดไมโครโฟน) คุณควรส่งเหตุการณ์ audioStreamEnd
เพื่อล้างเสียงที่แคชไว้ โดยลูกค้าสามารถกลับมาส่งข้อมูลเสียงต่อได้ทุกเมื่อ
# 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
client = genai.Client(api_key="GEMINI_API_KEY")
model = "gemini-2.0-flash-live-001"
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())
เมื่อใช้ send_realtime_input
ทาง API จะตอบสนองต่อเสียงโดยอัตโนมัติตาม VAD ขณะที่ send_client_content
จะเพิ่มข้อความลงในบริบทของโมเดลตามลําดับ แต่ send_realtime_input
จะเพิ่มประสิทธิภาพเพื่อตอบสนองโดยเสียค่าใช้จ่ายในการเรียงลําดับแบบกำหนด
กำหนดค่า VAD อัตโนมัติ
หากต้องการควบคุมกิจกรรม VAD ได้มากขึ้น คุณสามารถกําหนดค่าพารามิเตอร์ต่อไปนี้ ดูข้อมูลเพิ่มเติมได้ที่ข้อมูลอ้างอิง API
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,
}
}
}
ปิดใช้ VAD อัตโนมัติ
หรือจะปิดใช้ VAD อัตโนมัติโดยการตั้งค่า realtimeInputConfig.automaticActivityDetection.disabled
เป็น true
ในข้อความการตั้งค่าก็ได้ ในการกำหนดค่านี้ ไคลเอ็นต์มีหน้าที่รับผิดชอบในการตรวจจับเสียงพูดของผู้ใช้และส่งข้อความ activityStart
และ activityEnd
ในเวลาที่เหมาะสม ระบบจะไม่ส่ง audioStreamEnd
ในการกำหนดค่านี้ แต่ระบบจะแสดงข้อความ activityEnd
แทนเพื่อระบุว่าสตรีมหยุดชะงัก
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())
# ...
รับจํานวนโทเค็น
คุณดูจํานวนโทเค็นทั้งหมดที่ใช้ได้ในช่อง usageMetadata ของข้อความเซิร์ฟเวอร์ที่แสดงผล
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}")
ขยายระยะเวลาเซสชัน
ระยะเวลาเซสชันสูงสุดสามารถขยายได้ไม่จำกัดด้วยกลไก 2 อย่างดังนี้
นอกจากนี้ คุณจะได้รับข้อความ GoAway ก่อนเซสชันสิ้นสุดลง ซึ่งจะช่วยให้คุณดำเนินการต่อได้
เปิดใช้การบีบอัดกรอบบริบท
หากต้องการให้เซสชันทำงานได้นานขึ้นและหลีกเลี่ยงการสิ้นสุดการเชื่อมต่ออย่างกะทันหัน คุณสามารถเปิดใช้การบีบอัดกรอบบริบทได้โดยตั้งค่าช่อง contextWindowCompression เป็นส่วนหนึ่งของการกำหนดค่าเซสชัน
ใน ContextWindowCompressionConfig คุณสามารถกําหนดค่ากลไกกรอบเวลาแบบเลื่อนและจํานวนโทเค็นที่จะทริกเกอร์การบีบอัด
from google.genai import types
config = types.LiveConnectConfig(
response_modalities=["AUDIO"],
context_window_compression=(
# Configures compression with default parameters.
types.ContextWindowCompressionConfig(
sliding_window=types.SlidingWindow(),
)
),
)
กำหนดค่าการกลับมาทำงานของเซสชัน
หากต้องการป้องกันไม่ให้เซสชันสิ้นสุดลงเมื่อเซิร์ฟเวอร์รีเซ็ตการเชื่อมต่อ WebSocket เป็นระยะ ให้กําหนดค่าช่อง sessionResumption ภายในการกําหนดค่าการตั้งค่า
การส่งการกําหนดค่านี้ทําให้เซิร์ฟเวอร์ส่งข้อความ SessionResumptionUpdate ซึ่งสามารถใช้เพื่อกลับมาทํางานต่อในเซสชันได้โดยส่งโทเค็นการกลับมาทํางานต่อล่าสุดเป็น SessionResumptionConfig.handle
ของการเชื่อมต่อที่ตามมา
import asyncio
from google import genai
from google.genai import types
client = genai.Client(api_key="GEMINI_API_KEY")
model = "gemini-2.0-flash-live-001"
async def main():
print(f"Connecting to the service with handle {previous_session_handle}...")
async with client.aio.live.connect(
model=model,
config=types.LiveConnectConfig(
response_modalities=["AUDIO"],
session_resumption=types.SessionResumptionConfig(
# The handle of the session to resume is passed here,
# or else None to start a new session.
handle=previous_session_handle
),
),
) as session:
while True:
await session.send_client_content(
turns=types.Content(
role="user", parts=[types.Part(text="Hello world!")]
)
)
async for message in session.receive():
# Periodically, the server will send update messages that may
# contain a handle for the current state of the session.
if message.session_resumption_update:
update = message.session_resumption_update
if update.resumable and update.new_handle:
# The handle should be retained and linked to the session.
return update.new_handle
# For the purposes of this example, placeholder input is continually fed
# to the model. In non-sample code, the model inputs would come from
# the user.
if message.server_content and message.server_content.turn_complete:
break
if __name__ == "__main__":
asyncio.run(main())
รับข้อความก่อนที่เซสชันจะตัดการเชื่อมต่อ
เซิร์ฟเวอร์ส่งข้อความ GoAway ซึ่งบ่งบอกว่าการเชื่อมต่อปัจจุบันจะสิ้นสุดลงในไม่ช้า ข้อความนี้มี timeLeft ซึ่งแสดงเวลาที่เหลืออยู่และให้คุณดำเนินการเพิ่มเติมได้ก่อนที่การเชื่อมต่อจะสิ้นสุดลงโดยระบุว่า "ยกเลิก"
async for response in session.receive():
if response.go_away is not None:
# The connection will soon be terminated
print(response.go_away.time_left)
รับข้อความเมื่อการสร้างเสร็จสมบูรณ์
เซิร์ฟเวอร์จะส่งข้อความ generationComplete ที่บ่งบอกว่าโมเดลสร้างคำตอบเสร็จแล้ว
async for response in session.receive():
if response.server_content.generation_complete is True:
# The generation is complete
เปลี่ยนความละเอียดของสื่อ
คุณสามารถระบุความละเอียดของสื่อสำหรับสื่ออินพุตได้โดยการตั้งค่าช่อง mediaResolution
เป็นส่วนหนึ่งของการกำหนดค่าเซสชัน ดังนี้
from google.genai import types
config = types.LiveConnectConfig(
response_modalities=["AUDIO"],
media_resolution=types.MediaResolution.MEDIA_RESOLUTION_LOW,
)
รับการถอดเสียงเป็นคำ
คุณสามารถเปิดใช้การถอดเสียงเป็นคำของเอาต์พุตเสียงของโมเดลได้ ระบบจะอนุมานภาษาของการถอดเสียงจากคำตอบของโมเดล
import asyncio
from google import genai
from google.genai import types
client = genai.Client(api_key="GEMINI_API_KEY")
model = "gemini-2.0-flash-live-001"
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())
ข้อจำกัด
โปรดคำนึงถึงข้อจำกัดต่อไปนี้ของ Live API และ Gemini 2.0 เมื่อวางแผนโปรเจ็กต์
รูปแบบการตอบกลับ
คุณตั้งค่ารูปแบบคำตอบได้เพียงรูปแบบเดียว (TEXT
หรือ AUDIO
) ต่อเซสชันในการกําหนดค่าเซสชัน การพยายามตั้งค่าทั้ง 2 รายการจะส่งผลให้เกิดข้อความแสดงข้อผิดพลาดเกี่ยวกับการกําหนดค่า ซึ่งหมายความว่าคุณสามารถกําหนดค่าโมเดลให้ตอบกลับด้วยข้อความหรือเสียงได้ แต่ต้องเลือกเพียงอย่างเดียวในเซสชันเดียวกัน
การตรวจสอบสิทธิ์ไคลเอ็นต์
Live API มีการตรวจสอบสิทธิ์แบบเซิร์ฟเวอร์ต่อเซิร์ฟเวอร์เท่านั้น และเราไม่แนะนำให้ใช้กับไคลเอ็นต์โดยตรง อินพุตของไคลเอ็นต์ควรกำหนดเส้นทางผ่านเซิร์ฟเวอร์แอปพลิเคชันระดับกลางเพื่อการตรวจสอบสิทธิ์ที่ปลอดภัยกับ Live API
ระยะเวลาเซสชัน
คุณสามารถขยายระยะเวลาเซสชันได้ไม่จํากัดโดยการเปิดใช้การบีบอัดเซสชัน หากไม่มีการบีบอัด เซสชันที่มีเฉพาะเสียงจะจำกัดไว้ที่ 15 นาที และเซสชันที่มีทั้งเสียงและวิดีโอจะจำกัดไว้ที่ 2 นาที การเกินขีดจำกัดเหล่านี้โดยไม่ใช้การบีบอัดจะสิ้นสุดการเชื่อมต่อ
นอกจากนี้ คุณยังกําหนดค่าการกลับมาทํางานต่อของเซสชันเพื่ออนุญาตให้ไคลเอ็นต์กลับมาทํางานต่อในเซสชันที่สิ้นสุดไปแล้วได้
หน้าต่างบริบท
เซสชันมีขีดจํากัดของกรอบเวลาบริบทที่ 32,000 โทเค็น
ภาษาที่รองรับ
Live API รองรับภาษาต่อไปนี้
ภาษา | รหัส 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 |
มลยาฬัม (อินเดีย) | ml-IN |
มราฐี (อินเดีย) | mr-IN |
ทมิฬ (อินเดีย) | ta-IN |
เตลูกู (อินเดีย) | te-IN |
ดัตช์ (เนเธอร์แลนด์) | nl-NL |
เกาหลี (เกาหลีใต้) | ko-KR |
จีนกลาง (จีน) | cmn-CN |
โปแลนด์ (โปแลนด์) | pl-PL |
รัสเซีย (รัสเซีย) | ru-RU |
ไทย (ประเทศไทย) | th-TH |
การผสานรวมกับบุคคลที่สาม
สําหรับการติดตั้งใช้งานเว็บและแอปบนอุปกรณ์เคลื่อนที่ คุณสามารถดูตัวเลือกต่อไปนี้