mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-07-05 06:59:23 +00:00
* feat: adopt directory-based docs versioning with Edge channel Switch docs.crewai.com from navigation-only versioning (every version selector entry rendered the same docs/<lang>/* source files) to Mintlify's directory-based versioning so each version selector entry renders its own snapshot. Add an "Edge" channel under docs/edge/<lang>/* that always reflects main HEAD for unreleased work, eliminating pre-release leakage onto frozen release labels. External links to canonical /<lang>/* URLs are preserved via wildcard redirects that always land on the current default version. Layout: - docs/edge/<lang>/* rolling source (you edit here) - docs/edge/enterprise-api.*.yaml - docs/v<X.Y.Z>/<lang>/* frozen, immutable snapshots - docs/v<X.Y.Z>/enterprise-api.*.yaml - docs/images/ shared, append-only - docs/docs.json nav + redirects URLs follow the Mintlify-idiomatic shape: /edge/<lang>/<page> for Edge, /v<X.Y.Z>/<lang>/<page> for every frozen snapshot. The wildcard redirects /<lang>/:slug* -> /<default>/<lang>/:slug* keep stale links working, and every freeze rewrites them (plus all per-section/per-page redirects) so destinations always resolve to the current default without depending on a second redirect hop. Release flow integration (devtools release): - New module crewai_devtools.docs_versioning.freeze() materialises docs/v<X.Y.Z>/ from docs/edge/, rewrites openapi: refs inside the snapshot, inserts the version into every language block in docs.json, and refreshes all redirect destinations. - _update_docs_and_create_pr() in cli.py now calls that freeze during Phase 2 of devtools release. Edge changelogs are updated first (so the snapshot freeze picks them up), then the snapshot is staged alongside docs.json, branched as docs/freeze-v<X.Y.Z>, and the PR is titled [docs-freeze] docs: snapshot and changelog for v<X.Y.Z> — the title prefix the new CI guard reads. - The PR still gates tag, GitHub release, PyPI publish, and the enterprise release as before; no new PRs are added. - Pre-releases (1.X.YaN, 1.X.YbN, ...) skip the snapshot — they ride Edge — and the docs PR title omits the [docs-freeze] prefix. - docs_check (AI-generated docs scaffolding) writes to docs/edge/<lang>/* so newly-generated unreleased docs land in Edge and never accidentally touch a frozen snapshot. Migration scripts (one-shot): - scripts/docs/freeze_historical_versions.py reconstructs all 16 historical snapshots (v1.10.0 .. v1.14.7) from git tags via git archive | tar, rewriting openapi: MDX refs so each snapshot reads its own enterprise-api YAML rather than the live one. - scripts/docs/prefix_version_paths.py one-shot-migrates docs.json: rewrites every page path in 16 versioned blocks to point under docs/v<X.Y.Z>/, inserts a new Edge entry per language, tags v1.14.7 as Latest (default), prunes pages whose target file doesn't exist in the snapshot (e.g. docs/ar/ didn't exist before v1.12.0), and writes the wildcard + per-section redirects. - scripts/docs/freeze_current_edge.py is now a thin CLI wrapper around docs_versioning.freeze for manual one-off freezes (e.g. retroactively snapshotting a forgotten release). CI guards (.github/workflows/docs-snapshots.yml): - Frozen snapshots under docs/v[0-9]*/ are immutable; only PRs whose title contains [docs-freeze] (i.e. release-cut PRs generated by devtools release or the manual wrapper) may modify them. - Images under docs/images/ are append-only since snapshots share a single image directory. Deleting or renaming an image breaks every historical snapshot that still references it. Restored docs/images/crewai-otel-export.png from PR #3673; it was deleted in PR #4908 but v1.10.0 / v1.10.1 snapshots still reference it. Restoring instead of editing the snapshots preserves historical rendering fidelity and validates the new append-only rule retroactively. Tests: - lib/devtools/tests/test_docs_versioning.py covers the freeze: file copy, openapi rewrite, version insertion, default demotion, redirect upserts, per-section redirect rewriting, idempotency, and invalid inputs. Verified locally with mintlify broken-links: 0 broken links across the full site (Edge + 16 frozen versions, 4 locales). AGENTS.md (repo root) is the contributor guide for the new model; RELEASING.md is the release-cut runbook; README's Contribution section links to both. Co-authored-by: Cursor <cursoragent@cursor.com> * style: resolve linter issues --------- Co-authored-by: Cursor <cursoragent@cursor.com>
315 lines
9.6 KiB
Plaintext
315 lines
9.6 KiB
Plaintext
---
|
||
title: Integração com Slack
|
||
description: "Comunicação e colaboração em equipe com a integração Slack para CrewAI."
|
||
icon: "slack"
|
||
mode: "wide"
|
||
---
|
||
|
||
## Visão Geral
|
||
|
||
Permita que seus agentes gerenciem a comunicação da equipe pelo Slack. Envie mensagens, pesquise conversas, gerencie canais e coordene as atividades do time para otimizar os fluxos de colaboração com automação impulsionada por IA.
|
||
|
||
## Pré-requisitos
|
||
|
||
Antes de usar a integração com o Slack, certifique-se de que você tenha:
|
||
|
||
- Uma conta [CrewAI AMP](https://app.crewai.com) com assinatura ativa
|
||
- Um workspace do Slack com permissões apropriadas
|
||
- Seu workspace do Slack conectado por meio da [página de Integrações](https://app.crewai.com/integrations)
|
||
|
||
## Configurando a Integração Slack
|
||
|
||
### 1. Conecte seu Workspace do Slack
|
||
|
||
1. Acesse [CrewAI AMP Integrações](https://app.crewai.com/crewai_plus/connectors)
|
||
2. Encontre **Slack** na seção Integrações de Autenticação
|
||
3. Clique em **Conectar** e complete o fluxo OAuth
|
||
4. Conceda as permissões necessárias para comunicação em equipe
|
||
5. Copie seu Token Enterprise em [Configurações de Integração](https://app.crewai.com/crewai_plus/settings/integrations)
|
||
|
||
### 2. Instale o Pacote Necessário
|
||
|
||
```bash
|
||
uv add crewai-tools
|
||
```
|
||
|
||
### 3. Configuração de variável de ambiente
|
||
|
||
<Note>
|
||
Para usar integrações com `Agent(apps=[])`, você deve definir a variável de
|
||
ambiente `CREWAI_PLATFORM_INTEGRATION_TOKEN` com seu Enterprise Token.
|
||
</Note>
|
||
|
||
```bash
|
||
export CREWAI_PLATFORM_INTEGRATION_TOKEN="seu_enterprise_token"
|
||
```
|
||
|
||
Ou adicione ao seu arquivo `.env`:
|
||
|
||
```
|
||
CREWAI_PLATFORM_INTEGRATION_TOKEN=seu_enterprise_token
|
||
```
|
||
|
||
## Ferramentas Disponíveis
|
||
|
||
### **Gerenciamento de Usuários**
|
||
|
||
<AccordionGroup>
|
||
<Accordion title="slack/list_members">
|
||
**Descrição:** Lista todos os membros de um canal do Slack.
|
||
|
||
**Parâmetros:**
|
||
- Nenhum parâmetro necessário – recupera todos os membros do canal
|
||
|
||
</Accordion>
|
||
|
||
<Accordion title="slack/get_user_by_email">
|
||
**Descrição:** Encontre um usuário no seu workspace do Slack pelo endereço de e-mail.
|
||
|
||
**Parâmetros:**
|
||
- `email` (string, obrigatório): O endereço de e-mail de um usuário do workspace
|
||
|
||
</Accordion>
|
||
|
||
<Accordion title="slack/get_users_by_name">
|
||
**Descrição:** Pesquise usuários pelo nome ou nome de exibição.
|
||
|
||
**Parâmetros:**
|
||
- `name` (string, obrigatório): Nome real do usuário para a pesquisa
|
||
- `displayName` (string, obrigatório): Nome de exibição do usuário para a pesquisa
|
||
- `paginationParameters` (object, opcional): Configurações de paginação
|
||
- `pageCursor` (string, opcional): Cursor de página para paginação
|
||
|
||
</Accordion>
|
||
</AccordionGroup>
|
||
|
||
### **Gerenciamento de Canais**
|
||
|
||
<AccordionGroup>
|
||
<Accordion title="slack/list_channels">
|
||
**Descrição:** Lista todos os canais do seu workspace no Slack.
|
||
|
||
**Parâmetros:**
|
||
- Nenhum parâmetro necessário – recupera todos os canais acessíveis
|
||
|
||
</Accordion>
|
||
</AccordionGroup>
|
||
|
||
### **Mensagens**
|
||
|
||
<AccordionGroup>
|
||
<Accordion title="slack/send_message">
|
||
**Descrição:** Envie uma mensagem para um canal do Slack.
|
||
|
||
**Parâmetros:**
|
||
- `channel` (string, obrigatório): Nome ou ID do canal – Use as Configurações de Workflow do Connect Portal para que usuários selecionem o canal, ou insira o nome do canal para criar um novo
|
||
- `message` (string, obrigatório): Texto da mensagem a ser enviada
|
||
- `botName` (string, obrigatório): Nome do bot que enviará a mensagem
|
||
- `botIcon` (string, obrigatório): Ícone do bot – Pode ser uma URL de imagem ou um emoji (ex.: ":dog:")
|
||
- `blocks` (object, opcional): JSON do Slack Block Kit para mensagens ricas com anexos e elementos interativos
|
||
- `authenticatedUser` (boolean, opcional): Se verdadeiro, a mensagem aparecerá como enviada pelo seu usuário autenticado do Slack ao invés do aplicativo (por padrão é falso)
|
||
|
||
</Accordion>
|
||
|
||
<Accordion title="slack/send_direct_message">
|
||
**Descrição:** Envie uma mensagem direta para um usuário específico no Slack.
|
||
|
||
**Parâmetros:**
|
||
- `memberId` (string, obrigatório): ID do usuário destinatário – Use as Configurações de Workflow do Connect Portal para que usuários selecionem um membro
|
||
- `message` (string, obrigatório): Texto da mensagem a ser enviada
|
||
- `botName` (string, obrigatório): Nome do bot que enviará a mensagem
|
||
- `botIcon` (string, obrigatório): Ícone do bot – Pode ser uma URL de imagem ou um emoji (ex.: ":dog:")
|
||
- `blocks` (object, opcional): JSON do Slack Block Kit para formatação rica com anexos e elementos interativos
|
||
- `authenticatedUser` (boolean, opcional): Se verdadeiro, a mensagem aparecerá como enviada pelo seu usuário autenticado do Slack (padrão é falso)
|
||
|
||
</Accordion>
|
||
</AccordionGroup>
|
||
|
||
### **Pesquisa & Descoberta**
|
||
|
||
<AccordionGroup>
|
||
<Accordion title="slack/search_messages">
|
||
**Descrição:** Procure por mensagens em todo o seu workspace do Slack.
|
||
|
||
**Parâmetros:**
|
||
- `query` (string, obrigatório): Consulta de pesquisa usando a sintaxe do Slack para encontrar mensagens que correspondam aos critérios especificados
|
||
|
||
**Exemplos de Consultas de Pesquisa:**
|
||
- `"project update"` – Busca mensagens contendo "project update"
|
||
- `from:@john in:#general` – Busca mensagens do John no canal #general
|
||
- `has:link after:2023-01-01` – Busca mensagens com links após 1º de janeiro de 2023
|
||
- `in:@channel before:yesterday` – Busca mensagens em um canal específico antes de ontem
|
||
|
||
</Accordion>
|
||
</AccordionGroup>
|
||
|
||
## Integração com Block Kit
|
||
|
||
O Block Kit do Slack permite criar mensagens ricas e interativas. Veja alguns exemplos de como usar o parâmetro `blocks`:
|
||
|
||
### Texto Simples com Anexo
|
||
|
||
```json
|
||
[
|
||
{
|
||
"text": "I am a test message",
|
||
"attachments": [
|
||
{
|
||
"text": "And here's an attachment!"
|
||
}
|
||
]
|
||
}
|
||
]
|
||
```
|
||
|
||
### Formatação Rica com Seções
|
||
|
||
```json
|
||
[
|
||
{
|
||
"type": "section",
|
||
"text": {
|
||
"type": "mrkdwn",
|
||
"text": "*Project Update*\nStatus: ✅ Complete"
|
||
}
|
||
},
|
||
{
|
||
"type": "divider"
|
||
},
|
||
{
|
||
"type": "section",
|
||
"text": {
|
||
"type": "plain_text",
|
||
"text": "All tasks have been completed successfully."
|
||
}
|
||
}
|
||
]
|
||
```
|
||
|
||
## Exemplos de Uso
|
||
|
||
### Configuração Básica de Agente Slack
|
||
|
||
```python
|
||
from crewai import Agent, Task, Crew
|
||
|
||
# Create an agent with Slack capabilities
|
||
slack_agent = Agent(
|
||
role="Team Communication Manager",
|
||
goal="Facilitate team communication and coordinate collaboration efficiently",
|
||
backstory="An AI assistant specialized in team communication and workspace coordination.",
|
||
apps=['slack']
|
||
)
|
||
|
||
# Task to send project updates
|
||
update_task = Task(
|
||
description="Send a project status update to the #general channel with current progress",
|
||
agent=slack_agent,
|
||
expected_output="Project update message sent successfully to team channel"
|
||
)
|
||
|
||
# Run the task
|
||
crew = Crew(
|
||
agents=[slack_agent],
|
||
tasks=[update_task]
|
||
)
|
||
|
||
crew.kickoff()
|
||
```
|
||
|
||
### Filtrando Ferramentas Específicas do Slack
|
||
|
||
```python
|
||
|
||
communication_manager = Agent(
|
||
role="Communication Coordinator",
|
||
goal="Manage team communications and ensure important messages reach the right people",
|
||
backstory="An experienced communication coordinator who handles team messaging and notifications.",
|
||
apps=['slack']
|
||
)
|
||
|
||
# Task to coordinate team communication
|
||
coordination_task = Task(
|
||
description="Send task completion notifications to team members and update project channels",
|
||
agent=communication_manager,
|
||
expected_output="Team notifications sent and project channels updated successfully"
|
||
)
|
||
|
||
crew = Crew(
|
||
agents=[communication_manager],
|
||
tasks=[coordination_task]
|
||
)
|
||
|
||
crew.kickoff()
|
||
```
|
||
|
||
### Mensagens Avançadas com Block Kit
|
||
|
||
```python
|
||
from crewai import Agent, Task, Crew
|
||
|
||
notification_agent = Agent(
|
||
role="Notification Manager",
|
||
goal="Create rich, interactive notifications and manage workspace communication",
|
||
backstory="An AI assistant that specializes in creating engaging team notifications and updates.",
|
||
apps=['slack']
|
||
)
|
||
|
||
# Task to send rich notifications
|
||
notification_task = Task(
|
||
description="""
|
||
1. Send a formatted project completion message to #general with progress charts
|
||
2. Send direct messages to team leads with task summaries
|
||
3. Create interactive notification with action buttons for team feedback
|
||
""",
|
||
agent=notification_agent,
|
||
expected_output="Rich notifications sent with interactive elements and formatted content"
|
||
)
|
||
|
||
crew = Crew(
|
||
agents=[notification_agent],
|
||
tasks=[notification_task]
|
||
)
|
||
|
||
crew.kickoff()
|
||
```
|
||
|
||
### Pesquisa de Mensagens e Análises
|
||
|
||
```python
|
||
from crewai import Agent, Task, Crew
|
||
|
||
analytics_agent = Agent(
|
||
role="Communication Analyst",
|
||
goal="Analyze team communication patterns and extract insights from conversations",
|
||
backstory="An analytical AI that excels at understanding team dynamics through communication data.",
|
||
apps=['slack']
|
||
)
|
||
|
||
# Complex task involving search and analysis
|
||
analysis_task = Task(
|
||
description="""
|
||
1. Search for recent project-related messages across all channels
|
||
2. Find users by email to identify team members
|
||
3. Analyze communication patterns and response times
|
||
4. Generate weekly team communication summary
|
||
""",
|
||
agent=analytics_agent,
|
||
expected_output="Comprehensive communication analysis with team insights and recommendations"
|
||
)
|
||
|
||
crew = Crew(
|
||
agents=[analytics_agent],
|
||
tasks=[analysis_task]
|
||
)
|
||
|
||
crew.kickoff()
|
||
```
|
||
|
||
## Fale com o Suporte
|
||
|
||
<Card title="Precisa de Ajuda?" icon="headset" href="mailto:support@crewai.com">
|
||
Entre em contato com nossa equipe de suporte para obter ajuda na configuração
|
||
ou solução de problemas da integração com o Slack.
|
||
</Card>
|