|
10 | 10 | logging.basicConfig(level=logging.INFO) |
11 | 11 | logger = logging.getLogger(__name__) |
12 | 12 |
|
13 | | -jigsaw = jigsawstack.JigsawStack( |
14 | | - api_url="http://localhost:3000/api/", api_key=os.getenv("JIGSAWSTACK_API_KEY") |
15 | | -) |
16 | | -async_jigsaw = jigsawstack.AsyncJigsawStack( |
17 | | - api_url="http://localhost:3000/api/", api_key=os.getenv("JIGSAWSTACK_API_KEY") |
18 | | -) |
| 13 | +jigsaw = jigsawstack.JigsawStack(api_key=os.getenv("JIGSAWSTACK_API_KEY")) |
| 14 | +async_jigsaw = jigsawstack.AsyncJigsawStack(api_key=os.getenv("JIGSAWSTACK_API_KEY")) |
19 | 15 |
|
20 | 16 | URL = "https://jigsawstack.com" |
21 | 17 |
|
|
40 | 36 | "name": "scrape_with_features", |
41 | 37 | "params": { |
42 | 38 | "url": URL, |
| 39 | + "element_prompts": ["title"], |
43 | 40 | "features": ["meta", "link"], |
44 | 41 | }, |
45 | 42 | }, |
|
51 | 48 | "root_element_selector": "main", |
52 | 49 | }, |
53 | 50 | }, |
54 | | - { |
55 | | - "name": "scrape_with_wait_for_selector", |
56 | | - "params": { |
57 | | - "url": URL, |
58 | | - "element_prompts": ["dynamic content"], |
59 | | - "wait_for": {"mode": "selector", "value": ".loaded-content"}, |
60 | | - }, |
61 | | - }, |
62 | 51 | { |
63 | 52 | "name": "scrape_with_wait_for_timeout", |
64 | 53 | "params": { |
|
186 | 175 | "query": "artificial intelligence news", |
187 | 176 | }, |
188 | 177 | }, |
189 | | - { |
190 | | - "name": "search_with_max_results", |
191 | | - "params": { |
192 | | - "query": "python programming", |
193 | | - "max_results": 5, |
194 | | - }, |
195 | | - }, |
196 | 178 | { |
197 | 179 | "name": "search_specific_site", |
198 | 180 | "params": { |
|
203 | 185 | "name": "search_ai_mode", |
204 | 186 | "params": { |
205 | 187 | "query": "explain quantum computing", |
206 | | - "ai": True, |
| 188 | + "ai_overview": True, |
207 | 189 | }, |
208 | 190 | }, |
209 | 191 | ] |
|
248 | 230 | "name": "deep_research_with_depth", |
249 | 231 | "params": { |
250 | 232 | "query": "renewable energy sources", |
251 | | - "depth": 3, |
| 233 | + "depth": 2, |
252 | 234 | }, |
253 | 235 | }, |
254 | 236 | ] |
@@ -381,9 +363,9 @@ def test_deep_research(self, test_case): |
381 | 363 | result = jigsaw.web.deep_research(test_case["params"]) |
382 | 364 |
|
383 | 365 | assert result["success"] |
384 | | - assert "report" in result |
385 | | - assert isinstance(result["report"], str) |
386 | | - assert len(result["report"]) > 0 |
| 366 | + assert "results" in result |
| 367 | + assert isinstance(result["results"], str) |
| 368 | + assert len(result["results"]) > 0 |
387 | 369 |
|
388 | 370 | # Check for sources |
389 | 371 | if "sources" in result: |
@@ -483,7 +465,7 @@ async def test_search_async(self, test_case): |
483 | 465 | assert "description" in item |
484 | 466 |
|
485 | 467 | # Check AI mode response |
486 | | - if test_case["params"].get("ai"): |
| 468 | + if test_case["params"].get("ai_overview"): |
487 | 469 | assert "ai_overview" in result |
488 | 470 |
|
489 | 471 | except JigsawStackError as e: |
@@ -528,9 +510,9 @@ async def test_deep_research_async(self, test_case): |
528 | 510 | result = await async_jigsaw.web.deep_research(test_case["params"]) |
529 | 511 |
|
530 | 512 | assert result["success"] |
531 | | - assert "report" in result |
532 | | - assert isinstance(result["report"], str) |
533 | | - assert len(result["report"]) > 0 |
| 513 | + assert "results" in result |
| 514 | + assert isinstance(result["results"], str) |
| 515 | + assert len(result["results"]) > 0 |
534 | 516 |
|
535 | 517 | # Check for sources |
536 | 518 | if "sources" in result: |
|
0 commit comments