mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-07-02 21:58:11 +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>
290 lines
11 KiB
Plaintext
290 lines
11 KiB
Plaintext
---
|
|
title: Integração Microsoft Excel
|
|
description: "Gerenciamento de pastas de trabalho e dados com integração Microsoft Excel para CrewAI."
|
|
icon: "table"
|
|
mode: "wide"
|
|
---
|
|
|
|
## Visão Geral
|
|
|
|
Permita que seus agentes criem e gerenciem pastas de trabalho, planilhas, tabelas e gráficos do Excel no OneDrive ou SharePoint. Manipule intervalos de dados, crie visualizações, gerencie tabelas e simplifique seus fluxos de trabalho de planilhas com automação alimentada por IA.
|
|
|
|
## Pré-requisitos
|
|
|
|
Antes de usar a integração Microsoft Excel, certifique-se de ter:
|
|
|
|
- Uma conta [CrewAI AMP](https://app.crewai.com) com assinatura ativa
|
|
- Uma conta Microsoft 365 com acesso ao Excel e OneDrive/SharePoint
|
|
- Conectado sua conta Microsoft através da [página de Integrações](https://app.crewai.com/crewai_plus/connectors)
|
|
|
|
## Configurando a Integração Microsoft Excel
|
|
|
|
### 1. Conecte sua Conta Microsoft
|
|
|
|
1. Navegue para [Integrações CrewAI AMP](https://app.crewai.com/crewai_plus/connectors)
|
|
2. Encontre **Microsoft Excel** na seção de Integrações de Autenticação
|
|
3. Clique em **Conectar** e complete o fluxo OAuth
|
|
4. Conceda as permissões necessárias para acesso a arquivos e pastas de trabalho do Excel
|
|
5. Copie seu Token Enterprise das [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
|
|
```
|
|
|
|
## Ações Disponíveis
|
|
|
|
<AccordionGroup>
|
|
<Accordion title="microsoft_excel/create_workbook">
|
|
**Descrição:** Criar uma nova pasta de trabalho do Excel no OneDrive ou SharePoint.
|
|
|
|
**Parâmetros:**
|
|
- `file_path` (string, obrigatório): Caminho onde criar a pasta de trabalho (ex: 'MinhaPastaDeTrabalho.xlsx')
|
|
- `worksheets` (array, opcional): Planilhas iniciais para criar. Cada item é um objeto com `name` (string, nome da planilha).
|
|
|
|
</Accordion>
|
|
|
|
<Accordion title="microsoft_excel/get_workbooks">
|
|
**Descrição:** Obter todas as pastas de trabalho do Excel do OneDrive ou SharePoint.
|
|
|
|
**Parâmetros:**
|
|
- `select` (string, opcional): Selecionar propriedades específicas para retornar.
|
|
- `filter` (string, opcional): Filtrar resultados usando sintaxe OData.
|
|
- `expand` (string, opcional): Expandir recursos relacionados inline.
|
|
- `top` (integer, opcional): Número de itens a retornar (mín 1, máx 999).
|
|
- `orderby` (string, opcional): Ordenar resultados por propriedades especificadas.
|
|
|
|
</Accordion>
|
|
|
|
<Accordion title="microsoft_excel/get_worksheets">
|
|
**Descrição:** Obter todas as planilhas em uma pasta de trabalho do Excel.
|
|
|
|
**Parâmetros:**
|
|
- `file_id` (string, obrigatório): O ID do arquivo Excel.
|
|
- `select` (string, opcional): Selecionar propriedades específicas para retornar (ex: 'id,name,position').
|
|
- `filter` (string, opcional): Filtrar resultados usando sintaxe OData.
|
|
- `expand` (string, opcional): Expandir recursos relacionados inline.
|
|
- `top` (integer, opcional): Número de itens a retornar (mín 1, máx 999).
|
|
- `orderby` (string, opcional): Ordenar resultados por propriedades especificadas.
|
|
|
|
</Accordion>
|
|
|
|
<Accordion title="microsoft_excel/create_worksheet">
|
|
**Descrição:** Criar uma nova planilha em uma pasta de trabalho do Excel.
|
|
|
|
**Parâmetros:**
|
|
- `file_id` (string, obrigatório): O ID do arquivo Excel.
|
|
- `name` (string, obrigatório): Nome da nova planilha.
|
|
|
|
</Accordion>
|
|
|
|
<Accordion title="microsoft_excel/get_range_data">
|
|
**Descrição:** Obter dados de um intervalo específico em uma planilha do Excel.
|
|
|
|
**Parâmetros:**
|
|
- `file_id` (string, obrigatório): O ID do arquivo Excel.
|
|
- `worksheet_name` (string, obrigatório): Nome da planilha.
|
|
- `range` (string, obrigatório): Endereço do intervalo (ex: 'A1:C10').
|
|
|
|
</Accordion>
|
|
|
|
<Accordion title="microsoft_excel/update_range_data">
|
|
**Descrição:** Atualizar dados em um intervalo específico em uma planilha do Excel.
|
|
|
|
**Parâmetros:**
|
|
- `file_id` (string, obrigatório): O ID do arquivo Excel.
|
|
- `worksheet_name` (string, obrigatório): Nome da planilha.
|
|
- `range` (string, obrigatório): Endereço do intervalo (ex: 'A1:C10').
|
|
- `values` (array, obrigatório): Array 2D de valores para definir no intervalo. Cada array interno representa uma linha, e elementos podem ser string, number ou integer.
|
|
|
|
</Accordion>
|
|
|
|
<Accordion title="microsoft_excel/add_table">
|
|
**Descrição:** Criar uma tabela em uma planilha do Excel.
|
|
|
|
**Parâmetros:**
|
|
- `file_id` (string, obrigatório): O ID do arquivo Excel.
|
|
- `worksheet_name` (string, obrigatório): Nome da planilha.
|
|
- `range` (string, obrigatório): Intervalo para a tabela (ex: 'A1:D10').
|
|
- `has_headers` (boolean, opcional): Se a primeira linha contém cabeçalhos. Padrão: true.
|
|
|
|
</Accordion>
|
|
|
|
<Accordion title="microsoft_excel/get_tables">
|
|
**Descrição:** Obter todas as tabelas em uma planilha do Excel.
|
|
|
|
**Parâmetros:**
|
|
- `file_id` (string, obrigatório): O ID do arquivo Excel.
|
|
- `worksheet_name` (string, obrigatório): Nome da planilha.
|
|
|
|
</Accordion>
|
|
|
|
<Accordion title="microsoft_excel/add_table_row">
|
|
**Descrição:** Adicionar uma nova linha a uma tabela do Excel.
|
|
|
|
**Parâmetros:**
|
|
- `file_id` (string, obrigatório): O ID do arquivo Excel.
|
|
- `worksheet_name` (string, obrigatório): Nome da planilha.
|
|
- `table_name` (string, obrigatório): Nome da tabela.
|
|
- `values` (array, obrigatório): Array de valores para a nova linha. Elementos podem ser string, number ou integer.
|
|
|
|
</Accordion>
|
|
|
|
<Accordion title="microsoft_excel/get_table_data">
|
|
**Descrição:** Obter dados de uma tabela específica em uma planilha do Excel.
|
|
|
|
**Parâmetros:**
|
|
- `file_id` (string, obrigatório): O ID do arquivo Excel.
|
|
- `worksheet_name` (string, obrigatório): Nome da planilha.
|
|
- `table_name` (string, obrigatório): Nome da tabela.
|
|
|
|
</Accordion>
|
|
|
|
<Accordion title="microsoft_excel/create_chart">
|
|
**Descrição:** Criar um gráfico em uma planilha do Excel.
|
|
|
|
**Parâmetros:**
|
|
- `file_id` (string, obrigatório): O ID do arquivo Excel.
|
|
- `worksheet_name` (string, obrigatório): Nome da planilha.
|
|
- `chart_type` (string, obrigatório): Tipo de gráfico (ex: 'ColumnClustered', 'Line', 'Pie').
|
|
- `source_data` (string, obrigatório): Intervalo de dados para o gráfico (ex: 'A1:B10').
|
|
- `series_by` (string, opcional): Como interpretar os dados ('Auto', 'Columns' ou 'Rows'). Padrão: 'Auto'.
|
|
|
|
</Accordion>
|
|
|
|
<Accordion title="microsoft_excel/get_cell">
|
|
**Descrição:** Obter o valor de uma única célula em uma planilha do Excel.
|
|
|
|
**Parâmetros:**
|
|
- `file_id` (string, obrigatório): O ID do arquivo Excel.
|
|
- `worksheet_name` (string, obrigatório): Nome da planilha.
|
|
- `row` (integer, obrigatório): Número da linha (baseado em 0).
|
|
- `column` (integer, obrigatório): Número da coluna (baseado em 0).
|
|
|
|
</Accordion>
|
|
|
|
<Accordion title="microsoft_excel/get_used_range">
|
|
**Descrição:** Obter o intervalo usado de uma planilha do Excel (contém todos os dados).
|
|
|
|
**Parâmetros:**
|
|
- `file_id` (string, obrigatório): O ID do arquivo Excel.
|
|
- `worksheet_name` (string, obrigatório): Nome da planilha.
|
|
|
|
</Accordion>
|
|
|
|
<Accordion title="microsoft_excel/get_used_range_metadata">
|
|
**Descrição:** Obter os metadados do intervalo usado (apenas dimensões, sem dados) de uma planilha do Excel.
|
|
|
|
**Parâmetros:**
|
|
- `file_id` (string, obrigatório): O ID do arquivo Excel.
|
|
- `worksheet_name` (string, obrigatório): Nome da planilha.
|
|
|
|
</Accordion>
|
|
|
|
<Accordion title="microsoft_excel/list_charts">
|
|
**Descrição:** Obter todos os gráficos em uma planilha do Excel.
|
|
|
|
**Parâmetros:**
|
|
- `file_id` (string, obrigatório): O ID do arquivo Excel.
|
|
- `worksheet_name` (string, obrigatório): Nome da planilha.
|
|
|
|
</Accordion>
|
|
|
|
<Accordion title="microsoft_excel/delete_worksheet">
|
|
**Descrição:** Excluir uma planilha de uma pasta de trabalho do Excel.
|
|
|
|
**Parâmetros:**
|
|
- `file_id` (string, obrigatório): O ID do arquivo Excel.
|
|
- `worksheet_name` (string, obrigatório): Nome da planilha a excluir.
|
|
|
|
</Accordion>
|
|
|
|
<Accordion title="microsoft_excel/delete_table">
|
|
**Descrição:** Excluir uma tabela de uma planilha do Excel.
|
|
|
|
**Parâmetros:**
|
|
- `file_id` (string, obrigatório): O ID do arquivo Excel.
|
|
- `worksheet_name` (string, obrigatório): Nome da planilha.
|
|
- `table_name` (string, obrigatório): Nome da tabela a excluir.
|
|
|
|
</Accordion>
|
|
|
|
<Accordion title="microsoft_excel/list_names">
|
|
**Descrição:** Obter todos os intervalos nomeados em uma pasta de trabalho do Excel.
|
|
|
|
**Parâmetros:**
|
|
- `file_id` (string, obrigatório): O ID do arquivo Excel.
|
|
|
|
</Accordion>
|
|
</AccordionGroup>
|
|
|
|
## Exemplos de Uso
|
|
|
|
### Configuração Básica do Agente Microsoft Excel
|
|
|
|
```python
|
|
from crewai import Agent, Task, Crew
|
|
|
|
# Crie um agente com capacidades do Microsoft Excel
|
|
excel_agent = Agent(
|
|
role="Gerenciador de Dados Excel",
|
|
goal="Gerenciar pastas de trabalho e dados do Excel de forma eficiente",
|
|
backstory="Um assistente IA especializado em operações do Microsoft Excel e manipulação de dados.",
|
|
apps=['microsoft_excel'] # Todas as ações do Excel estarão disponíveis
|
|
)
|
|
|
|
# Tarefa para criar uma nova pasta de trabalho
|
|
create_workbook_task = Task(
|
|
description="Criar uma nova pasta de trabalho do Excel chamada 'RelatorioMensal.xlsx' com uma planilha inicial chamada 'DadosVendas'.",
|
|
agent=excel_agent,
|
|
expected_output="Nova pasta de trabalho 'RelatorioMensal.xlsx' criada com planilha 'DadosVendas'."
|
|
)
|
|
|
|
# Execute a tarefa
|
|
crew = Crew(
|
|
agents=[excel_agent],
|
|
tasks=[create_workbook_task]
|
|
)
|
|
|
|
crew.kickoff()
|
|
```
|
|
|
|
## Solução de Problemas
|
|
|
|
### Problemas Comuns
|
|
|
|
**Erros de Autenticação**
|
|
|
|
- Certifique-se de que sua conta Microsoft tenha as permissões necessárias para acesso a arquivos (ex: `Files.Read.All`, `Files.ReadWrite.All`).
|
|
- Verifique se a conexão OAuth inclui todos os escopos necessários.
|
|
|
|
**Problemas de Criação de Arquivos**
|
|
|
|
- Ao criar pastas de trabalho, certifique-se de que o `file_path` termine com extensão `.xlsx`.
|
|
- Verifique se você tem permissões de escrita no local de destino (OneDrive/SharePoint).
|
|
|
|
### Obtendo Ajuda
|
|
|
|
<Card title="Precisa de Ajuda?" icon="headset" href="mailto:support@crewai.com">
|
|
Entre em contato com nossa equipe de suporte para assistência com configuração
|
|
ou solução de problemas da integração Microsoft Excel.
|
|
</Card>
|