
100
에이전트 시대의 AI 시스템 설계
정보를 찾을 수 없는 경우 해당 위치를 NULL로 채우세요.
"""
input_message = [
{"role": "developer", "content": system_prompt},
{"role": "user", "content": paragraph}
]
response = client.chat.completions.create(
model=MODEL_ID,
messages=input_message,
response_format={"type": "json_object"}
)
return response.choices[0].message.content
이전 예제에 나온 『콜레라 시대의 사랑 (
Love
in
the
Time
of
Cholera
)』에 관한 텍스트를 입
력하면 다음과 같은
JSON
문자열이 출력된다.
{
"author": "Gabriel García Márquez",
"title": "Love in the Time of Cholera",
"year": 1985
}
그리고 다음은 타밀어 고전에 관한 입력 텍스트에 대해
LLM
이 출력한
JSON
문자열이다.
{
"author": "Valluvar",
"title": "The Tirukkural",
"year": "NULL"
}
요청한 대로
author ...