Strands Agents is an open-source Python library that provides a unified toolkit for developing autonomous AI agents. It bridges the gap between large language models and practical applications by offering ready-to-use tools for file operations, system execution, API interactions, mathematical operations, and more.
Set up the strands-agents-tools package by either using the quick pip install or the full development installation with virtual environment and pre-commit hooks.
Quick Install
Copy
pip install strands-agents-tools
3
Set the environment variable
Set your Bright Data API key and unlocker zone as an environment variables:
from strands import Agentfrom strands.models.litellm import LiteLLMModelimport strands_tools.bright_data as bright_dataimport osfrom dotenv import load_dotenvload_dotenv()def main():load_dotenv()print("🔍 Testing Bright Data Tool with OpenAI GPT-4o via LiteLLM")print("=" * 50)# Configure OpenAI model via LiteLLMopenai_model = LiteLLMModel( client_args={ "api_key": os.getenv("OPENAI_API_KEY"), }, model_id="openai/gpt-4o",)# Create agent with LiteLLM model and bright_data toolagent = Agent( model=openai_model, tools=[bright_data], system_prompt="you are a helpful Web Search assistant, whenever user asks you to search the web you will use avilable tools, always set zone name to 'unlocker'")# Test the bright_data tool with a relevant queryprint("Testing web scraping...")result = agent("Please scrape the content from https://example.com and return it as markdown")print(f'\n\nScraping Result:\n{result}')print("\n" + "=" * 50)print("Testing web search...")result2 = agent("Please search Google for 'Python programming tutorials")print(f'\n\nSearch Result:\n{result2}')if __name__ == "__main__":main()