mirror of
https://github.com/crewAIInc/crewAI.git
synced 2025-12-16 04:18:35 +00:00
Compare commits
91 Commits
devin/1750
...
devin/1754
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
78750edd1f | ||
|
|
d20f52367f | ||
|
|
75752479c2 | ||
|
|
477bc1f09e | ||
|
|
66567bdc2f | ||
|
|
0b31bbe957 | ||
|
|
246cf588cd | ||
|
|
d590210a61 | ||
|
|
88ed91561f | ||
|
|
9a347ad458 | ||
|
|
34c3075fdb | ||
|
|
498e8dc6e8 | ||
|
|
cb522cf500 | ||
|
|
017acc74f5 | ||
|
|
fab86d197a | ||
|
|
864e9bfb76 | ||
|
|
d3b45d197c | ||
|
|
579153b070 | ||
|
|
b1fdcdfa6e | ||
|
|
18d76a270c | ||
|
|
30541239ad | ||
|
|
9a65573955 | ||
|
|
27623a1d01 | ||
|
|
2593242234 | ||
|
|
2ab6c31544 | ||
|
|
3c55c8a22a | ||
|
|
424433ff58 | ||
|
|
2fd99503ed | ||
|
|
942014962e | ||
|
|
2ab79a7dd5 | ||
|
|
27c449c9c4 | ||
|
|
9737333ffd | ||
|
|
bf248d5118 | ||
|
|
2490e8cd46 | ||
|
|
9b67e5a15f | ||
|
|
6ebb6c9b63 | ||
|
|
53f674be60 | ||
|
|
11717a5213 | ||
|
|
b6d699f764 | ||
|
|
5b15061b87 | ||
|
|
1b6b2b36d9 | ||
|
|
3ada4053bd | ||
|
|
e7a5747c6b | ||
|
|
eec1262d4f | ||
|
|
c6caa763d7 | ||
|
|
08fa3797ca | ||
|
|
bf8fa3232b | ||
|
|
a6e60a5d42 | ||
|
|
7b0f3aabd9 | ||
|
|
f071966951 | ||
|
|
318310bb7a | ||
|
|
34a03f882c | ||
|
|
a0fcc0c8d1 | ||
|
|
748c25451c | ||
|
|
a77dcdd419 | ||
|
|
68f5bdf0d9 | ||
|
|
7f83947020 | ||
|
|
ceb310bcde | ||
|
|
ae57e5723c | ||
|
|
ab39753a75 | ||
|
|
640e1a7bc2 | ||
|
|
e544ff8ba3 | ||
|
|
49c0144154 | ||
|
|
2ab002a5bf | ||
|
|
b7bf15681e | ||
|
|
af9c01f5d3 | ||
|
|
5a12b51ba2 | ||
|
|
576b8ff836 | ||
|
|
b35c3e8024 | ||
|
|
b09796cd3f | ||
|
|
e0b46492fa | ||
|
|
ece13fbda0 | ||
|
|
94a62d84e1 | ||
|
|
cdf8388b18 | ||
|
|
0f861338ef | ||
|
|
4d1aabf620 | ||
|
|
a50fae3a4b | ||
|
|
f6dfec61d6 | ||
|
|
060c486948 | ||
|
|
8b176d0598 | ||
|
|
c96d4a6823 | ||
|
|
59032817c7 | ||
|
|
e9d8a853ea | ||
|
|
463ea2b97f | ||
|
|
ec2903e5ee | ||
|
|
4364585ebc | ||
|
|
0a6b7c655b | ||
|
|
db1e9e9b9a | ||
|
|
d92382b6cf | ||
|
|
7c8f2a1325 | ||
|
|
a40447df29 |
1429
.cursorrules
Normal file
1429
.cursorrules
Normal file
File diff suppressed because it is too large
Load Diff
45
.github/workflows/mkdocs.yml
vendored
45
.github/workflows/mkdocs.yml
vendored
@@ -1,45 +0,0 @@
|
||||
name: Deploy MkDocs
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.10'
|
||||
|
||||
- name: Calculate requirements hash
|
||||
id: req-hash
|
||||
run: echo "::set-output name=hash::$(sha256sum requirements-doc.txt | awk '{print $1}')"
|
||||
|
||||
- name: Setup cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
key: mkdocs-material-${{ steps.req-hash.outputs.hash }}
|
||||
path: .cache
|
||||
restore-keys: |
|
||||
mkdocs-material-
|
||||
|
||||
- name: Install Requirements
|
||||
run: |
|
||||
sudo apt-get update &&
|
||||
sudo apt-get install pngquant &&
|
||||
pip install mkdocs-material mkdocs-material-extensions pillow cairosvg
|
||||
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GH_TOKEN }}
|
||||
|
||||
- name: Build and deploy MkDocs
|
||||
run: mkdocs gh-deploy --force
|
||||
20
.github/workflows/tests.yml
vendored
20
.github/workflows/tests.yml
vendored
@@ -7,14 +7,18 @@ permissions:
|
||||
|
||||
env:
|
||||
OPENAI_API_KEY: fake-api-key
|
||||
PYTHONUNBUFFERED: 1
|
||||
|
||||
jobs:
|
||||
tests:
|
||||
name: tests (${{ matrix.python-version }})
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
strategy:
|
||||
fail-fast: true
|
||||
matrix:
|
||||
python-version: ['3.10', '3.11', '3.12', '3.13']
|
||||
group: [1, 2, 3, 4, 5, 6, 7, 8]
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
@@ -23,6 +27,9 @@ jobs:
|
||||
uses: astral-sh/setup-uv@v3
|
||||
with:
|
||||
enable-cache: true
|
||||
cache-dependency-glob: |
|
||||
**/pyproject.toml
|
||||
**/uv.lock
|
||||
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
run: uv python install ${{ matrix.python-version }}
|
||||
@@ -30,5 +37,14 @@ jobs:
|
||||
- name: Install the project
|
||||
run: uv sync --dev --all-extras
|
||||
|
||||
- name: Run tests
|
||||
run: uv run pytest --block-network --timeout=60 -vv
|
||||
- name: Run tests (group ${{ matrix.group }} of 8)
|
||||
run: |
|
||||
uv run pytest \
|
||||
--block-network \
|
||||
--timeout=30 \
|
||||
-vv \
|
||||
--splits 8 \
|
||||
--group ${{ matrix.group }} \
|
||||
--durations=10 \
|
||||
-n auto \
|
||||
--maxfail=3
|
||||
|
||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -26,4 +26,5 @@ test_flow.html
|
||||
crewairules.mdc
|
||||
plan.md
|
||||
conceptual_plan.md
|
||||
build_image
|
||||
build_image
|
||||
chromadb-*.lock
|
||||
|
||||
@@ -1,473 +0,0 @@
|
||||
---
|
||||
title: Changelog
|
||||
description: View the latest updates and changes to CrewAI
|
||||
icon: timeline
|
||||
---
|
||||
|
||||
<Update label="2024-05-22" description="v0.121.0" tags={["Latest"]}>
|
||||
## Release Highlights
|
||||
<Frame>
|
||||
<img src="/images/releases/v01210.png" />
|
||||
</Frame>
|
||||
|
||||
<div style={{ textAlign: 'center', marginBottom: '1rem' }}>
|
||||
<a href="https://github.com/crewAIInc/crewAI/releases/tag/0.121.0">View on GitHub</a>
|
||||
</div>
|
||||
|
||||
**Core Improvements & Fixes**
|
||||
- Fixed encoding error when creating tools
|
||||
- Fixed failing llama test
|
||||
- Updated logging configuration for consistency
|
||||
- Enhanced telemetry initialization and event handling
|
||||
|
||||
**New Features & Enhancements**
|
||||
- Added **markdown attribute** to the Task class
|
||||
- Added **reasoning attribute** to the Agent class
|
||||
- Added **inject_date flag** to Agent for automatic date injection
|
||||
- Implemented **HallucinationGuardrail** (no-op with test coverage)
|
||||
|
||||
**Documentation & Guides**
|
||||
- Added documentation for **StagehandTool** and improved MDX structure
|
||||
- Added documentation for **MCP integration** and updated enterprise docs
|
||||
- Documented knowledge events and updated reasoning docs
|
||||
- Added stop parameter documentation
|
||||
- Fixed import references in doc examples (before_kickoff, after_kickoff)
|
||||
- General docs updates and restructuring for clarity
|
||||
</Update>
|
||||
|
||||
<Update label="2024-05-15" description="v0.120.1">
|
||||
## Release Highlights
|
||||
<Frame>
|
||||
<img src="/images/releases/v01201.png" />
|
||||
</Frame>
|
||||
|
||||
<div style={{ textAlign: 'center', marginBottom: '1rem' }}>
|
||||
<a href="https://github.com/crewAIInc/crewAI/releases/tag/0.120.1">View on GitHub</a>
|
||||
</div>
|
||||
|
||||
**Core Improvements & Fixes**
|
||||
- Fixed **interpolation with hyphens**
|
||||
</Update>
|
||||
|
||||
<Update label="2024-05-14" description="v0.120.0">
|
||||
## Release Highlights
|
||||
<Frame>
|
||||
<img src="/images/releases/v01200.png" />
|
||||
</Frame>
|
||||
|
||||
<div style={{ textAlign: 'center', marginBottom: '1rem' }}>
|
||||
<a href="https://github.com/crewAIInc/crewAI/releases/tag/0.120.0">View on GitHub</a>
|
||||
</div>
|
||||
|
||||
**Core Improvements & Fixes**
|
||||
- Enabled **full Ruff rule set** by default for stricter linting
|
||||
- Addressed race condition in FilteredStream using context managers
|
||||
- Fixed agent knowledge reset issue
|
||||
- Refactored agent fetching logic into utility module
|
||||
|
||||
**New Features & Enhancements**
|
||||
- Added support for **loading an Agent directly from a repository**
|
||||
- Enabled setting an empty context for Task
|
||||
- Enhanced Agent repository feedback and fixed Tool auto-import behavior
|
||||
- Introduced direct initialization of knowledge (bypassing knowledge_sources)
|
||||
|
||||
**Documentation & Guides**
|
||||
- Updated security.md for current security practices
|
||||
- Cleaned up Google setup section for clarity
|
||||
- Added link to AI Studio when entering Gemini key
|
||||
- Updated Arize Phoenix observability guide
|
||||
- Refreshed flow documentation
|
||||
</Update>
|
||||
|
||||
<Update label="2024-05-08" description="v0.119.0">
|
||||
## Release Highlights
|
||||
<Frame>
|
||||
<img src="/images/releases/v01190.png" />
|
||||
</Frame>
|
||||
|
||||
<div style={{ textAlign: 'center', marginBottom: '1rem' }}>
|
||||
<a href="https://github.com/crewAIInc/crewAI/releases/tag/0.119.0">View on GitHub</a>
|
||||
</div>
|
||||
|
||||
**Core Improvements & Fixes**
|
||||
- Improved test reliability by enhancing pytest handling for flaky tests
|
||||
- Fixed memory reset crash when embedding dimensions mismatch
|
||||
- Enabled parent flow identification for Crew and LiteAgent
|
||||
- Prevented telemetry-related crashes when unavailable
|
||||
- Upgraded **LiteLLM version** for better compatibility
|
||||
- Fixed llama converter tests by removing skip_external_api
|
||||
|
||||
**New Features & Enhancements**
|
||||
- Introduced **knowledge retrieval prompt re-writing** in Agent for improved tracking and debugging
|
||||
- Made LLM setup and quickstart guides model-agnostic
|
||||
|
||||
**Documentation & Guides**
|
||||
- Added advanced configuration docs for the RAG tool
|
||||
- Updated Windows troubleshooting guide
|
||||
- Refined documentation examples for better clarity
|
||||
- Fixed typos across docs and config files
|
||||
</Update>
|
||||
|
||||
<Update label="2024-04-28" description="v0.118.0">
|
||||
## Release Highlights
|
||||
<Frame>
|
||||
<img src="/images/releases/v01180.png" />
|
||||
</Frame>
|
||||
|
||||
<div style={{ textAlign: 'center', marginBottom: '1rem' }}>
|
||||
<a href="https://github.com/crewAIInc/crewAI/releases/tag/0.118.0">View on GitHub</a>
|
||||
</div>
|
||||
|
||||
**Core Improvements & Fixes**
|
||||
- Fixed issues with missing prompt or system templates
|
||||
- Removed global logging configuration to avoid unintended overrides
|
||||
- Renamed **TaskGuardrail to LLMGuardrail** for improved clarity
|
||||
- Downgraded litellm to version 1.167.1 for compatibility
|
||||
- Added missing init.py files to ensure proper module initialization
|
||||
|
||||
**New Features & Enhancements**
|
||||
- Added support for **no-code Guardrail creation** to simplify AI behavior controls
|
||||
|
||||
**Documentation & Guides**
|
||||
- Removed CrewStructuredTool from public documentation to reflect internal usage
|
||||
- Updated enterprise documentation and YouTube embed for improved onboarding experience
|
||||
</Update>
|
||||
|
||||
<Update label="2024-04-20" description="v0.117.0">
|
||||
## Release Highlights
|
||||
<Frame>
|
||||
<img src="/images/releases/v01170.png" />
|
||||
</Frame>
|
||||
|
||||
<div style={{ textAlign: 'center', marginBottom: '1rem' }}>
|
||||
<a href="https://github.com/crewAIInc/crewAI/releases/tag/0.117.0">View on GitHub</a>
|
||||
</div>
|
||||
|
||||
**New Features & Enhancements**
|
||||
- Added `result_as_answer` parameter support in `@tool` decorator.
|
||||
- Introduced support for new language models: GPT-4.1, Gemini-2.0, and Gemini-2.5 Pro.
|
||||
- Enhanced knowledge management capabilities.
|
||||
- Added Huggingface provider option in CLI.
|
||||
- Improved compatibility and CI support for Python 3.10+.
|
||||
|
||||
**Core Improvements & Fixes**
|
||||
- Fixed issues with incorrect template parameters and missing inputs.
|
||||
- Improved asynchronous flow handling with coroutine condition checks.
|
||||
- Enhanced memory management with isolated configuration and correct memory object copying.
|
||||
- Fixed initialization of lite agents with correct references.
|
||||
- Addressed Python type hint issues and removed redundant imports.
|
||||
- Updated event placement for improved tool usage tracking.
|
||||
- Raised explicit exceptions when flows fail.
|
||||
- Removed unused code and redundant comments from various modules.
|
||||
- Updated GitHub App token action to v2.
|
||||
|
||||
**Documentation & Guides**
|
||||
- Enhanced documentation structure, including enterprise deployment instructions.
|
||||
- Automatically create output folders for documentation generation.
|
||||
- Fixed broken link in WeaviateVectorSearchTool documentation.
|
||||
- Fixed guardrail documentation usage and import paths for JSON search tools.
|
||||
- Updated documentation for CodeInterpreterTool.
|
||||
- Improved SEO, contextual navigation, and error handling for documentation pages.
|
||||
</Update>
|
||||
|
||||
<Update label="2024-04-25" description="v0.117.1">
|
||||
## Release Highlights
|
||||
<Frame>
|
||||
<img src="/images/releases/v01171.png" />
|
||||
</Frame>
|
||||
|
||||
<div style={{ textAlign: 'center', marginBottom: '1rem' }}>
|
||||
<a href="https://github.com/crewAIInc/crewAI/releases/tag/0.117.1">View on GitHub</a>
|
||||
</div>
|
||||
|
||||
**Core Improvements & Fixes**
|
||||
- Upgraded **crewai-tools** to latest version
|
||||
- Upgraded **liteLLM** to latest version
|
||||
- Fixed **Mem0 OSS**
|
||||
</Update>
|
||||
|
||||
<Update label="2024-04-07" description="v0.114.0">
|
||||
## Release Highlights
|
||||
<Frame>
|
||||
<img src="/images/releases/v01140.png" />
|
||||
</Frame>
|
||||
|
||||
<div style={{ textAlign: 'center', marginBottom: '1rem' }}>
|
||||
<a href="https://github.com/crewAIInc/crewAI/releases/tag/0.114.0">View on GitHub</a>
|
||||
</div>
|
||||
|
||||
**New Features & Enhancements**
|
||||
- Agents as an atomic unit. (`Agent(...).kickoff()`)
|
||||
- Support for [Custom LLM implementations](https://docs.crewai.com/guides/advanced/custom-llm).
|
||||
- Integrated External Memory and [Opik observability](https://docs.crewai.com/how-to/opik-observability).
|
||||
- Enhanced YAML extraction.
|
||||
- Multimodal agent validation.
|
||||
- Added Secure fingerprints for agents and crews.
|
||||
|
||||
**Core Improvements & Fixes**
|
||||
- Improved serialization, agent copying, and Python compatibility.
|
||||
- Added wildcard support to `emit()`
|
||||
- Added support for additional router calls and context window adjustments.
|
||||
- Fixed typing issues, validation, and import statements.
|
||||
- Improved method performance.
|
||||
- Enhanced agent task handling, event emissions, and memory management.
|
||||
- Fixed CLI issues, conditional tasks, cloning behavior, and tool outputs.
|
||||
|
||||
**Documentation & Guides**
|
||||
- Improved documentation structure, theme, and organization.
|
||||
- Added guides for Local NVIDIA NIM with WSL2, W&B Weave, and Arize Phoenix.
|
||||
- Updated tool configuration examples, prompts, and observability docs.
|
||||
- Guide on using singular agents within Flows.
|
||||
</Update>
|
||||
|
||||
<Update label="2024-03-17" description="v0.108.0">
|
||||
## Release Highlights
|
||||
<Frame>
|
||||
<img src="/images/releases/v01080.png" />
|
||||
</Frame>
|
||||
|
||||
<div style={{ textAlign: 'center', marginBottom: '1rem' }}>
|
||||
<a href="https://github.com/crewAIInc/crewAI/releases/tag/0.108.0">View on GitHub</a>
|
||||
</div>
|
||||
|
||||
**New Features & Enhancements**
|
||||
- Converted tabs to spaces in `crew.py` template
|
||||
- Enhanced LLM Streaming Response Handling and Event System
|
||||
- Included `model_name`
|
||||
- Enhanced Event Listener with rich visualization and improved logging
|
||||
- Added fingerprints
|
||||
|
||||
**Bug Fixes**
|
||||
- Fixed Mistral issues
|
||||
- Fixed a bug in documentation
|
||||
- Fixed type check error in fingerprint property
|
||||
|
||||
**Documentation Updates**
|
||||
- Improved tool documentation
|
||||
- Updated installation guide for the `uv` tool package
|
||||
- Added instructions for upgrading crewAI with the `uv` tool
|
||||
- Added documentation for `ApifyActorsTool`
|
||||
</Update>
|
||||
|
||||
<Update label="2024-03-10" description="v0.105.0">
|
||||
## Release Highlights
|
||||
<Frame>
|
||||
<img src="/images/releases/v01050.png" />
|
||||
</Frame>
|
||||
|
||||
<div style={{ textAlign: 'center', marginBottom: '1rem' }}>
|
||||
<a href="https://github.com/crewAIInc/crewAI/releases/tag/0.105.0">View on GitHub</a>
|
||||
</div>
|
||||
|
||||
**Core Improvements & Fixes**
|
||||
- Fixed issues with missing template variables and user memory configuration
|
||||
- Improved async flow support and addressed agent response formatting
|
||||
- Enhanced memory reset functionality and fixed CLI memory commands
|
||||
- Fixed type issues, tool calling properties, and telemetry decoupling
|
||||
|
||||
**New Features & Enhancements**
|
||||
- Added Flow state export and improved state utilities
|
||||
- Enhanced agent knowledge setup with optional crew embedder
|
||||
- Introduced event emitter for better observability and LLM call tracking
|
||||
- Added support for Python 3.10 and ChatOllama from langchain_ollama
|
||||
- Integrated context window size support for the o3-mini model
|
||||
- Added support for multiple router calls
|
||||
|
||||
**Documentation & Guides**
|
||||
- Improved documentation layout and hierarchical structure
|
||||
- Added QdrantVectorSearchTool guide and clarified event listener usage
|
||||
- Fixed typos in prompts and updated Amazon Bedrock model listings
|
||||
</Update>
|
||||
|
||||
<Update label="2024-02-12" description="v0.102.0">
|
||||
## Release Highlights
|
||||
<Frame>
|
||||
<img src="/images/releases/v01020.png" />
|
||||
</Frame>
|
||||
|
||||
<div style={{ textAlign: 'center', marginBottom: '1rem' }}>
|
||||
<a href="https://github.com/crewAIInc/crewAI/releases/tag/0.102.0">View on GitHub</a>
|
||||
</div>
|
||||
|
||||
**Core Improvements & Fixes**
|
||||
- Enhanced LLM Support: Improved structured LLM output, parameter handling, and formatting for Anthropic models
|
||||
- Crew & Agent Stability: Fixed issues with cloning agents/crews using knowledge sources, multiple task outputs in conditional tasks, and ignored Crew task callbacks
|
||||
- Memory & Storage Fixes: Fixed short-term memory handling with Bedrock, ensured correct embedder initialization, and added a reset memories function in the crew class
|
||||
- Training & Execution Reliability: Fixed broken training and interpolation issues with dict and list input types
|
||||
|
||||
**New Features & Enhancements**
|
||||
- Advanced Knowledge Management: Improved naming conventions and enhanced embedding configuration with custom embedder support
|
||||
- Expanded Logging & Observability: Added JSON format support for logging and integrated MLflow tracing documentation
|
||||
- Data Handling Improvements: Updated excel_knowledge_source.py to process multi-tab files
|
||||
- General Performance & Codebase Clean-Up: Streamlined enterprise code alignment and resolved linting issues
|
||||
- Adding new tool: `QdrantVectorSearchTool`
|
||||
|
||||
**Documentation & Guides**
|
||||
- Updated AI & Memory Docs: Improved Bedrock, Google AI, and long-term memory documentation
|
||||
- Task & Workflow Clarity: Added "Human Input" row to Task Attributes, Langfuse guide, and FileWriterTool documentation
|
||||
- Fixed Various Typos & Formatting Issues
|
||||
</Update>
|
||||
|
||||
<Update label="2024-01-28" description="v0.100.0">
|
||||
## Release Highlights
|
||||
<Frame>
|
||||
<img src="/images/releases/v01000.png" />
|
||||
</Frame>
|
||||
|
||||
<div style={{ textAlign: 'center', marginBottom: '1rem' }}>
|
||||
<a href="https://github.com/crewAIInc/crewAI/releases/tag/0.100.0">View on GitHub</a>
|
||||
</div>
|
||||
|
||||
**Features**
|
||||
- Add Composio docs
|
||||
- Add SageMaker as a LLM provider
|
||||
|
||||
**Fixes**
|
||||
- Overall LLM connection issues
|
||||
- Using safe accessors on training
|
||||
- Add version check to crew_chat.py
|
||||
|
||||
**Documentation**
|
||||
- New docs for crewai chat
|
||||
- Improve formatting and clarity in CLI and Composio Tool docs
|
||||
</Update>
|
||||
|
||||
<Update label="2024-01-20" description="v0.98.0">
|
||||
## Release Highlights
|
||||
<Frame>
|
||||
<img src="/images/releases/v0980.png" />
|
||||
</Frame>
|
||||
|
||||
<div style={{ textAlign: 'center', marginBottom: '1rem' }}>
|
||||
<a href="https://github.com/crewAIInc/crewAI/releases/tag/0.98.0">View on GitHub</a>
|
||||
</div>
|
||||
|
||||
**Features**
|
||||
- Conversation crew v1
|
||||
- Add unique ID to flow states
|
||||
- Add @persist decorator with FlowPersistence interface
|
||||
|
||||
**Integrations**
|
||||
- Add SambaNova integration
|
||||
- Add NVIDIA NIM provider in cli
|
||||
- Introducing VoyageAI
|
||||
|
||||
**Fixes**
|
||||
- Fix API Key Behavior and Entity Handling in Mem0 Integration
|
||||
- Fixed core invoke loop logic and relevant tests
|
||||
- Make tool inputs actual objects and not strings
|
||||
- Add important missing parts to creating tools
|
||||
- Drop litellm version to prevent windows issue
|
||||
- Before kickoff if inputs are none
|
||||
- Fixed typos, nested pydantic model issue, and docling issues
|
||||
</Update>
|
||||
|
||||
<Update label="2024-01-04" description="v0.95.0">
|
||||
## Release Highlights
|
||||
<Frame>
|
||||
<img src="/images/releases/v0950.png" />
|
||||
</Frame>
|
||||
|
||||
<div style={{ textAlign: 'center', marginBottom: '1rem' }}>
|
||||
<a href="https://github.com/crewAIInc/crewAI/releases/tag/0.95.0">View on GitHub</a>
|
||||
</div>
|
||||
|
||||
**New Features**
|
||||
- Adding Multimodal Abilities to Crew
|
||||
- Programatic Guardrails
|
||||
- HITL multiple rounds
|
||||
- Gemini 2.0 Support
|
||||
- CrewAI Flows Improvements
|
||||
- Add Workflow Permissions
|
||||
- Add support for langfuse with litellm
|
||||
- Portkey Integration with CrewAI
|
||||
- Add interpolate_only method and improve error handling
|
||||
- Docling Support
|
||||
- Weviate Support
|
||||
|
||||
**Fixes**
|
||||
- output_file not respecting system path
|
||||
- disk I/O error when resetting short-term memory
|
||||
- CrewJSONEncoder now accepts enums
|
||||
- Python max version
|
||||
- Interpolation for output_file in Task
|
||||
- Handle coworker role name case/whitespace properly
|
||||
- Add tiktoken as explicit dependency and document Rust requirement
|
||||
- Include agent knowledge in planning process
|
||||
- Change storage initialization to None for KnowledgeStorage
|
||||
- Fix optional storage checks
|
||||
- include event emitter in flows
|
||||
- Docstring, Error Handling, and Type Hints Improvements
|
||||
- Suppressed userWarnings from litellm pydantic issues
|
||||
</Update>
|
||||
|
||||
<Update label="2024-12-05" description="v0.86.0">
|
||||
## Release Highlights
|
||||
<Frame>
|
||||
<img src="/images/releases/v0860.png" />
|
||||
</Frame>
|
||||
|
||||
<div style={{ textAlign: 'center', marginBottom: '1rem' }}>
|
||||
<a href="https://github.com/crewAIInc/crewAI/releases/tag/0.86.0">View on GitHub</a>
|
||||
</div>
|
||||
**Changes**
|
||||
- Remove all references to pipeline and pipeline router
|
||||
- Add Nvidia NIM as provider in Custom LLM
|
||||
- Add knowledge demo + improve knowledge docs
|
||||
- Add HITL multiple rounds of followup
|
||||
- New docs about yaml crew with decorators
|
||||
- Simplify template crew
|
||||
</Update>
|
||||
|
||||
<Update label="2024-12-04" description="v0.85.0">
|
||||
## Release Highlights
|
||||
<Frame>
|
||||
<img src="/images/releases/v0850.png" />
|
||||
</Frame>
|
||||
|
||||
<div style={{ textAlign: 'center', marginBottom: '1rem' }}>
|
||||
<a href="https://github.com/crewAIInc/crewAI/releases/tag/0.85.0">View on GitHub</a>
|
||||
</div>
|
||||
**Features**
|
||||
- Added knowledge to agent level
|
||||
- Feat/remove langchain
|
||||
- Improve typed task outputs
|
||||
- Log in to Tool Repository on crewai login
|
||||
|
||||
**Fixes**
|
||||
- Fixes issues with result as answer not properly exiting LLM loop
|
||||
- Fix missing key name when running with ollama provider
|
||||
- Fix spelling issue found
|
||||
|
||||
**Documentation**
|
||||
- Update readme for running mypy
|
||||
- Add knowledge to mint.json
|
||||
- Update Github actions
|
||||
- Update Agents docs to include two approaches for creating an agent
|
||||
- Improvements to LLM Configuration and Usage
|
||||
</Update>
|
||||
|
||||
<Update label="2024-11-25" description="v0.83.0">
|
||||
**New Features**
|
||||
- New before_kickoff and after_kickoff crew callbacks
|
||||
- Support to pre-seed agents with Knowledge
|
||||
- Add support for retrieving user preferences and memories using Mem0
|
||||
|
||||
**Fixes**
|
||||
- Fix Async Execution
|
||||
- Upgrade chroma and adjust embedder function generator
|
||||
- Update CLI Watson supported models + docs
|
||||
- Reduce level for Bandit
|
||||
- Fixing all tests
|
||||
|
||||
**Documentation**
|
||||
- Update Docs
|
||||
</Update>
|
||||
|
||||
<Update label="2024-11-13" description="v0.80.0">
|
||||
**Fixes**
|
||||
- Fixing Tokens callback replacement bug
|
||||
- Fixing Step callback issue
|
||||
- Add cached prompt tokens info on usage metrics
|
||||
- Fix crew_train_success test
|
||||
</Update>
|
||||
@@ -1,67 +0,0 @@
|
||||
---
|
||||
title: Training
|
||||
description: Learn how to train your CrewAI agents by giving them feedback early on and get consistent results.
|
||||
icon: dumbbell
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
The training feature in CrewAI allows you to train your AI agents using the command-line interface (CLI).
|
||||
By running the command `crewai train -n <n_iterations>`, you can specify the number of iterations for the training process.
|
||||
|
||||
During training, CrewAI utilizes techniques to optimize the performance of your agents along with human feedback.
|
||||
This helps the agents improve their understanding, decision-making, and problem-solving abilities.
|
||||
|
||||
### Training Your Crew Using the CLI
|
||||
|
||||
To use the training feature, follow these steps:
|
||||
|
||||
1. Open your terminal or command prompt.
|
||||
2. Navigate to the directory where your CrewAI project is located.
|
||||
3. Run the following command:
|
||||
|
||||
```shell
|
||||
crewai train -n <n_iterations> <filename> (optional)
|
||||
```
|
||||
<Tip>
|
||||
Replace `<n_iterations>` with the desired number of training iterations and `<filename>` with the appropriate filename ending with `.pkl`.
|
||||
</Tip>
|
||||
|
||||
### Training Your Crew Programmatically
|
||||
|
||||
To train your crew programmatically, use the following steps:
|
||||
|
||||
1. Define the number of iterations for training.
|
||||
2. Specify the input parameters for the training process.
|
||||
3. Execute the training command within a try-except block to handle potential errors.
|
||||
|
||||
```python Code
|
||||
n_iterations = 2
|
||||
inputs = {"topic": "CrewAI Training"}
|
||||
filename = "your_model.pkl"
|
||||
|
||||
try:
|
||||
YourCrewName_Crew().crew().train(
|
||||
n_iterations=n_iterations,
|
||||
inputs=inputs,
|
||||
filename=filename
|
||||
)
|
||||
|
||||
except Exception as e:
|
||||
raise Exception(f"An error occurred while training the crew: {e}")
|
||||
```
|
||||
|
||||
### Key Points to Note
|
||||
|
||||
- **Positive Integer Requirement:** Ensure that the number of iterations (`n_iterations`) is a positive integer. The code will raise a `ValueError` if this condition is not met.
|
||||
- **Filename Requirement:** Ensure that the filename ends with `.pkl`. The code will raise a `ValueError` if this condition is not met.
|
||||
- **Error Handling:** The code handles subprocess errors and unexpected exceptions, providing error messages to the user.
|
||||
|
||||
It is important to note that the training process may take some time, depending on the complexity of your agents and will also require your feedback on each iteration.
|
||||
|
||||
Once the training is complete, your agents will be equipped with enhanced capabilities and knowledge, ready to tackle complex tasks and provide more consistent and valuable insights.
|
||||
|
||||
Remember to regularly update and retrain your agents to ensure they stay up-to-date with the latest information and advancements in the field.
|
||||
|
||||
Happy training with CrewAI! 🚀
|
||||
|
||||
1008
docs/docs.json
1008
docs/docs.json
File diff suppressed because it is too large
Load Diff
@@ -71,7 +71,7 @@ There are two ways to create agents in CrewAI: using **YAML configuration (recom
|
||||
|
||||
Using YAML configuration provides a cleaner, more maintainable way to define agents. We strongly recommend using this approach in your CrewAI projects.
|
||||
|
||||
After creating your CrewAI project as outlined in the [Installation](/installation) section, navigate to the `src/latest_ai_development/config/agents.yaml` file and modify the template to match your requirements.
|
||||
After creating your CrewAI project as outlined in the [Installation](/en/installation) section, navigate to the `src/latest_ai_development/config/agents.yaml` file and modify the template to match your requirements.
|
||||
|
||||
<Note>
|
||||
Variables in your YAML files (like `{topic}`) will be replaced with values from your inputs when running the crew:
|
||||
@@ -295,6 +295,11 @@ multimodal_agent = Agent(
|
||||
- `"safe"`: Uses Docker (recommended for production)
|
||||
- `"unsafe"`: Direct execution (use only in trusted environments)
|
||||
|
||||
<Note>
|
||||
This runs a default Docker image. If you want to configure the docker image, the checkout the Code Interpreter Tool in the tools section.
|
||||
Add the code interpreter tool as a tool in the agent as a tool parameter.
|
||||
</Note>
|
||||
|
||||
#### Advanced Features
|
||||
- `multimodal`: Enable multimodal capabilities for processing text and visual content
|
||||
- `reasoning`: Enable agent to reflect and create plans before executing tasks
|
||||
@@ -307,7 +312,7 @@ multimodal_agent = Agent(
|
||||
|
||||
<Note>
|
||||
When using custom templates, ensure that both `system_template` and `prompt_template` are defined. The `response_template` is optional but recommended for consistent output formatting.
|
||||
</Note>
|
||||
</Note>
|
||||
|
||||
<Note>
|
||||
When using custom templates, you can use variables like `{role}`, `{goal}`, and `{backstory}` in your templates. These will be automatically populated during execution.
|
||||
@@ -420,7 +425,7 @@ strict_agent = Agent(
|
||||
```python Code
|
||||
# Perfect for document processing
|
||||
document_processor = Agent(
|
||||
role="Document Analyst",
|
||||
role="Document Analyst",
|
||||
goal="Extract insights from large research papers",
|
||||
backstory="Expert at analyzing extensive documentation",
|
||||
respect_context_window=True, # Handle large documents gracefully
|
||||
@@ -521,6 +526,103 @@ agent = Agent(
|
||||
The context window management feature works automatically in the background. You don't need to call any special functions - just set `respect_context_window` to your preferred behavior and CrewAI handles the rest!
|
||||
</Note>
|
||||
|
||||
## Direct Agent Interaction with `kickoff()`
|
||||
|
||||
Agents can be used directly without going through a task or crew workflow using the `kickoff()` method. This provides a simpler way to interact with an agent when you don't need the full crew orchestration capabilities.
|
||||
|
||||
### How `kickoff()` Works
|
||||
|
||||
The `kickoff()` method allows you to send messages directly to an agent and get a response, similar to how you would interact with an LLM but with all the agent's capabilities (tools, reasoning, etc.).
|
||||
|
||||
```python Code
|
||||
from crewai import Agent
|
||||
from crewai_tools import SerperDevTool
|
||||
|
||||
# Create an agent
|
||||
researcher = Agent(
|
||||
role="AI Technology Researcher",
|
||||
goal="Research the latest AI developments",
|
||||
tools=[SerperDevTool()],
|
||||
verbose=True
|
||||
)
|
||||
|
||||
# Use kickoff() to interact directly with the agent
|
||||
result = researcher.kickoff("What are the latest developments in language models?")
|
||||
|
||||
# Access the raw response
|
||||
print(result.raw)
|
||||
```
|
||||
|
||||
### Parameters and Return Values
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| :---------------- | :---------------------------------- | :------------------------------------------------------------------------ |
|
||||
| `messages` | `Union[str, List[Dict[str, str]]]` | Either a string query or a list of message dictionaries with role/content |
|
||||
| `response_format` | `Optional[Type[Any]]` | Optional Pydantic model for structured output |
|
||||
|
||||
The method returns a `LiteAgentOutput` object with the following properties:
|
||||
|
||||
- `raw`: String containing the raw output text
|
||||
- `pydantic`: Parsed Pydantic model (if a `response_format` was provided)
|
||||
- `agent_role`: Role of the agent that produced the output
|
||||
- `usage_metrics`: Token usage metrics for the execution
|
||||
|
||||
### Structured Output
|
||||
|
||||
You can get structured output by providing a Pydantic model as the `response_format`:
|
||||
|
||||
```python Code
|
||||
from pydantic import BaseModel
|
||||
from typing import List
|
||||
|
||||
class ResearchFindings(BaseModel):
|
||||
main_points: List[str]
|
||||
key_technologies: List[str]
|
||||
future_predictions: str
|
||||
|
||||
# Get structured output
|
||||
result = researcher.kickoff(
|
||||
"Summarize the latest developments in AI for 2025",
|
||||
response_format=ResearchFindings
|
||||
)
|
||||
|
||||
# Access structured data
|
||||
print(result.pydantic.main_points)
|
||||
print(result.pydantic.future_predictions)
|
||||
```
|
||||
|
||||
### Multiple Messages
|
||||
|
||||
You can also provide a conversation history as a list of message dictionaries:
|
||||
|
||||
```python Code
|
||||
messages = [
|
||||
{"role": "user", "content": "I need information about large language models"},
|
||||
{"role": "assistant", "content": "I'd be happy to help with that! What specifically would you like to know?"},
|
||||
{"role": "user", "content": "What are the latest developments in 2025?"}
|
||||
]
|
||||
|
||||
result = researcher.kickoff(messages)
|
||||
```
|
||||
|
||||
### Async Support
|
||||
|
||||
An asynchronous version is available via `kickoff_async()` with the same parameters:
|
||||
|
||||
```python Code
|
||||
import asyncio
|
||||
|
||||
async def main():
|
||||
result = await researcher.kickoff_async("What are the latest developments in AI?")
|
||||
print(result.raw)
|
||||
|
||||
asyncio.run(main())
|
||||
```
|
||||
|
||||
<Note>
|
||||
The `kickoff()` method uses a `LiteAgent` internally, which provides a simpler execution flow while preserving all of the agent's configuration (role, goal, backstory, tools, etc.).
|
||||
</Note>
|
||||
|
||||
## Important Considerations and Best Practices
|
||||
|
||||
### Security and Code Execution
|
||||
@@ -4,6 +4,8 @@ description: Learn how to use the CrewAI CLI to interact with CrewAI.
|
||||
icon: terminal
|
||||
---
|
||||
|
||||
<Warning>Since release 0.140.0, CrewAI Enterprise started a process of migrating their login provider. As such, the authentication flow via CLI was updated. Users that use Google to login, or that created their account after July 3rd, 2025 will be unable to log in with older versions of the `crewai` library.</Warning>
|
||||
|
||||
## Overview
|
||||
|
||||
The CrewAI CLI provides a set of commands to interact with CrewAI, allowing you to create, train, run, and manage crews & flows.
|
||||
@@ -86,7 +88,7 @@ crewai replay [OPTIONS]
|
||||
- `-t, --task_id TEXT`: Replay the crew from this task ID, including all subsequent tasks
|
||||
|
||||
Example:
|
||||
```shell Terminal
|
||||
```shell Terminal
|
||||
crewai replay -t task_123456
|
||||
```
|
||||
|
||||
@@ -132,7 +134,7 @@ crewai test [OPTIONS]
|
||||
- `-m, --model TEXT`: LLM Model to run the tests on the Crew (default: "gpt-4o-mini")
|
||||
|
||||
Example:
|
||||
```shell Terminal
|
||||
```shell Terminal
|
||||
crewai test -n 5 -m gpt-3.5-turbo
|
||||
```
|
||||
|
||||
@@ -149,7 +151,7 @@ Starting from version 0.103.0, the `crewai run` command can be used to run both
|
||||
</Note>
|
||||
|
||||
<Note>
|
||||
Make sure to run these commands from the directory where your CrewAI project is set up.
|
||||
Make sure to run these commands from the directory where your CrewAI project is set up.
|
||||
Some commands may require additional configuration or setup within your project structure.
|
||||
</Note>
|
||||
|
||||
@@ -186,10 +188,7 @@ def crew(self) -> Crew:
|
||||
Deploy the crew or flow to [CrewAI Enterprise](https://app.crewai.com).
|
||||
|
||||
- **Authentication**: You need to be authenticated to deploy to CrewAI Enterprise.
|
||||
```shell Terminal
|
||||
crewai signup
|
||||
```
|
||||
If you already have an account, you can login with:
|
||||
You can login or create an account with:
|
||||
```shell Terminal
|
||||
crewai login
|
||||
```
|
||||
@@ -236,7 +235,7 @@ You must be authenticated to CrewAI Enterprise to use these organization managem
|
||||
- **Deploy the Crew**: Once you are authenticated, you can deploy your crew or flow to CrewAI Enterprise.
|
||||
```shell Terminal
|
||||
crewai deploy push
|
||||
```
|
||||
```
|
||||
- Initiates the deployment process on the CrewAI Enterprise platform.
|
||||
- Upon successful initiation, it will output the Deployment created successfully! message along with the Deployment Name and a unique Deployment ID (UUID).
|
||||
|
||||
@@ -285,13 +284,13 @@ Watch this video tutorial for a step-by-step demonstration of deploying your cre
|
||||
|
||||
### 11. API Keys
|
||||
|
||||
When running ```crewai create crew``` command, the CLI will first show you the top 5 most common LLM providers and ask you to select one.
|
||||
When running ```crewai create crew``` command, the CLI will show you a list of available LLM providers to choose from, followed by model selection for your chosen provider.
|
||||
|
||||
Once you've selected an LLM provider, you will be prompted for API keys.
|
||||
Once you've selected an LLM provider and model, you will be prompted for API keys.
|
||||
|
||||
#### Initial API key providers
|
||||
#### Available LLM Providers
|
||||
|
||||
The CLI will initially prompt for API keys for the following services:
|
||||
Here's a list of the most popular LLM providers suggested by the CLI:
|
||||
|
||||
* OpenAI
|
||||
* Groq
|
||||
@@ -299,11 +298,11 @@ The CLI will initially prompt for API keys for the following services:
|
||||
* Google Gemini
|
||||
* SambaNova
|
||||
|
||||
When you select a provider, the CLI will prompt you to enter your API key.
|
||||
When you select a provider, the CLI will then show you available models for that provider and prompt you to enter your API key.
|
||||
|
||||
#### Other Options
|
||||
|
||||
If you select option 6, you will be able to select from a list of LiteLLM supported providers.
|
||||
If you select "other", you will be able to select from a list of LiteLLM supported providers.
|
||||
|
||||
When you select a provider, the CLI will prompt you to enter the Key name and the API key.
|
||||
|
||||
@@ -311,5 +310,81 @@ See the following link for each provider's key name:
|
||||
|
||||
* [LiteLLM Providers](https://docs.litellm.ai/docs/providers)
|
||||
|
||||
### 12. Configuration Management
|
||||
|
||||
Manage CLI configuration settings for CrewAI.
|
||||
|
||||
```shell Terminal
|
||||
crewai config [COMMAND] [OPTIONS]
|
||||
```
|
||||
|
||||
#### Commands:
|
||||
|
||||
- `list`: Display all CLI configuration parameters
|
||||
```shell Terminal
|
||||
crewai config list
|
||||
```
|
||||
|
||||
- `set`: Set a CLI configuration parameter
|
||||
```shell Terminal
|
||||
crewai config set <key> <value>
|
||||
```
|
||||
|
||||
- `reset`: Reset all CLI configuration parameters to default values
|
||||
```shell Terminal
|
||||
crewai config reset
|
||||
```
|
||||
|
||||
#### Available Configuration Parameters
|
||||
|
||||
- `enterprise_base_url`: Base URL of the CrewAI Enterprise instance
|
||||
- `oauth2_provider`: OAuth2 provider used for authentication (e.g., workos, okta, auth0)
|
||||
- `oauth2_audience`: OAuth2 audience value, typically used to identify the target API or resource
|
||||
- `oauth2_client_id`: OAuth2 client ID issued by the provider, used during authentication requests
|
||||
- `oauth2_domain`: OAuth2 provider's domain (e.g., your-org.auth0.com) used for issuing tokens
|
||||
|
||||
#### Examples
|
||||
|
||||
Display current configuration:
|
||||
```shell Terminal
|
||||
crewai config list
|
||||
```
|
||||
|
||||
Example output:
|
||||
```
|
||||
CrewAI CLI Configuration
|
||||
┏━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
|
||||
┃ Setting ┃ Value ┃ Description ┃
|
||||
┡━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
|
||||
│ enterprise_base_url│ https://app.crewai.com │ Base URL of the CrewAI Enterprise instance │
|
||||
│ org_name │ Not set │ Name of the currently active organization │
|
||||
│ org_uuid │ Not set │ UUID of the currently active organization │
|
||||
│ oauth2_provider │ workos │ OAuth2 provider used for authentication (e.g., workos, okta, auth0). │
|
||||
│ oauth2_audience │ client_01YYY │ OAuth2 audience value, typically used to identify the target API or resource. │
|
||||
│ oauth2_client_id │ client_01XXX │ OAuth2 client ID issued by the provider, used during authentication requests. │
|
||||
│ oauth2_domain │ login.crewai.com │ OAuth2 provider's domain (e.g., your-org.auth0.com) used for issuing tokens. │
|
||||
```
|
||||
|
||||
Set the enterprise base URL:
|
||||
```shell Terminal
|
||||
crewai config set enterprise_base_url https://my-enterprise.crewai.com
|
||||
```
|
||||
|
||||
Set OAuth2 provider:
|
||||
```shell Terminal
|
||||
crewai config set oauth2_provider auth0
|
||||
```
|
||||
|
||||
Set OAuth2 domain:
|
||||
```shell Terminal
|
||||
crewai config set oauth2_domain my-company.auth0.com
|
||||
```
|
||||
|
||||
Reset all configuration to defaults:
|
||||
```shell Terminal
|
||||
crewai config reset
|
||||
```
|
||||
|
||||
<Note>
|
||||
Configuration settings are stored in `~/.config/crewai/settings.json`. Some settings like organization name and UUID are read-only and managed through authentication and organization commands. Tool repository related settings are hidden and cannot be set directly by users.
|
||||
</Note>
|
||||
@@ -32,6 +32,7 @@ A crew in crewAI represents a collaborative group of agents working together to
|
||||
| **Prompt File** _(optional)_ | `prompt_file` | Path to the prompt JSON file to be used for the crew. |
|
||||
| **Planning** *(optional)* | `planning` | Adds planning ability to the Crew. When activated before each Crew iteration, all Crew data is sent to an AgentPlanner that will plan the tasks and this plan will be added to each task description. |
|
||||
| **Planning LLM** *(optional)* | `planning_llm` | The language model used by the AgentPlanner in a planning process. |
|
||||
| **Knowledge Sources** _(optional)_ | `knowledge_sources` | Knowledge sources available at the crew level, accessible to all the agents. |
|
||||
|
||||
<Tip>
|
||||
**Crew Max RPM**: The `max_rpm` attribute sets the maximum number of requests per minute the crew can perform to avoid rate limits and will override individual agents' `max_rpm` settings if you set it.
|
||||
@@ -45,7 +46,7 @@ There are two ways to create crews in CrewAI: using **YAML configuration (recomm
|
||||
|
||||
Using YAML configuration provides a cleaner, more maintainable way to define crews and is consistent with how agents and tasks are defined in CrewAI projects.
|
||||
|
||||
After creating your CrewAI project as outlined in the [Installation](/installation) section, you can define your crew in a class that inherits from `CrewBase` and uses decorators to define agents, tasks, and the crew itself.
|
||||
After creating your CrewAI project as outlined in the [Installation](/en/installation) section, you can define your crew in a class that inherits from `CrewBase` and uses decorators to define agents, tasks, and the crew itself.
|
||||
|
||||
#### Example Crew Class with Decorators
|
||||
|
||||
@@ -66,8 +67,8 @@ class YourCrewName:
|
||||
# To see an example agent and task defined in YAML, checkout the following:
|
||||
# - Task: https://docs.crewai.com/concepts/tasks#yaml-configuration-recommended
|
||||
# - Agents: https://docs.crewai.com/concepts/agents#yaml-configuration-recommended
|
||||
agents_config = 'config/agents.yaml'
|
||||
tasks_config = 'config/tasks.yaml'
|
||||
agents_config = 'config/agents.yaml'
|
||||
tasks_config = 'config/tasks.yaml'
|
||||
|
||||
@before_kickoff
|
||||
def prepare_inputs(self, inputs):
|
||||
@@ -111,7 +112,7 @@ class YourCrewName:
|
||||
def crew(self) -> Crew:
|
||||
return Crew(
|
||||
agents=self.agents, # Automatically collected by the @agent decorator
|
||||
tasks=self.tasks, # Automatically collected by the @task decorator.
|
||||
tasks=self.tasks, # Automatically collected by the @task decorator.
|
||||
process=Process.sequential,
|
||||
verbose=True,
|
||||
)
|
||||
@@ -233,6 +233,11 @@ CrewAI provides a wide range of events that you can listen for:
|
||||
- **KnowledgeQueryFailedEvent**: Emitted when a knowledge query fails
|
||||
- **KnowledgeSearchQueryFailedEvent**: Emitted when a knowledge search query fails
|
||||
|
||||
### LLM Guardrail Events
|
||||
|
||||
- **LLMGuardrailStartedEvent**: Emitted when a guardrail validation starts. Contains details about the guardrail being applied and retry count.
|
||||
- **LLMGuardrailCompletedEvent**: Emitted when a guardrail validation completes. Contains details about validation success/failure, results, and error messages if any.
|
||||
|
||||
### Flow Events
|
||||
|
||||
- **FlowCreatedEvent**: Emitted when a Flow is created
|
||||
@@ -250,6 +255,17 @@ CrewAI provides a wide range of events that you can listen for:
|
||||
- **LLMCallFailedEvent**: Emitted when an LLM call fails
|
||||
- **LLMStreamChunkEvent**: Emitted for each chunk received during streaming LLM responses
|
||||
|
||||
### Memory Events
|
||||
|
||||
- **MemoryQueryStartedEvent**: Emitted when a memory query is started. Contains the query, limit, and optional score threshold.
|
||||
- **MemoryQueryCompletedEvent**: Emitted when a memory query is completed successfully. Contains the query, results, limit, score threshold, and query execution time.
|
||||
- **MemoryQueryFailedEvent**: Emitted when a memory query fails. Contains the query, limit, score threshold, and error message.
|
||||
- **MemorySaveStartedEvent**: Emitted when a memory save operation is started. Contains the value to be saved, metadata, and optional agent role.
|
||||
- **MemorySaveCompletedEvent**: Emitted when a memory save operation is completed successfully. Contains the saved value, metadata, agent role, and save execution time.
|
||||
- **MemorySaveFailedEvent**: Emitted when a memory save operation fails. Contains the value, metadata, agent role, and error message.
|
||||
- **MemoryRetrievalStartedEvent**: Emitted when memory retrieval for a task prompt starts. Contains the optional task ID.
|
||||
- **MemoryRetrievalCompletedEvent**: Emitted when memory retrieval for a task prompt completes successfully. Contains the task ID, memory content, and retrieval execution time.
|
||||
|
||||
## Event Handler Structure
|
||||
|
||||
Each event handler receives two parameters:
|
||||
@@ -270,7 +270,7 @@ In this section, you'll find detailed examples that help you select, configure,
|
||||
from crewai import LLM
|
||||
|
||||
llm = LLM(
|
||||
model="gemini/gemini-1.5-pro-latest",
|
||||
model="gemini-1.5-pro-latest", # or vertex_ai/gemini-1.5-pro-latest
|
||||
temperature=0.7,
|
||||
vertex_credentials=vertex_credentials_json
|
||||
)
|
||||
@@ -684,6 +684,28 @@ In this section, you'll find detailed examples that help you select, configure,
|
||||
- openrouter/deepseek/deepseek-chat
|
||||
</Info>
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="Nebius AI Studio">
|
||||
Set the following environment variables in your `.env` file:
|
||||
```toml Code
|
||||
NEBIUS_API_KEY=<your-api-key>
|
||||
```
|
||||
|
||||
Example usage in your CrewAI project:
|
||||
```python Code
|
||||
llm = LLM(
|
||||
model="nebius/Qwen/Qwen3-30B-A3B"
|
||||
)
|
||||
```
|
||||
|
||||
<Info>
|
||||
Nebius AI Studio features:
|
||||
- Large collection of open source models
|
||||
- Higher rate limits
|
||||
- Competitive pricing
|
||||
- Good balance of speed and quality
|
||||
</Info>
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
## Streaming Responses
|
||||
@@ -727,9 +749,58 @@ CrewAI supports streaming responses from LLMs, allowing your application to rece
|
||||
```
|
||||
|
||||
<Tip>
|
||||
[Click here](https://docs.crewai.com/concepts/event-listener#event-listeners) for more details
|
||||
[Click here](https://docs.crewai.com/concepts/event-listener#event-listeners) for more details
|
||||
</Tip>
|
||||
</Tab>
|
||||
|
||||
<Tab title="Agent & Task Tracking">
|
||||
All LLM events in CrewAI include agent and task information, allowing you to track and filter LLM interactions by specific agents or tasks:
|
||||
|
||||
```python
|
||||
from crewai import LLM, Agent, Task, Crew
|
||||
from crewai.utilities.events import LLMStreamChunkEvent
|
||||
from crewai.utilities.events.base_event_listener import BaseEventListener
|
||||
|
||||
class MyCustomListener(BaseEventListener):
|
||||
def setup_listeners(self, crewai_event_bus):
|
||||
@crewai_event_bus.on(LLMStreamChunkEvent)
|
||||
def on_llm_stream_chunk(source, event):
|
||||
if researcher.id == event.agent_id:
|
||||
print("\n==============\n Got event:", event, "\n==============\n")
|
||||
|
||||
|
||||
my_listener = MyCustomListener()
|
||||
|
||||
llm = LLM(model="gpt-4o-mini", temperature=0, stream=True)
|
||||
|
||||
researcher = Agent(
|
||||
role="About User",
|
||||
goal="You know everything about the user.",
|
||||
backstory="""You are a master at understanding people and their preferences.""",
|
||||
llm=llm,
|
||||
)
|
||||
|
||||
search = Task(
|
||||
description="Answer the following questions about the user: {question}",
|
||||
expected_output="An answer to the question.",
|
||||
agent=researcher,
|
||||
)
|
||||
|
||||
crew = Crew(agents=[researcher], tasks=[search])
|
||||
|
||||
result = crew.kickoff(
|
||||
inputs={"question": "..."}
|
||||
)
|
||||
```
|
||||
|
||||
<Info>
|
||||
This feature is particularly useful for:
|
||||
- Debugging specific agent behaviors
|
||||
- Logging LLM usage by task type
|
||||
- Auditing which agents are making what types of LLM calls
|
||||
- Performance monitoring of specific tasks
|
||||
</Info>
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
## Structured LLM Calls
|
||||
@@ -825,7 +896,7 @@ Learn how to get the most out of your LLM configuration:
|
||||
Remember to regularly monitor your token usage and adjust your configuration as needed to optimize costs and performance.
|
||||
</Info>
|
||||
</Accordion>
|
||||
|
||||
|
||||
<Accordion title="Drop Additional Parameters">
|
||||
CrewAI internally uses Litellm for LLM calls, which allows you to drop additional parameters that are not needed for your specific use case. This can help simplify your code and reduce the complexity of your LLM configuration.
|
||||
For example, if you don't need to send the <code>stop</code> parameter, you can simply omit it from your LLM call:
|
||||
@@ -9,7 +9,7 @@ icon: database
|
||||
The CrewAI framework provides a sophisticated memory system designed to significantly enhance AI agent capabilities. CrewAI offers **three distinct memory approaches** that serve different use cases:
|
||||
|
||||
1. **Basic Memory System** - Built-in short-term, long-term, and entity memory
|
||||
2. **User Memory** - User-specific memory with Mem0 integration (legacy approach)
|
||||
2. **User Memory** - User-specific memory with Mem0 integration (legacy approach)
|
||||
3. **External Memory** - Standalone external memory providers (new approach)
|
||||
|
||||
## Memory System Components
|
||||
@@ -62,7 +62,7 @@ By default, CrewAI uses the `appdirs` library to determine storage locations fol
|
||||
```
|
||||
~/Library/Application Support/CrewAI/{project_name}/
|
||||
├── knowledge/ # Knowledge base ChromaDB files
|
||||
├── short_term_memory/ # Short-term memory ChromaDB files
|
||||
├── short_term_memory/ # Short-term memory ChromaDB files
|
||||
├── long_term_memory/ # Long-term memory ChromaDB files
|
||||
├── entities/ # Entity memory ChromaDB files
|
||||
└── long_term_memory_storage.db # SQLite database
|
||||
@@ -252,7 +252,7 @@ chroma_path = os.path.join(storage_path, "knowledge")
|
||||
if os.path.exists(chroma_path):
|
||||
client = chromadb.PersistentClient(path=chroma_path)
|
||||
collections = client.list_collections()
|
||||
|
||||
|
||||
print("ChromaDB Collections:")
|
||||
for collection in collections:
|
||||
print(f" - {collection.name}: {collection.count()} documents")
|
||||
@@ -269,7 +269,7 @@ crew = Crew(agents=[...], tasks=[...], memory=True)
|
||||
|
||||
# Reset specific memory types
|
||||
crew.reset_memories(command_type='short') # Short-term memory
|
||||
crew.reset_memories(command_type='long') # Long-term memory
|
||||
crew.reset_memories(command_type='long') # Long-term memory
|
||||
crew.reset_memories(command_type='entity') # Entity memory
|
||||
crew.reset_memories(command_type='knowledge') # Knowledge storage
|
||||
```
|
||||
@@ -596,7 +596,7 @@ providers_to_test = [
|
||||
{
|
||||
"name": "Ollama",
|
||||
"config": {
|
||||
"provider": "ollama",
|
||||
"provider": "ollama",
|
||||
"config": {"model": "mxbai-embed-large"}
|
||||
}
|
||||
}
|
||||
@@ -604,7 +604,7 @@ providers_to_test = [
|
||||
|
||||
for provider in providers_to_test:
|
||||
print(f"\nTesting {provider['name']} embeddings...")
|
||||
|
||||
|
||||
# Create crew with specific embedder
|
||||
crew = Crew(
|
||||
agents=[...],
|
||||
@@ -612,7 +612,7 @@ for provider in providers_to_test:
|
||||
memory=True,
|
||||
embedder=provider['config']
|
||||
)
|
||||
|
||||
|
||||
# Run your test and measure performance
|
||||
result = crew.kickoff()
|
||||
print(f"{provider['name']} completed successfully")
|
||||
@@ -623,7 +623,7 @@ for provider in providers_to_test:
|
||||
**Model not found errors:**
|
||||
```python
|
||||
# Verify model availability
|
||||
from crewai.utilities.embedding_configurator import EmbeddingConfigurator
|
||||
from crewai.rag.embeddings.configurator import EmbeddingConfigurator
|
||||
|
||||
configurator = EmbeddingConfigurator()
|
||||
try:
|
||||
@@ -655,17 +655,17 @@ import time
|
||||
|
||||
def test_embedding_performance(embedder_config, test_text="This is a test document"):
|
||||
start_time = time.time()
|
||||
|
||||
|
||||
crew = Crew(
|
||||
agents=[...],
|
||||
tasks=[...],
|
||||
memory=True,
|
||||
embedder=embedder_config
|
||||
)
|
||||
|
||||
|
||||
# Simulate memory operation
|
||||
crew.kickoff()
|
||||
|
||||
|
||||
end_time = time.time()
|
||||
return end_time - start_time
|
||||
|
||||
@@ -676,7 +676,7 @@ openai_time = test_embedding_performance({
|
||||
})
|
||||
|
||||
ollama_time = test_embedding_performance({
|
||||
"provider": "ollama",
|
||||
"provider": "ollama",
|
||||
"config": {"model": "mxbai-embed-large"}
|
||||
})
|
||||
|
||||
@@ -712,7 +712,7 @@ crew = Crew(
|
||||
memory_config={
|
||||
"provider": "mem0",
|
||||
"config": {"user_id": "john"},
|
||||
"user_memory": {} # Required - triggers user memory initialization
|
||||
"user_memory": {} # DEPRECATED: Will be removed in version 0.156.0 or on 2025-08-04, use external_memory instead
|
||||
},
|
||||
process=Process.sequential,
|
||||
verbose=True
|
||||
@@ -720,7 +720,16 @@ crew = Crew(
|
||||
```
|
||||
|
||||
### Advanced Mem0 Configuration
|
||||
When using Mem0 Client, you can customize the memory configuration further, by using parameters like 'includes', 'excludes', 'custom_categories', 'infer' and 'run_id' (this is only for short-term memory).
|
||||
You can find more details in the [Mem0 documentation](https://docs.mem0.ai/).
|
||||
```python
|
||||
|
||||
new_categories = [
|
||||
{"lifestyle_management_concerns": "Tracks daily routines, habits, hobbies and interests including cooking, time management and work-life balance"},
|
||||
{"seeking_structure": "Documents goals around creating routines, schedules, and organized systems in various life areas"},
|
||||
{"personal_information": "Basic information about the user including name, preferences, and personality traits"}
|
||||
]
|
||||
|
||||
crew = Crew(
|
||||
agents=[...],
|
||||
tasks=[...],
|
||||
@@ -732,6 +741,11 @@ crew = Crew(
|
||||
"org_id": "my_org_id", # Optional
|
||||
"project_id": "my_project_id", # Optional
|
||||
"api_key": "custom-api-key" # Optional - overrides env var
|
||||
"run_id": "my_run_id", # Optional - for short-term memory
|
||||
"includes": "include1", # Optional
|
||||
"excludes": "exclude1", # Optional
|
||||
"infer": True # Optional defaults to True
|
||||
"custom_categories": new_categories # Optional - custom categories for user memory
|
||||
},
|
||||
"user_memory": {}
|
||||
}
|
||||
@@ -761,7 +775,8 @@ crew = Crew(
|
||||
"provider": "openai",
|
||||
"config": {"api_key": "your-api-key", "model": "text-embedding-3-small"}
|
||||
}
|
||||
}
|
||||
},
|
||||
"infer": True # Optional defaults to True
|
||||
},
|
||||
"user_memory": {}
|
||||
}
|
||||
@@ -783,7 +798,7 @@ os.environ["MEM0_API_KEY"] = "your-api-key"
|
||||
# Create external memory instance
|
||||
external_memory = ExternalMemory(
|
||||
embedder_config={
|
||||
"provider": "mem0",
|
||||
"provider": "mem0",
|
||||
"config": {"user_id": "U-123"}
|
||||
}
|
||||
)
|
||||
@@ -808,8 +823,8 @@ class CustomStorage(Storage):
|
||||
|
||||
def save(self, value, metadata=None, agent=None):
|
||||
self.memories.append({
|
||||
"value": value,
|
||||
"metadata": metadata,
|
||||
"value": value,
|
||||
"metadata": metadata,
|
||||
"agent": agent
|
||||
})
|
||||
|
||||
@@ -986,7 +1001,201 @@ crew = Crew(
|
||||
- 🫡 **Enhanced Personalization:** Memory enables agents to remember user preferences and historical interactions, leading to personalized experiences.
|
||||
- 🧠 **Improved Problem Solving:** Access to a rich memory store aids agents in making more informed decisions, drawing on past learnings and contextual insights.
|
||||
|
||||
## Memory Events
|
||||
|
||||
CrewAI's event system provides powerful insights into memory operations. By leveraging memory events, you can monitor, debug, and optimize your memory system's performance and behavior.
|
||||
|
||||
### Available Memory Events
|
||||
|
||||
CrewAI emits the following memory-related events:
|
||||
|
||||
| Event | Description | Key Properties |
|
||||
| :---- | :---------- | :------------- |
|
||||
| **MemoryQueryStartedEvent** | Emitted when a memory query begins | `query`, `limit`, `score_threshold` |
|
||||
| **MemoryQueryCompletedEvent** | Emitted when a memory query completes successfully | `query`, `results`, `limit`, `score_threshold`, `query_time_ms` |
|
||||
| **MemoryQueryFailedEvent** | Emitted when a memory query fails | `query`, `limit`, `score_threshold`, `error` |
|
||||
| **MemorySaveStartedEvent** | Emitted when a memory save operation begins | `value`, `metadata`, `agent_role` |
|
||||
| **MemorySaveCompletedEvent** | Emitted when a memory save operation completes successfully | `value`, `metadata`, `agent_role`, `save_time_ms` |
|
||||
| **MemorySaveFailedEvent** | Emitted when a memory save operation fails | `value`, `metadata`, `agent_role`, `error` |
|
||||
| **MemoryRetrievalStartedEvent** | Emitted when memory retrieval for a task prompt starts | `task_id` |
|
||||
| **MemoryRetrievalCompletedEvent** | Emitted when memory retrieval completes successfully | `task_id`, `memory_content`, `retrieval_time_ms` |
|
||||
|
||||
### Practical Applications
|
||||
|
||||
#### 1. Memory Performance Monitoring
|
||||
|
||||
Track memory operation timing to optimize your application:
|
||||
|
||||
```python
|
||||
from crewai.utilities.events.base_event_listener import BaseEventListener
|
||||
from crewai.utilities.events import (
|
||||
MemoryQueryCompletedEvent,
|
||||
MemorySaveCompletedEvent
|
||||
)
|
||||
import time
|
||||
|
||||
class MemoryPerformanceMonitor(BaseEventListener):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.query_times = []
|
||||
self.save_times = []
|
||||
|
||||
def setup_listeners(self, crewai_event_bus):
|
||||
@crewai_event_bus.on(MemoryQueryCompletedEvent)
|
||||
def on_memory_query_completed(source, event: MemoryQueryCompletedEvent):
|
||||
self.query_times.append(event.query_time_ms)
|
||||
print(f"Memory query completed in {event.query_time_ms:.2f}ms. Query: '{event.query}'")
|
||||
print(f"Average query time: {sum(self.query_times)/len(self.query_times):.2f}ms")
|
||||
|
||||
@crewai_event_bus.on(MemorySaveCompletedEvent)
|
||||
def on_memory_save_completed(source, event: MemorySaveCompletedEvent):
|
||||
self.save_times.append(event.save_time_ms)
|
||||
print(f"Memory save completed in {event.save_time_ms:.2f}ms")
|
||||
print(f"Average save time: {sum(self.save_times)/len(self.save_times):.2f}ms")
|
||||
|
||||
# Create an instance of your listener
|
||||
memory_monitor = MemoryPerformanceMonitor()
|
||||
```
|
||||
|
||||
#### 2. Memory Content Logging
|
||||
|
||||
Log memory operations for debugging and insights:
|
||||
|
||||
```python
|
||||
from crewai.utilities.events.base_event_listener import BaseEventListener
|
||||
from crewai.utilities.events import (
|
||||
MemorySaveStartedEvent,
|
||||
MemoryQueryStartedEvent,
|
||||
MemoryRetrievalCompletedEvent
|
||||
)
|
||||
import logging
|
||||
|
||||
# Configure logging
|
||||
logger = logging.getLogger('memory_events')
|
||||
|
||||
class MemoryLogger(BaseEventListener):
|
||||
def setup_listeners(self, crewai_event_bus):
|
||||
@crewai_event_bus.on(MemorySaveStartedEvent)
|
||||
def on_memory_save_started(source, event: MemorySaveStartedEvent):
|
||||
if event.agent_role:
|
||||
logger.info(f"Agent '{event.agent_role}' saving memory: {event.value[:50]}...")
|
||||
else:
|
||||
logger.info(f"Saving memory: {event.value[:50]}...")
|
||||
|
||||
@crewai_event_bus.on(MemoryQueryStartedEvent)
|
||||
def on_memory_query_started(source, event: MemoryQueryStartedEvent):
|
||||
logger.info(f"Memory query started: '{event.query}' (limit: {event.limit})")
|
||||
|
||||
@crewai_event_bus.on(MemoryRetrievalCompletedEvent)
|
||||
def on_memory_retrieval_completed(source, event: MemoryRetrievalCompletedEvent):
|
||||
if event.task_id:
|
||||
logger.info(f"Memory retrieved for task {event.task_id} in {event.retrieval_time_ms:.2f}ms")
|
||||
else:
|
||||
logger.info(f"Memory retrieved in {event.retrieval_time_ms:.2f}ms")
|
||||
logger.debug(f"Memory content: {event.memory_content}")
|
||||
|
||||
# Create an instance of your listener
|
||||
memory_logger = MemoryLogger()
|
||||
```
|
||||
|
||||
#### 3. Error Tracking and Notifications
|
||||
|
||||
Capture and respond to memory errors:
|
||||
|
||||
```python
|
||||
from crewai.utilities.events.base_event_listener import BaseEventListener
|
||||
from crewai.utilities.events import (
|
||||
MemorySaveFailedEvent,
|
||||
MemoryQueryFailedEvent
|
||||
)
|
||||
import logging
|
||||
from typing import Optional
|
||||
|
||||
# Configure logging
|
||||
logger = logging.getLogger('memory_errors')
|
||||
|
||||
class MemoryErrorTracker(BaseEventListener):
|
||||
def __init__(self, notify_email: Optional[str] = None):
|
||||
super().__init__()
|
||||
self.notify_email = notify_email
|
||||
self.error_count = 0
|
||||
|
||||
def setup_listeners(self, crewai_event_bus):
|
||||
@crewai_event_bus.on(MemorySaveFailedEvent)
|
||||
def on_memory_save_failed(source, event: MemorySaveFailedEvent):
|
||||
self.error_count += 1
|
||||
agent_info = f"Agent '{event.agent_role}'" if event.agent_role else "Unknown agent"
|
||||
error_message = f"Memory save failed: {event.error}. {agent_info}"
|
||||
logger.error(error_message)
|
||||
|
||||
if self.notify_email and self.error_count % 5 == 0:
|
||||
self._send_notification(error_message)
|
||||
|
||||
@crewai_event_bus.on(MemoryQueryFailedEvent)
|
||||
def on_memory_query_failed(source, event: MemoryQueryFailedEvent):
|
||||
self.error_count += 1
|
||||
error_message = f"Memory query failed: {event.error}. Query: '{event.query}'"
|
||||
logger.error(error_message)
|
||||
|
||||
if self.notify_email and self.error_count % 5 == 0:
|
||||
self._send_notification(error_message)
|
||||
|
||||
def _send_notification(self, message):
|
||||
# Implement your notification system (email, Slack, etc.)
|
||||
print(f"[NOTIFICATION] Would send to {self.notify_email}: {message}")
|
||||
|
||||
# Create an instance of your listener
|
||||
error_tracker = MemoryErrorTracker(notify_email="admin@example.com")
|
||||
```
|
||||
|
||||
### Integrating with Analytics Platforms
|
||||
|
||||
Memory events can be forwarded to analytics and monitoring platforms to track performance metrics, detect anomalies, and visualize memory usage patterns:
|
||||
|
||||
```python
|
||||
from crewai.utilities.events.base_event_listener import BaseEventListener
|
||||
from crewai.utilities.events import (
|
||||
MemoryQueryCompletedEvent,
|
||||
MemorySaveCompletedEvent
|
||||
)
|
||||
|
||||
class MemoryAnalyticsForwarder(BaseEventListener):
|
||||
def __init__(self, analytics_client):
|
||||
super().__init__()
|
||||
self.client = analytics_client
|
||||
|
||||
def setup_listeners(self, crewai_event_bus):
|
||||
@crewai_event_bus.on(MemoryQueryCompletedEvent)
|
||||
def on_memory_query_completed(source, event: MemoryQueryCompletedEvent):
|
||||
# Forward query metrics to analytics platform
|
||||
self.client.track_metric({
|
||||
"event_type": "memory_query",
|
||||
"query": event.query,
|
||||
"duration_ms": event.query_time_ms,
|
||||
"result_count": len(event.results) if hasattr(event.results, "__len__") else 0,
|
||||
"timestamp": event.timestamp
|
||||
})
|
||||
|
||||
@crewai_event_bus.on(MemorySaveCompletedEvent)
|
||||
def on_memory_save_completed(source, event: MemorySaveCompletedEvent):
|
||||
# Forward save metrics to analytics platform
|
||||
self.client.track_metric({
|
||||
"event_type": "memory_save",
|
||||
"agent_role": event.agent_role,
|
||||
"duration_ms": event.save_time_ms,
|
||||
"timestamp": event.timestamp
|
||||
})
|
||||
```
|
||||
|
||||
### Best Practices for Memory Event Listeners
|
||||
|
||||
1. **Keep handlers lightweight**: Avoid complex processing in event handlers to prevent performance impacts
|
||||
2. **Use appropriate logging levels**: Use INFO for normal operations, DEBUG for details, ERROR for issues
|
||||
3. **Batch metrics when possible**: Accumulate metrics before sending to external systems
|
||||
4. **Handle exceptions gracefully**: Ensure your event handlers don't crash due to unexpected data
|
||||
5. **Consider memory consumption**: Be mindful of storing large amounts of event data
|
||||
|
||||
## Conclusion
|
||||
|
||||
Integrating CrewAI's memory system into your projects is straightforward. By leveraging the provided memory components and configurations,
|
||||
Integrating CrewAI's memory system into your projects is straightforward. By leveraging the provided memory components and configurations,
|
||||
you can quickly empower your agents with the ability to remember, reason, and learn from their interactions, unlocking new levels of intelligence and capability.
|
||||
@@ -54,9 +54,11 @@ crew = Crew(
|
||||
| **Markdown** _(optional)_ | `markdown` | `Optional[bool]` | Whether the task should instruct the agent to return the final answer formatted in Markdown. Defaults to False. |
|
||||
| **Config** _(optional)_ | `config` | `Optional[Dict[str, Any]]` | Task-specific configuration parameters. |
|
||||
| **Output File** _(optional)_ | `output_file` | `Optional[str]` | File path for storing the task output. |
|
||||
| **Create Directory** _(optional)_ | `create_directory` | `Optional[bool]` | Whether to create the directory for output_file if it doesn't exist. Defaults to True. |
|
||||
| **Output JSON** _(optional)_ | `output_json` | `Optional[Type[BaseModel]]` | A Pydantic model to structure the JSON output. |
|
||||
| **Output Pydantic** _(optional)_ | `output_pydantic` | `Optional[Type[BaseModel]]` | A Pydantic model for task output. |
|
||||
| **Callback** _(optional)_ | `callback` | `Optional[Any]` | Function/object to be executed after task completion. |
|
||||
| **Guardrail** _(optional)_ | `guardrail` | `Optional[Callable]` | Function to validate task output before proceeding to next task. |
|
||||
|
||||
## Creating Tasks
|
||||
|
||||
@@ -66,7 +68,7 @@ There are two ways to create tasks in CrewAI: using **YAML configuration (recomm
|
||||
|
||||
Using YAML configuration provides a cleaner, more maintainable way to define tasks. We strongly recommend using this approach to define tasks in your CrewAI projects.
|
||||
|
||||
After creating your CrewAI project as outlined in the [Installation](/installation) section, navigate to the `src/latest_ai_development/config/tasks.yaml` file and modify the template to match your specific task requirements.
|
||||
After creating your CrewAI project as outlined in the [Installation](/en/installation) section, navigate to the `src/latest_ai_development/config/tasks.yaml` file and modify the template to match your specific task requirements.
|
||||
|
||||
<Note>
|
||||
Variables in your YAML files (like `{topic}`) will be replaced with values from your inputs when running the crew:
|
||||
@@ -277,7 +279,7 @@ formatted_task = Task(
|
||||
|
||||
When `markdown=True`, the agent will receive additional instructions to format the output using:
|
||||
- `#` for headers
|
||||
- `**text**` for bold text
|
||||
- `**text**` for bold text
|
||||
- `*text*` for italic text
|
||||
- `-` or `*` for bullet points
|
||||
- `` `code` `` for inline code
|
||||
@@ -332,9 +334,11 @@ Task guardrails provide a way to validate and transform task outputs before they
|
||||
are passed to the next task. This feature helps ensure data quality and provides
|
||||
feedback to agents when their output doesn't meet specific criteria.
|
||||
|
||||
### Using Task Guardrails
|
||||
Guardrails are implemented as Python functions that contain custom validation logic, giving you complete control over the validation process and ensuring reliable, deterministic results.
|
||||
|
||||
To add a guardrail to a task, provide a validation function through the `guardrail` parameter:
|
||||
### Function-Based Guardrails
|
||||
|
||||
To add a function-based guardrail to a task, provide a validation function through the `guardrail` parameter:
|
||||
|
||||
```python Code
|
||||
from typing import Tuple, Union, Dict, Any
|
||||
@@ -372,9 +376,7 @@ blog_task = Task(
|
||||
- On success: it returns a tuple of `(bool, Any)`. For example: `(True, validated_result)`
|
||||
- On Failure: it returns a tuple of `(bool, str)`. For example: `(False, "Error message explain the failure")`
|
||||
|
||||
### LLMGuardrail
|
||||
|
||||
The `LLMGuardrail` class offers a robust mechanism for validating task outputs.
|
||||
|
||||
### Error Handling Best Practices
|
||||
|
||||
@@ -798,184 +800,91 @@ While creating and executing tasks, certain validation mechanisms are in place t
|
||||
|
||||
These validations help in maintaining the consistency and reliability of task executions within the crewAI framework.
|
||||
|
||||
## Task Guardrails
|
||||
|
||||
Task guardrails provide a powerful way to validate, transform, or filter task outputs before they are passed to the next task. Guardrails are optional functions that execute before the next task starts, allowing you to ensure that task outputs meet specific requirements or formats.
|
||||
|
||||
### Basic Usage
|
||||
|
||||
#### Define your own logic to validate
|
||||
|
||||
```python Code
|
||||
from typing import Tuple, Union
|
||||
from crewai import Task
|
||||
|
||||
def validate_json_output(result: str) -> Tuple[bool, Union[dict, str]]:
|
||||
"""Validate that the output is valid JSON."""
|
||||
try:
|
||||
json_data = json.loads(result)
|
||||
return (True, json_data)
|
||||
except json.JSONDecodeError:
|
||||
return (False, "Output must be valid JSON")
|
||||
|
||||
task = Task(
|
||||
description="Generate JSON data",
|
||||
expected_output="Valid JSON object",
|
||||
guardrail=validate_json_output
|
||||
)
|
||||
```
|
||||
|
||||
#### Leverage a no-code approach for validation
|
||||
|
||||
```python Code
|
||||
from crewai import Task
|
||||
|
||||
task = Task(
|
||||
description="Generate JSON data",
|
||||
expected_output="Valid JSON object",
|
||||
guardrail="Ensure the response is a valid JSON object"
|
||||
)
|
||||
```
|
||||
|
||||
#### Using YAML
|
||||
|
||||
```yaml
|
||||
research_task:
|
||||
...
|
||||
guardrail: make sure each bullet contains a minimum of 100 words
|
||||
...
|
||||
```
|
||||
|
||||
```python Code
|
||||
@CrewBase
|
||||
class InternalCrew:
|
||||
agents_config = "config/agents.yaml"
|
||||
tasks_config = "config/tasks.yaml"
|
||||
|
||||
...
|
||||
@task
|
||||
def research_task(self):
|
||||
return Task(config=self.tasks_config["research_task"]) # type: ignore[index]
|
||||
...
|
||||
```
|
||||
|
||||
|
||||
#### Use custom models for code generation
|
||||
|
||||
```python Code
|
||||
from crewai import Task
|
||||
from crewai.llm import LLM
|
||||
|
||||
task = Task(
|
||||
description="Generate JSON data",
|
||||
expected_output="Valid JSON object",
|
||||
guardrail=LLMGuardrail(
|
||||
description="Ensure the response is a valid JSON object",
|
||||
llm=LLM(model="gpt-4o-mini"),
|
||||
)
|
||||
)
|
||||
```
|
||||
|
||||
### How Guardrails Work
|
||||
|
||||
1. **Optional Attribute**: Guardrails are an optional attribute at the task level, allowing you to add validation only where needed.
|
||||
2. **Execution Timing**: The guardrail function is executed before the next task starts, ensuring valid data flow between tasks.
|
||||
3. **Return Format**: Guardrails must return a tuple of `(success, data)`:
|
||||
- If `success` is `True`, `data` is the validated/transformed result
|
||||
- If `success` is `False`, `data` is the error message
|
||||
4. **Result Routing**:
|
||||
- On success (`True`), the result is automatically passed to the next task
|
||||
- On failure (`False`), the error is sent back to the agent to generate a new answer
|
||||
|
||||
### Common Use Cases
|
||||
|
||||
#### Data Format Validation
|
||||
```python Code
|
||||
def validate_email_format(result: str) -> Tuple[bool, Union[str, str]]:
|
||||
"""Ensure the output contains a valid email address."""
|
||||
import re
|
||||
email_pattern = r'^[\w\.-]+@[\w\.-]+\.\w+$'
|
||||
if re.match(email_pattern, result.strip()):
|
||||
return (True, result.strip())
|
||||
return (False, "Output must be a valid email address")
|
||||
```
|
||||
|
||||
#### Content Filtering
|
||||
```python Code
|
||||
def filter_sensitive_info(result: str) -> Tuple[bool, Union[str, str]]:
|
||||
"""Remove or validate sensitive information."""
|
||||
sensitive_patterns = ['SSN:', 'password:', 'secret:']
|
||||
for pattern in sensitive_patterns:
|
||||
if pattern.lower() in result.lower():
|
||||
return (False, f"Output contains sensitive information ({pattern})")
|
||||
return (True, result)
|
||||
```
|
||||
|
||||
#### Data Transformation
|
||||
```python Code
|
||||
def normalize_phone_number(result: str) -> Tuple[bool, Union[str, str]]:
|
||||
"""Ensure phone numbers are in a consistent format."""
|
||||
import re
|
||||
digits = re.sub(r'\D', '', result)
|
||||
if len(digits) == 10:
|
||||
formatted = f"({digits[:3]}) {digits[3:6]}-{digits[6:]}"
|
||||
return (True, formatted)
|
||||
return (False, "Output must be a 10-digit phone number")
|
||||
```
|
||||
|
||||
### Advanced Features
|
||||
|
||||
#### Chaining Multiple Validations
|
||||
```python Code
|
||||
def chain_validations(*validators):
|
||||
"""Chain multiple validators together."""
|
||||
def combined_validator(result):
|
||||
for validator in validators:
|
||||
success, data = validator(result)
|
||||
if not success:
|
||||
return (False, data)
|
||||
result = data
|
||||
return (True, result)
|
||||
return combined_validator
|
||||
|
||||
# Usage
|
||||
task = Task(
|
||||
description="Get user contact info",
|
||||
expected_output="Email and phone",
|
||||
guardrail=chain_validations(
|
||||
validate_email_format,
|
||||
filter_sensitive_info
|
||||
)
|
||||
)
|
||||
```
|
||||
|
||||
#### Custom Retry Logic
|
||||
```python Code
|
||||
task = Task(
|
||||
description="Generate data",
|
||||
expected_output="Valid data",
|
||||
guardrail=validate_data,
|
||||
max_retries=5 # Override default retry limit
|
||||
)
|
||||
```
|
||||
|
||||
## Creating Directories when Saving Files
|
||||
|
||||
You can now specify if a task should create directories when saving its output to a file. This is particularly useful for organizing outputs and ensuring that file paths are correctly structured.
|
||||
The `create_directory` parameter controls whether CrewAI should automatically create directories when saving task outputs to files. This feature is particularly useful for organizing outputs and ensuring that file paths are correctly structured, especially when working with complex project hierarchies.
|
||||
|
||||
### Default Behavior
|
||||
|
||||
By default, `create_directory=True`, which means CrewAI will automatically create any missing directories in the output file path:
|
||||
|
||||
```python Code
|
||||
# ...
|
||||
|
||||
save_output_task = Task(
|
||||
description='Save the summarized AI news to a file',
|
||||
expected_output='File saved successfully',
|
||||
agent=research_agent,
|
||||
tools=[file_save_tool],
|
||||
output_file='outputs/ai_news_summary.txt',
|
||||
create_directory=True
|
||||
# Default behavior - directories are created automatically
|
||||
report_task = Task(
|
||||
description='Generate a comprehensive market analysis report',
|
||||
expected_output='A detailed market analysis with charts and insights',
|
||||
agent=analyst_agent,
|
||||
output_file='reports/2025/market_analysis.md', # Creates 'reports/2025/' if it doesn't exist
|
||||
markdown=True
|
||||
)
|
||||
```
|
||||
|
||||
#...
|
||||
### Disabling Directory Creation
|
||||
|
||||
If you want to prevent automatic directory creation and ensure that the directory already exists, set `create_directory=False`:
|
||||
|
||||
```python Code
|
||||
# Strict mode - directory must already exist
|
||||
strict_output_task = Task(
|
||||
description='Save critical data that requires existing infrastructure',
|
||||
expected_output='Data saved to pre-configured location',
|
||||
agent=data_agent,
|
||||
output_file='secure/vault/critical_data.json',
|
||||
create_directory=False # Will raise RuntimeError if 'secure/vault/' doesn't exist
|
||||
)
|
||||
```
|
||||
|
||||
### YAML Configuration
|
||||
|
||||
You can also configure this behavior in your YAML task definitions:
|
||||
|
||||
```yaml tasks.yaml
|
||||
analysis_task:
|
||||
description: >
|
||||
Generate quarterly financial analysis
|
||||
expected_output: >
|
||||
A comprehensive financial report with quarterly insights
|
||||
agent: financial_analyst
|
||||
output_file: reports/quarterly/q4_2024_analysis.pdf
|
||||
create_directory: true # Automatically create 'reports/quarterly/' directory
|
||||
|
||||
audit_task:
|
||||
description: >
|
||||
Perform compliance audit and save to existing audit directory
|
||||
expected_output: >
|
||||
A compliance audit report
|
||||
agent: auditor
|
||||
output_file: audit/compliance_report.md
|
||||
create_directory: false # Directory must already exist
|
||||
```
|
||||
|
||||
### Use Cases
|
||||
|
||||
**Automatic Directory Creation (`create_directory=True`):**
|
||||
- Development and prototyping environments
|
||||
- Dynamic report generation with date-based folders
|
||||
- Automated workflows where directory structure may vary
|
||||
- Multi-tenant applications with user-specific folders
|
||||
|
||||
**Manual Directory Management (`create_directory=False`):**
|
||||
- Production environments with strict file system controls
|
||||
- Security-sensitive applications where directories must be pre-configured
|
||||
- Systems with specific permission requirements
|
||||
- Compliance environments where directory creation is audited
|
||||
|
||||
### Error Handling
|
||||
|
||||
When `create_directory=False` and the directory doesn't exist, CrewAI will raise a `RuntimeError`:
|
||||
|
||||
```python Code
|
||||
try:
|
||||
result = crew.kickoff()
|
||||
except RuntimeError as e:
|
||||
# Handle missing directory error
|
||||
print(f"Directory creation failed: {e}")
|
||||
# Create directory manually or use fallback location
|
||||
```
|
||||
|
||||
Check out the video below to see how to use structured outputs in CrewAI:
|
||||
131
docs/en/concepts/training.mdx
Normal file
131
docs/en/concepts/training.mdx
Normal file
@@ -0,0 +1,131 @@
|
||||
---
|
||||
title: Training
|
||||
description: Learn how to train your CrewAI agents by giving them feedback early on and get consistent results.
|
||||
icon: dumbbell
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
The training feature in CrewAI allows you to train your AI agents using the command-line interface (CLI).
|
||||
By running the command `crewai train -n <n_iterations>`, you can specify the number of iterations for the training process.
|
||||
|
||||
During training, CrewAI utilizes techniques to optimize the performance of your agents along with human feedback.
|
||||
This helps the agents improve their understanding, decision-making, and problem-solving abilities.
|
||||
|
||||
### Training Your Crew Using the CLI
|
||||
|
||||
To use the training feature, follow these steps:
|
||||
|
||||
1. Open your terminal or command prompt.
|
||||
2. Navigate to the directory where your CrewAI project is located.
|
||||
3. Run the following command:
|
||||
|
||||
```shell
|
||||
crewai train -n <n_iterations> <filename> (optional)
|
||||
```
|
||||
<Tip>
|
||||
Replace `<n_iterations>` with the desired number of training iterations and `<filename>` with the appropriate filename ending with `.pkl`.
|
||||
</Tip>
|
||||
|
||||
### Training Your Crew Programmatically
|
||||
|
||||
To train your crew programmatically, use the following steps:
|
||||
|
||||
1. Define the number of iterations for training.
|
||||
2. Specify the input parameters for the training process.
|
||||
3. Execute the training command within a try-except block to handle potential errors.
|
||||
|
||||
```python Code
|
||||
n_iterations = 2
|
||||
inputs = {"topic": "CrewAI Training"}
|
||||
filename = "your_model.pkl"
|
||||
|
||||
try:
|
||||
YourCrewName_Crew().crew().train(
|
||||
n_iterations=n_iterations,
|
||||
inputs=inputs,
|
||||
filename=filename
|
||||
)
|
||||
|
||||
except Exception as e:
|
||||
raise Exception(f"An error occurred while training the crew: {e}")
|
||||
```
|
||||
|
||||
### Key Points to Note
|
||||
|
||||
- **Positive Integer Requirement:** Ensure that the number of iterations (`n_iterations`) is a positive integer. The code will raise a `ValueError` if this condition is not met.
|
||||
- **Filename Requirement:** Ensure that the filename ends with `.pkl`. The code will raise a `ValueError` if this condition is not met.
|
||||
- **Error Handling:** The code handles subprocess errors and unexpected exceptions, providing error messages to the user.
|
||||
|
||||
It is important to note that the training process may take some time, depending on the complexity of your agents and will also require your feedback on each iteration.
|
||||
|
||||
Once the training is complete, your agents will be equipped with enhanced capabilities and knowledge, ready to tackle complex tasks and provide more consistent and valuable insights.
|
||||
|
||||
Remember to regularly update and retrain your agents to ensure they stay up-to-date with the latest information and advancements in the field.
|
||||
|
||||
Happy training with CrewAI! 🚀
|
||||
|
||||
## Small Language Model Considerations
|
||||
|
||||
<Warning>
|
||||
When using smaller language models (≤7B parameters) for training data evaluation, be aware that they may face challenges with generating structured outputs and following complex instructions.
|
||||
</Warning>
|
||||
|
||||
### Limitations of Small Models in Training Evaluation
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card title="JSON Output Accuracy" icon="triangle-exclamation">
|
||||
Smaller models often struggle with producing valid JSON responses needed for structured training evaluations, leading to parsing errors and incomplete data.
|
||||
</Card>
|
||||
<Card title="Evaluation Quality" icon="chart-line">
|
||||
Models under 7B parameters may provide less nuanced evaluations with limited reasoning depth compared to larger models.
|
||||
</Card>
|
||||
<Card title="Instruction Following" icon="list-check">
|
||||
Complex training evaluation criteria may not be fully followed or considered by smaller models.
|
||||
</Card>
|
||||
<Card title="Consistency" icon="rotate">
|
||||
Evaluations across multiple training iterations may lack consistency with smaller models.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
### Recommendations for Training
|
||||
|
||||
<Tabs>
|
||||
<Tab title="Best Practice">
|
||||
For optimal training quality and reliable evaluations, we strongly recommend using models with at least 7B parameters or larger:
|
||||
|
||||
```python
|
||||
from crewai import Agent, Crew, Task, LLM
|
||||
|
||||
# Recommended minimum for training evaluation
|
||||
llm = LLM(model="mistral/open-mistral-7b")
|
||||
|
||||
# Better options for reliable training evaluation
|
||||
llm = LLM(model="anthropic/claude-3-sonnet-20240229-v1:0")
|
||||
llm = LLM(model="gpt-4o")
|
||||
|
||||
# Use this LLM with your agents
|
||||
agent = Agent(
|
||||
role="Training Evaluator",
|
||||
goal="Provide accurate training feedback",
|
||||
llm=llm
|
||||
)
|
||||
```
|
||||
|
||||
<Tip>
|
||||
More powerful models provide higher quality feedback with better reasoning, leading to more effective training iterations.
|
||||
</Tip>
|
||||
</Tab>
|
||||
<Tab title="Small Model Usage">
|
||||
If you must use smaller models for training evaluation, be aware of these constraints:
|
||||
|
||||
```python
|
||||
# Using a smaller model (expect some limitations)
|
||||
llm = LLM(model="huggingface/microsoft/Phi-3-mini-4k-instruct")
|
||||
```
|
||||
|
||||
<Warning>
|
||||
While CrewAI includes optimizations for small models, expect less reliable and less nuanced evaluation results that may require more human intervention during training.
|
||||
</Warning>
|
||||
</Tab>
|
||||
</Tabs>
|
||||
155
docs/en/enterprise/features/agent-repositories.mdx
Normal file
155
docs/en/enterprise/features/agent-repositories.mdx
Normal file
@@ -0,0 +1,155 @@
|
||||
---
|
||||
title: 'Agent Repositories'
|
||||
description: 'Learn how to use Agent Repositories to share and reuse your agents across teams and projects'
|
||||
icon: 'database'
|
||||
---
|
||||
|
||||
Agent Repositories allow enterprise users to store, share, and reuse agent definitions across teams and projects. This feature enables organizations to maintain a centralized library of standardized agents, promoting consistency and reducing duplication of effort.
|
||||
|
||||
## Benefits of Agent Repositories
|
||||
|
||||
- **Standardization**: Maintain consistent agent definitions across your organization
|
||||
- **Reusability**: Create an agent once and use it in multiple crews and projects
|
||||
- **Governance**: Implement organization-wide policies for agent configurations
|
||||
- **Collaboration**: Enable teams to share and build upon each other's work
|
||||
|
||||
## Using Agent Repositories
|
||||
|
||||
### Prerequisites
|
||||
|
||||
1. You must have an account at CrewAI, try the [free plan](https://app.crewai.com).
|
||||
2. You need to be authenticated using the CrewAI CLI.
|
||||
3. If you have more than one organization, make sure you are switched to the correct organization using the CLI command:
|
||||
|
||||
```bash
|
||||
crewai org switch <org_id>
|
||||
```
|
||||
|
||||
### Creating and Managing Agents in Repositories
|
||||
|
||||
To create and manage agents in repositories,Enterprise Dashboard.
|
||||
|
||||
### Loading Agents from Repositories
|
||||
|
||||
You can load agents from repositories in your code using the `from_repository` parameter:
|
||||
|
||||
```python
|
||||
from crewai import Agent
|
||||
|
||||
# Create an agent by loading it from a repository
|
||||
# The agent is loaded with all its predefined configurations
|
||||
researcher = Agent(
|
||||
from_repository="market-research-agent"
|
||||
)
|
||||
|
||||
```
|
||||
|
||||
### Overriding Repository Settings
|
||||
|
||||
You can override specific settings from the repository by providing them in the configuration:
|
||||
|
||||
```python
|
||||
researcher = Agent(
|
||||
from_repository="market-research-agent",
|
||||
goal="Research the latest trends in AI development", # Override the repository goal
|
||||
verbose=True # Add a setting not in the repository
|
||||
)
|
||||
```
|
||||
|
||||
### Example: Creating a Crew with Repository Agents
|
||||
|
||||
```python
|
||||
from crewai import Crew, Agent, Task
|
||||
|
||||
# Load agents from repositories
|
||||
researcher = Agent(
|
||||
from_repository="market-research-agent"
|
||||
)
|
||||
|
||||
writer = Agent(
|
||||
from_repository="content-writer-agent"
|
||||
)
|
||||
|
||||
# Create tasks
|
||||
research_task = Task(
|
||||
description="Research the latest trends in AI",
|
||||
agent=researcher
|
||||
)
|
||||
|
||||
writing_task = Task(
|
||||
description="Write a comprehensive report based on the research",
|
||||
agent=writer
|
||||
)
|
||||
|
||||
# Create the crew
|
||||
crew = Crew(
|
||||
agents=[researcher, writer],
|
||||
tasks=[research_task, writing_task],
|
||||
verbose=True
|
||||
)
|
||||
|
||||
# Run the crew
|
||||
result = crew.kickoff()
|
||||
```
|
||||
|
||||
### Example: Using `kickoff()` with Repository Agents
|
||||
|
||||
You can also use repository agents directly with the `kickoff()` method for simpler interactions:
|
||||
|
||||
```python
|
||||
from crewai import Agent
|
||||
from pydantic import BaseModel
|
||||
from typing import List
|
||||
|
||||
# Define a structured output format
|
||||
class MarketAnalysis(BaseModel):
|
||||
key_trends: List[str]
|
||||
opportunities: List[str]
|
||||
recommendation: str
|
||||
|
||||
# Load an agent from repository
|
||||
analyst = Agent(
|
||||
from_repository="market-analyst-agent",
|
||||
verbose=True
|
||||
)
|
||||
|
||||
# Get a free-form response
|
||||
result = analyst.kickoff("Analyze the AI market in 2025")
|
||||
print(result.raw) # Access the raw response
|
||||
|
||||
# Get structured output
|
||||
structured_result = analyst.kickoff(
|
||||
"Provide a structured analysis of the AI market in 2025",
|
||||
response_format=MarketAnalysis
|
||||
)
|
||||
|
||||
# Access structured data
|
||||
print(f"Key Trends: {structured_result.pydantic.key_trends}")
|
||||
print(f"Recommendation: {structured_result.pydantic.recommendation}")
|
||||
```
|
||||
|
||||
## Best Practices
|
||||
|
||||
1. **Naming Convention**: Use clear, descriptive names for your repository agents
|
||||
2. **Documentation**: Include comprehensive descriptions for each agent
|
||||
3. **Tool Management**: Ensure that tools referenced by repository agents are available in your environment
|
||||
4. **Access Control**: Manage permissions to ensure only authorized team members can modify repository agents
|
||||
|
||||
## Organization Management
|
||||
|
||||
To switch between organizations or see your current organization, use the CrewAI CLI:
|
||||
|
||||
```bash
|
||||
# View current organization
|
||||
crewai org current
|
||||
|
||||
# Switch to a different organization
|
||||
crewai org switch <org_id>
|
||||
|
||||
# List all available organizations
|
||||
crewai org list
|
||||
```
|
||||
|
||||
<Note>
|
||||
When loading agents from repositories, you must be authenticated and switched to the correct organization. If you receive errors, check your authentication status and organization settings using the CLI commands above.
|
||||
</Note>
|
||||
@@ -124,7 +124,7 @@ from crewai_tools import CrewaiEnterpriseTools
|
||||
enterprise_tools = CrewaiEnterpriseTools(
|
||||
actions_list=["gmail_find_email"] # only gmail_find_email tool will be available
|
||||
)
|
||||
gmail_tool = enterprise_tools[0]
|
||||
gmail_tool = enterprise_tools["gmail_find_email"]
|
||||
|
||||
gmail_agent = Agent(
|
||||
role="Gmail Manager",
|
||||
@@ -10,11 +10,11 @@ icon: "people-arrows"
|
||||
|
||||
## Getting Started
|
||||
|
||||
<iframe
|
||||
<iframe
|
||||
width="100%"
|
||||
height="400"
|
||||
src="https://www.youtube.com/embed/-kSOTtYzgEw"
|
||||
title="Building Crews with CrewAI CLI"
|
||||
title="Building Crews with CrewAI CLI"
|
||||
frameborder="0"
|
||||
style={{ borderRadius: '10px' }}
|
||||
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
|
||||
@@ -23,13 +23,13 @@ icon: "people-arrows"
|
||||
|
||||
### Installation and Setup
|
||||
|
||||
<Card title="Follow Standard Installation" icon="wrench" href="/installation">
|
||||
<Card title="Follow Standard Installation" icon="wrench" href="/en/installation">
|
||||
Follow our standard installation guide to set up CrewAI CLI and create your first project.
|
||||
</Card>
|
||||
|
||||
### Building Your Crew
|
||||
|
||||
<Card title="Quickstart Tutorial" icon="rocket" href="/quickstart">
|
||||
<Card title="Quickstart Tutorial" icon="rocket" href="/en/quickstart">
|
||||
Follow our quickstart guide to create your first agent crew using YAML configuration.
|
||||
</Card>
|
||||
|
||||
@@ -40,4 +40,4 @@ For Enterprise-specific support or questions, contact our dedicated support team
|
||||
|
||||
<Card title="Schedule a Demo" icon="calendar" href="mailto:support@crewai.com">
|
||||
Book time with our team to learn more about Enterprise features and how they can benefit your organization.
|
||||
</Card>
|
||||
</Card>
|
||||
@@ -41,11 +41,8 @@ The CLI provides the fastest way to deploy locally developed crews to the Enterp
|
||||
First, you need to authenticate your CLI with the CrewAI Enterprise platform:
|
||||
|
||||
```bash
|
||||
# If you already have a CrewAI Enterprise account
|
||||
# If you already have a CrewAI Enterprise account, or want to create one:
|
||||
crewai login
|
||||
|
||||
# If you're creating a new account
|
||||
crewai signup
|
||||
```
|
||||
|
||||
When you run either command, the CLI will:
|
||||
@@ -122,7 +119,7 @@ The CrewAI CLI offers several commands to manage your deployments:
|
||||
|
||||
# Remove a deployment
|
||||
crewai deploy remove <deployment_id>
|
||||
```
|
||||
```
|
||||
|
||||
## Option 2: Deploy Directly via Web Interface
|
||||
|
||||
@@ -132,14 +129,14 @@ You can also deploy your crews directly through the CrewAI Enterprise web interf
|
||||
|
||||
<Step title="Pushing to GitHub">
|
||||
|
||||
You need to push your crew to a GitHub repository. If you haven't created a crew yet, you can [follow this tutorial](/quickstart).
|
||||
You need to push your crew to a GitHub repository. If you haven't created a crew yet, you can [follow this tutorial](/en/quickstart).
|
||||
|
||||
</Step>
|
||||
|
||||
<Step title="Connecting GitHub to CrewAI Enterprise">
|
||||
|
||||
1. Log in to [CrewAI Enterprise](https://app.crewai.com)
|
||||
2. Click on the button "Connect GitHub"
|
||||
2. Click on the button "Connect GitHub"
|
||||
|
||||
<Frame>
|
||||

|
||||
@@ -201,20 +198,20 @@ For security reasons, the following environment variable naming patterns are **a
|
||||
|
||||
**Blocked Patterns:**
|
||||
- Variables ending with `_TOKEN` (e.g., `MY_API_TOKEN`)
|
||||
- Variables ending with `_PASSWORD` (e.g., `DB_PASSWORD`)
|
||||
- Variables ending with `_PASSWORD` (e.g., `DB_PASSWORD`)
|
||||
- Variables ending with `_SECRET` (e.g., `API_SECRET`)
|
||||
- Variables ending with `_KEY` in certain contexts
|
||||
|
||||
**Specific Blocked Variables:**
|
||||
- `GITHUB_USER`, `GITHUB_TOKEN`
|
||||
- `AWS_REGION`, `AWS_DEFAULT_REGION`
|
||||
- `AWS_REGION`, `AWS_DEFAULT_REGION`
|
||||
- Various internal CrewAI system variables
|
||||
|
||||
### Allowed Exceptions
|
||||
|
||||
Some variables are explicitly allowed despite matching blocked patterns:
|
||||
- `AZURE_AD_TOKEN`
|
||||
- `AZURE_OPENAI_AD_TOKEN`
|
||||
- `AZURE_OPENAI_AD_TOKEN`
|
||||
- `ENTERPRISE_ACTION_TOKEN`
|
||||
- `CREWAI_ENTEPRISE_TOOLS_TOKEN`
|
||||
|
||||
@@ -228,7 +225,7 @@ OPENAI_TOKEN=sk-...
|
||||
DATABASE_PASSWORD=mypassword
|
||||
API_SECRET=secret123
|
||||
|
||||
# ✅ Use these naming patterns instead
|
||||
# ✅ Use these naming patterns instead
|
||||
OPENAI_API_KEY=sk-...
|
||||
DATABASE_CREDENTIALS=mypassword
|
||||
API_CONFIG=secret123
|
||||
253
docs/en/enterprise/integrations/asana.mdx
Normal file
253
docs/en/enterprise/integrations/asana.mdx
Normal file
@@ -0,0 +1,253 @@
|
||||
---
|
||||
title: Asana Integration
|
||||
description: "Team task and project coordination with Asana integration for CrewAI."
|
||||
icon: "circle"
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
Enable your agents to manage tasks, projects, and team coordination through Asana. Create tasks, update project status, manage assignments, and streamline your team's workflow with AI-powered automation.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
Before using the Asana integration, ensure you have:
|
||||
|
||||
- A [CrewAI Enterprise](https://app.crewai.com) account with an active subscription
|
||||
- An Asana account with appropriate permissions
|
||||
- Connected your Asana account through the [Integrations page](https://app.crewai.com/crewai_plus/connectors)
|
||||
|
||||
## Setting Up Asana Integration
|
||||
|
||||
### 1. Connect Your Asana Account
|
||||
|
||||
1. Navigate to [CrewAI Enterprise Integrations](https://app.crewai.com/crewai_plus/connectors)
|
||||
2. Find **Asana** in the Authentication Integrations section
|
||||
3. Click **Connect** and complete the OAuth flow
|
||||
4. Grant the necessary permissions for task and project management
|
||||
5. Copy your Enterprise Token from [Account Settings](https://app.crewai.com/crewai_plus/settings/account)
|
||||
|
||||
### 2. Install Required Package
|
||||
|
||||
```bash
|
||||
uv add crewai-tools
|
||||
```
|
||||
|
||||
## Available Actions
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="ASANA_CREATE_COMMENT">
|
||||
**Description:** Create a comment in Asana.
|
||||
|
||||
**Parameters:**
|
||||
- `task` (string, required): Task ID - The ID of the Task the comment will be added to. The comment will be authored by the currently authenticated user.
|
||||
- `text` (string, required): Text (example: "This is a comment.").
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="ASANA_CREATE_PROJECT">
|
||||
**Description:** Create a project in Asana.
|
||||
|
||||
**Parameters:**
|
||||
- `name` (string, required): Name (example: "Stuff to buy").
|
||||
- `workspace` (string, required): Workspace - Use Connect Portal Workflow Settings to allow users to select which Workspace to create Projects in. Defaults to the user's first Workspace if left blank.
|
||||
- `team` (string, optional): Team - Use Connect Portal Workflow Settings to allow users to select which Team to share this Project with. Defaults to the user's first Team if left blank.
|
||||
- `notes` (string, optional): Notes (example: "These are things we need to purchase.").
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="ASANA_GET_PROJECTS">
|
||||
**Description:** Get a list of projects in Asana.
|
||||
|
||||
**Parameters:**
|
||||
- `archived` (string, optional): Archived - Choose "true" to show archived projects, "false" to display only active projects, or "default" to show both archived and active projects.
|
||||
- Options: `default`, `true`, `false`
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="ASANA_GET_PROJECT_BY_ID">
|
||||
**Description:** Get a project by ID in Asana.
|
||||
|
||||
**Parameters:**
|
||||
- `projectFilterId` (string, required): Project ID.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="ASANA_CREATE_TASK">
|
||||
**Description:** Create a task in Asana.
|
||||
|
||||
**Parameters:**
|
||||
- `name` (string, required): Name (example: "Task Name").
|
||||
- `workspace` (string, optional): Workspace - Use Connect Portal Workflow Settings to allow users to select which Workspace to create Tasks in. Defaults to the user's first Workspace if left blank..
|
||||
- `project` (string, optional): Project - Use Connect Portal Workflow Settings to allow users to select which Project to create this Task in.
|
||||
- `notes` (string, optional): Notes.
|
||||
- `dueOnDate` (string, optional): Due On - The date on which this task is due. Cannot be used together with Due At. (example: "YYYY-MM-DD").
|
||||
- `dueAtDate` (string, optional): Due At - The date and time (ISO timestamp) at which this task is due. Cannot be used together with Due On. (example: "2019-09-15T02:06:58.147Z").
|
||||
- `assignee` (string, optional): Assignee - The ID of the Asana user this task will be assigned to. Use Connect Portal Workflow Settings to allow users to select an Assignee.
|
||||
- `gid` (string, optional): External ID - An ID from your application to associate this task with. You can use this ID to sync updates to this task later.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="ASANA_UPDATE_TASK">
|
||||
**Description:** Update a task in Asana.
|
||||
|
||||
**Parameters:**
|
||||
- `taskId` (string, required): Task ID - The ID of the Task that will be updated.
|
||||
- `completeStatus` (string, optional): Completed Status.
|
||||
- Options: `true`, `false`
|
||||
- `name` (string, optional): Name (example: "Task Name").
|
||||
- `notes` (string, optional): Notes.
|
||||
- `dueOnDate` (string, optional): Due On - The date on which this task is due. Cannot be used together with Due At. (example: "YYYY-MM-DD").
|
||||
- `dueAtDate` (string, optional): Due At - The date and time (ISO timestamp) at which this task is due. Cannot be used together with Due On. (example: "2019-09-15T02:06:58.147Z").
|
||||
- `assignee` (string, optional): Assignee - The ID of the Asana user this task will be assigned to. Use Connect Portal Workflow Settings to allow users to select an Assignee.
|
||||
- `gid` (string, optional): External ID - An ID from your application to associate this task with. You can use this ID to sync updates to this task later.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="ASANA_GET_TASKS">
|
||||
**Description:** Get a list of tasks in Asana.
|
||||
|
||||
**Parameters:**
|
||||
- `workspace` (string, optional): Workspace - The ID of the Workspace to filter tasks on. Use Connect Portal Workflow Settings to allow users to select a Workspace.
|
||||
- `project` (string, optional): Project - The ID of the Project to filter tasks on. Use Connect Portal Workflow Settings to allow users to select a Project.
|
||||
- `assignee` (string, optional): Assignee - The ID of the assignee to filter tasks on. Use Connect Portal Workflow Settings to allow users to select an Assignee.
|
||||
- `completedSince` (string, optional): Completed since - Only return tasks that are either incomplete or that have been completed since this time (ISO or Unix timestamp). (example: "2014-04-25T16:15:47-04:00").
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="ASANA_GET_TASKS_BY_ID">
|
||||
**Description:** Get a list of tasks by ID in Asana.
|
||||
|
||||
**Parameters:**
|
||||
- `taskId` (string, required): Task ID.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="ASANA_GET_TASK_BY_EXTERNAL_ID">
|
||||
**Description:** Get a task by external ID in Asana.
|
||||
|
||||
**Parameters:**
|
||||
- `gid` (string, required): External ID - The ID that this task is associated or synced with, from your application.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="ASANA_ADD_TASK_TO_SECTION">
|
||||
**Description:** Add a task to a section in Asana.
|
||||
|
||||
**Parameters:**
|
||||
- `sectionId` (string, required): Section ID - The ID of the section to add this task to.
|
||||
- `taskId` (string, required): Task ID - The ID of the task. (example: "1204619611402340").
|
||||
- `beforeTaskId` (string, optional): Before Task ID - The ID of a task in this section that this task will be inserted before. Cannot be used with After Task ID. (example: "1204619611402340").
|
||||
- `afterTaskId` (string, optional): After Task ID - The ID of a task in this section that this task will be inserted after. Cannot be used with Before Task ID. (example: "1204619611402340").
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="ASANA_GET_TEAMS">
|
||||
**Description:** Get a list of teams in Asana.
|
||||
|
||||
**Parameters:**
|
||||
- `workspace` (string, required): Workspace - Returns the teams in this workspace visible to the authorized user.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="ASANA_GET_WORKSPACES">
|
||||
**Description:** Get a list of workspaces in Asana.
|
||||
|
||||
**Parameters:** None required.
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
## Usage Examples
|
||||
|
||||
### Basic Asana Agent Setup
|
||||
|
||||
```python
|
||||
from crewai import Agent, Task, Crew
|
||||
from crewai_tools import CrewaiEnterpriseTools
|
||||
|
||||
# Get enterprise tools (Asana tools will be included)
|
||||
enterprise_tools = CrewaiEnterpriseTools(
|
||||
enterprise_token="your_enterprise_token"
|
||||
)
|
||||
|
||||
# Create an agent with Asana capabilities
|
||||
asana_agent = Agent(
|
||||
role="Project Manager",
|
||||
goal="Manage tasks and projects in Asana efficiently",
|
||||
backstory="An AI assistant specialized in project management and task coordination.",
|
||||
tools=[enterprise_tools]
|
||||
)
|
||||
|
||||
# Task to create a new project
|
||||
create_project_task = Task(
|
||||
description="Create a new project called 'Q1 Marketing Campaign' in the Marketing workspace",
|
||||
agent=asana_agent,
|
||||
expected_output="Confirmation that the project was created successfully with project ID"
|
||||
)
|
||||
|
||||
# Run the task
|
||||
crew = Crew(
|
||||
agents=[asana_agent],
|
||||
tasks=[create_project_task]
|
||||
)
|
||||
|
||||
crew.kickoff()
|
||||
```
|
||||
|
||||
### Filtering Specific Asana Tools
|
||||
|
||||
```python
|
||||
from crewai_tools import CrewaiEnterpriseTools
|
||||
|
||||
# Get only specific Asana tools
|
||||
enterprise_tools = CrewaiEnterpriseTools(
|
||||
enterprise_token="your_enterprise_token",
|
||||
actions_list=["asana_create_task", "asana_update_task", "asana_get_tasks"]
|
||||
)
|
||||
|
||||
task_manager_agent = Agent(
|
||||
role="Task Manager",
|
||||
goal="Create and manage tasks efficiently",
|
||||
backstory="An AI assistant that focuses on task creation and management.",
|
||||
tools=enterprise_tools
|
||||
)
|
||||
|
||||
# Task to create and assign a task
|
||||
task_management = Task(
|
||||
description="Create a task called 'Review quarterly reports' and assign it to the appropriate team member",
|
||||
agent=task_manager_agent,
|
||||
expected_output="Task created and assigned successfully"
|
||||
)
|
||||
|
||||
crew = Crew(
|
||||
agents=[task_manager_agent],
|
||||
tasks=[task_management]
|
||||
)
|
||||
|
||||
crew.kickoff()
|
||||
```
|
||||
|
||||
### Advanced Project Management
|
||||
|
||||
```python
|
||||
from crewai import Agent, Task, Crew
|
||||
from crewai_tools import CrewaiEnterpriseTools
|
||||
|
||||
enterprise_tools = CrewaiEnterpriseTools(
|
||||
enterprise_token="your_enterprise_token"
|
||||
)
|
||||
|
||||
project_coordinator = Agent(
|
||||
role="Project Coordinator",
|
||||
goal="Coordinate project activities and track progress",
|
||||
backstory="An experienced project coordinator who ensures projects run smoothly.",
|
||||
tools=[enterprise_tools]
|
||||
)
|
||||
|
||||
# Complex task involving multiple Asana operations
|
||||
coordination_task = Task(
|
||||
description="""
|
||||
1. Get all active projects in the workspace
|
||||
2. For each project, get the list of incomplete tasks
|
||||
3. Create a summary report task in the 'Management Reports' project
|
||||
4. Add comments to overdue tasks to request status updates
|
||||
""",
|
||||
agent=project_coordinator,
|
||||
expected_output="Summary report created and status update requests sent for overdue tasks"
|
||||
)
|
||||
|
||||
crew = Crew(
|
||||
agents=[project_coordinator],
|
||||
tasks=[coordination_task]
|
||||
)
|
||||
|
||||
crew.kickoff()
|
||||
```
|
||||
268
docs/en/enterprise/integrations/box.mdx
Normal file
268
docs/en/enterprise/integrations/box.mdx
Normal file
@@ -0,0 +1,268 @@
|
||||
---
|
||||
title: Box Integration
|
||||
description: "File storage and document management with Box integration for CrewAI."
|
||||
icon: "box"
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
Enable your agents to manage files, folders, and documents through Box. Upload files, organize folder structures, search content, and streamline your team's document management with AI-powered automation.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
Before using the Box integration, ensure you have:
|
||||
|
||||
- A [CrewAI Enterprise](https://app.crewai.com) account with an active subscription
|
||||
- A Box account with appropriate permissions
|
||||
- Connected your Box account through the [Integrations page](https://app.crewai.com/crewai_plus/connectors)
|
||||
|
||||
## Setting Up Box Integration
|
||||
|
||||
### 1. Connect Your Box Account
|
||||
|
||||
1. Navigate to [CrewAI Enterprise Integrations](https://app.crewai.com/crewai_plus/connectors)
|
||||
2. Find **Box** in the Authentication Integrations section
|
||||
3. Click **Connect** and complete the OAuth flow
|
||||
4. Grant the necessary permissions for file and folder management
|
||||
5. Copy your Enterprise Token from [Account Settings](https://app.crewai.com/crewai_plus/settings/account)
|
||||
|
||||
### 2. Install Required Package
|
||||
|
||||
```bash
|
||||
uv add crewai-tools
|
||||
```
|
||||
|
||||
## Available Actions
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="BOX_SAVE_FILE">
|
||||
**Description:** Save a file from URL in Box.
|
||||
|
||||
**Parameters:**
|
||||
- `fileAttributes` (object, required): Attributes - File metadata including name, parent folder, and timestamps.
|
||||
```json
|
||||
{
|
||||
"content_created_at": "2012-12-12T10:53:43-08:00",
|
||||
"content_modified_at": "2012-12-12T10:53:43-08:00",
|
||||
"name": "qwerty.png",
|
||||
"parent": { "id": "1234567" }
|
||||
}
|
||||
```
|
||||
- `file` (string, required): File URL - Files must be smaller than 50MB in size. (example: "https://picsum.photos/200/300").
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="BOX_SAVE_FILE_FROM_OBJECT">
|
||||
**Description:** Save a file in Box.
|
||||
|
||||
**Parameters:**
|
||||
- `file` (string, required): File - Accepts a File Object containing file data. Files must be smaller than 50MB in size.
|
||||
- `fileName` (string, required): File Name (example: "qwerty.png").
|
||||
- `folder` (string, optional): Folder - Use Connect Portal Workflow Settings to allow users to select the File's Folder destination. Defaults to the user's root folder if left blank.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="BOX_GET_FILE_BY_ID">
|
||||
**Description:** Get a file by ID in Box.
|
||||
|
||||
**Parameters:**
|
||||
- `fileId` (string, required): File ID - The unique identifier that represents a file. (example: "12345").
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="BOX_LIST_FILES">
|
||||
**Description:** List files in Box.
|
||||
|
||||
**Parameters:**
|
||||
- `folderId` (string, required): Folder ID - The unique identifier that represents a folder. (example: "0").
|
||||
- `filterFormula` (object, optional): A filter in disjunctive normal form - OR of AND groups of single conditions.
|
||||
```json
|
||||
{
|
||||
"operator": "OR",
|
||||
"conditions": [
|
||||
{
|
||||
"operator": "AND",
|
||||
"conditions": [
|
||||
{
|
||||
"field": "direction",
|
||||
"operator": "$stringExactlyMatches",
|
||||
"value": "ASC"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="BOX_CREATE_FOLDER">
|
||||
**Description:** Create a folder in Box.
|
||||
|
||||
**Parameters:**
|
||||
- `folderName` (string, required): Name - The name for the new folder. (example: "New Folder").
|
||||
- `folderParent` (object, required): Parent Folder - The parent folder where the new folder will be created.
|
||||
```json
|
||||
{
|
||||
"id": "123456"
|
||||
}
|
||||
```
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="BOX_MOVE_FOLDER">
|
||||
**Description:** Move a folder in Box.
|
||||
|
||||
**Parameters:**
|
||||
- `folderId` (string, required): Folder ID - The unique identifier that represents a folder. (example: "0").
|
||||
- `folderName` (string, required): Name - The name for the folder. (example: "New Folder").
|
||||
- `folderParent` (object, required): Parent Folder - The new parent folder destination.
|
||||
```json
|
||||
{
|
||||
"id": "123456"
|
||||
}
|
||||
```
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="BOX_GET_FOLDER_BY_ID">
|
||||
**Description:** Get a folder by ID in Box.
|
||||
|
||||
**Parameters:**
|
||||
- `folderId` (string, required): Folder ID - The unique identifier that represents a folder. (example: "0").
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="BOX_SEARCH_FOLDERS">
|
||||
**Description:** Search folders in Box.
|
||||
|
||||
**Parameters:**
|
||||
- `folderId` (string, required): Folder ID - The folder to search within.
|
||||
- `filterFormula` (object, optional): A filter in disjunctive normal form - OR of AND groups of single conditions.
|
||||
```json
|
||||
{
|
||||
"operator": "OR",
|
||||
"conditions": [
|
||||
{
|
||||
"operator": "AND",
|
||||
"conditions": [
|
||||
{
|
||||
"field": "sort",
|
||||
"operator": "$stringExactlyMatches",
|
||||
"value": "name"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="BOX_DELETE_FOLDER">
|
||||
**Description:** Delete a folder in Box.
|
||||
|
||||
**Parameters:**
|
||||
- `folderId` (string, required): Folder ID - The unique identifier that represents a folder. (example: "0").
|
||||
- `recursive` (boolean, optional): Recursive - Delete a folder that is not empty by recursively deleting the folder and all of its content.
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
## Usage Examples
|
||||
|
||||
### Basic Box Agent Setup
|
||||
|
||||
```python
|
||||
from crewai import Agent, Task, Crew
|
||||
from crewai_tools import CrewaiEnterpriseTools
|
||||
|
||||
# Get enterprise tools (Box tools will be included)
|
||||
enterprise_tools = CrewaiEnterpriseTools(
|
||||
enterprise_token="your_enterprise_token"
|
||||
)
|
||||
|
||||
# Create an agent with Box capabilities
|
||||
box_agent = Agent(
|
||||
role="Document Manager",
|
||||
goal="Manage files and folders in Box efficiently",
|
||||
backstory="An AI assistant specialized in document management and file organization.",
|
||||
tools=[enterprise_tools]
|
||||
)
|
||||
|
||||
# Task to create a folder structure
|
||||
create_structure_task = Task(
|
||||
description="Create a folder called 'Project Files' in the root directory and upload a document from URL",
|
||||
agent=box_agent,
|
||||
expected_output="Folder created and file uploaded successfully"
|
||||
)
|
||||
|
||||
# Run the task
|
||||
crew = Crew(
|
||||
agents=[box_agent],
|
||||
tasks=[create_structure_task]
|
||||
)
|
||||
|
||||
crew.kickoff()
|
||||
```
|
||||
|
||||
### Filtering Specific Box Tools
|
||||
|
||||
```python
|
||||
from crewai_tools import CrewaiEnterpriseTools
|
||||
|
||||
# Get only specific Box tools
|
||||
enterprise_tools = CrewaiEnterpriseTools(
|
||||
enterprise_token="your_enterprise_token",
|
||||
actions_list=["box_create_folder", "box_save_file", "box_list_files"]
|
||||
)
|
||||
|
||||
file_organizer_agent = Agent(
|
||||
role="File Organizer",
|
||||
goal="Organize and manage file storage efficiently",
|
||||
backstory="An AI assistant that focuses on file organization and storage management.",
|
||||
tools=enterprise_tools
|
||||
)
|
||||
|
||||
# Task to organize files
|
||||
organization_task = Task(
|
||||
description="Create a folder structure for the marketing team and organize existing files",
|
||||
agent=file_organizer_agent,
|
||||
expected_output="Folder structure created and files organized"
|
||||
)
|
||||
|
||||
crew = Crew(
|
||||
agents=[file_organizer_agent],
|
||||
tasks=[organization_task]
|
||||
)
|
||||
|
||||
crew.kickoff()
|
||||
```
|
||||
|
||||
### Advanced File Management
|
||||
|
||||
```python
|
||||
from crewai import Agent, Task, Crew
|
||||
from crewai_tools import CrewaiEnterpriseTools
|
||||
|
||||
enterprise_tools = CrewaiEnterpriseTools(
|
||||
enterprise_token="your_enterprise_token"
|
||||
)
|
||||
|
||||
file_manager = Agent(
|
||||
role="File Manager",
|
||||
goal="Maintain organized file structure and manage document lifecycle",
|
||||
backstory="An experienced file manager who ensures documents are properly organized and accessible.",
|
||||
tools=[enterprise_tools]
|
||||
)
|
||||
|
||||
# Complex task involving multiple Box operations
|
||||
management_task = Task(
|
||||
description="""
|
||||
1. List all files in the root folder
|
||||
2. Create monthly archive folders for the current year
|
||||
3. Move old files to appropriate archive folders
|
||||
4. Generate a summary report of the file organization
|
||||
""",
|
||||
agent=file_manager,
|
||||
expected_output="Files organized into archive structure with summary report"
|
||||
)
|
||||
|
||||
crew = Crew(
|
||||
agents=[file_manager],
|
||||
tasks=[management_task]
|
||||
)
|
||||
|
||||
crew.kickoff()
|
||||
```
|
||||
293
docs/en/enterprise/integrations/clickup.mdx
Normal file
293
docs/en/enterprise/integrations/clickup.mdx
Normal file
@@ -0,0 +1,293 @@
|
||||
---
|
||||
title: ClickUp Integration
|
||||
description: "Task and productivity management with ClickUp integration for CrewAI."
|
||||
icon: "list-check"
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
Enable your agents to manage tasks, projects, and productivity workflows through ClickUp. Create and update tasks, organize projects, manage team assignments, and streamline your productivity management with AI-powered automation.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
Before using the ClickUp integration, ensure you have:
|
||||
|
||||
- A [CrewAI Enterprise](https://app.crewai.com) account with an active subscription
|
||||
- A ClickUp account with appropriate permissions
|
||||
- Connected your ClickUp account through the [Integrations page](https://app.crewai.com/crewai_plus/connectors)
|
||||
|
||||
## Setting Up ClickUp Integration
|
||||
|
||||
### 1. Connect Your ClickUp Account
|
||||
|
||||
1. Navigate to [CrewAI Enterprise Integrations](https://app.crewai.com/crewai_plus/connectors)
|
||||
2. Find **ClickUp** in the Authentication Integrations section
|
||||
3. Click **Connect** and complete the OAuth flow
|
||||
4. Grant the necessary permissions for task and project management
|
||||
5. Copy your Enterprise Token from [Account Settings](https://app.crewai.com/crewai_plus/settings/account)
|
||||
|
||||
### 2. Install Required Package
|
||||
|
||||
```bash
|
||||
uv add crewai-tools
|
||||
```
|
||||
|
||||
## Available Actions
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="CLICKUP_SEARCH_TASKS">
|
||||
**Description:** Search for tasks in ClickUp using advanced filters.
|
||||
|
||||
**Parameters:**
|
||||
- `taskFilterFormula` (object, optional): A filter in disjunctive normal form - OR of AND groups of single conditions.
|
||||
```json
|
||||
{
|
||||
"operator": "OR",
|
||||
"conditions": [
|
||||
{
|
||||
"operator": "AND",
|
||||
"conditions": [
|
||||
{
|
||||
"field": "statuses%5B%5D",
|
||||
"operator": "$stringExactlyMatches",
|
||||
"value": "open"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
Available fields: `space_ids%5B%5D`, `project_ids%5B%5D`, `list_ids%5B%5D`, `statuses%5B%5D`, `include_closed`, `assignees%5B%5D`, `tags%5B%5D`, `due_date_gt`, `due_date_lt`, `date_created_gt`, `date_created_lt`, `date_updated_gt`, `date_updated_lt`
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="CLICKUP_GET_TASK_IN_LIST">
|
||||
**Description:** Get tasks in a specific list in ClickUp.
|
||||
|
||||
**Parameters:**
|
||||
- `listId` (string, required): List - Select a List to get tasks from. Use Connect Portal User Settings to allow users to select a ClickUp List.
|
||||
- `taskFilterFormula` (string, optional): Search for tasks that match specified filters. For example: name=task1.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="CLICKUP_CREATE_TASK">
|
||||
**Description:** Create a task in ClickUp.
|
||||
|
||||
**Parameters:**
|
||||
- `listId` (string, required): List - Select a List to create this task in. Use Connect Portal User Settings to allow users to select a ClickUp List.
|
||||
- `name` (string, required): Name - The task name.
|
||||
- `description` (string, optional): Description - Task description.
|
||||
- `status` (string, optional): Status - Select a Status for this task. Use Connect Portal User Settings to allow users to select a ClickUp Status.
|
||||
- `assignees` (string, optional): Assignees - Select a Member (or an array of member IDs) to be assigned to this task. Use Connect Portal User Settings to allow users to select a ClickUp Member.
|
||||
- `dueDate` (string, optional): Due Date - Specify a date for this task to be due on.
|
||||
- `additionalFields` (string, optional): Additional Fields - Specify additional fields to include on this task as JSON.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="CLICKUP_UPDATE_TASK">
|
||||
**Description:** Update a task in ClickUp.
|
||||
|
||||
**Parameters:**
|
||||
- `taskId` (string, required): Task ID - The ID of the task to update.
|
||||
- `listId` (string, required): List - Select a List to create this task in. Use Connect Portal User Settings to allow users to select a ClickUp List.
|
||||
- `name` (string, optional): Name - The task name.
|
||||
- `description` (string, optional): Description - Task description.
|
||||
- `status` (string, optional): Status - Select a Status for this task. Use Connect Portal User Settings to allow users to select a ClickUp Status.
|
||||
- `assignees` (string, optional): Assignees - Select a Member (or an array of member IDs) to be assigned to this task. Use Connect Portal User Settings to allow users to select a ClickUp Member.
|
||||
- `dueDate` (string, optional): Due Date - Specify a date for this task to be due on.
|
||||
- `additionalFields` (string, optional): Additional Fields - Specify additional fields to include on this task as JSON.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="CLICKUP_DELETE_TASK">
|
||||
**Description:** Delete a task in ClickUp.
|
||||
|
||||
**Parameters:**
|
||||
- `taskId` (string, required): Task ID - The ID of the task to delete.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="CLICKUP_GET_LIST">
|
||||
**Description:** Get List information in ClickUp.
|
||||
|
||||
**Parameters:**
|
||||
- `spaceId` (string, required): Space ID - The ID of the space containing the lists.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="CLICKUP_GET_CUSTOM_FIELDS_IN_LIST">
|
||||
**Description:** Get Custom Fields in a List in ClickUp.
|
||||
|
||||
**Parameters:**
|
||||
- `listId` (string, required): List ID - The ID of the list to get custom fields from.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="CLICKUP_GET_ALL_FIELDS_IN_LIST">
|
||||
**Description:** Get All Fields in a List in ClickUp.
|
||||
|
||||
**Parameters:**
|
||||
- `listId` (string, required): List ID - The ID of the list to get all fields from.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="CLICKUP_GET_SPACE">
|
||||
**Description:** Get Space information in ClickUp.
|
||||
|
||||
**Parameters:**
|
||||
- `spaceId` (string, optional): Space ID - The ID of the space to retrieve.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="CLICKUP_GET_FOLDERS">
|
||||
**Description:** Get Folders in ClickUp.
|
||||
|
||||
**Parameters:**
|
||||
- `spaceId` (string, required): Space ID - The ID of the space containing the folders.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="CLICKUP_GET_MEMBER">
|
||||
**Description:** Get Member information in ClickUp.
|
||||
|
||||
**Parameters:** None required.
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
## Usage Examples
|
||||
|
||||
### Basic ClickUp Agent Setup
|
||||
|
||||
```python
|
||||
from crewai import Agent, Task, Crew
|
||||
from crewai_tools import CrewaiEnterpriseTools
|
||||
|
||||
# Get enterprise tools (ClickUp tools will be included)
|
||||
enterprise_tools = CrewaiEnterpriseTools(
|
||||
enterprise_token="your_enterprise_token"
|
||||
)
|
||||
|
||||
# Create an agent with ClickUp capabilities
|
||||
clickup_agent = Agent(
|
||||
role="Task Manager",
|
||||
goal="Manage tasks and projects in ClickUp efficiently",
|
||||
backstory="An AI assistant specialized in task management and productivity coordination.",
|
||||
tools=[enterprise_tools]
|
||||
)
|
||||
|
||||
# Task to create a new task
|
||||
create_task = Task(
|
||||
description="Create a task called 'Review Q1 Reports' in the Marketing list with high priority",
|
||||
agent=clickup_agent,
|
||||
expected_output="Task created successfully with task ID"
|
||||
)
|
||||
|
||||
# Run the task
|
||||
crew = Crew(
|
||||
agents=[clickup_agent],
|
||||
tasks=[create_task]
|
||||
)
|
||||
|
||||
crew.kickoff()
|
||||
```
|
||||
|
||||
### Filtering Specific ClickUp Tools
|
||||
|
||||
```python
|
||||
from crewai_tools import CrewaiEnterpriseTools
|
||||
|
||||
# Get only specific ClickUp tools
|
||||
enterprise_tools = CrewaiEnterpriseTools(
|
||||
enterprise_token="your_enterprise_token",
|
||||
actions_list=["clickup_create_task", "clickup_update_task", "clickup_search_tasks"]
|
||||
)
|
||||
|
||||
task_coordinator = Agent(
|
||||
role="Task Coordinator",
|
||||
goal="Create and manage tasks efficiently",
|
||||
backstory="An AI assistant that focuses on task creation and status management.",
|
||||
tools=enterprise_tools
|
||||
)
|
||||
|
||||
# Task to manage task workflow
|
||||
task_workflow = Task(
|
||||
description="Create a task for project planning and assign it to the development team",
|
||||
agent=task_coordinator,
|
||||
expected_output="Task created and assigned successfully"
|
||||
)
|
||||
|
||||
crew = Crew(
|
||||
agents=[task_coordinator],
|
||||
tasks=[task_workflow]
|
||||
)
|
||||
|
||||
crew.kickoff()
|
||||
```
|
||||
|
||||
### Advanced Project Management
|
||||
|
||||
```python
|
||||
from crewai import Agent, Task, Crew
|
||||
from crewai_tools import CrewaiEnterpriseTools
|
||||
|
||||
enterprise_tools = CrewaiEnterpriseTools(
|
||||
enterprise_token="your_enterprise_token"
|
||||
)
|
||||
|
||||
project_manager = Agent(
|
||||
role="Project Manager",
|
||||
goal="Coordinate project activities and track team productivity",
|
||||
backstory="An experienced project manager who ensures projects are delivered on time.",
|
||||
tools=[enterprise_tools]
|
||||
)
|
||||
|
||||
# Complex task involving multiple ClickUp operations
|
||||
project_coordination = Task(
|
||||
description="""
|
||||
1. Get all open tasks in the current space
|
||||
2. Identify overdue tasks and update their status
|
||||
3. Create a weekly report task summarizing project progress
|
||||
4. Assign the report task to the team lead
|
||||
""",
|
||||
agent=project_manager,
|
||||
expected_output="Project status updated and weekly report task created and assigned"
|
||||
)
|
||||
|
||||
crew = Crew(
|
||||
agents=[project_manager],
|
||||
tasks=[project_coordination]
|
||||
)
|
||||
|
||||
crew.kickoff()
|
||||
```
|
||||
|
||||
### Task Search and Management
|
||||
|
||||
```python
|
||||
from crewai import Agent, Task, Crew
|
||||
from crewai_tools import CrewaiEnterpriseTools
|
||||
|
||||
enterprise_tools = CrewaiEnterpriseTools(
|
||||
enterprise_token="your_enterprise_token"
|
||||
)
|
||||
|
||||
task_analyst = Agent(
|
||||
role="Task Analyst",
|
||||
goal="Analyze task patterns and optimize team productivity",
|
||||
backstory="An AI assistant that analyzes task data to improve team efficiency.",
|
||||
tools=[enterprise_tools]
|
||||
)
|
||||
|
||||
# Task to analyze and optimize task distribution
|
||||
task_analysis = Task(
|
||||
description="""
|
||||
Search for all tasks assigned to team members in the last 30 days,
|
||||
analyze completion patterns, and create optimization recommendations
|
||||
""",
|
||||
agent=task_analyst,
|
||||
expected_output="Task analysis report with optimization recommendations"
|
||||
)
|
||||
|
||||
crew = Crew(
|
||||
agents=[task_analyst],
|
||||
tasks=[task_analysis]
|
||||
)
|
||||
|
||||
crew.kickoff()
|
||||
```
|
||||
|
||||
### Getting Help
|
||||
|
||||
<Card title="Need Help?" icon="headset" href="mailto:support@crewai.com">
|
||||
Contact our support team for assistance with ClickUp integration setup or troubleshooting.
|
||||
</Card>
|
||||
323
docs/en/enterprise/integrations/github.mdx
Normal file
323
docs/en/enterprise/integrations/github.mdx
Normal file
@@ -0,0 +1,323 @@
|
||||
---
|
||||
title: GitHub Integration
|
||||
description: "Repository and issue management with GitHub integration for CrewAI."
|
||||
icon: "github"
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
Enable your agents to manage repositories, issues, and releases through GitHub. Create and update issues, manage releases, track project development, and streamline your software development workflow with AI-powered automation.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
Before using the GitHub integration, ensure you have:
|
||||
|
||||
- A [CrewAI Enterprise](https://app.crewai.com) account with an active subscription
|
||||
- A GitHub account with appropriate repository permissions
|
||||
- Connected your GitHub account through the [Integrations page](https://app.crewai.com/crewai_plus/connectors)
|
||||
|
||||
## Setting Up GitHub Integration
|
||||
|
||||
### 1. Connect Your GitHub Account
|
||||
|
||||
1. Navigate to [CrewAI Enterprise Integrations](https://app.crewai.com/crewai_plus/connectors)
|
||||
2. Find **GitHub** in the Authentication Integrations section
|
||||
3. Click **Connect** and complete the OAuth flow
|
||||
4. Grant the necessary permissions for repository and issue management
|
||||
5. Copy your Enterprise Token from [Account Settings](https://app.crewai.com/crewai_plus/settings/account)
|
||||
|
||||
### 2. Install Required Package
|
||||
|
||||
```bash
|
||||
uv add crewai-tools
|
||||
```
|
||||
|
||||
## Available Actions
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="GITHUB_CREATE_ISSUE">
|
||||
**Description:** Create an issue in GitHub.
|
||||
|
||||
**Parameters:**
|
||||
- `owner` (string, required): Owner - Specify the name of the account owner of the associated repository for this Issue. (example: "abc").
|
||||
- `repo` (string, required): Repository - Specify the name of the associated repository for this Issue.
|
||||
- `title` (string, required): Issue Title - Specify the title of the issue to create.
|
||||
- `body` (string, optional): Issue Body - Specify the body contents of the issue to create.
|
||||
- `assignees` (string, optional): Assignees - Specify the assignee(s)' GitHub login as an array of strings for this issue. (example: `["octocat"]`).
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="GITHUB_UPDATE_ISSUE">
|
||||
**Description:** Update an issue in GitHub.
|
||||
|
||||
**Parameters:**
|
||||
- `owner` (string, required): Owner - Specify the name of the account owner of the associated repository for this Issue. (example: "abc").
|
||||
- `repo` (string, required): Repository - Specify the name of the associated repository for this Issue.
|
||||
- `issue_number` (string, required): Issue Number - Specify the number of the issue to update.
|
||||
- `title` (string, required): Issue Title - Specify the title of the issue to update.
|
||||
- `body` (string, optional): Issue Body - Specify the body contents of the issue to update.
|
||||
- `assignees` (string, optional): Assignees - Specify the assignee(s)' GitHub login as an array of strings for this issue. (example: `["octocat"]`).
|
||||
- `state` (string, optional): State - Specify the updated state of the issue.
|
||||
- Options: `open`, `closed`
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="GITHUB_GET_ISSUE_BY_NUMBER">
|
||||
**Description:** Get an issue by number in GitHub.
|
||||
|
||||
**Parameters:**
|
||||
- `owner` (string, required): Owner - Specify the name of the account owner of the associated repository for this Issue. (example: "abc").
|
||||
- `repo` (string, required): Repository - Specify the name of the associated repository for this Issue.
|
||||
- `issue_number` (string, required): Issue Number - Specify the number of the issue to fetch.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="GITHUB_LOCK_ISSUE">
|
||||
**Description:** Lock an issue in GitHub.
|
||||
|
||||
**Parameters:**
|
||||
- `owner` (string, required): Owner - Specify the name of the account owner of the associated repository for this Issue. (example: "abc").
|
||||
- `repo` (string, required): Repository - Specify the name of the associated repository for this Issue.
|
||||
- `issue_number` (string, required): Issue Number - Specify the number of the issue to lock.
|
||||
- `lock_reason` (string, required): Lock Reason - Specify a reason for locking the issue or pull request conversation.
|
||||
- Options: `off-topic`, `too heated`, `resolved`, `spam`
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="GITHUB_SEARCH_ISSUE">
|
||||
**Description:** Search for issues in GitHub.
|
||||
|
||||
**Parameters:**
|
||||
- `owner` (string, required): Owner - Specify the name of the account owner of the associated repository for this Issue. (example: "abc").
|
||||
- `repo` (string, required): Repository - Specify the name of the associated repository for this Issue.
|
||||
- `filter` (object, required): A filter in disjunctive normal form - OR of AND groups of single conditions.
|
||||
```json
|
||||
{
|
||||
"operator": "OR",
|
||||
"conditions": [
|
||||
{
|
||||
"operator": "AND",
|
||||
"conditions": [
|
||||
{
|
||||
"field": "assignee",
|
||||
"operator": "$stringExactlyMatches",
|
||||
"value": "octocat"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
Available fields: `assignee`, `creator`, `mentioned`, `labels`
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="GITHUB_CREATE_RELEASE">
|
||||
**Description:** Create a release in GitHub.
|
||||
|
||||
**Parameters:**
|
||||
- `owner` (string, required): Owner - Specify the name of the account owner of the associated repository for this Release. (example: "abc").
|
||||
- `repo` (string, required): Repository - Specify the name of the associated repository for this Release.
|
||||
- `tag_name` (string, required): Name - Specify the name of the release tag to be created. (example: "v1.0.0").
|
||||
- `target_commitish` (string, optional): Target - Specify the target of the release. This can either be a branch name or a commit SHA. Defaults to the main branch. (example: "master").
|
||||
- `body` (string, optional): Body - Specify a description for this release.
|
||||
- `draft` (string, optional): Draft - Specify whether the created release should be a draft (unpublished) release.
|
||||
- Options: `true`, `false`
|
||||
- `prerelease` (string, optional): Prerelease - Specify whether the created release should be a prerelease.
|
||||
- Options: `true`, `false`
|
||||
- `discussion_category_name` (string, optional): Discussion Category Name - If specified, a discussion of the specified category is created and linked to the release. The value must be a category that already exists in the repository.
|
||||
- `generate_release_notes` (string, optional): Release Notes - Specify whether the created release should automatically create release notes using the provided name and body specified.
|
||||
- Options: `true`, `false`
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="GITHUB_UPDATE_RELEASE">
|
||||
**Description:** Update a release in GitHub.
|
||||
|
||||
**Parameters:**
|
||||
- `owner` (string, required): Owner - Specify the name of the account owner of the associated repository for this Release. (example: "abc").
|
||||
- `repo` (string, required): Repository - Specify the name of the associated repository for this Release.
|
||||
- `id` (string, required): Release ID - Specify the ID of the release to update.
|
||||
- `tag_name` (string, optional): Name - Specify the name of the release tag to be updated. (example: "v1.0.0").
|
||||
- `target_commitish` (string, optional): Target - Specify the target of the release. This can either be a branch name or a commit SHA. Defaults to the main branch. (example: "master").
|
||||
- `body` (string, optional): Body - Specify a description for this release.
|
||||
- `draft` (string, optional): Draft - Specify whether the created release should be a draft (unpublished) release.
|
||||
- Options: `true`, `false`
|
||||
- `prerelease` (string, optional): Prerelease - Specify whether the created release should be a prerelease.
|
||||
- Options: `true`, `false`
|
||||
- `discussion_category_name` (string, optional): Discussion Category Name - If specified, a discussion of the specified category is created and linked to the release. The value must be a category that already exists in the repository.
|
||||
- `generate_release_notes` (string, optional): Release Notes - Specify whether the created release should automatically create release notes using the provided name and body specified.
|
||||
- Options: `true`, `false`
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="GITHUB_GET_RELEASE_BY_ID">
|
||||
**Description:** Get a release by ID in GitHub.
|
||||
|
||||
**Parameters:**
|
||||
- `owner` (string, required): Owner - Specify the name of the account owner of the associated repository for this Release. (example: "abc").
|
||||
- `repo` (string, required): Repository - Specify the name of the associated repository for this Release.
|
||||
- `id` (string, required): Release ID - Specify the release ID of the release to fetch.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="GITHUB_GET_RELEASE_BY_TAG_NAME">
|
||||
**Description:** Get a release by tag name in GitHub.
|
||||
|
||||
**Parameters:**
|
||||
- `owner` (string, required): Owner - Specify the name of the account owner of the associated repository for this Release. (example: "abc").
|
||||
- `repo` (string, required): Repository - Specify the name of the associated repository for this Release.
|
||||
- `tag_name` (string, required): Name - Specify the tag of the release to fetch. (example: "v1.0.0").
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="GITHUB_DELETE_RELEASE">
|
||||
**Description:** Delete a release in GitHub.
|
||||
|
||||
**Parameters:**
|
||||
- `owner` (string, required): Owner - Specify the name of the account owner of the associated repository for this Release. (example: "abc").
|
||||
- `repo` (string, required): Repository - Specify the name of the associated repository for this Release.
|
||||
- `id` (string, required): Release ID - Specify the ID of the release to delete.
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
## Usage Examples
|
||||
|
||||
### Basic GitHub Agent Setup
|
||||
|
||||
```python
|
||||
from crewai import Agent, Task, Crew
|
||||
from crewai_tools import CrewaiEnterpriseTools
|
||||
|
||||
# Get enterprise tools (GitHub tools will be included)
|
||||
enterprise_tools = CrewaiEnterpriseTools(
|
||||
enterprise_token="your_enterprise_token"
|
||||
)
|
||||
|
||||
# Create an agent with GitHub capabilities
|
||||
github_agent = Agent(
|
||||
role="Repository Manager",
|
||||
goal="Manage GitHub repositories, issues, and releases efficiently",
|
||||
backstory="An AI assistant specialized in repository management and issue tracking.",
|
||||
tools=[enterprise_tools]
|
||||
)
|
||||
|
||||
# Task to create a new issue
|
||||
create_issue_task = Task(
|
||||
description="Create a bug report issue for the login functionality in the main repository",
|
||||
agent=github_agent,
|
||||
expected_output="Issue created successfully with issue number"
|
||||
)
|
||||
|
||||
# Run the task
|
||||
crew = Crew(
|
||||
agents=[github_agent],
|
||||
tasks=[create_issue_task]
|
||||
)
|
||||
|
||||
crew.kickoff()
|
||||
```
|
||||
|
||||
### Filtering Specific GitHub Tools
|
||||
|
||||
```python
|
||||
from crewai_tools import CrewaiEnterpriseTools
|
||||
|
||||
# Get only specific GitHub tools
|
||||
enterprise_tools = CrewaiEnterpriseTools(
|
||||
enterprise_token="your_enterprise_token",
|
||||
actions_list=["github_create_issue", "github_update_issue", "github_search_issue"]
|
||||
)
|
||||
|
||||
issue_manager = Agent(
|
||||
role="Issue Manager",
|
||||
goal="Create and manage GitHub issues efficiently",
|
||||
backstory="An AI assistant that focuses on issue tracking and management.",
|
||||
tools=enterprise_tools
|
||||
)
|
||||
|
||||
# Task to manage issue workflow
|
||||
issue_workflow = Task(
|
||||
description="Create a feature request issue and assign it to the development team",
|
||||
agent=issue_manager,
|
||||
expected_output="Feature request issue created and assigned successfully"
|
||||
)
|
||||
|
||||
crew = Crew(
|
||||
agents=[issue_manager],
|
||||
tasks=[issue_workflow]
|
||||
)
|
||||
|
||||
crew.kickoff()
|
||||
```
|
||||
|
||||
### Release Management
|
||||
|
||||
```python
|
||||
from crewai import Agent, Task, Crew
|
||||
from crewai_tools import CrewaiEnterpriseTools
|
||||
|
||||
enterprise_tools = CrewaiEnterpriseTools(
|
||||
enterprise_token="your_enterprise_token"
|
||||
)
|
||||
|
||||
release_manager = Agent(
|
||||
role="Release Manager",
|
||||
goal="Manage software releases and versioning",
|
||||
backstory="An experienced release manager who handles version control and release processes.",
|
||||
tools=[enterprise_tools]
|
||||
)
|
||||
|
||||
# Task to create a new release
|
||||
release_task = Task(
|
||||
description="""
|
||||
Create a new release v2.1.0 for the project with:
|
||||
- Auto-generated release notes
|
||||
- Target the main branch
|
||||
- Include a description of new features and bug fixes
|
||||
""",
|
||||
agent=release_manager,
|
||||
expected_output="Release v2.1.0 created successfully with release notes"
|
||||
)
|
||||
|
||||
crew = Crew(
|
||||
agents=[release_manager],
|
||||
tasks=[release_task]
|
||||
)
|
||||
|
||||
crew.kickoff()
|
||||
```
|
||||
|
||||
### Issue Tracking and Management
|
||||
|
||||
```python
|
||||
from crewai import Agent, Task, Crew
|
||||
from crewai_tools import CrewaiEnterpriseTools
|
||||
|
||||
enterprise_tools = CrewaiEnterpriseTools(
|
||||
enterprise_token="your_enterprise_token"
|
||||
)
|
||||
|
||||
project_coordinator = Agent(
|
||||
role="Project Coordinator",
|
||||
goal="Track and coordinate project issues and development progress",
|
||||
backstory="An AI assistant that helps coordinate development work and track project progress.",
|
||||
tools=[enterprise_tools]
|
||||
)
|
||||
|
||||
# Complex task involving multiple GitHub operations
|
||||
coordination_task = Task(
|
||||
description="""
|
||||
1. Search for all open issues assigned to the current milestone
|
||||
2. Identify overdue issues and update their priority labels
|
||||
3. Create a weekly progress report issue
|
||||
4. Lock resolved issues that have been inactive for 30 days
|
||||
""",
|
||||
agent=project_coordinator,
|
||||
expected_output="Project coordination completed with progress report and issue management"
|
||||
)
|
||||
|
||||
crew = Crew(
|
||||
agents=[project_coordinator],
|
||||
tasks=[coordination_task]
|
||||
)
|
||||
|
||||
crew.kickoff()
|
||||
```
|
||||
|
||||
### Getting Help
|
||||
|
||||
<Card title="Need Help?" icon="headset" href="mailto:support@crewai.com">
|
||||
Contact our support team for assistance with GitHub integration setup or troubleshooting.
|
||||
</Card>
|
||||
356
docs/en/enterprise/integrations/gmail.mdx
Normal file
356
docs/en/enterprise/integrations/gmail.mdx
Normal file
@@ -0,0 +1,356 @@
|
||||
---
|
||||
title: Gmail Integration
|
||||
description: "Email and contact management with Gmail integration for CrewAI."
|
||||
icon: "envelope"
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
Enable your agents to manage emails, contacts, and drafts through Gmail. Send emails, search messages, manage contacts, create drafts, and streamline your email communications with AI-powered automation.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
Before using the Gmail integration, ensure you have:
|
||||
|
||||
- A [CrewAI Enterprise](https://app.crewai.com) account with an active subscription
|
||||
- A Gmail account with appropriate permissions
|
||||
- Connected your Gmail account through the [Integrations page](https://app.crewai.com/crewai_plus/connectors)
|
||||
|
||||
## Setting Up Gmail Integration
|
||||
|
||||
### 1. Connect Your Gmail Account
|
||||
|
||||
1. Navigate to [CrewAI Enterprise Integrations](https://app.crewai.com/crewai_plus/connectors)
|
||||
2. Find **Gmail** in the Authentication Integrations section
|
||||
3. Click **Connect** and complete the OAuth flow
|
||||
4. Grant the necessary permissions for email and contact management
|
||||
5. Copy your Enterprise Token from [Account Settings](https://app.crewai.com/crewai_plus/settings/account)
|
||||
|
||||
### 2. Install Required Package
|
||||
|
||||
```bash
|
||||
uv add crewai-tools
|
||||
```
|
||||
|
||||
## Available Actions
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="GMAIL_SEND_EMAIL">
|
||||
**Description:** Send an email in Gmail.
|
||||
|
||||
**Parameters:**
|
||||
- `toRecipients` (array, required): To - Specify the recipients as either a single string or a JSON array.
|
||||
```json
|
||||
[
|
||||
"recipient1@domain.com",
|
||||
"recipient2@domain.com"
|
||||
]
|
||||
```
|
||||
- `from` (string, required): From - Specify the email of the sender.
|
||||
- `subject` (string, required): Subject - Specify the subject of the message.
|
||||
- `messageContent` (string, required): Message Content - Specify the content of the email message as plain text or HTML.
|
||||
- `attachments` (string, optional): Attachments - Accepts either a single file object or a JSON array of file objects.
|
||||
- `additionalHeaders` (object, optional): Additional Headers - Specify any additional header fields here.
|
||||
```json
|
||||
{
|
||||
"reply-to": "Sender Name <sender@domain.com>"
|
||||
}
|
||||
```
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="GMAIL_GET_EMAIL_BY_ID">
|
||||
**Description:** Get an email by ID in Gmail.
|
||||
|
||||
**Parameters:**
|
||||
- `userId` (string, required): User ID - Specify the user's email address. (example: "user@domain.com").
|
||||
- `messageId` (string, required): Message ID - Specify the ID of the message to retrieve.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="GMAIL_SEARCH_FOR_EMAIL">
|
||||
**Description:** Search for emails in Gmail using advanced filters.
|
||||
|
||||
**Parameters:**
|
||||
- `emailFilterFormula` (object, optional): A filter in disjunctive normal form - OR of AND groups of single conditions.
|
||||
```json
|
||||
{
|
||||
"operator": "OR",
|
||||
"conditions": [
|
||||
{
|
||||
"operator": "AND",
|
||||
"conditions": [
|
||||
{
|
||||
"field": "from",
|
||||
"operator": "$stringContains",
|
||||
"value": "example@domain.com"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
Available fields: `from`, `to`, `date`, `label`, `subject`, `cc`, `bcc`, `category`, `deliveredto:`, `size`, `filename`, `older_than`, `newer_than`, `list`, `is:important`, `is:unread`, `is:snoozed`, `is:starred`, `is:read`, `has:drive`, `has:document`, `has:spreadsheet`, `has:presentation`, `has:attachment`, `has:youtube`, `has:userlabels`
|
||||
- `paginationParameters` (object, optional): Pagination Parameters.
|
||||
```json
|
||||
{
|
||||
"pageCursor": "page_cursor_string"
|
||||
}
|
||||
```
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="GMAIL_DELETE_EMAIL">
|
||||
**Description:** Delete an email in Gmail.
|
||||
|
||||
**Parameters:**
|
||||
- `userId` (string, required): User ID - Specify the user's email address. (example: "user@domain.com").
|
||||
- `messageId` (string, required): Message ID - Specify the ID of the message to trash.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="GMAIL_CREATE_A_CONTACT">
|
||||
**Description:** Create a contact in Gmail.
|
||||
|
||||
**Parameters:**
|
||||
- `givenName` (string, required): Given Name - Specify the Given Name of the Contact to create. (example: "John").
|
||||
- `familyName` (string, required): Family Name - Specify the Family Name of the Contact to create. (example: "Doe").
|
||||
- `email` (string, required): Email - Specify the Email Address of the Contact to create.
|
||||
- `additionalFields` (object, optional): Additional Fields - Additional contact information.
|
||||
```json
|
||||
{
|
||||
"addresses": [
|
||||
{
|
||||
"streetAddress": "1000 North St.",
|
||||
"city": "Los Angeles"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="GMAIL_GET_CONTACT_BY_RESOURCE_NAME">
|
||||
**Description:** Get a contact by resource name in Gmail.
|
||||
|
||||
**Parameters:**
|
||||
- `resourceName` (string, required): Resource Name - Specify the resource name of the contact to fetch.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="GMAIL_SEARCH_FOR_CONTACT">
|
||||
**Description:** Search for a contact in Gmail.
|
||||
|
||||
**Parameters:**
|
||||
- `searchTerm` (string, required): Term - Specify a search term to search for near or exact matches on the names, nickNames, emailAddresses, phoneNumbers, or organizations Contact properties.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="GMAIL_DELETE_CONTACT">
|
||||
**Description:** Delete a contact in Gmail.
|
||||
|
||||
**Parameters:**
|
||||
- `resourceName` (string, required): Resource Name - Specify the resource name of the contact to delete.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="GMAIL_CREATE_DRAFT">
|
||||
**Description:** Create a draft in Gmail.
|
||||
|
||||
**Parameters:**
|
||||
- `toRecipients` (array, optional): To - Specify the recipients as either a single string or a JSON array.
|
||||
```json
|
||||
[
|
||||
"recipient1@domain.com",
|
||||
"recipient2@domain.com"
|
||||
]
|
||||
```
|
||||
- `from` (string, optional): From - Specify the email of the sender.
|
||||
- `subject` (string, optional): Subject - Specify the subject of the message.
|
||||
- `messageContent` (string, optional): Message Content - Specify the content of the email message as plain text or HTML.
|
||||
- `attachments` (string, optional): Attachments - Accepts either a single file object or a JSON array of file objects.
|
||||
- `additionalHeaders` (object, optional): Additional Headers - Specify any additional header fields here.
|
||||
```json
|
||||
{
|
||||
"reply-to": "Sender Name <sender@domain.com>"
|
||||
}
|
||||
```
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
## Usage Examples
|
||||
|
||||
### Basic Gmail Agent Setup
|
||||
|
||||
```python
|
||||
from crewai import Agent, Task, Crew
|
||||
from crewai_tools import CrewaiEnterpriseTools
|
||||
|
||||
# Get enterprise tools (Gmail tools will be included)
|
||||
enterprise_tools = CrewaiEnterpriseTools(
|
||||
enterprise_token="your_enterprise_token"
|
||||
)
|
||||
|
||||
# Create an agent with Gmail capabilities
|
||||
gmail_agent = Agent(
|
||||
role="Email Manager",
|
||||
goal="Manage email communications and contacts efficiently",
|
||||
backstory="An AI assistant specialized in email management and communication.",
|
||||
tools=[enterprise_tools]
|
||||
)
|
||||
|
||||
# Task to send a follow-up email
|
||||
send_email_task = Task(
|
||||
description="Send a follow-up email to john@example.com about the project update meeting",
|
||||
agent=gmail_agent,
|
||||
expected_output="Email sent successfully with confirmation"
|
||||
)
|
||||
|
||||
# Run the task
|
||||
crew = Crew(
|
||||
agents=[gmail_agent],
|
||||
tasks=[send_email_task]
|
||||
)
|
||||
|
||||
crew.kickoff()
|
||||
```
|
||||
|
||||
### Filtering Specific Gmail Tools
|
||||
|
||||
```python
|
||||
from crewai_tools import CrewaiEnterpriseTools
|
||||
|
||||
# Get only specific Gmail tools
|
||||
enterprise_tools = CrewaiEnterpriseTools(
|
||||
enterprise_token="your_enterprise_token",
|
||||
actions_list=["gmail_send_email", "gmail_search_for_email", "gmail_create_draft"]
|
||||
)
|
||||
|
||||
email_coordinator = Agent(
|
||||
role="Email Coordinator",
|
||||
goal="Coordinate email communications and manage drafts",
|
||||
backstory="An AI assistant that focuses on email coordination and draft management.",
|
||||
tools=enterprise_tools
|
||||
)
|
||||
|
||||
# Task to prepare and send emails
|
||||
email_coordination = Task(
|
||||
description="Search for emails from the marketing team, create a summary draft, and send it to stakeholders",
|
||||
agent=email_coordinator,
|
||||
expected_output="Summary email sent to stakeholders"
|
||||
)
|
||||
|
||||
crew = Crew(
|
||||
agents=[email_coordinator],
|
||||
tasks=[email_coordination]
|
||||
)
|
||||
|
||||
crew.kickoff()
|
||||
```
|
||||
|
||||
### Contact Management
|
||||
|
||||
```python
|
||||
from crewai import Agent, Task, Crew
|
||||
from crewai_tools import CrewaiEnterpriseTools
|
||||
|
||||
enterprise_tools = CrewaiEnterpriseTools(
|
||||
enterprise_token="your_enterprise_token"
|
||||
)
|
||||
|
||||
contact_manager = Agent(
|
||||
role="Contact Manager",
|
||||
goal="Manage and organize email contacts efficiently",
|
||||
backstory="An experienced contact manager who maintains organized contact databases.",
|
||||
tools=[enterprise_tools]
|
||||
)
|
||||
|
||||
# Task to manage contacts
|
||||
contact_task = Task(
|
||||
description="""
|
||||
1. Search for contacts from the 'example.com' domain
|
||||
2. Create new contacts for recent email senders not in the contact list
|
||||
3. Update contact information with recent interaction data
|
||||
""",
|
||||
agent=contact_manager,
|
||||
expected_output="Contact database updated with new contacts and recent interactions"
|
||||
)
|
||||
|
||||
crew = Crew(
|
||||
agents=[contact_manager],
|
||||
tasks=[contact_task]
|
||||
)
|
||||
|
||||
crew.kickoff()
|
||||
```
|
||||
|
||||
### Email Search and Analysis
|
||||
|
||||
```python
|
||||
from crewai import Agent, Task, Crew
|
||||
from crewai_tools import CrewaiEnterpriseTools
|
||||
|
||||
enterprise_tools = CrewaiEnterpriseTools(
|
||||
enterprise_token="your_enterprise_token"
|
||||
)
|
||||
|
||||
email_analyst = Agent(
|
||||
role="Email Analyst",
|
||||
goal="Analyze email patterns and provide insights",
|
||||
backstory="An AI assistant that analyzes email data to provide actionable insights.",
|
||||
tools=[enterprise_tools]
|
||||
)
|
||||
|
||||
# Task to analyze email patterns
|
||||
analysis_task = Task(
|
||||
description="""
|
||||
Search for all unread emails from the last 7 days,
|
||||
categorize them by sender domain,
|
||||
and create a summary report of communication patterns
|
||||
""",
|
||||
agent=email_analyst,
|
||||
expected_output="Email analysis report with communication patterns and recommendations"
|
||||
)
|
||||
|
||||
crew = Crew(
|
||||
agents=[email_analyst],
|
||||
tasks=[analysis_task]
|
||||
)
|
||||
|
||||
crew.kickoff()
|
||||
```
|
||||
|
||||
### Automated Email Workflows
|
||||
|
||||
```python
|
||||
from crewai import Agent, Task, Crew
|
||||
from crewai_tools import CrewaiEnterpriseTools
|
||||
|
||||
enterprise_tools = CrewaiEnterpriseTools(
|
||||
enterprise_token="your_enterprise_token"
|
||||
)
|
||||
|
||||
workflow_manager = Agent(
|
||||
role="Email Workflow Manager",
|
||||
goal="Automate email workflows and responses",
|
||||
backstory="An AI assistant that manages automated email workflows and responses.",
|
||||
tools=[enterprise_tools]
|
||||
)
|
||||
|
||||
# Complex task involving multiple Gmail operations
|
||||
workflow_task = Task(
|
||||
description="""
|
||||
1. Search for emails with 'urgent' in the subject from the last 24 hours
|
||||
2. Create draft responses for each urgent email
|
||||
3. Send automated acknowledgment emails to senders
|
||||
4. Create a summary report of urgent items requiring attention
|
||||
""",
|
||||
agent=workflow_manager,
|
||||
expected_output="Urgent emails processed with automated responses and summary report"
|
||||
)
|
||||
|
||||
crew = Crew(
|
||||
agents=[workflow_manager],
|
||||
tasks=[workflow_task]
|
||||
)
|
||||
|
||||
crew.kickoff()
|
||||
```
|
||||
|
||||
### Getting Help
|
||||
|
||||
<Card title="Need Help?" icon="headset" href="mailto:support@crewai.com">
|
||||
Contact our support team for assistance with Gmail integration setup or troubleshooting.
|
||||
</Card>
|
||||
391
docs/en/enterprise/integrations/google_calendar.mdx
Normal file
391
docs/en/enterprise/integrations/google_calendar.mdx
Normal file
@@ -0,0 +1,391 @@
|
||||
---
|
||||
title: Google Calendar Integration
|
||||
description: "Event and schedule management with Google Calendar integration for CrewAI."
|
||||
icon: "calendar"
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
Enable your agents to manage calendar events, schedules, and availability through Google Calendar. Create and update events, manage attendees, check availability, and streamline your scheduling workflows with AI-powered automation.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
Before using the Google Calendar integration, ensure you have:
|
||||
|
||||
- A [CrewAI Enterprise](https://app.crewai.com) account with an active subscription
|
||||
- A Google account with Google Calendar access
|
||||
- Connected your Google account through the [Integrations page](https://app.crewai.com/crewai_plus/connectors)
|
||||
|
||||
## Setting Up Google Calendar Integration
|
||||
|
||||
### 1. Connect Your Google Account
|
||||
|
||||
1. Navigate to [CrewAI Enterprise Integrations](https://app.crewai.com/crewai_plus/connectors)
|
||||
2. Find **Google Calendar** in the Authentication Integrations section
|
||||
3. Click **Connect** and complete the OAuth flow
|
||||
4. Grant the necessary permissions for calendar and contact access
|
||||
5. Copy your Enterprise Token from [Account Settings](https://app.crewai.com/crewai_plus/settings/account)
|
||||
|
||||
### 2. Install Required Package
|
||||
|
||||
```bash
|
||||
uv add crewai-tools
|
||||
```
|
||||
|
||||
## Available Actions
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="GOOGLE_CALENDAR_CREATE_EVENT">
|
||||
**Description:** Create an event in Google Calendar.
|
||||
|
||||
**Parameters:**
|
||||
- `eventName` (string, required): Event name.
|
||||
- `startTime` (string, required): Start time - Accepts Unix timestamp or ISO8601 date formats.
|
||||
- `endTime` (string, optional): End time - Defaults to one hour after the start time if left blank.
|
||||
- `calendar` (string, optional): Calendar - Use Connect Portal Workflow Settings to allow users to select which calendar the event will be added to. Defaults to the user's primary calendar if left blank.
|
||||
- `attendees` (string, optional): Attendees - Accepts an array of email addresses or email addresses separated by commas.
|
||||
- `eventLocation` (string, optional): Event location.
|
||||
- `eventDescription` (string, optional): Event description.
|
||||
- `eventId` (string, optional): Event ID - An ID from your application to associate this event with. You can use this ID to sync updates to this event later.
|
||||
- `includeMeetLink` (boolean, optional): Include Google Meet link? - Automatically creates Google Meet conference link for this event.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="GOOGLE_CALENDAR_UPDATE_EVENT">
|
||||
**Description:** Update an existing event in Google Calendar.
|
||||
|
||||
**Parameters:**
|
||||
- `eventId` (string, required): Event ID - The ID of the event to update.
|
||||
- `eventName` (string, optional): Event name.
|
||||
- `startTime` (string, optional): Start time - Accepts Unix timestamp or ISO8601 date formats.
|
||||
- `endTime` (string, optional): End time - Defaults to one hour after the start time if left blank.
|
||||
- `calendar` (string, optional): Calendar - Use Connect Portal Workflow Settings to allow users to select which calendar the event will be added to. Defaults to the user's primary calendar if left blank.
|
||||
- `attendees` (string, optional): Attendees - Accepts an array of email addresses or email addresses separated by commas.
|
||||
- `eventLocation` (string, optional): Event location.
|
||||
- `eventDescription` (string, optional): Event description.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="GOOGLE_CALENDAR_LIST_EVENTS">
|
||||
**Description:** List events from Google Calendar.
|
||||
|
||||
**Parameters:**
|
||||
- `calendar` (string, optional): Calendar - Use Connect Portal Workflow Settings to allow users to select which calendar the event will be added to. Defaults to the user's primary calendar if left blank.
|
||||
- `after` (string, optional): After - Filters events that start after the provided date (Unix in milliseconds or ISO timestamp). (example: "2025-04-12T10:00:00Z or 1712908800000").
|
||||
- `before` (string, optional): Before - Filters events that end before the provided date (Unix in milliseconds or ISO timestamp). (example: "2025-04-12T10:00:00Z or 1712908800000").
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="GOOGLE_CALENDAR_GET_EVENT_BY_ID">
|
||||
**Description:** Get a specific event by ID from Google Calendar.
|
||||
|
||||
**Parameters:**
|
||||
- `eventId` (string, required): Event ID.
|
||||
- `calendar` (string, optional): Calendar - Use Connect Portal Workflow Settings to allow users to select which calendar the event will be added to. Defaults to the user's primary calendar if left blank.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="GOOGLE_CALENDAR_DELETE_EVENT">
|
||||
**Description:** Delete an event from Google Calendar.
|
||||
|
||||
**Parameters:**
|
||||
- `eventId` (string, required): Event ID - The ID of the calendar event to be deleted.
|
||||
- `calendar` (string, optional): Calendar - Use Connect Portal Workflow Settings to allow users to select which calendar the event will be added to. Defaults to the user's primary calendar if left blank.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="GOOGLE_CALENDAR_GET_CONTACTS">
|
||||
**Description:** Get contacts from Google Calendar.
|
||||
|
||||
**Parameters:**
|
||||
- `paginationParameters` (object, optional): Pagination Parameters.
|
||||
```json
|
||||
{
|
||||
"pageCursor": "page_cursor_string"
|
||||
}
|
||||
```
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="GOOGLE_CALENDAR_SEARCH_CONTACTS">
|
||||
**Description:** Search for contacts in Google Calendar.
|
||||
|
||||
**Parameters:**
|
||||
- `query` (string, optional): Search query to search contacts.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="GOOGLE_CALENDAR_LIST_DIRECTORY_PEOPLE">
|
||||
**Description:** List directory people.
|
||||
|
||||
**Parameters:**
|
||||
- `paginationParameters` (object, optional): Pagination Parameters.
|
||||
```json
|
||||
{
|
||||
"pageCursor": "page_cursor_string"
|
||||
}
|
||||
```
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="GOOGLE_CALENDAR_SEARCH_DIRECTORY_PEOPLE">
|
||||
**Description:** Search directory people.
|
||||
|
||||
**Parameters:**
|
||||
- `query` (string, required): Search query to search contacts.
|
||||
- `paginationParameters` (object, optional): Pagination Parameters.
|
||||
```json
|
||||
{
|
||||
"pageCursor": "page_cursor_string"
|
||||
}
|
||||
```
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="GOOGLE_CALENDAR_LIST_OTHER_CONTACTS">
|
||||
**Description:** List other contacts.
|
||||
|
||||
**Parameters:**
|
||||
- `paginationParameters` (object, optional): Pagination Parameters.
|
||||
```json
|
||||
{
|
||||
"pageCursor": "page_cursor_string"
|
||||
}
|
||||
```
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="GOOGLE_CALENDAR_SEARCH_OTHER_CONTACTS">
|
||||
**Description:** Search other contacts.
|
||||
|
||||
**Parameters:**
|
||||
- `query` (string, optional): Search query to search contacts.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="GOOGLE_CALENDAR_GET_AVAILABILITY">
|
||||
**Description:** Get availability information for calendars.
|
||||
|
||||
**Parameters:**
|
||||
- `timeMin` (string, required): The start of the interval. In ISO format.
|
||||
- `timeMax` (string, required): The end of the interval. In ISO format.
|
||||
- `timeZone` (string, optional): Time zone used in the response. Optional. The default is UTC.
|
||||
- `items` (array, optional): List of calendars and/or groups to query. Defaults to the user default calendar.
|
||||
```json
|
||||
[
|
||||
{
|
||||
"id": "calendar_id_1"
|
||||
},
|
||||
{
|
||||
"id": "calendar_id_2"
|
||||
}
|
||||
]
|
||||
```
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
## Usage Examples
|
||||
|
||||
### Basic Calendar Agent Setup
|
||||
|
||||
```python
|
||||
from crewai import Agent, Task, Crew
|
||||
from crewai_tools import CrewaiEnterpriseTools
|
||||
|
||||
# Get enterprise tools (Google Calendar tools will be included)
|
||||
enterprise_tools = CrewaiEnterpriseTools(
|
||||
enterprise_token="your_enterprise_token"
|
||||
)
|
||||
|
||||
# Create an agent with Google Calendar capabilities
|
||||
calendar_agent = Agent(
|
||||
role="Schedule Manager",
|
||||
goal="Manage calendar events and scheduling efficiently",
|
||||
backstory="An AI assistant specialized in calendar management and scheduling coordination.",
|
||||
tools=[enterprise_tools]
|
||||
)
|
||||
|
||||
# Task to create a meeting
|
||||
create_meeting_task = Task(
|
||||
description="Create a team standup meeting for tomorrow at 9 AM with the development team",
|
||||
agent=calendar_agent,
|
||||
expected_output="Meeting created successfully with Google Meet link"
|
||||
)
|
||||
|
||||
# Run the task
|
||||
crew = Crew(
|
||||
agents=[calendar_agent],
|
||||
tasks=[create_meeting_task]
|
||||
)
|
||||
|
||||
crew.kickoff()
|
||||
```
|
||||
|
||||
### Filtering Specific Calendar Tools
|
||||
|
||||
```python
|
||||
from crewai_tools import CrewaiEnterpriseTools
|
||||
|
||||
# Get only specific Google Calendar tools
|
||||
enterprise_tools = CrewaiEnterpriseTools(
|
||||
enterprise_token="your_enterprise_token",
|
||||
actions_list=["google_calendar_create_event", "google_calendar_list_events", "google_calendar_get_availability"]
|
||||
)
|
||||
|
||||
meeting_coordinator = Agent(
|
||||
role="Meeting Coordinator",
|
||||
goal="Coordinate meetings and check availability",
|
||||
backstory="An AI assistant that focuses on meeting scheduling and availability management.",
|
||||
tools=enterprise_tools
|
||||
)
|
||||
|
||||
# Task to schedule a meeting with availability check
|
||||
schedule_meeting = Task(
|
||||
description="Check availability for next week and schedule a project review meeting with stakeholders",
|
||||
agent=meeting_coordinator,
|
||||
expected_output="Meeting scheduled after checking availability of all participants"
|
||||
)
|
||||
|
||||
crew = Crew(
|
||||
agents=[meeting_coordinator],
|
||||
tasks=[schedule_meeting]
|
||||
)
|
||||
|
||||
crew.kickoff()
|
||||
```
|
||||
|
||||
### Event Management and Updates
|
||||
|
||||
```python
|
||||
from crewai import Agent, Task, Crew
|
||||
from crewai_tools import CrewaiEnterpriseTools
|
||||
|
||||
enterprise_tools = CrewaiEnterpriseTools(
|
||||
enterprise_token="your_enterprise_token"
|
||||
)
|
||||
|
||||
event_manager = Agent(
|
||||
role="Event Manager",
|
||||
goal="Manage and update calendar events efficiently",
|
||||
backstory="An experienced event manager who handles event logistics and updates.",
|
||||
tools=[enterprise_tools]
|
||||
)
|
||||
|
||||
# Task to manage event updates
|
||||
event_management = Task(
|
||||
description="""
|
||||
1. List all events for this week
|
||||
2. Update any events that need location changes to include video conference links
|
||||
3. Send calendar invitations to new team members for recurring meetings
|
||||
""",
|
||||
agent=event_manager,
|
||||
expected_output="Weekly events updated with proper locations and new attendees added"
|
||||
)
|
||||
|
||||
crew = Crew(
|
||||
agents=[event_manager],
|
||||
tasks=[event_management]
|
||||
)
|
||||
|
||||
crew.kickoff()
|
||||
```
|
||||
|
||||
### Contact and Availability Management
|
||||
|
||||
```python
|
||||
from crewai import Agent, Task, Crew
|
||||
from crewai_tools import CrewaiEnterpriseTools
|
||||
|
||||
enterprise_tools = CrewaiEnterpriseTools(
|
||||
enterprise_token="your_enterprise_token"
|
||||
)
|
||||
|
||||
availability_coordinator = Agent(
|
||||
role="Availability Coordinator",
|
||||
goal="Coordinate availability and manage contacts for scheduling",
|
||||
backstory="An AI assistant that specializes in availability management and contact coordination.",
|
||||
tools=[enterprise_tools]
|
||||
)
|
||||
|
||||
# Task to coordinate availability
|
||||
availability_task = Task(
|
||||
description="""
|
||||
1. Search for contacts in the engineering department
|
||||
2. Check availability for all engineers next Friday afternoon
|
||||
3. Create a team meeting for the first available 2-hour slot
|
||||
4. Include Google Meet link and send invitations
|
||||
""",
|
||||
agent=availability_coordinator,
|
||||
expected_output="Team meeting scheduled based on availability with all engineers invited"
|
||||
)
|
||||
|
||||
crew = Crew(
|
||||
agents=[availability_coordinator],
|
||||
tasks=[availability_task]
|
||||
)
|
||||
|
||||
crew.kickoff()
|
||||
```
|
||||
|
||||
### Automated Scheduling Workflows
|
||||
|
||||
```python
|
||||
from crewai import Agent, Task, Crew
|
||||
from crewai_tools import CrewaiEnterpriseTools
|
||||
|
||||
enterprise_tools = CrewaiEnterpriseTools(
|
||||
enterprise_token="your_enterprise_token"
|
||||
)
|
||||
|
||||
scheduling_automator = Agent(
|
||||
role="Scheduling Automator",
|
||||
goal="Automate scheduling workflows and calendar management",
|
||||
backstory="An AI assistant that automates complex scheduling scenarios and calendar workflows.",
|
||||
tools=[enterprise_tools]
|
||||
)
|
||||
|
||||
# Complex scheduling automation task
|
||||
automation_task = Task(
|
||||
description="""
|
||||
1. List all upcoming events for the next two weeks
|
||||
2. Identify any scheduling conflicts or back-to-back meetings
|
||||
3. Suggest optimal meeting times by checking availability
|
||||
4. Create buffer time between meetings where needed
|
||||
5. Update event descriptions with agenda items and meeting links
|
||||
""",
|
||||
agent=scheduling_automator,
|
||||
expected_output="Calendar optimized with resolved conflicts, buffer times, and updated meeting details"
|
||||
)
|
||||
|
||||
crew = Crew(
|
||||
agents=[scheduling_automator],
|
||||
tasks=[automation_task]
|
||||
)
|
||||
|
||||
crew.kickoff()
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
|
||||
**Authentication Errors**
|
||||
- Ensure your Google account has the necessary permissions for calendar access
|
||||
- Verify that the OAuth connection includes all required scopes for Google Calendar API
|
||||
- Check if calendar sharing settings allow the required access level
|
||||
|
||||
**Event Creation Issues**
|
||||
- Verify that time formats are correct (ISO8601 or Unix timestamps)
|
||||
- Ensure attendee email addresses are properly formatted
|
||||
- Check that the target calendar exists and is accessible
|
||||
- Verify time zones are correctly specified
|
||||
|
||||
**Availability and Time Conflicts**
|
||||
- Use proper ISO format for time ranges when checking availability
|
||||
- Ensure time zones are consistent across all operations
|
||||
- Verify that calendar IDs are correct when checking multiple calendars
|
||||
|
||||
**Contact and People Search**
|
||||
- Ensure search queries are properly formatted
|
||||
- Check that directory access permissions are granted
|
||||
- Verify that contact information is up to date and accessible
|
||||
|
||||
**Event Updates and Deletions**
|
||||
- Verify that event IDs are correct and events exist
|
||||
- Ensure you have edit permissions for the events
|
||||
- Check that calendar ownership allows modifications
|
||||
|
||||
### Getting Help
|
||||
|
||||
<Card title="Need Help?" icon="headset" href="mailto:support@crewai.com">
|
||||
Contact our support team for assistance with Google Calendar integration setup or troubleshooting.
|
||||
</Card>
|
||||
321
docs/en/enterprise/integrations/google_sheets.mdx
Normal file
321
docs/en/enterprise/integrations/google_sheets.mdx
Normal file
@@ -0,0 +1,321 @@
|
||||
---
|
||||
title: Google Sheets Integration
|
||||
description: "Spreadsheet data synchronization with Google Sheets integration for CrewAI."
|
||||
icon: "google"
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
Enable your agents to manage spreadsheet data through Google Sheets. Read rows, create new entries, update existing data, and streamline your data management workflows with AI-powered automation. Perfect for data tracking, reporting, and collaborative data management.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
Before using the Google Sheets integration, ensure you have:
|
||||
|
||||
- A [CrewAI Enterprise](https://app.crewai.com) account with an active subscription
|
||||
- A Google account with Google Sheets access
|
||||
- Connected your Google account through the [Integrations page](https://app.crewai.com/crewai_plus/connectors)
|
||||
- Spreadsheets with proper column headers for data operations
|
||||
|
||||
## Setting Up Google Sheets Integration
|
||||
|
||||
### 1. Connect Your Google Account
|
||||
|
||||
1. Navigate to [CrewAI Enterprise Integrations](https://app.crewai.com/crewai_plus/connectors)
|
||||
2. Find **Google Sheets** in the Authentication Integrations section
|
||||
3. Click **Connect** and complete the OAuth flow
|
||||
4. Grant the necessary permissions for spreadsheet access
|
||||
5. Copy your Enterprise Token from [Account Settings](https://app.crewai.com/crewai_plus/settings/account)
|
||||
|
||||
### 2. Install Required Package
|
||||
|
||||
```bash
|
||||
uv add crewai-tools
|
||||
```
|
||||
|
||||
## Available Actions
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="GOOGLE_SHEETS_GET_ROW">
|
||||
**Description:** Get rows from a Google Sheets spreadsheet.
|
||||
|
||||
**Parameters:**
|
||||
- `spreadsheetId` (string, required): Spreadsheet - Use Connect Portal Workflow Settings to allow users to select a spreadsheet. Defaults to using the first worksheet in the selected spreadsheet.
|
||||
- `limit` (string, optional): Limit rows - Limit the maximum number of rows to return.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="GOOGLE_SHEETS_CREATE_ROW">
|
||||
**Description:** Create a new row in a Google Sheets spreadsheet.
|
||||
|
||||
**Parameters:**
|
||||
- `spreadsheetId` (string, required): Spreadsheet - Use Connect Portal Workflow Settings to allow users to select a spreadsheet. Defaults to using the first worksheet in the selected spreadsheet..
|
||||
- `worksheet` (string, required): Worksheet - Your worksheet must have column headers.
|
||||
- `additionalFields` (object, required): Fields - Include fields to create this row with, as an object with keys of Column Names. Use Connect Portal Workflow Settings to allow users to select a Column Mapping.
|
||||
```json
|
||||
{
|
||||
"columnName1": "columnValue1",
|
||||
"columnName2": "columnValue2",
|
||||
"columnName3": "columnValue3",
|
||||
"columnName4": "columnValue4"
|
||||
}
|
||||
```
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="GOOGLE_SHEETS_UPDATE_ROW">
|
||||
**Description:** Update existing rows in a Google Sheets spreadsheet.
|
||||
|
||||
**Parameters:**
|
||||
- `spreadsheetId` (string, required): Spreadsheet - Use Connect Portal Workflow Settings to allow users to select a spreadsheet. Defaults to using the first worksheet in the selected spreadsheet.
|
||||
- `worksheet` (string, required): Worksheet - Your worksheet must have column headers.
|
||||
- `filterFormula` (object, optional): A filter in disjunctive normal form - OR of AND groups of single conditions to identify which rows to update.
|
||||
```json
|
||||
{
|
||||
"operator": "OR",
|
||||
"conditions": [
|
||||
{
|
||||
"operator": "AND",
|
||||
"conditions": [
|
||||
{
|
||||
"field": "status",
|
||||
"operator": "$stringExactlyMatches",
|
||||
"value": "pending"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
Available operators: `$stringContains`, `$stringDoesNotContain`, `$stringExactlyMatches`, `$stringDoesNotExactlyMatch`, `$stringStartsWith`, `$stringDoesNotStartWith`, `$stringEndsWith`, `$stringDoesNotEndWith`, `$numberGreaterThan`, `$numberLessThan`, `$numberEquals`, `$numberDoesNotEqual`, `$dateTimeAfter`, `$dateTimeBefore`, `$dateTimeEquals`, `$booleanTrue`, `$booleanFalse`, `$exists`, `$doesNotExist`
|
||||
- `additionalFields` (object, required): Fields - Include fields to update, as an object with keys of Column Names. Use Connect Portal Workflow Settings to allow users to select a Column Mapping.
|
||||
```json
|
||||
{
|
||||
"columnName1": "newValue1",
|
||||
"columnName2": "newValue2",
|
||||
"columnName3": "newValue3",
|
||||
"columnName4": "newValue4"
|
||||
}
|
||||
```
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
## Usage Examples
|
||||
|
||||
### Basic Google Sheets Agent Setup
|
||||
|
||||
```python
|
||||
from crewai import Agent, Task, Crew
|
||||
from crewai_tools import CrewaiEnterpriseTools
|
||||
|
||||
# Get enterprise tools (Google Sheets tools will be included)
|
||||
enterprise_tools = CrewaiEnterpriseTools(
|
||||
enterprise_token="your_enterprise_token"
|
||||
)
|
||||
|
||||
# Create an agent with Google Sheets capabilities
|
||||
sheets_agent = Agent(
|
||||
role="Data Manager",
|
||||
goal="Manage spreadsheet data and track information efficiently",
|
||||
backstory="An AI assistant specialized in data management and spreadsheet operations.",
|
||||
tools=[enterprise_tools]
|
||||
)
|
||||
|
||||
# Task to add new data to a spreadsheet
|
||||
data_entry_task = Task(
|
||||
description="Add a new customer record to the customer database spreadsheet with name, email, and signup date",
|
||||
agent=sheets_agent,
|
||||
expected_output="New customer record added successfully to the spreadsheet"
|
||||
)
|
||||
|
||||
# Run the task
|
||||
crew = Crew(
|
||||
agents=[sheets_agent],
|
||||
tasks=[data_entry_task]
|
||||
)
|
||||
|
||||
crew.kickoff()
|
||||
```
|
||||
|
||||
### Filtering Specific Google Sheets Tools
|
||||
|
||||
```python
|
||||
from crewai_tools import CrewaiEnterpriseTools
|
||||
|
||||
# Get only specific Google Sheets tools
|
||||
enterprise_tools = CrewaiEnterpriseTools(
|
||||
enterprise_token="your_enterprise_token",
|
||||
actions_list=["google_sheets_get_row", "google_sheets_create_row"]
|
||||
)
|
||||
|
||||
data_collector = Agent(
|
||||
role="Data Collector",
|
||||
goal="Collect and organize data in spreadsheets",
|
||||
backstory="An AI assistant that focuses on data collection and organization.",
|
||||
tools=enterprise_tools
|
||||
)
|
||||
|
||||
# Task to collect and organize data
|
||||
data_collection = Task(
|
||||
description="Retrieve current inventory data and add new product entries to the inventory spreadsheet",
|
||||
agent=data_collector,
|
||||
expected_output="Inventory data retrieved and new products added successfully"
|
||||
)
|
||||
|
||||
crew = Crew(
|
||||
agents=[data_collector],
|
||||
tasks=[data_collection]
|
||||
)
|
||||
|
||||
crew.kickoff()
|
||||
```
|
||||
|
||||
### Data Analysis and Reporting
|
||||
|
||||
```python
|
||||
from crewai import Agent, Task, Crew
|
||||
from crewai_tools import CrewaiEnterpriseTools
|
||||
|
||||
enterprise_tools = CrewaiEnterpriseTools(
|
||||
enterprise_token="your_enterprise_token"
|
||||
)
|
||||
|
||||
data_analyst = Agent(
|
||||
role="Data Analyst",
|
||||
goal="Analyze spreadsheet data and generate insights",
|
||||
backstory="An experienced data analyst who extracts insights from spreadsheet data.",
|
||||
tools=[enterprise_tools]
|
||||
)
|
||||
|
||||
# Task to analyze data and create reports
|
||||
analysis_task = Task(
|
||||
description="""
|
||||
1. Retrieve all sales data from the current month's spreadsheet
|
||||
2. Analyze the data for trends and patterns
|
||||
3. Create a summary report in a new row with key metrics
|
||||
""",
|
||||
agent=data_analyst,
|
||||
expected_output="Sales data analyzed and summary report created with key insights"
|
||||
)
|
||||
|
||||
crew = Crew(
|
||||
agents=[data_analyst],
|
||||
tasks=[analysis_task]
|
||||
)
|
||||
|
||||
crew.kickoff()
|
||||
```
|
||||
|
||||
### Automated Data Updates
|
||||
|
||||
```python
|
||||
from crewai import Agent, Task, Crew
|
||||
from crewai_tools import CrewaiEnterpriseTools
|
||||
|
||||
enterprise_tools = CrewaiEnterpriseTools(
|
||||
enterprise_token="your_enterprise_token"
|
||||
)
|
||||
|
||||
data_updater = Agent(
|
||||
role="Data Updater",
|
||||
goal="Automatically update and maintain spreadsheet data",
|
||||
backstory="An AI assistant that maintains data accuracy and updates records automatically.",
|
||||
tools=[enterprise_tools]
|
||||
)
|
||||
|
||||
# Task to update data based on conditions
|
||||
update_task = Task(
|
||||
description="""
|
||||
1. Find all pending orders in the orders spreadsheet
|
||||
2. Update their status to 'processing'
|
||||
3. Add a timestamp for when the status was updated
|
||||
4. Log the changes in a separate tracking sheet
|
||||
""",
|
||||
agent=data_updater,
|
||||
expected_output="All pending orders updated to processing status with timestamps logged"
|
||||
)
|
||||
|
||||
crew = Crew(
|
||||
agents=[data_updater],
|
||||
tasks=[update_task]
|
||||
)
|
||||
|
||||
crew.kickoff()
|
||||
```
|
||||
|
||||
### Complex Data Management Workflow
|
||||
|
||||
```python
|
||||
from crewai import Agent, Task, Crew
|
||||
from crewai_tools import CrewaiEnterpriseTools
|
||||
|
||||
enterprise_tools = CrewaiEnterpriseTools(
|
||||
enterprise_token="your_enterprise_token"
|
||||
)
|
||||
|
||||
workflow_manager = Agent(
|
||||
role="Data Workflow Manager",
|
||||
goal="Manage complex data workflows across multiple spreadsheets",
|
||||
backstory="An AI assistant that orchestrates complex data operations across multiple spreadsheets.",
|
||||
tools=[enterprise_tools]
|
||||
)
|
||||
|
||||
# Complex workflow task
|
||||
workflow_task = Task(
|
||||
description="""
|
||||
1. Get all customer data from the main customer spreadsheet
|
||||
2. Create monthly summary entries for active customers
|
||||
3. Update customer status based on activity in the last 30 days
|
||||
4. Generate a monthly report with customer metrics
|
||||
5. Archive inactive customer records to a separate sheet
|
||||
""",
|
||||
agent=workflow_manager,
|
||||
expected_output="Monthly customer workflow completed with updated statuses and generated reports"
|
||||
)
|
||||
|
||||
crew = Crew(
|
||||
agents=[workflow_manager],
|
||||
tasks=[workflow_task]
|
||||
)
|
||||
|
||||
crew.kickoff()
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
|
||||
**Permission Errors**
|
||||
- Ensure your Google account has edit access to the target spreadsheets
|
||||
- Verify that the OAuth connection includes required scopes for Google Sheets API
|
||||
- Check that spreadsheets are shared with the authenticated account
|
||||
|
||||
**Spreadsheet Structure Issues**
|
||||
- Ensure worksheets have proper column headers before creating or updating rows
|
||||
- Verify that column names in `additionalFields` match the actual column headers
|
||||
- Check that the specified worksheet exists in the spreadsheet
|
||||
|
||||
**Data Type and Format Issues**
|
||||
- Ensure data values match the expected format for each column
|
||||
- Use proper date formats for date columns (ISO format recommended)
|
||||
- Verify that numeric values are properly formatted for number columns
|
||||
|
||||
**Filter Formula Issues**
|
||||
- Ensure filter formulas follow the correct JSON structure for disjunctive normal form
|
||||
- Use valid field names that match actual column headers
|
||||
- Test simple filters before building complex multi-condition queries
|
||||
- Verify that operator types match the data types in the columns
|
||||
|
||||
**Row Limits and Performance**
|
||||
- Be mindful of row limits when using `GOOGLE_SHEETS_GET_ROW`
|
||||
- Consider pagination for large datasets
|
||||
- Use specific filters to reduce the amount of data processed
|
||||
|
||||
**Update Operations**
|
||||
- Ensure filter conditions properly identify the intended rows for updates
|
||||
- Test filter conditions with small datasets before large updates
|
||||
- Verify that all required fields are included in update operations
|
||||
|
||||
### Getting Help
|
||||
|
||||
<Card title="Need Help?" icon="headset" href="mailto:support@crewai.com">
|
||||
Contact our support team for assistance with Google Sheets integration setup or troubleshooting.
|
||||
</Card>
|
||||
579
docs/en/enterprise/integrations/hubspot.mdx
Normal file
579
docs/en/enterprise/integrations/hubspot.mdx
Normal file
@@ -0,0 +1,579 @@
|
||||
---
|
||||
title: "HubSpot Integration"
|
||||
description: "Manage companies and contacts in HubSpot with CrewAI."
|
||||
icon: "briefcase"
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
Enable your agents to manage companies and contacts within HubSpot. Create new records and streamline your CRM processes with AI-powered automation.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
Before using the HubSpot integration, ensure you have:
|
||||
|
||||
- A [CrewAI Enterprise](https://app.crewai.com) account with an active subscription.
|
||||
- A HubSpot account with appropriate permissions.
|
||||
- Connected your HubSpot account through the [Integrations page](https://app.crewai.com/crewai_plus/connectors).
|
||||
|
||||
## Setting Up HubSpot Integration
|
||||
|
||||
### 1. Connect Your HubSpot Account
|
||||
|
||||
1. Navigate to [CrewAI Enterprise Integrations](https://app.crewai.com/crewai_plus/connectors).
|
||||
2. Find **HubSpot** in the Authentication Integrations section.
|
||||
3. Click **Connect** and complete the OAuth flow.
|
||||
4. Grant the necessary permissions for company and contact management.
|
||||
5. Copy your Enterprise Token from [Account Settings](https://app.crewai.com/crewai_plus/settings/account).
|
||||
|
||||
### 2. Install Required Package
|
||||
|
||||
```bash
|
||||
uv add crewai-tools
|
||||
```
|
||||
|
||||
## Available Actions
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="HUBSPOT_CREATE_RECORD_COMPANIES">
|
||||
**Description:** Create a new company record in HubSpot.
|
||||
|
||||
**Parameters:**
|
||||
- `name` (string, required): Name of the company.
|
||||
- `domain` (string, optional): Company Domain Name.
|
||||
- `industry` (string, optional): Industry. Must be one of the predefined values from HubSpot.
|
||||
- `phone` (string, optional): Phone Number.
|
||||
- `hubspot_owner_id` (string, optional): Company owner ID.
|
||||
- `type` (string, optional): Type of the company. Available values: `PROSPECT`, `PARTNER`, `RESELLER`, `VENDOR`, `OTHER`.
|
||||
- `city` (string, optional): City.
|
||||
- `state` (string, optional): State/Region.
|
||||
- `zip` (string, optional): Postal Code.
|
||||
- `numberofemployees` (number, optional): Number of Employees.
|
||||
- `annualrevenue` (number, optional): Annual Revenue.
|
||||
- `timezone` (string, optional): Time Zone.
|
||||
- `description` (string, optional): Description.
|
||||
- `linkedin_company_page` (string, optional): LinkedIn Company Page URL.
|
||||
- `company_email` (string, optional): Company Email.
|
||||
- `first_name` (string, optional): First Name of a contact at the company.
|
||||
- `last_name` (string, optional): Last Name of a contact at the company.
|
||||
- `about_us` (string, optional): About Us.
|
||||
- `hs_csm_sentiment` (string, optional): CSM Sentiment. Available values: `at_risk`, `neutral`, `healthy`.
|
||||
- `closedate` (string, optional): Close Date.
|
||||
- `hs_keywords` (string, optional): Company Keywords. Must be one of the predefined values.
|
||||
- `country` (string, optional): Country/Region.
|
||||
- `hs_country_code` (string, optional): Country/Region Code.
|
||||
- `hs_employee_range` (string, optional): Employee range.
|
||||
- `facebook_company_page` (string, optional): Facebook Company Page URL.
|
||||
- `facebookfans` (number, optional): Number of Facebook Fans.
|
||||
- `hs_gps_coordinates` (string, optional): GPS Coordinates.
|
||||
- `hs_gps_error` (string, optional): GPS Error.
|
||||
- `googleplus_page` (string, optional): Google Plus Page URL.
|
||||
- `owneremail` (string, optional): HubSpot Owner Email.
|
||||
- `ownername` (string, optional): HubSpot Owner Name.
|
||||
- `hs_ideal_customer_profile` (string, optional): Ideal Customer Profile Tier. Available values: `tier_1`, `tier_2`, `tier_3`.
|
||||
- `hs_industry_group` (string, optional): Industry group.
|
||||
- `is_public` (boolean, optional): Is Public.
|
||||
- `hs_last_metered_enrichment_timestamp` (string, optional): Last Metered Enrichment Timestamp.
|
||||
- `hs_lead_status` (string, optional): Lead Status. Available values: `NEW`, `OPEN`, `IN_PROGRESS`, `OPEN_DEAL`, `UNQUALIFIED`, `ATTEMPTED_TO_CONTACT`, `CONNECTED`, `BAD_TIMING`.
|
||||
- `lifecyclestage` (string, optional): Lifecycle Stage. Available values: `subscriber`, `lead`, `marketingqualifiedlead`, `salesqualifiedlead`, `opportunity`, `customer`, `evangelist`, `other`.
|
||||
- `linkedinbio` (string, optional): LinkedIn Bio.
|
||||
- `hs_linkedin_handle` (string, optional): LinkedIn handle.
|
||||
- `hs_live_enrichment_deadline` (string, optional): Live enrichment deadline.
|
||||
- `hs_logo_url` (string, optional): Logo URL.
|
||||
- `hs_analytics_source` (string, optional): Original Traffic Source.
|
||||
- `hs_pinned_engagement_id` (number, optional): Pinned Engagement ID.
|
||||
- `hs_quick_context` (string, optional): Quick context.
|
||||
- `hs_revenue_range` (string, optional): Revenue range.
|
||||
- `hs_state_code` (string, optional): State/Region Code.
|
||||
- `address` (string, optional): Street Address.
|
||||
- `address2` (string, optional): Street Address 2.
|
||||
- `hs_is_target_account` (boolean, optional): Target Account.
|
||||
- `hs_target_account` (string, optional): Target Account Tier. Available values: `tier_1`, `tier_2`, `tier_3`.
|
||||
- `hs_target_account_recommendation_snooze_time` (string, optional): Target Account Recommendation Snooze Time.
|
||||
- `hs_target_account_recommendation_state` (string, optional): Target Account Recommendation State. Available values: `DISMISSED`, `NONE`, `SNOOZED`.
|
||||
- `total_money_raised` (string, optional): Total Money Raised.
|
||||
- `twitterbio` (string, optional): Twitter Bio.
|
||||
- `twitterfollowers` (number, optional): Twitter Followers.
|
||||
- `twitterhandle` (string, optional): Twitter Handle.
|
||||
- `web_technologies` (string, optional): Web Technologies used. Must be one of the predefined values.
|
||||
- `website` (string, optional): Website URL.
|
||||
- `founded_year` (string, optional): Year Founded.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="HUBSPOT_CREATE_RECORD_CONTACTS">
|
||||
**Description:** Create a new contact record in HubSpot.
|
||||
|
||||
**Parameters:**
|
||||
- `email` (string, required): Email address of the contact.
|
||||
- `firstname` (string, optional): First Name.
|
||||
- `lastname` (string, optional): Last Name.
|
||||
- `phone` (string, optional): Phone Number.
|
||||
- `hubspot_owner_id` (string, optional): Contact owner.
|
||||
- `lifecyclestage` (string, optional): Lifecycle Stage. Available values: `subscriber`, `lead`, `marketingqualifiedlead`, `salesqualifiedlead`, `opportunity`, `customer`, `evangelist`, `other`.
|
||||
- `hs_lead_status` (string, optional): Lead Status. Available values: `NEW`, `OPEN`, `IN_PROGRESS`, `OPEN_DEAL`, `UNQUALIFIED`, `ATTEMPTED_TO_CONTACT`, `CONNECTED`, `BAD_TIMING`.
|
||||
- `annualrevenue` (string, optional): Annual Revenue.
|
||||
- `hs_buying_role` (string, optional): Buying Role.
|
||||
- `cc_emails` (string, optional): CC Emails.
|
||||
- `ch_customer_id` (string, optional): Chargify Customer ID.
|
||||
- `ch_customer_reference` (string, optional): Chargify Customer Reference.
|
||||
- `chargify_sites` (string, optional): Chargify Site(s).
|
||||
- `city` (string, optional): City.
|
||||
- `hs_facebook_ad_clicked` (boolean, optional): Clicked Facebook ad.
|
||||
- `hs_linkedin_ad_clicked` (string, optional): Clicked LinkedIn Ad.
|
||||
- `hs_clicked_linkedin_ad` (string, optional): Clicked on a LinkedIn Ad.
|
||||
- `closedate` (string, optional): Close Date.
|
||||
- `company` (string, optional): Company Name.
|
||||
- `company_size` (string, optional): Company size.
|
||||
- `country` (string, optional): Country/Region.
|
||||
- `hs_country_region_code` (string, optional): Country/Region Code.
|
||||
- `date_of_birth` (string, optional): Date of birth.
|
||||
- `degree` (string, optional): Degree.
|
||||
- `hs_email_customer_quarantined_reason` (string, optional): Email address quarantine reason.
|
||||
- `hs_role` (string, optional): Employment Role. Must be one of the predefined values.
|
||||
- `hs_seniority` (string, optional): Employment Seniority. Must be one of the predefined values.
|
||||
- `hs_sub_role` (string, optional): Employment Sub Role. Must be one of the predefined values.
|
||||
- `hs_employment_change_detected_date` (string, optional): Employment change detected date.
|
||||
- `hs_enriched_email_bounce_detected` (boolean, optional): Enriched Email Bounce Detected.
|
||||
- `hs_facebookid` (string, optional): Facebook ID.
|
||||
- `hs_facebook_click_id` (string, optional): Facebook click id.
|
||||
- `fax` (string, optional): Fax Number.
|
||||
- `field_of_study` (string, optional): Field of study.
|
||||
- `followercount` (number, optional): Follower Count.
|
||||
- `gender` (string, optional): Gender.
|
||||
- `hs_google_click_id` (string, optional): Google ad click id.
|
||||
- `graduation_date` (string, optional): Graduation date.
|
||||
- `owneremail` (string, optional): HubSpot Owner Email (legacy).
|
||||
- `ownername` (string, optional): HubSpot Owner Name (legacy).
|
||||
- `industry` (string, optional): Industry.
|
||||
- `hs_inferred_language_codes` (string, optional): Inferred Language Codes. Must be one of the predefined values.
|
||||
- `jobtitle` (string, optional): Job Title.
|
||||
- `hs_job_change_detected_date` (string, optional): Job change detected date.
|
||||
- `job_function` (string, optional): Job function.
|
||||
- `hs_journey_stage` (string, optional): Journey Stage. Must be one of the predefined values.
|
||||
- `kloutscoregeneral` (number, optional): Klout Score.
|
||||
- `hs_last_metered_enrichment_timestamp` (string, optional): Last Metered Enrichment Timestamp.
|
||||
- `hs_latest_source` (string, optional): Latest Traffic Source.
|
||||
- `hs_latest_source_timestamp` (string, optional): Latest Traffic Source Date.
|
||||
- `hs_legal_basis` (string, optional): Legal basis for processing contact's data.
|
||||
- `linkedinbio` (string, optional): LinkedIn Bio.
|
||||
- `linkedinconnections` (number, optional): LinkedIn Connections.
|
||||
- `hs_linkedin_url` (string, optional): LinkedIn URL.
|
||||
- `hs_linkedinid` (string, optional): Linkedin ID.
|
||||
- `hs_live_enrichment_deadline` (string, optional): Live enrichment deadline.
|
||||
- `marital_status` (string, optional): Marital Status.
|
||||
- `hs_content_membership_email` (string, optional): Member email.
|
||||
- `hs_content_membership_notes` (string, optional): Membership Notes.
|
||||
- `message` (string, optional): Message.
|
||||
- `military_status` (string, optional): Military status.
|
||||
- `mobilephone` (string, optional): Mobile Phone Number.
|
||||
- `numemployees` (string, optional): Number of Employees.
|
||||
- `hs_analytics_source` (string, optional): Original Traffic Source.
|
||||
- `photo` (string, optional): Photo.
|
||||
- `hs_pinned_engagement_id` (number, optional): Pinned engagement ID.
|
||||
- `zip` (string, optional): Postal Code.
|
||||
- `hs_language` (string, optional): Preferred language. Must be one of the predefined values.
|
||||
- `associatedcompanyid` (number, optional): Primary Associated Company ID.
|
||||
- `hs_email_optout_survey_reason` (string, optional): Reason for opting out of email.
|
||||
- `relationship_status` (string, optional): Relationship Status.
|
||||
- `hs_returning_to_office_detected_date` (string, optional): Returning to office detected date.
|
||||
- `salutation` (string, optional): Salutation.
|
||||
- `school` (string, optional): School.
|
||||
- `seniority` (string, optional): Seniority.
|
||||
- `hs_feedback_show_nps_web_survey` (boolean, optional): Should be shown an NPS web survey.
|
||||
- `start_date` (string, optional): Start date.
|
||||
- `state` (string, optional): State/Region.
|
||||
- `hs_state_code` (string, optional): State/Region Code.
|
||||
- `hs_content_membership_status` (string, optional): Status.
|
||||
- `address` (string, optional): Street Address.
|
||||
- `tax_exempt` (string, optional): Tax Exempt.
|
||||
- `hs_timezone` (string, optional): Time Zone. Must be one of the predefined values.
|
||||
- `twitterbio` (string, optional): Twitter Bio.
|
||||
- `hs_twitterid` (string, optional): Twitter ID.
|
||||
- `twitterprofilephoto` (string, optional): Twitter Profile Photo.
|
||||
- `twitterhandle` (string, optional): Twitter Username.
|
||||
- `vat_number` (string, optional): VAT Number.
|
||||
- `ch_verified` (string, optional): Verified for ACH/eCheck Payments.
|
||||
- `website` (string, optional): Website URL.
|
||||
- `hs_whatsapp_phone_number` (string, optional): WhatsApp Phone Number.
|
||||
- `work_email` (string, optional): Work email.
|
||||
- `hs_googleplusid` (string, optional): googleplus ID.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="HUBSPOT_CREATE_RECORD_DEALS">
|
||||
**Description:** Create a new deal record in HubSpot.
|
||||
|
||||
**Parameters:**
|
||||
- `dealname` (string, required): Name of the deal.
|
||||
- `amount` (number, optional): The value of the deal.
|
||||
- `dealstage` (string, optional): The pipeline stage of the deal.
|
||||
- `pipeline` (string, optional): The pipeline the deal belongs to.
|
||||
- `closedate` (string, optional): The date the deal is expected to close.
|
||||
- `hubspot_owner_id` (string, optional): The owner of the deal.
|
||||
- `dealtype` (string, optional): The type of deal. Available values: `newbusiness`, `existingbusiness`.
|
||||
- `description` (string, optional): A description of the deal.
|
||||
- `hs_priority` (string, optional): The priority of the deal. Available values: `low`, `medium`, `high`.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="HUBSPOT_CREATE_RECORD_ENGAGEMENTS">
|
||||
**Description:** Create a new engagement (e.g., note, email, call, meeting, task) in HubSpot.
|
||||
|
||||
**Parameters:**
|
||||
- `engagementType` (string, required): The type of engagement. Available values: `NOTE`, `EMAIL`, `CALL`, `MEETING`, `TASK`.
|
||||
- `hubspot_owner_id` (string, optional): The user the activity is assigned to.
|
||||
- `hs_timestamp` (string, optional): The date and time of the activity.
|
||||
- `hs_note_body` (string, optional): The body of the note. (Used for `NOTE`)
|
||||
- `hs_task_subject` (string, optional): The title of the task. (Used for `TASK`)
|
||||
- `hs_task_body` (string, optional): The notes for the task. (Used for `TASK`)
|
||||
- `hs_task_status` (string, optional): The status of the task. (Used for `TASK`)
|
||||
- `hs_meeting_title` (string, optional): The title of the meeting. (Used for `MEETING`)
|
||||
- `hs_meeting_body` (string, optional): The description for the meeting. (Used for `MEETING`)
|
||||
- `hs_meeting_start_time` (string, optional): The start time of the meeting. (Used for `MEETING`)
|
||||
- `hs_meeting_end_time` (string, optional): The end time of the meeting. (Used for `MEETING`)
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="HUBSPOT_UPDATE_RECORD_COMPANIES">
|
||||
**Description:** Update an existing company record in HubSpot.
|
||||
|
||||
**Parameters:**
|
||||
- `recordId` (string, required): The ID of the company to update.
|
||||
- `name` (string, optional): Name of the company.
|
||||
- `domain` (string, optional): Company Domain Name.
|
||||
- `industry` (string, optional): Industry.
|
||||
- `phone` (string, optional): Phone Number.
|
||||
- `city` (string, optional): City.
|
||||
- `state` (string, optional): State/Region.
|
||||
- `zip` (string, optional): Postal Code.
|
||||
- `numberofemployees` (number, optional): Number of Employees.
|
||||
- `annualrevenue` (number, optional): Annual Revenue.
|
||||
- `description` (string, optional): Description.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="HUBSPOT_CREATE_RECORD_ANY">
|
||||
**Description:** Create a record for a specified object type in HubSpot.
|
||||
|
||||
**Parameters:**
|
||||
- `recordType` (string, required): The object type ID of the custom object.
|
||||
- Additional parameters depend on the custom object's schema.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="HUBSPOT_UPDATE_RECORD_CONTACTS">
|
||||
**Description:** Update an existing contact record in HubSpot.
|
||||
|
||||
**Parameters:**
|
||||
- `recordId` (string, required): The ID of the contact to update.
|
||||
- `firstname` (string, optional): First Name.
|
||||
- `lastname` (string, optional): Last Name.
|
||||
- `email` (string, optional): Email address.
|
||||
- `phone` (string, optional): Phone Number.
|
||||
- `company` (string, optional): Company Name.
|
||||
- `jobtitle` (string, optional): Job Title.
|
||||
- `lifecyclestage` (string, optional): Lifecycle Stage.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="HUBSPOT_UPDATE_RECORD_DEALS">
|
||||
**Description:** Update an existing deal record in HubSpot.
|
||||
|
||||
**Parameters:**
|
||||
- `recordId` (string, required): The ID of the deal to update.
|
||||
- `dealname` (string, optional): Name of the deal.
|
||||
- `amount` (number, optional): The value of the deal.
|
||||
- `dealstage` (string, optional): The pipeline stage of the deal.
|
||||
- `pipeline` (string, optional): The pipeline the deal belongs to.
|
||||
- `closedate` (string, optional): The date the deal is expected to close.
|
||||
- `dealtype` (string, optional): The type of deal.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="HUBSPOT_UPDATE_RECORD_ENGAGEMENTS">
|
||||
**Description:** Update an existing engagement in HubSpot.
|
||||
|
||||
**Parameters:**
|
||||
- `recordId` (string, required): The ID of the engagement to update.
|
||||
- `hs_note_body` (string, optional): The body of the note.
|
||||
- `hs_task_subject` (string, optional): The title of the task.
|
||||
- `hs_task_body` (string, optional): The notes for the task.
|
||||
- `hs_task_status` (string, optional): The status of the task.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="HUBSPOT_UPDATE_RECORD_ANY">
|
||||
**Description:** Update a record for a specified object type in HubSpot.
|
||||
|
||||
**Parameters:**
|
||||
- `recordId` (string, required): The ID of the record to update.
|
||||
- `recordType` (string, required): The object type ID of the custom object.
|
||||
- Additional parameters depend on the custom object's schema.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="HUBSPOT_GET_RECORDS_COMPANIES">
|
||||
**Description:** Get a list of company records from HubSpot.
|
||||
|
||||
**Parameters:**
|
||||
- `paginationParameters` (object, optional): Use `pageCursor` to fetch subsequent pages.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="HUBSPOT_GET_RECORDS_CONTACTS">
|
||||
**Description:** Get a list of contact records from HubSpot.
|
||||
|
||||
**Parameters:**
|
||||
- `paginationParameters` (object, optional): Use `pageCursor` to fetch subsequent pages.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="HUBSPOT_GET_RECORDS_DEALS">
|
||||
**Description:** Get a list of deal records from HubSpot.
|
||||
|
||||
**Parameters:**
|
||||
- `paginationParameters` (object, optional): Use `pageCursor` to fetch subsequent pages.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="HUBSPOT_GET_RECORDS_ENGAGEMENTS">
|
||||
**Description:** Get a list of engagement records from HubSpot.
|
||||
|
||||
**Parameters:**
|
||||
- `objectName` (string, required): The type of engagement to fetch (e.g., "notes").
|
||||
- `paginationParameters` (object, optional): Use `pageCursor` to fetch subsequent pages.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="HUBSPOT_GET_RECORDS_ANY">
|
||||
**Description:** Get a list of records for any specified object type in HubSpot.
|
||||
|
||||
**Parameters:**
|
||||
- `recordType` (string, required): The object type ID of the custom object.
|
||||
- `paginationParameters` (object, optional): Use `pageCursor` to fetch subsequent pages.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="HUBSPOT_GET_RECORD_BY_ID_COMPANIES">
|
||||
**Description:** Get a single company record by its ID.
|
||||
|
||||
**Parameters:**
|
||||
- `recordId` (string, required): The ID of the company to retrieve.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="HUBSPOT_GET_RECORD_BY_ID_CONTACTS">
|
||||
**Description:** Get a single contact record by its ID.
|
||||
|
||||
**Parameters:**
|
||||
- `recordId` (string, required): The ID of the contact to retrieve.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="HUBSPOT_GET_RECORD_BY_ID_DEALS">
|
||||
**Description:** Get a single deal record by its ID.
|
||||
|
||||
**Parameters:**
|
||||
- `recordId` (string, required): The ID of the deal to retrieve.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="HUBSPOT_GET_RECORD_BY_ID_ENGAGEMENTS">
|
||||
**Description:** Get a single engagement record by its ID.
|
||||
|
||||
**Parameters:**
|
||||
- `recordId` (string, required): The ID of the engagement to retrieve.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="HUBSPOT_GET_RECORD_BY_ID_ANY">
|
||||
**Description:** Get a single record of any specified object type by its ID.
|
||||
|
||||
**Parameters:**
|
||||
- `recordType` (string, required): The object type ID of the custom object.
|
||||
- `recordId` (string, required): The ID of the record to retrieve.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="HUBSPOT_SEARCH_RECORDS_COMPANIES">
|
||||
**Description:** Search for company records in HubSpot using a filter formula.
|
||||
|
||||
**Parameters:**
|
||||
- `filterFormula` (object, optional): A filter in disjunctive normal form (OR of ANDs).
|
||||
- `paginationParameters` (object, optional): Use `pageCursor` to fetch subsequent pages.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="HUBSPOT_SEARCH_RECORDS_CONTACTS">
|
||||
**Description:** Search for contact records in HubSpot using a filter formula.
|
||||
|
||||
**Parameters:**
|
||||
- `filterFormula` (object, optional): A filter in disjunctive normal form (OR of ANDs).
|
||||
- `paginationParameters` (object, optional): Use `pageCursor` to fetch subsequent pages.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="HUBSPOT_SEARCH_RECORDS_DEALS">
|
||||
**Description:** Search for deal records in HubSpot using a filter formula.
|
||||
|
||||
**Parameters:**
|
||||
- `filterFormula` (object, optional): A filter in disjunctive normal form (OR of ANDs).
|
||||
- `paginationParameters` (object, optional): Use `pageCursor` to fetch subsequent pages.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="HUBSPOT_SEARCH_RECORDS_ENGAGEMENTS">
|
||||
**Description:** Search for engagement records in HubSpot using a filter formula.
|
||||
|
||||
**Parameters:**
|
||||
- `engagementFilterFormula` (object, optional): A filter for engagements.
|
||||
- `paginationParameters` (object, optional): Use `pageCursor` to fetch subsequent pages.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="HUBSPOT_SEARCH_RECORDS_ANY">
|
||||
**Description:** Search for records of any specified object type in HubSpot.
|
||||
|
||||
**Parameters:**
|
||||
- `recordType` (string, required): The object type ID to search.
|
||||
- `filterFormula` (string, optional): The filter formula to apply.
|
||||
- `paginationParameters` (object, optional): Use `pageCursor` to fetch subsequent pages.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="HUBSPOT_DELETE_RECORD_COMPANIES">
|
||||
**Description:** Delete a company record by its ID.
|
||||
|
||||
**Parameters:**
|
||||
- `recordId` (string, required): The ID of the company to delete.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="HUBSPOT_DELETE_RECORD_CONTACTS">
|
||||
**Description:** Delete a contact record by its ID.
|
||||
|
||||
**Parameters:**
|
||||
- `recordId` (string, required): The ID of the contact to delete.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="HUBSPOT_DELETE_RECORD_DEALS">
|
||||
**Description:** Delete a deal record by its ID.
|
||||
|
||||
**Parameters:**
|
||||
- `recordId` (string, required): The ID of the deal to delete.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="HUBSPOT_DELETE_RECORD_ENGAGEMENTS">
|
||||
**Description:** Delete an engagement record by its ID.
|
||||
|
||||
**Parameters:**
|
||||
- `recordId` (string, required): The ID of the engagement to delete.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="HUBSPOT_DELETE_RECORD_ANY">
|
||||
**Description:** Delete a record of any specified object type by its ID.
|
||||
|
||||
**Parameters:**
|
||||
- `recordType` (string, required): The object type ID of the custom object.
|
||||
- `recordId` (string, required): The ID of the record to delete.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="HUBSPOT_GET_CONTACTS_BY_LIST_ID">
|
||||
**Description:** Get contacts from a specific list by its ID.
|
||||
|
||||
**Parameters:**
|
||||
- `listId` (string, required): The ID of the list to get contacts from.
|
||||
- `paginationParameters` (object, optional): Use `pageCursor` for subsequent pages.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="HUBSPOT_DESCRIBE_ACTION_SCHEMA">
|
||||
**Description:** Get the expected schema for a given object type and operation.
|
||||
|
||||
**Parameters:**
|
||||
- `recordType` (string, required): The object type ID (e.g., 'companies').
|
||||
- `operation` (string, required): The operation type (e.g., 'CREATE_RECORD').
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
## Usage Examples
|
||||
|
||||
### Basic HubSpot Agent Setup
|
||||
|
||||
```python
|
||||
from crewai import Agent, Task, Crew
|
||||
from crewai_tools import CrewaiEnterpriseTools
|
||||
|
||||
# Get enterprise tools (HubSpot tools will be included)
|
||||
enterprise_tools = CrewaiEnterpriseTools(
|
||||
enterprise_token="your_enterprise_token"
|
||||
)
|
||||
|
||||
# Create an agent with HubSpot capabilities
|
||||
hubspot_agent = Agent(
|
||||
role="CRM Manager",
|
||||
goal="Manage company and contact records in HubSpot",
|
||||
backstory="An AI assistant specialized in CRM management.",
|
||||
tools=[enterprise_tools]
|
||||
)
|
||||
|
||||
# Task to create a new company
|
||||
create_company_task = Task(
|
||||
description="Create a new company in HubSpot with name 'Innovate Corp' and domain 'innovatecorp.com'.",
|
||||
agent=hubspot_agent,
|
||||
expected_output="Company created successfully with confirmation"
|
||||
)
|
||||
|
||||
# Run the task
|
||||
crew = Crew(
|
||||
agents=[hubspot_agent],
|
||||
tasks=[create_company_task]
|
||||
)
|
||||
|
||||
crew.kickoff()
|
||||
```
|
||||
|
||||
### Filtering Specific HubSpot Tools
|
||||
|
||||
```python
|
||||
from crewai_tools import CrewaiEnterpriseTools
|
||||
|
||||
# Get only the tool to create contacts
|
||||
enterprise_tools = CrewaiEnterpriseTools(
|
||||
enterprise_token="your_enterprise_token",
|
||||
actions_list=["hubspot_create_record_contacts"]
|
||||
)
|
||||
|
||||
contact_creator = Agent(
|
||||
role="Contact Creator",
|
||||
goal="Create new contacts in HubSpot",
|
||||
backstory="An AI assistant that focuses on creating new contact entries in the CRM.",
|
||||
tools=[enterprise_tools]
|
||||
)
|
||||
|
||||
# Task to create a contact
|
||||
create_contact = Task(
|
||||
description="Create a new contact for 'John Doe' with email 'john.doe@example.com'.",
|
||||
agent=contact_creator,
|
||||
expected_output="Contact created successfully in HubSpot."
|
||||
)
|
||||
|
||||
crew = Crew(
|
||||
agents=[contact_creator],
|
||||
tasks=[create_contact]
|
||||
)
|
||||
|
||||
crew.kickoff()
|
||||
```
|
||||
|
||||
### Contact Management
|
||||
|
||||
```python
|
||||
from crewai import Agent, Task, Crew
|
||||
from crewai_tools import CrewaiEnterpriseTools
|
||||
|
||||
enterprise_tools = CrewaiEnterpriseTools(
|
||||
enterprise_token="your_enterprise_token"
|
||||
)
|
||||
|
||||
crm_manager = Agent(
|
||||
role="CRM Manager",
|
||||
goal="Manage and organize HubSpot contacts efficiently.",
|
||||
backstory="An experienced CRM manager who maintains an organized contact database.",
|
||||
tools=[enterprise_tools]
|
||||
)
|
||||
|
||||
# Task to manage contacts
|
||||
contact_task = Task(
|
||||
description="Create a new contact for 'Jane Smith' at 'Global Tech Inc.' with email 'jane.smith@globaltech.com'.",
|
||||
agent=crm_manager,
|
||||
expected_output="Contact database updated with the new contact."
|
||||
)
|
||||
|
||||
crew = Crew(
|
||||
agents=[crm_manager],
|
||||
tasks=[contact_task]
|
||||
)
|
||||
|
||||
crew.kickoff()
|
||||
```
|
||||
|
||||
### Getting Help
|
||||
|
||||
<Card title="Need Help?" icon="headset" href="mailto:support@crewai.com">
|
||||
Contact our support team for assistance with HubSpot integration setup or troubleshooting.
|
||||
</Card>
|
||||
394
docs/en/enterprise/integrations/jira.mdx
Normal file
394
docs/en/enterprise/integrations/jira.mdx
Normal file
@@ -0,0 +1,394 @@
|
||||
---
|
||||
title: Jira Integration
|
||||
description: "Issue tracking and project management with Jira integration for CrewAI."
|
||||
icon: "bug"
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
Enable your agents to manage issues, projects, and workflows through Jira. Create and update issues, track project progress, manage assignments, and streamline your project management with AI-powered automation.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
Before using the Jira integration, ensure you have:
|
||||
|
||||
- A [CrewAI Enterprise](https://app.crewai.com) account with an active subscription
|
||||
- A Jira account with appropriate project permissions
|
||||
- Connected your Jira account through the [Integrations page](https://app.crewai.com/crewai_plus/connectors)
|
||||
|
||||
## Setting Up Jira Integration
|
||||
|
||||
### 1. Connect Your Jira Account
|
||||
|
||||
1. Navigate to [CrewAI Enterprise Integrations](https://app.crewai.com/crewai_plus/connectors)
|
||||
2. Find **Jira** in the Authentication Integrations section
|
||||
3. Click **Connect** and complete the OAuth flow
|
||||
4. Grant the necessary permissions for issue and project management
|
||||
5. Copy your Enterprise Token from [Account Settings](https://app.crewai.com/crewai_plus/settings/account)
|
||||
|
||||
### 2. Install Required Package
|
||||
|
||||
```bash
|
||||
uv add crewai-tools
|
||||
```
|
||||
|
||||
## Available Actions
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="JIRA_CREATE_ISSUE">
|
||||
**Description:** Create an issue in Jira.
|
||||
|
||||
**Parameters:**
|
||||
- `summary` (string, required): Summary - A brief one-line summary of the issue. (example: "The printer stopped working").
|
||||
- `project` (string, optional): Project - The project which the issue belongs to. Defaults to the user's first project if not provided. Use Connect Portal Workflow Settings to allow users to select a Project.
|
||||
- `issueType` (string, optional): Issue type - Defaults to Task if not provided.
|
||||
- `jiraIssueStatus` (string, optional): Status - Defaults to the project's first status if not provided.
|
||||
- `assignee` (string, optional): Assignee - Defaults to the authenticated user if not provided.
|
||||
- `descriptionType` (string, optional): Description Type - Select the Description Type.
|
||||
- Options: `description`, `descriptionJSON`
|
||||
- `description` (string, optional): Description - A detailed description of the issue. This field appears only when 'descriptionType' = 'description'.
|
||||
- `additionalFields` (string, optional): Additional Fields - Specify any other fields that should be included in JSON format. Use Connect Portal Workflow Settings to allow users to select which Issue Fields to update.
|
||||
```json
|
||||
{
|
||||
"customfield_10001": "value"
|
||||
}
|
||||
```
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="JIRA_UPDATE_ISSUE">
|
||||
**Description:** Update an issue in Jira.
|
||||
|
||||
**Parameters:**
|
||||
- `issueKey` (string, required): Issue Key (example: "TEST-1234").
|
||||
- `summary` (string, optional): Summary - A brief one-line summary of the issue. (example: "The printer stopped working").
|
||||
- `issueType` (string, optional): Issue type - Use Connect Portal Workflow Settings to allow users to select an Issue Type.
|
||||
- `jiraIssueStatus` (string, optional): Status - Use Connect Portal Workflow Settings to allow users to select a Status.
|
||||
- `assignee` (string, optional): Assignee - Use Connect Portal Workflow Settings to allow users to select an Assignee.
|
||||
- `descriptionType` (string, optional): Description Type - Select the Description Type.
|
||||
- Options: `description`, `descriptionJSON`
|
||||
- `description` (string, optional): Description - A detailed description of the issue. This field appears only when 'descriptionType' = 'description'.
|
||||
- `additionalFields` (string, optional): Additional Fields - Specify any other fields that should be included in JSON format.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="JIRA_GET_ISSUE_BY_KEY">
|
||||
**Description:** Get an issue by key in Jira.
|
||||
|
||||
**Parameters:**
|
||||
- `issueKey` (string, required): Issue Key (example: "TEST-1234").
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="JIRA_FILTER_ISSUES">
|
||||
**Description:** Search issues in Jira using filters.
|
||||
|
||||
**Parameters:**
|
||||
- `jqlQuery` (object, optional): A filter in disjunctive normal form - OR of AND groups of single conditions.
|
||||
```json
|
||||
{
|
||||
"operator": "OR",
|
||||
"conditions": [
|
||||
{
|
||||
"operator": "AND",
|
||||
"conditions": [
|
||||
{
|
||||
"field": "status",
|
||||
"operator": "$stringExactlyMatches",
|
||||
"value": "Open"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
Available operators: `$stringExactlyMatches`, `$stringDoesNotExactlyMatch`, `$stringIsIn`, `$stringIsNotIn`, `$stringContains`, `$stringDoesNotContain`, `$stringGreaterThan`, `$stringLessThan`
|
||||
- `limit` (string, optional): Limit results - Limit the maximum number of issues to return. Defaults to 10 if left blank.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="JIRA_SEARCH_BY_JQL">
|
||||
**Description:** Search issues by JQL in Jira.
|
||||
|
||||
**Parameters:**
|
||||
- `jqlQuery` (string, required): JQL Query (example: "project = PROJECT").
|
||||
- `paginationParameters` (object, optional): Pagination parameters for paginated results.
|
||||
```json
|
||||
{
|
||||
"pageCursor": "cursor_string"
|
||||
}
|
||||
```
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="JIRA_UPDATE_ISSUE_ANY">
|
||||
**Description:** Update any issue in Jira. Use DESCRIBE_ACTION_SCHEMA to get properties schema for this function.
|
||||
|
||||
**Parameters:** No specific parameters - use JIRA_DESCRIBE_ACTION_SCHEMA first to get the expected schema.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="JIRA_DESCRIBE_ACTION_SCHEMA">
|
||||
**Description:** Get the expected schema for an issue type. Use this function first if no other function matches the issue type you want to operate on.
|
||||
|
||||
**Parameters:**
|
||||
- `issueTypeId` (string, required): Issue Type ID.
|
||||
- `projectKey` (string, required): Project key.
|
||||
- `operation` (string, required): Operation Type value, for example CREATE_ISSUE or UPDATE_ISSUE.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="JIRA_GET_PROJECTS">
|
||||
**Description:** Get Projects in Jira.
|
||||
|
||||
**Parameters:**
|
||||
- `paginationParameters` (object, optional): Pagination Parameters.
|
||||
```json
|
||||
{
|
||||
"pageCursor": "cursor_string"
|
||||
}
|
||||
```
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="JIRA_GET_ISSUE_TYPES_BY_PROJECT">
|
||||
**Description:** Get Issue Types by project in Jira.
|
||||
|
||||
**Parameters:**
|
||||
- `project` (string, required): Project key.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="JIRA_GET_ISSUE_TYPES">
|
||||
**Description:** Get all Issue Types in Jira.
|
||||
|
||||
**Parameters:** None required.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="JIRA_GET_ISSUE_STATUS_BY_PROJECT">
|
||||
**Description:** Get issue statuses for a given project.
|
||||
|
||||
**Parameters:**
|
||||
- `project` (string, required): Project key.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="JIRA_GET_ALL_ASSIGNEES_BY_PROJECT">
|
||||
**Description:** Get assignees for a given project.
|
||||
|
||||
**Parameters:**
|
||||
- `project` (string, required): Project key.
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
## Usage Examples
|
||||
|
||||
### Basic Jira Agent Setup
|
||||
|
||||
```python
|
||||
from crewai import Agent, Task, Crew
|
||||
from crewai_tools import CrewaiEnterpriseTools
|
||||
|
||||
# Get enterprise tools (Jira tools will be included)
|
||||
enterprise_tools = CrewaiEnterpriseTools(
|
||||
enterprise_token="your_enterprise_token"
|
||||
)
|
||||
|
||||
# Create an agent with Jira capabilities
|
||||
jira_agent = Agent(
|
||||
role="Issue Manager",
|
||||
goal="Manage Jira issues and track project progress efficiently",
|
||||
backstory="An AI assistant specialized in issue tracking and project management.",
|
||||
tools=[enterprise_tools]
|
||||
)
|
||||
|
||||
# Task to create a bug report
|
||||
create_bug_task = Task(
|
||||
description="Create a bug report for the login functionality with high priority and assign it to the development team",
|
||||
agent=jira_agent,
|
||||
expected_output="Bug report created successfully with issue key"
|
||||
)
|
||||
|
||||
# Run the task
|
||||
crew = Crew(
|
||||
agents=[jira_agent],
|
||||
tasks=[create_bug_task]
|
||||
)
|
||||
|
||||
crew.kickoff()
|
||||
```
|
||||
|
||||
### Filtering Specific Jira Tools
|
||||
|
||||
```python
|
||||
from crewai_tools import CrewaiEnterpriseTools
|
||||
|
||||
# Get only specific Jira tools
|
||||
enterprise_tools = CrewaiEnterpriseTools(
|
||||
enterprise_token="your_enterprise_token",
|
||||
actions_list=["jira_create_issue", "jira_update_issue", "jira_search_by_jql"]
|
||||
)
|
||||
|
||||
issue_coordinator = Agent(
|
||||
role="Issue Coordinator",
|
||||
goal="Create and manage Jira issues efficiently",
|
||||
backstory="An AI assistant that focuses on issue creation and management.",
|
||||
tools=enterprise_tools
|
||||
)
|
||||
|
||||
# Task to manage issue workflow
|
||||
issue_workflow = Task(
|
||||
description="Create a feature request issue and update the status of related issues",
|
||||
agent=issue_coordinator,
|
||||
expected_output="Feature request created and related issues updated"
|
||||
)
|
||||
|
||||
crew = Crew(
|
||||
agents=[issue_coordinator],
|
||||
tasks=[issue_workflow]
|
||||
)
|
||||
|
||||
crew.kickoff()
|
||||
```
|
||||
|
||||
### Project Analysis and Reporting
|
||||
|
||||
```python
|
||||
from crewai import Agent, Task, Crew
|
||||
from crewai_tools import CrewaiEnterpriseTools
|
||||
|
||||
enterprise_tools = CrewaiEnterpriseTools(
|
||||
enterprise_token="your_enterprise_token"
|
||||
)
|
||||
|
||||
project_analyst = Agent(
|
||||
role="Project Analyst",
|
||||
goal="Analyze project data and generate insights from Jira",
|
||||
backstory="An experienced project analyst who extracts insights from project management data.",
|
||||
tools=[enterprise_tools]
|
||||
)
|
||||
|
||||
# Task to analyze project status
|
||||
analysis_task = Task(
|
||||
description="""
|
||||
1. Get all projects and their issue types
|
||||
2. Search for all open issues across projects
|
||||
3. Analyze issue distribution by status and assignee
|
||||
4. Create a summary report issue with findings
|
||||
""",
|
||||
agent=project_analyst,
|
||||
expected_output="Project analysis completed with summary report created"
|
||||
)
|
||||
|
||||
crew = Crew(
|
||||
agents=[project_analyst],
|
||||
tasks=[analysis_task]
|
||||
)
|
||||
|
||||
crew.kickoff()
|
||||
```
|
||||
|
||||
### Automated Issue Management
|
||||
|
||||
```python
|
||||
from crewai import Agent, Task, Crew
|
||||
from crewai_tools import CrewaiEnterpriseTools
|
||||
|
||||
enterprise_tools = CrewaiEnterpriseTools(
|
||||
enterprise_token="your_enterprise_token"
|
||||
)
|
||||
|
||||
automation_manager = Agent(
|
||||
role="Automation Manager",
|
||||
goal="Automate issue management and workflow processes",
|
||||
backstory="An AI assistant that automates repetitive issue management tasks.",
|
||||
tools=[enterprise_tools]
|
||||
)
|
||||
|
||||
# Task to automate issue management
|
||||
automation_task = Task(
|
||||
description="""
|
||||
1. Search for all unassigned issues using JQL
|
||||
2. Get available assignees for each project
|
||||
3. Automatically assign issues based on workload and expertise
|
||||
4. Update issue priorities based on age and type
|
||||
5. Create weekly sprint planning issues
|
||||
""",
|
||||
agent=automation_manager,
|
||||
expected_output="Issues automatically assigned and sprint planning issues created"
|
||||
)
|
||||
|
||||
crew = Crew(
|
||||
agents=[automation_manager],
|
||||
tasks=[automation_task]
|
||||
)
|
||||
|
||||
crew.kickoff()
|
||||
```
|
||||
|
||||
### Advanced Schema-Based Operations
|
||||
|
||||
```python
|
||||
from crewai import Agent, Task, Crew
|
||||
from crewai_tools import CrewaiEnterpriseTools
|
||||
|
||||
enterprise_tools = CrewaiEnterpriseTools(
|
||||
enterprise_token="your_enterprise_token"
|
||||
)
|
||||
|
||||
schema_specialist = Agent(
|
||||
role="Schema Specialist",
|
||||
goal="Handle complex Jira operations using dynamic schemas",
|
||||
backstory="An AI assistant that can work with dynamic Jira schemas and custom issue types.",
|
||||
tools=[enterprise_tools]
|
||||
)
|
||||
|
||||
# Task using schema-based operations
|
||||
schema_task = Task(
|
||||
description="""
|
||||
1. Get all projects and their custom issue types
|
||||
2. For each custom issue type, describe the action schema
|
||||
3. Create issues using the dynamic schema for complex custom fields
|
||||
4. Update issues with custom field values based on business rules
|
||||
""",
|
||||
agent=schema_specialist,
|
||||
expected_output="Custom issues created and updated using dynamic schemas"
|
||||
)
|
||||
|
||||
crew = Crew(
|
||||
agents=[schema_specialist],
|
||||
tasks=[schema_task]
|
||||
)
|
||||
|
||||
crew.kickoff()
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
|
||||
**Permission Errors**
|
||||
- Ensure your Jira account has necessary permissions for the target projects
|
||||
- Verify that the OAuth connection includes required scopes for Jira API
|
||||
- Check if you have create/edit permissions for issues in the specified projects
|
||||
|
||||
**Invalid Project or Issue Keys**
|
||||
- Double-check project keys and issue keys for correct format (e.g., "PROJ-123")
|
||||
- Ensure projects exist and are accessible to your account
|
||||
- Verify that issue keys reference existing issues
|
||||
|
||||
**Issue Type and Status Issues**
|
||||
- Use JIRA_GET_ISSUE_TYPES_BY_PROJECT to get valid issue types for a project
|
||||
- Use JIRA_GET_ISSUE_STATUS_BY_PROJECT to get valid statuses
|
||||
- Ensure issue types and statuses are available in the target project
|
||||
|
||||
**JQL Query Problems**
|
||||
- Test JQL queries in Jira's issue search before using in API calls
|
||||
- Ensure field names in JQL are spelled correctly and exist in your Jira instance
|
||||
- Use proper JQL syntax for complex queries
|
||||
|
||||
**Custom Fields and Schema Issues**
|
||||
- Use JIRA_DESCRIBE_ACTION_SCHEMA to get the correct schema for complex issue types
|
||||
- Ensure custom field IDs are correct (e.g., "customfield_10001")
|
||||
- Verify that custom fields are available in the target project and issue type
|
||||
|
||||
**Filter Formula Issues**
|
||||
- Ensure filter formulas follow the correct JSON structure for disjunctive normal form
|
||||
- Use valid field names that exist in your Jira configuration
|
||||
- Test simple filters before building complex multi-condition queries
|
||||
|
||||
### Getting Help
|
||||
|
||||
<Card title="Need Help?" icon="headset" href="mailto:support@crewai.com">
|
||||
Contact our support team for assistance with Jira integration setup or troubleshooting.
|
||||
</Card>
|
||||
453
docs/en/enterprise/integrations/linear.mdx
Normal file
453
docs/en/enterprise/integrations/linear.mdx
Normal file
@@ -0,0 +1,453 @@
|
||||
---
|
||||
title: Linear Integration
|
||||
description: "Software project and bug tracking with Linear integration for CrewAI."
|
||||
icon: "list-check"
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
Enable your agents to manage issues, projects, and development workflows through Linear. Create and update issues, manage project timelines, organize teams, and streamline your software development process with AI-powered automation.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
Before using the Linear integration, ensure you have:
|
||||
|
||||
- A [CrewAI Enterprise](https://app.crewai.com) account with an active subscription
|
||||
- A Linear account with appropriate workspace permissions
|
||||
- Connected your Linear account through the [Integrations page](https://app.crewai.com/crewai_plus/connectors)
|
||||
|
||||
## Setting Up Linear Integration
|
||||
|
||||
### 1. Connect Your Linear Account
|
||||
|
||||
1. Navigate to [CrewAI Enterprise Integrations](https://app.crewai.com/crewai_plus/connectors)
|
||||
2. Find **Linear** in the Authentication Integrations section
|
||||
3. Click **Connect** and complete the OAuth flow
|
||||
4. Grant the necessary permissions for issue and project management
|
||||
5. Copy your Enterprise Token from [Account Settings](https://app.crewai.com/crewai_plus/settings/account)
|
||||
|
||||
### 2. Install Required Package
|
||||
|
||||
```bash
|
||||
uv add crewai-tools
|
||||
```
|
||||
|
||||
## Available Actions
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="LINEAR_CREATE_ISSUE">
|
||||
**Description:** Create a new issue in Linear.
|
||||
|
||||
**Parameters:**
|
||||
- `teamId` (string, required): Team ID - Specify the Team ID of the parent for this new issue. Use Connect Portal Workflow Settings to allow users to select a Team ID. (example: "a70bdf0f-530a-4887-857d-46151b52b47c").
|
||||
- `title` (string, required): Title - Specify a title for this issue.
|
||||
- `description` (string, optional): Description - Specify a description for this issue.
|
||||
- `statusId` (string, optional): Status - Specify the state or status of this issue.
|
||||
- `priority` (string, optional): Priority - Specify the priority of this issue as an integer.
|
||||
- `dueDate` (string, optional): Due Date - Specify the due date of this issue in ISO 8601 format.
|
||||
- `cycleId` (string, optional): Cycle ID - Specify the cycle associated with this issue.
|
||||
- `additionalFields` (object, optional): Additional Fields.
|
||||
```json
|
||||
{
|
||||
"assigneeId": "a70bdf0f-530a-4887-857d-46151b52b47c",
|
||||
"labelIds": ["a70bdf0f-530a-4887-857d-46151b52b47c"]
|
||||
}
|
||||
```
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="LINEAR_UPDATE_ISSUE">
|
||||
**Description:** Update an issue in Linear.
|
||||
|
||||
**Parameters:**
|
||||
- `issueId` (string, required): Issue ID - Specify the Issue ID of the issue to update. (example: "90fbc706-18cd-42c9-ae66-6bd344cc8977").
|
||||
- `title` (string, optional): Title - Specify a title for this issue.
|
||||
- `description` (string, optional): Description - Specify a description for this issue.
|
||||
- `statusId` (string, optional): Status - Specify the state or status of this issue.
|
||||
- `priority` (string, optional): Priority - Specify the priority of this issue as an integer.
|
||||
- `dueDate` (string, optional): Due Date - Specify the due date of this issue in ISO 8601 format.
|
||||
- `cycleId` (string, optional): Cycle ID - Specify the cycle associated with this issue.
|
||||
- `additionalFields` (object, optional): Additional Fields.
|
||||
```json
|
||||
{
|
||||
"assigneeId": "a70bdf0f-530a-4887-857d-46151b52b47c",
|
||||
"labelIds": ["a70bdf0f-530a-4887-857d-46151b52b47c"]
|
||||
}
|
||||
```
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="LINEAR_GET_ISSUE_BY_ID">
|
||||
**Description:** Get an issue by ID in Linear.
|
||||
|
||||
**Parameters:**
|
||||
- `issueId` (string, required): Issue ID - Specify the record ID of the issue to fetch. (example: "90fbc706-18cd-42c9-ae66-6bd344cc8977").
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="LINEAR_GET_ISSUE_BY_ISSUE_IDENTIFIER">
|
||||
**Description:** Get an issue by issue identifier in Linear.
|
||||
|
||||
**Parameters:**
|
||||
- `externalId` (string, required): External ID - Specify the human-readable Issue identifier of the issue to fetch. (example: "ABC-1").
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="LINEAR_SEARCH_ISSUE">
|
||||
**Description:** Search issues in Linear.
|
||||
|
||||
**Parameters:**
|
||||
- `queryTerm` (string, required): Query Term - The search term to look for.
|
||||
- `issueFilterFormula` (object, optional): A filter in disjunctive normal form - OR of AND groups of single conditions.
|
||||
```json
|
||||
{
|
||||
"operator": "OR",
|
||||
"conditions": [
|
||||
{
|
||||
"operator": "AND",
|
||||
"conditions": [
|
||||
{
|
||||
"field": "title",
|
||||
"operator": "$stringContains",
|
||||
"value": "bug"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
Available fields: `title`, `number`, `project`, `createdAt`
|
||||
Available operators: `$stringExactlyMatches`, `$stringDoesNotExactlyMatch`, `$stringIsIn`, `$stringIsNotIn`, `$stringStartsWith`, `$stringDoesNotStartWith`, `$stringEndsWith`, `$stringDoesNotEndWith`, `$stringContains`, `$stringDoesNotContain`, `$stringGreaterThan`, `$stringLessThan`, `$numberGreaterThanOrEqualTo`, `$numberLessThanOrEqualTo`, `$numberGreaterThan`, `$numberLessThan`, `$dateTimeAfter`, `$dateTimeBefore`
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="LINEAR_DELETE_ISSUE">
|
||||
**Description:** Delete an issue in Linear.
|
||||
|
||||
**Parameters:**
|
||||
- `issueId` (string, required): Issue ID - Specify the record ID of the issue to delete. (example: "90fbc706-18cd-42c9-ae66-6bd344cc8977").
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="LINEAR_ARCHIVE_ISSUE">
|
||||
**Description:** Archive an issue in Linear.
|
||||
|
||||
**Parameters:**
|
||||
- `issueId` (string, required): Issue ID - Specify the record ID of the issue to archive. (example: "90fbc706-18cd-42c9-ae66-6bd344cc8977").
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="LINEAR_CREATE_SUB_ISSUE">
|
||||
**Description:** Create a sub-issue in Linear.
|
||||
|
||||
**Parameters:**
|
||||
- `parentId` (string, required): Parent ID - Specify the Issue ID for the parent of this new issue.
|
||||
- `teamId` (string, required): Team ID - Specify the Team ID of the parent for this new sub-issue. Use Connect Portal Workflow Settings to allow users to select a Team ID. (example: "a70bdf0f-530a-4887-857d-46151b52b47c").
|
||||
- `title` (string, required): Title - Specify a title for this issue.
|
||||
- `description` (string, optional): Description - Specify a description for this issue.
|
||||
- `additionalFields` (object, optional): Additional Fields.
|
||||
```json
|
||||
{
|
||||
"lead": "linear_user_id"
|
||||
}
|
||||
```
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="LINEAR_CREATE_PROJECT">
|
||||
**Description:** Create a new project in Linear.
|
||||
|
||||
**Parameters:**
|
||||
- `teamIds` (object, required): Team ID - Specify the team ID(s) this project is associated with as a string or a JSON array. Use Connect Portal User Settings to allow your user to select a Team ID.
|
||||
```json
|
||||
[
|
||||
"a70bdf0f-530a-4887-857d-46151b52b47c",
|
||||
"4ac7..."
|
||||
]
|
||||
```
|
||||
- `projectName` (string, required): Project Name - Specify the name of the project. (example: "My Linear Project").
|
||||
- `description` (string, optional): Project Description - Specify a description for this project.
|
||||
- `additionalFields` (object, optional): Additional Fields.
|
||||
```json
|
||||
{
|
||||
"state": "planned",
|
||||
"description": ""
|
||||
}
|
||||
```
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="LINEAR_UPDATE_PROJECT">
|
||||
**Description:** Update a project in Linear.
|
||||
|
||||
**Parameters:**
|
||||
- `projectId` (string, required): Project ID - Specify the ID of the project to update. (example: "a6634484-6061-4ac7-9739-7dc5e52c796b").
|
||||
- `projectName` (string, optional): Project Name - Specify the name of the project to update. (example: "My Linear Project").
|
||||
- `description` (string, optional): Project Description - Specify a description for this project.
|
||||
- `additionalFields` (object, optional): Additional Fields.
|
||||
```json
|
||||
{
|
||||
"state": "planned",
|
||||
"description": ""
|
||||
}
|
||||
```
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="LINEAR_GET_PROJECT_BY_ID">
|
||||
**Description:** Get a project by ID in Linear.
|
||||
|
||||
**Parameters:**
|
||||
- `projectId` (string, required): Project ID - Specify the Project ID of the project to fetch. (example: "a6634484-6061-4ac7-9739-7dc5e52c796b").
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="LINEAR_DELETE_PROJECT">
|
||||
**Description:** Delete a project in Linear.
|
||||
|
||||
**Parameters:**
|
||||
- `projectId` (string, required): Project ID - Specify the Project ID of the project to delete. (example: "a6634484-6061-4ac7-9739-7dc5e52c796b").
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="LINEAR_SEARCH_TEAMS">
|
||||
**Description:** Search teams in Linear.
|
||||
|
||||
**Parameters:**
|
||||
- `teamFilterFormula` (object, optional): A filter in disjunctive normal form - OR of AND groups of single conditions.
|
||||
```json
|
||||
{
|
||||
"operator": "OR",
|
||||
"conditions": [
|
||||
{
|
||||
"operator": "AND",
|
||||
"conditions": [
|
||||
{
|
||||
"field": "name",
|
||||
"operator": "$stringContains",
|
||||
"value": "Engineering"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
Available fields: `id`, `name`
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
## Usage Examples
|
||||
|
||||
### Basic Linear Agent Setup
|
||||
|
||||
```python
|
||||
from crewai import Agent, Task, Crew
|
||||
from crewai_tools import CrewaiEnterpriseTools
|
||||
|
||||
# Get enterprise tools (Linear tools will be included)
|
||||
enterprise_tools = CrewaiEnterpriseTools(
|
||||
enterprise_token="your_enterprise_token"
|
||||
)
|
||||
|
||||
# Create an agent with Linear capabilities
|
||||
linear_agent = Agent(
|
||||
role="Development Manager",
|
||||
goal="Manage Linear issues and track development progress efficiently",
|
||||
backstory="An AI assistant specialized in software development project management.",
|
||||
tools=[enterprise_tools]
|
||||
)
|
||||
|
||||
# Task to create a bug report
|
||||
create_bug_task = Task(
|
||||
description="Create a high-priority bug report for the authentication system and assign it to the backend team",
|
||||
agent=linear_agent,
|
||||
expected_output="Bug report created successfully with issue ID"
|
||||
)
|
||||
|
||||
# Run the task
|
||||
crew = Crew(
|
||||
agents=[linear_agent],
|
||||
tasks=[create_bug_task]
|
||||
)
|
||||
|
||||
crew.kickoff()
|
||||
```
|
||||
|
||||
### Filtering Specific Linear Tools
|
||||
|
||||
```python
|
||||
from crewai_tools import CrewaiEnterpriseTools
|
||||
|
||||
# Get only specific Linear tools
|
||||
enterprise_tools = CrewaiEnterpriseTools(
|
||||
enterprise_token="your_enterprise_token",
|
||||
actions_list=["linear_create_issue", "linear_update_issue", "linear_search_issue"]
|
||||
)
|
||||
|
||||
issue_manager = Agent(
|
||||
role="Issue Manager",
|
||||
goal="Create and manage Linear issues efficiently",
|
||||
backstory="An AI assistant that focuses on issue creation and lifecycle management.",
|
||||
tools=enterprise_tools
|
||||
)
|
||||
|
||||
# Task to manage issue workflow
|
||||
issue_workflow = Task(
|
||||
description="Create a feature request issue and update the status of related issues to reflect current progress",
|
||||
agent=issue_manager,
|
||||
expected_output="Feature request created and related issues updated"
|
||||
)
|
||||
|
||||
crew = Crew(
|
||||
agents=[issue_manager],
|
||||
tasks=[issue_workflow]
|
||||
)
|
||||
|
||||
crew.kickoff()
|
||||
```
|
||||
|
||||
### Project and Team Management
|
||||
|
||||
```python
|
||||
from crewai import Agent, Task, Crew
|
||||
from crewai_tools import CrewaiEnterpriseTools
|
||||
|
||||
enterprise_tools = CrewaiEnterpriseTools(
|
||||
enterprise_token="your_enterprise_token"
|
||||
)
|
||||
|
||||
project_coordinator = Agent(
|
||||
role="Project Coordinator",
|
||||
goal="Coordinate projects and teams in Linear efficiently",
|
||||
backstory="An experienced project coordinator who manages development cycles and team workflows.",
|
||||
tools=[enterprise_tools]
|
||||
)
|
||||
|
||||
# Task to coordinate project setup
|
||||
project_coordination = Task(
|
||||
description="""
|
||||
1. Search for engineering teams in Linear
|
||||
2. Create a new project for Q2 feature development
|
||||
3. Associate the project with relevant teams
|
||||
4. Create initial project milestones as issues
|
||||
""",
|
||||
agent=project_coordinator,
|
||||
expected_output="Q2 project created with teams assigned and initial milestones established"
|
||||
)
|
||||
|
||||
crew = Crew(
|
||||
agents=[project_coordinator],
|
||||
tasks=[project_coordination]
|
||||
)
|
||||
|
||||
crew.kickoff()
|
||||
```
|
||||
|
||||
### Issue Hierarchy and Sub-task Management
|
||||
|
||||
```python
|
||||
from crewai import Agent, Task, Crew
|
||||
from crewai_tools import CrewaiEnterpriseTools
|
||||
|
||||
enterprise_tools = CrewaiEnterpriseTools(
|
||||
enterprise_token="your_enterprise_token"
|
||||
)
|
||||
|
||||
task_organizer = Agent(
|
||||
role="Task Organizer",
|
||||
goal="Organize complex issues into manageable sub-tasks",
|
||||
backstory="An AI assistant that breaks down complex development work into organized sub-tasks.",
|
||||
tools=[enterprise_tools]
|
||||
)
|
||||
|
||||
# Task to create issue hierarchy
|
||||
hierarchy_task = Task(
|
||||
description="""
|
||||
1. Search for large feature issues that need to be broken down
|
||||
2. For each complex issue, create sub-issues for different components
|
||||
3. Update the parent issues with proper descriptions and links to sub-issues
|
||||
4. Assign sub-issues to appropriate team members based on expertise
|
||||
""",
|
||||
agent=task_organizer,
|
||||
expected_output="Complex issues broken down into manageable sub-tasks with proper assignments"
|
||||
)
|
||||
|
||||
crew = Crew(
|
||||
agents=[task_organizer],
|
||||
tasks=[hierarchy_task]
|
||||
)
|
||||
|
||||
crew.kickoff()
|
||||
```
|
||||
|
||||
### Automated Development Workflow
|
||||
|
||||
```python
|
||||
from crewai import Agent, Task, Crew
|
||||
from crewai_tools import CrewaiEnterpriseTools
|
||||
|
||||
enterprise_tools = CrewaiEnterpriseTools(
|
||||
enterprise_token="your_enterprise_token"
|
||||
)
|
||||
|
||||
workflow_automator = Agent(
|
||||
role="Workflow Automator",
|
||||
goal="Automate development workflow processes in Linear",
|
||||
backstory="An AI assistant that automates repetitive development workflow tasks.",
|
||||
tools=[enterprise_tools]
|
||||
)
|
||||
|
||||
# Complex workflow automation task
|
||||
automation_task = Task(
|
||||
description="""
|
||||
1. Search for issues that have been in progress for more than 7 days
|
||||
2. Update their priorities based on due dates and project importance
|
||||
3. Create weekly sprint planning issues for each team
|
||||
4. Archive completed issues from the previous cycle
|
||||
5. Generate project status reports as new issues
|
||||
""",
|
||||
agent=workflow_automator,
|
||||
expected_output="Development workflow automated with updated priorities, sprint planning, and status reports"
|
||||
)
|
||||
|
||||
crew = Crew(
|
||||
agents=[workflow_automator],
|
||||
tasks=[automation_task]
|
||||
)
|
||||
|
||||
crew.kickoff()
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
|
||||
**Permission Errors**
|
||||
- Ensure your Linear account has necessary permissions for the target workspace
|
||||
- Verify that the OAuth connection includes required scopes for Linear API
|
||||
- Check if you have create/edit permissions for issues and projects in the workspace
|
||||
|
||||
**Invalid IDs and References**
|
||||
- Double-check team IDs, issue IDs, and project IDs for correct UUID format
|
||||
- Ensure referenced entities (teams, projects, cycles) exist and are accessible
|
||||
- Verify that issue identifiers follow the correct format (e.g., "ABC-1")
|
||||
|
||||
**Team and Project Association Issues**
|
||||
- Use LINEAR_SEARCH_TEAMS to get valid team IDs before creating issues or projects
|
||||
- Ensure teams exist and are active in your workspace
|
||||
- Verify that team IDs are properly formatted as UUIDs
|
||||
|
||||
**Issue Status and Priority Problems**
|
||||
- Check that status IDs reference valid workflow states for the team
|
||||
- Ensure priority values are within the valid range for your Linear configuration
|
||||
- Verify that custom fields and labels exist before referencing them
|
||||
|
||||
**Date and Time Format Issues**
|
||||
- Use ISO 8601 format for due dates and timestamps
|
||||
- Ensure time zones are handled correctly for due date calculations
|
||||
- Verify that date values are valid and in the future for due dates
|
||||
|
||||
**Search and Filter Issues**
|
||||
- Ensure search queries are properly formatted and not empty
|
||||
- Use valid field names in filter formulas: `title`, `number`, `project`, `createdAt`
|
||||
- Test simple filters before building complex multi-condition queries
|
||||
- Verify that operator types match the data types of the fields being filtered
|
||||
|
||||
**Sub-issue Creation Problems**
|
||||
- Ensure parent issue IDs are valid and accessible
|
||||
- Verify that the team ID for sub-issues matches or is compatible with the parent issue's team
|
||||
- Check that parent issues are not already archived or deleted
|
||||
|
||||
### Getting Help
|
||||
|
||||
<Card title="Need Help?" icon="headset" href="mailto:support@crewai.com">
|
||||
Contact our support team for assistance with Linear integration setup or troubleshooting.
|
||||
</Card>
|
||||
509
docs/en/enterprise/integrations/notion.mdx
Normal file
509
docs/en/enterprise/integrations/notion.mdx
Normal file
@@ -0,0 +1,509 @@
|
||||
---
|
||||
title: Notion Integration
|
||||
description: "Page and database management with Notion integration for CrewAI."
|
||||
icon: "book"
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
Enable your agents to manage pages, databases, and content through Notion. Create and update pages, manage content blocks, organize knowledge bases, and streamline your documentation workflows with AI-powered automation.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
Before using the Notion integration, ensure you have:
|
||||
|
||||
- A [CrewAI Enterprise](https://app.crewai.com) account with an active subscription
|
||||
- A Notion account with appropriate workspace permissions
|
||||
- Connected your Notion account through the [Integrations page](https://app.crewai.com/crewai_plus/connectors)
|
||||
|
||||
## Setting Up Notion Integration
|
||||
|
||||
### 1. Connect Your Notion Account
|
||||
|
||||
1. Navigate to [CrewAI Enterprise Integrations](https://app.crewai.com/crewai_plus/connectors)
|
||||
2. Find **Notion** in the Authentication Integrations section
|
||||
3. Click **Connect** and complete the OAuth flow
|
||||
4. Grant the necessary permissions for page and database management
|
||||
5. Copy your Enterprise Token from [Account Settings](https://app.crewai.com/crewai_plus/settings/account)
|
||||
|
||||
### 2. Install Required Package
|
||||
|
||||
```bash
|
||||
uv add crewai-tools
|
||||
```
|
||||
|
||||
## Available Actions
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="NOTION_CREATE_PAGE">
|
||||
**Description:** Create a page in Notion.
|
||||
|
||||
**Parameters:**
|
||||
- `parent` (object, required): Parent - The parent page or database where the new page is inserted, represented as a JSON object with a page_id or database_id key.
|
||||
```json
|
||||
{
|
||||
"database_id": "DATABASE_ID"
|
||||
}
|
||||
```
|
||||
- `properties` (object, required): Properties - The values of the page's properties. If the parent is a database, then the schema must match the parent database's properties.
|
||||
```json
|
||||
{
|
||||
"title": [
|
||||
{
|
||||
"text": {
|
||||
"content": "My Page"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
- `icon` (object, required): Icon - The page icon.
|
||||
```json
|
||||
{
|
||||
"emoji": "🥬"
|
||||
}
|
||||
```
|
||||
- `children` (object, optional): Children - Content blocks to add to the page.
|
||||
```json
|
||||
[
|
||||
{
|
||||
"object": "block",
|
||||
"type": "heading_2",
|
||||
"heading_2": {
|
||||
"rich_text": [
|
||||
{
|
||||
"type": "text",
|
||||
"text": {
|
||||
"content": "Lacinato kale"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
```
|
||||
- `cover` (object, optional): Cover - The page cover image.
|
||||
```json
|
||||
{
|
||||
"external": {
|
||||
"url": "https://upload.wikimedia.org/wikipedia/commons/6/62/Tuscankale.jpg"
|
||||
}
|
||||
}
|
||||
```
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="NOTION_UPDATE_PAGE">
|
||||
**Description:** Update a page in Notion.
|
||||
|
||||
**Parameters:**
|
||||
- `pageId` (string, required): Page ID - Specify the ID of the Page to Update. (example: "59833787-2cf9-4fdf-8782-e53db20768a5").
|
||||
- `icon` (object, required): Icon - The page icon.
|
||||
```json
|
||||
{
|
||||
"emoji": "🥬"
|
||||
}
|
||||
```
|
||||
- `archived` (boolean, optional): Archived - Whether the page is archived (deleted). Set to true to archive a page. Set to false to un-archive (restore) a page.
|
||||
- `properties` (object, optional): Properties - The property values to update for the page.
|
||||
```json
|
||||
{
|
||||
"title": [
|
||||
{
|
||||
"text": {
|
||||
"content": "My Updated Page"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
- `cover` (object, optional): Cover - The page cover image.
|
||||
```json
|
||||
{
|
||||
"external": {
|
||||
"url": "https://upload.wikimedia.org/wikipedia/commons/6/62/Tuscankale.jpg"
|
||||
}
|
||||
}
|
||||
```
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="NOTION_GET_PAGE_BY_ID">
|
||||
**Description:** Get a page by ID in Notion.
|
||||
|
||||
**Parameters:**
|
||||
- `pageId` (string, required): Page ID - Specify the ID of the Page to Get. (example: "59833787-2cf9-4fdf-8782-e53db20768a5").
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="NOTION_ARCHIVE_PAGE">
|
||||
**Description:** Archive a page in Notion.
|
||||
|
||||
**Parameters:**
|
||||
- `pageId` (string, required): Page ID - Specify the ID of the Page to Archive. (example: "59833787-2cf9-4fdf-8782-e53db20768a5").
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="NOTION_SEARCH_PAGES">
|
||||
**Description:** Search pages in Notion using filters.
|
||||
|
||||
**Parameters:**
|
||||
- `searchByTitleFilterSearch` (object, optional): A filter in disjunctive normal form - OR of AND groups of single conditions.
|
||||
```json
|
||||
{
|
||||
"operator": "OR",
|
||||
"conditions": [
|
||||
{
|
||||
"operator": "AND",
|
||||
"conditions": [
|
||||
{
|
||||
"field": "query",
|
||||
"operator": "$stringExactlyMatches",
|
||||
"value": "meeting notes"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
Available fields: `query`, `filter.value`, `direction`, `page_size`
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="NOTION_GET_PAGE_CONTENT">
|
||||
**Description:** Get page content (blocks) in Notion.
|
||||
|
||||
**Parameters:**
|
||||
- `blockId` (string, required): Page ID - Specify a Block or Page ID to receive all of its block's children in order. (example: "59833787-2cf9-4fdf-8782-e53db20768a5").
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="NOTION_UPDATE_BLOCK">
|
||||
**Description:** Update a block in Notion.
|
||||
|
||||
**Parameters:**
|
||||
- `blockId` (string, required): Block ID - Specify the ID of the Block to Update. (example: "9bc30ad4-9373-46a5-84ab-0a7845ee52e6").
|
||||
- `archived` (boolean, optional): Archived - Set to true to archive (delete) a block. Set to false to un-archive (restore) a block.
|
||||
- `paragraph` (object, optional): Paragraph content.
|
||||
```json
|
||||
{
|
||||
"rich_text": [
|
||||
{
|
||||
"type": "text",
|
||||
"text": {
|
||||
"content": "Lacinato kale",
|
||||
"link": null
|
||||
}
|
||||
}
|
||||
],
|
||||
"color": "default"
|
||||
}
|
||||
```
|
||||
- `image` (object, optional): Image block.
|
||||
```json
|
||||
{
|
||||
"type": "external",
|
||||
"external": {
|
||||
"url": "https://website.domain/images/image.png"
|
||||
}
|
||||
}
|
||||
```
|
||||
- `bookmark` (object, optional): Bookmark block.
|
||||
```json
|
||||
{
|
||||
"caption": [],
|
||||
"url": "https://companywebsite.com"
|
||||
}
|
||||
```
|
||||
- `code` (object, optional): Code block.
|
||||
```json
|
||||
{
|
||||
"rich_text": [
|
||||
{
|
||||
"type": "text",
|
||||
"text": {
|
||||
"content": "const a = 3"
|
||||
}
|
||||
}
|
||||
],
|
||||
"language": "javascript"
|
||||
}
|
||||
```
|
||||
- `pdf` (object, optional): PDF block.
|
||||
```json
|
||||
{
|
||||
"type": "external",
|
||||
"external": {
|
||||
"url": "https://website.domain/files/doc.pdf"
|
||||
}
|
||||
}
|
||||
```
|
||||
- `table` (object, optional): Table block.
|
||||
```json
|
||||
{
|
||||
"table_width": 2,
|
||||
"has_column_header": false,
|
||||
"has_row_header": false
|
||||
}
|
||||
```
|
||||
- `tableOfContent` (object, optional): Table of Contents block.
|
||||
```json
|
||||
{
|
||||
"color": "default"
|
||||
}
|
||||
```
|
||||
- `additionalFields` (object, optional): Additional block types.
|
||||
```json
|
||||
{
|
||||
"child_page": {
|
||||
"title": "Lacinato kale"
|
||||
},
|
||||
"child_database": {
|
||||
"title": "My database"
|
||||
}
|
||||
}
|
||||
```
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="NOTION_GET_BLOCK_BY_ID">
|
||||
**Description:** Get a block by ID in Notion.
|
||||
|
||||
**Parameters:**
|
||||
- `blockId` (string, required): Block ID - Specify the ID of the Block to Get. (example: "9bc30ad4-9373-46a5-84ab-0a7845ee52e6").
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="NOTION_DELETE_BLOCK">
|
||||
**Description:** Delete a block in Notion.
|
||||
|
||||
**Parameters:**
|
||||
- `blockId` (string, required): Block ID - Specify the ID of the Block to Delete. (example: "9bc30ad4-9373-46a5-84ab-0a7845ee52e6").
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
## Usage Examples
|
||||
|
||||
### Basic Notion Agent Setup
|
||||
|
||||
```python
|
||||
from crewai import Agent, Task, Crew
|
||||
from crewai_tools import CrewaiEnterpriseTools
|
||||
|
||||
# Get enterprise tools (Notion tools will be included)
|
||||
enterprise_tools = CrewaiEnterpriseTools(
|
||||
enterprise_token="your_enterprise_token"
|
||||
)
|
||||
|
||||
# Create an agent with Notion capabilities
|
||||
notion_agent = Agent(
|
||||
role="Documentation Manager",
|
||||
goal="Manage documentation and knowledge base in Notion efficiently",
|
||||
backstory="An AI assistant specialized in content management and documentation.",
|
||||
tools=[enterprise_tools]
|
||||
)
|
||||
|
||||
# Task to create a meeting notes page
|
||||
create_notes_task = Task(
|
||||
description="Create a new meeting notes page in the team database with today's date and agenda items",
|
||||
agent=notion_agent,
|
||||
expected_output="Meeting notes page created successfully with structured content"
|
||||
)
|
||||
|
||||
# Run the task
|
||||
crew = Crew(
|
||||
agents=[notion_agent],
|
||||
tasks=[create_notes_task]
|
||||
)
|
||||
|
||||
crew.kickoff()
|
||||
```
|
||||
|
||||
### Filtering Specific Notion Tools
|
||||
|
||||
```python
|
||||
from crewai_tools import CrewaiEnterpriseTools
|
||||
|
||||
# Get only specific Notion tools
|
||||
enterprise_tools = CrewaiEnterpriseTools(
|
||||
enterprise_token="your_enterprise_token",
|
||||
actions_list=["notion_create_page", "notion_update_block", "notion_search_pages"]
|
||||
)
|
||||
|
||||
content_manager = Agent(
|
||||
role="Content Manager",
|
||||
goal="Create and manage content pages efficiently",
|
||||
backstory="An AI assistant that focuses on content creation and management.",
|
||||
tools=enterprise_tools
|
||||
)
|
||||
|
||||
# Task to manage content workflow
|
||||
content_workflow = Task(
|
||||
description="Create a new project documentation page and add structured content blocks for requirements and specifications",
|
||||
agent=content_manager,
|
||||
expected_output="Project documentation created with organized content sections"
|
||||
)
|
||||
|
||||
crew = Crew(
|
||||
agents=[content_manager],
|
||||
tasks=[content_workflow]
|
||||
)
|
||||
|
||||
crew.kickoff()
|
||||
```
|
||||
|
||||
### Knowledge Base Management
|
||||
|
||||
```python
|
||||
from crewai import Agent, Task, Crew
|
||||
from crewai_tools import CrewaiEnterpriseTools
|
||||
|
||||
enterprise_tools = CrewaiEnterpriseTools(
|
||||
enterprise_token="your_enterprise_token"
|
||||
)
|
||||
|
||||
knowledge_curator = Agent(
|
||||
role="Knowledge Curator",
|
||||
goal="Curate and organize knowledge base content in Notion",
|
||||
backstory="An experienced knowledge manager who organizes and maintains comprehensive documentation.",
|
||||
tools=[enterprise_tools]
|
||||
)
|
||||
|
||||
# Task to curate knowledge base
|
||||
curation_task = Task(
|
||||
description="""
|
||||
1. Search for existing documentation pages related to our new product feature
|
||||
2. Create a comprehensive feature documentation page with proper structure
|
||||
3. Add code examples, images, and links to related resources
|
||||
4. Update existing pages with cross-references to the new documentation
|
||||
""",
|
||||
agent=knowledge_curator,
|
||||
expected_output="Feature documentation created and integrated with existing knowledge base"
|
||||
)
|
||||
|
||||
crew = Crew(
|
||||
agents=[knowledge_curator],
|
||||
tasks=[curation_task]
|
||||
)
|
||||
|
||||
crew.kickoff()
|
||||
```
|
||||
|
||||
### Content Structure and Organization
|
||||
|
||||
```python
|
||||
from crewai import Agent, Task, Crew
|
||||
from crewai_tools import CrewaiEnterpriseTools
|
||||
|
||||
enterprise_tools = CrewaiEnterpriseTools(
|
||||
enterprise_token="your_enterprise_token"
|
||||
)
|
||||
|
||||
content_organizer = Agent(
|
||||
role="Content Organizer",
|
||||
goal="Organize and structure content blocks for optimal readability",
|
||||
backstory="An AI assistant that specializes in content structure and user experience.",
|
||||
tools=[enterprise_tools]
|
||||
)
|
||||
|
||||
# Task to organize content structure
|
||||
organization_task = Task(
|
||||
description="""
|
||||
1. Get content from existing project pages
|
||||
2. Analyze the structure and identify improvement opportunities
|
||||
3. Update content blocks to use proper headings, tables, and formatting
|
||||
4. Add table of contents and improve navigation between related pages
|
||||
5. Create templates for future documentation consistency
|
||||
""",
|
||||
agent=content_organizer,
|
||||
expected_output="Content reorganized with improved structure and navigation"
|
||||
)
|
||||
|
||||
crew = Crew(
|
||||
agents=[content_organizer],
|
||||
tasks=[organization_task]
|
||||
)
|
||||
|
||||
crew.kickoff()
|
||||
```
|
||||
|
||||
### Automated Documentation Workflows
|
||||
|
||||
```python
|
||||
from crewai import Agent, Task, Crew
|
||||
from crewai_tools import CrewaiEnterpriseTools
|
||||
|
||||
enterprise_tools = CrewaiEnterpriseTools(
|
||||
enterprise_token="your_enterprise_token"
|
||||
)
|
||||
|
||||
doc_automator = Agent(
|
||||
role="Documentation Automator",
|
||||
goal="Automate documentation workflows and maintenance",
|
||||
backstory="An AI assistant that automates repetitive documentation tasks.",
|
||||
tools=[enterprise_tools]
|
||||
)
|
||||
|
||||
# Complex documentation automation task
|
||||
automation_task = Task(
|
||||
description="""
|
||||
1. Search for pages that haven't been updated in the last 30 days
|
||||
2. Review and update outdated content blocks
|
||||
3. Create weekly team update pages with consistent formatting
|
||||
4. Add status indicators and progress tracking to project pages
|
||||
5. Generate monthly documentation health reports
|
||||
6. Archive completed project pages and organize them in archive sections
|
||||
""",
|
||||
agent=doc_automator,
|
||||
expected_output="Documentation automated with updated content, weekly reports, and organized archives"
|
||||
)
|
||||
|
||||
crew = Crew(
|
||||
agents=[doc_automator],
|
||||
tasks=[automation_task]
|
||||
)
|
||||
|
||||
crew.kickoff()
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
|
||||
**Permission Errors**
|
||||
- Ensure your Notion account has edit access to the target workspace
|
||||
- Verify that the OAuth connection includes required scopes for Notion API
|
||||
- Check that pages and databases are shared with the authenticated integration
|
||||
|
||||
**Invalid Page and Block IDs**
|
||||
- Double-check page IDs and block IDs for correct UUID format
|
||||
- Ensure referenced pages and blocks exist and are accessible
|
||||
- Verify that parent page or database IDs are valid when creating new pages
|
||||
|
||||
**Property Schema Issues**
|
||||
- Ensure page properties match the database schema when creating pages in databases
|
||||
- Verify that property names and types are correct for the target database
|
||||
- Check that required properties are included when creating or updating pages
|
||||
|
||||
**Content Block Structure**
|
||||
- Ensure block content follows Notion's rich text format specifications
|
||||
- Verify that nested block structures are properly formatted
|
||||
- Check that media URLs are accessible and properly formatted
|
||||
|
||||
**Search and Filter Issues**
|
||||
- Ensure search queries are properly formatted and not empty
|
||||
- Use valid field names in filter formulas: `query`, `filter.value`, `direction`, `page_size`
|
||||
- Test simple searches before building complex filter conditions
|
||||
|
||||
**Parent-Child Relationships**
|
||||
- Verify that parent page or database exists before creating child pages
|
||||
- Ensure proper permissions exist for the parent container
|
||||
- Check that database schemas allow the properties you're trying to set
|
||||
|
||||
**Rich Text and Media Content**
|
||||
- Ensure URLs for external images, PDFs, and bookmarks are accessible
|
||||
- Verify that rich text formatting follows Notion's API specifications
|
||||
- Check that code block language types are supported by Notion
|
||||
|
||||
**Archive and Deletion Operations**
|
||||
- Understand the difference between archiving (reversible) and deleting (permanent)
|
||||
- Verify that you have permissions to archive or delete the target content
|
||||
- Be cautious with bulk operations that might affect multiple pages or blocks
|
||||
|
||||
### Getting Help
|
||||
|
||||
<Card title="Need Help?" icon="headset" href="mailto:support@crewai.com">
|
||||
Contact our support team for assistance with Notion integration setup or troubleshooting.
|
||||
</Card>
|
||||
632
docs/en/enterprise/integrations/salesforce.mdx
Normal file
632
docs/en/enterprise/integrations/salesforce.mdx
Normal file
@@ -0,0 +1,632 @@
|
||||
---
|
||||
title: Salesforce Integration
|
||||
description: "CRM and sales automation with Salesforce integration for CrewAI."
|
||||
icon: "salesforce"
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
Enable your agents to manage customer relationships, sales processes, and data through Salesforce. Create and update records, manage leads and opportunities, execute SOQL queries, and streamline your CRM workflows with AI-powered automation.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
Before using the Salesforce integration, ensure you have:
|
||||
|
||||
- A [CrewAI Enterprise](https://app.crewai.com) account with an active subscription
|
||||
- A Salesforce account with appropriate permissions
|
||||
- Connected your Salesforce account through the [Integrations page](https://app.crewai.com/integrations)
|
||||
|
||||
## Available Tools
|
||||
|
||||
### **Record Management**
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="SALESFORCE_CREATE_RECORD_CONTACT">
|
||||
**Description:** Create a new Contact record in Salesforce.
|
||||
|
||||
**Parameters:**
|
||||
- `FirstName` (string, optional): First Name
|
||||
- `LastName` (string, required): Last Name - This field is required
|
||||
- `accountId` (string, optional): Account ID - The Account that the Contact belongs to
|
||||
- `Email` (string, optional): Email address
|
||||
- `Title` (string, optional): Title of the contact, such as CEO or Vice President
|
||||
- `Description` (string, optional): A description of the Contact
|
||||
- `additionalFields` (object, optional): Additional fields in JSON format for custom Contact fields
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="SALESFORCE_CREATE_RECORD_LEAD">
|
||||
**Description:** Create a new Lead record in Salesforce.
|
||||
|
||||
**Parameters:**
|
||||
- `FirstName` (string, optional): First Name
|
||||
- `LastName` (string, required): Last Name - This field is required
|
||||
- `Company` (string, required): Company - This field is required
|
||||
- `Email` (string, optional): Email address
|
||||
- `Phone` (string, optional): Phone number
|
||||
- `Website` (string, optional): Website URL
|
||||
- `Title` (string, optional): Title of the contact, such as CEO or Vice President
|
||||
- `Status` (string, optional): Lead Status - Use Connect Portal Workflow Settings to select Lead Status
|
||||
- `Description` (string, optional): A description of the Lead
|
||||
- `additionalFields` (object, optional): Additional fields in JSON format for custom Lead fields
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="SALESFORCE_CREATE_RECORD_OPPORTUNITY">
|
||||
**Description:** Create a new Opportunity record in Salesforce.
|
||||
|
||||
**Parameters:**
|
||||
- `Name` (string, required): The Opportunity name - This field is required
|
||||
- `StageName` (string, optional): Opportunity Stage - Use Connect Portal Workflow Settings to select stage
|
||||
- `CloseDate` (string, optional): Close Date in YYYY-MM-DD format - Defaults to 30 days from current date
|
||||
- `AccountId` (string, optional): The Account that the Opportunity belongs to
|
||||
- `Amount` (string, optional): Estimated total sale amount
|
||||
- `Description` (string, optional): A description of the Opportunity
|
||||
- `OwnerId` (string, optional): The Salesforce user assigned to work on this Opportunity
|
||||
- `NextStep` (string, optional): Description of next task in closing Opportunity
|
||||
- `additionalFields` (object, optional): Additional fields in JSON format for custom Opportunity fields
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="SALESFORCE_CREATE_RECORD_TASK">
|
||||
**Description:** Create a new Task record in Salesforce.
|
||||
|
||||
**Parameters:**
|
||||
- `whatId` (string, optional): Related to ID - The ID of the Account or Opportunity this Task is related to
|
||||
- `whoId` (string, optional): Name ID - The ID of the Contact or Lead this Task is related to
|
||||
- `subject` (string, required): Subject of the task
|
||||
- `activityDate` (string, optional): Activity Date in YYYY-MM-DD format
|
||||
- `description` (string, optional): A description of the Task
|
||||
- `taskSubtype` (string, required): Task Subtype - Options: task, email, listEmail, call
|
||||
- `Status` (string, optional): Status - Options: Not Started, In Progress, Completed
|
||||
- `ownerId` (string, optional): Assigned To ID - The Salesforce user assigned to this Task
|
||||
- `callDurationInSeconds` (string, optional): Call Duration in seconds
|
||||
- `isReminderSet` (boolean, optional): Whether reminder is set
|
||||
- `reminderDateTime` (string, optional): Reminder Date/Time in ISO format
|
||||
- `additionalFields` (object, optional): Additional fields in JSON format for custom Task fields
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="SALESFORCE_CREATE_RECORD_ACCOUNT">
|
||||
**Description:** Create a new Account record in Salesforce.
|
||||
|
||||
**Parameters:**
|
||||
- `Name` (string, required): The Account name - This field is required
|
||||
- `OwnerId` (string, optional): The Salesforce user assigned to this Account
|
||||
- `Website` (string, optional): Website URL
|
||||
- `Phone` (string, optional): Phone number
|
||||
- `Description` (string, optional): Account description
|
||||
- `additionalFields` (object, optional): Additional fields in JSON format for custom Account fields
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="SALESFORCE_CREATE_RECORD_ANY">
|
||||
**Description:** Create a record of any object type in Salesforce.
|
||||
|
||||
**Note:** This is a flexible tool for creating records of custom or unknown object types.
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
### **Record Updates**
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="SALESFORCE_UPDATE_RECORD_CONTACT">
|
||||
**Description:** Update an existing Contact record in Salesforce.
|
||||
|
||||
**Parameters:**
|
||||
- `recordId` (string, required): The ID of the record to update
|
||||
- `FirstName` (string, optional): First Name
|
||||
- `LastName` (string, optional): Last Name
|
||||
- `accountId` (string, optional): Account ID - The Account that the Contact belongs to
|
||||
- `Email` (string, optional): Email address
|
||||
- `Title` (string, optional): Title of the contact
|
||||
- `Description` (string, optional): A description of the Contact
|
||||
- `additionalFields` (object, optional): Additional fields in JSON format for custom Contact fields
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="SALESFORCE_UPDATE_RECORD_LEAD">
|
||||
**Description:** Update an existing Lead record in Salesforce.
|
||||
|
||||
**Parameters:**
|
||||
- `recordId` (string, required): The ID of the record to update
|
||||
- `FirstName` (string, optional): First Name
|
||||
- `LastName` (string, optional): Last Name
|
||||
- `Company` (string, optional): Company name
|
||||
- `Email` (string, optional): Email address
|
||||
- `Phone` (string, optional): Phone number
|
||||
- `Website` (string, optional): Website URL
|
||||
- `Title` (string, optional): Title of the contact
|
||||
- `Status` (string, optional): Lead Status
|
||||
- `Description` (string, optional): A description of the Lead
|
||||
- `additionalFields` (object, optional): Additional fields in JSON format for custom Lead fields
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="SALESFORCE_UPDATE_RECORD_OPPORTUNITY">
|
||||
**Description:** Update an existing Opportunity record in Salesforce.
|
||||
|
||||
**Parameters:**
|
||||
- `recordId` (string, required): The ID of the record to update
|
||||
- `Name` (string, optional): The Opportunity name
|
||||
- `StageName` (string, optional): Opportunity Stage
|
||||
- `CloseDate` (string, optional): Close Date in YYYY-MM-DD format
|
||||
- `AccountId` (string, optional): The Account that the Opportunity belongs to
|
||||
- `Amount` (string, optional): Estimated total sale amount
|
||||
- `Description` (string, optional): A description of the Opportunity
|
||||
- `OwnerId` (string, optional): The Salesforce user assigned to work on this Opportunity
|
||||
- `NextStep` (string, optional): Description of next task in closing Opportunity
|
||||
- `additionalFields` (object, optional): Additional fields in JSON format for custom Opportunity fields
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="SALESFORCE_UPDATE_RECORD_TASK">
|
||||
**Description:** Update an existing Task record in Salesforce.
|
||||
|
||||
**Parameters:**
|
||||
- `recordId` (string, required): The ID of the record to update
|
||||
- `whatId` (string, optional): Related to ID - The ID of the Account or Opportunity this Task is related to
|
||||
- `whoId` (string, optional): Name ID - The ID of the Contact or Lead this Task is related to
|
||||
- `subject` (string, optional): Subject of the task
|
||||
- `activityDate` (string, optional): Activity Date in YYYY-MM-DD format
|
||||
- `description` (string, optional): A description of the Task
|
||||
- `Status` (string, optional): Status - Options: Not Started, In Progress, Completed
|
||||
- `ownerId` (string, optional): Assigned To ID - The Salesforce user assigned to this Task
|
||||
- `callDurationInSeconds` (string, optional): Call Duration in seconds
|
||||
- `isReminderSet` (boolean, optional): Whether reminder is set
|
||||
- `reminderDateTime` (string, optional): Reminder Date/Time in ISO format
|
||||
- `additionalFields` (object, optional): Additional fields in JSON format for custom Task fields
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="SALESFORCE_UPDATE_RECORD_ACCOUNT">
|
||||
**Description:** Update an existing Account record in Salesforce.
|
||||
|
||||
**Parameters:**
|
||||
- `recordId` (string, required): The ID of the record to update
|
||||
- `Name` (string, optional): The Account name
|
||||
- `OwnerId` (string, optional): The Salesforce user assigned to this Account
|
||||
- `Website` (string, optional): Website URL
|
||||
- `Phone` (string, optional): Phone number
|
||||
- `Description` (string, optional): Account description
|
||||
- `additionalFields` (object, optional): Additional fields in JSON format for custom Account fields
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="SALESFORCE_UPDATE_RECORD_ANY">
|
||||
**Description:** Update a record of any object type in Salesforce.
|
||||
|
||||
**Note:** This is a flexible tool for updating records of custom or unknown object types.
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
### **Record Retrieval**
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="SALESFORCE_GET_RECORD_BY_ID_CONTACT">
|
||||
**Description:** Get a Contact record by its ID.
|
||||
|
||||
**Parameters:**
|
||||
- `recordId` (string, required): Record ID of the Contact
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="SALESFORCE_GET_RECORD_BY_ID_LEAD">
|
||||
**Description:** Get a Lead record by its ID.
|
||||
|
||||
**Parameters:**
|
||||
- `recordId` (string, required): Record ID of the Lead
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="SALESFORCE_GET_RECORD_BY_ID_OPPORTUNITY">
|
||||
**Description:** Get an Opportunity record by its ID.
|
||||
|
||||
**Parameters:**
|
||||
- `recordId` (string, required): Record ID of the Opportunity
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="SALESFORCE_GET_RECORD_BY_ID_TASK">
|
||||
**Description:** Get a Task record by its ID.
|
||||
|
||||
**Parameters:**
|
||||
- `recordId` (string, required): Record ID of the Task
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="SALESFORCE_GET_RECORD_BY_ID_ACCOUNT">
|
||||
**Description:** Get an Account record by its ID.
|
||||
|
||||
**Parameters:**
|
||||
- `recordId` (string, required): Record ID of the Account
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="SALESFORCE_GET_RECORD_BY_ID_ANY">
|
||||
**Description:** Get a record of any object type by its ID.
|
||||
|
||||
**Parameters:**
|
||||
- `recordType` (string, required): Record Type (e.g., "CustomObject__c")
|
||||
- `recordId` (string, required): Record ID
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
### **Record Search**
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="SALESFORCE_SEARCH_RECORDS_CONTACT">
|
||||
**Description:** Search for Contact records with advanced filtering.
|
||||
|
||||
**Parameters:**
|
||||
- `filterFormula` (object, optional): Advanced filter in disjunctive normal form with field-specific operators
|
||||
- `sortBy` (string, optional): Sort field (e.g., "CreatedDate")
|
||||
- `sortDirection` (string, optional): Sort direction - Options: ASC, DESC
|
||||
- `includeAllFields` (boolean, optional): Include all fields in results
|
||||
- `paginationParameters` (object, optional): Pagination settings with pageCursor
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="SALESFORCE_SEARCH_RECORDS_LEAD">
|
||||
**Description:** Search for Lead records with advanced filtering.
|
||||
|
||||
**Parameters:**
|
||||
- `filterFormula` (object, optional): Advanced filter in disjunctive normal form with field-specific operators
|
||||
- `sortBy` (string, optional): Sort field (e.g., "CreatedDate")
|
||||
- `sortDirection` (string, optional): Sort direction - Options: ASC, DESC
|
||||
- `includeAllFields` (boolean, optional): Include all fields in results
|
||||
- `paginationParameters` (object, optional): Pagination settings with pageCursor
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="SALESFORCE_SEARCH_RECORDS_OPPORTUNITY">
|
||||
**Description:** Search for Opportunity records with advanced filtering.
|
||||
|
||||
**Parameters:**
|
||||
- `filterFormula` (object, optional): Advanced filter in disjunctive normal form with field-specific operators
|
||||
- `sortBy` (string, optional): Sort field (e.g., "CreatedDate")
|
||||
- `sortDirection` (string, optional): Sort direction - Options: ASC, DESC
|
||||
- `includeAllFields` (boolean, optional): Include all fields in results
|
||||
- `paginationParameters` (object, optional): Pagination settings with pageCursor
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="SALESFORCE_SEARCH_RECORDS_TASK">
|
||||
**Description:** Search for Task records with advanced filtering.
|
||||
|
||||
**Parameters:**
|
||||
- `filterFormula` (object, optional): Advanced filter in disjunctive normal form with field-specific operators
|
||||
- `sortBy` (string, optional): Sort field (e.g., "CreatedDate")
|
||||
- `sortDirection` (string, optional): Sort direction - Options: ASC, DESC
|
||||
- `includeAllFields` (boolean, optional): Include all fields in results
|
||||
- `paginationParameters` (object, optional): Pagination settings with pageCursor
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="SALESFORCE_SEARCH_RECORDS_ACCOUNT">
|
||||
**Description:** Search for Account records with advanced filtering.
|
||||
|
||||
**Parameters:**
|
||||
- `filterFormula` (object, optional): Advanced filter in disjunctive normal form with field-specific operators
|
||||
- `sortBy` (string, optional): Sort field (e.g., "CreatedDate")
|
||||
- `sortDirection` (string, optional): Sort direction - Options: ASC, DESC
|
||||
- `includeAllFields` (boolean, optional): Include all fields in results
|
||||
- `paginationParameters` (object, optional): Pagination settings with pageCursor
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="SALESFORCE_SEARCH_RECORDS_ANY">
|
||||
**Description:** Search for records of any object type.
|
||||
|
||||
**Parameters:**
|
||||
- `recordType` (string, required): Record Type to search
|
||||
- `filterFormula` (string, optional): Filter search criteria
|
||||
- `includeAllFields` (boolean, optional): Include all fields in results
|
||||
- `paginationParameters` (object, optional): Pagination settings with pageCursor
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
### **List View Retrieval**
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="SALESFORCE_GET_RECORD_BY_VIEW_ID_CONTACT">
|
||||
**Description:** Get Contact records from a specific List View.
|
||||
|
||||
**Parameters:**
|
||||
- `listViewId` (string, required): List View ID
|
||||
- `paginationParameters` (object, optional): Pagination settings with pageCursor
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="SALESFORCE_GET_RECORD_BY_VIEW_ID_LEAD">
|
||||
**Description:** Get Lead records from a specific List View.
|
||||
|
||||
**Parameters:**
|
||||
- `listViewId` (string, required): List View ID
|
||||
- `paginationParameters` (object, optional): Pagination settings with pageCursor
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="SALESFORCE_GET_RECORD_BY_VIEW_ID_OPPORTUNITY">
|
||||
**Description:** Get Opportunity records from a specific List View.
|
||||
|
||||
**Parameters:**
|
||||
- `listViewId` (string, required): List View ID
|
||||
- `paginationParameters` (object, optional): Pagination settings with pageCursor
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="SALESFORCE_GET_RECORD_BY_VIEW_ID_TASK">
|
||||
**Description:** Get Task records from a specific List View.
|
||||
|
||||
**Parameters:**
|
||||
- `listViewId` (string, required): List View ID
|
||||
- `paginationParameters` (object, optional): Pagination settings with pageCursor
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="SALESFORCE_GET_RECORD_BY_VIEW_ID_ACCOUNT">
|
||||
**Description:** Get Account records from a specific List View.
|
||||
|
||||
**Parameters:**
|
||||
- `listViewId` (string, required): List View ID
|
||||
- `paginationParameters` (object, optional): Pagination settings with pageCursor
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="SALESFORCE_GET_RECORD_BY_VIEW_ID_ANY">
|
||||
**Description:** Get records of any object type from a specific List View.
|
||||
|
||||
**Parameters:**
|
||||
- `recordType` (string, required): Record Type
|
||||
- `listViewId` (string, required): List View ID
|
||||
- `paginationParameters` (object, optional): Pagination settings with pageCursor
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
### **Custom Fields**
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="SALESFORCE_CREATE_CUSTOM_FIELD_CONTACT">
|
||||
**Description:** Deploy custom fields for Contact objects.
|
||||
|
||||
**Parameters:**
|
||||
- `label` (string, required): Field Label for displays and internal reference
|
||||
- `type` (string, required): Field Type - Options: Checkbox, Currency, Date, Email, Number, Percent, Phone, Picklist, MultiselectPicklist, Text, TextArea, LongTextArea, Html, Time, Url
|
||||
- `defaultCheckboxValue` (boolean, optional): Default value for checkbox fields
|
||||
- `length` (string, required): Length for numeric/text fields
|
||||
- `decimalPlace` (string, required): Decimal places for numeric fields
|
||||
- `pickListValues` (string, required): Values for picklist fields (separated by new lines)
|
||||
- `visibleLines` (string, required): Visible lines for multiselect/text area fields
|
||||
- `description` (string, optional): Field description
|
||||
- `helperText` (string, optional): Helper text shown on hover
|
||||
- `defaultFieldValue` (string, optional): Default field value
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="SALESFORCE_CREATE_CUSTOM_FIELD_LEAD">
|
||||
**Description:** Deploy custom fields for Lead objects.
|
||||
|
||||
**Parameters:**
|
||||
- `label` (string, required): Field Label for displays and internal reference
|
||||
- `type` (string, required): Field Type - Options: Checkbox, Currency, Date, Email, Number, Percent, Phone, Picklist, MultiselectPicklist, Text, TextArea, LongTextArea, Html, Time, Url
|
||||
- `defaultCheckboxValue` (boolean, optional): Default value for checkbox fields
|
||||
- `length` (string, required): Length for numeric/text fields
|
||||
- `decimalPlace` (string, required): Decimal places for numeric fields
|
||||
- `pickListValues` (string, required): Values for picklist fields (separated by new lines)
|
||||
- `visibleLines` (string, required): Visible lines for multiselect/text area fields
|
||||
- `description` (string, optional): Field description
|
||||
- `helperText` (string, optional): Helper text shown on hover
|
||||
- `defaultFieldValue` (string, optional): Default field value
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="SALESFORCE_CREATE_CUSTOM_FIELD_OPPORTUNITY">
|
||||
**Description:** Deploy custom fields for Opportunity objects.
|
||||
|
||||
**Parameters:**
|
||||
- `label` (string, required): Field Label for displays and internal reference
|
||||
- `type` (string, required): Field Type - Options: Checkbox, Currency, Date, Email, Number, Percent, Phone, Picklist, MultiselectPicklist, Text, TextArea, LongTextArea, Html, Time, Url
|
||||
- `defaultCheckboxValue` (boolean, optional): Default value for checkbox fields
|
||||
- `length` (string, required): Length for numeric/text fields
|
||||
- `decimalPlace` (string, required): Decimal places for numeric fields
|
||||
- `pickListValues` (string, required): Values for picklist fields (separated by new lines)
|
||||
- `visibleLines` (string, required): Visible lines for multiselect/text area fields
|
||||
- `description` (string, optional): Field description
|
||||
- `helperText` (string, optional): Helper text shown on hover
|
||||
- `defaultFieldValue` (string, optional): Default field value
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="SALESFORCE_CREATE_CUSTOM_FIELD_TASK">
|
||||
**Description:** Deploy custom fields for Task objects.
|
||||
|
||||
**Parameters:**
|
||||
- `label` (string, required): Field Label for displays and internal reference
|
||||
- `type` (string, required): Field Type - Options: Checkbox, Currency, Date, Email, Number, Percent, Phone, Picklist, MultiselectPicklist, Text, TextArea, Time, Url
|
||||
- `defaultCheckboxValue` (boolean, optional): Default value for checkbox fields
|
||||
- `length` (string, required): Length for numeric/text fields
|
||||
- `decimalPlace` (string, required): Decimal places for numeric fields
|
||||
- `pickListValues` (string, required): Values for picklist fields (separated by new lines)
|
||||
- `visibleLines` (string, required): Visible lines for multiselect fields
|
||||
- `description` (string, optional): Field description
|
||||
- `helperText` (string, optional): Helper text shown on hover
|
||||
- `defaultFieldValue` (string, optional): Default field value
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="SALESFORCE_CREATE_CUSTOM_FIELD_ACCOUNT">
|
||||
**Description:** Deploy custom fields for Account objects.
|
||||
|
||||
**Parameters:**
|
||||
- `label` (string, required): Field Label for displays and internal reference
|
||||
- `type` (string, required): Field Type - Options: Checkbox, Currency, Date, Email, Number, Percent, Phone, Picklist, MultiselectPicklist, Text, TextArea, LongTextArea, Html, Time, Url
|
||||
- `defaultCheckboxValue` (boolean, optional): Default value for checkbox fields
|
||||
- `length` (string, required): Length for numeric/text fields
|
||||
- `decimalPlace` (string, required): Decimal places for numeric fields
|
||||
- `pickListValues` (string, required): Values for picklist fields (separated by new lines)
|
||||
- `visibleLines` (string, required): Visible lines for multiselect/text area fields
|
||||
- `description` (string, optional): Field description
|
||||
- `helperText` (string, optional): Helper text shown on hover
|
||||
- `defaultFieldValue` (string, optional): Default field value
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="SALESFORCE_CREATE_CUSTOM_FIELD_ANY">
|
||||
**Description:** Deploy custom fields for any object type.
|
||||
|
||||
**Note:** This is a flexible tool for creating custom fields on custom or unknown object types.
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
### **Advanced Operations**
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="SALESFORCE_WRITE_SOQL_QUERY">
|
||||
**Description:** Execute custom SOQL queries against your Salesforce data.
|
||||
|
||||
**Parameters:**
|
||||
- `query` (string, required): SOQL Query (e.g., "SELECT Id, Name FROM Account WHERE Name = 'Example'")
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="SALESFORCE_CREATE_CUSTOM_OBJECT">
|
||||
**Description:** Deploy a new custom object in Salesforce.
|
||||
|
||||
**Parameters:**
|
||||
- `label` (string, required): Object Label for tabs, page layouts, and reports
|
||||
- `pluralLabel` (string, required): Plural Label (e.g., "Accounts")
|
||||
- `description` (string, optional): A description of the Custom Object
|
||||
- `recordName` (string, required): Record Name that appears in layouts and searches (e.g., "Account Name")
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="SALESFORCE_DESCRIBE_ACTION_SCHEMA">
|
||||
**Description:** Get the expected schema for operations on specific object types.
|
||||
|
||||
**Parameters:**
|
||||
- `recordType` (string, required): Record Type to describe
|
||||
- `operation` (string, required): Operation Type (e.g., "CREATE_RECORD" or "UPDATE_RECORD")
|
||||
|
||||
**Note:** Use this function first when working with custom objects to understand their schema before performing operations.
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
## Usage Examples
|
||||
|
||||
### Basic Salesforce Agent Setup
|
||||
|
||||
```python
|
||||
from crewai import Agent, Task, Crew
|
||||
from crewai_tools import CrewaiEnterpriseTools
|
||||
|
||||
# Get enterprise tools (Salesforce tools will be included)
|
||||
enterprise_tools = CrewaiEnterpriseTools(
|
||||
enterprise_token="your_enterprise_token"
|
||||
)
|
||||
|
||||
# Create an agent with Salesforce capabilities
|
||||
salesforce_agent = Agent(
|
||||
role="CRM Manager",
|
||||
goal="Manage customer relationships and sales processes efficiently",
|
||||
backstory="An AI assistant specialized in CRM operations and sales automation.",
|
||||
tools=[enterprise_tools]
|
||||
)
|
||||
|
||||
# Task to create a new lead
|
||||
create_lead_task = Task(
|
||||
description="Create a new lead for John Doe from Example Corp with email john.doe@example.com",
|
||||
agent=salesforce_agent,
|
||||
expected_output="Lead created successfully with lead ID"
|
||||
)
|
||||
|
||||
# Run the task
|
||||
crew = Crew(
|
||||
agents=[salesforce_agent],
|
||||
tasks=[create_lead_task]
|
||||
)
|
||||
|
||||
crew.kickoff()
|
||||
```
|
||||
|
||||
### Filtering Specific Salesforce Tools
|
||||
|
||||
```python
|
||||
from crewai_tools import CrewaiEnterpriseTools
|
||||
|
||||
# Get only specific Salesforce tools
|
||||
enterprise_tools = CrewaiEnterpriseTools(
|
||||
enterprise_token="your_enterprise_token",
|
||||
actions_list=["salesforce_create_record_lead", "salesforce_update_record_opportunity", "salesforce_search_records_contact"]
|
||||
)
|
||||
|
||||
sales_manager = Agent(
|
||||
role="Sales Manager",
|
||||
goal="Manage leads and opportunities in the sales pipeline",
|
||||
backstory="An experienced sales manager who handles lead qualification and opportunity management.",
|
||||
tools=enterprise_tools
|
||||
)
|
||||
|
||||
# Task to manage sales pipeline
|
||||
pipeline_task = Task(
|
||||
description="Create a qualified lead and convert it to an opportunity with $50,000 value",
|
||||
agent=sales_manager,
|
||||
expected_output="Lead created and opportunity established successfully"
|
||||
)
|
||||
|
||||
crew = Crew(
|
||||
agents=[sales_manager],
|
||||
tasks=[pipeline_task]
|
||||
)
|
||||
|
||||
crew.kickoff()
|
||||
```
|
||||
|
||||
### Contact and Account Management
|
||||
|
||||
```python
|
||||
from crewai import Agent, Task, Crew
|
||||
from crewai_tools import CrewaiEnterpriseTools
|
||||
|
||||
enterprise_tools = CrewaiEnterpriseTools(
|
||||
enterprise_token="your_enterprise_token"
|
||||
)
|
||||
|
||||
account_manager = Agent(
|
||||
role="Account Manager",
|
||||
goal="Manage customer accounts and maintain strong relationships",
|
||||
backstory="An AI assistant that specializes in account management and customer relationship building.",
|
||||
tools=[enterprise_tools]
|
||||
)
|
||||
|
||||
# Task to manage customer accounts
|
||||
account_task = Task(
|
||||
description="""
|
||||
1. Create a new account for TechCorp Inc.
|
||||
2. Add John Doe as the primary contact for this account
|
||||
3. Create a follow-up task for next week to check on their project status
|
||||
""",
|
||||
agent=account_manager,
|
||||
expected_output="Account, contact, and follow-up task created successfully"
|
||||
)
|
||||
|
||||
crew = Crew(
|
||||
agents=[account_manager],
|
||||
tasks=[account_task]
|
||||
)
|
||||
|
||||
crew.kickoff()
|
||||
```
|
||||
|
||||
### Advanced SOQL Queries and Reporting
|
||||
|
||||
```python
|
||||
from crewai import Agent, Task, Crew
|
||||
from crewai_tools import CrewaiEnterpriseTools
|
||||
|
||||
enterprise_tools = CrewaiEnterpriseTools(
|
||||
enterprise_token="your_enterprise_token"
|
||||
)
|
||||
|
||||
data_analyst = Agent(
|
||||
role="Sales Data Analyst",
|
||||
goal="Generate insights from Salesforce data using SOQL queries",
|
||||
backstory="An analytical AI that excels at extracting meaningful insights from CRM data.",
|
||||
tools=[enterprise_tools]
|
||||
)
|
||||
|
||||
# Complex task involving SOQL queries and data analysis
|
||||
analysis_task = Task(
|
||||
description="""
|
||||
1. Execute a SOQL query to find all opportunities closing this quarter
|
||||
2. Search for contacts at companies with opportunities over $100K
|
||||
3. Create a summary report of the sales pipeline status
|
||||
4. Update high-value opportunities with next steps
|
||||
""",
|
||||
agent=data_analyst,
|
||||
expected_output="Comprehensive sales pipeline analysis with actionable insights"
|
||||
)
|
||||
|
||||
crew = Crew(
|
||||
agents=[data_analyst],
|
||||
tasks=[analysis_task]
|
||||
)
|
||||
|
||||
crew.kickoff()
|
||||
```
|
||||
|
||||
This comprehensive documentation covers all the Salesforce tools organized by functionality, making it easy for users to find the specific operations they need for their CRM automation tasks.
|
||||
|
||||
### Getting Help
|
||||
|
||||
<Card title="Need Help?" icon="headset" href="mailto:support@crewai.com">
|
||||
Contact our support team for assistance with Salesforce integration setup or troubleshooting.
|
||||
</Card>
|
||||
382
docs/en/enterprise/integrations/shopify.mdx
Normal file
382
docs/en/enterprise/integrations/shopify.mdx
Normal file
@@ -0,0 +1,382 @@
|
||||
---
|
||||
title: Shopify Integration
|
||||
description: "E-commerce and online store management with Shopify integration for CrewAI."
|
||||
icon: "shopify"
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
Enable your agents to manage e-commerce operations through Shopify. Handle customers, orders, products, inventory, and store analytics to streamline your online business with AI-powered automation.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
Before using the Shopify integration, ensure you have:
|
||||
|
||||
- A [CrewAI Enterprise](https://app.crewai.com) account with an active subscription
|
||||
- A Shopify store with appropriate admin permissions
|
||||
- Connected your Shopify store through the [Integrations page](https://app.crewai.com/integrations)
|
||||
|
||||
## Available Tools
|
||||
|
||||
### **Customer Management**
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="SHOPIFY_GET_CUSTOMERS">
|
||||
**Description:** Retrieve a list of customers from your Shopify store.
|
||||
|
||||
**Parameters:**
|
||||
- `customerIds` (string, optional): Comma-separated list of customer IDs to filter by (example: "207119551, 207119552")
|
||||
- `createdAtMin` (string, optional): Only return customers created after this date (ISO or Unix timestamp)
|
||||
- `createdAtMax` (string, optional): Only return customers created before this date (ISO or Unix timestamp)
|
||||
- `updatedAtMin` (string, optional): Only return customers updated after this date (ISO or Unix timestamp)
|
||||
- `updatedAtMax` (string, optional): Only return customers updated before this date (ISO or Unix timestamp)
|
||||
- `limit` (string, optional): Maximum number of customers to return (defaults to 250)
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="SHOPIFY_SEARCH_CUSTOMERS">
|
||||
**Description:** Search for customers using advanced filtering criteria.
|
||||
|
||||
**Parameters:**
|
||||
- `filterFormula` (object, optional): Advanced filter in disjunctive normal form with field-specific operators
|
||||
- `limit` (string, optional): Maximum number of customers to return (defaults to 250)
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="SHOPIFY_CREATE_CUSTOMER">
|
||||
**Description:** Create a new customer in your Shopify store.
|
||||
|
||||
**Parameters:**
|
||||
- `firstName` (string, required): Customer's first name
|
||||
- `lastName` (string, required): Customer's last name
|
||||
- `email` (string, required): Customer's email address
|
||||
- `company` (string, optional): Company name
|
||||
- `streetAddressLine1` (string, optional): Street address
|
||||
- `streetAddressLine2` (string, optional): Street address line 2
|
||||
- `city` (string, optional): City
|
||||
- `state` (string, optional): State or province code
|
||||
- `country` (string, optional): Country
|
||||
- `zipCode` (string, optional): Zip code
|
||||
- `phone` (string, optional): Phone number
|
||||
- `tags` (string, optional): Tags as array or comma-separated list
|
||||
- `note` (string, optional): Customer note
|
||||
- `sendEmailInvite` (boolean, optional): Whether to send email invitation
|
||||
- `metafields` (object, optional): Additional metafields in JSON format
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="SHOPIFY_UPDATE_CUSTOMER">
|
||||
**Description:** Update an existing customer in your Shopify store.
|
||||
|
||||
**Parameters:**
|
||||
- `customerId` (string, required): The ID of the customer to update
|
||||
- `firstName` (string, optional): Customer's first name
|
||||
- `lastName` (string, optional): Customer's last name
|
||||
- `email` (string, optional): Customer's email address
|
||||
- `company` (string, optional): Company name
|
||||
- `streetAddressLine1` (string, optional): Street address
|
||||
- `streetAddressLine2` (string, optional): Street address line 2
|
||||
- `city` (string, optional): City
|
||||
- `state` (string, optional): State or province code
|
||||
- `country` (string, optional): Country
|
||||
- `zipCode` (string, optional): Zip code
|
||||
- `phone` (string, optional): Phone number
|
||||
- `tags` (string, optional): Tags as array or comma-separated list
|
||||
- `note` (string, optional): Customer note
|
||||
- `sendEmailInvite` (boolean, optional): Whether to send email invitation
|
||||
- `metafields` (object, optional): Additional metafields in JSON format
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
### **Order Management**
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="SHOPIFY_GET_ORDERS">
|
||||
**Description:** Retrieve a list of orders from your Shopify store.
|
||||
|
||||
**Parameters:**
|
||||
- `orderIds` (string, optional): Comma-separated list of order IDs to filter by (example: "450789469, 450789470")
|
||||
- `createdAtMin` (string, optional): Only return orders created after this date (ISO or Unix timestamp)
|
||||
- `createdAtMax` (string, optional): Only return orders created before this date (ISO or Unix timestamp)
|
||||
- `updatedAtMin` (string, optional): Only return orders updated after this date (ISO or Unix timestamp)
|
||||
- `updatedAtMax` (string, optional): Only return orders updated before this date (ISO or Unix timestamp)
|
||||
- `limit` (string, optional): Maximum number of orders to return (defaults to 250)
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="SHOPIFY_CREATE_ORDER">
|
||||
**Description:** Create a new order in your Shopify store.
|
||||
|
||||
**Parameters:**
|
||||
- `email` (string, required): Customer email address
|
||||
- `lineItems` (object, required): Order line items in JSON format with title, price, quantity, and variant_id
|
||||
- `sendReceipt` (boolean, optional): Whether to send order receipt
|
||||
- `fulfillmentStatus` (string, optional): Fulfillment status - Options: fulfilled, null, partial, restocked
|
||||
- `financialStatus` (string, optional): Financial status - Options: pending, authorized, partially_paid, paid, partially_refunded, refunded, voided
|
||||
- `inventoryBehaviour` (string, optional): Inventory behavior - Options: bypass, decrement_ignoring_policy, decrement_obeying_policy
|
||||
- `note` (string, optional): Order note
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="SHOPIFY_UPDATE_ORDER">
|
||||
**Description:** Update an existing order in your Shopify store.
|
||||
|
||||
**Parameters:**
|
||||
- `orderId` (string, required): The ID of the order to update
|
||||
- `email` (string, optional): Customer email address
|
||||
- `lineItems` (object, optional): Updated order line items in JSON format
|
||||
- `sendReceipt` (boolean, optional): Whether to send order receipt
|
||||
- `fulfillmentStatus` (string, optional): Fulfillment status - Options: fulfilled, null, partial, restocked
|
||||
- `financialStatus` (string, optional): Financial status - Options: pending, authorized, partially_paid, paid, partially_refunded, refunded, voided
|
||||
- `inventoryBehaviour` (string, optional): Inventory behavior - Options: bypass, decrement_ignoring_policy, decrement_obeying_policy
|
||||
- `note` (string, optional): Order note
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="SHOPIFY_GET_ABANDONED_CARTS">
|
||||
**Description:** Retrieve abandoned carts from your Shopify store.
|
||||
|
||||
**Parameters:**
|
||||
- `createdWithInLast` (string, optional): Restrict results to checkouts created within specified time
|
||||
- `createdAfterId` (string, optional): Restrict results to after the specified ID
|
||||
- `status` (string, optional): Show checkouts with given status - Options: open, closed (defaults to open)
|
||||
- `createdAtMin` (string, optional): Only return carts created after this date (ISO or Unix timestamp)
|
||||
- `createdAtMax` (string, optional): Only return carts created before this date (ISO or Unix timestamp)
|
||||
- `limit` (string, optional): Maximum number of carts to return (defaults to 250)
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
### **Product Management (REST API)**
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="SHOPIFY_GET_PRODUCTS">
|
||||
**Description:** Retrieve a list of products from your Shopify store using REST API.
|
||||
|
||||
**Parameters:**
|
||||
- `productIds` (string, optional): Comma-separated list of product IDs to filter by (example: "632910392, 632910393")
|
||||
- `title` (string, optional): Filter by product title
|
||||
- `productType` (string, optional): Filter by product type
|
||||
- `vendor` (string, optional): Filter by vendor
|
||||
- `status` (string, optional): Filter by status - Options: active, archived, draft
|
||||
- `createdAtMin` (string, optional): Only return products created after this date (ISO or Unix timestamp)
|
||||
- `createdAtMax` (string, optional): Only return products created before this date (ISO or Unix timestamp)
|
||||
- `updatedAtMin` (string, optional): Only return products updated after this date (ISO or Unix timestamp)
|
||||
- `updatedAtMax` (string, optional): Only return products updated before this date (ISO or Unix timestamp)
|
||||
- `limit` (string, optional): Maximum number of products to return (defaults to 250)
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="SHOPIFY_CREATE_PRODUCT">
|
||||
**Description:** Create a new product in your Shopify store using REST API.
|
||||
|
||||
**Parameters:**
|
||||
- `title` (string, required): Product title
|
||||
- `productType` (string, required): Product type/category
|
||||
- `vendor` (string, required): Product vendor
|
||||
- `productDescription` (string, optional): Product description (accepts plain text or HTML)
|
||||
- `tags` (string, optional): Product tags as array or comma-separated list
|
||||
- `price` (string, optional): Product price
|
||||
- `inventoryPolicy` (string, optional): Inventory policy - Options: deny, continue
|
||||
- `imageUrl` (string, optional): Product image URL
|
||||
- `isPublished` (boolean, optional): Whether product is published
|
||||
- `publishToPointToSale` (boolean, optional): Whether to publish to point of sale
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="SHOPIFY_UPDATE_PRODUCT">
|
||||
**Description:** Update an existing product in your Shopify store using REST API.
|
||||
|
||||
**Parameters:**
|
||||
- `productId` (string, required): The ID of the product to update
|
||||
- `title` (string, optional): Product title
|
||||
- `productType` (string, optional): Product type/category
|
||||
- `vendor` (string, optional): Product vendor
|
||||
- `productDescription` (string, optional): Product description (accepts plain text or HTML)
|
||||
- `tags` (string, optional): Product tags as array or comma-separated list
|
||||
- `price` (string, optional): Product price
|
||||
- `inventoryPolicy` (string, optional): Inventory policy - Options: deny, continue
|
||||
- `imageUrl` (string, optional): Product image URL
|
||||
- `isPublished` (boolean, optional): Whether product is published
|
||||
- `publishToPointToSale` (boolean, optional): Whether to publish to point of sale
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
### **Product Management (GraphQL)**
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="SHOPIFY_GET_PRODUCTS_GRAPHQL">
|
||||
**Description:** Retrieve products using advanced GraphQL filtering capabilities.
|
||||
|
||||
**Parameters:**
|
||||
- `productFilterFormula` (object, optional): Advanced filter in disjunctive normal form with support for fields like id, title, vendor, status, handle, tag, created_at, updated_at, published_at
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="SHOPIFY_CREATE_PRODUCT_GRAPHQL">
|
||||
**Description:** Create a new product using GraphQL API with enhanced media support.
|
||||
|
||||
**Parameters:**
|
||||
- `title` (string, required): Product title
|
||||
- `productType` (string, required): Product type/category
|
||||
- `vendor` (string, required): Product vendor
|
||||
- `productDescription` (string, optional): Product description (accepts plain text or HTML)
|
||||
- `tags` (string, optional): Product tags as array or comma-separated list
|
||||
- `media` (object, optional): Media objects with alt text, content type, and source URL
|
||||
- `additionalFields` (object, optional): Additional product fields like status, requiresSellingPlan, giftCard
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="SHOPIFY_UPDATE_PRODUCT_GRAPHQL">
|
||||
**Description:** Update an existing product using GraphQL API with enhanced media support.
|
||||
|
||||
**Parameters:**
|
||||
- `productId` (string, required): The GraphQL ID of the product to update (e.g., "gid://shopify/Product/913144112")
|
||||
- `title` (string, optional): Product title
|
||||
- `productType` (string, optional): Product type/category
|
||||
- `vendor` (string, optional): Product vendor
|
||||
- `productDescription` (string, optional): Product description (accepts plain text or HTML)
|
||||
- `tags` (string, optional): Product tags as array or comma-separated list
|
||||
- `media` (object, optional): Updated media objects with alt text, content type, and source URL
|
||||
- `additionalFields` (object, optional): Additional product fields like status, requiresSellingPlan, giftCard
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
## Usage Examples
|
||||
|
||||
### Basic Shopify Agent Setup
|
||||
|
||||
```python
|
||||
from crewai import Agent, Task, Crew
|
||||
from crewai_tools import CrewaiEnterpriseTools
|
||||
|
||||
# Get enterprise tools (Shopify tools will be included)
|
||||
enterprise_tools = CrewaiEnterpriseTools(
|
||||
enterprise_token="your_enterprise_token"
|
||||
)
|
||||
|
||||
# Create an agent with Shopify capabilities
|
||||
shopify_agent = Agent(
|
||||
role="E-commerce Manager",
|
||||
goal="Manage online store operations and customer relationships efficiently",
|
||||
backstory="An AI assistant specialized in e-commerce operations and online store management.",
|
||||
tools=[enterprise_tools]
|
||||
)
|
||||
|
||||
# Task to create a new customer
|
||||
create_customer_task = Task(
|
||||
description="Create a new VIP customer Jane Smith with email jane.smith@example.com and phone +1-555-0123",
|
||||
agent=shopify_agent,
|
||||
expected_output="Customer created successfully with customer ID"
|
||||
)
|
||||
|
||||
# Run the task
|
||||
crew = Crew(
|
||||
agents=[shopify_agent],
|
||||
tasks=[create_customer_task]
|
||||
)
|
||||
|
||||
crew.kickoff()
|
||||
```
|
||||
|
||||
### Filtering Specific Shopify Tools
|
||||
|
||||
```python
|
||||
from crewai_tools import CrewaiEnterpriseTools
|
||||
|
||||
# Get only specific Shopify tools
|
||||
enterprise_tools = CrewaiEnterpriseTools(
|
||||
enterprise_token="your_enterprise_token",
|
||||
actions_list=["shopify_create_customer", "shopify_create_order", "shopify_get_products"]
|
||||
)
|
||||
|
||||
store_manager = Agent(
|
||||
role="Store Manager",
|
||||
goal="Manage customer orders and product catalog",
|
||||
backstory="An experienced store manager who handles customer relationships and inventory management.",
|
||||
tools=enterprise_tools
|
||||
)
|
||||
|
||||
# Task to manage store operations
|
||||
store_task = Task(
|
||||
description="Create a new customer and process their order for 2 Premium Coffee Mugs",
|
||||
agent=store_manager,
|
||||
expected_output="Customer created and order processed successfully"
|
||||
)
|
||||
|
||||
crew = Crew(
|
||||
agents=[store_manager],
|
||||
tasks=[store_task]
|
||||
)
|
||||
|
||||
crew.kickoff()
|
||||
```
|
||||
|
||||
### Product Management with GraphQL
|
||||
|
||||
```python
|
||||
from crewai import Agent, Task, Crew
|
||||
from crewai_tools import CrewaiEnterpriseTools
|
||||
|
||||
enterprise_tools = CrewaiEnterpriseTools(
|
||||
enterprise_token="your_enterprise_token"
|
||||
)
|
||||
|
||||
product_manager = Agent(
|
||||
role="Product Manager",
|
||||
goal="Manage product catalog and inventory with advanced GraphQL capabilities",
|
||||
backstory="An AI assistant that specializes in product management and catalog optimization.",
|
||||
tools=[enterprise_tools]
|
||||
)
|
||||
|
||||
# Task to manage product catalog
|
||||
catalog_task = Task(
|
||||
description="""
|
||||
1. Create a new product "Premium Coffee Mug" from Coffee Co vendor
|
||||
2. Add high-quality product images and descriptions
|
||||
3. Search for similar products from the same vendor
|
||||
4. Update product tags and pricing strategy
|
||||
""",
|
||||
agent=product_manager,
|
||||
expected_output="Product created and catalog optimized successfully"
|
||||
)
|
||||
|
||||
crew = Crew(
|
||||
agents=[product_manager],
|
||||
tasks=[catalog_task]
|
||||
)
|
||||
|
||||
crew.kickoff()
|
||||
```
|
||||
|
||||
### Order and Customer Analytics
|
||||
|
||||
```python
|
||||
from crewai import Agent, Task, Crew
|
||||
from crewai_tools import CrewaiEnterpriseTools
|
||||
|
||||
enterprise_tools = CrewaiEnterpriseTools(
|
||||
enterprise_token="your_enterprise_token"
|
||||
)
|
||||
|
||||
analytics_agent = Agent(
|
||||
role="E-commerce Analyst",
|
||||
goal="Analyze customer behavior and order patterns to optimize store performance",
|
||||
backstory="An analytical AI that excels at extracting insights from e-commerce data.",
|
||||
tools=[enterprise_tools]
|
||||
)
|
||||
|
||||
# Complex task involving multiple operations
|
||||
analytics_task = Task(
|
||||
description="""
|
||||
1. Retrieve recent customer data and order history
|
||||
2. Identify abandoned carts from the last 7 days
|
||||
3. Analyze product performance and inventory levels
|
||||
4. Generate recommendations for customer retention
|
||||
""",
|
||||
agent=analytics_agent,
|
||||
expected_output="Comprehensive e-commerce analytics report with actionable insights"
|
||||
)
|
||||
|
||||
crew = Crew(
|
||||
agents=[analytics_agent],
|
||||
tasks=[analytics_task]
|
||||
)
|
||||
|
||||
crew.kickoff()
|
||||
```
|
||||
|
||||
### Getting Help
|
||||
|
||||
<Card title="Need Help?" icon="headset" href="mailto:support@crewai.com">
|
||||
Contact our support team for assistance with Shopify integration setup or troubleshooting.
|
||||
</Card>
|
||||
293
docs/en/enterprise/integrations/slack.mdx
Normal file
293
docs/en/enterprise/integrations/slack.mdx
Normal file
@@ -0,0 +1,293 @@
|
||||
---
|
||||
title: Slack Integration
|
||||
description: "Team communication and collaboration with Slack integration for CrewAI."
|
||||
icon: "slack"
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
Enable your agents to manage team communication through Slack. Send messages, search conversations, manage channels, and coordinate team activities to streamline your collaboration workflows with AI-powered automation.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
Before using the Slack integration, ensure you have:
|
||||
|
||||
- A [CrewAI Enterprise](https://app.crewai.com) account with an active subscription
|
||||
- A Slack workspace with appropriate permissions
|
||||
- Connected your Slack workspace through the [Integrations page](https://app.crewai.com/integrations)
|
||||
|
||||
## Available Tools
|
||||
|
||||
### **User Management**
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="SLACK_LIST_MEMBERS">
|
||||
**Description:** List all members in a Slack channel.
|
||||
|
||||
**Parameters:**
|
||||
- No parameters required - retrieves all channel members
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="SLACK_GET_USER_BY_EMAIL">
|
||||
**Description:** Find a user in your Slack workspace by their email address.
|
||||
|
||||
**Parameters:**
|
||||
- `email` (string, required): The email address of a user in the workspace
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="SLACK_GET_USERS_BY_NAME">
|
||||
**Description:** Search for users by their name or display name.
|
||||
|
||||
**Parameters:**
|
||||
- `name` (string, required): User's real name to search for
|
||||
- `displayName` (string, required): User's display name to search for
|
||||
- `paginationParameters` (object, optional): Pagination settings
|
||||
- `pageCursor` (string, optional): Page cursor for pagination
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
### **Channel Management**
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="SLACK_LIST_CHANNELS">
|
||||
**Description:** List all channels in your Slack workspace.
|
||||
|
||||
**Parameters:**
|
||||
- No parameters required - retrieves all accessible channels
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
### **Messaging**
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="SLACK_SEND_MESSAGE">
|
||||
**Description:** Send a message to a Slack channel.
|
||||
|
||||
**Parameters:**
|
||||
- `channel` (string, required): Channel name or ID - Use Connect Portal Workflow Settings to allow users to select a channel, or enter a channel name to create a new channel
|
||||
- `message` (string, required): The message text to send
|
||||
- `botName` (string, required): The name of the bot that sends this message
|
||||
- `botIcon` (string, required): Bot icon - Can be either an image URL or an emoji (e.g., ":dog:")
|
||||
- `blocks` (object, optional): Slack Block Kit JSON for rich message formatting with attachments and interactive elements
|
||||
- `authenticatedUser` (boolean, optional): If true, message appears to come from your authenticated Slack user instead of the application (defaults to false)
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="SLACK_SEND_DIRECT_MESSAGE">
|
||||
**Description:** Send a direct message to a specific user in Slack.
|
||||
|
||||
**Parameters:**
|
||||
- `memberId` (string, required): Recipient user ID - Use Connect Portal Workflow Settings to allow users to select a workspace member
|
||||
- `message` (string, required): The message text to send
|
||||
- `botName` (string, required): The name of the bot that sends this message
|
||||
- `botIcon` (string, required): Bot icon - Can be either an image URL or an emoji (e.g., ":dog:")
|
||||
- `blocks` (object, optional): Slack Block Kit JSON for rich message formatting with attachments and interactive elements
|
||||
- `authenticatedUser` (boolean, optional): If true, message appears to come from your authenticated Slack user instead of the application (defaults to false)
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
### **Search & Discovery**
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="SLACK_SEARCH_MESSAGES">
|
||||
**Description:** Search for messages across your Slack workspace.
|
||||
|
||||
**Parameters:**
|
||||
- `query` (string, required): Search query using Slack search syntax to find messages that match specified criteria
|
||||
|
||||
**Search Query Examples:**
|
||||
- `"project update"` - Search for messages containing "project update"
|
||||
- `from:@john in:#general` - Search for messages from John in the #general channel
|
||||
- `has:link after:2023-01-01` - Search for messages with links after January 1, 2023
|
||||
- `in:@channel before:yesterday` - Search for messages in a specific channel before yesterday
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
## Block Kit Integration
|
||||
|
||||
Slack's Block Kit allows you to create rich, interactive messages. Here are some examples of how to use the `blocks` parameter:
|
||||
|
||||
### Simple Text with Attachment
|
||||
```json
|
||||
[
|
||||
{
|
||||
"text": "I am a test message",
|
||||
"attachments": [
|
||||
{
|
||||
"text": "And here's an attachment!"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
### Rich Formatting with Sections
|
||||
```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."
|
||||
}
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
## Usage Examples
|
||||
|
||||
### Basic Slack Agent Setup
|
||||
|
||||
```python
|
||||
from crewai import Agent, Task, Crew
|
||||
from crewai_tools import CrewaiEnterpriseTools
|
||||
|
||||
# Get enterprise tools (Slack tools will be included)
|
||||
enterprise_tools = CrewaiEnterpriseTools(
|
||||
enterprise_token="your_enterprise_token"
|
||||
)
|
||||
|
||||
# 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.",
|
||||
tools=[enterprise_tools]
|
||||
)
|
||||
|
||||
# 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()
|
||||
```
|
||||
|
||||
### Filtering Specific Slack Tools
|
||||
|
||||
```python
|
||||
from crewai_tools import CrewaiEnterpriseTools
|
||||
|
||||
# Get only specific Slack tools
|
||||
enterprise_tools = CrewaiEnterpriseTools(
|
||||
enterprise_token="your_enterprise_token",
|
||||
actions_list=["slack_send_message", "slack_send_direct_message", "slack_search_messages"]
|
||||
)
|
||||
|
||||
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.",
|
||||
tools=enterprise_tools
|
||||
)
|
||||
|
||||
# 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()
|
||||
```
|
||||
|
||||
### Advanced Messaging with Block Kit
|
||||
|
||||
```python
|
||||
from crewai import Agent, Task, Crew
|
||||
from crewai_tools import CrewaiEnterpriseTools
|
||||
|
||||
enterprise_tools = CrewaiEnterpriseTools(
|
||||
enterprise_token="your_enterprise_token"
|
||||
)
|
||||
|
||||
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.",
|
||||
tools=[enterprise_tools]
|
||||
)
|
||||
|
||||
# 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()
|
||||
```
|
||||
|
||||
### Message Search and Analytics
|
||||
|
||||
```python
|
||||
from crewai import Agent, Task, Crew
|
||||
from crewai_tools import CrewaiEnterpriseTools
|
||||
|
||||
enterprise_tools = CrewaiEnterpriseTools(
|
||||
enterprise_token="your_enterprise_token"
|
||||
)
|
||||
|
||||
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.",
|
||||
tools=[enterprise_tools]
|
||||
)
|
||||
|
||||
# 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()
|
||||
```
|
||||
|
||||
## Contact Support
|
||||
|
||||
<Card title="Need Help?" icon="headset" href="mailto:support@crewai.com">
|
||||
Contact our support team for assistance with Slack integration setup or troubleshooting.
|
||||
</Card>
|
||||
305
docs/en/enterprise/integrations/stripe.mdx
Normal file
305
docs/en/enterprise/integrations/stripe.mdx
Normal file
@@ -0,0 +1,305 @@
|
||||
---
|
||||
title: Stripe Integration
|
||||
description: "Payment processing and subscription management with Stripe integration for CrewAI."
|
||||
icon: "stripe"
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
Enable your agents to manage payments, subscriptions, and customer billing through Stripe. Handle customer data, process subscriptions, manage products, and track financial transactions to streamline your payment workflows with AI-powered automation.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
Before using the Stripe integration, ensure you have:
|
||||
|
||||
- A [CrewAI Enterprise](https://app.crewai.com) account with an active subscription
|
||||
- A Stripe account with appropriate API permissions
|
||||
- Connected your Stripe account through the [Integrations page](https://app.crewai.com/integrations)
|
||||
|
||||
## Available Tools
|
||||
|
||||
### **Customer Management**
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="STRIPE_CREATE_CUSTOMER">
|
||||
**Description:** Create a new customer in your Stripe account.
|
||||
|
||||
**Parameters:**
|
||||
- `emailCreateCustomer` (string, required): Customer's email address
|
||||
- `name` (string, optional): Customer's full name
|
||||
- `description` (string, optional): Customer description for internal reference
|
||||
- `metadataCreateCustomer` (object, optional): Additional metadata as key-value pairs (e.g., `{"field1": 1, "field2": 2}`)
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="STRIPE_GET_CUSTOMER_BY_ID">
|
||||
**Description:** Retrieve a specific customer by their Stripe customer ID.
|
||||
|
||||
**Parameters:**
|
||||
- `idGetCustomer` (string, required): The Stripe customer ID to retrieve
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="STRIPE_GET_CUSTOMERS">
|
||||
**Description:** Retrieve a list of customers with optional filtering.
|
||||
|
||||
**Parameters:**
|
||||
- `emailGetCustomers` (string, optional): Filter customers by email address
|
||||
- `createdAfter` (string, optional): Filter customers created after this date (Unix timestamp)
|
||||
- `createdBefore` (string, optional): Filter customers created before this date (Unix timestamp)
|
||||
- `limitGetCustomers` (string, optional): Maximum number of customers to return (defaults to 10)
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="STRIPE_UPDATE_CUSTOMER">
|
||||
**Description:** Update an existing customer's information.
|
||||
|
||||
**Parameters:**
|
||||
- `customerId` (string, required): The ID of the customer to update
|
||||
- `emailUpdateCustomer` (string, optional): Updated email address
|
||||
- `name` (string, optional): Updated customer name
|
||||
- `description` (string, optional): Updated customer description
|
||||
- `metadataUpdateCustomer` (object, optional): Updated metadata as key-value pairs
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
### **Subscription Management**
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="STRIPE_CREATE_SUBSCRIPTION">
|
||||
**Description:** Create a new subscription for a customer.
|
||||
|
||||
**Parameters:**
|
||||
- `customerIdCreateSubscription` (string, required): The customer ID for whom the subscription will be created
|
||||
- `plan` (string, required): The plan ID for the subscription - Use Connect Portal Workflow Settings to allow users to select a plan
|
||||
- `metadataCreateSubscription` (object, optional): Additional metadata for the subscription
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="STRIPE_GET_SUBSCRIPTIONS">
|
||||
**Description:** Retrieve subscriptions with optional filtering.
|
||||
|
||||
**Parameters:**
|
||||
- `customerIdGetSubscriptions` (string, optional): Filter subscriptions by customer ID
|
||||
- `subscriptionStatus` (string, optional): Filter by subscription status - Options: incomplete, incomplete_expired, trialing, active, past_due, canceled, unpaid
|
||||
- `limitGetSubscriptions` (string, optional): Maximum number of subscriptions to return (defaults to 10)
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
### **Product Management**
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="STRIPE_CREATE_PRODUCT">
|
||||
**Description:** Create a new product in your Stripe catalog.
|
||||
|
||||
**Parameters:**
|
||||
- `productName` (string, required): The product name
|
||||
- `description` (string, optional): Product description
|
||||
- `metadataProduct` (object, optional): Additional product metadata as key-value pairs
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="STRIPE_GET_PRODUCT_BY_ID">
|
||||
**Description:** Retrieve a specific product by its Stripe product ID.
|
||||
|
||||
**Parameters:**
|
||||
- `productId` (string, required): The Stripe product ID to retrieve
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="STRIPE_GET_PRODUCTS">
|
||||
**Description:** Retrieve a list of products with optional filtering.
|
||||
|
||||
**Parameters:**
|
||||
- `createdAfter` (string, optional): Filter products created after this date (Unix timestamp)
|
||||
- `createdBefore` (string, optional): Filter products created before this date (Unix timestamp)
|
||||
- `limitGetProducts` (string, optional): Maximum number of products to return (defaults to 10)
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
### **Financial Operations**
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="STRIPE_GET_BALANCE_TRANSACTIONS">
|
||||
**Description:** Retrieve balance transactions from your Stripe account.
|
||||
|
||||
**Parameters:**
|
||||
- `balanceTransactionType` (string, optional): Filter by transaction type - Options: charge, refund, payment, payment_refund
|
||||
- `paginationParameters` (object, optional): Pagination settings
|
||||
- `pageCursor` (string, optional): Page cursor for pagination
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="STRIPE_GET_PLANS">
|
||||
**Description:** Retrieve subscription plans from your Stripe account.
|
||||
|
||||
**Parameters:**
|
||||
- `isPlanActive` (boolean, optional): Filter by plan status - true for active plans, false for inactive plans
|
||||
- `paginationParameters` (object, optional): Pagination settings
|
||||
- `pageCursor` (string, optional): Page cursor for pagination
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
## Usage Examples
|
||||
|
||||
### Basic Stripe Agent Setup
|
||||
|
||||
```python
|
||||
from crewai import Agent, Task, Crew
|
||||
from crewai_tools import CrewaiEnterpriseTools
|
||||
|
||||
# Get enterprise tools (Stripe tools will be included)
|
||||
enterprise_tools = CrewaiEnterpriseTools(
|
||||
enterprise_token="your_enterprise_token"
|
||||
)
|
||||
|
||||
# Create an agent with Stripe capabilities
|
||||
stripe_agent = Agent(
|
||||
role="Payment Manager",
|
||||
goal="Manage customer payments, subscriptions, and billing operations efficiently",
|
||||
backstory="An AI assistant specialized in payment processing and subscription management.",
|
||||
tools=[enterprise_tools]
|
||||
)
|
||||
|
||||
# Task to create a new customer
|
||||
create_customer_task = Task(
|
||||
description="Create a new premium customer John Doe with email john.doe@example.com",
|
||||
agent=stripe_agent,
|
||||
expected_output="Customer created successfully with customer ID"
|
||||
)
|
||||
|
||||
# Run the task
|
||||
crew = Crew(
|
||||
agents=[stripe_agent],
|
||||
tasks=[create_customer_task]
|
||||
)
|
||||
|
||||
crew.kickoff()
|
||||
```
|
||||
|
||||
### Filtering Specific Stripe Tools
|
||||
|
||||
```python
|
||||
from crewai_tools import CrewaiEnterpriseTools
|
||||
|
||||
# Get only specific Stripe tools
|
||||
enterprise_tools = CrewaiEnterpriseTools(
|
||||
enterprise_token="your_enterprise_token",
|
||||
actions_list=["stripe_create_customer", "stripe_create_subscription", "stripe_get_balance_transactions"]
|
||||
)
|
||||
|
||||
billing_manager = Agent(
|
||||
role="Billing Manager",
|
||||
goal="Handle customer billing, subscriptions, and payment processing",
|
||||
backstory="An experienced billing manager who handles subscription lifecycle and payment operations.",
|
||||
tools=enterprise_tools
|
||||
)
|
||||
|
||||
# Task to manage billing operations
|
||||
billing_task = Task(
|
||||
description="Create a new customer and set up their premium subscription plan",
|
||||
agent=billing_manager,
|
||||
expected_output="Customer created and subscription activated successfully"
|
||||
)
|
||||
|
||||
crew = Crew(
|
||||
agents=[billing_manager],
|
||||
tasks=[billing_task]
|
||||
)
|
||||
|
||||
crew.kickoff()
|
||||
```
|
||||
|
||||
### Subscription Management
|
||||
|
||||
```python
|
||||
from crewai import Agent, Task, Crew
|
||||
from crewai_tools import CrewaiEnterpriseTools
|
||||
|
||||
enterprise_tools = CrewaiEnterpriseTools(
|
||||
enterprise_token="your_enterprise_token"
|
||||
)
|
||||
|
||||
subscription_manager = Agent(
|
||||
role="Subscription Manager",
|
||||
goal="Manage customer subscriptions and optimize recurring revenue",
|
||||
backstory="An AI assistant that specializes in subscription lifecycle management and customer retention.",
|
||||
tools=[enterprise_tools]
|
||||
)
|
||||
|
||||
# Task to manage subscription operations
|
||||
subscription_task = Task(
|
||||
description="""
|
||||
1. Create a new product "Premium Service Plan" with advanced features
|
||||
2. Set up subscription plans with different tiers
|
||||
3. Create customers and assign them to appropriate plans
|
||||
4. Monitor subscription status and handle billing issues
|
||||
""",
|
||||
agent=subscription_manager,
|
||||
expected_output="Subscription management system configured with customers and active plans"
|
||||
)
|
||||
|
||||
crew = Crew(
|
||||
agents=[subscription_manager],
|
||||
tasks=[subscription_task]
|
||||
)
|
||||
|
||||
crew.kickoff()
|
||||
```
|
||||
|
||||
### Financial Analytics and Reporting
|
||||
|
||||
```python
|
||||
from crewai import Agent, Task, Crew
|
||||
from crewai_tools import CrewaiEnterpriseTools
|
||||
|
||||
enterprise_tools = CrewaiEnterpriseTools(
|
||||
enterprise_token="your_enterprise_token"
|
||||
)
|
||||
|
||||
financial_analyst = Agent(
|
||||
role="Financial Analyst",
|
||||
goal="Analyze payment data and generate financial insights",
|
||||
backstory="An analytical AI that excels at extracting insights from payment and subscription data.",
|
||||
tools=[enterprise_tools]
|
||||
)
|
||||
|
||||
# Complex task involving financial analysis
|
||||
analytics_task = Task(
|
||||
description="""
|
||||
1. Retrieve balance transactions for the current month
|
||||
2. Analyze customer payment patterns and subscription trends
|
||||
3. Identify high-value customers and subscription performance
|
||||
4. Generate monthly financial performance report
|
||||
""",
|
||||
agent=financial_analyst,
|
||||
expected_output="Comprehensive financial analysis with payment insights and recommendations"
|
||||
)
|
||||
|
||||
crew = Crew(
|
||||
agents=[financial_analyst],
|
||||
tasks=[analytics_task]
|
||||
)
|
||||
|
||||
crew.kickoff()
|
||||
```
|
||||
|
||||
## Subscription Status Reference
|
||||
|
||||
Understanding subscription statuses:
|
||||
|
||||
- **incomplete** - Subscription requires payment method or payment confirmation
|
||||
- **incomplete_expired** - Subscription expired before payment was confirmed
|
||||
- **trialing** - Subscription is in trial period
|
||||
- **active** - Subscription is active and current
|
||||
- **past_due** - Payment failed but subscription is still active
|
||||
- **canceled** - Subscription has been canceled
|
||||
- **unpaid** - Payment failed and subscription is no longer active
|
||||
|
||||
## Metadata Usage
|
||||
|
||||
Metadata allows you to store additional information about customers, subscriptions, and products:
|
||||
|
||||
```json
|
||||
{
|
||||
"customer_segment": "enterprise",
|
||||
"acquisition_source": "google_ads",
|
||||
"lifetime_value": "high",
|
||||
"custom_field_1": "value1"
|
||||
}
|
||||
```
|
||||
|
||||
This integration enables comprehensive payment and subscription management automation, allowing your AI agents to handle billing operations seamlessly within your Stripe ecosystem.
|
||||
343
docs/en/enterprise/integrations/zendesk.mdx
Normal file
343
docs/en/enterprise/integrations/zendesk.mdx
Normal file
@@ -0,0 +1,343 @@
|
||||
---
|
||||
title: Zendesk Integration
|
||||
description: "Customer support and helpdesk management with Zendesk integration for CrewAI."
|
||||
icon: "headset"
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
Enable your agents to manage customer support operations through Zendesk. Create and update tickets, manage users, track support metrics, and streamline your customer service workflows with AI-powered automation.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
Before using the Zendesk integration, ensure you have:
|
||||
|
||||
- A [CrewAI Enterprise](https://app.crewai.com) account with an active subscription
|
||||
- A Zendesk account with appropriate API permissions
|
||||
- Connected your Zendesk account through the [Integrations page](https://app.crewai.com/integrations)
|
||||
|
||||
## Available Tools
|
||||
|
||||
### **Ticket Management**
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="ZENDESK_CREATE_TICKET">
|
||||
**Description:** Create a new support ticket in Zendesk.
|
||||
|
||||
**Parameters:**
|
||||
- `ticketSubject` (string, required): Ticket subject line (e.g., "Help, my printer is on fire!")
|
||||
- `ticketDescription` (string, required): First comment that appears on the ticket (e.g., "The smoke is very colorful.")
|
||||
- `requesterName` (string, required): Name of the user requesting support (e.g., "Jane Customer")
|
||||
- `requesterEmail` (string, required): Email of the user requesting support (e.g., "jane@example.com")
|
||||
- `assigneeId` (string, optional): Zendesk Agent ID assigned to this ticket - Use Connect Portal Workflow Settings to allow users to select an assignee
|
||||
- `ticketType` (string, optional): Ticket type - Options: problem, incident, question, task
|
||||
- `ticketPriority` (string, optional): Priority level - Options: urgent, high, normal, low
|
||||
- `ticketStatus` (string, optional): Ticket status - Options: new, open, pending, hold, solved, closed
|
||||
- `ticketDueAt` (string, optional): Due date for task-type tickets (ISO 8601 timestamp)
|
||||
- `ticketTags` (string, optional): Array of tags to apply (e.g., `["enterprise", "other_tag"]`)
|
||||
- `ticketExternalId` (string, optional): External ID to link tickets to local records
|
||||
- `ticketCustomFields` (object, optional): Custom field values in JSON format
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="ZENDESK_UPDATE_TICKET">
|
||||
**Description:** Update an existing support ticket in Zendesk.
|
||||
|
||||
**Parameters:**
|
||||
- `ticketId` (string, required): ID of the ticket to update (e.g., "35436")
|
||||
- `ticketSubject` (string, optional): Updated ticket subject
|
||||
- `requesterName` (string, required): Name of the user who requested this ticket
|
||||
- `requesterEmail` (string, required): Email of the user who requested this ticket
|
||||
- `assigneeId` (string, optional): Updated assignee ID - Use Connect Portal Workflow Settings
|
||||
- `ticketType` (string, optional): Updated ticket type - Options: problem, incident, question, task
|
||||
- `ticketPriority` (string, optional): Updated priority - Options: urgent, high, normal, low
|
||||
- `ticketStatus` (string, optional): Updated status - Options: new, open, pending, hold, solved, closed
|
||||
- `ticketDueAt` (string, optional): Updated due date (ISO 8601 timestamp)
|
||||
- `ticketTags` (string, optional): Updated tags array
|
||||
- `ticketExternalId` (string, optional): Updated external ID
|
||||
- `ticketCustomFields` (object, optional): Updated custom field values
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="ZENDESK_GET_TICKET_BY_ID">
|
||||
**Description:** Retrieve a specific ticket by its ID.
|
||||
|
||||
**Parameters:**
|
||||
- `ticketId` (string, required): The ticket ID to retrieve (e.g., "35436")
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="ZENDESK_ADD_COMMENT_TO_TICKET">
|
||||
**Description:** Add a comment or internal note to an existing ticket.
|
||||
|
||||
**Parameters:**
|
||||
- `ticketId` (string, required): ID of the ticket to add comment to (e.g., "35436")
|
||||
- `commentBody` (string, required): Comment message (accepts plain text or HTML, e.g., "Thanks for your help!")
|
||||
- `isInternalNote` (boolean, optional): Set to true for internal notes instead of public replies (defaults to false)
|
||||
- `isPublic` (boolean, optional): True for public comments, false for internal notes
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="ZENDESK_SEARCH_TICKETS">
|
||||
**Description:** Search for tickets using various filters and criteria.
|
||||
|
||||
**Parameters:**
|
||||
- `ticketSubject` (string, optional): Filter by text in ticket subject
|
||||
- `ticketDescription` (string, optional): Filter by text in ticket description and comments
|
||||
- `ticketStatus` (string, optional): Filter by status - Options: new, open, pending, hold, solved, closed
|
||||
- `ticketType` (string, optional): Filter by type - Options: problem, incident, question, task, no_type
|
||||
- `ticketPriority` (string, optional): Filter by priority - Options: urgent, high, normal, low, no_priority
|
||||
- `requesterId` (string, optional): Filter by requester user ID
|
||||
- `assigneeId` (string, optional): Filter by assigned agent ID
|
||||
- `recipientEmail` (string, optional): Filter by original recipient email address
|
||||
- `ticketTags` (string, optional): Filter by ticket tags
|
||||
- `ticketExternalId` (string, optional): Filter by external ID
|
||||
- `createdDate` (object, optional): Filter by creation date with operator (EQUALS, LESS_THAN_EQUALS, GREATER_THAN_EQUALS) and value
|
||||
- `updatedDate` (object, optional): Filter by update date with operator and value
|
||||
- `dueDate` (object, optional): Filter by due date with operator and value
|
||||
- `sort_by` (string, optional): Sort field - Options: created_at, updated_at, priority, status, ticket_type
|
||||
- `sort_order` (string, optional): Sort direction - Options: asc, desc
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
### **User Management**
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="ZENDESK_CREATE_USER">
|
||||
**Description:** Create a new user in Zendesk.
|
||||
|
||||
**Parameters:**
|
||||
- `name` (string, required): User's full name
|
||||
- `email` (string, optional): User's email address (e.g., "jane@example.com")
|
||||
- `phone` (string, optional): User's phone number
|
||||
- `role` (string, optional): User role - Options: admin, agent, end-user
|
||||
- `externalId` (string, optional): Unique identifier from another system
|
||||
- `details` (string, optional): Additional user details
|
||||
- `notes` (string, optional): Internal notes about the user
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="ZENDESK_UPDATE_USER">
|
||||
**Description:** Update an existing user's information.
|
||||
|
||||
**Parameters:**
|
||||
- `userId` (string, required): ID of the user to update
|
||||
- `name` (string, optional): Updated user name
|
||||
- `email` (string, optional): Updated email (adds as secondary email on update)
|
||||
- `phone` (string, optional): Updated phone number
|
||||
- `role` (string, optional): Updated role - Options: admin, agent, end-user
|
||||
- `externalId` (string, optional): Updated external ID
|
||||
- `details` (string, optional): Updated user details
|
||||
- `notes` (string, optional): Updated internal notes
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="ZENDESK_GET_USER_BY_ID">
|
||||
**Description:** Retrieve a specific user by their ID.
|
||||
|
||||
**Parameters:**
|
||||
- `userId` (string, required): The user ID to retrieve
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="ZENDESK_SEARCH_USERS">
|
||||
**Description:** Search for users using various criteria.
|
||||
|
||||
**Parameters:**
|
||||
- `name` (string, optional): Filter by user name
|
||||
- `email` (string, optional): Filter by user email (e.g., "jane@example.com")
|
||||
- `role` (string, optional): Filter by role - Options: admin, agent, end-user
|
||||
- `externalId` (string, optional): Filter by external ID
|
||||
- `sort_by` (string, optional): Sort field - Options: created_at, updated_at
|
||||
- `sort_order` (string, optional): Sort direction - Options: asc, desc
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
### **Administrative Tools**
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="ZENDESK_GET_TICKET_FIELDS">
|
||||
**Description:** Retrieve all standard and custom fields available for tickets.
|
||||
|
||||
**Parameters:**
|
||||
- `paginationParameters` (object, optional): Pagination settings
|
||||
- `pageCursor` (string, optional): Page cursor for pagination
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="ZENDESK_GET_TICKET_AUDITS">
|
||||
**Description:** Get audit records (read-only history) for tickets.
|
||||
|
||||
**Parameters:**
|
||||
- `ticketId` (string, optional): Get audits for specific ticket (if empty, retrieves audits for all non-archived tickets, e.g., "1234")
|
||||
- `paginationParameters` (object, optional): Pagination settings
|
||||
- `pageCursor` (string, optional): Page cursor for pagination
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
## Custom Fields
|
||||
|
||||
Custom fields allow you to store additional information specific to your organization:
|
||||
|
||||
```json
|
||||
[
|
||||
{ "id": 27642, "value": "745" },
|
||||
{ "id": 27648, "value": "yes" }
|
||||
]
|
||||
```
|
||||
|
||||
## Ticket Priority Levels
|
||||
|
||||
Understanding priority levels:
|
||||
|
||||
- **urgent** - Critical issues requiring immediate attention
|
||||
- **high** - Important issues that should be addressed quickly
|
||||
- **normal** - Standard priority for most tickets
|
||||
- **low** - Minor issues that can be addressed when convenient
|
||||
|
||||
## Ticket Status Workflow
|
||||
|
||||
Standard ticket status progression:
|
||||
|
||||
- **new** - Recently created, not yet assigned
|
||||
- **open** - Actively being worked on
|
||||
- **pending** - Waiting for customer response or external action
|
||||
- **hold** - Temporarily paused
|
||||
- **solved** - Issue resolved, awaiting customer confirmation
|
||||
- **closed** - Ticket completed and closed
|
||||
|
||||
## Usage Examples
|
||||
|
||||
### Basic Zendesk Agent Setup
|
||||
|
||||
```python
|
||||
from crewai import Agent, Task, Crew
|
||||
from crewai_tools import CrewaiEnterpriseTools
|
||||
|
||||
# Get enterprise tools (Zendesk tools will be included)
|
||||
enterprise_tools = CrewaiEnterpriseTools(
|
||||
enterprise_token="your_enterprise_token"
|
||||
)
|
||||
|
||||
# Create an agent with Zendesk capabilities
|
||||
zendesk_agent = Agent(
|
||||
role="Support Manager",
|
||||
goal="Manage customer support tickets and provide excellent customer service",
|
||||
backstory="An AI assistant specialized in customer support operations and ticket management.",
|
||||
tools=[enterprise_tools]
|
||||
)
|
||||
|
||||
# Task to create a new support ticket
|
||||
create_ticket_task = Task(
|
||||
description="Create a high-priority support ticket for John Smith who is unable to access his account after password reset",
|
||||
agent=zendesk_agent,
|
||||
expected_output="Support ticket created successfully with ticket ID"
|
||||
)
|
||||
|
||||
# Run the task
|
||||
crew = Crew(
|
||||
agents=[zendesk_agent],
|
||||
tasks=[create_ticket_task]
|
||||
)
|
||||
|
||||
crew.kickoff()
|
||||
```
|
||||
|
||||
### Filtering Specific Zendesk Tools
|
||||
|
||||
```python
|
||||
from crewai_tools import CrewaiEnterpriseTools
|
||||
|
||||
# Get only specific Zendesk tools
|
||||
enterprise_tools = CrewaiEnterpriseTools(
|
||||
enterprise_token="your_enterprise_token",
|
||||
actions_list=["zendesk_create_ticket", "zendesk_update_ticket", "zendesk_add_comment_to_ticket"]
|
||||
)
|
||||
|
||||
support_agent = Agent(
|
||||
role="Customer Support Agent",
|
||||
goal="Handle customer inquiries and resolve support issues efficiently",
|
||||
backstory="An experienced support agent who specializes in ticket resolution and customer communication.",
|
||||
tools=enterprise_tools
|
||||
)
|
||||
|
||||
# Task to manage support workflow
|
||||
support_task = Task(
|
||||
description="Create a ticket for login issues, add troubleshooting comments, and update status to resolved",
|
||||
agent=support_agent,
|
||||
expected_output="Support ticket managed through complete resolution workflow"
|
||||
)
|
||||
|
||||
crew = Crew(
|
||||
agents=[support_agent],
|
||||
tasks=[support_task]
|
||||
)
|
||||
|
||||
crew.kickoff()
|
||||
```
|
||||
|
||||
### Advanced Ticket Management
|
||||
|
||||
```python
|
||||
from crewai import Agent, Task, Crew
|
||||
from crewai_tools import CrewaiEnterpriseTools
|
||||
|
||||
enterprise_tools = CrewaiEnterpriseTools(
|
||||
enterprise_token="your_enterprise_token"
|
||||
)
|
||||
|
||||
ticket_manager = Agent(
|
||||
role="Ticket Manager",
|
||||
goal="Manage support ticket workflows and ensure timely resolution",
|
||||
backstory="An AI assistant that specializes in support ticket triage and workflow optimization.",
|
||||
tools=[enterprise_tools]
|
||||
)
|
||||
|
||||
# Task to manage ticket lifecycle
|
||||
ticket_workflow = Task(
|
||||
description="""
|
||||
1. Create a new support ticket for account access issues
|
||||
2. Add internal notes with troubleshooting steps
|
||||
3. Update ticket priority based on customer tier
|
||||
4. Add resolution comments and close the ticket
|
||||
""",
|
||||
agent=ticket_manager,
|
||||
expected_output="Complete ticket lifecycle managed from creation to resolution"
|
||||
)
|
||||
|
||||
crew = Crew(
|
||||
agents=[ticket_manager],
|
||||
tasks=[ticket_workflow]
|
||||
)
|
||||
|
||||
crew.kickoff()
|
||||
```
|
||||
|
||||
### Support Analytics and Reporting
|
||||
|
||||
```python
|
||||
from crewai import Agent, Task, Crew
|
||||
from crewai_tools import CrewaiEnterpriseTools
|
||||
|
||||
enterprise_tools = CrewaiEnterpriseTools(
|
||||
enterprise_token="your_enterprise_token"
|
||||
)
|
||||
|
||||
support_analyst = Agent(
|
||||
role="Support Analyst",
|
||||
goal="Analyze support metrics and generate insights for team performance",
|
||||
backstory="An analytical AI that excels at extracting insights from support data and ticket patterns.",
|
||||
tools=[enterprise_tools]
|
||||
)
|
||||
|
||||
# Complex task involving analytics and reporting
|
||||
analytics_task = Task(
|
||||
description="""
|
||||
1. Search for all open tickets from the last 30 days
|
||||
2. Analyze ticket resolution times and customer satisfaction
|
||||
3. Identify common issues and support patterns
|
||||
4. Generate weekly support performance report
|
||||
""",
|
||||
agent=support_analyst,
|
||||
expected_output="Comprehensive support analytics report with performance insights and recommendations"
|
||||
)
|
||||
|
||||
crew = Crew(
|
||||
agents=[support_analyst],
|
||||
tasks=[analytics_task]
|
||||
)
|
||||
|
||||
crew.kickoff()
|
||||
```
|
||||
@@ -56,8 +56,8 @@ CrewAI Enterprise extends the power of the open-source framework with features d
|
||||
<Steps>
|
||||
<Step title="Sign up for an account">
|
||||
Create your account at [app.crewai.com](https://app.crewai.com)
|
||||
<Card
|
||||
title="Sign Up"
|
||||
<Card
|
||||
title="Sign Up"
|
||||
icon="user"
|
||||
href="https://app.crewai.com/signup"
|
||||
>
|
||||
@@ -66,34 +66,34 @@ CrewAI Enterprise extends the power of the open-source framework with features d
|
||||
</Step>
|
||||
<Step title="Build your first crew">
|
||||
Use code or Crew Studio to build your crew
|
||||
<Card
|
||||
title="Build Crew"
|
||||
<Card
|
||||
title="Build Crew"
|
||||
icon="paintbrush"
|
||||
href="/enterprise/guides/build-crew"
|
||||
href="/en/enterprise/guides/build-crew"
|
||||
>
|
||||
Build Crew
|
||||
</Card>
|
||||
</Step>
|
||||
<Step title="Deploy your crew">
|
||||
Deploy your crew to the Enterprise platform
|
||||
<Card
|
||||
title="Deploy Crew"
|
||||
<Card
|
||||
title="Deploy Crew"
|
||||
icon="rocket"
|
||||
href="/enterprise/guides/deploy-crew"
|
||||
href="/en/enterprise/guides/deploy-crew"
|
||||
>
|
||||
Deploy Crew
|
||||
</Card>
|
||||
</Step>
|
||||
<Step title="Access your crew">
|
||||
Integrate with your crew via the generated API endpoints
|
||||
<Card
|
||||
title="API Access"
|
||||
<Card
|
||||
title="API Access"
|
||||
icon="code"
|
||||
href="/enterprise/guides/use-crew-api"
|
||||
href="/en/enterprise/guides/kickoff-crew"
|
||||
>
|
||||
Use the Crew API
|
||||
</Card>
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
For detailed instructions, check out our [deployment guide](/enterprise/guides/deploy-crew) or click the button below to get started.
|
||||
For detailed instructions, check out our [deployment guide](/en/enterprise/guides/deploy-crew) or click the button below to get started.
|
||||
@@ -48,12 +48,12 @@ icon: "circle-question"
|
||||
|
||||
To integrate human input into agent execution, set the `human_input` flag in the task definition. When enabled, the agent prompts the user for input before delivering its final answer. This input can provide extra context, clarify ambiguities, or validate the agent's output.
|
||||
|
||||
For detailed implementation guidance, see our [Human-in-the-Loop guide](/how-to/human-in-the-loop).
|
||||
For detailed implementation guidance, see our [Human-in-the-Loop guide](/en/how-to/human-in-the-loop).
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="What advanced customization options are available for tailoring and enhancing agent behavior and capabilities in CrewAI?">
|
||||
CrewAI provides a range of advanced customization options:
|
||||
|
||||
|
||||
- **Language Model Customization**: Agents can be customized with specific language models (`llm`) and function-calling language models (`function_calling_llm`)
|
||||
- **Performance and Debugging Settings**: Adjust an agent's performance and monitor its operations
|
||||
- **Verbose Mode**: Enables detailed logging of an agent's actions, useful for debugging and optimization
|
||||
@@ -129,12 +129,12 @@ icon: "circle-question"
|
||||
|
||||
Here's a tutorial on how to consistently get structured outputs from your agents:
|
||||
<Frame>
|
||||
<iframe
|
||||
<iframe
|
||||
height="400"
|
||||
width="100%"
|
||||
src="https://www.youtube.com/embed/dNpKQk5uxHw"
|
||||
title="YouTube video player" frameborder="0"
|
||||
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
|
||||
src="https://www.youtube.com/embed/dNpKQk5uxHw"
|
||||
title="YouTube video player" frameborder="0"
|
||||
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
|
||||
allowfullscreen></iframe>
|
||||
</Frame>
|
||||
</Accordion>
|
||||
@@ -148,4 +148,4 @@ icon: "circle-question"
|
||||
<Accordion title="How can you control the maximum number of requests per minute that the entire crew can perform?">
|
||||
The `max_rpm` attribute sets the maximum number of requests per minute the crew can perform to avoid rate limits and will override individual agents' `max_rpm` settings if you set it.
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
</AccordionGroup>
|
||||
@@ -44,7 +44,7 @@ Based on your agent configuration, CrewAI adds different default instructions:
|
||||
"I MUST use these formats, my job depends on it!"
|
||||
```
|
||||
|
||||
#### For Agents With Tools
|
||||
#### For Agents With Tools
|
||||
```text
|
||||
"IMPORTANT: Use the following format in your response:
|
||||
|
||||
@@ -127,7 +127,7 @@ custom_prompt_template = """Task: {input}
|
||||
Please complete this task thoughtfully."""
|
||||
|
||||
agent = Agent(
|
||||
role="Research Assistant",
|
||||
role="Research Assistant",
|
||||
goal="Help users find accurate information",
|
||||
backstory="You are a helpful research assistant.",
|
||||
system_template=custom_system_template,
|
||||
@@ -164,7 +164,7 @@ crew = Crew(
|
||||
```python
|
||||
agent = Agent(
|
||||
role="Analyst",
|
||||
goal="Analyze data",
|
||||
goal="Analyze data",
|
||||
backstory="Expert analyst",
|
||||
use_system_prompt=False # Disables system prompt separation
|
||||
)
|
||||
@@ -174,13 +174,13 @@ agent = Agent(
|
||||
|
||||
For production transparency, integrate with observability platforms to monitor all prompts and LLM interactions. This allows you to see exactly what prompts (including default instructions) are being sent to your LLMs.
|
||||
|
||||
See our [Observability documentation](/how-to/observability) for detailed integration guides with various platforms including Langfuse, MLflow, Weights & Biases, and custom logging solutions.
|
||||
See our [Observability documentation](/en/observability/overview) for detailed integration guides with various platforms including Langfuse, MLflow, Weights & Biases, and custom logging solutions.
|
||||
|
||||
### Best Practices for Production
|
||||
|
||||
1. **Always inspect generated prompts** before deploying to production
|
||||
2. **Use custom templates** when you need full control over prompt content
|
||||
3. **Integrate observability tools** for ongoing prompt monitoring (see [Observability docs](/how-to/observability))
|
||||
3. **Integrate observability tools** for ongoing prompt monitoring (see [Observability docs](/en/observability/overview))
|
||||
4. **Test with different LLMs** as default instructions may work differently across models
|
||||
5. **Document your prompt customizations** for team transparency
|
||||
|
||||
@@ -313,4 +313,4 @@ Low-level prompt customization in CrewAI opens the door to super custom, complex
|
||||
|
||||
<Check>
|
||||
You now have the foundation for advanced prompt customizations in CrewAI. Whether you're adapting for model-specific structures or domain-specific constraints, this low-level approach lets you shape agent interactions in highly specialized ways.
|
||||
</Check>
|
||||
</Check>
|
||||
@@ -448,5 +448,5 @@ Congratulations! You now understand the principles and practices of effective ag
|
||||
## Next Steps
|
||||
|
||||
- Experiment with different agent configurations for your specific use case
|
||||
- Learn about [building your first crew](/guides/crews/first-crew) to see how agents work together
|
||||
- Explore [CrewAI Flows](/guides/flows/first-flow) for more advanced orchestration
|
||||
- Learn about [building your first crew](/en/guides/crews/first-crew) to see how agents work together
|
||||
- Explore [CrewAI Flows](/en/guides/flows/first-flow) for more advanced orchestration
|
||||
@@ -11,7 +11,7 @@ When building AI applications with CrewAI, one of the most important decisions y
|
||||
At the heart of this decision is understanding the relationship between **complexity** and **precision** in your application:
|
||||
|
||||
<Frame caption="Complexity vs. Precision Matrix for CrewAI Applications">
|
||||
<img src="../../images/complexity_precision.png" alt="Complexity vs. Precision Matrix" />
|
||||
<img src="/images/complexity_precision.png" alt="Complexity vs. Precision Matrix" />
|
||||
</Frame>
|
||||
|
||||
This matrix helps visualize how different approaches align with varying requirements for complexity and precision. Let's explore what each quadrant means and how it guides your architectural choices.
|
||||
@@ -497,7 +497,7 @@ You now have a framework for evaluating CrewAI use cases and choosing the right
|
||||
|
||||
## Next Steps
|
||||
|
||||
- Learn more about [crafting effective agents](/guides/agents/crafting-effective-agents)
|
||||
- Explore [building your first crew](/guides/crews/first-crew)
|
||||
- Dive into [mastering flow state management](/guides/flows/mastering-flow-state)
|
||||
- Check out the [core concepts](/concepts/agents) for deeper understanding
|
||||
- Learn more about [crafting effective agents](/en/guides/agents/crafting-effective-agents)
|
||||
- Explore [building your first crew](/en/guides/crews/first-crew)
|
||||
- Dive into [mastering flow state management](/en/guides/flows/mastering-flow-state)
|
||||
- Check out the [core concepts](/en/concepts/agents) for deeper understanding
|
||||
@@ -32,9 +32,9 @@ Let's get started building your first crew!
|
||||
|
||||
Before starting, make sure you have:
|
||||
|
||||
1. Installed CrewAI following the [installation guide](/installation)
|
||||
1. Installed CrewAI following the [installation guide](/en/installation)
|
||||
2. Set up your LLM API key in your environment, following the [LLM setup
|
||||
guide](/concepts/llms#setting-up-your-llm)
|
||||
guide](/en/concepts/llms#setting-up-your-llm)
|
||||
3. Basic understanding of Python
|
||||
|
||||
## Step 1: Create a New CrewAI Project
|
||||
@@ -54,7 +54,7 @@ This will generate a project with the basic structure needed for your crew. The
|
||||
- A main script to run the crew
|
||||
|
||||
<Frame caption="CrewAI Framework Overview">
|
||||
<img src="../../images/crews.png" alt="CrewAI Framework Overview" />
|
||||
<img src="/images/crews.png" alt="CrewAI Framework Overview" />
|
||||
</Frame>
|
||||
|
||||
|
||||
@@ -287,7 +287,7 @@ SERPER_API_KEY=your_serper_api_key
|
||||
# Add your provider's API key here too.
|
||||
```
|
||||
|
||||
See the [LLM Setup guide](/concepts/llms#setting-up-your-llm) for details on configuring your provider of choice. You can get a Serper API key from [Serper.dev](https://serper.dev/).
|
||||
See the [LLM Setup guide](/en/concepts/llms#setting-up-your-llm) for details on configuring your provider of choice. You can get a Serper API key from [Serper.dev](https://serper.dev/).
|
||||
|
||||
## Step 8: Install Dependencies
|
||||
|
||||
@@ -388,7 +388,7 @@ Now that you've built your first crew, you can:
|
||||
2. Try more complex task structures and workflows
|
||||
3. Implement custom tools to give your agents new capabilities
|
||||
4. Apply your crew to different topics or problem domains
|
||||
5. Explore [CrewAI Flows](/guides/flows/first-flow) for more advanced workflows with procedural programming
|
||||
5. Explore [CrewAI Flows](/en/guides/flows/first-flow) for more advanced workflows with procedural programming
|
||||
|
||||
<Check>
|
||||
Congratulations! You've successfully built your first CrewAI crew that can research and analyze any topic you provide. This foundational experience has equipped you with the skills to create increasingly sophisticated AI systems that can tackle complex, multi-stage problems through collaborative intelligence.
|
||||
@@ -42,9 +42,9 @@ Let's dive in and build your first flow!
|
||||
|
||||
Before starting, make sure you have:
|
||||
|
||||
1. Installed CrewAI following the [installation guide](/installation)
|
||||
1. Installed CrewAI following the [installation guide](/en/installation)
|
||||
2. Set up your LLM API key in your environment, following the [LLM setup
|
||||
guide](/concepts/llms#setting-up-your-llm)
|
||||
guide](/en/concepts/llms#setting-up-your-llm)
|
||||
3. Basic understanding of Python
|
||||
|
||||
## Step 1: Create a New CrewAI Flow Project
|
||||
@@ -59,7 +59,7 @@ cd guide_creator_flow
|
||||
This will generate a project with the basic structure needed for your flow.
|
||||
|
||||
<Frame caption="CrewAI Framework Overview">
|
||||
<img src="../../images/flows.png" alt="CrewAI Framework Overview" />
|
||||
<img src="/images/flows.png" alt="CrewAI Framework Overview" />
|
||||
</Frame>
|
||||
|
||||
## Step 2: Understanding the Project Structure
|
||||
@@ -443,7 +443,7 @@ This is the power of flows - combining different types of processing (user inter
|
||||
## Step 6: Set Up Your Environment Variables
|
||||
|
||||
Create a `.env` file in your project root with your API keys. See the [LLM setup
|
||||
guide](/concepts/llms#setting-up-your-llm) for details on configuring a provider.
|
||||
guide](/en/concepts/llms#setting-up-your-llm) for details on configuring a provider.
|
||||
|
||||
```sh .env
|
||||
OPENAI_API_KEY=your_openai_api_key
|
||||
@@ -767,5 +767,5 @@ You've now mastered the concepts and practices of state management in CrewAI Flo
|
||||
|
||||
- Experiment with both structured and unstructured state in your flows
|
||||
- Try implementing state persistence for long-running workflows
|
||||
- Explore [building your first crew](/guides/crews/first-crew) to see how crews and flows can work together
|
||||
- Check out the [Flow reference documentation](/concepts/flows) for more advanced features
|
||||
- Explore [building your first crew](/en/guides/crews/first-crew) to see how crews and flows can work together
|
||||
- Check out the [Flow reference documentation](/en/concepts/flows) for more advanced features
|
||||
@@ -72,7 +72,7 @@ If you haven't installed `uv` yet, follow **step 1** to quickly get it set up on
|
||||
</Warning>
|
||||
|
||||
<Warning>
|
||||
If you encounter the `chroma-hnswlib==0.7.6` build error (`fatal error C1083: Cannot open include file: 'float.h'`) on Windows, install (Visual Studio Build Tools)[https://visualstudio.microsoft.com/downloads/] with *Desktop development with C++*.
|
||||
If you encounter the `chroma-hnswlib==0.7.6` build error (`fatal error C1083: Cannot open include file: 'float.h'`) on Windows, install [Visual Studio Build Tools](https://visualstudio.microsoft.com/downloads/) with *Desktop development with C++*.
|
||||
</Warning>
|
||||
|
||||
- To verify that `crewai` is installed, run:
|
||||
@@ -104,7 +104,6 @@ We recommend using the `YAML` template scaffolding for a structured approach to
|
||||
```
|
||||
|
||||
- This creates a new project with the following structure:
|
||||
<Frame>
|
||||
```
|
||||
my_project/
|
||||
├── .gitignore
|
||||
@@ -124,7 +123,6 @@ We recommend using the `YAML` template scaffolding for a structured approach to
|
||||
├── agents.yaml
|
||||
└── tasks.yaml
|
||||
```
|
||||
</Frame>
|
||||
</Step>
|
||||
|
||||
<Step title="Customize Your Project">
|
||||
@@ -172,7 +170,7 @@ For teams and organizations, CrewAI offers enterprise deployment options that el
|
||||
|
||||
### CrewAI Factory (Self-hosted)
|
||||
- Containerized deployment for your infrastructure
|
||||
- Supports any hyperscaler including on prem depployments
|
||||
- Supports any hyperscaler including on prem deployments
|
||||
- Integration with your existing security systems
|
||||
|
||||
<Card title="Explore Enterprise Options" icon="building" href="https://crewai.com/enterprise">
|
||||
@@ -186,7 +184,7 @@ For teams and organizations, CrewAI offers enterprise deployment options that el
|
||||
<Card
|
||||
title="Build Your First Agent"
|
||||
icon="code"
|
||||
href="/quickstart"
|
||||
href="/en/quickstart"
|
||||
>
|
||||
Follow our quickstart guide to create your first CrewAI agent and get hands-on experience.
|
||||
</Card>
|
||||
@@ -10,8 +10,8 @@ icon: handshake
|
||||
|
||||
CrewAI empowers developers with both high-level simplicity and precise low-level control, ideal for creating autonomous AI agents tailored to any scenario:
|
||||
|
||||
- **[CrewAI Crews](/guides/crews/first-crew)**: Optimize for autonomy and collaborative intelligence, enabling you to create AI teams where each agent has specific roles, tools, and goals.
|
||||
- **[CrewAI Flows](/guides/flows/first-flow)**: Enable granular, event-driven control, single LLM calls for precise task orchestration and supports Crews natively.
|
||||
- **[CrewAI Crews](/en/guides/crews/first-crew)**: Optimize for autonomy and collaborative intelligence, enabling you to create AI teams where each agent has specific roles, tools, and goals.
|
||||
- **[CrewAI Flows](/en/guides/flows/first-flow)**: Enable granular, event-driven control, single LLM calls for precise task orchestration and supports Crews natively.
|
||||
|
||||
With over 100,000 developers certified through our community courses, CrewAI is rapidly becoming the standard for enterprise-ready AI automation.
|
||||
|
||||
@@ -23,7 +23,7 @@ With over 100,000 developers certified through our community courses, CrewAI is
|
||||
</Note>
|
||||
|
||||
<Frame caption="CrewAI Framework Overview">
|
||||
<img src="images/crews.png" alt="CrewAI Framework Overview" />
|
||||
<img src="/images/crews.png" alt="CrewAI Framework Overview" />
|
||||
</Frame>
|
||||
|
||||
| Component | Description | Key Features |
|
||||
@@ -64,7 +64,7 @@ With over 100,000 developers certified through our community courses, CrewAI is
|
||||
</Note>
|
||||
|
||||
<Frame caption="CrewAI Framework Overview">
|
||||
<img src="images/flows.png" alt="CrewAI Framework Overview" />
|
||||
<img src="/images/flows.png" alt="CrewAI Framework Overview" />
|
||||
</Frame>
|
||||
|
||||
| Component | Description | Key Features |
|
||||
@@ -94,21 +94,21 @@ With over 100,000 developers certified through our community courses, CrewAI is
|
||||
## When to Use Crews vs. Flows
|
||||
|
||||
<Note>
|
||||
Understanding when to use [Crews](/guides/crews/first-crew) versus [Flows](/guides/flows/first-flow) is key to maximizing the potential of CrewAI in your applications.
|
||||
Understanding when to use [Crews](/en/guides/crews/first-crew) versus [Flows](/en/guides/flows/first-flow) is key to maximizing the potential of CrewAI in your applications.
|
||||
</Note>
|
||||
|
||||
| Use Case | Recommended Approach | Why? |
|
||||
|:---------|:---------------------|:-----|
|
||||
| **Open-ended research** | [Crews](/guides/crews/first-crew) | When tasks require creative thinking, exploration, and adaptation |
|
||||
| **Content generation** | [Crews](/guides/crews/first-crew) | For collaborative creation of articles, reports, or marketing materials |
|
||||
| **Decision workflows** | [Flows](/guides/flows/first-flow) | When you need predictable, auditable decision paths with precise control |
|
||||
| **API orchestration** | [Flows](/guides/flows/first-flow) | For reliable integration with multiple external services in a specific sequence |
|
||||
| **Hybrid applications** | Combined approach | Use [Flows](/guides/flows/first-flow) to orchestrate overall process with [Crews](/guides/crews/first-crew) handling complex subtasks |
|
||||
| **Open-ended research** | [Crews](/en/guides/crews/first-crew) | When tasks require creative thinking, exploration, and adaptation |
|
||||
| **Content generation** | [Crews](/en/guides/crews/first-crew) | For collaborative creation of articles, reports, or marketing materials |
|
||||
| **Decision workflows** | [Flows](/en/guides/flows/first-flow) | When you need predictable, auditable decision paths with precise control |
|
||||
| **API orchestration** | [Flows](/en/guides/flows/first-flow) | For reliable integration with multiple external services in a specific sequence |
|
||||
| **Hybrid applications** | Combined approach | Use [Flows](/en/guides/flows/first-flow) to orchestrate overall process with [Crews](/en/guides/crews/first-crew) handling complex subtasks |
|
||||
|
||||
### Decision Framework
|
||||
|
||||
- **Choose [Crews](/guides/crews/first-crew) when:** You need autonomous problem-solving, creative collaboration, or exploratory tasks
|
||||
- **Choose [Flows](/guides/flows/first-flow) when:** You require deterministic outcomes, auditability, or precise control over execution
|
||||
- **Choose [Crews](/en/guides/crews/first-crew) when:** You need autonomous problem-solving, creative collaboration, or exploratory tasks
|
||||
- **Choose [Flows](/en/guides/flows/first-flow) when:** You require deterministic outcomes, auditability, or precise control over execution
|
||||
- **Combine both when:** Your application needs both structured processes and pockets of autonomous intelligence
|
||||
|
||||
## Why Choose CrewAI?
|
||||
@@ -126,14 +126,14 @@ With over 100,000 developers certified through our community courses, CrewAI is
|
||||
<Card
|
||||
title="Build Your First Crew"
|
||||
icon="users-gear"
|
||||
href="/guides/crews/first-crew"
|
||||
href="/en/guides/crews/first-crew"
|
||||
>
|
||||
Step-by-step tutorial to create a collaborative AI team that works together to solve complex problems.
|
||||
</Card>
|
||||
<Card
|
||||
title="Build Your First Flow"
|
||||
icon="diagram-project"
|
||||
href="/guides/flows/first-flow"
|
||||
href="/en/guides/flows/first-flow"
|
||||
>
|
||||
Learn how to create structured, event-driven workflows with precise control over execution.
|
||||
</Card>
|
||||
@@ -143,14 +143,14 @@ With over 100,000 developers certified through our community courses, CrewAI is
|
||||
<Card
|
||||
title="Install CrewAI"
|
||||
icon="wrench"
|
||||
href="/installation"
|
||||
href="/en/installation"
|
||||
>
|
||||
Get started with CrewAI in your development environment.
|
||||
</Card>
|
||||
<Card
|
||||
title="Quick Start"
|
||||
icon="bolt"
|
||||
href="/quickstart"
|
||||
href="en/quickstart"
|
||||
>
|
||||
Follow our quickstart guide to create your first CrewAI agent and get hands-on experience.
|
||||
</Card>
|
||||
@@ -161,4 +161,4 @@ With over 100,000 developers certified through our community courses, CrewAI is
|
||||
>
|
||||
Connect with other developers, get help, and share your CrewAI experiences.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
</CardGroup>
|
||||
@@ -34,6 +34,7 @@ LiteLLM supports a wide range of providers, including but not limited to:
|
||||
- DeepInfra
|
||||
- Groq
|
||||
- SambaNova
|
||||
- Nebius AI Studio
|
||||
- [NVIDIA NIMs](https://docs.api.nvidia.com/nim/reference/models-1)
|
||||
- And many more!
|
||||
|
||||
@@ -12,38 +12,38 @@ This section provides comprehensive guides and tutorials to help you master Crew
|
||||
|
||||
### Core Concepts
|
||||
<CardGroup cols={2}>
|
||||
<Card title="Sequential Process" icon="list-ol" href="/learn/sequential-process">
|
||||
<Card title="Sequential Process" icon="list-ol" href="/en/learn/sequential-process">
|
||||
Learn how to execute tasks in a sequential order for structured workflows.
|
||||
</Card>
|
||||
|
||||
<Card title="Hierarchical Process" icon="sitemap" href="/learn/hierarchical-process">
|
||||
<Card title="Hierarchical Process" icon="sitemap" href="/en/learn/hierarchical-process">
|
||||
Implement hierarchical task execution with manager agents overseeing workflows.
|
||||
</Card>
|
||||
|
||||
<Card title="Conditional Tasks" icon="code-branch" href="/learn/conditional-tasks">
|
||||
<Card title="Conditional Tasks" icon="code-branch" href="/en/learn/conditional-tasks">
|
||||
Create dynamic workflows with conditional task execution based on outcomes.
|
||||
</Card>
|
||||
|
||||
<Card title="Async Kickoff" icon="bolt" href="/learn/kickoff-async">
|
||||
<Card title="Async Kickoff" icon="bolt" href="/en/learn/kickoff-async">
|
||||
Execute crews asynchronously for improved performance and concurrency.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
### Agent Development
|
||||
<CardGroup cols={2}>
|
||||
<Card title="Customizing Agents" icon="user-gear" href="/learn/customizing-agents">
|
||||
<Card title="Customizing Agents" icon="user-gear" href="/en/learn/customizing-agents">
|
||||
Learn how to customize agent behavior, roles, and capabilities.
|
||||
</Card>
|
||||
|
||||
<Card title="Coding Agents" icon="code" href="/learn/coding-agents">
|
||||
<Card title="Coding Agents" icon="code" href="/en/learn/coding-agents">
|
||||
Build agents that can write, execute, and debug code automatically.
|
||||
</Card>
|
||||
|
||||
<Card title="Multimodal Agents" icon="images" href="/learn/multimodal-agents">
|
||||
<Card title="Multimodal Agents" icon="images" href="/en/learn/multimodal-agents">
|
||||
Create agents that can process text, images, and other media types.
|
||||
</Card>
|
||||
|
||||
<Card title="Custom Manager Agent" icon="user-tie" href="/learn/custom-manager-agent">
|
||||
<Card title="Custom Manager Agent" icon="user-tie" href="/en/learn/custom-manager-agent">
|
||||
Implement custom manager agents for complex hierarchical workflows.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
@@ -52,38 +52,38 @@ This section provides comprehensive guides and tutorials to help you master Crew
|
||||
|
||||
### Workflow Control
|
||||
<CardGroup cols={2}>
|
||||
<Card title="Human in the Loop" icon="user-check" href="/learn/human-in-the-loop">
|
||||
<Card title="Human in the Loop" icon="user-check" href="/en/learn/human-in-the-loop">
|
||||
Integrate human oversight and intervention into agent workflows.
|
||||
</Card>
|
||||
|
||||
<Card title="Human Input on Execution" icon="hand-paper" href="/learn/human-input-on-execution">
|
||||
<Card title="Human Input on Execution" icon="hand-paper" href="/en/learn/human-input-on-execution">
|
||||
Allow human input during task execution for dynamic decision making.
|
||||
</Card>
|
||||
|
||||
<Card title="Replay Tasks" icon="rotate-left" href="/learn/replay-tasks-from-latest-crew-kickoff">
|
||||
<Card title="Replay Tasks" icon="rotate-left" href="/en/learn/replay-tasks-from-latest-crew-kickoff">
|
||||
Replay and resume tasks from previous crew executions.
|
||||
</Card>
|
||||
|
||||
<Card title="Kickoff for Each" icon="repeat" href="/learn/kickoff-for-each">
|
||||
<Card title="Kickoff for Each" icon="repeat" href="/en/learn/kickoff-for-each">
|
||||
Execute crews multiple times with different inputs efficiently.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
### Customization & Integration
|
||||
<CardGroup cols={2}>
|
||||
<Card title="Custom LLM" icon="brain" href="/learn/custom-llm">
|
||||
<Card title="Custom LLM" icon="brain" href="/en/learn/custom-llm">
|
||||
Integrate custom language models and providers with CrewAI.
|
||||
</Card>
|
||||
|
||||
<Card title="LLM Connections" icon="link" href="/learn/llm-connections">
|
||||
<Card title="LLM Connections" icon="link" href="/en/learn/llm-connections">
|
||||
Configure and manage connections to various LLM providers.
|
||||
</Card>
|
||||
|
||||
<Card title="Create Custom Tools" icon="wrench" href="/learn/create-custom-tools">
|
||||
<Card title="Create Custom Tools" icon="wrench" href="/en/learn/create-custom-tools">
|
||||
Build custom tools to extend agent capabilities.
|
||||
</Card>
|
||||
|
||||
<Card title="Using Annotations" icon="at" href="/learn/using-annotations">
|
||||
<Card title="Using Annotations" icon="at" href="/en/learn/using-annotations">
|
||||
Use Python annotations for cleaner, more maintainable code.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
@@ -92,18 +92,18 @@ This section provides comprehensive guides and tutorials to help you master Crew
|
||||
|
||||
### Content & Media
|
||||
<CardGroup cols={2}>
|
||||
<Card title="DALL-E Image Generation" icon="image" href="/learn/dalle-image-generation">
|
||||
<Card title="DALL-E Image Generation" icon="image" href="/en/learn/dalle-image-generation">
|
||||
Generate images using DALL-E integration with your agents.
|
||||
</Card>
|
||||
|
||||
<Card title="Bring Your Own Agent" icon="user-plus" href="/learn/bring-your-own-agent">
|
||||
<Card title="Bring Your Own Agent" icon="user-plus" href="/en/learn/bring-your-own-agent">
|
||||
Integrate existing agents and models into CrewAI workflows.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
### Tool Management
|
||||
<CardGroup cols={2}>
|
||||
<Card title="Force Tool Output as Result" icon="hammer" href="/learn/force-tool-output-as-result">
|
||||
<Card title="Force Tool Output as Result" icon="hammer" href="/en/learn/force-tool-output-as-result">
|
||||
Configure tools to return their output directly as task results.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
@@ -155,4 +155,4 @@ This section provides comprehensive guides and tutorials to help you master Crew
|
||||
- **Examples**: Check the Examples section for complete working implementations
|
||||
- **Support**: Contact [support@crewai.com](mailto:support@crewai.com) for technical assistance
|
||||
|
||||
Start with the guides that match your current needs and gradually explore more advanced topics as you become comfortable with the fundamentals.
|
||||
Start with the guides that match your current needs and gradually explore more advanced topics as you become comfortable with the fundamentals.
|
||||
@@ -6,11 +6,11 @@ icon: plug
|
||||
|
||||
## Overview
|
||||
|
||||
The [Model Context Protocol](https://modelcontextprotocol.io/introduction) (MCP) provides a standardized way for AI agents to provide context to LLMs by communicating with external services, known as MCP Servers.
|
||||
The `crewai-tools` library extends CrewAI's capabilities by allowing you to seamlessly integrate tools from these MCP servers into your agents.
|
||||
This gives your crews access to a vast ecosystem of functionalities.
|
||||
The [Model Context Protocol](https://modelcontextprotocol.io/introduction) (MCP) provides a standardized way for AI agents to provide context to LLMs by communicating with external services, known as MCP Servers.
|
||||
The `crewai-tools` library extends CrewAI's capabilities by allowing you to seamlessly integrate tools from these MCP servers into your agents.
|
||||
This gives your crews access to a vast ecosystem of functionalities.
|
||||
|
||||
We currently support the following transport mechanisms:
|
||||
We currently support the following transport mechanisms:
|
||||
|
||||
- **Stdio**: for local servers (communication via standard input/output between processes on the same machine)
|
||||
- **Server-Sent Events (SSE)**: for remote servers (unidirectional, real-time data streaming from server to client over HTTP)
|
||||
@@ -44,6 +44,19 @@ The `MCPServerAdapter` class from `crewai-tools` is the primary way to connect t
|
||||
|
||||
Using a Python context manager (`with` statement) is the **recommended approach** for `MCPServerAdapter`. It automatically handles starting and stopping the connection to the MCP server.
|
||||
|
||||
## Connection Configuration
|
||||
|
||||
The `MCPServerAdapter` supports several configuration options to customize the connection behavior:
|
||||
|
||||
- **`connect_timeout`** (optional): Maximum time in seconds to wait for establishing a connection to the MCP server. Defaults to 30 seconds if not specified. This is particularly useful for remote servers that may have variable response times.
|
||||
|
||||
```python
|
||||
# Example with custom connection timeout
|
||||
with MCPServerAdapter(server_params, connect_timeout=60) as tools:
|
||||
# Connection will timeout after 60 seconds if not established
|
||||
pass
|
||||
```
|
||||
|
||||
```python
|
||||
from crewai import Agent
|
||||
from crewai_tools import MCPServerAdapter
|
||||
@@ -52,27 +65,27 @@ from mcp import StdioServerParameters # For Stdio Server
|
||||
# Example server_params (choose one based on your server type):
|
||||
# 1. Stdio Server:
|
||||
server_params=StdioServerParameters(
|
||||
command="python3",
|
||||
command="python3",
|
||||
args=["servers/your_server.py"],
|
||||
env={"UV_PYTHON": "3.12", **os.environ},
|
||||
)
|
||||
|
||||
# 2. SSE Server:
|
||||
server_params = {
|
||||
"url": "http://localhost:8000/sse",
|
||||
"url": "http://localhost:8000/sse",
|
||||
"transport": "sse"
|
||||
}
|
||||
|
||||
# 3. Streamable HTTP Server:
|
||||
server_params = {
|
||||
"url": "http://localhost:8001/mcp",
|
||||
"url": "http://localhost:8001/mcp",
|
||||
"transport": "streamable-http"
|
||||
}
|
||||
|
||||
# Example usage (uncomment and adapt once server_params is set):
|
||||
with MCPServerAdapter(server_params) as mcp_tools:
|
||||
with MCPServerAdapter(server_params, connect_timeout=60) as mcp_tools:
|
||||
print(f"Available tools: {[tool.name for tool in mcp_tools]}")
|
||||
|
||||
|
||||
my_agent = Agent(
|
||||
role="MCP Tool User",
|
||||
goal="Utilize tools from an MCP server.",
|
||||
@@ -85,45 +98,132 @@ with MCPServerAdapter(server_params) as mcp_tools:
|
||||
```
|
||||
This general pattern shows how to integrate tools. For specific examples tailored to each transport, refer to the detailed guides below.
|
||||
|
||||
## Filtering Tools
|
||||
|
||||
There are two ways to filter tools:
|
||||
|
||||
1. Accessing a specific tool using dictionary-style indexing.
|
||||
2. Pass a list of tool names to the `MCPServerAdapter` constructor.
|
||||
|
||||
### Accessing a specific tool using dictionary-style indexing.
|
||||
|
||||
```python
|
||||
with MCPServerAdapter(server_params, connect_timeout=60) as mcp_tools:
|
||||
print(f"Available tools: {[tool.name for tool in mcp_tools]}")
|
||||
|
||||
my_agent = Agent(
|
||||
role="MCP Tool User",
|
||||
goal="Utilize tools from an MCP server.",
|
||||
backstory="I can connect to MCP servers and use their tools.",
|
||||
tools=[mcp_tools["tool_name"]], # Pass the loaded tools to your agent
|
||||
reasoning=True,
|
||||
verbose=True
|
||||
)
|
||||
# ... rest of your crew setup ...
|
||||
```
|
||||
|
||||
### Pass a list of tool names to the `MCPServerAdapter` constructor.
|
||||
|
||||
```python
|
||||
with MCPServerAdapter(server_params, "tool_name", connect_timeout=60) as mcp_tools:
|
||||
print(f"Available tools: {[tool.name for tool in mcp_tools]}")
|
||||
|
||||
my_agent = Agent(
|
||||
role="MCP Tool User",
|
||||
goal="Utilize tools from an MCP server.",
|
||||
backstory="I can connect to MCP servers and use their tools.",
|
||||
tools=mcp_tools, # Pass the loaded tools to your agent
|
||||
reasoning=True,
|
||||
verbose=True
|
||||
)
|
||||
# ... rest of your crew setup ...
|
||||
```
|
||||
|
||||
## Using with CrewBase
|
||||
|
||||
To use MCPServer tools within a CrewBase class, use the `mcp_tools` method. Server configurations should be provided via the mcp_server_params attribute. You can pass either a single configuration or a list of multiple server configurations.
|
||||
|
||||
```python
|
||||
@CrewBase
|
||||
class CrewWithMCP:
|
||||
# ... define your agents and tasks config file ...
|
||||
|
||||
mcp_server_params = [
|
||||
# Streamable HTTP Server
|
||||
{
|
||||
"url": "http://localhost:8001/mcp",
|
||||
"transport": "streamable-http"
|
||||
},
|
||||
# SSE Server
|
||||
{
|
||||
"url": "http://localhost:8000/sse",
|
||||
"transport": "sse"
|
||||
},
|
||||
# StdIO Server
|
||||
StdioServerParameters(
|
||||
command="python3",
|
||||
args=["servers/your_stdio_server.py"],
|
||||
env={"UV_PYTHON": "3.12", **os.environ},
|
||||
)
|
||||
]
|
||||
|
||||
@agent
|
||||
def your_agent(self):
|
||||
return Agent(config=self.agents_config["your_agent"], tools=self.get_mcp_tools()) # get all available tools
|
||||
|
||||
# ... rest of your crew setup ...
|
||||
```
|
||||
|
||||
You can filter which tools are available to your agent by passing a list of tool names to the `get_mcp_tools` method.
|
||||
|
||||
```python
|
||||
@agent
|
||||
def another_agent(self):
|
||||
return Agent(
|
||||
config=self.agents_config["your_agent"],
|
||||
tools=self.get_mcp_tools("tool_1", "tool_2") # get specific tools
|
||||
)
|
||||
```
|
||||
|
||||
## Explore MCP Integrations
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card
|
||||
title="Stdio Transport"
|
||||
icon="server"
|
||||
href="/mcp/stdio"
|
||||
<Card
|
||||
title="Stdio Transport"
|
||||
icon="server"
|
||||
href="/en/mcp/stdio"
|
||||
color="#3B82F6"
|
||||
>
|
||||
Connect to local MCP servers via standard input/output. Ideal for scripts and local executables.
|
||||
</Card>
|
||||
<Card
|
||||
title="SSE Transport"
|
||||
icon="wifi"
|
||||
href="/mcp/sse"
|
||||
<Card
|
||||
title="SSE Transport"
|
||||
icon="wifi"
|
||||
href="/en/mcp/sse"
|
||||
color="#10B981"
|
||||
>
|
||||
Integrate with remote MCP servers using Server-Sent Events for real-time data streaming.
|
||||
</Card>
|
||||
<Card
|
||||
title="Streamable HTTP Transport"
|
||||
icon="globe"
|
||||
href="/mcp/streamable-http"
|
||||
<Card
|
||||
title="Streamable HTTP Transport"
|
||||
icon="globe"
|
||||
href="/en/mcp/streamable-http"
|
||||
color="#F59E0B"
|
||||
>
|
||||
Utilize flexible Streamable HTTP for robust communication with remote MCP servers.
|
||||
</Card>
|
||||
<Card
|
||||
title="Connecting to Multiple Servers"
|
||||
icon="layer-group"
|
||||
href="/mcp/multiple-servers"
|
||||
<Card
|
||||
title="Connecting to Multiple Servers"
|
||||
icon="layer-group"
|
||||
href="/en/mcp/multiple-servers"
|
||||
color="#8B5CF6"
|
||||
>
|
||||
Aggregate tools from several MCP servers simultaneously using a single adapter.
|
||||
</Card>
|
||||
<Card
|
||||
title="Security Considerations"
|
||||
icon="lock"
|
||||
href="/mcp/security"
|
||||
<Card
|
||||
title="Security Considerations"
|
||||
icon="lock"
|
||||
href="/en/mcp/security"
|
||||
color="#EF4444"
|
||||
>
|
||||
Review important security best practices for MCP integration to keep your agents safe.
|
||||
@@ -132,7 +232,7 @@ This general pattern shows how to integrate tools. For specific examples tailore
|
||||
|
||||
Checkout this repository for full demos and examples of MCP integration with CrewAI! 👇
|
||||
|
||||
<Card
|
||||
<Card
|
||||
title="GitHub Repository"
|
||||
icon="github"
|
||||
href="https://github.com/tonykipkemboi/crewai-mcp-demo"
|
||||
@@ -147,7 +247,7 @@ Always ensure that you trust an MCP Server before using it.
|
||||
</Warning>
|
||||
|
||||
#### Security Warning: DNS Rebinding Attacks
|
||||
SSE transports can be vulnerable to DNS rebinding attacks if not properly secured.
|
||||
SSE transports can be vulnerable to DNS rebinding attacks if not properly secured.
|
||||
To prevent this:
|
||||
|
||||
1. **Always validate Origin headers** on incoming SSE connections to ensure they come from expected sources
|
||||
@@ -159,6 +259,6 @@ Without these protections, attackers could use DNS rebinding to interact with lo
|
||||
For more details, see the [Anthropic's MCP Transport Security docs](https://modelcontextprotocol.io/docs/concepts/transports#security-considerations).
|
||||
|
||||
### Limitations
|
||||
* **Supported Primitives**: Currently, `MCPServerAdapter` primarily supports adapting MCP `tools`.
|
||||
* **Supported Primitives**: Currently, `MCPServerAdapter` primarily supports adapting MCP `tools`.
|
||||
Other MCP primitives like `prompts` or `resources` are not directly integrated as CrewAI components through this adapter at this time.
|
||||
* **Output Handling**: The adapter typically processes the primary text output from an MCP tool (e.g., `.content[0].text`). Complex or multi-modal outputs might require custom handling if not fitting this pattern.
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user