-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_complete_workflow.ps1
More file actions
29 lines (25 loc) · 1.44 KB
/
Copy pathtest_complete_workflow.ps1
File metadata and controls
29 lines (25 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# Step 5: Provide Email (Should trigger lead capture!)
Write-Host "`n========================================`n" -ForegroundColor Cyan
Write-Host "STEP 5: Provide Email - LEAD CAPTURE SHOULD TRIGGER!" -ForegroundColor Green
Write-Host "User: 'john.doe@example.com'`n" -ForegroundColor White
try {
$response5 = Invoke-WebRequest -Uri http://localhost:8000/chat -Method POST -ContentType "application/json" -Body "{`"message`": `"john.doe@example.com`", `"session_id`": `"$sessionId`"}"
$data5 = $response5.Content | ConvertFrom-Json
Write-Host "Agent Response:" -ForegroundColor Cyan
Write-Host $data5.response -ForegroundColor White
Write-Host "`nIntent: $($data5.intent)" -ForegroundColor Yellow
if ($data5.lead_captured -eq $true) {
Write-Host "Lead Captured: TRUE ✓" -ForegroundColor Green
Write-Host "`n🎉 SUCCESS! Lead was captured successfully!" -ForegroundColor Green
Write-Host "`nCheck captured lead in: ./data/leads/leads.json" -ForegroundColor Cyan
} else {
Write-Host "Lead Captured: FALSE ✗" -ForegroundColor Red
Write-Host "`n❌ FAILED! Lead was not captured." -ForegroundColor Red
}
} catch {
Write-Host "ERROR: $($_.Exception.Message)" -ForegroundColor Red
exit 1
}
Write-Host "`n========================================" -ForegroundColor Cyan
Write-Host "Test Complete" -ForegroundColor Cyan
Write-Host "========================================`n" -ForegroundColor Cyan