@@ -33,10 +33,10 @@ class CompanyInfo(BaseModel):
33
33
industry : str = Field (description = "The industry of the company" )
34
34
35
35
class 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" )
40
40
41
41
class RowEnrichmentResult (BaseModel ):
42
42
basicInfo : BasicInfo
@@ -50,7 +50,7 @@ def notify_trigger(wait_token: WaitToken, result: dict):
50
50
"Authorization" : f"Bearer { wait_token .publicAccessToken } " ,
51
51
"Content-Type" : "application/json"
52
52
}
53
- response = requests .post (url , json = result , headers = headers )
53
+ response = requests .post (url , json = { "data" : result } , headers = headers )
54
54
response .raise_for_status ()
55
55
return response .json ()
56
56
@@ -121,13 +121,17 @@ async def main(agent_input: AgentInput):
121
121
"""
122
122
)
123
123
124
+ enriched_data = result .final_output
125
+ if isinstance (enriched_data , BaseModel ):
126
+ enriched_data = enriched_data .model_dump ()
127
+
124
128
print ("Final Output:" )
125
129
# Pretty print the final output
126
- print (json .dumps (result . final_output , indent = 2 ))
130
+ print (json .dumps (enriched_data , indent = 2 ))
127
131
128
132
try :
129
133
# Send the result back to Trigger.dev
130
- notify_trigger (agent_input .waitToken , result . final_output )
134
+ notify_trigger (agent_input .waitToken , enriched_data )
131
135
132
136
print ("Successfully enriched data and notified Trigger.dev" )
133
137
0 commit comments