mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-05-06 17:52:35 +00:00
Some checks failed
* feat(crewai-tools): add highlights to ExaSearchTool, rename from EXASearchTool - Add a highlights init param so agents can get token-efficient excerpts instead of full pages - Rename EXASearchTool to ExaSearchTool; keep EXASearchTool as a deprecated alias so existing imports keep working - Update the docs and example to use highlights as the recommended option - Add a small note that says Exa is the fastest and most accurate web search API - Add tests for the new highlights param and the deprecation alias * fix(crewai-tools): import order and module-level Exa for tests - Reorder std-lib imports so ruff is happy with force-sort-within-sections. - Import Exa at module level (with a fallback) so the existing test mocks resolve. The lazy install prompt still works if exa_py is missing. - Allow content and summary to be a dict, matching highlights. - Trim test file to the cases this PR introduces (highlights param and the EXASearchTool deprecation alias). Existing init-shape tests stay. Co-Authored-By: ishan <ishan@exa.ai> * chore(crewai-tools): drop self-explanatory comment on schema alias Co-Authored-By: ishan <ishan@exa.ai> * docs(crewai-tools): default highlights to True, drop summary from examples Co-Authored-By: ishan <ishan@exa.ai> * docs(crewai-tools): simplify highlights examples to highlights=True Co-Authored-By: ishan <ishan@exa.ai> * feat(crewai-tools): add x-exa-integration header for usage tracking Co-Authored-By: ishan <ishan@exa.ai> * docs(crewai-tools): add Exa MCP section and resources links Co-Authored-By: ishan <ishan@exa.ai> --------- Co-authored-by: ishan <ishan@exa.ai> Co-authored-by: Greyson LaLonde <greyson.r.lalonde@gmail.com> Co-authored-by: Lorenze Jay <63378463+lorenzejay@users.noreply.github.com>
81 lines
2.7 KiB
Plaintext
81 lines
2.7 KiB
Plaintext
---
|
|
title: Carregador Web EXA Search
|
|
description: O `ExaSearchTool` foi projetado para realizar uma busca semântica para uma consulta especificada a partir do conteúdo de um texto em toda a internet.
|
|
icon: globe-pointer
|
|
mode: "wide"
|
|
---
|
|
|
|
# `ExaSearchTool`
|
|
|
|
## Descrição
|
|
|
|
O ExaSearchTool foi projetado para realizar uma busca semântica para uma consulta especificada a partir do conteúdo de um texto em toda a internet.
|
|
Ele utiliza a API da [exa.ai](https://exa.ai/) para buscar e exibir os resultados de pesquisa mais relevantes com base na consulta fornecida pelo usuário.
|
|
|
|
## Instalação
|
|
|
|
Para incorporar esta ferramenta em seu projeto, siga as instruções de instalação abaixo:
|
|
|
|
```shell
|
|
pip install 'crewai[tools]'
|
|
```
|
|
|
|
## Exemplo
|
|
|
|
O exemplo a seguir demonstra como inicializar a ferramenta e executar uma busca com uma consulta determinada:
|
|
|
|
```python Code
|
|
from crewai_tools import ExaSearchTool
|
|
|
|
# Initialize the tool for internet searching capabilities
|
|
tool = ExaSearchTool()
|
|
```
|
|
|
|
## Etapas para Começar
|
|
|
|
Para usar o ExaSearchTool de forma eficaz, siga estas etapas:
|
|
|
|
<Steps>
|
|
<Step title="Instalação do Pacote">
|
|
Confirme se o pacote `crewai[tools]` está instalado em seu ambiente Python.
|
|
</Step>
|
|
<Step title="Obtenção da Chave de API">
|
|
Adquira uma chave de API da [exa.ai](https://exa.ai/) registrando-se gratuitamente em [exa.ai](https://exa.ai/).
|
|
</Step>
|
|
<Step title="Configuração de Ambiente">
|
|
Armazene a chave de API obtida em uma variável de ambiente chamada `EXA_API_KEY` para facilitar o uso pela ferramenta.
|
|
</Step>
|
|
</Steps>
|
|
|
|
## Usando o Exa via MCP
|
|
|
|
Você também pode conectar seu agente ao servidor MCP hospedado pelo Exa. Passe sua chave de API no cabeçalho `x-api-key`:
|
|
|
|
```python
|
|
from crewai import Agent
|
|
from crewai.mcp import MCPServerHTTP
|
|
|
|
agent = Agent(
|
|
role="Research Analyst",
|
|
goal="Find and analyze information on the web",
|
|
backstory="Expert researcher with access to Exa's tools",
|
|
mcps=[
|
|
MCPServerHTTP(
|
|
url="https://mcp.exa.ai/mcp",
|
|
headers={"x-api-key": "YOUR_EXA_API_KEY"},
|
|
),
|
|
],
|
|
)
|
|
```
|
|
|
|
Obtenha sua chave de API no [painel da Exa](https://dashboard.exa.ai/api-keys). Para mais informações sobre MCP no CrewAI, consulte a [visão geral do MCP](/pt-BR/mcp/overview).
|
|
|
|
## Conclusão
|
|
|
|
Ao integrar o `ExaSearchTool` em projetos Python, os usuários ganham a capacidade de realizar buscas relevantes e em tempo real pela internet diretamente de suas aplicações.
|
|
Seguindo as orientações de configuração e uso fornecidas, a incorporação desta ferramenta em projetos torna-se simples e direta.
|
|
|
|
## Recursos
|
|
|
|
- [Documentação do Exa](https://exa.ai/docs)
|
|
- [Painel do Exa — gerenciar chaves de API e uso](https://dashboard.exa.ai) |