File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed
examples/integrations/temporal/src Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -34,10 +34,8 @@ function validateSearchResults(results: any[]): SearchResult[] {
34
34
// First try strict validation
35
35
let validResults = results . filter ( r =>
36
36
r . title &&
37
- r . url &&
38
37
r . snippet &&
39
38
r . title . length > 5 &&
40
- r . url . startsWith ( 'http' ) &&
41
39
r . snippet . length > 10
42
40
) ;
43
41
@@ -47,10 +45,9 @@ function validateSearchResults(results: any[]): SearchResult[] {
47
45
validResults = results . filter ( r =>
48
46
r . title &&
49
47
r . title . length > 2 &&
50
- ( r . url || r . link ) // Sometimes extraction uses 'link' instead of 'url'
48
+ r . snippet
51
49
) . map ( r => ( {
52
50
title : r . title ,
53
- url : r . url || r . link || 'URL not available' ,
54
51
snippet : r . snippet || r . description || 'Description not available'
55
52
} ) ) ;
56
53
}
@@ -61,7 +58,7 @@ function validateSearchResults(results: any[]): SearchResult[] {
61
58
}
62
59
63
60
console . log ( `Validated ${ validResults . length } search results` ) ;
64
- return validResults . slice ( 0 , 3 ) ;
61
+ return validResults ;
65
62
}
66
63
67
64
export async function searchWeb ( query : string ) : Promise < SearchResult [ ] > {
You can’t perform that action at this time.
0 commit comments