Showing the changes to apps/python-sdk (2 of 2 files). Show all
Unified · Split
| @@ -13,7 +13,7 @@ import os · 12 unmodified lines | |||
| 13 | 13 | ||
| 14 | from .firecrawl import FirecrawlApp, AsyncFirecrawlApp, JsonConfig, ScrapeOptions, ChangeTrackingOptions # noqa | 14 | from .firecrawl import FirecrawlApp, AsyncFirecrawlApp, JsonConfig, ScrapeOptions, ChangeTrackingOptions # noqa |
| 15 | 15 | ||
| 16 | __version__ = "2.16.1" | 16 | __version__ = "2.16.2" |
| 17 | 17 | ||
| 18 | # Define the logger for the Firecrawl project | 18 | # Define the logger for the Firecrawl project |
| 19 | logger: logging.Logger = logging.getLogger("firecrawl") | 19 | logger: logging.Logger = logging.getLogger("firecrawl") |
| @@ -1372,8 +1372,8 @@ class FirecrawlApp: · 1371 unmodified lines | |||
| 1372 | if isinstance(json_options, dict) and "schema" in json_options: | 1372 | if isinstance(json_options, dict) and "schema" in json_options: |
| 1373 | json_options["schema"] = self._ensure_schema_dict(json_options["schema"]) | 1373 | json_options["schema"] = self._ensure_schema_dict(json_options["schema"]) |
| 1374 | scrape_params['jsonOptions'] = json_options if isinstance(json_options, dict) else json_options.dict(exclude_none=True) | 1374 | scrape_params['jsonOptions'] = json_options if isinstance(json_options, dict) else json_options.dict(exclude_none=True) |
| 1375 | if actions is not None: | 1375 | if actions: |
| 1376 | scrape_params['actions'] = [action.dict(exclude_none=True) for action in actions] | 1376 | scrape_params['actions'] = [action if isinstance(action, dict) else action.dict(exclude_none=True) for action in actions] |
| 1377 | if agent is not None: | 1377 | if agent is not None: |
| 1378 | scrape_params['agent'] = agent.dict(exclude_none=True) | 1378 | scrape_params['agent'] = agent.dict(exclude_none=True) |
| 1379 | if max_concurrency is not None: | 1379 | if max_concurrency is not None: |
| @@ -1513,8 +1513,8 @@ class FirecrawlApp: · 133 unmodified lines | |||
| 1513 | if isinstance(json_options, dict) and "schema" in json_options: | 1513 | if isinstance(json_options, dict) and "schema" in json_options: |
| 1514 | json_options["schema"] = self._ensure_schema_dict(json_options["schema"]) | 1514 | json_options["schema"] = self._ensure_schema_dict(json_options["schema"]) |
| 1515 | scrape_params['jsonOptions'] = json_options if isinstance(json_options, dict) else json_options.dict(exclude_none=True) | 1515 | scrape_params['jsonOptions'] = json_options if isinstance(json_options, dict) else json_options.dict(exclude_none=True) |
| 1516 | if actions is not None: | 1516 | if actions: |
| 1517 | scrape_params['actions'] = [action.dict(exclude_none=True) for action in actions] | 1517 | scrape_params['actions'] = [action if isinstance(action, dict) else action.dict(exclude_none=True) for action in actions] |
| 1518 | if agent is not None: | 1518 | if agent is not None: |
| 1519 | scrape_params['agent'] = agent.dict(exclude_none=True) | 1519 | scrape_params['agent'] = agent.dict(exclude_none=True) |
| 1520 | if max_concurrency is not None: | 1520 | if max_concurrency is not None: |
| @@ -1649,8 +1649,8 @@ class FirecrawlApp: · 128 unmodified lines | |||
| 1649 | if isinstance(json_options, dict) and "schema" in json_options: | 1649 | if isinstance(json_options, dict) and "schema" in json_options: |
| 1650 | json_options["schema"] = self._ensure_schema_dict(json_options["schema"]) | 1650 | json_options["schema"] = self._ensure_schema_dict(json_options["schema"]) |
| 1651 | scrape_params['jsonOptions'] = json_options if isinstance(json_options, dict) else json_options.dict(exclude_none=True) | 1651 | scrape_params['jsonOptions'] = json_options if isinstance(json_options, dict) else json_options.dict(exclude_none=True) |
| 1652 | if actions is not None: | 1652 | if actions: |
| 1653 | scrape_params['actions'] = [action.dict(exclude_none=True) for action in actions] | 1653 | scrape_params['actions'] = [action if isinstance(action, dict) else action.dict(exclude_none=True) for action in actions] |
| 1654 | if agent is not None: | 1654 | if agent is not None: |
| 1655 | scrape_params['agent'] = agent.dict(exclude_none=True) | 1655 | scrape_params['agent'] = agent.dict(exclude_none=True) |
| 1656 | if max_concurrency is not None: | 1656 | if max_concurrency is not None: |
| @@ -3074,7 +3074,6 @@ class AsyncFirecrawlApp(FirecrawlApp): · 1417 unmodified lines | |||
| 3074 | scrape_params['jsonOptions'] = json_options if isinstance(json_options, dict) else json_options.dict(exclude_none=True) | 3074 | scrape_params['jsonOptions'] = json_options if isinstance(json_options, dict) else json_options.dict(exclude_none=True) |
| 3075 | if actions: | 3075 | if actions: |
| 3076 | scrape_params['actions'] = [action if isinstance(action, dict) else action.dict(exclude_none=True) for action in actions] | 3076 | scrape_params['actions'] = [action if isinstance(action, dict) else action.dict(exclude_none=True) for action in actions] |
| 3077 | |||
| 3078 | if 'extract' in scrape_params and scrape_params['extract'] and 'schema' in scrape_params['extract']: | 3077 | if 'extract' in scrape_params and scrape_params['extract'] and 'schema' in scrape_params['extract']: |
| 3079 | scrape_params['extract']['schema'] = self._ensure_schema_dict(scrape_params['extract']['schema']) | 3078 | scrape_params['extract']['schema'] = self._ensure_schema_dict(scrape_params['extract']['schema']) |
| 3080 | if 'jsonOptions' in scrape_params and scrape_params['jsonOptions'] and 'schema' in scrape_params['jsonOptions']: | 3079 | if 'jsonOptions' in scrape_params and scrape_params['jsonOptions'] and 'schema' in scrape_params['jsonOptions']: |
| @@ -3199,8 +3198,7 @@ class AsyncFirecrawlApp(FirecrawlApp): · 118 unmodified lines | |||
| 3199 | if isinstance(json_options, dict) and "schema" in json_options: | 3198 | if isinstance(json_options, dict) and "schema" in json_options: |
| 3200 | json_options["schema"] = self._ensure_schema_dict(json_options["schema"]) | 3199 | json_options["schema"] = self._ensure_schema_dict(json_options["schema"]) |
| 3201 | scrape_params['jsonOptions'] = json_options if isinstance(json_options, dict) else json_options.dict(exclude_none=True) | 3200 | scrape_params['jsonOptions'] = json_options if isinstance(json_options, dict) else json_options.dict(exclude_none=True) |
| 3202 | if actions is not None: | 3201 | |
| 3203 | scrape_params['actions'] = [action.dict(exclude_none=True) for action in actions] | ||
| 3204 | if agent is not None: | 3202 | if agent is not None: |
| 3205 | scrape_params['agent'] = agent.dict(exclude_none=True) | 3203 | scrape_params['agent'] = agent.dict(exclude_none=True) |
| 3206 | 3204 | ||
| @@ -3339,8 +3337,8 @@ class AsyncFirecrawlApp(FirecrawlApp): · 132 unmodified lines | |||
| 3339 | if isinstance(json_options, dict) and "schema" in json_options: | 3337 | if isinstance(json_options, dict) and "schema" in json_options: |
| 3340 | json_options["schema"] = self._ensure_schema_dict(json_options["schema"]) | 3338 | json_options["schema"] = self._ensure_schema_dict(json_options["schema"]) |
| 3341 | scrape_params['jsonOptions'] = json_options if isinstance(json_options, dict) else json_options.dict(exclude_none=True) | 3339 | scrape_params['jsonOptions'] = json_options if isinstance(json_options, dict) else json_options.dict(exclude_none=True) |
| 3342 | if actions is not None: | 3340 | if actions: |
| 3343 | scrape_params['actions'] = [action.dict(exclude_none=True) for action in actions] | 3341 | scrape_params['actions'] = [action if isinstance(action, dict) else action.dict(exclude_none=True) for action in actions] |
| 3344 | if agent is not None: | 3342 | if agent is not None: |
| 3345 | scrape_params['agent'] = agent.dict(exclude_none=True) | 3343 | scrape_params['agent'] = agent.dict(exclude_none=True) |
| 3346 | if zero_data_retention is not None: | 3344 | if zero_data_retention is not None: |