|
17 | 17 | from pydantic import BaseModel, Field |
18 | 18 |
|
19 | 19 | import workflowai |
20 | | -from workflowai import Model, Run |
| 20 | +from workflowai import Model |
21 | 21 | from workflowai.fields import File |
22 | 22 |
|
23 | 23 |
|
@@ -79,7 +79,7 @@ class CalendarEventOutput(BaseModel): |
79 | 79 | id="calendar-event-extractor", |
80 | 80 | model=Model.GPT_4O_MINI_LATEST, |
81 | 81 | ) |
82 | | -async def extract_calendar_event_from_email(email_input: EmailInput) -> Run[CalendarEventOutput]: |
| 82 | +async def extract_calendar_event_from_email(email_input: EmailInput) -> CalendarEventOutput: |
83 | 83 | """ |
84 | 84 | Extract calendar event details from email content. |
85 | 85 |
|
@@ -112,7 +112,7 @@ async def extract_calendar_event_from_email(email_input: EmailInput) -> Run[Cale |
112 | 112 | id="calendar-event-extractor", |
113 | 113 | model=Model.GPT_4O_MINI_LATEST, |
114 | 114 | ) |
115 | | -async def extract_calendar_event_from_image(image_input: ImageInput) -> Run[CalendarEventOutput]: |
| 115 | +async def extract_calendar_event_from_image(image_input: ImageInput) -> CalendarEventOutput: |
116 | 116 | """ |
117 | 117 | Extract calendar event details from an event poster or flyer image. |
118 | 118 |
|
@@ -160,7 +160,7 @@ async def main(): |
160 | 160 | """, |
161 | 161 | ) |
162 | 162 |
|
163 | | - run = await extract_calendar_event_from_email(email1) |
| 163 | + run = await extract_calendar_event_from_email.run(email1) |
164 | 164 | print(run) |
165 | 165 |
|
166 | 166 | # Example 2: Virtual meeting with more details |
@@ -238,7 +238,7 @@ async def main(): |
238 | 238 | ) |
239 | 239 |
|
240 | 240 | try: |
241 | | - run = await extract_calendar_event_from_email(email4) |
| 241 | + run = await extract_calendar_event_from_email.run(email4) |
242 | 242 | print(run) |
243 | 243 | except workflowai.WorkflowAIError as e: |
244 | 244 | print(f"As expected, no calendar event found: {e!s}") |
|
0 commit comments