728x90
반응형
SMALL
1. 아래와 같이 코딩 후 실행합니다.
import google.generativeai as genai
from config import *
genai.configure(api_key=API_KEY)
myfile = genai.upload_file("output.mp3")
print(f"{myfile=}")
model = genai.GenerativeModel("gemini-1.5-flash")
result = model.generate_content([myfile, "오디오 파일의 주요 내용에 대해 설명해줘"])
print(f"{result.text=}")
# 참고
# https://ai.google.dev/gemini-api/docs/audio?hl=ko&_gl=1*1ybgrt1*_up*MQ..*_ga*MTIzODAyODMzNy4xNzM0NTk0NjMx*_ga_P1DBVKWT6V*MTczNDU5NDYzMC4xLjAuMTczNDU5NDgxNS4wLjAuMTEwNTQ5MDk5MQ..&lang=python
2.아래와 같이 응답결과를 얻을 수 있습니다.
728x90
반응형
LIST
'퀵포스팅 > 제미나이2.0 ai api로 할 수 있는 것들' 카테고리의 다른 글
제미나이 2.0 ai api로 할 수 있는 것들 - 7.AI Studio api의 다양한 모델들 (0) | 2024.12.22 |
---|---|
제미나이 2.0 ai api로 할 수 있는 것들 - 6.텍스트 감정 분석 (0) | 2024.12.22 |
제미나이 2.0 ai api로 할 수 있는 것들 - 5.실시간 번역 (0) | 2024.12.22 |
제미나이 2.0 ai api로 할 수 있는 것들 - 4.여행계획 짜기 (3) | 2024.12.22 |
제미나이 2.0 ai api로 할 수 있는 것들 - 3.동영상에 대한 설명 얻기 (1) | 2024.12.22 |