99
1010import asyncio
1111from datetime import date , datetime
12+ from zoneinfo import ZoneInfo
1213
1314from pydantic import BaseModel , Field
14- from zoneinfo import ZoneInfo
1515
1616import workflowai
17- from workflowai import Model , Run
17+ from workflowai import Model
1818
1919
2020def get_current_date () -> str :
@@ -65,7 +65,7 @@ class HistoricalEventOutput(BaseModel):
6565 model = Model .GEMINI_1_5_FLASH_LATEST ,
6666 tools = [get_current_date , calculate_days_between ],
6767)
68- async def analyze_historical_event (event_input : HistoricalEventInput ) -> Run [ HistoricalEventOutput ] :
68+ async def analyze_historical_event (event_input : HistoricalEventInput ) -> HistoricalEventOutput :
6969 """
7070 Find information about historical events and calculate days since they occurred.
7171
@@ -88,7 +88,7 @@ async def main():
8888 # Example: Query about the moon landing
8989 print ("\n Example: First Moon Landing" )
9090 print ("-" * 50 )
91- result = await analyze_historical_event (
91+ result = await analyze_historical_event . run (
9292 HistoricalEventInput (query = "When was the first moon landing?" ),
9393 )
9494 print (result .output )
@@ -99,7 +99,7 @@ async def main():
9999 # Example: Query about World War II
100100 print ("\n Example: End of World War II" )
101101 print ("-" * 50 )
102- result = await analyze_historical_event (
102+ result = await analyze_historical_event . run (
103103 HistoricalEventInput (query = "When did World War II end?" ),
104104 )
105105 print (result .output )
0 commit comments