일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- convert to shp
- 크롤링
- to shp
- colab runtime
- clustering
- Chat-GPT
- 해시태그
- 코랩 런타임
- Python
- 파이썬
- NLP
- Selenium
- 웹페이지
- Crawling
- 괄호 문제
- geopandas
- string to list
- 인스타그램
- Merge Repositories
- 플라스크
- 셀레니움
- kmeans
- flask
- 알고리즘
- plotly dash
- 2164 카드2
- python buildpacks
- 백준
- 혁신성장부문
- geoDataFrame
Archives
- Today
- Total
코딩코딩코딩
Chat-GPT in Python (PyCharm) 본문
import openai as oa
t = "sk-~~~~~~J"
oa.api_key = t
def get_completion(prompt, model='gpt-3.5-turbo'):
messages = [{"role": "user", "content": prompt}]
response = oa.ChatCompletion.create(
model=model,
messages=messages,
temperature=0,
)
return response.choices[0].message["content"]
# prompt = "Please tell me about what is difference between chat-gpt model 3.5 and 4 in korean."
prompt = "'빨래'는 '말티푸'라는 종이고, 2kg 정도로 아주 작고 귀여운 갈색 강아지야. "
response = get_completion(prompt)
print(response)