firecrawl 2.1.1__tar.gz → 2.1.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of firecrawl might be problematic. Click here for more details.
- {firecrawl-2.1.1 → firecrawl-2.1.2}/PKG-INFO +1 -1
- {firecrawl-2.1.1 → firecrawl-2.1.2}/firecrawl/__init__.py +1 -1
- {firecrawl-2.1.1 → firecrawl-2.1.2}/firecrawl/firecrawl.py +34 -18
- {firecrawl-2.1.1 → firecrawl-2.1.2}/firecrawl.egg-info/PKG-INFO +1 -1
- {firecrawl-2.1.1 → firecrawl-2.1.2}/firecrawl.egg-info/top_level.txt +2 -0
- {firecrawl-2.1.1 → firecrawl-2.1.2}/LICENSE +0 -0
- {firecrawl-2.1.1 → firecrawl-2.1.2}/README.md +0 -0
- {firecrawl-2.1.1 → firecrawl-2.1.2}/firecrawl/__tests__/e2e_withAuth/__init__.py +0 -0
- {firecrawl-2.1.1 → firecrawl-2.1.2}/firecrawl/__tests__/e2e_withAuth/test.py +0 -0
- {firecrawl-2.1.1 → firecrawl-2.1.2}/firecrawl/__tests__/v1/e2e_withAuth/__init__.py +0 -0
- {firecrawl-2.1.1 → firecrawl-2.1.2}/firecrawl/__tests__/v1/e2e_withAuth/test.py +0 -0
- {firecrawl-2.1.1 → firecrawl-2.1.2}/firecrawl.egg-info/SOURCES.txt +0 -0
- {firecrawl-2.1.1 → firecrawl-2.1.2}/firecrawl.egg-info/dependency_links.txt +0 -0
- {firecrawl-2.1.1 → firecrawl-2.1.2}/firecrawl.egg-info/requires.txt +0 -0
- {firecrawl-2.1.1 → firecrawl-2.1.2}/pyproject.toml +0 -0
- {firecrawl-2.1.1 → firecrawl-2.1.2}/setup.cfg +0 -0
- {firecrawl-2.1.1 → firecrawl-2.1.2}/setup.py +0 -0
- {firecrawl-2.1.1 → firecrawl-2.1.2}/tests/test_change_tracking.py +0 -0
|
@@ -1849,24 +1849,33 @@ class FirecrawlApp:
|
|
|
1849
1849
|
show_full_text=show_full_text,
|
|
1850
1850
|
experimental_stream=experimental_stream
|
|
1851
1851
|
)
|
|
1852
|
-
|
|
1853
|
-
|
|
1852
|
+
|
|
1853
|
+
if not response.success or not response.id:
|
|
1854
|
+
return GenerateLLMsTextStatusResponse(
|
|
1855
|
+
success=False,
|
|
1856
|
+
error='Failed to start LLMs.txt generation',
|
|
1857
|
+
status='failed',
|
|
1858
|
+
expiresAt=''
|
|
1859
|
+
)
|
|
1854
1860
|
|
|
1855
|
-
job_id = response
|
|
1861
|
+
job_id = response.id
|
|
1856
1862
|
while True:
|
|
1857
1863
|
status = self.check_generate_llms_text_status(job_id)
|
|
1858
1864
|
|
|
1859
|
-
if status
|
|
1865
|
+
if status.status == 'completed':
|
|
1860
1866
|
return status
|
|
1861
|
-
elif status
|
|
1862
|
-
|
|
1863
|
-
elif status
|
|
1864
|
-
|
|
1867
|
+
elif status.status == 'failed':
|
|
1868
|
+
return status
|
|
1869
|
+
elif status.status != 'processing':
|
|
1870
|
+
return GenerateLLMsTextStatusResponse(
|
|
1871
|
+
success=False,
|
|
1872
|
+
error='LLMs.txt generation job terminated unexpectedly',
|
|
1873
|
+
status='failed',
|
|
1874
|
+
expiresAt=''
|
|
1875
|
+
)
|
|
1865
1876
|
|
|
1866
1877
|
time.sleep(2) # Polling interval
|
|
1867
1878
|
|
|
1868
|
-
return {'success': False, 'error': 'LLMs.txt generation job terminated unexpectedly'}
|
|
1869
|
-
|
|
1870
1879
|
def async_generate_llms_text(
|
|
1871
1880
|
self,
|
|
1872
1881
|
url: str,
|
|
@@ -1903,10 +1912,13 @@ class FirecrawlApp:
|
|
|
1903
1912
|
json_data['origin'] = f"python-sdk@{version}"
|
|
1904
1913
|
|
|
1905
1914
|
try:
|
|
1906
|
-
|
|
1907
|
-
|
|
1915
|
+
req = self._post_request(f'{self.api_url}/v1/llmstxt', json_data, headers)
|
|
1916
|
+
response = req.json()
|
|
1917
|
+
print("json_data", json_data)
|
|
1918
|
+
print("response", response)
|
|
1919
|
+
if response.get('success'):
|
|
1908
1920
|
try:
|
|
1909
|
-
return response
|
|
1921
|
+
return GenerateLLMsTextResponse(**response)
|
|
1910
1922
|
except:
|
|
1911
1923
|
raise Exception('Failed to parse Firecrawl response as JSON.')
|
|
1912
1924
|
else:
|
|
@@ -1914,7 +1926,10 @@ class FirecrawlApp:
|
|
|
1914
1926
|
except Exception as e:
|
|
1915
1927
|
raise ValueError(str(e))
|
|
1916
1928
|
|
|
1917
|
-
return
|
|
1929
|
+
return GenerateLLMsTextResponse(
|
|
1930
|
+
success=False,
|
|
1931
|
+
error='Internal server error'
|
|
1932
|
+
)
|
|
1918
1933
|
|
|
1919
1934
|
def check_generate_llms_text_status(self, id: str) -> GenerateLLMsTextStatusResponse:
|
|
1920
1935
|
"""
|
|
@@ -1941,9 +1956,10 @@ class FirecrawlApp:
|
|
|
1941
1956
|
response = self._get_request(f'{self.api_url}/v1/llmstxt/{id}', headers)
|
|
1942
1957
|
if response.status_code == 200:
|
|
1943
1958
|
try:
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1959
|
+
json_data = response.json()
|
|
1960
|
+
return GenerateLLMsTextStatusResponse(**json_data)
|
|
1961
|
+
except Exception as e:
|
|
1962
|
+
raise Exception(f'Failed to parse Firecrawl response as GenerateLLMsTextStatusResponse: {str(e)}')
|
|
1947
1963
|
elif response.status_code == 404:
|
|
1948
1964
|
raise Exception('LLMs.txt generation job not found')
|
|
1949
1965
|
else:
|
|
@@ -1951,7 +1967,7 @@ class FirecrawlApp:
|
|
|
1951
1967
|
except Exception as e:
|
|
1952
1968
|
raise ValueError(str(e))
|
|
1953
1969
|
|
|
1954
|
-
return
|
|
1970
|
+
return GenerateLLMsTextStatusResponse(success=False, error='Internal server error', status='failed', expiresAt='')
|
|
1955
1971
|
|
|
1956
1972
|
def _prepare_headers(
|
|
1957
1973
|
self,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|