Generate content (Gemini)
오디오
네이티브 Gemini 형식
Gemini-native generateContent interface for text chat, multimodal media recognition (images, audio, video), speech synthesis, and image generation with structured parts. Use generationConfig to request specific response modalities such as speech (speechConfig) or images (imageConfig).
POST
Generate content (Gemini)
이 페이지는 콘텐츠 생성 (Gemini)과 동일한
generateContent 작업을 사용하며, 위의 플레이그라운드에는 일반 텍스트 채팅이 미리 입력되어 있습니다. 아래 내용은 구조화된 파트(part)를 사용하여 오디오 이해 또는 생성을 요청하기 위해 generationConfig에 추가할 수 있는 Gemini 네이티브 필드를 설명합니다.
오디오 출력을 요청하려면
generationConfig.responseModalities를 ["AUDIO"]로 설정하고, 생성된 음성에 사용할 사전 정의된 음성을 선택하려면 generationConfig.speechConfig.voiceConfig.prebuiltVoiceConfig.voiceName을 설정하세요.Gemini 네이티브 요청 필드
| 필드 | 유형 | 필수 | 설명 |
|---|---|---|---|
generationConfig.responseModalities | array | 예 | 요청할 응답 모달리티입니다 (예: ["AUDIO"]). |
generationConfig.speechConfig | object | 아니요 | 음성 설정 객체입니다. |
generationConfig.speechConfig.voiceConfig | object | 아니요 | 음성 설정 래퍼입니다. |
generationConfig.speechConfig.voiceConfig.prebuiltVoiceConfig | object | 아니요 | 사전 정의된 음성 설정입니다. |
generationConfig.speechConfig.voiceConfig.prebuiltVoiceConfig.voiceName | string | 아니요 | 사전 정의된 음성 프리셋 이름입니다 (예: Kore). |
예시: 음성 오디오 요청
응답 필드
응답은 표준generateContent 형식을 따릅니다. 오디오 출력을 요청한 경우, 반환되는 parts에는 텍스트 대신 인라인 오디오 데이터가 포함됩니다.
모델이 반환한 후보 응답입니다.
promptTokenCount, candidatesTokenCount, totalTokenCount를 포함한 토큰 사용 내역입니다.해당하는 경우 프롬프트 차단 관련 피드백입니다.
응답 예시
200
인증
Your DGrid API key. All endpoints use Authorization: Bearer <DGRID_API_KEY>.
경로 매개변수
Target model ID, such as gemini-1.5-pro.
본문
application/json

