팟캐스트 생성 (API 메서드)
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
Gemini Enterprise는 소스 문서를 기반으로 팟캐스트를 생성할 수 있는 API를 제공합니다. 출력은 최종 사용자가 노트북 내에서 생성할 수 있는 팟캐스트와 매우 유사합니다.
API를 통한 팟캐스트 생성은 수십 또는 수백 개의 책, 기사, 강의가 있고 각각에 대해 팟캐스트를 생성하려는 일괄 작업에 적합합니다.
팟캐스트 API는 독립형 API입니다. 즉, NotebookLM Enterprise 노트북, Gemini Enterprise 라이선스 또는 데이터 스토어가 필요하지 않습니다. 사용 설정된 Google Cloud 프로젝트와 팟캐스트 API 사용자 역할만 있으면 됩니다.
API의 입력은 context
요소의 배열입니다. 팟캐스트가 생성되는 소스 자료입니다. 입력은 텍스트, 이미지, 오디오, 동영상 형식일 수 있습니다. 컨텍스트 배열의 총 콘텐츠는 100,000개 미만의 토큰이어야 합니다.
지원되는 유형 목록은 Gemini 2.5 Flash에 관한 이 페이지의 이미지, 문서, 동영상, 오디오 기술 사양을 참고하세요.
출력
API의 출력은 MP3 형식의 팟캐스트입니다.
시작하기 전에
API를 사용하여 팟캐스트를 생성하려면 다음이 필요합니다.
컨텍스트 입력에서 팟캐스트 생성
다음 명령어를 사용하여 podcast 메서드를 호출하여 팟캐스트를 생성합니다.
입력은 텍스트, 이미지, 오디오 및 동영상 클립과 같은 멀티미디어 객체의 배열입니다.
REST
팟캐스트를 생성하고 내보내려면 다음 단계를 따르세요.
다음 curl 명령어를 실행합니다.
curl -X POST \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
"https://discoveryengine.googleapis.com/v1/projects/PROJECT_ID/locations/global/podcasts" \
-d '{
"podcastConfig": {
"focus": "FOCUS",
"length": "LENGTH",
"languageCode": "LANGUAGE_CODE"
},
"contexts": [
{
"MEDIA_TYPE_1": "MEDIA_CONTENT_1"
},
{
"MEDIA_TYPE_2": "MEDIA_CONTENT_2"
}
],
"title": "PODCAST_TITLE",
"description": "PODCAST_DESCRIPTION"
}'
다음을 바꿉니다.
PROJECT_ID
: 프로젝트의 ID입니다.
FOCUS
: 팟캐스트의 초점을 제안하는 프롬프트입니다.
LENGTH
: 두 가지 옵션이 있습니다.
SHORT
(일반적으로 4~5분)
STANDARD
(일반적으로 약 10분이지만 데이터 세트가 작으면 더 짧을 수 있음)
LANGUAGE_CODE
: 선택사항입니다. 팟캐스트의 언어 코드를 지정합니다. BCP47에 정의된 언어 태그를 사용합니다. 언어 코드가 제공되지 않으면 팟캐스트가 영어로 생성됩니다.
MEDIA_TYPE_N
: 팟캐스트를 생성하는 데 참조하는 미디어 유형을 지정합니다. 허용되는 유형은 다음과 같습니다.
text
. 일반 텍스트입니다.
blob
. 일반 텍스트를 제외한 모든 미디어 유형의 경우 이 유형을 사용하고 데이터를 원시 바이트로 업로드합니다.
MEDIA_CONTENT_N
: 일반 텍스트 또는 원시 바이트의 콘텐츠 자체입니다. 컨텍스트 배열의 총 콘텐츠는 100,000개 미만의 토큰이어야 합니다.
PODCAST_TITLE
: 팟캐스트 제목입니다. 이는 내부용일 수도 있고 최종 사용자에게 표시할 수도 있습니다.
PODCAST_DESCRIPTION
: 팟캐스트에 대한 설명입니다. 내부용으로 사용할 수도 있고 최종 사용자에게 표시할 수도 있습니다.
명령어 및 결과 예시
curl -X POST \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
"https://discoveryengine.googleapis.com/v1/projects/my-project-123/locations/global/podcasts" \
-d '{
"podcastConfig": {
"focus": "Can you talk about how to find a job in Google?",
"length": "SHORT"
},
"contexts": [
{
"text": "Breaking into Google is a highly competitive endeavor, attracting millions of applicants globally due to its reputation as a top employer, its innovative work, and comprehensive perks. Success hinges on a multi-faceted approach, starting with meticulously tailored online applications that incorporate job description keywords for ATS and showcasing Googlyness—a blend of curiosity, collaborative spirit, and leadership potential. The rigorous, multi-stage interview process involves recruiter screens, behavioral interviews (often using the STAR method), and for technical roles, demanding coding challenges and system design questions that assess not just correct answers but also problem-solving thought processes and communication skills. Networking for referrals and informational interviews can significantly boost visibility, but ultimately, thorough preparation through mock interviews and platforms like LeetCode, combined with patience and resilience through the often lengthy process, are paramount for navigating this challenging but rewarding path."
},
{
"text": "Finding your way into a career at Google begins with their comprehensive careers website, a digital gateway brimming with opportunities. To embark on this journey, you first navigate the job board, using keywords like software engineer or product manager to pinpoint potential roles. To refine your search, utilize the array of filters available for location, experience level, degree, skills, and even specific Google organizations. You can even browse by team if you have a particular department in mind, like Engineering and Technology or Marketing and Communications. Once you discover a promising position, delve into its detailed description, paying close attention to the minimum qualifications – these are the foundational criteria against which your application will be assessed. Remember, Google seeks out leaders who can perform at the highest level, and while experience is valued, internships or graduate programs can be a great entry point for those earlier in their career. When you are ready to apply, you will need to create a Careers Profile, using your Google Account for seamless sign-in and communication. Crucially, tailor your resume for each specific role, highlighting relevant experiences and quantifying your achievements with concrete data. While a one-page resume is generally preferred, a two-page resume is acceptable for those with more extensive experience. Notably, cover letters are not typically required unless explicitly stated in the job description. Google encourages quality over quantity, so strategically apply for up to three jobs every 30 days, choosing roles that truly align with your skills and passions. Once you have submitted your applications, your Careers Profile becomes your tracking center, where you can monitor the status of each submission, from Draft to Submitted. If you do not hear back within eight weeks, the search continues, though Google recruiters may proactively reach out for other opportunities later. Remember, perseverance and a solid understanding of Google values, combined with a continuously refined skill set and a well-prepared resume, will greatly enhance your chances of securing a position at this innovative company."
}
],
"title": "Find a job at Google ",
"description": "This podcast is based on two plain text documents that describe various aspects of getting a job at Google."
}'
{
"name": "projects/123456/locations/global/operations/create-podcast-54321"
}
팟캐스트를 생성하는 데 몇 분 정도 걸립니다.
작업 이름을 기록해 둡니다. 4단계에서 팟캐스트를 다운로드하는 데 필요합니다. 위 예시에서 작업 이름은 projects/123456/locations/global/operations/create-podcast-54321
입니다.
(선택사항) 팟캐스트 생성 작업의 상태를 폴링합니다. 장기 실행 작업에 대한 세부정보 가져오기를 참고하세요.
작업이 완료되면 다음 curl 명령어를 실행하여 팟캐스트를 다운로드합니다.
curl -v \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
"https://discoveryengine.googleapis.com/v1/OPERATION_NAME:download?alt=media" \
--output FILENAME.mp3 -L
다음을 바꿉니다.
OPERATION_NAME
: 2단계에서 메모한 작업의 이름입니다.
FILENAME
: 팟캐스트의 파일 이름입니다.
이 명령어는 팟캐스트를 로컬 디렉터리의 MP3 파일로 다운로드합니다.
명령어 및 결과 예시
curl -v \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
"https://discoveryengine.googleapis.com/v1/projects/123456/locations/global/operations/create-podcast-54321:download?alt=media" \
--output my-podcast.mp3 -L
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Host discoveryengine.googleapis.com:443 was resolved.
...
{ [42044 bytes data]
100 14.3M 100 14.3M 0 0 10.9M 0 0:00:01 0:00:01 --:--:-- 29.7M
* Connection #0 to host discoveryengine.googleapis.com left intact
규정 준수
포드캐스트 API는 고객 관리 암호화 키인 Gemini Enterprise용 CMEK를 준수하지 않습니다.