반응형
Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | ||||
| 4 | 5 | 6 | 7 | 8 | 9 | 10 |
| 11 | 12 | 13 | 14 | 15 | 16 | 17 |
| 18 | 19 | 20 | 21 | 22 | 23 | 24 |
| 25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- Google Spreadsheet
- Redshift
- SQL
- google apps script
- PySpark
- list
- Java
- Google Excel
- Github
- Python
- dataframe
- 파이썬
- PostgreSQL
- Apache
- numpy
- django
- array
- c#
- math
- hive
- string
- Presto
- gas
- Tkinter
- PANDAS
- GIT
- Kotlin
- Excel
- matplotlib
Archives
- Today
- Total
달나라 노트
Gemini API - Python에서 Gemini API 호출하기 본문
728x90
반응형
아래는 가장 간단한 Gemini 호출 예시입니다.
import google.generativeai as genai
genai.configure(api_key=gemini_api_key)
# gemini model을 설정합니다.
model = genai.GenerativeModel('gemini-1.5-flash')
# gemini에 전송할 텍스트입니다.
prompt = '파이썬으로 Gemini API를 사용하는 방법에 대해 간단히 설명해 주세요.'
# genimi에 텍스트를 전달하여 답변을 생성합니다.
response = model.generate_content(prompt)
# 생성된 답변을 출력합니다.
print(response.text)
728x90
반응형
'AI > Gemini' 카테고리의 다른 글
| Gemini API - 사용 가능한 모델 list 보기 (0) | 2025.04.27 |
|---|
Comments
