6. API 요청 및 응답
① 준비된 클라이언트로 LLM에 요청을 보내고 응답을 받아 chat_completion 변수에 저장합니다.
② "content": "Say this is a test."는 LLM에 질문하는 부분이고, model = "gpt-4o"는 응답할 LLM을 설정하는 부분입니다.
# API 요청 및 응답
chat_completion = client.chat.completions.create(
messages = [
{
"role": "user",
"content": "Say this is a test.",
}
],
model = "gpt-4o",
)