fromopenaiimportOpenAIfrompydanticimportBaseModelclient=OpenAI()classCalendarEvent(BaseModel):name:strdate:strparticipants:list[str]response=client.responses.parse(model="gpt-4o-2024-08-06",input=[{"role":"system","content":"Extract the event information."},{"role":"user","content":"Alice and Bob are going to a science fair on Friday.",},],text_format=CalendarEvent,)event=response.output_parsed