이 프롬프트를 개발자 Console에 복사하여 직접 시도해보세요!

Content
System당신의 임무는 제공된 비정형 텍스트를 가져와 JSON을 사용하여 잘 정리된 테이블 형식으로 변환하는 것입니다. 텍스트에서 언급된 주요 엔티티, 속성 또는 카테고리를 식별하고 이를 JSON 객체의 키로 사용하세요. 그런 다음 텍스트에서 관련 정보를 추출하여 JSON 객체의 해당 값을 채우세요. 데이터가 JSON 구조 내에서 정확하게 표현되고 적절하게 형식화되었는지 확인하세요. 결과 JSON 테이블은 원본 텍스트에 제시된 정보에 대한 명확하고 구조화된 개요를 제공해야 합니다.
UserSilvermist Hollow는 매력적인 마을로, 비범한 사람들의 집단이 살고 있었습니다. 그 중에는 지역 의료 센터에서 수술 기법을 혁신한 45세의 예일대 출신 신경외과 의사인 Liam Patel 박사가 있었습니다. 28세의 Olivia Chen은 UC 버클리 출신의 혁신적인 건축가로, 지속 가능하고 숨막히게 아름다운 디자인으로 마을의 경관을 변화시켰습니다. 지역 극장에서는 72세의 줄리아드 음악학교 출신 음악가이자 작곡가인 Ethan Kovacs의 매혹적인 교향곡이 연주되었습니다. 지역에서 생산된 재료에 열정을 가진 독학 요리사 Isabella Torres는 농장에서 식탁으로 직접 재료를 공급하는 레스토랑으로 요리 센세이션을 일으켰고, 이는 음식 애호가들이 꼭 방문해야 할 목적지가 되었습니다. 이 놀라운 개인들은 각자의 독특한 재능으로 Silvermist Hollow의 생생한 삶의 태피스트리에 기여했습니다.

예시 출력

[
  {
    "name": "Dr. Liam Patel",
    "age": 45,
    "profession": "Neurosurgeon",
    "education": "Yale",
    "accomplishments": "Revolutionized surgical techniques at the regional medical center"
  },
  {
    "name": "Olivia Chen",
    "age": 28,
    "profession": "Architect",
    "education": "UC Berkeley",
    "accomplishments": "Transformed the village's landscape with sustainable and breathtaking designs"
  },
  {
    "name": "Ethan Kovacs",
    "age": 72,
    "profession": "Musician and Composer",
    "education": "Juilliard",
    "accomplishments": "Graced the local theater with enchanting symphonies"
  },
  {
    "name": "Isabella Torres",
    "age": null,
    "profession": "Chef",
    "education": "Self-taught",
    "accomplishments": "Created a culinary sensation with her farm-to-table restaurant, which became a must-visit destination for food lovers"
  }
]

import anthropic

client = anthropic.Anthropic(
    # defaults to os.environ.get("ANTHROPIC_API_KEY")
    api_key="my_api_key",
)
message = client.messages.create(
    model="claude-opus-4-20250514",
    max_tokens=1000,
    temperature=0,
    system="Your task is to take the unstructured text provided and convert it into a well-organized table format using JSON. Identify the main entities, attributes, or categories mentioned in the text and use them as keys in the JSON object. Then, extract the relevant information from the text and populate the corresponding values in the JSON object. Ensure that the data is accurately represented and properly formatted within the JSON structure. The resulting JSON table should provide a clear, structured overview of the information presented in the original text.",
    messages=[
        {
            "role": "user",
            "content": [
                {
                    "type": "text",
                    "text": "Silvermist Hollow, a charming village, was home to an extraordinary group of individuals. Among them was Dr. Liam Patel, a 45-year-old Yale-taught neurosurgeon who revolutionized surgical techniques at the regional medical center. Olivia Chen, at 28, was an innovative architect from UC Berkeley who transformed the village's landscape with her sustainable and breathtaking designs. The local theater was graced by the enchanting symphonies of Ethan Kovacs, a 72-year-old Juilliard-trained musician and composer. Isabella Torres, a self-taught chef with a passion for locally sourced ingredients, created a culinary sensation with her farm-to-table restaurant, which became a must-visit destination for food lovers. These remarkable individuals, each with their distinct talents, contributed to the vibrant tapestry of life in Silvermist Hollow."
                }
            ]
        }
    ]
)
print(message.content)