Ȩ
[´ÙÁ¤´Ù°¨]
[´ÙÁ¤´Ù°¨]¼Ò°³
[´ÙÁ¤´Ù°¨]Download
[´ÙÁ¤´Ù°¨]FAQ
[´ÙÁ¤´Ù°¨]Q&A
[´ÙÁ¤´Ù°¨]¸Å´º¾ó
µ¹Á¾ÀÌÀÇ ±³·®À̾߱â
¿£Áö´Ï¾î¸µ ¼Ò¼ÈÄÚµù
ÇÁ·Î±×·¡¹ÖTips
Excel,CAD VBA°ÁÂ
SMath
[±¸Á¶¼³°è¹Ì·¡Æ÷·³]
Æ÷·³¼Ò°³
ÀÔȸ¾È³»
Æ÷·³ÀÚ·á½Ç
±¸Á¶¼³°è Ä¿¹Â´ÏƼ
±¸Á¶¼³°è´º½º
±¸Á¶¼³°è°Ô½ÃÆÇ
±¸Á¶¼³°èÀÚ·á½Ç
±¸Á¶¼³°è ¾÷¹« Tips
±³·®°¶·¯¸®
°øÁö»çÇ×
ÀÚÀ¯°Ô½ÃÆÇ
°¡ÀÔÀλç
Åä·Ð¹æ
¼³¹®¹æ
ÇÑ°è»óż³°è°Ô½ÃÆÇ
Åä¸ñ±¸Á¶±â¼ú»ç
Åä¸ñ±¸Á¶±â¼ú»ç ¼Ò½Ä
Åä¸ñ±¸Á¶±â¼ú»ç ±âÃâ¹®Á¦
±â¼ú»ç °ü·Ã Åë°è
±¸Á¶¼³°èµ¥ÀÌÅÍ
±¸Á¶¼³°èµ¥ÀÌÅÍ(°Ô½ÃÆÇ)
±¸Á¶¼³°èµ¥ÀÌÅÍ
OpenBIM
OpenBIM
ID:
PW:
0 ºÐ
23 ºÐ
¿£Áö´Ï¾î µ¹Á¾
dolljong
ÇÁ·Î±×·¡¹Ö Tips
ÇÁ·Î±×·¡¹Ö¿¡ °üÇÑ TipÀ» °øÀ¯ÇÏ´Â °÷ÀÔ´Ï´Ù.
[ÆÄÀ̽ã] ÆÄÀ̽ãÀ¸·Î chatGPT API ÀÌ¿ëÇϱâ
À̼®Á¾
2023-04-11 17:32:11, Á¶È¸ :
470
, ̵̧ :
92
1. openai.com°¡ÀÔÇϱâ
openai.com¿¡ Á¢¼ÓÇؼ ȸ¿ø°¡ÀÔÇϱâ.
À̸ÞÀÏ ÁÖ¼Ò¿Í ÀüȹøÈ£¸¦ ÀÔ·ÂÇÏ°í °¡ÀÔÇϸé 3°³¿ùµ¿¾È 5´Þ·¯ÀÇ »ç¿ë±ÇÇÑÀ» ÁØ´Ù.
2. API key ¹Þ±â
https://platform.openai.com/docs/api-reference
Á¢¼Ó
¿ìÃø personalÀ» Ŭ¸¯Çϸé View API key¸¦ ¼±ÅÃÇÏ¸é ¾Æ·¡ÀÇ ÁÖ¼Ò·Î ¿¬°áµÈ´Ù.
https://platform.openai.com/account/api-keys
create new secret key¸¦ ¼±ÅÃÇؼ key»ý¼º
ºñ¹Ð¹øÈ£¿Í °°Àº °ÍÀ̹ǷΠ´Ù¸¥ »ç¶÷¿¡°Ô ³ëÃâµÇÁö ¾Êµµ·Ï ÀúÀåÇÑ´Ù.
3. openai¼³Ä¡Çϱâ
cmd»óÅ¿¡¼ pip install openai¸¦ ÀÔ·ÂÇؼ openai ¼³Ä¡
4. ÄÚµùÇϱâ
ÁÖÇÇÅÍ ³ëÆ®ºÏÀ¸·Î ¾Æ·¡ÀÇ Äڵ带 ½ÇÇà.
ÀÌ Äڵ忡¼ "¹ß±Þ¹ÞÀº Å°"´Â 2´Ü°è¿¡¼ ¹ß±Þ¹ÞÀº API key´Ù.
¾Æ·¡ÀÇ chatÇÔ¼ö´Â »ç¿ëÀÚ¿¡°Ô¼ Áú¹®À» ¹Þ¾Æ¼ ´äº¯À» Ãâ·ÂÇØÁÖ´Â ÇÔ¼ö´Ù.
import openai
openai.api_key = "¹ß±Þ¹ÞÀº Å°"
database=""
def chat(message):
response = openai.ChatCompletion.create(
model = "gpt-3.5-turbo",
messages = [
{"role":"system","content":database},
{"role":"user","content":message}
],
)
print(response.choices[0]["message"]["content"])
À§ ºí·°À» ½ÇÇàÇϸé chatÇÔ¼ö°¡ Á¤ÀÇµÈ °ÍÀ̹ǷÎ
¾Æ·¡ ºí·°À» Ãß°¡ÇÏ¿© ´ëȸ¦ ÇÏ¸é µÊ.
chat("Hi")
chat("ÇÑ° ±³·® Áß ÁÖÁö°£ÀåÀÌ °¡Àå ±ä ±³·®Àº?")
ÃßõÇϱâ
¸ñ·Ïº¸±â
Copyright 1999-2024
Zeroboard
/ skin by
zero
±¸Á¶¼³°èÀÇ ¹Ì·¡¸¦ ÁغñÇÏ´Â ¸ðÀÓ [±¸Á¶¼³°è¹Ì·¡Æ÷·³]