| | |
| | | ## Prerequisites |
| | | |
| | | 1. Get a Tavily API key from https://tavily.com |
| | | 2. Configure the key using one of these methods: |
| | | - **.env file (推荐)**: 在 `~/.openclaw/.env` 文件中配置: |
| | | ```json |
| | | {"env": {"TAVILY_API_KEY": "your_key_here"}} |
| | | ``` |
| | | - **Environment variable**: `export TAVILY_API_KEY=your_key_here` |
| | | - **Direct parameter**: Pass `api_key` when calling the function |
| | | 2. Configure the key via **environment variable**: |
| | | ```bash |
| | | export TAVILY_API_KEY=your_key_here |
| | | ``` |
| | | Add to `~/.bashrc` or `~/.zshrc` for persistence: |
| | | ```bash |
| | | echo 'export TAVILY_API_KEY=your_key_here' >> ~/.bashrc |
| | | source ~/.bashrc |
| | | ``` |
| | | 3. Or pass `api_key` as a direct parameter when calling the function |
| | | |
| | | ## Usage |
| | | |