@@ -33,10 +33,10 @@ class CompanyInfo(BaseModel):
3333    industry : str  =  Field (description = "The industry of the company" )
3434
3535class  SocialInfo (BaseModel ):
36-     twitter : Optional [HttpUrl ] =  Field (None , description = "The Twitter URL  of the person" )
37-     linkedin : Optional [HttpUrl ] =  Field (None , description = "The LinkedIn URL  of the person" )
38-     facebook : Optional [HttpUrl ] =  Field (None , description = "The Facebook URL  of the person" )
39-     instagram : Optional [HttpUrl ] =  Field (None , description = "The Instagram URL  of the person" )
36+     twitter : Optional [str ] =  Field (None , description = "The Twitter username  of the person" )
37+     linkedin : Optional [str ] =  Field (None , description = "The LinkedIn username  of the person" )
38+     facebook : Optional [str ] =  Field (None , description = "The Facebook username  of the person" )
39+     instagram : Optional [str ] =  Field (None , description = "The Instagram username  of the person" )
4040
4141class  RowEnrichmentResult (BaseModel ):
4242    basicInfo : BasicInfo 
@@ -50,7 +50,7 @@ def notify_trigger(wait_token: WaitToken, result: dict):
5050        "Authorization" : f"Bearer { wait_token .publicAccessToken }  " ,
5151        "Content-Type" : "application/json" 
5252    }
53-     response  =  requests .post (url , json = result , headers = headers )
53+     response  =  requests .post (url , json = { "data" :  result } , headers = headers )
5454    response .raise_for_status ()
5555    return  response .json ()
5656
@@ -121,13 +121,17 @@ async def main(agent_input: AgentInput):
121121        """ 
122122    )
123123
124+     enriched_data  =  result .final_output 
125+     if  isinstance (enriched_data , BaseModel ):
126+         enriched_data  =  enriched_data .model_dump ()
127+ 
124128    print ("Final Output:" )
125129    # Pretty print the final output 
126-     print (json .dumps (result . final_output , indent = 2 ))
130+     print (json .dumps (enriched_data , indent = 2 ))
127131
128132    try :        
129133        # Send the result back to Trigger.dev 
130-         notify_trigger (agent_input .waitToken , result . final_output )
134+         notify_trigger (agent_input .waitToken , enriched_data )
131135
132136        print ("Successfully enriched data and notified Trigger.dev" )
133137
0 commit comments