Live API는 지연 시간이 짧은 Gemini와의 양방향 음성 및 동영상 상호작용을 지원합니다. Live API를 사용하면 최종 사용자에게 사람처럼 자연스러운 음성 대화 경험과 음성 명령을 사용하여 모델의 응답을 중단할 수 있는 기능을 제공할 수 있습니다. Live API는 텍스트, 오디오, 동영상 입력을 처리하고 텍스트 및 오디오 출력을 제공할 수 있습니다.
사양
Live API의 기술 사양은 다음과 같습니다.
- 입력: 텍스트, 오디오, 동영상
- 출력: 텍스트 및 오디오 (합성 음성)
- 기본 세션 길이: 10분
- 세션 길이는 필요에 따라 10분 단위로 연장할 수 있습니다.
- 컨텍스트 윈도우: 32,000개 토큰
- 응답을 위한 8가지 음성 중에서 선택
- 31개 언어로 된 대답 지원
Live API 사용
다음 섹션에서는 Live API 기능을 사용하는 방법의 예를 제공합니다.
자세한 내용은 Live API 참조 가이드를 참고하세요.
텍스트 전송 및 오디오 수신
Python용 Gen AI SDK
voice_name = "Aoede" # @param ["Aoede", "Puck", "Charon", "Kore", "Fenrir", "Leda", "Orus", "Zephyr"] config = LiveConnectConfig( response_modalities=["AUDIO"], speech_config=SpeechConfig( voice_config=VoiceConfig( prebuilt_voice_config=PrebuiltVoiceConfig( voice_name=voice_name, ) ), ), ) async with client.aio.live.connect( model=MODEL_ID, config=config, ) as session: text_input = "Hello? Gemini are you there?" display(Markdown(f"**Input:** {text_input}")) await session.send_client_content( turns=Content(role="user", parts=[Part(text=text_input)])) audio_data = [] async for message in session.receive(): if ( message.server_content.model_turn and message.server_content.model_turn.parts ): for part in message.server_content.model_turn.parts: if part.inline_data: audio_data.append( np.frombuffer(part.inline_data.data, dtype=np.int16) ) if audio_data: display(Audio(np.concatenate(audio_data), rate=24000, autoplay=True))
문자 메시지 주고받기
Gen AI SDK for Python
설치
pip install --upgrade google-genai
자세한 내용은 SDK 참조 문서를 참고하세요.
Vertex AI에서 Gen AI SDK를 사용하도록 환경 변수를 설정합니다.
# Replace the `GOOGLE_CLOUD_PROJECT` and `GOOGLE_CLOUD_LOCATION` values # with appropriate values for your project. export GOOGLE_CLOUD_PROJECT=GOOGLE_CLOUD_PROJECT export GOOGLE_CLOUD_LOCATION=global export GOOGLE_GENAI_USE_VERTEXAI=True
오디오 전송
Python용 Gen AI SDK
import asyncio import wave from google import genai client = genai.Client(api_key="GEMINI_API_KEY", http_options={'api_version': 'v1alpha'}) model = "gemini-2.0-flash-live-preview-04-09" 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=Content(role="user", parts=[Part(text=message)])) 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는 다음 오디오 형식을 지원합니다.
- 입력 오디오 형식: 16kHz little-endian의 원시 16비트 PCM 오디오
- 출력 오디오 형식: 24kHz little-endian의 원시 16비트 PCM 오디오
오디오 스크립트 작성
Live API는 입력 오디오와 출력 오디오를 모두 스크립트로 변환할 수 있습니다.
Python용 Gen AI SDK
# Set model generation_config CONFIG = { 'response_modalities': ['AUDIO'], } headers = { "Content-Type": "application/json", "Authorization": f"Bearer {bearer_token[0]}", } # Connect to the server async with connect(SERVICE_URL, additional_headers=headers) as ws: # Setup the session await ws.send( json.dumps( { "setup": { "model": "gemini-2.0-flash-live-preview-04-09", "generation_config": CONFIG, 'input_audio_transcription': {}, 'output_audio_transcription': {} } } ) ) # Receive setup response raw_response = await ws.recv(decode=False) setup_response = json.loads(raw_response.decode("ascii")) # Send text message text_input = "Hello? Gemini are you there?" display(Markdown(f"**Input:** {text_input}")) msg = { "client_content": { "turns": [{"role": "user", "parts": [{"text": text_input}]}], "turn_complete": True, } } await ws.send(json.dumps(msg)) responses = [] input_transcriptions = [] output_transcriptions = [] # Receive chucks of server response async for raw_response in ws: response = json.loads(raw_response.decode()) server_content = response.pop("serverContent", None) if server_content is None: break if (input_transcription := server_content.get("inputTranscription")) is not None: if (text := input_transcription.get("text")) is not None: input_transcriptions.append(text) if (output_transcription := server_content.get("outputTranscription")) is not None: if (text := output_transcription.get("text")) is not None: output_transcriptions.append(text) model_turn = server_content.pop("modelTurn", None) if model_turn is not None: parts = model_turn.pop("parts", None) if parts is not None: for part in parts: pcm_data = base64.b64decode(part["inlineData"]["data"]) responses.append(np.frombuffer(pcm_data, dtype=np.int16)) # End of turn turn_complete = server_content.pop("turnComplete", None) if turn_complete: break if input_transcriptions: display(Markdown(f"**Input transcription >** {''.join(input_transcriptions)}")) if responses: # Play the returned audio message display(Audio(np.concatenate(responses), rate=24000, autoplay=True)) if output_transcriptions: display(Markdown(f"**Output transcription >** {''.join(output_transcriptions)}"))
음성 및 언어 설정 변경하기
Live API는 Chirp 3를 사용하여 8가지 HD 음성 및 31개 언어로 합성된 음성 응답을 지원합니다.
다음 음성 중에서 선택할 수 있습니다.
Aoede
(여성)Charon
(남성)Fenrir
(남성)Kore
(여성)Leda
(여성)Orus
(남성)Puck
(남성)Zephyr
(여성)
이러한 음성의 소리를 들을 수 있는 데모와 사용 가능한 언어의 전체 목록은 Chirp 3: HD 음성을 참고하세요.
응답 음성 및 언어를 설정하려면 다음 단계를 따르세요.
Python용 Gen AI SDK
config = LiveConnectConfig( response_modalities=["AUDIO"], speech_config=SpeechConfig( voice_config=VoiceConfig( prebuilt_voice_config=PrebuiltVoiceConfig( voice_name=voice_name, ) ), language_code="en-US", ), )
콘솔
- Vertex AI Studio > 실시간 스트리밍을 엽니다.
- 출력 펼치기에서 음성 드롭다운에서 음성을 선택합니다.
- 동일한 확장 프로그램에서 언어 드롭다운에서 언어를 선택합니다.
- 세션 시작을 클릭하여 세션을 시작합니다.
모델에 영어가 아닌 언어로 프롬프트를 표시하고 응답하도록 요구할 때 최상의 결과를 얻으려면 시스템 안내의 일부로 다음을 포함하세요.
RESPOND IN LANGUAGE. YOU MUST RESPOND UNMISTAKABLY IN LANGUAGE.
스트리밍된 대화하기
Python용 Gen AI SDK
텍스트 프롬프트를 전송하고 오디오 응답을 수신할 수 있는 API와 대화를 설정합니다.
# Set model generation_config CONFIG = {"response_modalities": ["AUDIO"]} headers = { "Content-Type": "application/json", "Authorization": f"Bearer {bearer_token[0]}", } async def main() -> None: # Connect to the server async with connect(SERVICE_URL, additional_headers=headers) as ws: # Setup the session async def setup() -> None: await ws.send( json.dumps( { "setup": { "model": "gemini-2.0-flash-live-preview-04-09", "generation_config": CONFIG, } } ) ) # Receive setup response raw_response = await ws.recv(decode=False) setup_response = json.loads(raw_response.decode("ascii")) print(f"Connected: {setup_response}") return # Send text message async def send() -> bool: text_input = input("Input > ") if text_input.lower() in ("q", "quit", "exit"): return False msg = { "client_content": { "turns": [{"role": "user", "parts": [{"text": text_input}]}], "turn_complete": True, } } await ws.send(json.dumps(msg)) return True # Receive server response async def receive() -> None: responses = [] # Receive chucks of server response async for raw_response in ws: response = json.loads(raw_response.decode()) server_content = response.pop("serverContent", None) if server_content is None: break model_turn = server_content.pop("modelTurn", None) if model_turn is not None: parts = model_turn.pop("parts", None) if parts is not None: for part in parts: pcm_data = base64.b64decode(part["inlineData"]["data"]) responses.append(np.frombuffer(pcm_data, dtype=np.int16)) # End of turn turn_complete = server_content.pop("turnComplete", None) if turn_complete: break # Play the returned audio message display(Markdown("**Response >**")) display(Audio(np.concatenate(responses), rate=24000, autoplay=True)) return await setup() while True: if not await send(): break await receive()
대화를 시작하거나 프롬프트를 입력하거나 q
, quit
또는 exit
를 입력하여 종료합니다.
await main()
콘솔
- Vertex AI Studio > 실시간 스트리밍을 엽니다.
- 세션 시작을 클릭하여 대화 세션을 시작합니다.
세션을 종료하려면
세션 중지를 클릭합니다.세션 길이
대화 세션의 기본 최대 길이는 10분입니다. 세션이 종료되기 60초 전에 go_away
알림 (BidiGenerateContentServerMessage.go_away
)이 클라이언트로 다시 전송됩니다.
API를 사용하면 세션 길이를 10분 단위로 연장할 수 있습니다. 세션을 연장할 수 있는 횟수에는 제한이 없습니다. 세션 길이를 연장하는 방법의 예는 세션 재개 사용 설정 및 중지를 참고하세요. 이 기능은 현재 Vertex AI 스튜디오가 아닌 API에서만 사용할 수 있습니다.
컨텍스트 윈도우
Live API의 세션 최대 컨텍스트 길이는 기본적으로 32,768개 토큰이며, 이는 오디오의 경우 초당 25개 토큰 (TPS), 동영상의 경우 258TPS의 속도로 스트리밍되는 실시간 데이터와 텍스트 기반 입력, 모델 출력 등의 기타 콘텐츠를 저장하는 데 할당됩니다.
컨텍스트 창이 최대 컨텍스트 길이를 초과하면 컨텍스트 창에서 가장 오래된 회전의 컨텍스트가 잘려 전체 컨텍스트 창 크기가 제한 아래로 유지됩니다.
세션의 기본 컨텍스트 길이와 자르기 후 타겟 컨텍스트 길이는 각각 설정 메시지의 context_window_compression.trigger_tokens
및 context_window_compression.sliding_window.target_tokens
필드를 사용하여 구성할 수 있습니다.
동시 세션
기본적으로 프로젝트당 최대 10개의 동시 세션을 사용할 수 있습니다.
세션 중간에 시스템 안내 업데이트
Live API를 사용하면 활성 세션 중에 시스템 안내를 업데이트할 수 있습니다. 이를 사용하여 세션 중에 모델의 응답을 조정할 수 있습니다(예: 모델이 응답하는 언어를 다른 언어로 변경하거나 모델이 응답할 어조를 수정).
음성 활동 감지 설정 변경하기
기본적으로 이 모델은 연속 오디오 입력 스트림에서 음성 활동 감지 (VAD)를 자동으로 실행합니다. VAD는 설정 메시지의 realtimeInputConfig.automaticActivityDetection
필드로 구성할 수 있습니다.
오디오 스트림이 1초 이상 일시중지되면 (예: 사용자가 마이크를 껐기 때문에) 캐시된 오디오를 플러시하기 위해 audioStreamEnd
이벤트를 전송해야 합니다. 클라이언트는 언제든지 오디오 데이터 전송을 재개할 수 있습니다.
또는 설정 메시지에서 realtimeInputConfig.automaticActivityDetection.disabled
를 true
로 설정하여 자동 VAD를 사용 중지할 수 있습니다. 이 구성에서 클라이언트는 사용자 음성을 감지하고 적절한 시점에 activityStart
및 activityEnd
메시지를 전송합니다. 이 구성에서는 audioStreamEnd
가 전송되지 않습니다. 대신 스트림이 중단되면 activityEnd
메시지로 표시됩니다.
세션 재개 사용 설정 및 중지
이 기능은 기본적으로 사용 중지되어 있습니다. 사용자는 API 요청에 필드를 지정하여 API를 호출할 때마다 이 기능을 사용 설정해야 하며, 캐시된 데이터에는 프로젝트 수준의 개인 정보 보호가 적용됩니다. 세션 재개를 사용 설정하면 사용자가 텍스트, 동영상, 오디오 프롬프트 데이터 및 모델 출력을 비롯한 캐시된 데이터를 최대 24시간 동안 저장하여 24시간 이내에 이전 세션에 다시 연결할 수 있습니다. 데이터 보관 제로를 달성하려면 이 기능을 사용 설정하지 마세요.
세션 재개 기능을 사용 설정하려면 BidiGenerateContentSetup
메시지의 session_resumption
필드를 설정합니다. 사용 설정하면 서버는 주기적으로 현재 캐시된 세션 컨텍스트의 스냅샷을 찍어 내부 저장소에 저장합니다. 스냅샷이 성공적으로 찍히면 핸들 ID와 함께 resumption_update
가 반환되며, 이 핸들 ID를 기록하여 나중에 스냅샷에서 세션을 재개하는 데 사용할 수 있습니다.
다음은 세션 재개 기능을 사용 설정하고 핸들 ID 정보를 수집하는 예입니다.
Python용 Gen AI SDK
# Set model generation_config CONFIG = {"response_modalities": ["TEXT"]} headers = { "Content-Type": "application/json", "Authorization": f"Bearer {bearer_token[0]}", } # Connect to the server async with connect(SERVICE_URL, additional_headers=headers) as ws: # Setup the session await ws.send( json.dumps( { "setup": { "model": "gemini-2.0-flash-live-preview-04-09", "generation_config": CONFIG, # Enable session resumption. "session_resumption": {}, } } ) ) # Receive setup response raw_response = await ws.recv(decode=False) setup_response = json.loads(raw_response.decode("ascii")) # Send text message text_input = "Hello? Gemini are you there?" display(Markdown(f"**Input:** {text_input}")) msg = { "client_content": { "turns": [{"role": "user", "parts": [{"text": text_input}]}], "turn_complete": True, } } await ws.send(json.dumps(msg)) responses = [] handle_id = "" turn_completed = False resumption_received = False # Receive chucks of server response, # wait for turn completion and resumption handle. async for raw_response in ws: response = json.loads(raw_response.decode()) server_content = response.pop("serverContent", None) resumption_update = response.pop("sessionResumptionUpdate", None) if server_content is not None: model_turn = server_content.pop("modelTurn", None) if model_turn is not None: parts = model_turn.pop("parts", None) if parts is not None: responses.append(parts[0]["text"]) # End of turn turn_complete = server_content.pop("turnComplete", None) if turn_complete: turn_completed = True elif resumption_update is not None: handle_id = resumption_update['newHandle'] resumption_received = True else: continue if turn_complete and resumption_received: break # Print the server response display(Markdown(f"**Response >** {''.join(responses)}")) display(Markdown(f"**Session Handle ID >** {handle_id}"))
이전 세션을 재개하려면 setup.session_resumption
구성의 handle
필드를 이전에 기록된 핸들 ID로 설정하면 됩니다.
Python용 Gen AI SDK
# Set model generation_config CONFIG = {"response_modalities": ["TEXT"]} headers = { "Content-Type": "application/json", "Authorization": f"Bearer {bearer_token[0]}", } # Connect to the server async with connect(SERVICE_URL, additional_headers=headers) as ws: # Setup the session await ws.send( json.dumps( { "setup": { "model": "gemini-2.0-flash-live-preview-04-09", "generation_config": CONFIG, # Enable session resumption. "session_resumption": { "handle": handle_id, }, } } ) ) # Receive setup response raw_response = await ws.recv(decode=False) setup_response = json.loads(raw_response.decode("ascii")) # Send text message text_input = "What was the last question I asked?" display(Markdown(f"**Input:** {text_input}")) msg = { "client_content": { "turns": [{"role": "user", "parts": [{"text": text_input}]}], "turn_complete": True, } } await ws.send(json.dumps(msg)) responses = [] handle_id = "" turn_completed = False resumption_received = False # Receive chucks of server response, # wait for turn completion and resumption handle. async for raw_response in ws: response = json.loads(raw_response.decode()) server_content = response.pop("serverContent", None) resumption_update = response.pop("sessionResumptionUpdate", None) if server_content is not None: model_turn = server_content.pop("modelTurn", None) if model_turn is not None: parts = model_turn.pop("parts", None) if parts is not None: responses.append(parts[0]["text"]) # End of turn turn_complete = server_content.pop("turnComplete", None) if turn_complete: turn_completed = True elif resumption_update is not None: handle_id = resumption_update['newHandle'] resumption_received = True else: continue if turn_complete and resumption_received: break # Print the server response # Expected answer: "You just asked if I was there." display(Markdown(f"**Response >** {''.join(responses)}")) display(Markdown(f"**Session Handle >** {resumption_update}"))
원활한 세션 재개를 위해 투명 모드를 사용 설정할 수 있습니다.
Python용 Gen AI SDK
await ws.send( json.dumps( { "setup": { "model": "gemini-2.0-flash-live-preview-04-09", "generation_config": CONFIG, # Enable session resumption. "session_resumption": { "transparent": True, }, } } ) )
투명 모드가 사용 설정되면 컨텍스트 스냅샷에 해당하는 클라이언트 메시지의 색인이 명시적으로 반환됩니다. 이렇게 하면 재개 핸들에서 세션을 재개할 때 다시 전송해야 하는 클라이언트 메시지를 식별하는 데 도움이 됩니다.
함수 호출 사용
함수 호출을 사용하여 함수에 대한 설명을 만든 다음 요청 시 해당 설명을 모델에 전달할 수 있습니다. 모델의 응답에는 설명과 일치하는 함수의 이름과 함께 이를 호출할 인수가 포함됩니다.
모든 함수는 setup
메시지의 일부로 도구 정의를 전송하여 세션 시작 시 선언되어야 합니다.
Python용 Gen AI SDK
# Set model generation_config CONFIG = {"response_modalities": ["TEXT"]} # Define function declarations TOOLS = { "function_declarations": { "name": "get_current_weather", "description": "Get the current weather in the given location", "parameters": { "type": "OBJECT", "properties": {"location": {"type": "STRING"}}, }, } } headers = { "Content-Type": "application/json", "Authorization": f"Bearer {bearer_token[0]}", } # Connect to the server async with connect(SERVICE_URL, additional_headers=headers) as ws: # Setup the session await ws.send( json.dumps( { "setup": { "model": "gemini-2.0-flash-live-preview-04-09", "generation_config": CONFIG, "tools": TOOLS, } } ) ) # Receive setup response raw_response = await ws.recv(decode=False) setup_response = json.loads(raw_response.decode()) # Send text message text_input = "Get the current weather in Santa Clara, San Jose and Mountain View" display(Markdown(f"**Input:** {text_input}")) msg = { "client_content": { "turns": [{"role": "user", "parts": [{"text": text_input}]}], "turn_complete": True, } } await ws.send(json.dumps(msg)) responses = [] # Receive chucks of server response async for raw_response in ws: response = json.loads(raw_response.decode("UTF-8")) if (tool_call := response.get("toolCall")) is not None: for function_call in tool_call["functionCalls"]: responses.append(f"FunctionCall: {str(function_call)}\n") if (server_content := response.get("serverContent")) is not None: if server_content.get("turnComplete", True): break # Print the server response display(Markdown("**Response >** {}".format("\n".join(responses))))
코드 실행 사용
Live API와 함께 코드 실행을 사용하여 Python 코드를 직접 생성하고 실행할 수 있습니다.
Python용 Gen AI SDK
# Set model generation_config CONFIG = {"response_modalities": ["TEXT"]} # Set code execution TOOLS = {"code_execution": {}} headers = { "Content-Type": "application/json", "Authorization": f"Bearer {bearer_token[0]}", } # Connect to the server async with connect(SERVICE_URL, additional_headers=headers) as ws: # Setup the session await ws.send( json.dumps( { "setup": { "model": "gemini-2.0-flash-live-preview-04-09", "generation_config": CONFIG, "tools": TOOLS, } } ) ) # Receive setup response raw_response = await ws.recv(decode=False) setup_response = json.loads(raw_response.decode()) # Send text message text_input = "Write code to calculate the 15th fibonacci number then find the nearest palindrome to it" display(Markdown(f"**Input:** {text_input}")) msg = { "client_content": { "turns": [{"role": "user", "parts": [{"text": text_input}]}], "turn_complete": True, } } await ws.send(json.dumps(msg)) responses = [] # Receive chucks of server response async for raw_response in ws: response = json.loads(raw_response.decode("UTF-8")) if (server_content := response.get("serverContent")) is not None: if (model_turn:= server_content.get("modelTurn")) is not None: if (parts := model_turn.get("parts")) is not None: if parts[0].get("text"): responses.append(parts[0]["text"]) for part in parts: if (executable_code := part.get("executableCode")) is not None: display( Markdown( f"""**Executable code:** ```py {executable_code.get("code")} ``` """ ) ) if server_content.get("turnComplete", False): break # Print the server response display(Markdown(f"**Response >** {''.join(responses)}"))
Google 검색을 사용한 그라운딩
google_search
를 사용하여 라이브 API와 함께 Google 검색을 통한 기반 구축을 사용할 수 있습니다.
Python용 Gen AI SDK
# Set model generation_config CONFIG = {"response_modalities": ["TEXT"]} # Set google search TOOLS = {"google_search": {}} headers = { "Content-Type": "application/json", "Authorization": f"Bearer {bearer_token[0]}", } # Connect to the server async with connect(SERVICE_URL, additional_headers=headers) as ws: # Setup the session await ws.send( json.dumps( { "setup": { "model": "gemini-2.0-flash-live-preview-04-09", "generation_config": CONFIG, "tools": TOOLS, } } ) ) # Receive setup response raw_response = await ws.recv(decode=False) setup_response = json.loads(raw_response.decode()) # Send text message text_input = "What is the current weather in San Jose, CA?" display(Markdown(f"**Input:** {text_input}")) msg = { "client_content": { "turns": [{"role": "user", "parts": [{"text": text_input}]}], "turn_complete": True, } } await ws.send(json.dumps(msg)) responses = [] # Receive chucks of server response async for raw_response in ws: response = json.loads(raw_response.decode()) server_content = response.pop("serverContent", None) if server_content is None: break model_turn = server_content.pop("modelTurn", None) if model_turn is not None: parts = model_turn.pop("parts", None) if parts is not None: responses.append(parts[0]["text"]) # End of turn turn_complete = server_content.pop("turnComplete", None) if turn_complete: break # Print the server response display(Markdown("**Response >** {}".format("\n".join(responses))))
네이티브 오디오
Live API가 포함된 Gemini 2.5 Flash에는 네이티브 오디오 기능이 있습니다. 기본 오디오에는 표준 라이브 API 기능 외에도 다음이 포함됩니다.
- 향상된 음질 및 적응성: Live API 네이티브 오디오는 24개 언어의 30개 HD 음성으로 더 풍부하고 자연스러운 음성 상호작용을 제공합니다.
- 사전 예방적 오디오 소개: 사전 예방적 오디오가 사용 설정되면 모델은 관련성이 있을 때만 응답합니다. 이 모델은 기기에 관한 쿼리에 대해서만 사전에 텍스트 스크립트와 오디오 응답을 생성하며 기기가 아닌 쿼리에는 응답하지 않습니다.
감정 대화 소개: Live API 네이티브 오디오를 사용하는 모델은 사용자의 감정 표현을 이해하고 적절하게 반응하여 더 미묘한 대화를 할 수 있습니다.
사전 예방적 오디오 사용
사전 예방적 오디오를 사용하려면 설정 메시지에서 proactivity
필드를 구성하고 proactive_audio
를 true
로 설정합니다.
Python용 Gen AI SDK
config = LiveConnectConfig( response_modalities=["AUDIO"], proactivity=ProactivityConfig(proactive_audio=True), )
감정 대화 사용
감정 대화를 사용하려면 설정 메시지에서 enable_affective_dialog
를 true
로 설정합니다.
Python용 Gen AI SDK
config = LiveConnectConfig( response_modalities=["AUDIO"], enable_affective_dialog=True, )
제한사항
Live API의 현재 제한사항에 관한 전체 목록은 참조 문서의 Live API 제한사항 섹션을 참고하세요.
Live API 네이티브 오디오를 사용한 Gemini 2.5 Flash의 비공개 미리보기 버전은 동시 세션이 3개로 제한됩니다.
가격 책정
자세한 내용은 가격 책정 페이지를 참고하세요.
추가 정보
WebSocket
API 참조와 같은 라이브 API에 관한 자세한 내용은 Gemini API 문서를 참고하세요.