Membuat podcast (metode API)
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Penting: Akses ke Podcast API tersedia untuk pelanggan tertentu Google Cloud. Untuk mengetahui informasi selengkapnya atau mendaftar untuk menggunakan fitur ini, hubungi
Google Cloud Sales Rep Anda.
Gemini Enterprise menawarkan API yang memungkinkan Anda membuat podcast berdasarkan dokumen sumber. Outputnya sangat mirip dengan podcast yang dapat dibuat pengguna akhir dari dalam notebook mereka.
Pembuatan podcast melalui API sangat cocok untuk tugas batch yang mungkin memiliki puluhan atau ratusan buku, artikel, atau kursus, dan Anda ingin membuat podcast untuk setiap item tersebut.
Podcast API adalah API mandiri. Artinya, Anda tidak memerlukan notebook NotebookLM Enterprise, lisensi Gemini Enterprise, atau penyimpanan data. Yang Anda butuhkan hanyalah project Google Cloud yang
diaktifkan dan peran Pengguna Podcast API.
Input untuk API adalah array elemen context
. Ini adalah materi
sumber yang digunakan untuk membuat podcast. Input dapat berupa
teks, gambar, audio, dan video. Total konten array konteks harus kurang dari 100.000 token.
Untuk mengetahui daftar jenis yang didukung, lihat spesifikasi teknis untuk gambar, dokumen, video, dan audio di halaman ini tentang Gemini 2.5 Flash .
Output
Output dari API adalah podcast, dalam format MP3.
Sebelum memulai
Sebelum dapat membuat podcast menggunakan API, Anda harus memiliki hal berikut:
Membuat podcast dari input konteks
Gunakan perintah berikut untuk membuat podcast dengan memanggil metode
podcast .
Input berupa array objek multimedia seperti teks, gambar, dan klip audio dan video.
REST
Untuk membuat dan mengekspor podcast, lakukan hal berikut:
Jalankan perintah curl berikut:
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 "
}'
Ganti kode berikut:
PROJECT_ID
: ID project Anda.
FOCUS
: perintah tempat Anda menyarankan
fokus podcast.
LENGTH
: ada dua opsi:
SHORT
(biasanya 4-5 menit)
STANDARD
(biasanya sekitar 10 menit, tetapi bisa lebih singkat dengan set data yang lebih kecil)
LANGUAGE_CODE
: optional. Tentukan
kode bahasa untuk podcast. Gunakan tag bahasa yang ditentukan oleh BCP47 . Jika kode bahasa tidak diberikan, podcast akan dibuat dalam bahasa Inggris.
MEDIA_TYPE_N
: menentukan jenis media yang
Anda rujuk untuk membuat podcast. Jenis yang diizinkan adalah
berikut:
text
. Teks biasa.
blob
. Untuk
semua jenis media kecuali teks biasa, gunakan jenis ini dan upload
data sebagai byte mentah.
MEDIA_CONTENT_N
: konten itu sendiri dalam teks biasa atau byte mentah. Total konten array konteks harus kurang
dari 100 ribu token.
PODCAST_TITLE
: judul untuk podcast. Deskripsi ini dapat digunakan untuk penggunaan internal, atau Anda dapat memilih untuk menampilkannya kepada pengguna akhir.
PODCAST_DESCRIPTION
: deskripsi podcast. Deskripsi ini dapat digunakan untuk penggunaan internal, atau Anda dapat memilih untuk menampilkannya kepada
pengguna akhir.
Contoh perintah dan hasil
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"
}
Proses pembuatan podcast memerlukan waktu beberapa menit.
Catat nama operasi; Anda memerlukannya untuk mendownload podcast pada
langkah 4. Pada contoh di atas, nama operasi adalah projects/123456/locations/global/operations/create-podcast-54321
.
Opsional. Lakukan polling status operasi pembuatan podcast. Lihat Mendapatkan detail tentang operasi yang berjalan lama .
Setelah operasi selesai, jalankan perintah curl berikut untuk
mendownload podcast:
curl -v \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
"https://discoveryengine.googleapis.com/v1/OPERATION_NAME :download?alt=media" \
--output FILENAME .mp3 -L
Ganti kode berikut:
OPERATION_NAME
: nama
operasi yang Anda catat di langkah 2.
FILENAME
: nama file untuk podcast.
Perintah ini akan mendownload podcast ke file MP3 di direktori lokal Anda.
Contoh perintah dan hasil
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
Kepatuhan
Podcast API tidak mematuhi kunci enkripsi yang dikelola pelanggan,
CMEK untuk
Gemini Enterprise .