Use environment variable to initialize scrapegraph_py.Client (#362)

This commit fixes a bug where `SCRAPEGRAPH_API_KEY` were never used to
initialize `scrapegraph_py.Client`.
This commit is contained in:
Vini Brasil
2025-07-09 15:03:16 -03:00
committed by GitHub
parent e0de166592
commit eb09f2718f

View File

@@ -102,9 +102,8 @@ class ScrapegraphScrapeTool(BaseTool):
"`scrapegraph-py` package not found, please run `uv add scrapegraph-py`"
)
self._client = Client(api_key=api_key)
self.api_key = api_key or os.getenv("SCRAPEGRAPH_API_KEY")
self._client = Client(api_key=self.api_key)
if not self.api_key:
raise ValueError("Scrapegraph API key is required")