openai2 [TIL] ๋ด์ผ๋ฐฐ์์บ ํ AI 9๊ธฐ - 19ํ ๐ถ ํ์ต ๋ฒ์LLM ํน๊ฐ ๊ณผ์ ์ฝ๋์นดํ ๐ถ ๊ณต๋ถ ๋ด์ฉโจ LLM ํน๊ฐ ๊ณผ์ (ํธ๋ฌ๋ธ ์ํ ์กฐ์น)โ๏ธ ์์ ํ๊ฒฝ - Window (PowerShell) - VSCode - Python 3.10โ๏ธ ์์ ๋ด์ฉ (OpenAI API ํ ์คํธ) 1. API Key ์์ฑ 2. ํ๊ฒฝ๋ณ์ ์ค์ setx OPENAI_API_KEY "your_api_key_here" 3. OpenAI API ์ค์นpip install openaiโ 4. ์์ค ์ฝ๋ ์์ฑ (text_example.py)from openai import OpenAIclient = OpenAI()completion = client.chat.completions.create( model="gpt-4o-mini", messages=[ .. 2025. 1. 31. (AI) openai.OpenAIError: The api_key client option must be set either by passing api_key to the client or by setting the OPENAI_API_KEY environment variable ๐ถ ์๋ฌโ๏ธ ์์ ํ๊ฒฝ - Window (PowerShell) - VSCode - Python 3.10โ๏ธ ์์ ๋ด์ฉ (OpenAI API ํ ์คํธ) 1. API Key ์์ฑ 2. ํ๊ฒฝ๋ณ์ ์ค์ setx OPENAI_API_KEY "your_api_key_here" 3. OpenAI API ์ค์นpip install openaiโ 4. ์์ค ์ฝ๋ ์์ฑ (text_example.py)from openai import OpenAIclient = OpenAI()completion = client.chat.completions.create( model="gpt-4o-mini", messages=[ {"role": "system", "content": "You are a h.. 2025. 1. 31. ์ด์ 1 ๋ค์