From 8d041c05b461a8ecd3a90d17f47ce32611b429be Mon Sep 17 00:00:00 2001 From: Matt Joyce Date: Thu, 23 May 2024 08:00:56 +1000 Subject: [PATCH] rearranged logic for FIRECRAWL_API_URL It would not use the ENV unless the param was set to None which was counter-intuitive. --- apps/python-sdk/firecrawl/firecrawl.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/python-sdk/firecrawl/firecrawl.py b/apps/python-sdk/firecrawl/firecrawl.py index 98cb8ed..2b7121a 100644 --- a/apps/python-sdk/firecrawl/firecrawl.py +++ b/apps/python-sdk/firecrawl/firecrawl.py @@ -4,11 +4,11 @@ import requests import time class FirecrawlApp: - def __init__(self, api_key=None, api_url='https://api.firecrawl.dev'): + def __init__(self, api_key: Optional[str] = None, api_url: Optional[str] = None) -> None: self.api_key = api_key or os.getenv('FIRECRAWL_API_KEY') if self.api_key is None: raise ValueError('No API key provided') - self.api_url = api_url or os.getenv('FIRECRAWL_API_URL') + self.api_url = api_url or os.getenv('FIRECRAWL_API_URL', 'https://api.firecrawl.dev')