Skip to content

Commit

Permalink
Get api key from env file
Browse files Browse the repository at this point in the history
  • Loading branch information
anuragts committed Feb 12, 2025
1 parent b414bf3 commit 71d6161
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion libs/agno/agno/tools/firecrawl.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import json
from os import getenv
from typing import Any, Dict, List, Optional

from agno.tools import Toolkit
from agno.utils.log import logger

try:
from firecrawl import FirecrawlApp
Expand All @@ -20,7 +22,11 @@ def __init__(
):
super().__init__(name="firecrawl_tools")

self.api_key: Optional[str] = api_key
self.api_key = api_key or getenv("FIRECRAWL_API_KEY")
logger.info(f"FIRECRAWL_API_KEY: {self.api_key}")
if not self.api_key:
logger.error("FIRECRAWL_API_KEY not set. Please set the FIRECRAWL_API_KEY environment variable.")

self.formats: Optional[List[str]] = formats
self.limit: int = limit
self.app: FirecrawlApp = FirecrawlApp(api_key=self.api_key)
Expand Down

0 comments on commit 71d6161

Please sign in to comment.