Compare commits
46 Commits
devin/1753
...
0.165.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6068fe941f | ||
|
|
2a0cefc98b | ||
|
|
a4f65e4870 | ||
|
|
a1b3edd79c | ||
|
|
80b3d9689a | ||
|
|
ec03a53121 | ||
|
|
2fdf3f3a6a | ||
|
|
1d3d7ebf5e | ||
|
|
2c2196f415 | ||
|
|
c9f30b175c | ||
|
|
a17b93a7f8 | ||
|
|
0d3e462791 | ||
|
|
947c9552f0 | ||
|
|
04a03d332f | ||
|
|
992e093610 | ||
|
|
07f8e73958 | ||
|
|
66c2fa1623 | ||
|
|
7a52cc9667 | ||
|
|
8b686fb0c6 | ||
|
|
dc6771ae95 | ||
|
|
e9b1e5a8f6 | ||
|
|
57c787f919 | ||
|
|
a0eadf783b | ||
|
|
251ae00b8b | ||
|
|
a221295394 | ||
|
|
a92211f0ba | ||
|
|
f9481cf10d | ||
|
|
915857541e | ||
|
|
7c162411b7 | ||
|
|
8f4a6cc61c | ||
|
|
7dc86dc79a | ||
|
|
7ce20cfcc6 | ||
|
|
1d9523c98f | ||
|
|
9f1d7d1aa9 | ||
|
|
79b375f6fa | ||
|
|
75752479c2 | ||
|
|
477bc1f09e | ||
|
|
66567bdc2f | ||
|
|
0b31bbe957 | ||
|
|
246cf588cd | ||
|
|
88ed91561f | ||
|
|
9a347ad458 | ||
|
|
34c3075fdb | ||
|
|
498e8dc6e8 | ||
|
|
cb522cf500 | ||
|
|
017acc74f5 |
1
.gitignore
vendored
@@ -21,7 +21,6 @@ crew_tasks_output.json
|
||||
.mypy_cache
|
||||
.ruff_cache
|
||||
.venv
|
||||
agentops.log
|
||||
test_flow.html
|
||||
crewairules.mdc
|
||||
plan.md
|
||||
|
||||
386
docs/docs.json
@@ -128,7 +128,9 @@
|
||||
"en/tools/file-document/jsonsearchtool",
|
||||
"en/tools/file-document/csvsearchtool",
|
||||
"en/tools/file-document/directorysearchtool",
|
||||
"en/tools/file-document/directoryreadtool"
|
||||
"en/tools/file-document/directoryreadtool",
|
||||
"en/tools/file-document/ocrtool",
|
||||
"en/tools/file-document/pdf-text-writing-tool"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -146,7 +148,8 @@
|
||||
"en/tools/web-scraping/stagehandtool",
|
||||
"en/tools/web-scraping/firecrawlcrawlwebsitetool",
|
||||
"en/tools/web-scraping/firecrawlscrapewebsitetool",
|
||||
"en/tools/web-scraping/oxylabsscraperstool"
|
||||
"en/tools/web-scraping/oxylabsscraperstool",
|
||||
"en/tools/web-scraping/brightdata-tools"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -163,7 +166,11 @@
|
||||
"en/tools/search-research/youtubechannelsearchtool",
|
||||
"en/tools/search-research/youtubevideosearchtool",
|
||||
"en/tools/search-research/tavilysearchtool",
|
||||
"en/tools/search-research/tavilyextractortool"
|
||||
"en/tools/search-research/tavilyextractortool",
|
||||
"en/tools/search-research/arxivpapertool",
|
||||
"en/tools/search-research/serpapi-googlesearchtool",
|
||||
"en/tools/search-research/serpapi-googleshoppingtool",
|
||||
"en/tools/search-research/databricks-query-tool"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -175,7 +182,9 @@
|
||||
"en/tools/database-data/snowflakesearchtool",
|
||||
"en/tools/database-data/nl2sqltool",
|
||||
"en/tools/database-data/qdrantvectorsearchtool",
|
||||
"en/tools/database-data/weaviatevectorsearchtool"
|
||||
"en/tools/database-data/weaviatevectorsearchtool",
|
||||
"en/tools/database-data/mongodbvectorsearchtool",
|
||||
"en/tools/database-data/singlestoresearchtool"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -207,7 +216,8 @@
|
||||
"en/tools/automation/overview",
|
||||
"en/tools/automation/apifyactorstool",
|
||||
"en/tools/automation/composiotool",
|
||||
"en/tools/automation/multiontool"
|
||||
"en/tools/automation/multiontool",
|
||||
"en/tools/automation/zapieractionstool"
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -216,8 +226,8 @@
|
||||
"group": "Observability",
|
||||
"pages": [
|
||||
"en/observability/overview",
|
||||
"en/observability/agentops",
|
||||
"en/observability/arize-phoenix",
|
||||
"en/observability/langdb",
|
||||
"en/observability/langfuse",
|
||||
"en/observability/langtrace",
|
||||
"en/observability/maxim",
|
||||
@@ -227,7 +237,8 @@
|
||||
"en/observability/opik",
|
||||
"en/observability/patronus-evaluation",
|
||||
"en/observability/portkey",
|
||||
"en/observability/weave"
|
||||
"en/observability/weave",
|
||||
"en/observability/truefoundry"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -270,6 +281,7 @@
|
||||
{
|
||||
"group": "Features",
|
||||
"pages": [
|
||||
"en/enterprise/features/rbac",
|
||||
"en/enterprise/features/tool-repository",
|
||||
"en/enterprise/features/webhook-streaming",
|
||||
"en/enterprise/features/traces",
|
||||
@@ -333,7 +345,7 @@
|
||||
},
|
||||
{
|
||||
"group": "Endpoints",
|
||||
"openapi": "enterprise-api.yaml"
|
||||
"openapi": "https://raw.githubusercontent.com/crewAIInc/crewAI/main/docs/enterprise-api.en.yaml"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -342,7 +354,7 @@
|
||||
"groups": [
|
||||
{
|
||||
"group": "Examples",
|
||||
"pages": ["en/examples/example"]
|
||||
"pages": ["en/examples/example", "en/examples/cookbooks"]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -553,8 +565,8 @@
|
||||
"group": "Observabilidade",
|
||||
"pages": [
|
||||
"pt-BR/observability/overview",
|
||||
"pt-BR/observability/agentops",
|
||||
"pt-BR/observability/arize-phoenix",
|
||||
"pt-BR/observability/langdb",
|
||||
"pt-BR/observability/langfuse",
|
||||
"pt-BR/observability/langtrace",
|
||||
"pt-BR/observability/maxim",
|
||||
@@ -563,7 +575,8 @@
|
||||
"pt-BR/observability/opik",
|
||||
"pt-BR/observability/patronus-evaluation",
|
||||
"pt-BR/observability/portkey",
|
||||
"pt-BR/observability/weave"
|
||||
"pt-BR/observability/weave",
|
||||
"pt-BR/observability/truefoundry"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -606,6 +619,7 @@
|
||||
{
|
||||
"group": "Funcionalidades",
|
||||
"pages": [
|
||||
"pt-BR/enterprise/features/rbac",
|
||||
"pt-BR/enterprise/features/tool-repository",
|
||||
"pt-BR/enterprise/features/webhook-streaming",
|
||||
"pt-BR/enterprise/features/traces",
|
||||
@@ -670,7 +684,7 @@
|
||||
},
|
||||
{
|
||||
"group": "Endpoints",
|
||||
"openapi": "enterprise-api.yaml"
|
||||
"openapi": "https://raw.githubusercontent.com/crewAIInc/crewAI/main/docs/enterprise-api.pt-BR.yaml"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -679,7 +693,353 @@
|
||||
"groups": [
|
||||
{
|
||||
"group": "Exemplos",
|
||||
"pages": ["pt-BR/examples/example"]
|
||||
"pages": ["pt-BR/examples/example", "pt-BR/examples/cookbooks"]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"language": "ko",
|
||||
"global": {
|
||||
"anchors": [
|
||||
{
|
||||
"anchor": "웹사이트",
|
||||
"href": "https://crewai.com",
|
||||
"icon": "globe"
|
||||
},
|
||||
{
|
||||
"anchor": "포럼",
|
||||
"href": "https://community.crewai.com",
|
||||
"icon": "discourse"
|
||||
},
|
||||
{
|
||||
"anchor": "Crew GPT",
|
||||
"href": "https://chatgpt.com/g/g-qqTuUWsBY-crewai-assistant",
|
||||
"icon": "robot"
|
||||
},
|
||||
{
|
||||
"anchor": "릴리스",
|
||||
"href": "https://github.com/crewAIInc/crewAI/releases",
|
||||
"icon": "tag"
|
||||
}
|
||||
]
|
||||
},
|
||||
"tabs": [
|
||||
{
|
||||
"tab": "기술 문서",
|
||||
"groups": [
|
||||
{
|
||||
"group": "시작 안내",
|
||||
"pages": ["ko/introduction", "ko/installation", "ko/quickstart"]
|
||||
},
|
||||
{
|
||||
"group": "가이드",
|
||||
"pages": [
|
||||
{
|
||||
"group": "전략",
|
||||
"pages": ["ko/guides/concepts/evaluating-use-cases"]
|
||||
},
|
||||
{
|
||||
"group": "에이전트 (Agents)",
|
||||
"pages": ["ko/guides/agents/crafting-effective-agents"]
|
||||
},
|
||||
{
|
||||
"group": "크루 (Crews)",
|
||||
"pages": ["ko/guides/crews/first-crew"]
|
||||
},
|
||||
{
|
||||
"group": "플로우 (Flows)",
|
||||
"pages": [
|
||||
"ko/guides/flows/first-flow",
|
||||
"ko/guides/flows/mastering-flow-state"
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "고급",
|
||||
"pages": [
|
||||
"ko/guides/advanced/customizing-prompts",
|
||||
"ko/guides/advanced/fingerprinting"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "핵심 개념",
|
||||
"pages": [
|
||||
"ko/concepts/agents",
|
||||
"ko/concepts/tasks",
|
||||
"ko/concepts/crews",
|
||||
"ko/concepts/flows",
|
||||
"ko/concepts/knowledge",
|
||||
"ko/concepts/llms",
|
||||
"ko/concepts/processes",
|
||||
"ko/concepts/collaboration",
|
||||
"ko/concepts/training",
|
||||
"ko/concepts/memory",
|
||||
"ko/concepts/reasoning",
|
||||
"ko/concepts/planning",
|
||||
"ko/concepts/testing",
|
||||
"ko/concepts/cli",
|
||||
"ko/concepts/tools",
|
||||
"ko/concepts/event-listener"
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "MCP 통합",
|
||||
"pages": [
|
||||
"ko/mcp/overview",
|
||||
"ko/mcp/stdio",
|
||||
"ko/mcp/sse",
|
||||
"ko/mcp/streamable-http",
|
||||
"ko/mcp/multiple-servers",
|
||||
"ko/mcp/security"
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "도구 (Tools)",
|
||||
"pages": [
|
||||
"ko/tools/overview",
|
||||
{
|
||||
"group": "파일 & 문서",
|
||||
"pages": [
|
||||
"ko/tools/file-document/overview",
|
||||
"ko/tools/file-document/filereadtool",
|
||||
"ko/tools/file-document/filewritetool",
|
||||
"ko/tools/file-document/pdfsearchtool",
|
||||
"ko/tools/file-document/docxsearchtool",
|
||||
"ko/tools/file-document/mdxsearchtool",
|
||||
"ko/tools/file-document/xmlsearchtool",
|
||||
"ko/tools/file-document/txtsearchtool",
|
||||
"ko/tools/file-document/jsonsearchtool",
|
||||
"ko/tools/file-document/csvsearchtool",
|
||||
"ko/tools/file-document/directorysearchtool",
|
||||
"ko/tools/file-document/directoryreadtool",
|
||||
"ko/tools/file-document/ocrtool",
|
||||
"ko/tools/file-document/pdf-text-writing-tool"
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "웹 스크래핑 & 브라우징",
|
||||
"pages": [
|
||||
"ko/tools/web-scraping/overview",
|
||||
"ko/tools/web-scraping/scrapewebsitetool",
|
||||
"ko/tools/web-scraping/scrapeelementfromwebsitetool",
|
||||
"ko/tools/web-scraping/scrapflyscrapetool",
|
||||
"ko/tools/web-scraping/seleniumscrapingtool",
|
||||
"ko/tools/web-scraping/scrapegraphscrapetool",
|
||||
"ko/tools/web-scraping/spidertool",
|
||||
"ko/tools/web-scraping/browserbaseloadtool",
|
||||
"ko/tools/web-scraping/hyperbrowserloadtool",
|
||||
"ko/tools/web-scraping/stagehandtool",
|
||||
"ko/tools/web-scraping/firecrawlcrawlwebsitetool",
|
||||
"ko/tools/web-scraping/firecrawlscrapewebsitetool",
|
||||
"ko/tools/web-scraping/oxylabsscraperstool",
|
||||
"ko/tools/web-scraping/brightdata-tools"
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "검색 및 연구",
|
||||
"pages": [
|
||||
"ko/tools/search-research/overview",
|
||||
"ko/tools/search-research/serperdevtool",
|
||||
"ko/tools/search-research/bravesearchtool",
|
||||
"ko/tools/search-research/exasearchtool",
|
||||
"ko/tools/search-research/linkupsearchtool",
|
||||
"ko/tools/search-research/githubsearchtool",
|
||||
"ko/tools/search-research/websitesearchtool",
|
||||
"ko/tools/search-research/codedocssearchtool",
|
||||
"ko/tools/search-research/youtubechannelsearchtool",
|
||||
"ko/tools/search-research/youtubevideosearchtool",
|
||||
"ko/tools/search-research/tavilysearchtool",
|
||||
"ko/tools/search-research/tavilyextractortool",
|
||||
"ko/tools/search-research/arxivpapertool",
|
||||
"ko/tools/search-research/serpapi-googlesearchtool",
|
||||
"ko/tools/search-research/serpapi-googleshoppingtool",
|
||||
"ko/tools/search-research/databricks-query-tool"
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "데이터베이스 & 데이터",
|
||||
"pages": [
|
||||
"ko/tools/database-data/overview",
|
||||
"ko/tools/database-data/mysqltool",
|
||||
"ko/tools/database-data/pgsearchtool",
|
||||
"ko/tools/database-data/snowflakesearchtool",
|
||||
"ko/tools/database-data/nl2sqltool",
|
||||
"ko/tools/database-data/qdrantvectorsearchtool",
|
||||
"ko/tools/database-data/weaviatevectorsearchtool",
|
||||
"ko/tools/database-data/mongodbvectorsearchtool",
|
||||
"ko/tools/database-data/singlestoresearchtool"
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "인공지능 & 머신러닝",
|
||||
"pages": [
|
||||
"ko/tools/ai-ml/overview",
|
||||
"ko/tools/ai-ml/dalletool",
|
||||
"ko/tools/ai-ml/visiontool",
|
||||
"ko/tools/ai-ml/aimindtool",
|
||||
"ko/tools/ai-ml/llamaindextool",
|
||||
"ko/tools/ai-ml/langchaintool",
|
||||
"ko/tools/ai-ml/ragtool",
|
||||
"ko/tools/ai-ml/codeinterpretertool"
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "클라우드 & 스토리지",
|
||||
"pages": [
|
||||
"ko/tools/cloud-storage/overview",
|
||||
"ko/tools/cloud-storage/s3readertool",
|
||||
"ko/tools/cloud-storage/s3writertool",
|
||||
"ko/tools/cloud-storage/bedrockinvokeagenttool",
|
||||
"ko/tools/cloud-storage/bedrockkbretriever"
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "자동화 & 통합",
|
||||
"pages": [
|
||||
"ko/tools/automation/overview",
|
||||
"ko/tools/automation/apifyactorstool",
|
||||
"ko/tools/automation/composiotool",
|
||||
"ko/tools/automation/multiontool",
|
||||
"ko/tools/automation/zapieractionstool"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "Observability",
|
||||
"pages": [
|
||||
"ko/observability/overview",
|
||||
"ko/observability/arize-phoenix",
|
||||
"ko/observability/langdb",
|
||||
"ko/observability/langfuse",
|
||||
"ko/observability/langtrace",
|
||||
"ko/observability/maxim",
|
||||
"ko/observability/mlflow",
|
||||
"ko/observability/neatlogs",
|
||||
"ko/observability/openlit",
|
||||
"ko/observability/opik",
|
||||
"ko/observability/patronus-evaluation",
|
||||
"ko/observability/portkey",
|
||||
"ko/observability/weave"
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "학습",
|
||||
"pages": [
|
||||
"ko/learn/overview",
|
||||
"ko/learn/llm-selection-guide",
|
||||
"ko/learn/conditional-tasks",
|
||||
"ko/learn/coding-agents",
|
||||
"ko/learn/create-custom-tools",
|
||||
"ko/learn/custom-llm",
|
||||
"ko/learn/custom-manager-agent",
|
||||
"ko/learn/customizing-agents",
|
||||
"ko/learn/dalle-image-generation",
|
||||
"ko/learn/force-tool-output-as-result",
|
||||
"ko/learn/hierarchical-process",
|
||||
"ko/learn/human-input-on-execution",
|
||||
"ko/learn/kickoff-async",
|
||||
"ko/learn/kickoff-for-each",
|
||||
"ko/learn/llm-connections",
|
||||
"ko/learn/multimodal-agents",
|
||||
"ko/learn/replay-tasks-from-latest-crew-kickoff",
|
||||
"ko/learn/sequential-process",
|
||||
"ko/learn/using-annotations"
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "Telemetry",
|
||||
"pages": ["ko/telemetry"]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"tab": "엔터프라이즈",
|
||||
"groups": [
|
||||
{
|
||||
"group": "시작 안내",
|
||||
"pages": ["ko/enterprise/introduction"]
|
||||
},
|
||||
{
|
||||
"group": "특징",
|
||||
"pages": [
|
||||
"ko/enterprise/features/rbac",
|
||||
"ko/enterprise/features/tool-repository",
|
||||
"ko/enterprise/features/webhook-streaming",
|
||||
"ko/enterprise/features/traces",
|
||||
"ko/enterprise/features/hallucination-guardrail",
|
||||
"ko/enterprise/features/integrations",
|
||||
"ko/enterprise/features/agent-repositories"
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "통합 문서",
|
||||
"pages": [
|
||||
"ko/enterprise/integrations/asana",
|
||||
"ko/enterprise/integrations/box",
|
||||
"ko/enterprise/integrations/clickup",
|
||||
"ko/enterprise/integrations/github",
|
||||
"ko/enterprise/integrations/gmail",
|
||||
"ko/enterprise/integrations/google_calendar",
|
||||
"ko/enterprise/integrations/google_sheets",
|
||||
"ko/enterprise/integrations/hubspot",
|
||||
"ko/enterprise/integrations/jira",
|
||||
"ko/enterprise/integrations/linear",
|
||||
"ko/enterprise/integrations/notion",
|
||||
"ko/enterprise/integrations/salesforce",
|
||||
"ko/enterprise/integrations/shopify",
|
||||
"ko/enterprise/integrations/slack",
|
||||
"ko/enterprise/integrations/stripe",
|
||||
"ko/enterprise/integrations/zendesk"
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "How-To Guides",
|
||||
"pages": [
|
||||
"ko/enterprise/guides/build-crew",
|
||||
"ko/enterprise/guides/deploy-crew",
|
||||
"ko/enterprise/guides/kickoff-crew",
|
||||
"ko/enterprise/guides/update-crew",
|
||||
"ko/enterprise/guides/enable-crew-studio",
|
||||
"ko/enterprise/guides/azure-openai-setup",
|
||||
"ko/enterprise/guides/hubspot-trigger",
|
||||
"ko/enterprise/guides/react-component-export",
|
||||
"ko/enterprise/guides/salesforce-trigger",
|
||||
"ko/enterprise/guides/slack-trigger",
|
||||
"ko/enterprise/guides/team-management",
|
||||
"ko/enterprise/guides/webhook-automation",
|
||||
"ko/enterprise/guides/human-in-the-loop",
|
||||
"ko/enterprise/guides/zapier-trigger"
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "학습 자원",
|
||||
"pages": ["ko/enterprise/resources/frequently-asked-questions"]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"tab": "API 레퍼런스",
|
||||
"groups": [
|
||||
{
|
||||
"group": "시작 안내",
|
||||
"pages": ["ko/api-reference/introduction"]
|
||||
},
|
||||
{
|
||||
"group": "Endpoints",
|
||||
"openapi": "https://raw.githubusercontent.com/crewAIInc/crewAI/main/docs/enterprise-api.ko.yaml"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"tab": "예시",
|
||||
"groups": [
|
||||
{
|
||||
"group": "예시",
|
||||
"pages": ["ko/examples/example", "ko/examples/cookbooks"]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -88,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
|
||||
```
|
||||
|
||||
@@ -134,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
|
||||
```
|
||||
|
||||
@@ -151,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>
|
||||
|
||||
@@ -235,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).
|
||||
|
||||
@@ -309,3 +309,82 @@ When you select a provider, the CLI will prompt you to enter the Key name and th
|
||||
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>
|
||||
|
||||
@@ -20,8 +20,7 @@ A crew in crewAI represents a collaborative group of agents working together to
|
||||
| **Function Calling LLM** _(optional)_ | `function_calling_llm` | If passed, the crew will use this LLM to do function calling for tools for all agents in the crew. Each agent can have its own LLM, which overrides the crew's LLM for function calling. |
|
||||
| **Config** _(optional)_ | `config` | Optional configuration settings for the crew, in `Json` or `Dict[str, Any]` format. |
|
||||
| **Max RPM** _(optional)_ | `max_rpm` | Maximum requests per minute the crew adheres to during execution. Defaults to `None`. |
|
||||
| **Memory** _(optional)_ | `memory` | Utilized for storing execution memories (short-term, long-term, entity memory). |
|
||||
| **Memory Config** _(optional)_ | `memory_config` | Configuration for the memory provider to be used by the crew. |
|
||||
| **Memory** _(optional)_ | `memory` | Utilized for storing execution memories (short-term, long-term, entity memory). | |
|
||||
| **Cache** _(optional)_ | `cache` | Specifies whether to use a cache for storing the results of tools' execution. Defaults to `True`. |
|
||||
| **Embedder** _(optional)_ | `embedder` | Configuration for the embedder to be used by the crew. Mostly used by memory for now. Default is `{"provider": "openai"}`. |
|
||||
| **Step Callback** _(optional)_ | `step_callback` | A function that is called after each step of every agent. This can be used to log the agent's actions or to perform other operations; it won't override the agent-specific `step_callback`. |
|
||||
|
||||
@@ -177,14 +177,7 @@ class MyCustomCrew:
|
||||
# Your crew implementation...
|
||||
```
|
||||
|
||||
This is exactly how CrewAI's built-in `agentops_listener` is registered. In the CrewAI codebase, you'll find:
|
||||
|
||||
```python
|
||||
# src/crewai/utilities/events/third_party/__init__.py
|
||||
from .agentops_listener import agentops_listener
|
||||
```
|
||||
|
||||
This ensures the `agentops_listener` is loaded when the `crewai.utilities.events` package is imported.
|
||||
This is how third-party event listeners are registered in the CrewAI codebase.
|
||||
|
||||
## Available Event Types
|
||||
|
||||
@@ -280,77 +273,6 @@ The structure of the event object depends on the event type, but all events inhe
|
||||
|
||||
Additional fields vary by event type. For example, `CrewKickoffCompletedEvent` includes `crew_name` and `output` fields.
|
||||
|
||||
## Real-World Example: Integration with AgentOps
|
||||
|
||||
CrewAI includes an example of a third-party integration with [AgentOps](https://github.com/AgentOps-AI/agentops), a monitoring and observability platform for AI agents. Here's how it's implemented:
|
||||
|
||||
```python
|
||||
from typing import Optional
|
||||
|
||||
from crewai.utilities.events import (
|
||||
CrewKickoffCompletedEvent,
|
||||
ToolUsageErrorEvent,
|
||||
ToolUsageStartedEvent,
|
||||
)
|
||||
from crewai.utilities.events.base_event_listener import BaseEventListener
|
||||
from crewai.utilities.events.crew_events import CrewKickoffStartedEvent
|
||||
from crewai.utilities.events.task_events import TaskEvaluationEvent
|
||||
|
||||
try:
|
||||
import agentops
|
||||
AGENTOPS_INSTALLED = True
|
||||
except ImportError:
|
||||
AGENTOPS_INSTALLED = False
|
||||
|
||||
class AgentOpsListener(BaseEventListener):
|
||||
tool_event: Optional["agentops.ToolEvent"] = None
|
||||
session: Optional["agentops.Session"] = None
|
||||
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
|
||||
def setup_listeners(self, crewai_event_bus):
|
||||
if not AGENTOPS_INSTALLED:
|
||||
return
|
||||
|
||||
@crewai_event_bus.on(CrewKickoffStartedEvent)
|
||||
def on_crew_kickoff_started(source, event: CrewKickoffStartedEvent):
|
||||
self.session = agentops.init()
|
||||
for agent in source.agents:
|
||||
if self.session:
|
||||
self.session.create_agent(
|
||||
name=agent.role,
|
||||
agent_id=str(agent.id),
|
||||
)
|
||||
|
||||
@crewai_event_bus.on(CrewKickoffCompletedEvent)
|
||||
def on_crew_kickoff_completed(source, event: CrewKickoffCompletedEvent):
|
||||
if self.session:
|
||||
self.session.end_session(
|
||||
end_state="Success",
|
||||
end_state_reason="Finished Execution",
|
||||
)
|
||||
|
||||
@crewai_event_bus.on(ToolUsageStartedEvent)
|
||||
def on_tool_usage_started(source, event: ToolUsageStartedEvent):
|
||||
self.tool_event = agentops.ToolEvent(name=event.tool_name)
|
||||
if self.session:
|
||||
self.session.record(self.tool_event)
|
||||
|
||||
@crewai_event_bus.on(ToolUsageErrorEvent)
|
||||
def on_tool_usage_error(source, event: ToolUsageErrorEvent):
|
||||
agentops.ErrorEvent(exception=event.error, trigger_event=self.tool_event)
|
||||
```
|
||||
|
||||
This listener initializes an AgentOps session when a Crew starts, registers agents with AgentOps, tracks tool usage, and ends the session when the Crew completes.
|
||||
|
||||
The AgentOps listener is registered in CrewAI's event system through the import in `src/crewai/utilities/events/third_party/__init__.py`:
|
||||
|
||||
```python
|
||||
from .agentops_listener import agentops_listener
|
||||
```
|
||||
|
||||
This ensures the `agentops_listener` is loaded when the `crewai.utilities.events` package is imported.
|
||||
|
||||
## Advanced Usage: Scoped Handlers
|
||||
|
||||
|
||||
@@ -9,8 +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)
|
||||
3. **External Memory** - Standalone external memory providers (new approach)
|
||||
2. **External Memory** - Standalone external memory providers
|
||||
|
||||
## Memory System Components
|
||||
|
||||
@@ -19,7 +18,7 @@ The CrewAI framework provides a sophisticated memory system designed to signific
|
||||
| **Short-Term Memory**| Temporarily stores recent interactions and outcomes using `RAG`, enabling agents to recall and utilize information relevant to their current context during the current executions.|
|
||||
| **Long-Term Memory** | Preserves valuable insights and learnings from past executions, allowing agents to build and refine their knowledge over time. |
|
||||
| **Entity Memory** | Captures and organizes information about entities (people, places, concepts) encountered during tasks, facilitating deeper understanding and relationship mapping. Uses `RAG` for storing entity information. |
|
||||
| **Contextual Memory**| Maintains the context of interactions by combining `ShortTermMemory`, `LongTermMemory`, and `EntityMemory`, aiding in the coherence and relevance of agent responses over a sequence of tasks or a conversation. |
|
||||
| **Contextual Memory**| Maintains the context of interactions by combining `ShortTermMemory`, `LongTermMemory`, `ExternalMemory` and `EntityMemory`, aiding in the coherence and relevance of agent responses over a sequence of tasks or a conversation. |
|
||||
|
||||
## 1. Basic Memory System (Recommended)
|
||||
|
||||
@@ -202,7 +201,7 @@ crew = Crew(
|
||||
tasks=[task],
|
||||
memory=True,
|
||||
embedder={
|
||||
"provider": "anthropic", # Match your LLM provider
|
||||
"provider": "anthropic", # Match your LLM provider
|
||||
"config": {
|
||||
"api_key": "your-anthropic-key",
|
||||
"model": "text-embedding-3-small"
|
||||
@@ -540,16 +539,71 @@ crew = Crew(
|
||||
)
|
||||
```
|
||||
|
||||
### Mem0 Provider
|
||||
|
||||
Short-Term Memory and Entity Memory both supports a tight integration with both Mem0 OSS and Mem0 Client as a provider. Here is how you can use Mem0 as a provider.
|
||||
|
||||
```python
|
||||
from crewai.memory.short_term.short_term_memory import ShortTermMemory
|
||||
from crewai.memory.entity_entity_memory import EntityMemory
|
||||
|
||||
mem0_oss_embedder_config = {
|
||||
"provider": "mem0",
|
||||
"config": {
|
||||
"user_id": "john",
|
||||
"local_mem0_config": {
|
||||
"vector_store": {"provider": "qdrant","config": {"host": "localhost", "port": 6333}},
|
||||
"llm": {"provider": "openai","config": {"api_key": "your-api-key", "model": "gpt-4"}},
|
||||
"embedder": {"provider": "openai","config": {"api_key": "your-api-key", "model": "text-embedding-3-small"}}
|
||||
},
|
||||
"infer": True # Optional defaults to True
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
mem0_client_embedder_config = {
|
||||
"provider": "mem0",
|
||||
"config": {
|
||||
"user_id": "john",
|
||||
"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
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
short_term_memory_mem0_oss = ShortTermMemory(embedder_config=mem0_oss_embedder_config) # Short Term Memory with Mem0 OSS
|
||||
short_term_memory_mem0_client = ShortTermMemory(embedder_config=mem0_client_embedder_config) # Short Term Memory with Mem0 Client
|
||||
entity_memory_mem0_oss = EntityMemory(embedder_config=mem0_oss_embedder_config) # Entity Memory with Mem0 OSS
|
||||
entity_memory_mem0_client = EntityMemory(embedder_config=mem0_client_embedder_config) # Short Term Memory with Mem0 Client
|
||||
|
||||
crew = Crew(
|
||||
memory=True,
|
||||
short_term_memory=short_term_memory_mem0_oss, # or short_term_memory_mem0_client
|
||||
entity_memory=entity_memory_mem0_oss # or entity_memory_mem0_client
|
||||
)
|
||||
```
|
||||
|
||||
### Choosing the Right Embedding Provider
|
||||
|
||||
| Provider | Best For | Pros | Cons |
|
||||
|:---------|:----------|:------|:------|
|
||||
| **OpenAI** | General use, reliability | High quality, well-tested | Cost, requires API key |
|
||||
| **Ollama** | Privacy, cost savings | Free, local, private | Requires local setup |
|
||||
| **Google AI** | Google ecosystem | Good performance | Requires Google account |
|
||||
| **Azure OpenAI** | Enterprise, compliance | Enterprise features | Complex setup |
|
||||
| **Cohere** | Multilingual content | Great language support | Specialized use case |
|
||||
| **VoyageAI** | Retrieval tasks | Optimized for search | Newer provider |
|
||||
When selecting an embedding provider, consider factors like performance, privacy, cost, and integration needs.
|
||||
Below is a comparison to help you decide:
|
||||
|
||||
| Provider | Best For | Pros | Cons |
|
||||
| -------------- | ------------------------------ | --------------------------------- | ------------------------- |
|
||||
| **OpenAI** | General use, high reliability | High quality, widely tested | Paid service, API key required |
|
||||
| **Ollama** | Privacy-focused, cost savings | Free, runs locally, fully private | Requires local installation/setup |
|
||||
| **Google AI** | Integration in Google ecosystem| Strong performance, good support | Google account required |
|
||||
| **Azure OpenAI** | Enterprise & compliance needs| Enterprise-grade features, security | More complex setup process |
|
||||
| **Cohere** | Multilingual content handling | Excellent language support | More niche use cases |
|
||||
| **VoyageAI** | Information retrieval & search | Optimized for retrieval tasks | Relatively new provider |
|
||||
| **Mem0** | Per-user personalization | Search-optimized embeddings | Paid service, API key required |
|
||||
|
||||
|
||||
### Environment Variable Configuration
|
||||
|
||||
@@ -684,81 +738,18 @@ print(f"OpenAI: {openai_time:.2f}s")
|
||||
print(f"Ollama: {ollama_time:.2f}s")
|
||||
```
|
||||
|
||||
## 2. User Memory with Mem0 (Legacy)
|
||||
## 2. External Memory
|
||||
External Memory provides a standalone memory system that operates independently from the crew's built-in memory. This is ideal for specialized memory providers or cross-application memory sharing.
|
||||
|
||||
<Warning>
|
||||
**Legacy Approach**: While fully functional, this approach is considered legacy. For new projects requiring user-specific memory, consider using External Memory instead.
|
||||
</Warning>
|
||||
|
||||
User Memory integrates with [Mem0](https://mem0.ai/) to provide user-specific memory that persists across sessions and integrates with the crew's contextual memory system.
|
||||
|
||||
### Prerequisites
|
||||
```bash
|
||||
pip install mem0ai
|
||||
```
|
||||
|
||||
### Mem0 Cloud Configuration
|
||||
### Basic External Memory with Mem0
|
||||
```python
|
||||
import os
|
||||
from crewai import Crew, Process
|
||||
from crewai import Agent, Crew, Process, Task
|
||||
from crewai.memory.external.external_memory import ExternalMemory
|
||||
|
||||
# Set your Mem0 API key
|
||||
os.environ["MEM0_API_KEY"] = "m0-your-api-key"
|
||||
|
||||
crew = Crew(
|
||||
agents=[...],
|
||||
tasks=[...],
|
||||
memory=True, # Required for contextual memory integration
|
||||
memory_config={
|
||||
"provider": "mem0",
|
||||
"config": {"user_id": "john"},
|
||||
"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
|
||||
)
|
||||
```
|
||||
|
||||
### 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=[...],
|
||||
memory=True,
|
||||
memory_config={
|
||||
"provider": "mem0",
|
||||
"config": {
|
||||
"user_id": "john",
|
||||
"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": {}
|
||||
}
|
||||
)
|
||||
```
|
||||
|
||||
### Local Mem0 Configuration
|
||||
```python
|
||||
crew = Crew(
|
||||
agents=[...],
|
||||
tasks=[...],
|
||||
memory=True,
|
||||
memory_config={
|
||||
# Create external memory instance with local Mem0 Configuration
|
||||
external_memory = ExternalMemory(
|
||||
embedder_config={
|
||||
"provider": "mem0",
|
||||
"config": {
|
||||
"user_id": "john",
|
||||
@@ -776,37 +767,59 @@ crew = Crew(
|
||||
"config": {"api_key": "your-api-key", "model": "text-embedding-3-small"}
|
||||
}
|
||||
},
|
||||
"infer": True # Optional defaults to True
|
||||
"infer": True # Optional defaults to True
|
||||
},
|
||||
"user_memory": {}
|
||||
}
|
||||
)
|
||||
```
|
||||
|
||||
## 3. External Memory (New Approach)
|
||||
|
||||
External Memory provides a standalone memory system that operates independently from the crew's built-in memory. This is ideal for specialized memory providers or cross-application memory sharing.
|
||||
|
||||
### Basic External Memory with Mem0
|
||||
```python
|
||||
import os
|
||||
from crewai import Agent, Crew, Process, Task
|
||||
from crewai.memory.external.external_memory import ExternalMemory
|
||||
|
||||
os.environ["MEM0_API_KEY"] = "your-api-key"
|
||||
|
||||
# Create external memory instance
|
||||
external_memory = ExternalMemory(
|
||||
embedder_config={
|
||||
"provider": "mem0",
|
||||
"config": {"user_id": "U-123"}
|
||||
}
|
||||
)
|
||||
|
||||
crew = Crew(
|
||||
agents=[...],
|
||||
tasks=[...],
|
||||
external_memory=external_memory, # Separate from basic memory
|
||||
external_memory=external_memory, # Separate from basic memory
|
||||
process=Process.sequential,
|
||||
verbose=True
|
||||
)
|
||||
```
|
||||
|
||||
### Advanced External Memory with Mem0 Client
|
||||
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
|
||||
import os
|
||||
from crewai import Agent, Crew, Process, Task
|
||||
from crewai.memory.external.external_memory import ExternalMemory
|
||||
|
||||
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"}
|
||||
]
|
||||
|
||||
os.environ["MEM0_API_KEY"] = "your-api-key"
|
||||
|
||||
# Create external memory instance with Mem0 Client
|
||||
external_memory = ExternalMemory(
|
||||
embedder_config={
|
||||
"provider": "mem0",
|
||||
"config": {
|
||||
"user_id": "john",
|
||||
"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
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
crew = Crew(
|
||||
agents=[...],
|
||||
tasks=[...],
|
||||
external_memory=external_memory, # Separate from basic memory
|
||||
process=Process.sequential,
|
||||
verbose=True
|
||||
)
|
||||
@@ -845,17 +858,18 @@ crew = Crew(
|
||||
)
|
||||
```
|
||||
|
||||
## Memory System Comparison
|
||||
## 🧠 Memory System Comparison
|
||||
|
||||
| **Category** | **Feature** | **Basic Memory** | **External Memory** |
|
||||
|---------------------|------------------------|-----------------------------|------------------------------|
|
||||
| **Ease of Use** | Setup Complexity | Simple | Moderate |
|
||||
| | Integration | Built-in (contextual) | Standalone |
|
||||
| **Persistence** | Storage | Local files | Custom / Mem0 |
|
||||
| | Cross-session Support | ✅ | ✅ |
|
||||
| **Personalization** | User-specific Memory | ❌ | ✅ |
|
||||
| | Custom Providers | Limited | Any provider |
|
||||
| **Use Case Fit** | Recommended For | Most general use cases | Specialized / custom needs |
|
||||
|
||||
| Feature | Basic Memory | User Memory (Legacy) | External Memory |
|
||||
|---------|-------------|---------------------|----------------|
|
||||
| **Setup Complexity** | Simple | Medium | Medium |
|
||||
| **Integration** | Built-in contextual | Contextual + User-specific | Standalone |
|
||||
| **Storage** | Local files | Mem0 Cloud/Local | Custom/Mem0 |
|
||||
| **Cross-session** | ✅ | ✅ | ✅ |
|
||||
| **User-specific** | ❌ | ✅ | ✅ |
|
||||
| **Custom providers** | Limited | Mem0 only | Any provider |
|
||||
| **Recommended for** | Most use cases | Legacy projects | Specialized needs |
|
||||
|
||||
## Supported Embedding Providers
|
||||
|
||||
|
||||
103
docs/en/enterprise/features/rbac.mdx
Normal file
@@ -0,0 +1,103 @@
|
||||
---
|
||||
title: "Role-Based Access Control (RBAC)"
|
||||
description: "Control access to crews, tools, and data with roles, scopes, and granular permissions."
|
||||
icon: "shield"
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
RBAC in CrewAI Enterprise enables secure, scalable access management through a combination of organization‑level roles and automation‑level visibility controls.
|
||||
|
||||
<Frame>
|
||||
<img src="/images/enterprise/users_and_roles.png" alt="RBAC overview in CrewAI Enterprise" />
|
||||
|
||||
</Frame>
|
||||
|
||||
## Users and Roles
|
||||
|
||||
Each member in your CrewAI workspace is assigned a role, which determines their access across various features.
|
||||
|
||||
You can:
|
||||
|
||||
- Use predefined roles (Owner, Member)
|
||||
- Create custom roles tailored to specific permissions
|
||||
- Assign roles at any time through the settings panel
|
||||
|
||||
You can configure users and roles in Settings → Roles.
|
||||
|
||||
<Steps>
|
||||
<Step title="Open Roles settings">
|
||||
Go to <b>Settings → Roles</b> in CrewAI Enterprise.
|
||||
</Step>
|
||||
<Step title="Choose a role type">
|
||||
Use a predefined role (<b>Owner</b>, <b>Member</b>) or click <b>Create role</b> to define a custom one.
|
||||
</Step>
|
||||
<Step title="Assign to members">
|
||||
Select users and assign the role. You can change this anytime.
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
### Configuration summary
|
||||
|
||||
| Area | Where to configure | Options |
|
||||
|:---|:---|:---|
|
||||
| Users & Roles | Settings → Roles | Predefined: Owner, Member; Custom roles |
|
||||
| Automation visibility | Automation → Settings → Visibility | Private; Whitelist users/roles |
|
||||
|
||||
## Automation‑level Access Control
|
||||
|
||||
In addition to organization‑wide roles, CrewAI Automations support fine‑grained visibility settings that let you restrict access to specific automations by user or role.
|
||||
|
||||
This is useful for:
|
||||
|
||||
- Keeping sensitive or experimental automations private
|
||||
- Managing visibility across large teams or external collaborators
|
||||
- Testing automations in isolated contexts
|
||||
|
||||
Deployments can be configured as private, meaning only whitelisted users and roles will be able to:
|
||||
|
||||
- View the deployment
|
||||
- Run it or interact with its API
|
||||
- Access its logs, metrics, and settings
|
||||
|
||||
The organization owner always has access, regardless of visibility settings.
|
||||
|
||||
You can configure automation‑level access control in Automation → Settings → Visibility tab.
|
||||
|
||||
<Steps>
|
||||
<Step title="Open Visibility tab">
|
||||
Navigate to <b>Automation → Settings → Visibility</b>.
|
||||
</Step>
|
||||
<Step title="Set visibility">
|
||||
Choose <b>Private</b> to restrict access. The organization owner always retains access.
|
||||
</Step>
|
||||
<Step title="Whitelist access">
|
||||
Add specific users and roles allowed to view, run, and access logs/metrics/settings.
|
||||
</Step>
|
||||
<Step title="Save and verify">
|
||||
Save changes, then confirm that non‑whitelisted users cannot view or run the automation.
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
### Private visibility: access outcomes
|
||||
|
||||
| Action | Owner | Whitelisted user/role | Not whitelisted |
|
||||
|:---|:---|:---|:---|
|
||||
| View automation | ✓ | ✓ | ✗ |
|
||||
| Run automation/API | ✓ | ✓ | ✗ |
|
||||
| Access logs/metrics/settings | ✓ | ✓ | ✗ |
|
||||
|
||||
<Tip>
|
||||
The organization owner always has access. In private mode, only whitelisted users and roles can view, run, and access logs/metrics/settings.
|
||||
</Tip>
|
||||
|
||||
<Frame>
|
||||
<img src="/images/enterprise/visibility.png" alt="Automation Visibility settings in CrewAI Enterprise" />
|
||||
|
||||
</Frame>
|
||||
|
||||
<Card title="Need Help?" icon="headset" href="mailto:support@crewai.com">
|
||||
Contact our support team for assistance with RBAC questions.
|
||||
</Card>
|
||||
|
||||
|
||||
@@ -35,6 +35,22 @@ crewai tool install <tool-name>
|
||||
|
||||
This installs the tool and adds it to `pyproject.toml`.
|
||||
|
||||
You can use the tool by importing it and adding it to your agents:
|
||||
|
||||
```python
|
||||
from your_tool.tool import YourTool
|
||||
|
||||
custom_tool = YourTool()
|
||||
|
||||
researcher = Agent(
|
||||
role='Market Research Analyst',
|
||||
goal='Provide up-to-date market analysis of the AI industry',
|
||||
backstory='An expert analyst with a keen eye for market trends.',
|
||||
tools=[custom_tool],
|
||||
verbose=True
|
||||
)
|
||||
```
|
||||
|
||||
## Creating and Publishing Tools
|
||||
|
||||
To create a new tool project:
|
||||
|
||||
22
docs/en/examples/cookbooks.mdx
Normal file
@@ -0,0 +1,22 @@
|
||||
---
|
||||
title: CrewAI Cookbooks
|
||||
description: Feature-focused quickstarts and notebooks for learning patterns fast.
|
||||
icon: book
|
||||
---
|
||||
|
||||
## Quickstarts & Demos
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card title="Task Guardrails" icon="shield-check" href="https://github.com/crewAIInc/crewAI-quickstarts/tree/main/Task%20Guardrails">
|
||||
Interactive notebooks for hands-on exploration.
|
||||
</Card>
|
||||
<Card title="Browse Quickstarts" icon="bolt" href="https://github.com/crewAIInc/crewAI-quickstarts">
|
||||
Feature demos and small projects showcasing specific CrewAI capabilities.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
<Tip>
|
||||
Use Cookbooks to learn a pattern quickly, then jump to Full Examples for production‑grade implementations.
|
||||
</Tip>
|
||||
|
||||
|
||||
@@ -1,62 +1,85 @@
|
||||
---
|
||||
title: CrewAI Examples
|
||||
description: A collection of examples that show how to use CrewAI framework to automate workflows.
|
||||
description: Explore curated examples organized by Crews, Flows, Integrations, and Notebooks.
|
||||
icon: rocket-launch
|
||||
---
|
||||
|
||||
## Crews
|
||||
|
||||
<CardGroup cols={3}>
|
||||
<Card
|
||||
title="Marketing Strategy"
|
||||
color="#F3A78B"
|
||||
href="https://github.com/crewAIInc/crewAI-examples/tree/main/marketing_strategy"
|
||||
icon="bullhorn"
|
||||
iconType="solid"
|
||||
>
|
||||
Automate marketing strategy creation with CrewAI.
|
||||
<Card title="Marketing Strategy" icon="bullhorn" href="https://github.com/crewAIInc/crewAI-examples/tree/main/crews/marketing_strategy">
|
||||
Multi‑agent marketing campaign planning.
|
||||
</Card>
|
||||
<Card title="Surprise Trip" icon="plane" href="https://github.com/crewAIInc/crewAI-examples/tree/main/crews/surprise_trip">
|
||||
Personalized surprise travel planning.
|
||||
</Card>
|
||||
<Card title="Match Profile to Positions" icon="id-card" href="https://github.com/crewAIInc/crewAI-examples/tree/main/crews/match_profile_to_positions">
|
||||
CV‑to‑job matching with vector search.
|
||||
</Card>
|
||||
<Card title="Job Posting" icon="newspaper" href="https://github.com/crewAIInc/crewAI-examples/tree/main/crews/job-posting">
|
||||
Automated job description creation.
|
||||
</Card>
|
||||
<Card title="Game Builder Crew" icon="gamepad" href="https://github.com/crewAIInc/crewAI-examples/tree/main/crews/game-builder-crew">
|
||||
Multi‑agent team that designs and builds Python games.
|
||||
</Card>
|
||||
<Card title="Recruitment" icon="user-group" href="https://github.com/crewAIInc/crewAI-examples/tree/main/crews/recruitment">
|
||||
Candidate sourcing and evaluation.
|
||||
</Card>
|
||||
<Card title="Browse all Crews" icon="users" href="https://github.com/crewAIInc/crewAI-examples/tree/main/crews">
|
||||
See the full list of crew examples.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
## Flows
|
||||
|
||||
<CardGroup cols={3}>
|
||||
<Card title="Content Creator Flow" icon="pen" href="https://github.com/crewAIInc/crewAI-examples/tree/main/flows/content_creator_flow">
|
||||
Multi‑crew content generation with routing.
|
||||
</Card>
|
||||
<Card title="Email Auto Responder" icon="envelope" href="https://github.com/crewAIInc/crewAI-examples/tree/main/flows/email_auto_responder_flow">
|
||||
Automated email monitoring and replies.
|
||||
</Card>
|
||||
<Card title="Lead Score Flow" icon="chart-line" href="https://github.com/crewAIInc/crewAI-examples/tree/main/flows/lead_score_flow">
|
||||
Lead qualification with human‑in‑the‑loop.
|
||||
</Card>
|
||||
<Card title="Meeting Assistant Flow" icon="calendar" href="https://github.com/crewAIInc/crewAI-examples/tree/main/flows/meeting_assistant_flow">
|
||||
Notes processing with integrations.
|
||||
</Card>
|
||||
<Card title="Self Evaluation Loop" icon="rotate" href="https://github.com/crewAIInc/crewAI-examples/tree/main/flows/self_evaluation_loop_flow">
|
||||
Iterative self‑improvement workflows.
|
||||
</Card>
|
||||
<Card title="Write a Book (Flows)" icon="book" href="https://github.com/crewAIInc/crewAI-examples/tree/main/flows/write_a_book_with_flows">
|
||||
Parallel chapter generation.
|
||||
</Card>
|
||||
<Card title="Browse all Flows" icon="diagram-project" href="https://github.com/crewAIInc/crewAI-examples/tree/main/flows">
|
||||
See the full list of flow examples.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
## Integrations
|
||||
|
||||
<CardGroup cols={3}>
|
||||
<Card title="CrewAI ↔ LangGraph" icon="link" href="https://github.com/crewAIInc/crewAI-examples/tree/main/integrations/crewai-langgraph">
|
||||
Integration with LangGraph framework.
|
||||
</Card>
|
||||
<Card title="Azure OpenAI" icon="cloud" href="https://github.com/crewAIInc/crewAI-examples/tree/main/integrations/azure_model">
|
||||
Using CrewAI with Azure OpenAI.
|
||||
</Card>
|
||||
<Card title="NVIDIA Models" icon="microchip" href="https://github.com/crewAIInc/crewAI-examples/tree/main/integrations/nvidia_models">
|
||||
NVIDIA ecosystem integrations.
|
||||
</Card>
|
||||
<Card title="Browse Integrations" icon="puzzle-piece" href="https://github.com/crewAIInc/crewAI-examples/tree/main/integrations">
|
||||
See all integration examples.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
## Notebooks
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card title="Simple QA Crew + Flow" icon="book" href="https://github.com/crewAIInc/crewAI-examples/tree/main/Notebooks/Simple%20QA%20Crew%20%2B%20Flow">
|
||||
Simple QA Crew + Flow.
|
||||
</Card>
|
||||
<Card title="All Notebooks" icon="book" href="https://github.com/crewAIInc/crewAI-examples/tree/main/Notebooks">
|
||||
Interactive examples for learning and experimentation.
|
||||
</Card>
|
||||
<Card
|
||||
title="Surprise Trip"
|
||||
color="#F3A78B"
|
||||
href="https://github.com/crewAIInc/crewAI-examples/tree/main/surprise_trip"
|
||||
icon="plane"
|
||||
iconType="duotone"
|
||||
>
|
||||
Create a surprise trip itinerary with CrewAI.
|
||||
</Card>
|
||||
<Card
|
||||
title="Match Profile to Positions"
|
||||
color="#F3A78B"
|
||||
href="https://github.com/crewAIInc/crewAI-examples/tree/main/match_profile_to_positions"
|
||||
icon="linkedin"
|
||||
iconType="duotone"
|
||||
>
|
||||
Match a profile to jobpositions with CrewAI.
|
||||
</Card>
|
||||
<Card
|
||||
title="Create Job Posting"
|
||||
color="#F3A78B"
|
||||
href="https://github.com/crewAIInc/crewAI-examples/tree/main/job-posting"
|
||||
icon="newspaper"
|
||||
iconType="duotone"
|
||||
>
|
||||
Create a job posting with CrewAI.
|
||||
</Card>
|
||||
<Card
|
||||
title="Game Generator"
|
||||
color="#F3A78B"
|
||||
href="https://github.com/crewAIInc/crewAI-examples/tree/main/game-builder-crew"
|
||||
icon="gamepad"
|
||||
iconType="duotone"
|
||||
>
|
||||
Create a game with CrewAI.
|
||||
</Card>
|
||||
<Card
|
||||
title="Find Job Candidates"
|
||||
color="#F3A78B"
|
||||
href="https://github.com/crewAIInc/crewAI-examples/tree/main/recruitment"
|
||||
icon="user-group"
|
||||
iconType="duotone"
|
||||
>
|
||||
Find job candidates with CrewAI.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
@@ -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
|
||||
@@ -70,7 +83,7 @@ server_params = {
|
||||
}
|
||||
|
||||
# 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(
|
||||
@@ -95,7 +108,7 @@ There are two ways to filter tools:
|
||||
### Accessing a specific tool using dictionary-style indexing.
|
||||
|
||||
```python
|
||||
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(
|
||||
@@ -112,7 +125,7 @@ with MCPServerAdapter(server_params) as mcp_tools:
|
||||
### Pass a list of tool names to the `MCPServerAdapter` constructor.
|
||||
|
||||
```python
|
||||
with MCPServerAdapter(server_params, "tool_name") as mcp_tools:
|
||||
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(
|
||||
|
||||
@@ -1,126 +0,0 @@
|
||||
---
|
||||
title: AgentOps Integration
|
||||
description: Understanding and logging your agent performance with AgentOps.
|
||||
icon: paperclip
|
||||
---
|
||||
|
||||
# Introduction
|
||||
|
||||
Observability is a key aspect of developing and deploying conversational AI agents. It allows developers to understand how their agents are performing,
|
||||
how their agents are interacting with users, and how their agents use external tools and APIs.
|
||||
AgentOps is a product independent of CrewAI that provides a comprehensive observability solution for agents.
|
||||
|
||||
## AgentOps
|
||||
|
||||
[AgentOps](https://agentops.ai/?=crew) provides session replays, metrics, and monitoring for agents.
|
||||
|
||||
At a high level, AgentOps gives you the ability to monitor cost, token usage, latency, agent failures, session-wide statistics, and more.
|
||||
For more info, check out the [AgentOps Repo](https://github.com/AgentOps-AI/agentops).
|
||||
|
||||
### Overview
|
||||
|
||||
AgentOps provides monitoring for agents in development and production.
|
||||
It provides a dashboard for tracking agent performance, session replays, and custom reporting.
|
||||
|
||||
Additionally, AgentOps provides session drilldowns for viewing Crew agent interactions, LLM calls, and tool usage in real-time.
|
||||
This feature is useful for debugging and understanding how agents interact with users as well as other agents.
|
||||
|
||||

|
||||

|
||||

|
||||
|
||||
### Features
|
||||
|
||||
- **LLM Cost Management and Tracking**: Track spend with foundation model providers.
|
||||
- **Replay Analytics**: Watch step-by-step agent execution graphs.
|
||||
- **Recursive Thought Detection**: Identify when agents fall into infinite loops.
|
||||
- **Custom Reporting**: Create custom analytics on agent performance.
|
||||
- **Analytics Dashboard**: Monitor high-level statistics about agents in development and production.
|
||||
- **Public Model Testing**: Test your agents against benchmarks and leaderboards.
|
||||
- **Custom Tests**: Run your agents against domain-specific tests.
|
||||
- **Time Travel Debugging**: Restart your sessions from checkpoints.
|
||||
- **Compliance and Security**: Create audit logs and detect potential threats such as profanity and PII leaks.
|
||||
- **Prompt Injection Detection**: Identify potential code injection and secret leaks.
|
||||
|
||||
### Using AgentOps
|
||||
|
||||
<Steps>
|
||||
<Step title="Create an API Key">
|
||||
Create a user API key here: [Create API Key](https://app.agentops.ai/account)
|
||||
</Step>
|
||||
<Step title="Configure Your Environment">
|
||||
Add your API key to your environment variables:
|
||||
```bash
|
||||
AGENTOPS_API_KEY=<YOUR_AGENTOPS_API_KEY>
|
||||
```
|
||||
</Step>
|
||||
<Step title="Install AgentOps">
|
||||
Install AgentOps with:
|
||||
```bash
|
||||
pip install 'crewai[agentops]'
|
||||
```
|
||||
or
|
||||
```bash
|
||||
pip install agentops
|
||||
```
|
||||
</Step>
|
||||
<Step title="Initialize AgentOps">
|
||||
Before using `Crew` in your script, include these lines:
|
||||
|
||||
```python
|
||||
import agentops
|
||||
agentops.init()
|
||||
```
|
||||
|
||||
This will initiate an AgentOps session as well as automatically track Crew agents. For further info on how to outfit more complex agentic systems,
|
||||
check out the [AgentOps documentation](https://docs.agentops.ai) or join the [Discord](https://discord.gg/j4f3KbeH).
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
### Crew + AgentOps Examples
|
||||
|
||||
<CardGroup cols={3}>
|
||||
<Card
|
||||
title="Job Posting"
|
||||
color="#F3A78B"
|
||||
href="https://github.com/joaomdmoura/crewAI-examples/tree/main/job-posting"
|
||||
icon="briefcase"
|
||||
iconType="solid"
|
||||
>
|
||||
Example of a Crew agent that generates job posts.
|
||||
</Card>
|
||||
<Card
|
||||
title="Markdown Validator"
|
||||
color="#F3A78B"
|
||||
href="https://github.com/joaomdmoura/crewAI-examples/tree/main/markdown_validator"
|
||||
icon="markdown"
|
||||
iconType="solid"
|
||||
>
|
||||
Example of a Crew agent that validates Markdown files.
|
||||
</Card>
|
||||
<Card
|
||||
title="Instagram Post"
|
||||
color="#F3A78B"
|
||||
href="https://github.com/joaomdmoura/crewAI-examples/tree/main/instagram_post"
|
||||
icon="square-instagram"
|
||||
iconType="brands"
|
||||
>
|
||||
Example of a Crew agent that generates Instagram posts.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
### Further Information
|
||||
|
||||
To get started, create an [AgentOps account](https://agentops.ai/?=crew).
|
||||
|
||||
For feature requests or bug reports, please reach out to the AgentOps team on the [AgentOps Repo](https://github.com/AgentOps-AI/agentops).
|
||||
|
||||
#### Extra links
|
||||
|
||||
<a href="https://twitter.com/agentopsai/">🐦 Twitter</a>
|
||||
<span> • </span>
|
||||
<a href="https://discord.gg/JHPt4C7r">📢 Discord</a>
|
||||
<span> • </span>
|
||||
<a href="https://app.agentops.ai/?=crew">🖇️ AgentOps Dashboard</a>
|
||||
<span> • </span>
|
||||
<a href="https://docs.agentops.ai/introduction">📙 Documentation</a>
|
||||
286
docs/en/observability/langdb.mdx
Normal file
@@ -0,0 +1,286 @@
|
||||
---
|
||||
title: LangDB Integration
|
||||
description: Govern, secure, and optimize your CrewAI workflows with LangDB AI Gateway—access 350+ models, automatic routing, cost optimization, and full observability.
|
||||
icon: database
|
||||
---
|
||||
|
||||
# Introduction
|
||||
|
||||
[LangDB AI Gateway](https://langdb.ai) provides OpenAI-compatible APIs to connect with multiple Large Language Models and serves as an observability platform that makes it effortless to trace CrewAI workflows end-to-end while providing access to 350+ language models. With a single `init()` call, all agent interactions, task executions, and LLM calls are captured, providing comprehensive observability and production-ready AI infrastructure for your applications.
|
||||
|
||||
<Frame caption="LangDB CrewAI Trace Example">
|
||||
<img src="/images/langdb-1.png" alt="LangDB CrewAI trace example" />
|
||||
</Frame>
|
||||
|
||||
**Checkout:** [View the live trace example](https://app.langdb.ai/sharing/threads/3becbfed-a1be-ae84-ea3c-4942867a3e22)
|
||||
|
||||
## Features
|
||||
|
||||
### AI Gateway Capabilities
|
||||
- **Access to 350+ LLMs**: Connect to all major language models through a single integration
|
||||
- **Virtual Models**: Create custom model configurations with specific parameters and routing rules
|
||||
- **Virtual MCP**: Enable compatibility and integration with MCP (Model Context Protocol) systems for enhanced agent communication
|
||||
- **Guardrails**: Implement safety measures and compliance controls for agent behavior
|
||||
|
||||
### Observability & Tracing
|
||||
- **Automatic Tracing**: Single `init()` call captures all CrewAI interactions
|
||||
- **End-to-End Visibility**: Monitor agent workflows from start to finish
|
||||
- **Tool Usage Tracking**: Track which tools agents use and their outcomes
|
||||
- **Model Call Monitoring**: Detailed insights into LLM interactions
|
||||
- **Performance Analytics**: Monitor latency, token usage, and costs
|
||||
- **Debugging Support**: Step-through execution for troubleshooting
|
||||
- **Real-time Monitoring**: Live traces and metrics dashboard
|
||||
|
||||
## Setup Instructions
|
||||
|
||||
<Steps>
|
||||
<Step title="Install LangDB">
|
||||
Install the LangDB client with CrewAI feature flag:
|
||||
```bash
|
||||
pip install 'pylangdb[crewai]'
|
||||
```
|
||||
</Step>
|
||||
<Step title="Set Environment Variables">
|
||||
Configure your LangDB credentials:
|
||||
```bash
|
||||
export LANGDB_API_KEY="<your_langdb_api_key>"
|
||||
export LANGDB_PROJECT_ID="<your_langdb_project_id>"
|
||||
export LANGDB_API_BASE_URL='https://api.us-east-1.langdb.ai'
|
||||
```
|
||||
</Step>
|
||||
<Step title="Initialize Tracing">
|
||||
Import and initialize LangDB before configuring your CrewAI code:
|
||||
```python
|
||||
from pylangdb.crewai import init
|
||||
# Initialize LangDB
|
||||
init()
|
||||
```
|
||||
</Step>
|
||||
<Step title="Configure CrewAI with LangDB">
|
||||
Set up your LLM with LangDB headers:
|
||||
```python
|
||||
from crewai import Agent, Task, Crew, LLM
|
||||
import os
|
||||
|
||||
# Configure LLM with LangDB headers
|
||||
llm = LLM(
|
||||
model="openai/gpt-4o", # Replace with the model you want to use
|
||||
api_key=os.getenv("LANGDB_API_KEY"),
|
||||
base_url=os.getenv("LANGDB_API_BASE_URL"),
|
||||
extra_headers={"x-project-id": os.getenv("LANGDB_PROJECT_ID")}
|
||||
)
|
||||
```
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## Quick Start Example
|
||||
|
||||
Here's a simple example to get you started with LangDB and CrewAI:
|
||||
|
||||
```python
|
||||
import os
|
||||
from pylangdb.crewai import init
|
||||
from crewai import Agent, Task, Crew, LLM
|
||||
|
||||
# Initialize LangDB before any CrewAI imports
|
||||
init()
|
||||
|
||||
def create_llm(model):
|
||||
return LLM(
|
||||
model=model,
|
||||
api_key=os.environ.get("LANGDB_API_KEY"),
|
||||
base_url=os.environ.get("LANGDB_API_BASE_URL"),
|
||||
extra_headers={"x-project-id": os.environ.get("LANGDB_PROJECT_ID")}
|
||||
)
|
||||
|
||||
# Define your agent
|
||||
researcher = Agent(
|
||||
role="Research Specialist",
|
||||
goal="Research topics thoroughly",
|
||||
backstory="Expert researcher with skills in finding information",
|
||||
llm=create_llm("openai/gpt-4o"), # Replace with the model you want to use
|
||||
verbose=True
|
||||
)
|
||||
|
||||
# Create a task
|
||||
task = Task(
|
||||
description="Research the given topic and provide a comprehensive summary",
|
||||
agent=researcher,
|
||||
expected_output="Detailed research summary with key findings"
|
||||
)
|
||||
|
||||
# Create and run the crew
|
||||
crew = Crew(agents=[researcher], tasks=[task])
|
||||
result = crew.kickoff()
|
||||
print(result)
|
||||
```
|
||||
|
||||
## Complete Example: Research and Planning Agent
|
||||
|
||||
This comprehensive example demonstrates a multi-agent workflow with research and planning capabilities.
|
||||
|
||||
### Prerequisites
|
||||
|
||||
```bash
|
||||
pip install crewai 'pylangdb[crewai]' crewai_tools setuptools python-dotenv
|
||||
```
|
||||
|
||||
### Environment Setup
|
||||
|
||||
```bash
|
||||
# LangDB credentials
|
||||
export LANGDB_API_KEY="<your_langdb_api_key>"
|
||||
export LANGDB_PROJECT_ID="<your_langdb_project_id>"
|
||||
export LANGDB_API_BASE_URL='https://api.us-east-1.langdb.ai'
|
||||
|
||||
# Additional API keys (optional)
|
||||
export SERPER_API_KEY="<your_serper_api_key>" # For web search capabilities
|
||||
```
|
||||
|
||||
### Complete Implementation
|
||||
|
||||
```python
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import os
|
||||
import sys
|
||||
from pylangdb.crewai import init
|
||||
init() # Initialize LangDB before any CrewAI imports
|
||||
from dotenv import load_dotenv
|
||||
from crewai import Agent, Task, Crew, Process, LLM
|
||||
from crewai_tools import SerperDevTool
|
||||
|
||||
load_dotenv()
|
||||
|
||||
def create_llm(model):
|
||||
return LLM(
|
||||
model=model,
|
||||
api_key=os.environ.get("LANGDB_API_KEY"),
|
||||
base_url=os.environ.get("LANGDB_API_BASE_URL"),
|
||||
extra_headers={"x-project-id": os.environ.get("LANGDB_PROJECT_ID")}
|
||||
)
|
||||
|
||||
class ResearchPlanningCrew:
|
||||
def researcher(self) -> Agent:
|
||||
return Agent(
|
||||
role="Research Specialist",
|
||||
goal="Research topics thoroughly and compile comprehensive information",
|
||||
backstory="Expert researcher with skills in finding and analyzing information from various sources",
|
||||
tools=[SerperDevTool()],
|
||||
llm=create_llm("openai/gpt-4o"),
|
||||
verbose=True
|
||||
)
|
||||
|
||||
def planner(self) -> Agent:
|
||||
return Agent(
|
||||
role="Strategic Planner",
|
||||
goal="Create actionable plans based on research findings",
|
||||
backstory="Strategic planner who breaks down complex challenges into executable plans",
|
||||
reasoning=True,
|
||||
max_reasoning_attempts=3,
|
||||
llm=create_llm("openai/anthropic/claude-3.7-sonnet"),
|
||||
verbose=True
|
||||
)
|
||||
|
||||
def research_task(self) -> Task:
|
||||
return Task(
|
||||
description="Research the topic thoroughly and compile comprehensive information",
|
||||
agent=self.researcher(),
|
||||
expected_output="Comprehensive research report with key findings and insights"
|
||||
)
|
||||
|
||||
def planning_task(self) -> Task:
|
||||
return Task(
|
||||
description="Create a strategic plan based on the research findings",
|
||||
agent=self.planner(),
|
||||
expected_output="Strategic execution plan with phases, goals, and actionable steps",
|
||||
context=[self.research_task()]
|
||||
)
|
||||
|
||||
def crew(self) -> Crew:
|
||||
return Crew(
|
||||
agents=[self.researcher(), self.planner()],
|
||||
tasks=[self.research_task(), self.planning_task()],
|
||||
verbose=True,
|
||||
process=Process.sequential
|
||||
)
|
||||
|
||||
def main():
|
||||
topic = sys.argv[1] if len(sys.argv) > 1 else "Artificial Intelligence in Healthcare"
|
||||
|
||||
crew_instance = ResearchPlanningCrew()
|
||||
|
||||
# Update task descriptions with the specific topic
|
||||
crew_instance.research_task().description = f"Research {topic} thoroughly and compile comprehensive information"
|
||||
crew_instance.planning_task().description = f"Create a strategic plan for {topic} based on the research findings"
|
||||
|
||||
result = crew_instance.crew().kickoff()
|
||||
print(result)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
```
|
||||
|
||||
### Running the Example
|
||||
|
||||
```bash
|
||||
python main.py "Sustainable Energy Solutions"
|
||||
```
|
||||
|
||||
## Viewing Traces in LangDB
|
||||
|
||||
After running your CrewAI application, you can view detailed traces in the LangDB dashboard:
|
||||
|
||||
<Frame caption="LangDB Trace Dashboard">
|
||||
<img src="/images/langdb-2.png" alt="LangDB trace dashboard showing CrewAI workflow" />
|
||||
</Frame>
|
||||
|
||||
### What You'll See
|
||||
|
||||
- **Agent Interactions**: Complete flow of agent conversations and task handoffs
|
||||
- **Tool Usage**: Which tools were called, their inputs, and outputs
|
||||
- **Model Calls**: Detailed LLM interactions with prompts image.pngand responses
|
||||
- **Performance Metrics**: Latency, token usage, and cost tracking
|
||||
- **Execution Timeline**: Step-by-step view of the entire workflow
|
||||
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
|
||||
- **No traces appearing**: Ensure `init()` is called before any CrewAI imports
|
||||
- **Authentication errors**: Verify your LangDB API key and project ID
|
||||
|
||||
|
||||
## Resources
|
||||
|
||||
<CardGroup cols={3}>
|
||||
<Card title="LangDB Documentation" icon="book" href="https://docs.langdb.ai">
|
||||
Official LangDB documentation and guides
|
||||
</Card>
|
||||
<Card title="LangDB Guides" icon="graduation-cap" href="https://docs.langdb.ai/guides">
|
||||
Step-by-step tutorials for building AI agents
|
||||
</Card>
|
||||
<Card title="GitHub Examples" icon="github" href="https://github.com/langdb/langdb-samples/tree/main/examples/crewai" >
|
||||
Complete CrewAI integration examples
|
||||
</Card>
|
||||
<Card title="LangDB Dashboard" icon="chart-line" href="https://app.langdb.ai">
|
||||
Access your traces and analytics
|
||||
</Card>
|
||||
<Card title="Model Catalog" icon="list" href="https://app.langdb.ai/models">
|
||||
Browse 350+ available language models
|
||||
</Card>
|
||||
<Card title="Enterprise Features" icon="building" href="https://docs.langdb.ai/enterprise">
|
||||
Self-hosted options and enterprise capabilities
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
## Next Steps
|
||||
|
||||
This guide covered the basics of integrating LangDB AI Gateway with CrewAI. To further enhance your AI workflows, explore:
|
||||
|
||||
- **Virtual Models**: Create custom model configurations with routing strategies
|
||||
- **Guardrails & Safety**: Implement content filtering and compliance controls
|
||||
- **Production Deployment**: Configure fallbacks, retries, and load balancing
|
||||
|
||||
For more advanced features and use cases, visit the [LangDB Documentation](https://docs.langdb.ai) or explore the [Model Catalog](https://app.langdb.ai/models) to discover all available models.
|
||||
@@ -21,8 +21,9 @@ Observability is crucial for understanding how your CrewAI agents perform, ident
|
||||
### Monitoring & Tracing Platforms
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card title="AgentOps" icon="paperclip" href="/en/observability/agentops">
|
||||
Session replays, metrics, and monitoring for agent development and production.
|
||||
|
||||
<Card title="LangDB" icon="database" href="/en/observability/langdb">
|
||||
End-to-end tracing for CrewAI workflows with automatic agent interaction capture.
|
||||
</Card>
|
||||
|
||||
<Card title="OpenLIT" icon="magnifying-glass-chart" href="/en/observability/openlit">
|
||||
|
||||
146
docs/en/observability/truefoundry.mdx
Normal file
@@ -0,0 +1,146 @@
|
||||
---
|
||||
title: TrueFoundry Integration
|
||||
icon: chart-line
|
||||
---
|
||||
|
||||
TrueFoundry provides an enterprise-ready [AI Gateway](https://www.truefoundry.com/ai-gateway) which can integrate with agentic frameworks like CrewAI and provides governance and observability for your AI Applications. TrueFoundry AI Gateway serves as a unified interface for LLM access, providing:
|
||||
|
||||
- **Unified API Access**: Connect to 250+ LLMs (OpenAI, Claude, Gemini, Groq, Mistral) through one API
|
||||
- **Low Latency**: Sub-3ms internal latency with intelligent routing and load balancing
|
||||
- **Enterprise Security**: SOC 2, HIPAA, GDPR compliance with RBAC and audit logging
|
||||
- **Quota and cost management**: Token-based quotas, rate limiting, and comprehensive usage tracking
|
||||
- **Observability**: Full request/response logging, metrics, and traces with customizable retention
|
||||
|
||||
## How TrueFoundry Integrates with CrewAI
|
||||
|
||||
|
||||
### Installation & Setup
|
||||
|
||||
<Steps>
|
||||
<Step title="Install CrewAI">
|
||||
```bash
|
||||
pip install crewai
|
||||
```
|
||||
</Step>
|
||||
|
||||
<Step title="Get TrueFoundry Access Token">
|
||||
1. Sign up for a [TrueFoundry account](https://www.truefoundry.com/register)
|
||||
2. Follow the steps here in [Quick start](https://docs.truefoundry.com/gateway/quick-start)
|
||||
</Step>
|
||||
|
||||
<Step title="Configure CrewAI with TrueFoundry">
|
||||

|
||||
|
||||
```python
|
||||
from crewai import LLM
|
||||
|
||||
# Create an LLM instance with TrueFoundry AI Gateway
|
||||
truefoundry_llm = LLM(
|
||||
model="openai-main/gpt-4o", # Similarly, you can call any model from any provider
|
||||
base_url="your_truefoundry_gateway_base_url",
|
||||
api_key="your_truefoundry_api_key"
|
||||
)
|
||||
|
||||
# Use in your CrewAI agents
|
||||
from crewai import Agent
|
||||
|
||||
@agent
|
||||
def researcher(self) -> Agent:
|
||||
return Agent(
|
||||
config=self.agents_config['researcher'],
|
||||
llm=truefoundry_llm,
|
||||
verbose=True
|
||||
)
|
||||
```
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
### Complete CrewAI Example
|
||||
|
||||
```python
|
||||
from crewai import Agent, Task, Crew, LLM
|
||||
|
||||
# Configure LLM with TrueFoundry
|
||||
llm = LLM(
|
||||
model="openai-main/gpt-4o",
|
||||
base_url="your_truefoundry_gateway_base_url",
|
||||
api_key="your_truefoundry_api_key"
|
||||
)
|
||||
|
||||
# Create agents
|
||||
researcher = Agent(
|
||||
role='Research Analyst',
|
||||
goal='Conduct detailed market research',
|
||||
backstory='Expert market analyst with attention to detail',
|
||||
llm=llm,
|
||||
verbose=True
|
||||
)
|
||||
|
||||
writer = Agent(
|
||||
role='Content Writer',
|
||||
goal='Create comprehensive reports',
|
||||
backstory='Experienced technical writer',
|
||||
llm=llm,
|
||||
verbose=True
|
||||
)
|
||||
|
||||
# Create tasks
|
||||
research_task = Task(
|
||||
description='Research AI market trends for 2024',
|
||||
agent=researcher,
|
||||
expected_output='Comprehensive research summary'
|
||||
)
|
||||
|
||||
writing_task = Task(
|
||||
description='Create a market research report',
|
||||
agent=writer,
|
||||
expected_output='Well-structured report with insights',
|
||||
context=[research_task]
|
||||
)
|
||||
|
||||
# Create and execute crew
|
||||
crew = Crew(
|
||||
agents=[researcher, writer],
|
||||
tasks=[research_task, writing_task],
|
||||
verbose=True
|
||||
)
|
||||
|
||||
result = crew.kickoff()
|
||||
```
|
||||
|
||||
### Observability and Governance
|
||||
|
||||
Monitor your CrewAI agents through TrueFoundry's metrics tab:
|
||||

|
||||
|
||||
With Truefoundry's AI gateway, you can monitor and analyze:
|
||||
|
||||
- **Performance Metrics**: Track key latency metrics like Request Latency, Time to First Token (TTFS), and Inter-Token Latency (ITL) with P99, P90, and P50 percentiles
|
||||
- **Cost and Token Usage**: Gain visibility into your application's costs with detailed breakdowns of input/output tokens and the associated expenses for each model
|
||||
- **Usage Patterns**: Understand how your application is being used with detailed analytics on user activity, model distribution, and team-based usage
|
||||
- **Rate limit and Load balancing**: You can set up rate limiting, load balancing and fallback for your models
|
||||
|
||||
## Tracing
|
||||
|
||||
For a more detailed understanding on tracing, please see [getting-started-tracing](https://docs.truefoundry.com/docs/tracing/tracing-getting-started).For tracing, you can add the Traceloop SDK:
|
||||
For tracing, you can add the Traceloop SDK:
|
||||
|
||||
```bash
|
||||
pip install traceloop-sdk
|
||||
```
|
||||
|
||||
```python
|
||||
from traceloop.sdk import Traceloop
|
||||
|
||||
# Initialize enhanced tracing
|
||||
Traceloop.init(
|
||||
api_endpoint="https://your-truefoundry-endpoint/api/tracing",
|
||||
headers={
|
||||
"Authorization": f"Bearer {your_truefoundry_pat_token}",
|
||||
"TFY-Tracing-Project": "your_project_name",
|
||||
},
|
||||
)
|
||||
```
|
||||
|
||||
This provides additional trace correlation across your entire CrewAI workflow.
|
||||

|
||||
@@ -35,7 +35,7 @@ os.environ['OTEL_SDK_DISABLED'] = 'true'
|
||||
|
||||
### Data Explanation:
|
||||
| Defaulted | Data | Reason and Specifics |
|
||||
|-----------|-------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------|
|
||||
|:----------|:------------------------------------------|:----------------------------------------------------------------------------------------------------------------------------|
|
||||
| Yes | CrewAI and Python Version | Tracks software versions. Example: CrewAI v1.2.3, Python 3.8.10. No personal data. |
|
||||
| Yes | Crew Metadata | Includes: randomly generated key and ID, process type (e.g., 'sequential', 'parallel'), boolean flag for memory usage (true/false), count of tasks, count of agents. All non-personal. |
|
||||
| Yes | Agent Data | Includes: randomly generated key and ID, role name (should not include personal info), boolean settings (verbose, delegation enabled, code execution allowed), max iterations, max RPM, max retry limit, LLM info (see LLM Attributes), list of tool names (should not include personal info). No personal data. |
|
||||
|
||||
@@ -20,6 +20,10 @@ These tools enable your agents to automate workflows, integrate with external pl
|
||||
<Card title="Multion Tool" icon="window-restore" href="/en/tools/automation/multiontool">
|
||||
Automate browser interactions and web-based workflows.
|
||||
</Card>
|
||||
|
||||
<Card title="Zapier Actions Adapter" icon="bolt" href="/en/tools/automation/zapieractionstool">
|
||||
Expose Zapier Actions as CrewAI tools for automation across thousands of apps.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
## **Common Use Cases**
|
||||
|
||||
58
docs/en/tools/automation/zapieractionstool.mdx
Normal file
@@ -0,0 +1,58 @@
|
||||
---
|
||||
title: Zapier Actions Tool
|
||||
description: The `ZapierActionsAdapter` exposes Zapier actions as CrewAI tools for automation.
|
||||
icon: bolt
|
||||
---
|
||||
|
||||
# `ZapierActionsAdapter`
|
||||
|
||||
## Description
|
||||
|
||||
Use the Zapier adapter to list and call Zapier actions as CrewAI tools. This enables agents to trigger automations across thousands of apps.
|
||||
|
||||
## Installation
|
||||
|
||||
This adapter is included with `crewai-tools`. No extra install required.
|
||||
|
||||
## Environment Variables
|
||||
|
||||
- `ZAPIER_API_KEY` (required): Zapier API key. Get one from the Zapier Actions dashboard at https://actions.zapier.com/ (create an account, then generate an API key). You can also pass `zapier_api_key` directly when constructing the adapter.
|
||||
|
||||
## Example
|
||||
|
||||
```python Code
|
||||
from crewai import Agent, Task, Crew
|
||||
from crewai_tools.adapters.zapier_adapter import ZapierActionsAdapter
|
||||
|
||||
adapter = ZapierActionsAdapter(api_key="your_zapier_api_key")
|
||||
tools = adapter.tools()
|
||||
|
||||
agent = Agent(
|
||||
role="Automator",
|
||||
goal="Execute Zapier actions",
|
||||
backstory="Automation specialist",
|
||||
tools=tools,
|
||||
verbose=True,
|
||||
)
|
||||
|
||||
task = Task(
|
||||
description="Create a new Google Sheet and add a row using Zapier actions",
|
||||
expected_output="Confirmation with created resource IDs",
|
||||
agent=agent,
|
||||
)
|
||||
|
||||
crew = Crew(agents=[agent], tasks=[task])
|
||||
result = crew.kickoff()
|
||||
```
|
||||
|
||||
## Notes & limits
|
||||
|
||||
- The adapter lists available actions for your key and creates `BaseTool` wrappers dynamically.
|
||||
- Handle action‑specific required fields in your task instructions or tool call.
|
||||
- Rate limits depend on your Zapier plan; see the Zapier Actions docs.
|
||||
|
||||
## Notes
|
||||
|
||||
- The adapter fetches available actions and generates `BaseTool` wrappers dynamically.
|
||||
|
||||
|
||||
168
docs/en/tools/database-data/mongodbvectorsearchtool.mdx
Normal file
@@ -0,0 +1,168 @@
|
||||
---
|
||||
title: MongoDB Vector Search Tool
|
||||
description: The `MongoDBVectorSearchTool` performs vector search on MongoDB Atlas with optional indexing helpers.
|
||||
icon: "leaf"
|
||||
---
|
||||
|
||||
# `MongoDBVectorSearchTool`
|
||||
|
||||
## Description
|
||||
|
||||
Perform vector similarity queries on MongoDB Atlas collections. Supports index creation helpers and bulk insert of embedded texts.
|
||||
|
||||
MongoDB Atlas supports native vector search. Learn more:
|
||||
https://www.mongodb.com/docs/atlas/atlas-vector-search/vector-search-overview/
|
||||
|
||||
## Installation
|
||||
|
||||
Install with the MongoDB extra:
|
||||
|
||||
```shell
|
||||
pip install crewai-tools[mongodb]
|
||||
```
|
||||
|
||||
or
|
||||
|
||||
```shell
|
||||
uv add crewai-tools --extra mongodb
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
### Initialization
|
||||
|
||||
- `connection_string` (str, required)
|
||||
- `database_name` (str, required)
|
||||
- `collection_name` (str, required)
|
||||
- `vector_index_name` (str, default `vector_index`)
|
||||
- `text_key` (str, default `text`)
|
||||
- `embedding_key` (str, default `embedding`)
|
||||
- `dimensions` (int, default `1536`)
|
||||
|
||||
### Run Parameters
|
||||
|
||||
- `query` (str, required): Natural language query to embed and search.
|
||||
|
||||
## Quick start
|
||||
|
||||
```python Code
|
||||
from crewai_tools import MongoDBVectorSearchTool
|
||||
|
||||
tool = MongoDBVectorSearchTool(
|
||||
connection_string="mongodb+srv://...",
|
||||
database_name="mydb",
|
||||
collection_name="docs",
|
||||
)
|
||||
|
||||
print(tool.run(query="how to create vector index"))
|
||||
```
|
||||
|
||||
## Index creation helpers
|
||||
|
||||
Use `create_vector_search_index(...)` to provision an Atlas Vector Search index with the correct dimensions and similarity.
|
||||
|
||||
## Common issues
|
||||
|
||||
- Authentication failures: ensure your Atlas IP Access List allows your runner and the connection string includes credentials.
|
||||
- Index not found: create the vector index first; name must match `vector_index_name`.
|
||||
- Dimensions mismatch: align embedding model dimensions with `dimensions`.
|
||||
|
||||
## More examples
|
||||
|
||||
### Basic initialization
|
||||
|
||||
```python Code
|
||||
from crewai_tools import MongoDBVectorSearchTool
|
||||
|
||||
tool = MongoDBVectorSearchTool(
|
||||
database_name="example_database",
|
||||
collection_name="example_collection",
|
||||
connection_string="<your_mongodb_connection_string>",
|
||||
)
|
||||
```
|
||||
|
||||
### Custom query configuration
|
||||
|
||||
```python Code
|
||||
from crewai_tools import MongoDBVectorSearchConfig, MongoDBVectorSearchTool
|
||||
|
||||
query_config = MongoDBVectorSearchConfig(limit=10, oversampling_factor=2)
|
||||
tool = MongoDBVectorSearchTool(
|
||||
database_name="example_database",
|
||||
collection_name="example_collection",
|
||||
connection_string="<your_mongodb_connection_string>",
|
||||
query_config=query_config,
|
||||
vector_index_name="my_vector_index",
|
||||
)
|
||||
|
||||
rag_agent = Agent(
|
||||
name="rag_agent",
|
||||
role="You are a helpful assistant that can answer questions with the help of the MongoDBVectorSearchTool.",
|
||||
goal="...",
|
||||
backstory="...",
|
||||
tools=[tool],
|
||||
)
|
||||
```
|
||||
|
||||
### Preloading the database and creating the index
|
||||
|
||||
```python Code
|
||||
import os
|
||||
from crewai_tools import MongoDBVectorSearchTool
|
||||
|
||||
tool = MongoDBVectorSearchTool(
|
||||
database_name="example_database",
|
||||
collection_name="example_collection",
|
||||
connection_string="<your_mongodb_connection_string>",
|
||||
)
|
||||
|
||||
# Load text content from a local folder and add to MongoDB
|
||||
texts = []
|
||||
for fname in os.listdir("knowledge"):
|
||||
path = os.path.join("knowledge", fname)
|
||||
if os.path.isfile(path):
|
||||
with open(path, "r", encoding="utf-8") as f:
|
||||
texts.append(f.read())
|
||||
|
||||
tool.add_texts(texts)
|
||||
|
||||
# Create the Atlas Vector Search index (e.g., 3072 dims for text-embedding-3-large)
|
||||
tool.create_vector_search_index(dimensions=3072)
|
||||
```
|
||||
|
||||
## Example
|
||||
|
||||
```python Code
|
||||
from crewai import Agent, Task, Crew
|
||||
from crewai_tools import MongoDBVectorSearchTool
|
||||
|
||||
tool = MongoDBVectorSearchTool(
|
||||
connection_string="mongodb+srv://...",
|
||||
database_name="mydb",
|
||||
collection_name="docs",
|
||||
)
|
||||
|
||||
agent = Agent(
|
||||
role="RAG Agent",
|
||||
goal="Answer using MongoDB vector search",
|
||||
backstory="Knowledge retrieval specialist",
|
||||
tools=[tool],
|
||||
verbose=True,
|
||||
)
|
||||
|
||||
task = Task(
|
||||
description="Find relevant content for 'indexing guidance'",
|
||||
expected_output="A concise answer citing the most relevant matches",
|
||||
agent=agent,
|
||||
)
|
||||
|
||||
crew = Crew(
|
||||
agents=[agent],
|
||||
tasks=[task],
|
||||
verbose=True,
|
||||
)
|
||||
|
||||
result = crew.kickoff()
|
||||
```
|
||||
|
||||
|
||||
@@ -32,6 +32,14 @@ These tools enable your agents to interact with various database systems, from t
|
||||
<Card title="Weaviate Vector Search" icon="network-wired" href="/en/tools/database-data/weaviatevectorsearchtool">
|
||||
Perform semantic search with Weaviate vector database.
|
||||
</Card>
|
||||
|
||||
<Card title="MongoDB Vector Search" icon="leaf" href="/en/tools/database-data/mongodbvectorsearchtool">
|
||||
Vector similarity search on MongoDB Atlas with indexing helpers.
|
||||
</Card>
|
||||
|
||||
<Card title="SingleStore Search" icon="database" href="/en/tools/database-data/singlestoresearchtool">
|
||||
Safe SELECT/SHOW queries on SingleStore with pooling and validation.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
## **Common Use Cases**
|
||||
|
||||
61
docs/en/tools/database-data/singlestoresearchtool.mdx
Normal file
@@ -0,0 +1,61 @@
|
||||
---
|
||||
title: SingleStore Search Tool
|
||||
description: The `SingleStoreSearchTool` safely executes SELECT/SHOW queries on SingleStore with pooling.
|
||||
icon: circle
|
||||
---
|
||||
|
||||
# `SingleStoreSearchTool`
|
||||
|
||||
## Description
|
||||
|
||||
Execute read‑only queries (`SELECT`/`SHOW`) against SingleStore with connection pooling and input validation.
|
||||
|
||||
## Installation
|
||||
|
||||
```shell
|
||||
uv add crewai-tools[singlestore]
|
||||
```
|
||||
|
||||
## Environment Variables
|
||||
|
||||
Variables like `SINGLESTOREDB_HOST`, `SINGLESTOREDB_USER`, `SINGLESTOREDB_PASSWORD`, etc., can be used, or `SINGLESTOREDB_URL` as a single DSN.
|
||||
|
||||
Generate the API key from the SingleStore dashboard, [docs here](https://docs.singlestore.com/cloud/reference/management-api/#generate-an-api-key).
|
||||
|
||||
## Example
|
||||
|
||||
```python Code
|
||||
from crewai import Agent, Task, Crew
|
||||
from crewai_tools import SingleStoreSearchTool
|
||||
|
||||
tool = SingleStoreSearchTool(
|
||||
tables=["products"],
|
||||
host="host",
|
||||
user="user",
|
||||
password="pass",
|
||||
database="db",
|
||||
)
|
||||
|
||||
agent = Agent(
|
||||
role="Analyst",
|
||||
goal="Query SingleStore",
|
||||
tools=[tool],
|
||||
verbose=True,
|
||||
)
|
||||
|
||||
task = Task(
|
||||
description="List 5 products",
|
||||
expected_output="5 rows as JSON/text",
|
||||
agent=agent,
|
||||
)
|
||||
|
||||
crew = Crew(
|
||||
agents=[agent],
|
||||
tasks=[task],
|
||||
verbose=True,
|
||||
)
|
||||
|
||||
result = crew.kickoff()
|
||||
```
|
||||
|
||||
|
||||
89
docs/en/tools/file-document/ocrtool.mdx
Normal file
@@ -0,0 +1,89 @@
|
||||
---
|
||||
title: OCR Tool
|
||||
description: The `OCRTool` extracts text from local images or image URLs using an LLM with vision.
|
||||
icon: image
|
||||
---
|
||||
|
||||
# `OCRTool`
|
||||
|
||||
## Description
|
||||
|
||||
Extract text from images (local path or URL). Uses a vision‑capable LLM via CrewAI’s LLM interface.
|
||||
|
||||
## Installation
|
||||
|
||||
No extra install beyond `crewai-tools`. Ensure your selected LLM supports vision.
|
||||
|
||||
## Parameters
|
||||
|
||||
### Run Parameters
|
||||
|
||||
- `image_path_url` (str, required): Local image path or HTTP(S) URL.
|
||||
|
||||
## Examples
|
||||
|
||||
### Direct usage
|
||||
|
||||
```python Code
|
||||
from crewai_tools import OCRTool
|
||||
|
||||
print(OCRTool().run(image_path_url="/tmp/receipt.png"))
|
||||
```
|
||||
|
||||
### With an agent
|
||||
|
||||
```python Code
|
||||
from crewai import Agent, Task, Crew
|
||||
from crewai_tools import OCRTool
|
||||
|
||||
ocr = OCRTool()
|
||||
|
||||
agent = Agent(
|
||||
role="OCR",
|
||||
goal="Extract text",
|
||||
tools=[ocr],
|
||||
)
|
||||
|
||||
task = Task(
|
||||
description="Extract text from https://example.com/invoice.jpg",
|
||||
expected_output="All detected text in plain text",
|
||||
agent=agent,
|
||||
)
|
||||
|
||||
crew = Crew(agents=[agent], tasks=[task])
|
||||
result = crew.kickoff()
|
||||
```
|
||||
|
||||
## Notes
|
||||
|
||||
- Ensure the selected LLM supports image inputs.
|
||||
- For large images, consider downscaling to reduce token usage.
|
||||
- You can pass a specific LLM instance to the tool (e.g., `LLM(model="gpt-4o")`) if needed, matching the README guidance.
|
||||
|
||||
## Example
|
||||
|
||||
```python Code
|
||||
from crewai import Agent, Task, Crew
|
||||
from crewai_tools import OCRTool
|
||||
|
||||
tool = OCRTool()
|
||||
|
||||
agent = Agent(
|
||||
role="OCR Specialist",
|
||||
goal="Extract text from images",
|
||||
backstory="Vision‑enabled analyst",
|
||||
tools=[tool],
|
||||
verbose=True,
|
||||
)
|
||||
|
||||
task = Task(
|
||||
description="Extract text from https://example.com/receipt.png",
|
||||
expected_output="All detected text in plain text",
|
||||
agent=agent,
|
||||
)
|
||||
|
||||
crew = Crew(agents=[agent], tasks=[task])
|
||||
result = crew.kickoff()
|
||||
```
|
||||
|
||||
|
||||
@@ -52,6 +52,14 @@ These tools enable your agents to work with various file formats and document ty
|
||||
<Card title="Directory Read Tool" icon="folder" href="/en/tools/file-document/directoryreadtool">
|
||||
Read and list directory contents, file structures, and metadata.
|
||||
</Card>
|
||||
|
||||
<Card title="OCR Tool" icon="image" href="/en/tools/file-document/ocrtool">
|
||||
Extract text from images (local files or URLs) using a vision‑capable LLM.
|
||||
</Card>
|
||||
|
||||
<Card title="PDF Text Writing Tool" icon="file-pdf" href="/en/tools/file-document/pdf-text-writing-tool">
|
||||
Write text at specific coordinates in PDFs, with optional custom fonts.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
## **Common Use Cases**
|
||||
|
||||
76
docs/en/tools/file-document/pdf-text-writing-tool.mdx
Normal file
@@ -0,0 +1,76 @@
|
||||
---
|
||||
title: PDF Text Writing Tool
|
||||
description: The `PDFTextWritingTool` writes text to specific positions in a PDF, supporting custom fonts.
|
||||
icon: file-pdf
|
||||
---
|
||||
|
||||
# `PDFTextWritingTool`
|
||||
|
||||
## Description
|
||||
|
||||
Write text at precise coordinates on a PDF page, optionally embedding a custom TrueType font.
|
||||
|
||||
## Parameters
|
||||
|
||||
### Run Parameters
|
||||
|
||||
- `pdf_path` (str, required): Path to the input PDF.
|
||||
- `text` (str, required): Text to add.
|
||||
- `position` (tuple[int, int], required): `(x, y)` coordinates.
|
||||
- `font_size` (int, default `12`)
|
||||
- `font_color` (str, default `"0 0 0 rg"`)
|
||||
- `font_name` (str, default `"F1"`)
|
||||
- `font_file` (str, optional): Path to `.ttf` file.
|
||||
- `page_number` (int, default `0`)
|
||||
|
||||
## Example
|
||||
|
||||
```python Code
|
||||
from crewai import Agent, Task, Crew
|
||||
from crewai_tools import PDFTextWritingTool
|
||||
|
||||
tool = PDFTextWritingTool()
|
||||
|
||||
agent = Agent(
|
||||
role="PDF Editor",
|
||||
goal="Annotate PDFs",
|
||||
backstory="Documentation specialist",
|
||||
tools=[tool],
|
||||
verbose=True,
|
||||
)
|
||||
|
||||
task = Task(
|
||||
description="Write 'CONFIDENTIAL' at (72, 720) on page 1 of ./sample.pdf",
|
||||
expected_output="Confirmation message",
|
||||
agent=agent,
|
||||
)
|
||||
|
||||
crew = Crew(
|
||||
agents=[agent],
|
||||
tasks=[task],
|
||||
verbose=True,
|
||||
)
|
||||
|
||||
result = crew.kickoff()
|
||||
```
|
||||
|
||||
### Direct usage
|
||||
|
||||
```python Code
|
||||
from crewai_tools import PDFTextWritingTool
|
||||
|
||||
PDFTextWritingTool().run(
|
||||
pdf_path="./input.pdf",
|
||||
text="CONFIDENTIAL",
|
||||
position=(72, 720),
|
||||
font_size=18,
|
||||
page_number=0,
|
||||
)
|
||||
```
|
||||
|
||||
## Tips
|
||||
|
||||
- Coordinate origin is the bottom‑left corner.
|
||||
- If using a custom font (`font_file`), ensure it is a valid `.ttf`.
|
||||
|
||||
|
||||
112
docs/en/tools/search-research/arxivpapertool.mdx
Normal file
@@ -0,0 +1,112 @@
|
||||
---
|
||||
title: Arxiv Paper Tool
|
||||
description: The `ArxivPaperTool` searches arXiv for papers matching a query and optionally downloads PDFs.
|
||||
icon: box-archive
|
||||
---
|
||||
|
||||
# `ArxivPaperTool`
|
||||
|
||||
## Description
|
||||
|
||||
The `ArxivPaperTool` queries the arXiv API for academic papers and returns compact, readable results. It can also optionally download PDFs to disk.
|
||||
|
||||
## Installation
|
||||
|
||||
This tool has no special installation beyond `crewai-tools`.
|
||||
|
||||
```shell
|
||||
uv add crewai-tools
|
||||
```
|
||||
|
||||
No API key is required. This tool uses the public arXiv Atom API.
|
||||
|
||||
## Steps to Get Started
|
||||
|
||||
1. Initialize the tool.
|
||||
2. Provide a `search_query` (e.g., "transformer neural network").
|
||||
3. Optionally set `max_results` (1–100) and enable PDF downloads in the constructor.
|
||||
|
||||
## Example
|
||||
|
||||
```python Code
|
||||
from crewai import Agent, Task, Crew
|
||||
from crewai_tools import ArxivPaperTool
|
||||
|
||||
tool = ArxivPaperTool(
|
||||
download_pdfs=False,
|
||||
save_dir="./arxiv_pdfs",
|
||||
use_title_as_filename=True,
|
||||
)
|
||||
|
||||
agent = Agent(
|
||||
role="Researcher",
|
||||
goal="Find relevant arXiv papers",
|
||||
backstory="Expert at literature discovery",
|
||||
tools=[tool],
|
||||
verbose=True,
|
||||
)
|
||||
|
||||
task = Task(
|
||||
description="Search arXiv for 'transformer neural network' and list top 5 results.",
|
||||
expected_output="A concise list of 5 relevant papers with titles, links, and summaries.",
|
||||
agent=agent,
|
||||
)
|
||||
|
||||
crew = Crew(agents=[agent], tasks=[task])
|
||||
result = crew.kickoff()
|
||||
```
|
||||
|
||||
### Direct usage (without Agent)
|
||||
|
||||
```python Code
|
||||
from crewai_tools import ArxivPaperTool
|
||||
|
||||
tool = ArxivPaperTool(
|
||||
download_pdfs=True,
|
||||
save_dir="./arxiv_pdfs",
|
||||
)
|
||||
print(tool.run(search_query="mixture of experts", max_results=3))
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
### Initialization Parameters
|
||||
|
||||
- `download_pdfs` (bool, default `False`): Whether to download PDFs.
|
||||
- `save_dir` (str, default `./arxiv_pdfs`): Directory to save PDFs.
|
||||
- `use_title_as_filename` (bool, default `False`): Use paper titles for filenames.
|
||||
|
||||
### Run Parameters
|
||||
|
||||
- `search_query` (str, required): The arXiv search query.
|
||||
- `max_results` (int, default `5`, range 1–100): Number of results.
|
||||
|
||||
## Output format
|
||||
|
||||
The tool returns a human‑readable list of papers with:
|
||||
- Title
|
||||
- Link (abs page)
|
||||
- Snippet/summary (truncated)
|
||||
|
||||
When `download_pdfs=True`, PDFs are saved to disk and the summary mentions saved files.
|
||||
|
||||
## Usage Notes
|
||||
|
||||
- The tool returns formatted text with key metadata and links.
|
||||
- When `download_pdfs=True`, PDFs will be stored in `save_dir`.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
- If you receive a network timeout, re‑try or reduce `max_results`.
|
||||
- Invalid XML errors indicate an arXiv response parse issue; try a simpler query.
|
||||
- File system errors (e.g., permission denied) may occur when saving PDFs; ensure `save_dir` is writable.
|
||||
|
||||
## Related links
|
||||
|
||||
- arXiv API docs: https://info.arxiv.org/help/api/index.html
|
||||
|
||||
## Error Handling
|
||||
|
||||
- Network issues, invalid XML, and OS errors are handled with informative messages.
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ pip install 'crewai[tools]'
|
||||
To effectively use the `BraveSearchTool`, follow these steps:
|
||||
|
||||
1. **Package Installation**: Confirm that the `crewai[tools]` package is installed in your Python environment.
|
||||
2. **API Key Acquisition**: Acquire a Brave Search API key by registering at [Brave Search API](https://api.search.brave.com/app/keys).
|
||||
2. **API Key Acquisition**: Acquire a Brave Search API key at https://api.search.brave.com/app/keys (sign in to generate a key).
|
||||
3. **Environment Configuration**: Store your obtained API key in an environment variable named `BRAVE_API_KEY` to facilitate its use by the tool.
|
||||
|
||||
## Example
|
||||
|
||||
80
docs/en/tools/search-research/databricks-query-tool.mdx
Normal file
@@ -0,0 +1,80 @@
|
||||
---
|
||||
title: Databricks SQL Query Tool
|
||||
description: The `DatabricksQueryTool` executes SQL queries against Databricks workspace tables.
|
||||
icon: trowel-bricks
|
||||
---
|
||||
|
||||
# `DatabricksQueryTool`
|
||||
|
||||
## Description
|
||||
|
||||
Run SQL against Databricks workspace tables with either CLI profile or direct host/token authentication.
|
||||
|
||||
## Installation
|
||||
|
||||
```shell
|
||||
uv add crewai-tools[databricks-sdk]
|
||||
```
|
||||
|
||||
## Environment Variables
|
||||
|
||||
- `DATABRICKS_CONFIG_PROFILE` or (`DATABRICKS_HOST` + `DATABRICKS_TOKEN`)
|
||||
|
||||
Create a personal access token and find host details in the Databricks workspace under User Settings → Developer.
|
||||
Docs: https://docs.databricks.com/en/dev-tools/auth/pat.html
|
||||
|
||||
## Example
|
||||
|
||||
```python Code
|
||||
from crewai import Agent, Task, Crew
|
||||
from crewai_tools import DatabricksQueryTool
|
||||
|
||||
tool = DatabricksQueryTool(
|
||||
default_catalog="main",
|
||||
default_schema="default",
|
||||
)
|
||||
|
||||
agent = Agent(
|
||||
role="Data Analyst",
|
||||
goal="Query Databricks",
|
||||
tools=[tool],
|
||||
verbose=True,
|
||||
)
|
||||
|
||||
task = Task(
|
||||
description="SELECT * FROM my_table LIMIT 10",
|
||||
expected_output="10 rows",
|
||||
agent=agent,
|
||||
)
|
||||
|
||||
crew = Crew(
|
||||
agents=[agent],
|
||||
tasks=[task],
|
||||
verbose=True,
|
||||
)
|
||||
result = crew.kickoff()
|
||||
|
||||
print(result)
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
- `query` (required): SQL query to execute
|
||||
- `catalog` (optional): Override default catalog
|
||||
- `db_schema` (optional): Override default schema
|
||||
- `warehouse_id` (optional): Override default SQL warehouse
|
||||
- `row_limit` (optional): Maximum rows to return (default: 1000)
|
||||
|
||||
## Defaults on initialization
|
||||
|
||||
- `default_catalog`
|
||||
- `default_schema`
|
||||
- `default_warehouse_id`
|
||||
|
||||
### Error handling & tips
|
||||
|
||||
- Authentication errors: verify `DATABRICKS_HOST` begins with `https://` and token is valid.
|
||||
- Permissions: ensure your SQL warehouse and schema are accessible by your token.
|
||||
- Limits: long‑running queries should be avoided in agent loops; add filters/limits.
|
||||
|
||||
|
||||
@@ -24,6 +24,8 @@ pip install 'crewai[tools]'
|
||||
|
||||
This command installs the necessary package to run the GithubSearchTool along with any other tools included in the crewai_tools package.
|
||||
|
||||
Get a GitHub Personal Access Token at https://github.com/settings/tokens (Developer settings → Fine‑grained tokens or classic tokens).
|
||||
|
||||
## Example
|
||||
|
||||
Here’s how you can use the GithubSearchTool to perform semantic searches within a GitHub repository:
|
||||
|
||||
@@ -52,6 +52,18 @@ These tools enable your agents to search the web, research topics, and find info
|
||||
<Card title="Tavily Extractor Tool" icon="file-text" href="/en/tools/search-research/tavilyextractortool">
|
||||
Extract structured content from web pages using the Tavily API.
|
||||
</Card>
|
||||
|
||||
<Card title="Arxiv Paper Tool" icon="box-archive" href="/en/tools/search-research/arxivpapertool">
|
||||
Search arXiv and optionally download PDFs.
|
||||
</Card>
|
||||
|
||||
<Card title="SerpApi Google Search" icon="search" href="/en/tools/search-research/serpapi-googlesearchtool">
|
||||
Google search via SerpApi with structured results.
|
||||
</Card>
|
||||
|
||||
<Card title="SerpApi Google Shopping" icon="cart-shopping" href="/en/tools/search-research/serpapi-googleshoppingtool">
|
||||
Google Shopping queries via SerpApi.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
## **Common Use Cases**
|
||||
|
||||
65
docs/en/tools/search-research/serpapi-googlesearchtool.mdx
Normal file
@@ -0,0 +1,65 @@
|
||||
---
|
||||
title: SerpApi Google Search Tool
|
||||
description: The `SerpApiGoogleSearchTool` performs Google searches using the SerpApi service.
|
||||
icon: google
|
||||
---
|
||||
|
||||
# `SerpApiGoogleSearchTool`
|
||||
|
||||
## Description
|
||||
|
||||
Use the `SerpApiGoogleSearchTool` to run Google searches with SerpApi and retrieve structured results. Requires a SerpApi API key.
|
||||
|
||||
## Installation
|
||||
|
||||
```shell
|
||||
uv add crewai-tools[serpapi]
|
||||
```
|
||||
|
||||
## Environment Variables
|
||||
|
||||
- `SERPAPI_API_KEY` (required): API key for SerpApi. Create one at https://serpapi.com/ (free tier available).
|
||||
|
||||
## Example
|
||||
|
||||
```python Code
|
||||
from crewai import Agent, Task, Crew
|
||||
from crewai_tools import SerpApiGoogleSearchTool
|
||||
|
||||
tool = SerpApiGoogleSearchTool()
|
||||
|
||||
agent = Agent(
|
||||
role="Researcher",
|
||||
goal="Answer questions using Google search",
|
||||
backstory="Search specialist",
|
||||
tools=[tool],
|
||||
verbose=True,
|
||||
)
|
||||
|
||||
task = Task(
|
||||
description="Search for the latest CrewAI releases",
|
||||
expected_output="A concise list of relevant results with titles and links",
|
||||
agent=agent,
|
||||
)
|
||||
|
||||
crew = Crew(agents=[agent], tasks=[task])
|
||||
result = crew.kickoff()
|
||||
```
|
||||
|
||||
## Notes
|
||||
|
||||
- Set `SERPAPI_API_KEY` in the environment. Create a key at https://serpapi.com/
|
||||
- See also Google Shopping via SerpApi: `/en/tools/search-research/serpapi-googleshoppingtool`
|
||||
|
||||
## Parameters
|
||||
|
||||
### Run Parameters
|
||||
|
||||
- `search_query` (str, required): The Google query.
|
||||
- `location` (str, optional): Geographic location parameter.
|
||||
|
||||
## Notes
|
||||
|
||||
- This tool wraps SerpApi and returns structured search results.
|
||||
|
||||
|
||||
61
docs/en/tools/search-research/serpapi-googleshoppingtool.mdx
Normal file
@@ -0,0 +1,61 @@
|
||||
---
|
||||
title: SerpApi Google Shopping Tool
|
||||
description: The `SerpApiGoogleShoppingTool` searches Google Shopping results using SerpApi.
|
||||
icon: cart-shopping
|
||||
---
|
||||
|
||||
# `SerpApiGoogleShoppingTool`
|
||||
|
||||
## Description
|
||||
|
||||
Leverage `SerpApiGoogleShoppingTool` to query Google Shopping via SerpApi and retrieve product-oriented results.
|
||||
|
||||
## Installation
|
||||
|
||||
```shell
|
||||
uv add crewai-tools[serpapi]
|
||||
```
|
||||
|
||||
## Environment Variables
|
||||
|
||||
- `SERPAPI_API_KEY` (required): API key for SerpApi. Create one at https://serpapi.com/ (free tier available).
|
||||
|
||||
## Example
|
||||
|
||||
```python Code
|
||||
from crewai import Agent, Task, Crew
|
||||
from crewai_tools import SerpApiGoogleShoppingTool
|
||||
|
||||
tool = SerpApiGoogleShoppingTool()
|
||||
|
||||
agent = Agent(
|
||||
role="Shopping Researcher",
|
||||
goal="Find relevant products",
|
||||
backstory="Expert in product search",
|
||||
tools=[tool],
|
||||
verbose=True,
|
||||
)
|
||||
|
||||
task = Task(
|
||||
description="Search Google Shopping for 'wireless noise-canceling headphones'",
|
||||
expected_output="Top relevant products with titles and links",
|
||||
agent=agent,
|
||||
)
|
||||
|
||||
crew = Crew(agents=[agent], tasks=[task])
|
||||
result = crew.kickoff()
|
||||
```
|
||||
|
||||
## Notes
|
||||
|
||||
- Set `SERPAPI_API_KEY` in the environment. Create a key at https://serpapi.com/
|
||||
- See also Google Web Search via SerpApi: `/en/tools/search-research/serpapi-googlesearchtool`
|
||||
|
||||
## Parameters
|
||||
|
||||
### Run Parameters
|
||||
|
||||
- `search_query` (str, required): Product search query.
|
||||
- `location` (str, optional): Geographic location parameter.
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ to fetch and display the most relevant search results based on the query provide
|
||||
To effectively use the `SerperDevTool`, follow these steps:
|
||||
|
||||
1. **Package Installation**: Confirm that the `crewai[tools]` package is installed in your Python environment.
|
||||
2. **API Key Acquisition**: Acquire a `serper.dev` API key by registering for a free account at `serper.dev`.
|
||||
2. **API Key Acquisition**: Acquire a `serper.dev` API key at https://serper.dev/ (free tier available).
|
||||
3. **Environment Configuration**: Store your obtained API key in an environment variable named `SERPER_API_KEY` to facilitate its use by the tool.
|
||||
|
||||
To incorporate this tool into your project, follow the installation instructions below:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
title: "Tavily Extractor Tool"
|
||||
description: "Extract structured content from web pages using the Tavily API"
|
||||
icon: "file-text"
|
||||
icon: square-poll-horizontal
|
||||
---
|
||||
|
||||
The `TavilyExtractorTool` allows CrewAI agents to extract structured content from web pages using the Tavily API. It can process single URLs or lists of URLs and provides options for controlling the extraction depth and including images.
|
||||
|
||||
@@ -22,6 +22,8 @@ Ensure your Tavily API key is set as an environment variable:
|
||||
export TAVILY_API_KEY='your_tavily_api_key'
|
||||
```
|
||||
|
||||
Get an API key at https://app.tavily.com/ (sign up, then create a key).
|
||||
|
||||
## Example Usage
|
||||
|
||||
Here's how to initialize and use the `TavilySearchTool` within a CrewAI agent:
|
||||
|
||||
111
docs/en/tools/web-scraping/brightdata-tools.mdx
Normal file
@@ -0,0 +1,111 @@
|
||||
---
|
||||
title: Bright Data Tools
|
||||
description: Bright Data integrations for SERP search, Web Unlocker scraping, and Dataset API.
|
||||
icon: spider
|
||||
---
|
||||
|
||||
# Bright Data Tools
|
||||
|
||||
This set of tools integrates Bright Data services for web extraction.
|
||||
|
||||
## Installation
|
||||
|
||||
```shell
|
||||
uv add crewai-tools requests aiohttp
|
||||
```
|
||||
|
||||
## Environment Variables
|
||||
|
||||
- `BRIGHT_DATA_API_KEY` (required)
|
||||
- `BRIGHT_DATA_ZONE` (for SERP/Web Unlocker)
|
||||
|
||||
Create credentials at https://brightdata.com/ (sign up, then create an API token and zone).
|
||||
See their docs: https://developers.brightdata.com/
|
||||
|
||||
## Included Tools
|
||||
|
||||
- `BrightDataSearchTool`: SERP search (Google/Bing/Yandex) with geo/language/device options.
|
||||
- `BrightDataWebUnlockerTool`: Scrape pages with anti-bot bypass and rendering.
|
||||
- `BrightDataDatasetTool`: Run Dataset API jobs and fetch results.
|
||||
|
||||
## Examples
|
||||
|
||||
### SERP Search
|
||||
|
||||
```python Code
|
||||
from crewai_tools import BrightDataSearchTool
|
||||
|
||||
tool = BrightDataSearchTool(
|
||||
query="CrewAI",
|
||||
country="us",
|
||||
)
|
||||
|
||||
print(tool.run())
|
||||
```
|
||||
|
||||
### Web Unlocker
|
||||
|
||||
```python Code
|
||||
from crewai_tools import BrightDataWebUnlockerTool
|
||||
|
||||
tool = BrightDataWebUnlockerTool(
|
||||
url="https://example.com",
|
||||
format="markdown",
|
||||
)
|
||||
|
||||
print(tool.run(url="https://example.com"))
|
||||
```
|
||||
|
||||
### Dataset API
|
||||
|
||||
```python Code
|
||||
from crewai_tools import BrightDataDatasetTool
|
||||
|
||||
tool = BrightDataDatasetTool(
|
||||
dataset_type="ecommerce",
|
||||
url="https://example.com/product",
|
||||
)
|
||||
|
||||
print(tool.run())
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
- 401/403: verify `BRIGHT_DATA_API_KEY` and `BRIGHT_DATA_ZONE`.
|
||||
- Empty/blocked content: enable rendering or try a different zone.
|
||||
|
||||
## Example
|
||||
|
||||
```python Code
|
||||
from crewai import Agent, Task, Crew
|
||||
from crewai_tools import BrightDataSearchTool
|
||||
|
||||
tool = BrightDataSearchTool(
|
||||
query="CrewAI",
|
||||
country="us",
|
||||
)
|
||||
|
||||
agent = Agent(
|
||||
role="Web Researcher",
|
||||
goal="Search with Bright Data",
|
||||
backstory="Finds reliable results",
|
||||
tools=[tool],
|
||||
verbose=True,
|
||||
)
|
||||
|
||||
task = Task(
|
||||
description="Search for CrewAI and summarize top results",
|
||||
expected_output="Short summary with links",
|
||||
agent=agent,
|
||||
)
|
||||
|
||||
crew = Crew(
|
||||
agents=[agent],
|
||||
tasks=[task],
|
||||
verbose=True,
|
||||
)
|
||||
|
||||
result = crew.kickoff()
|
||||
```
|
||||
|
||||
|
||||
@@ -60,6 +60,10 @@ These tools enable your agents to interact with the web, extract data from websi
|
||||
<Card title="Oxylabs Scraper Tool" icon="globe" href="/en/tools/web-scraping/oxylabsscraperstool">
|
||||
Access web data at scale with Oxylabs.
|
||||
</Card>
|
||||
|
||||
<Card title="Bright Data Tools" icon="spider" href="/en/tools/web-scraping/brightdata-tools">
|
||||
SERP search, Web Unlocker, and Dataset API integrations.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
## **Common Use Cases**
|
||||
|
||||
435
docs/enterprise-api.en.yaml
Normal file
@@ -0,0 +1,435 @@
|
||||
openapi: 3.0.3
|
||||
info:
|
||||
title: CrewAI Enterprise API
|
||||
description: |
|
||||
REST API for interacting with your deployed CrewAI crews on CrewAI Enterprise.
|
||||
|
||||
## Getting Started
|
||||
|
||||
1. **Find your crew URL**: Get your unique crew URL from the CrewAI Enterprise dashboard
|
||||
2. **Copy examples**: Use the code examples from each endpoint page as templates
|
||||
3. **Replace placeholders**: Update URLs and tokens with your actual values
|
||||
4. **Test with your tools**: Use cURL, Postman, or your preferred API client
|
||||
|
||||
## Authentication
|
||||
|
||||
All API requests require a bearer token for authentication. There are two types of tokens:
|
||||
|
||||
- **Bearer Token**: Organization-level token for full crew operations
|
||||
- **User Bearer Token**: User-scoped token for individual access with limited permissions
|
||||
|
||||
You can find your bearer tokens in the Status tab of your crew's detail page in the CrewAI Enterprise dashboard.
|
||||
|
||||
## Reference Documentation
|
||||
|
||||
This documentation provides comprehensive examples for each endpoint:
|
||||
|
||||
- **Request formats** with all required and optional parameters
|
||||
- **Response examples** for success and error scenarios
|
||||
- **Code samples** in multiple programming languages
|
||||
- **Authentication patterns** with proper Bearer token usage
|
||||
|
||||
Copy the examples and customize them with your actual crew URL and authentication tokens.
|
||||
|
||||
## Workflow
|
||||
|
||||
1. **Discover inputs** using `GET /inputs`
|
||||
2. **Start execution** using `POST /kickoff`
|
||||
3. **Monitor progress** using `GET /status/{kickoff_id}`
|
||||
version: 1.0.0
|
||||
contact:
|
||||
name: CrewAI Support
|
||||
email: support@crewai.com
|
||||
url: https://crewai.com
|
||||
servers:
|
||||
- url: https://your-actual-crew-name.crewai.com
|
||||
description: Replace with your actual deployed crew URL from the CrewAI Enterprise dashboard
|
||||
- url: https://my-travel-crew.crewai.com
|
||||
description: Example travel planning crew (replace with your URL)
|
||||
- url: https://content-creation-crew.crewai.com
|
||||
description: Example content creation crew (replace with your URL)
|
||||
- url: https://research-assistant-crew.crewai.com
|
||||
description: Example research assistant crew (replace with your URL)
|
||||
security:
|
||||
- BearerAuth: []
|
||||
paths:
|
||||
/inputs:
|
||||
get:
|
||||
summary: Get Required Inputs
|
||||
description: |
|
||||
**📋 Reference Example Only** - *This shows the request format. To test with your actual crew, copy the cURL example and replace the URL + token with your real values.*
|
||||
|
||||
Retrieves the list of all required input parameters that your crew expects for execution.
|
||||
Use this endpoint to discover what inputs you need to provide when starting a crew execution.
|
||||
operationId: getRequiredInputs
|
||||
responses:
|
||||
'200':
|
||||
description: Successfully retrieved required inputs
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
inputs:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
description: Array of required input parameter names
|
||||
example: ["budget", "interests", "duration", "age"]
|
||||
examples:
|
||||
travel_crew:
|
||||
summary: Travel planning crew inputs
|
||||
value:
|
||||
inputs: ["budget", "interests", "duration", "age"]
|
||||
outreach_crew:
|
||||
summary: Outreach crew inputs
|
||||
value:
|
||||
inputs: ["name", "title", "company", "industry", "our_product", "linkedin_url"]
|
||||
'401':
|
||||
$ref: '#/components/responses/UnauthorizedError'
|
||||
'404':
|
||||
$ref: '#/components/responses/NotFoundError'
|
||||
'500':
|
||||
$ref: '#/components/responses/ServerError'
|
||||
|
||||
/kickoff:
|
||||
post:
|
||||
summary: Start Crew Execution
|
||||
description: |
|
||||
**📋 Reference Example Only** - *This shows the request format. To test with your actual crew, copy the cURL example and replace the URL + token with your real values.*
|
||||
|
||||
Initiates a new crew execution with the provided inputs. Returns a kickoff ID that can be used
|
||||
to track the execution progress and retrieve results.
|
||||
|
||||
Crew executions can take anywhere from seconds to minutes depending on their complexity.
|
||||
Consider using webhooks for real-time notifications or implement polling with the status endpoint.
|
||||
operationId: startCrewExecution
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
required:
|
||||
- inputs
|
||||
properties:
|
||||
inputs:
|
||||
type: object
|
||||
description: Key-value pairs of all required inputs for your crew
|
||||
additionalProperties:
|
||||
type: string
|
||||
example:
|
||||
budget: "1000 USD"
|
||||
interests: "games, tech, ai, relaxing hikes, amazing food"
|
||||
duration: "7 days"
|
||||
age: "35"
|
||||
meta:
|
||||
type: object
|
||||
description: Additional metadata to pass to the crew
|
||||
additionalProperties: true
|
||||
example:
|
||||
requestId: "user-request-12345"
|
||||
source: "mobile-app"
|
||||
taskWebhookUrl:
|
||||
type: string
|
||||
format: uri
|
||||
description: Callback URL executed after each task completion
|
||||
example: "https://your-server.com/webhooks/task"
|
||||
stepWebhookUrl:
|
||||
type: string
|
||||
format: uri
|
||||
description: Callback URL executed after each agent thought/action
|
||||
example: "https://your-server.com/webhooks/step"
|
||||
crewWebhookUrl:
|
||||
type: string
|
||||
format: uri
|
||||
description: Callback URL executed when the crew execution completes
|
||||
example: "https://your-server.com/webhooks/crew"
|
||||
examples:
|
||||
travel_planning:
|
||||
summary: Travel planning crew
|
||||
value:
|
||||
inputs:
|
||||
budget: "1000 USD"
|
||||
interests: "games, tech, ai, relaxing hikes, amazing food"
|
||||
duration: "7 days"
|
||||
age: "35"
|
||||
meta:
|
||||
requestId: "travel-req-123"
|
||||
source: "web-app"
|
||||
outreach_campaign:
|
||||
summary: Outreach crew with webhooks
|
||||
value:
|
||||
inputs:
|
||||
name: "John Smith"
|
||||
title: "CTO"
|
||||
company: "TechCorp"
|
||||
industry: "Software"
|
||||
our_product: "AI Development Platform"
|
||||
linkedin_url: "https://linkedin.com/in/johnsmith"
|
||||
taskWebhookUrl: "https://api.example.com/webhooks/task"
|
||||
crewWebhookUrl: "https://api.example.com/webhooks/crew"
|
||||
responses:
|
||||
'200':
|
||||
description: Crew execution started successfully
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
kickoff_id:
|
||||
type: string
|
||||
format: uuid
|
||||
description: Unique identifier for tracking this execution
|
||||
example: "abcd1234-5678-90ef-ghij-klmnopqrstuv"
|
||||
'400':
|
||||
description: Invalid request body or missing required inputs
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Error'
|
||||
'401':
|
||||
$ref: '#/components/responses/UnauthorizedError'
|
||||
'422':
|
||||
description: Validation error - ensure all required inputs are provided
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ValidationError'
|
||||
'500':
|
||||
$ref: '#/components/responses/ServerError'
|
||||
|
||||
/status/{kickoff_id}:
|
||||
get:
|
||||
summary: Get Execution Status
|
||||
description: |
|
||||
**📋 Reference Example Only** - *This shows the request format. To test with your actual crew, copy the cURL example and replace the URL + token with your real values.*
|
||||
|
||||
Retrieves the current status and results of a crew execution using its kickoff ID.
|
||||
|
||||
The response structure varies depending on the execution state:
|
||||
- **running**: Execution in progress with current task info
|
||||
- **completed**: Execution finished with full results
|
||||
- **error**: Execution failed with error details
|
||||
operationId: getExecutionStatus
|
||||
parameters:
|
||||
- name: kickoff_id
|
||||
in: path
|
||||
required: true
|
||||
description: The kickoff ID returned from the /kickoff endpoint
|
||||
schema:
|
||||
type: string
|
||||
format: uuid
|
||||
example: "abcd1234-5678-90ef-ghij-klmnopqrstuv"
|
||||
responses:
|
||||
'200':
|
||||
description: Successfully retrieved execution status
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
oneOf:
|
||||
- $ref: '#/components/schemas/ExecutionRunning'
|
||||
- $ref: '#/components/schemas/ExecutionCompleted'
|
||||
- $ref: '#/components/schemas/ExecutionError'
|
||||
examples:
|
||||
running:
|
||||
summary: Execution in progress
|
||||
value:
|
||||
status: "running"
|
||||
current_task: "research_task"
|
||||
progress:
|
||||
completed_tasks: 1
|
||||
total_tasks: 3
|
||||
completed:
|
||||
summary: Execution completed successfully
|
||||
value:
|
||||
status: "completed"
|
||||
result:
|
||||
output: "Comprehensive travel itinerary for 7 days in Japan focusing on tech culture..."
|
||||
tasks:
|
||||
- task_id: "research_task"
|
||||
output: "Research findings on tech destinations in Japan..."
|
||||
agent: "Travel Researcher"
|
||||
execution_time: 45.2
|
||||
- task_id: "planning_task"
|
||||
output: "7-day detailed itinerary with activities and recommendations..."
|
||||
agent: "Trip Planner"
|
||||
execution_time: 62.8
|
||||
execution_time: 108.5
|
||||
error:
|
||||
summary: Execution failed
|
||||
value:
|
||||
status: "error"
|
||||
error: "Task execution failed: Invalid API key for external service"
|
||||
execution_time: 23.1
|
||||
'401':
|
||||
$ref: '#/components/responses/UnauthorizedError'
|
||||
'404':
|
||||
description: Kickoff ID not found
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Error'
|
||||
example:
|
||||
error: "Execution not found"
|
||||
message: "No execution found with ID: abcd1234-5678-90ef-ghij-klmnopqrstuv"
|
||||
'500':
|
||||
$ref: '#/components/responses/ServerError'
|
||||
|
||||
components:
|
||||
securitySchemes:
|
||||
BearerAuth:
|
||||
type: http
|
||||
scheme: bearer
|
||||
description: |
|
||||
**📋 Reference Documentation** - *The tokens shown in examples are placeholders for reference only.*
|
||||
|
||||
Use your actual Bearer Token or User Bearer Token from the CrewAI Enterprise dashboard for real API calls.
|
||||
|
||||
**Bearer Token**: Organization-level access for full crew operations
|
||||
**User Bearer Token**: User-scoped access with limited permissions
|
||||
|
||||
schemas:
|
||||
ExecutionRunning:
|
||||
type: object
|
||||
properties:
|
||||
status:
|
||||
type: string
|
||||
enum: ["running"]
|
||||
example: "running"
|
||||
current_task:
|
||||
type: string
|
||||
description: Name of the currently executing task
|
||||
example: "research_task"
|
||||
progress:
|
||||
type: object
|
||||
properties:
|
||||
completed_tasks:
|
||||
type: integer
|
||||
description: Number of completed tasks
|
||||
example: 1
|
||||
total_tasks:
|
||||
type: integer
|
||||
description: Total number of tasks in the crew
|
||||
example: 3
|
||||
|
||||
ExecutionCompleted:
|
||||
type: object
|
||||
properties:
|
||||
status:
|
||||
type: string
|
||||
enum: ["completed"]
|
||||
example: "completed"
|
||||
result:
|
||||
type: object
|
||||
properties:
|
||||
output:
|
||||
type: string
|
||||
description: Final output from the crew execution
|
||||
example: "Comprehensive travel itinerary..."
|
||||
tasks:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/TaskResult'
|
||||
execution_time:
|
||||
type: number
|
||||
description: Total execution time in seconds
|
||||
example: 108.5
|
||||
|
||||
ExecutionError:
|
||||
type: object
|
||||
properties:
|
||||
status:
|
||||
type: string
|
||||
enum: ["error"]
|
||||
example: "error"
|
||||
error:
|
||||
type: string
|
||||
description: Error message describing what went wrong
|
||||
example: "Task execution failed: Invalid API key"
|
||||
execution_time:
|
||||
type: number
|
||||
description: Time until error occurred in seconds
|
||||
example: 23.1
|
||||
|
||||
TaskResult:
|
||||
type: object
|
||||
properties:
|
||||
task_id:
|
||||
type: string
|
||||
description: Unique identifier for the task
|
||||
example: "research_task"
|
||||
output:
|
||||
type: string
|
||||
description: Output generated by this task
|
||||
example: "Research findings..."
|
||||
agent:
|
||||
type: string
|
||||
description: Name of the agent that executed this task
|
||||
example: "Travel Researcher"
|
||||
execution_time:
|
||||
type: number
|
||||
description: Time taken to execute this task in seconds
|
||||
example: 45.2
|
||||
|
||||
Error:
|
||||
type: object
|
||||
properties:
|
||||
error:
|
||||
type: string
|
||||
description: Error type or title
|
||||
example: "Authentication Error"
|
||||
message:
|
||||
type: string
|
||||
description: Detailed error message
|
||||
example: "Invalid bearer token provided"
|
||||
|
||||
ValidationError:
|
||||
type: object
|
||||
properties:
|
||||
error:
|
||||
type: string
|
||||
example: "Validation Error"
|
||||
message:
|
||||
type: string
|
||||
example: "Missing required inputs"
|
||||
details:
|
||||
type: object
|
||||
properties:
|
||||
missing_inputs:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
example: ["budget", "interests"]
|
||||
|
||||
responses:
|
||||
UnauthorizedError:
|
||||
description: Authentication failed - check your bearer token
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Error'
|
||||
example:
|
||||
error: "Unauthorized"
|
||||
message: "Invalid or missing bearer token"
|
||||
|
||||
NotFoundError:
|
||||
description: Resource not found
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Error'
|
||||
example:
|
||||
error: "Not Found"
|
||||
message: "The requested resource was not found"
|
||||
|
||||
ServerError:
|
||||
description: Internal server error
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Error'
|
||||
example:
|
||||
error: "Internal Server Error"
|
||||
message: "An unexpected error occurred"
|
||||
|
||||
231
docs/enterprise-api.ko.yaml
Normal file
@@ -0,0 +1,231 @@
|
||||
openapi: 3.0.3
|
||||
info:
|
||||
title: CrewAI 엔터프라이즈 API
|
||||
description: |
|
||||
CrewAI Enterprise에 배포된 crew와 상호작용하기 위한 REST API입니다.
|
||||
|
||||
## 시작하기
|
||||
1. **Crew URL 확인**: 대시보드에서 고유한 crew URL을 확인하세요
|
||||
2. **예제 복사**: 각 엔드포인트의 예제를 템플릿으로 사용하세요
|
||||
3. **플레이스홀더 교체**: 실제 URL과 토큰으로 바꾸세요
|
||||
4. **도구로 테스트**: cURL, Postman 등 선호하는 도구로 테스트하세요
|
||||
version: 1.0.0
|
||||
contact:
|
||||
name: CrewAI 지원
|
||||
email: support@crewai.com
|
||||
url: https://crewai.com
|
||||
servers:
|
||||
- url: https://your-actual-crew-name.crewai.com
|
||||
description: 대시보드의 실제 crew URL로 교체하세요
|
||||
security:
|
||||
- BearerAuth: []
|
||||
paths:
|
||||
/inputs:
|
||||
get:
|
||||
summary: 필요 입력값 조회
|
||||
description: |
|
||||
**📋 참조 예제만 제공** - *요청 형식을 보여줍니다. 실제 호출은 cURL 예제를 복사해 URL과 토큰을 교체하세요.*
|
||||
|
||||
실행에 필요한 입력 파라미터 목록을 반환합니다.
|
||||
operationId: getRequiredInputs
|
||||
responses:
|
||||
'200':
|
||||
description: 입력값을 성공적으로 조회
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
inputs:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
'401':
|
||||
$ref: '#/components/responses/UnauthorizedError'
|
||||
'404':
|
||||
$ref: '#/components/responses/NotFoundError'
|
||||
'500':
|
||||
$ref: '#/components/responses/ServerError'
|
||||
|
||||
/kickoff:
|
||||
post:
|
||||
summary: Crew 실행 시작
|
||||
description: |
|
||||
**📋 참조 예제만 제공** - *요청 형식을 보여줍니다. 실제 호출은 cURL 예제를 복사해 URL과 토큰을 교체하세요.*
|
||||
|
||||
제공된 입력으로 새로운 실행을 시작하고 kickoff ID를 반환합니다.
|
||||
operationId: startCrewExecution
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
required:
|
||||
- inputs
|
||||
properties:
|
||||
inputs:
|
||||
type: object
|
||||
additionalProperties:
|
||||
type: string
|
||||
responses:
|
||||
'200':
|
||||
description: 실행이 성공적으로 시작됨
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
kickoff_id:
|
||||
type: string
|
||||
format: uuid
|
||||
'401':
|
||||
$ref: '#/components/responses/UnauthorizedError'
|
||||
'500':
|
||||
$ref: '#/components/responses/ServerError'
|
||||
|
||||
/status/{kickoff_id}:
|
||||
get:
|
||||
summary: 실행 상태 조회
|
||||
description: |
|
||||
**📋 참조 예제만 제공** - *요청 형식을 보여줍니다. 실제 호출은 cURL 예제를 복사해 URL과 토큰을 교체하세요.*
|
||||
|
||||
kickoff ID로 실행 상태와 결과를 조회합니다.
|
||||
operationId: getExecutionStatus
|
||||
parameters:
|
||||
- name: kickoff_id
|
||||
in: path
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
format: uuid
|
||||
responses:
|
||||
'200':
|
||||
description: 상태를 성공적으로 조회
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
oneOf:
|
||||
- $ref: '#/components/schemas/ExecutionRunning'
|
||||
- $ref: '#/components/schemas/ExecutionCompleted'
|
||||
- $ref: '#/components/schemas/ExecutionError'
|
||||
'401':
|
||||
$ref: '#/components/responses/UnauthorizedError'
|
||||
'404':
|
||||
description: Kickoff ID를 찾을 수 없음
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Error'
|
||||
'500':
|
||||
$ref: '#/components/responses/ServerError'
|
||||
|
||||
components:
|
||||
securitySchemes:
|
||||
BearerAuth:
|
||||
type: http
|
||||
scheme: bearer
|
||||
description: |
|
||||
**📋 참고** - *예시의 토큰은 자리 표시자입니다.* 실제 토큰을 사용하세요.
|
||||
|
||||
schemas:
|
||||
ExecutionRunning:
|
||||
type: object
|
||||
properties:
|
||||
status:
|
||||
type: string
|
||||
enum: ["running"]
|
||||
current_task:
|
||||
type: string
|
||||
progress:
|
||||
type: object
|
||||
properties:
|
||||
completed_tasks:
|
||||
type: integer
|
||||
total_tasks:
|
||||
type: integer
|
||||
|
||||
ExecutionCompleted:
|
||||
type: object
|
||||
properties:
|
||||
status:
|
||||
type: string
|
||||
enum: ["completed"]
|
||||
result:
|
||||
type: object
|
||||
properties:
|
||||
output:
|
||||
type: string
|
||||
tasks:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/TaskResult'
|
||||
execution_time:
|
||||
type: number
|
||||
|
||||
ExecutionError:
|
||||
type: object
|
||||
properties:
|
||||
status:
|
||||
type: string
|
||||
enum: ["error"]
|
||||
error:
|
||||
type: string
|
||||
execution_time:
|
||||
type: number
|
||||
|
||||
TaskResult:
|
||||
type: object
|
||||
properties:
|
||||
task_id:
|
||||
type: string
|
||||
output:
|
||||
type: string
|
||||
agent:
|
||||
type: string
|
||||
execution_time:
|
||||
type: number
|
||||
|
||||
Error:
|
||||
type: object
|
||||
properties:
|
||||
error:
|
||||
type: string
|
||||
message:
|
||||
type: string
|
||||
|
||||
ValidationError:
|
||||
type: object
|
||||
properties:
|
||||
error:
|
||||
type: string
|
||||
message:
|
||||
type: string
|
||||
details:
|
||||
type: object
|
||||
properties:
|
||||
missing_inputs:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
|
||||
responses:
|
||||
UnauthorizedError:
|
||||
description: 인증 실패
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Error'
|
||||
NotFoundError:
|
||||
description: 리소스를 찾을 수 없음
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Error'
|
||||
ServerError:
|
||||
description: 서버 내부 오류
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Error'
|
||||
|
||||
268
docs/enterprise-api.pt-BR.yaml
Normal file
@@ -0,0 +1,268 @@
|
||||
openapi: 3.0.3
|
||||
info:
|
||||
title: CrewAI Enterprise API
|
||||
description: |
|
||||
REST API para interagir com suas crews implantadas no CrewAI Enterprise.
|
||||
|
||||
## Introdução
|
||||
|
||||
1. **Encontre a URL da sua crew**: Obtenha sua URL única no painel do CrewAI Enterprise
|
||||
2. **Copie os exemplos**: Use os exemplos de cada endpoint como modelo
|
||||
3. **Substitua os placeholders**: Atualize URLs e tokens com seus valores reais
|
||||
4. **Teste com suas ferramentas**: Use cURL, Postman ou seu cliente preferido
|
||||
|
||||
## Autenticação
|
||||
|
||||
Todas as requisições exigem um token bearer. Existem dois tipos:
|
||||
|
||||
- **Bearer Token**: Token em nível de organização para operações completas
|
||||
- **User Bearer Token**: Token com escopo de usuário com permissões limitadas
|
||||
|
||||
Você encontra os tokens na aba Status da sua crew no painel do CrewAI Enterprise.
|
||||
|
||||
## Documentação de Referência
|
||||
|
||||
Este documento fornece exemplos completos para cada endpoint:
|
||||
|
||||
- **Formatos de requisição** com parâmetros obrigatórios e opcionais
|
||||
- **Exemplos de resposta** para sucesso e erro
|
||||
- **Amostras de código** em várias linguagens
|
||||
- **Padrões de autenticação** com uso correto de Bearer token
|
||||
|
||||
Copie os exemplos e personalize com sua URL e tokens reais.
|
||||
|
||||
## Fluxo
|
||||
|
||||
1. **Descubra os inputs** usando `GET /inputs`
|
||||
2. **Inicie a execução** usando `POST /kickoff`
|
||||
3. **Monitore o progresso** usando `GET /status/{kickoff_id}`
|
||||
version: 1.0.0
|
||||
contact:
|
||||
name: CrewAI Suporte
|
||||
email: support@crewai.com
|
||||
url: https://crewai.com
|
||||
servers:
|
||||
- url: https://your-actual-crew-name.crewai.com
|
||||
description: Substitua pela URL real da sua crew no painel do CrewAI Enterprise
|
||||
security:
|
||||
- BearerAuth: []
|
||||
paths:
|
||||
/inputs:
|
||||
get:
|
||||
summary: Obter Inputs Requeridos
|
||||
description: |
|
||||
**📋 Exemplo de Referência** - *Mostra o formato da requisição. Para testar com sua crew real, copie o cURL e substitua URL + token.*
|
||||
|
||||
Retorna a lista de parâmetros de entrada que sua crew espera.
|
||||
operationId: getRequiredInputs
|
||||
responses:
|
||||
'200':
|
||||
description: Inputs requeridos obtidos com sucesso
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
inputs:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
description: Nomes dos parâmetros de entrada
|
||||
example: ["budget", "interests", "duration", "age"]
|
||||
'401':
|
||||
$ref: '#/components/responses/UnauthorizedError'
|
||||
'404':
|
||||
$ref: '#/components/responses/NotFoundError'
|
||||
'500':
|
||||
$ref: '#/components/responses/ServerError'
|
||||
|
||||
/kickoff:
|
||||
post:
|
||||
summary: Iniciar Execução da Crew
|
||||
description: |
|
||||
**📋 Exemplo de Referência** - *Mostra o formato da requisição. Para testar com sua crew real, copie o cURL e substitua URL + token.*
|
||||
|
||||
Inicia uma nova execução da crew com os inputs fornecidos e retorna um kickoff ID.
|
||||
operationId: startCrewExecution
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
required:
|
||||
- inputs
|
||||
properties:
|
||||
inputs:
|
||||
type: object
|
||||
additionalProperties:
|
||||
type: string
|
||||
example:
|
||||
budget: "1000 USD"
|
||||
interests: "games, tech, ai, relaxing hikes, amazing food"
|
||||
duration: "7 days"
|
||||
age: "35"
|
||||
|
||||
responses:
|
||||
'200':
|
||||
description: Execução iniciada com sucesso
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
kickoff_id:
|
||||
type: string
|
||||
format: uuid
|
||||
example: "abcd1234-5678-90ef-ghij-klmnopqrstuv"
|
||||
'401':
|
||||
$ref: '#/components/responses/UnauthorizedError'
|
||||
'500':
|
||||
$ref: '#/components/responses/ServerError'
|
||||
|
||||
/status/{kickoff_id}:
|
||||
get:
|
||||
summary: Obter Status da Execução
|
||||
description: |
|
||||
**📋 Exemplo de Referência** - *Mostra o formato da requisição. Para testar com sua crew real, copie o cURL e substitua URL + token.*
|
||||
|
||||
Retorna o status atual e os resultados de uma execução usando o kickoff ID.
|
||||
operationId: getExecutionStatus
|
||||
parameters:
|
||||
- name: kickoff_id
|
||||
in: path
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
format: uuid
|
||||
responses:
|
||||
'200':
|
||||
description: Status recuperado com sucesso
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
oneOf:
|
||||
- $ref: '#/components/schemas/ExecutionRunning'
|
||||
- $ref: '#/components/schemas/ExecutionCompleted'
|
||||
- $ref: '#/components/schemas/ExecutionError'
|
||||
'401':
|
||||
$ref: '#/components/responses/UnauthorizedError'
|
||||
'404':
|
||||
description: Kickoff ID não encontrado
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Error'
|
||||
'500':
|
||||
$ref: '#/components/responses/ServerError'
|
||||
|
||||
components:
|
||||
securitySchemes:
|
||||
BearerAuth:
|
||||
type: http
|
||||
scheme: bearer
|
||||
description: |
|
||||
**📋 Referência** - *Os tokens mostrados são apenas exemplos.*
|
||||
Use seus tokens reais do painel do CrewAI Enterprise.
|
||||
|
||||
schemas:
|
||||
ExecutionRunning:
|
||||
type: object
|
||||
properties:
|
||||
status:
|
||||
type: string
|
||||
enum: ["running"]
|
||||
current_task:
|
||||
type: string
|
||||
progress:
|
||||
type: object
|
||||
properties:
|
||||
completed_tasks:
|
||||
type: integer
|
||||
total_tasks:
|
||||
type: integer
|
||||
|
||||
ExecutionCompleted:
|
||||
type: object
|
||||
properties:
|
||||
status:
|
||||
type: string
|
||||
enum: ["completed"]
|
||||
result:
|
||||
type: object
|
||||
properties:
|
||||
output:
|
||||
type: string
|
||||
tasks:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/TaskResult'
|
||||
execution_time:
|
||||
type: number
|
||||
|
||||
ExecutionError:
|
||||
type: object
|
||||
properties:
|
||||
status:
|
||||
type: string
|
||||
enum: ["error"]
|
||||
error:
|
||||
type: string
|
||||
execution_time:
|
||||
type: number
|
||||
|
||||
TaskResult:
|
||||
type: object
|
||||
properties:
|
||||
task_id:
|
||||
type: string
|
||||
output:
|
||||
type: string
|
||||
agent:
|
||||
type: string
|
||||
execution_time:
|
||||
type: number
|
||||
|
||||
Error:
|
||||
type: object
|
||||
properties:
|
||||
error:
|
||||
type: string
|
||||
message:
|
||||
type: string
|
||||
|
||||
ValidationError:
|
||||
type: object
|
||||
properties:
|
||||
error:
|
||||
type: string
|
||||
message:
|
||||
type: string
|
||||
details:
|
||||
type: object
|
||||
properties:
|
||||
missing_inputs:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
|
||||
responses:
|
||||
UnauthorizedError:
|
||||
description: Autenticação falhou
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Error'
|
||||
NotFoundError:
|
||||
description: Recurso não encontrado
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Error'
|
||||
ServerError:
|
||||
description: Erro interno do servidor
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Error'
|
||||
|
||||
|
Before Width: | Height: | Size: 288 KiB |
|
Before Width: | Height: | Size: 419 KiB |
|
Before Width: | Height: | Size: 263 KiB |
BIN
docs/images/enterprise/users_and_roles.png
Normal file
|
After Width: | Height: | Size: 248 KiB |
BIN
docs/images/enterprise/visibility.png
Normal file
|
After Width: | Height: | Size: 472 KiB |
BIN
docs/images/gateway-metrics.png
Normal file
|
After Width: | Height: | Size: 530 KiB |
BIN
docs/images/langdb-1.png
Normal file
|
After Width: | Height: | Size: 127 KiB |
BIN
docs/images/langdb-2.png
Normal file
|
After Width: | Height: | Size: 117 KiB |
BIN
docs/images/new-code-snippet.png
Normal file
|
After Width: | Height: | Size: 554 KiB |
BIN
docs/images/tracing_crewai.png
Normal file
|
After Width: | Height: | Size: 128 KiB |
119
docs/ko/api-reference/introduction.mdx
Normal file
@@ -0,0 +1,119 @@
|
||||
---
|
||||
title: "소개"
|
||||
description: "CrewAI Enterprise REST API에 대한 완벽한 참고 자료"
|
||||
icon: "code"
|
||||
---
|
||||
|
||||
# CrewAI 엔터프라이즈 API
|
||||
|
||||
CrewAI 엔터프라이즈 API 참고 자료에 오신 것을 환영합니다. 이 API를 사용하면 배포된 crew와 프로그래밍 방식으로 상호작용할 수 있어, 애플리케이션, 워크플로우 및 서비스와의 통합이 가능합니다.
|
||||
|
||||
## 빠른 시작
|
||||
|
||||
<Steps>
|
||||
<Step title="API 자격 증명 받기">
|
||||
CrewAI Enterprise 대시보드에서 자신의 crew 상세 페이지로 이동하여 Status 탭에서 Bearer Token을 복사하세요.
|
||||
</Step>
|
||||
|
||||
<Step title="필수 입력값 확인하기">
|
||||
`GET /inputs` 엔드포인트를 사용하여 crew가 기대하는 파라미터를 확인하세요.
|
||||
</Step>
|
||||
|
||||
<Step title="Crew 실행 시작하기">
|
||||
입력값과 함께 `POST /kickoff`를 호출하여 crew 실행을 시작하고 `kickoff_id`를 받으세요.
|
||||
</Step>
|
||||
|
||||
<Step title="진행 상황 모니터링">
|
||||
`GET /status/{kickoff_id}`를 사용하여 실행 상태를 확인하고 결과를 조회하세요.
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## 인증
|
||||
|
||||
모든 API 요청은 Bearer 토큰을 사용한 인증이 필요합니다. `Authorization` 헤더에 토큰을 포함하세요:
|
||||
|
||||
```bash
|
||||
curl -H "Authorization: Bearer YOUR_CREW_TOKEN" \
|
||||
https://your-crew-url.crewai.com/inputs
|
||||
```
|
||||
|
||||
### 토큰 유형
|
||||
|
||||
| 토큰 유형 | 범위 | 사용 사례 |
|
||||
|:-----------|:--------|:----------|
|
||||
| **Bearer Token** | 조직 단위 접근 | 전체 crew 운영, 서버 간 통합에 이상적 |
|
||||
| **User Bearer Token** | 사용자 범위 접근 | 제한된 권한, 사용자별 작업에 적합 |
|
||||
|
||||
<Tip>
|
||||
두 토큰 유형 모두 CrewAI Enterprise 대시보드의 crew 상세 페이지 Status 탭에서 확인할 수 있습니다.
|
||||
</Tip>
|
||||
|
||||
## 기본 URL
|
||||
|
||||
각 배포된 crew마다 고유한 API 엔드포인트가 있습니다:
|
||||
|
||||
```
|
||||
https://your-crew-name.crewai.com
|
||||
```
|
||||
|
||||
`your-crew-name`을(를) 대시보드에서 확인할 수 있는 실제 crew의 URL로 교체하세요.
|
||||
|
||||
## 일반적인 워크플로우
|
||||
|
||||
1. **탐색**: `GET /inputs`를 호출하여 crew가 필요한 것을 파악합니다.
|
||||
2. **실행**: `POST /kickoff`를 통해 입력값을 제출하여 처리를 시작합니다.
|
||||
3. **모니터링**: 완료될 때까지 `GET /status/{kickoff_id}`를 주기적으로 조회합니다.
|
||||
4. **결과**: 완료된 응답에서 최종 출력을 추출합니다.
|
||||
|
||||
## 오류 처리
|
||||
|
||||
API는 표준 HTTP 상태 코드를 사용합니다:
|
||||
|
||||
| 코드 | 의미 |
|
||||
|------|:--------|
|
||||
| `200` | 성공 |
|
||||
| `400` | 잘못된 요청 - 잘못된 입력 형식 |
|
||||
| `401` | 인증 실패 - 잘못된 베어러 토큰 |
|
||||
| `404` | 찾을 수 없음 - 리소스가 존재하지 않음 |
|
||||
| `422` | 유효성 검사 오류 - 필수 입력 누락 |
|
||||
| `500` | 서버 오류 - 지원팀에 문의하십시오 |
|
||||
|
||||
## 인터랙티브 테스트
|
||||
|
||||
<Info>
|
||||
**왜 "전송" 버튼이 없나요?** 각 CrewAI Enterprise 사용자는 고유한 crew URL을 가지므로, 혼동을 피하기 위해 인터랙티브 플레이그라운드 대신 **참조 모드**를 사용합니다. 이를 통해 비작동 전송 버튼 없이 요청이 어떻게 생겼는지 정확히 보여줍니다.
|
||||
</Info>
|
||||
|
||||
각 엔드포인트 페이지에서는 다음을 확인할 수 있습니다:
|
||||
- ✅ 모든 파라미터가 포함된 **정확한 요청 형식**
|
||||
- ✅ 성공 및 오류 사례에 대한 **응답 예시**
|
||||
- ✅ 여러 언어(cURL, Python, JavaScript 등)로 제공되는 **코드 샘플**
|
||||
- ✅ 올바른 Bearer 토큰 형식의 **인증 예시**
|
||||
|
||||
### **실제 API를 테스트하려면:**
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card title="cURL 예제 복사" icon="terminal">
|
||||
cURL 예제를 복사한 후, URL과 토큰을 실제 값으로 교체하세요
|
||||
</Card>
|
||||
<Card title="Postman/Insomnia 사용" icon="play">
|
||||
예제를 원하는 API 테스트 도구에 가져오세요
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
**예시 작업 흐름:**
|
||||
1. **cURL 예제를 복사**합니다 (엔드포인트 페이지에서)
|
||||
2. **`your-actual-crew-name.crewai.com`**을(를) 실제 crew URL로 교체합니다
|
||||
3. **Bearer 토큰을** 대시보드에서 복사한 실제 토큰으로 교체합니다
|
||||
4. **요청을 실행**합니다 (터미널이나 API 클라이언트에서)
|
||||
|
||||
## 도움이 필요하신가요?
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card title="Enterprise Support" icon="headset" href="mailto:support@crewai.com">
|
||||
API 통합 및 문제 해결에 대한 지원을 받으세요
|
||||
</Card>
|
||||
<Card title="Enterprise Dashboard" icon="chart-line" href="https://app.crewai.com">
|
||||
crew를 관리하고 실행 로그를 확인하세요
|
||||
</Card>
|
||||
</CardGroup>
|
||||
690
docs/ko/concepts/agents.mdx
Normal file
@@ -0,0 +1,690 @@
|
||||
---
|
||||
title: 에이전트
|
||||
description: CrewAI 프레임워크 내에서 에이전트를 생성하고 관리하는 자세한 가이드입니다.
|
||||
icon: robot
|
||||
---
|
||||
|
||||
## 에이전트 개요
|
||||
|
||||
CrewAI 프레임워크에서 `Agent`는 다음과 같은 역할을 수행하는 자율적 단위입니다:
|
||||
- 특정 작업 수행
|
||||
- 자신의 역할과 목표에 기반한 의사결정
|
||||
- 도구를 활용하여 목표 달성
|
||||
- 다른 에이전트와의 소통 및 협업
|
||||
- 상호작용에 대한 기억 유지
|
||||
- 허용될 경우 작업 위임
|
||||
|
||||
<Tip>
|
||||
에이전트는 특정한 기술, 전문성, 책임을 가진 전문 팀원이라고 생각하시면 됩니다. 예를 들어, `Researcher` 에이전트는 정보 수집 및 분석에 뛰어날 수 있고, `Writer` 에이전트는 콘텐츠 작성에 더 강점을 가질 수 있습니다.
|
||||
</Tip>
|
||||
|
||||
<Note type="info" title="엔터프라이즈 확장: 시각적 에이전트 빌더">
|
||||
CrewAI Enterprise에는 코드를 작성하지 않고도 에이전트 생성 및 구성을 간편하게 할 수 있는 시각적 에이전트 빌더가 포함되어 있습니다. 에이전트를 시각적으로 설계하고 실시간으로 테스트하세요.
|
||||
|
||||

|
||||
|
||||
시각적 에이전트 빌더를 통해 다음과 같은 기능을 사용할 수 있습니다:
|
||||
- 폼 기반 인터페이스를 통한 직관적 에이전트 구성
|
||||
- 실시간 테스트 및 검증
|
||||
- 사전 구성된 에이전트 유형 템플릿 라이브러리
|
||||
- 에이전트 속성 및 행동의 손쉬운 커스터마이즈
|
||||
</Note>
|
||||
|
||||
## 에이전트 속성
|
||||
|
||||
| 속성 | 파라미터 | 타입 | 설명 |
|
||||
| :-------------------------------------- | :----------------------- | :---------------------------- | :----------------------------------------------------------------------------------------------------------------- |
|
||||
| **역할** | `role` | `str` | 에이전트의 기능과 전문 분야를 정의합니다. |
|
||||
| **목표** | `goal` | `str` | 에이전트의 의사결정을 이끄는 개별 목표입니다. |
|
||||
| **배경 이야기** | `backstory` | `str` | 에이전트에게 맥락과 개성을 부여하여 상호작용을 풍부하게 합니다. |
|
||||
| **LLM** _(옵션)_ | `llm` | `Union[str, LLM, Any]` | 에이전트를 구동하는 언어 모델입니다. `OPENAI_MODEL_NAME`에 지정된 모델 또는 "gpt-4"가 기본값입니다. |
|
||||
| **도구** _(옵션)_ | `tools` | `List[BaseTool]` | 에이전트가 사용할 수 있는 기능 혹은 역량입니다. 기본값은 빈 리스트입니다. |
|
||||
| **Function Calling LLM** _(옵션)_ | `function_calling_llm` | `Optional[Any]` | 도구 호출을 위한 언어 모델로, 지정 시 crew의 LLM을 재정의합니다. |
|
||||
| **최대 반복 횟수** _(옵션)_ | `max_iter` | `int` | 에이전트가 최선의 답변을 제공하기 전 최대 반복 수입니다. 기본값은 20입니다. |
|
||||
| **최대 RPM** _(옵션)_ | `max_rpm` | `Optional[int]` | 레이트 리밋 회피를 위한 분당 최대 요청 수입니다. |
|
||||
| **최대 실행 시간** _(옵션)_ | `max_execution_time` | `Optional[int]` | 작업 실행의 최대 시간(초)입니다. |
|
||||
| **상세 로그** _(옵션)_ | `verbose` | `bool` | 디버깅을 위한 상세 실행 로그를 활성화합니다. 기본값은 False입니다. |
|
||||
| **위임 허용** _(옵션)_ | `allow_delegation` | `bool` | 에이전트가 다른 에이전트에게 작업을 위임할 수 있도록 허용합니다. 기본값은 False입니다. |
|
||||
| **Step Callback** _(옵션)_ | `step_callback` | `Optional[Any]` | 각 에이전트 단계 후 호출되는 함수로, crew 콜백을 재정의합니다. |
|
||||
| **캐시** _(옵션)_ | `cache` | `bool` | 도구 사용에 대해 캐싱을 활성화합니다. 기본값은 True입니다. |
|
||||
| **시스템 템플릿** _(옵션)_ | `system_template` | `Optional[str]` | 에이전트 맞춤형 시스템 프롬프트 템플릿입니다. |
|
||||
| **프롬프트 템플릿** _(옵션)_ | `prompt_template` | `Optional[str]` | 에이전트 맞춤형 프롬프트 템플릿입니다. |
|
||||
| **응답 템플릿** _(옵션)_ | `response_template` | `Optional[str]` | 에이전트 맞춤형 응답 템플릿입니다. |
|
||||
| **코드 실행 허용** _(옵션)_ | `allow_code_execution` | `Optional[bool]` | 에이전트의 코드 실행 활성화 여부입니다. 기본값은 False입니다. |
|
||||
| **최대 재시도 횟수** _(옵션)_ | `max_retry_limit` | `int` | 오류 발생 시 최대 재시도 횟수입니다. 기본값은 2입니다. |
|
||||
| **컨텍스트 윈도우 준수** _(옵션)_ | `respect_context_window` | `bool` | 메시지를 컨텍스트 윈도우 크기 내로 유지하기 위하여 요약 기능을 사용합니다. 기본값은 True입니다. |
|
||||
| **코드 실행 모드** _(옵션)_ | `code_execution_mode` | `Literal["safe", "unsafe"]` | 코드 실행 모드: 'safe'(Docker 사용) 또는 'unsafe'(직접 실행). 기본값은 'safe'입니다. |
|
||||
| **멀티모달** _(옵션)_ | `multimodal` | `bool` | 에이전트가 멀티모달 기능을 지원하는지 여부입니다. 기본값은 False입니다. |
|
||||
| **날짜 자동 삽입** _(옵션)_ | `inject_date` | `bool` | 작업에 현재 날짜를 자동으로 삽입할지 여부입니다. 기본값은 False입니다. |
|
||||
| **날짜 형식** _(옵션)_ | `date_format` | `str` | inject_date 활성화 시 날짜 표시 형식 문자열입니다. 기본값은 "%Y-%m-%d"(ISO 포맷)입니다. |
|
||||
| **추론** _(옵션)_ | `reasoning` | `bool` | 에이전트가 작업을 실행하기 전에 반영 및 플랜을 생성할지 여부입니다. 기본값은 False입니다. |
|
||||
| **최대 추론 시도 수** _(옵션)_ | `max_reasoning_attempts` | `Optional[int]` | 작업 실행 전 최대 추론 시도 횟수입니다. 설정하지 않으면 준비될 때까지 시도합니다. |
|
||||
| **임베더** _(옵션)_ | `embedder` | `Optional[Dict[str, Any]]` | 에이전트가 사용하는 임베더 설정입니다. |
|
||||
| **지식 소스** _(옵션)_ | `knowledge_sources` | `Optional[List[BaseKnowledgeSource]]` | 에이전트가 사용할 수 있는 지식 소스입니다. |
|
||||
| **시스템 프롬프트 사용** _(옵션)_ | `use_system_prompt` | `Optional[bool]` | 시스템 프롬프트 사용 여부(o1 모델 지원용). 기본값은 True입니다. |
|
||||
|
||||
## 에이전트 생성
|
||||
|
||||
CrewAI에서 에이전트를 생성하는 방법에는 **YAML 구성(권장)**을 사용하는 방법과 **코드에서 직접 정의**하는 두 가지가 있습니다.
|
||||
|
||||
### YAML 구성 (권장)
|
||||
|
||||
YAML 구성을 사용하면 에이전트를 보다 깔끔하고 유지 관리하기 쉽도록 정의할 수 있습니다. CrewAI 프로젝트에서 이 방식을 사용하는 것을 강력히 권장합니다.
|
||||
|
||||
[설치](/ko/installation) 섹션에 설명된 대로 CrewAI 프로젝트를 생성한 후, `src/latest_ai_development/config/agents.yaml` 파일로 이동하여 템플릿을 여러분의 요구 사항에 맞게 수정하세요.
|
||||
|
||||
<Note>
|
||||
YAML 파일의 변수(예: `{topic}`)는 crew를 실행할 때 입력값에서 가져온 값으로 대체됩니다:
|
||||
```python Code
|
||||
crew.kickoff(inputs={'topic': 'AI Agents'})
|
||||
```
|
||||
</Note>
|
||||
|
||||
아래는 YAML을 사용하여 에이전트를 구성하는 예시입니다:
|
||||
|
||||
```yaml agents.yaml
|
||||
# src/latest_ai_development/config/agents.yaml
|
||||
researcher:
|
||||
role: >
|
||||
{topic} Senior Data Researcher
|
||||
goal: >
|
||||
Uncover cutting-edge developments in {topic}
|
||||
backstory: >
|
||||
You're a seasoned researcher with a knack for uncovering the latest
|
||||
developments in {topic}. Known for your ability to find the most relevant
|
||||
information and present it in a clear and concise manner.
|
||||
|
||||
reporting_analyst:
|
||||
role: >
|
||||
{topic} Reporting Analyst
|
||||
goal: >
|
||||
Create detailed reports based on {topic} data analysis and research findings
|
||||
backstory: >
|
||||
You're a meticulous analyst with a keen eye for detail. You're known for
|
||||
your ability to turn complex data into clear and concise reports, making
|
||||
it easy for others to understand and act on the information you provide.
|
||||
```
|
||||
|
||||
이 YAML 구성을 코드에서 사용하려면, `CrewBase`를 상속하는 crew 클래스를 생성하세요:
|
||||
|
||||
```python Code
|
||||
# src/latest_ai_development/crew.py
|
||||
from crewai import Agent, Crew, Process
|
||||
from crewai.project import CrewBase, agent, crew
|
||||
from crewai_tools import SerperDevTool
|
||||
|
||||
@CrewBase
|
||||
class LatestAiDevelopmentCrew():
|
||||
"""LatestAiDevelopment crew"""
|
||||
|
||||
agents_config = "config/agents.yaml"
|
||||
|
||||
@agent
|
||||
def researcher(self) -> Agent:
|
||||
return Agent(
|
||||
config=self.agents_config['researcher'], # type: ignore[index]
|
||||
verbose=True,
|
||||
tools=[SerperDevTool()]
|
||||
)
|
||||
|
||||
@agent
|
||||
def reporting_analyst(self) -> Agent:
|
||||
return Agent(
|
||||
config=self.agents_config['reporting_analyst'], # type: ignore[index]
|
||||
verbose=True
|
||||
)
|
||||
```
|
||||
|
||||
<Note>
|
||||
YAML 파일(`agents.yaml`)에서 사용하는 이름은 파이썬 코드의 메서드 이름과 일치해야 합니다.
|
||||
</Note>
|
||||
|
||||
### 직접 코드 정의
|
||||
|
||||
`Agent` 클래스를 인스턴스화하여 코드에서 직접 agent를 생성할 수 있습니다. 아래는 사용 가능한 모든 파라미터를 보여주는 종합적인 예제입니다:
|
||||
|
||||
```python Code
|
||||
from crewai import Agent
|
||||
from crewai_tools import SerperDevTool
|
||||
|
||||
# 사용 가능한 모든 파라미터로 agent 생성
|
||||
agent = Agent(
|
||||
role="Senior Data Scientist",
|
||||
goal="Analyze and interpret complex datasets to provide actionable insights",
|
||||
backstory="With over 10 years of experience in data science and machine learning, "
|
||||
"you excel at finding patterns in complex datasets.",
|
||||
llm="gpt-4", # 기본값: OPENAI_MODEL_NAME 또는 "gpt-4"
|
||||
function_calling_llm=None, # 옵션: 도구 호출을 위한 별도의 LLM
|
||||
verbose=False, # 기본값: False
|
||||
allow_delegation=False, # 기본값: False
|
||||
max_iter=20, # 기본값: 20번 반복
|
||||
max_rpm=None, # 옵션: API 호출에 대한 속도 제한
|
||||
max_execution_time=None, # 옵션: 최대 실행 시간(초 단위)
|
||||
max_retry_limit=2, # 기본값: 오류 시 2번 재시도
|
||||
allow_code_execution=False, # 기본값: False
|
||||
code_execution_mode="safe", # 기본값: "safe" (옵션: "safe", "unsafe")
|
||||
respect_context_window=True, # 기본값: True
|
||||
use_system_prompt=True, # 기본값: True
|
||||
multimodal=False, # 기본값: False
|
||||
inject_date=False, # 기본값: False
|
||||
date_format="%Y-%m-%d", # 기본값: ISO 형식
|
||||
reasoning=False, # 기본값: False
|
||||
max_reasoning_attempts=None, # 기본값: None
|
||||
tools=[SerperDevTool()], # 옵션: 도구 리스트
|
||||
knowledge_sources=None, # 옵션: 지식 소스 리스트
|
||||
embedder=None, # 옵션: 커스텀 임베더 구성
|
||||
system_template=None, # 옵션: 커스텀 시스템 프롬프트 템플릿
|
||||
prompt_template=None, # 옵션: 커스텀 프롬프트 템플릿
|
||||
response_template=None, # 옵션: 커스텀 응답 템플릿
|
||||
step_callback=None, # 옵션: 모니터링용 콜백 함수
|
||||
)
|
||||
```
|
||||
|
||||
일반적인 사용 사례를 위한 주요 파라미터 조합을 살펴보겠습니다:
|
||||
|
||||
#### 기본 연구 에이전트
|
||||
```python Code
|
||||
research_agent = Agent(
|
||||
role="Research Analyst",
|
||||
goal="Find and summarize information about specific topics",
|
||||
backstory="You are an experienced researcher with attention to detail",
|
||||
tools=[SerperDevTool()],
|
||||
verbose=True # Enable logging for debugging
|
||||
)
|
||||
```
|
||||
|
||||
#### 코드 개발 에이전트
|
||||
```python Code
|
||||
dev_agent = Agent(
|
||||
role="Senior Python Developer",
|
||||
goal="Write and debug Python code",
|
||||
backstory="Expert Python developer with 10 years of experience",
|
||||
allow_code_execution=True,
|
||||
code_execution_mode="safe", # Uses Docker for safety
|
||||
max_execution_time=300, # 5-minute timeout
|
||||
max_retry_limit=3 # More retries for complex code tasks
|
||||
)
|
||||
```
|
||||
|
||||
#### 장기 실행 분석 에이전트
|
||||
```python Code
|
||||
analysis_agent = Agent(
|
||||
role="Data Analyst",
|
||||
goal="Perform deep analysis of large datasets",
|
||||
backstory="Specialized in big data analysis and pattern recognition",
|
||||
memory=True,
|
||||
respect_context_window=True,
|
||||
max_rpm=10, # Limit API calls
|
||||
function_calling_llm="gpt-4o-mini" # Cheaper model for tool calls
|
||||
)
|
||||
```
|
||||
|
||||
#### 커스텀 템플릿 에이전트
|
||||
```python Code
|
||||
custom_agent = Agent(
|
||||
role="Customer Service Representative",
|
||||
goal="Assist customers with their inquiries",
|
||||
backstory="Experienced in customer support with a focus on satisfaction",
|
||||
system_template="""<|start_header_id|>system<|end_header_id|>
|
||||
{{ .System }}<|eot_id|>""",
|
||||
prompt_template="""<|start_header_id|>user<|end_header_id|>
|
||||
{{ .Prompt }}<|eot_id|>""",
|
||||
response_template="""<|start_header_id|>assistant<|end_header_id|>
|
||||
{{ .Response }}<|eot_id|>""",
|
||||
)
|
||||
```
|
||||
|
||||
#### 날짜 인식이 가능한 Reasoning Agent
|
||||
```python Code
|
||||
strategic_agent = Agent(
|
||||
role="Market Analyst",
|
||||
goal="Track market movements with precise date references and strategic planning",
|
||||
backstory="Expert in time-sensitive financial analysis and strategic reporting",
|
||||
inject_date=True, # Automatically inject current date into tasks
|
||||
date_format="%B %d, %Y", # Format as "May 21, 2025"
|
||||
reasoning=True, # Enable strategic planning
|
||||
max_reasoning_attempts=2, # Limit planning iterations
|
||||
verbose=True
|
||||
)
|
||||
```
|
||||
|
||||
#### Reasoning Agent
|
||||
```python Code
|
||||
reasoning_agent = Agent(
|
||||
role="Strategic Planner",
|
||||
goal="Analyze complex problems and create detailed execution plans",
|
||||
backstory="Expert strategic planner who methodically breaks down complex challenges",
|
||||
reasoning=True, # Enable reasoning and planning
|
||||
max_reasoning_attempts=3, # Limit reasoning attempts
|
||||
max_iter=30, # Allow more iterations for complex planning
|
||||
verbose=True
|
||||
)
|
||||
```
|
||||
|
||||
#### 멀티모달 에이전트
|
||||
```python Code
|
||||
multimodal_agent = Agent(
|
||||
role="Visual Content Analyst",
|
||||
goal="Analyze and process both text and visual content",
|
||||
backstory="Specialized in multimodal analysis combining text and image understanding",
|
||||
multimodal=True, # Enable multimodal capabilities
|
||||
verbose=True
|
||||
)
|
||||
```
|
||||
|
||||
### 매개변수 세부 정보
|
||||
|
||||
#### 중요 파라미터
|
||||
- `role`, `goal`, 그리고 `backstory`는 필수이며 에이전트의 행동을 결정합니다
|
||||
- `llm`은 사용되는 언어 모델을 결정합니다 (기본값: OpenAI의 GPT-4)
|
||||
|
||||
#### 메모리 및 컨텍스트
|
||||
- `memory`: 대화 이력을 유지하도록 활성화합니다
|
||||
- `respect_context_window`: 토큰 제한 문제를 방지합니다
|
||||
- `knowledge_sources`: 도메인별 지식 기반을 추가합니다
|
||||
|
||||
#### 실행 제어
|
||||
- `max_iter`: 최적의 답변을 제공하기 전의 최대 시도 횟수
|
||||
- `max_execution_time`: 제한 시간(초 단위)
|
||||
- `max_rpm`: API 호출 속도 제한
|
||||
- `max_retry_limit`: 오류 발생 시 재시도 횟수
|
||||
|
||||
#### 코드 실행
|
||||
- `allow_code_execution`: 코드를 실행하려면 True여야 합니다
|
||||
- `code_execution_mode`:
|
||||
- `"safe"`: Docker를 사용합니다 (프로덕션에 권장)
|
||||
- `"unsafe"`: 직접 실행 (신뢰할 수 있는 환경에서만 사용)
|
||||
|
||||
<Note>
|
||||
이 옵션은 기본 Docker 이미지를 실행합니다. Docker 이미지를 구성하려면 도구 섹션에 있는 Code Interpreter Tool을 확인하십시오.
|
||||
Code Interpreter Tool을 에이전트의 도구 파라미터로 추가하십시오.
|
||||
</Note>
|
||||
|
||||
#### 고급 기능
|
||||
- `multimodal`: 텍스트와 시각적 콘텐츠 처리를 위한 멀티모달 기능 활성화
|
||||
- `reasoning`: 에이전트가 작업을 수행하기 전에 반영하고 계획을 작성할 수 있도록 활성화
|
||||
- `inject_date`: 현재 날짜를 작업 설명에 자동으로 삽입
|
||||
|
||||
#### 템플릿
|
||||
- `system_template`: 에이전트의 핵심 동작을 정의합니다
|
||||
- `prompt_template`: 입력 형식을 구성합니다
|
||||
- `response_template`: 에이전트 응답을 포맷합니다
|
||||
|
||||
<Note>
|
||||
커스텀 템플릿을 사용할 때는 `system_template`과 `prompt_template`가 모두 정의되어 있는지 확인하십시오. `response_template`은 선택 사항이지만 일관된 출력 포맷을 위해 권장됩니다.
|
||||
</Note>
|
||||
|
||||
<Note>
|
||||
커스텀 템플릿을 사용할 때는 템플릿에서 `{role}`, `{goal}`, `{backstory}`와 같은 변수를 사용할 수 있습니다. 이 변수들은 실행 중에 자동으로 채워집니다.
|
||||
</Note>
|
||||
|
||||
## 에이전트 도구
|
||||
|
||||
에이전트는 다양한 도구를 장착하여 그 능력을 향상시킬 수 있습니다. CrewAI는 다음의 도구들을 지원합니다:
|
||||
- [CrewAI Toolkit](https://github.com/joaomdmoura/crewai-tools)
|
||||
- [LangChain Tools](https://python.langchain.com/docs/integrations/tools)
|
||||
|
||||
에이전트에 도구를 추가하는 방법은 다음과 같습니다:
|
||||
|
||||
```python Code
|
||||
from crewai import Agent
|
||||
from crewai_tools import SerperDevTool, WikipediaTools
|
||||
|
||||
# 도구 생성
|
||||
search_tool = SerperDevTool()
|
||||
wiki_tool = WikipediaTools()
|
||||
|
||||
# 에이전트에 도구 추가
|
||||
researcher = Agent(
|
||||
role="AI Technology Researcher",
|
||||
goal="Research the latest AI developments",
|
||||
tools=[search_tool, wiki_tool],
|
||||
verbose=True
|
||||
)
|
||||
```
|
||||
|
||||
## 에이전트 메모리와 컨텍스트
|
||||
|
||||
에이전트는 상호작용의 메모리를 유지하고 이전 작업의 컨텍스트를 사용할 수 있습니다. 이는 여러 작업에 걸쳐 정보를 유지해야 하는 복잡한 워크플로우에서 특히 유용합니다.
|
||||
|
||||
```python Code
|
||||
from crewai import Agent
|
||||
|
||||
analyst = Agent(
|
||||
role="Data Analyst",
|
||||
goal="Analyze and remember complex data patterns",
|
||||
memory=True, # Enable memory
|
||||
verbose=True
|
||||
)
|
||||
```
|
||||
|
||||
<Note>
|
||||
`memory`가 활성화되면 에이전트는 여러 상호작용에 걸쳐 컨텍스트를 유지하게 되어, 복잡하고 여러 단계로 이루어진 작업을 처리하는 능력이 향상됩니다.
|
||||
</Note>
|
||||
|
||||
## 컨텍스트 윈도우 관리
|
||||
|
||||
CrewAI는 대화가 언어 모델의 토큰 한도를 초과하는 상황을 처리하기 위해 정교한 자동 컨텍스트 윈도우 관리 기능을 포함하고 있습니다. 이 강력한 기능은 `respect_context_window` 매개변수로 제어됩니다.
|
||||
|
||||
### 컨텍스트 윈도우 관리 방식
|
||||
|
||||
에이전트의 대화 기록이 LLM의 컨텍스트 윈도우 크기를 초과할 경우, CrewAI는 이 상황을 자동으로 감지하고 다음 중 하나를 수행할 수 있습니다:
|
||||
|
||||
1. **자동으로 내용을 요약** ( `respect_context_window=True` 인 경우)
|
||||
2. **오류와 함께 실행 중지** ( `respect_context_window=False` 인 경우)
|
||||
|
||||
### 자동 컨텍스트 처리 (`respect_context_window=True`)
|
||||
|
||||
이 설정은 대부분의 사용 사례에서 **기본값이자 권장 옵션**입니다. 활성화되면 CrewAI는 다음과 같이 동작합니다:
|
||||
|
||||
```python Code
|
||||
# Agent with automatic context management (default)
|
||||
smart_agent = Agent(
|
||||
role="Research Analyst",
|
||||
goal="Analyze large documents and datasets",
|
||||
backstory="Expert at processing extensive information",
|
||||
respect_context_window=True, # 🔑 Default: auto-handle context limits
|
||||
verbose=True
|
||||
)
|
||||
```
|
||||
|
||||
**컨텍스트 한도를 초과할 경우 발생하는 일:**
|
||||
- ⚠️ **경고 메시지**: `"Context length exceeded. Summarizing content to fit the model context window."`
|
||||
- 🔄 **자동 요약**: CrewAI가 대화 기록을 지능적으로 요약함
|
||||
- ✅ **작업 지속**: 요약된 컨텍스트로 작업이 원활하게 계속됨
|
||||
- 📝 **정보 보존**: 토큰 수를 줄이면서도 주요 정보는 유지됨
|
||||
|
||||
### 엄격한 컨텍스트 제한(`respect_context_window=False`)
|
||||
|
||||
정확한 제어가 필요하며, 정보를 잃지 않으려면 실행이 중지되도록 할 때:
|
||||
|
||||
```python Code
|
||||
# Agent with strict context limits
|
||||
strict_agent = Agent(
|
||||
role="Legal Document Reviewer",
|
||||
goal="Provide precise legal analysis without information loss",
|
||||
backstory="Legal expert requiring complete context for accurate analysis",
|
||||
respect_context_window=False, # ❌ Stop execution on context limit
|
||||
verbose=True
|
||||
)
|
||||
```
|
||||
|
||||
**컨텍스트 한도를 초과하면 발생하는 일:**
|
||||
- ❌ **오류 메시지**: `"Context length exceeded. Consider using smaller text or RAG tools from crewai_tools."`
|
||||
- 🛑 **실행 중지**: 작업 실행이 즉시 중단됨
|
||||
- 🔧 **수동 개입 필요**: 접근 방식을 직접 수정해야 함
|
||||
|
||||
### 올바른 설정 선택
|
||||
|
||||
#### 다음과 같은 경우 `respect_context_window=True` (기본값)을 사용하세요:
|
||||
- **문서가 클 경우** 컨텍스트 제한을 초과할 수 있습니다
|
||||
- **오래 지속되는 대화**에서 일부 요약이 허용되는 경우
|
||||
- **연구 과제**에서 정확한 세부사항보다는 전체적인 컨텍스트가 더 중요한 경우
|
||||
- **프로토타이핑 및 개발**에서 견고한 실행을 원하는 경우
|
||||
|
||||
```python Code
|
||||
# Perfect for document processing
|
||||
document_processor = Agent(
|
||||
role="Document Analyst",
|
||||
goal="Extract insights from large research papers",
|
||||
backstory="Expert at analyzing extensive documentation",
|
||||
respect_context_window=True, # Handle large documents gracefully
|
||||
max_iter=50, # Allow more iterations for complex analysis
|
||||
verbose=True
|
||||
)
|
||||
```
|
||||
|
||||
#### `respect_context_window=False`를 사용할 때:
|
||||
- **정확성이 매우 중요**하고 정보 손실이 허용되지 않을 때
|
||||
- **법률 또는 의료 업무**에서 전체 맥락이 필요한 경우
|
||||
- **코드 리뷰**에서 누락된 세부 정보가 버그를 유발할 수 있는 경우
|
||||
- **금융 분석**에서 정확도가 최우선인 경우
|
||||
|
||||
```python Code
|
||||
# Perfect for precision tasks
|
||||
precision_agent = Agent(
|
||||
role="Code Security Auditor",
|
||||
goal="Identify security vulnerabilities in code",
|
||||
backstory="Security expert requiring complete code context",
|
||||
respect_context_window=False, # Prefer failure over incomplete analysis
|
||||
max_retry_limit=1, # Fail fast on context issues
|
||||
verbose=True
|
||||
)
|
||||
```
|
||||
|
||||
### 대용량 데이터에 대한 대체 접근 방식
|
||||
|
||||
매우 큰 데이터셋을 다룰 때는 다음과 같은 전략을 고려하세요:
|
||||
|
||||
#### 1. RAG 도구 사용하기
|
||||
```python Code
|
||||
from crewai_tools import RagTool
|
||||
|
||||
# Create RAG tool for large document processing
|
||||
rag_tool = RagTool()
|
||||
|
||||
rag_agent = Agent(
|
||||
role="Research Assistant",
|
||||
goal="Query large knowledge bases efficiently",
|
||||
backstory="Expert at using RAG tools for information retrieval",
|
||||
tools=[rag_tool], # Use RAG instead of large context windows
|
||||
respect_context_window=True,
|
||||
verbose=True
|
||||
)
|
||||
```
|
||||
|
||||
#### 2. 지식 소스 사용
|
||||
```python Code
|
||||
# Use knowledge sources instead of large prompts
|
||||
knowledge_agent = Agent(
|
||||
role="Knowledge Expert",
|
||||
goal="Answer questions using curated knowledge",
|
||||
backstory="Expert at leveraging structured knowledge sources",
|
||||
knowledge_sources=[your_knowledge_sources], # Pre-processed knowledge
|
||||
respect_context_window=True,
|
||||
verbose=True
|
||||
)
|
||||
```
|
||||
|
||||
### 컨텍스트 윈도우 모범 사례
|
||||
|
||||
1. **컨텍스트 사용 모니터링**: `verbose=True`를 활성화하여 컨텍스트 관리 과정을 확인하세요
|
||||
2. **효율성 설계**: 작업 구조를 효과적으로 설계하여 컨텍스트 누적을 최소화하세요
|
||||
3. **적절한 모델 사용**: 작업에 적합한 컨텍스트 윈도우를 가진 LLM을 선택하세요
|
||||
4. **두 가지 설정 모두 테스트**: `True`와 `False` 모두 시도하여 어떤 것이 더 효과적인지 확인하세요
|
||||
5. **RAG와 조합 사용**: 매우 큰 데이터셋의 경우 컨텍스트 윈도우에만 의존하지 말고 RAG 도구도 함께 사용하세요
|
||||
|
||||
### 컨텍스트 문제 해결
|
||||
|
||||
**컨텍스트 제한 오류가 발생하는 경우:**
|
||||
```python Code
|
||||
# 빠른 해결책: 자동 처리 활성화
|
||||
agent.respect_context_window = True
|
||||
|
||||
# 더 나은 솔루션: 대용량 데이터에는 RAG 도구 사용
|
||||
from crewai_tools import RagTool
|
||||
agent.tools = [RagTool()]
|
||||
|
||||
# 대안: 작업을 더 작은 단위로 나누기
|
||||
# 또는 대용량 프롬프트 대신 knowledge 소스 사용
|
||||
```
|
||||
|
||||
**자동 요약 기능이 중요한 정보를 놓치는 경우:**
|
||||
```python Code
|
||||
# 자동 요약 비활성화 후 RAG 사용
|
||||
agent = Agent(
|
||||
role="Detailed Analyst",
|
||||
goal="Maintain complete information accuracy",
|
||||
backstory="Expert requiring full context",
|
||||
respect_context_window=False, # 요약 안 함
|
||||
tools=[RagTool()], # 대용량 데이터에는 RAG 사용
|
||||
verbose=True
|
||||
)
|
||||
```
|
||||
|
||||
<Note>
|
||||
컨텍스트 윈도우 관리 기능은 백그라운드에서 자동으로 작동합니다. 특별한 함수를 호출할 필요가 없으며, 원하는 동작에 맞게 `respect_context_window`만 설정하면 CrewAI가 나머지를 처리합니다!
|
||||
</Note>
|
||||
|
||||
## `kickoff()`을 사용한 에이전트 직접 상호작용
|
||||
|
||||
에이전트는 `kickoff()` 메서드를 사용하여 작업(task)이나 crew 워크플로우를 거치지 않고 직접 사용할 수 있습니다. 이는 전체 crew 오케스트레이션 기능이 필요하지 않을 때 에이전트와 상호작용하는 더 간단한 방법을 제공합니다.
|
||||
|
||||
### `kickoff()` 작동 방식
|
||||
|
||||
`kickoff()` 메서드는 메시지를 에이전트에게 직접 보내고 응답을 받을 수 있게 해줍니다. 이는 LLM과 상호 작용하는 것과 유사하지만, 에이전트의 모든 기능(도구, 추론 등)을 활용할 수 있다는 점이 다릅니다.
|
||||
|
||||
```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)
|
||||
```
|
||||
|
||||
### 매개변수 및 반환 값
|
||||
|
||||
| 매개변수 | 타입 | 설명 |
|
||||
| :---------------- | :---------------------------------- | :------------------------------------------------------------------------ |
|
||||
| `messages` | `Union[str, List[Dict[str, str]]]` | 문자열 쿼리 또는 역할/내용이 포함된 메시지 딕셔너리의 리스트 |
|
||||
| `response_format` | `Optional[Type[Any]]` | 구조화된 출력을 위한 선택적 Pydantic 모델 |
|
||||
|
||||
이 메서드는 다음과 같은 속성을 가진 `LiteAgentOutput` 객체를 반환합니다:
|
||||
|
||||
- `raw`: 원시 출력 텍스트를 포함하는 문자열
|
||||
- `pydantic`: 파싱된 Pydantic 모델 (`response_format`이 제공된 경우)
|
||||
- `agent_role`: 출력을 생성한 agent의 역할
|
||||
- `usage_metrics`: 실행에 대한 토큰 사용 지표
|
||||
|
||||
### 구조화된 출력
|
||||
|
||||
`response_format`으로 Pydantic 모델을 제공하여 구조화된 출력을 받을 수 있습니다:
|
||||
|
||||
```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)
|
||||
```
|
||||
|
||||
### 여러 개의 메시지
|
||||
|
||||
대화 기록을 메시지 딕셔너리의 목록으로 제공할 수도 있습니다:
|
||||
|
||||
```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)
|
||||
```
|
||||
|
||||
### 비동기 지원
|
||||
|
||||
동일한 매개변수를 사용하는 비동기 버전은 `kickoff_async()`를 통해 사용할 수 있습니다:
|
||||
|
||||
```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>
|
||||
`kickoff()` 메서드는 내부적으로 `LiteAgent`를 사용하며, 모든 agent 설정(역할, 목표, 백스토리, 도구 등)을 유지하면서도 더 간단한 실행 흐름을 제공합니다.
|
||||
</Note>
|
||||
|
||||
## 중요한 고려사항 및 모범 사례
|
||||
|
||||
### 보안 및 코드 실행
|
||||
- `allow_code_execution`을 사용할 때는 사용자 입력에 주의하고 항상 입력 값을 검증하세요
|
||||
- 운영 환경에서는 `code_execution_mode: "safe"`(Docker)를 사용하세요
|
||||
- 무한 루프를 방지하기 위해 적절한 `max_execution_time` 제한을 설정하는 것을 고려하세요
|
||||
|
||||
### 성능 최적화
|
||||
- `respect_context_window: true`를 사용하여 토큰 제한 문제를 방지하세요.
|
||||
- 적절한 `max_rpm`을 설정하여 속도 제한을 피하세요.
|
||||
- 반복적인 작업의 성능 향상을 위해 `cache: true`를 활성화하세요.
|
||||
- 작업의 복잡도에 따라 `max_iter`와 `max_retry_limit`을 조정하세요.
|
||||
|
||||
### 메모리 및 컨텍스트 관리
|
||||
- 도메인별 정보를 위해 `knowledge_sources`를 활용하세요
|
||||
- 커스텀 임베딩 모델을 사용할 때는 `embedder`를 구성하세요
|
||||
- 에이전트 행동을 세밀하게 제어하려면 커스텀 템플릿(`system_template`, `prompt_template`, `response_template`)을 사용하세요
|
||||
|
||||
### 고급 기능
|
||||
- 복잡한 작업을 실행하기 전에 계획을 세우고 반성해야 하는 에이전트의 경우 `reasoning: true`를 활성화하세요.
|
||||
- 계획 반복 횟수를 제어하려면 적절한 `max_reasoning_attempts` 값을 설정하세요 (무제한 시 None 사용).
|
||||
- 시간에 민감한 작업을 위해 에이전트가 현재 날짜를 인식할 수 있도록 `inject_date: true`를 사용하세요.
|
||||
- 표준 Python datetime 형식 코드를 사용하여 `date_format`으로 날짜 형식을 맞춤 설정할 수 있습니다.
|
||||
- 텍스트와 시각적 콘텐츠를 모두 처리해야 하는 에이전트의 경우 `multimodal: true`를 활성화하세요.
|
||||
|
||||
### 에이전트 협업
|
||||
- 에이전트들이 함께 작업해야 할 때 `allow_delegation: true`를 활성화하세요
|
||||
- 에이전트 상호작용을 모니터링하고 기록하려면 `step_callback`을 사용하세요
|
||||
- 다양한 목적에 따라 서로 다른 LLM을 사용하는 것을 고려하세요:
|
||||
- 복잡한 추론에는 메인 `llm`
|
||||
- 효율적인 도구 사용에는 `function_calling_llm`
|
||||
|
||||
### 날짜 인식 및 추론
|
||||
- 시간에 민감한 작업을 위해 `inject_date: true`를 사용하여 에이전트에게 현재 날짜 인식 기능을 제공합니다.
|
||||
- 표준 Python datetime 형식 코드를 사용하는 `date_format`으로 날짜 형식을 사용자 정의할 수 있습니다.
|
||||
- 유효한 형식 코드는 다음과 같습니다: %Y (연도), %m (월), %d (일), %B (전체 월 이름) 등.
|
||||
- 잘못된 날짜 형식은 경고로 기록되며, 작업 설명을 수정하지 않습니다.
|
||||
- 사전 계획 및 성찰이 필요한 복잡한 작업의 경우 `reasoning: true`를 활성화하세요.
|
||||
|
||||
### 모델 호환성
|
||||
- 시스템 메시지를 지원하지 않는 이전 모델의 경우 `use_system_prompt: false`로 설정하세요
|
||||
- 선택한 `llm`이(가) 필요한 기능(예: 함수 호출)을 지원하는지 확인하세요
|
||||
|
||||
## 일반적인 문제 해결
|
||||
|
||||
1. **Rate Limiting(속도 제한)**: API 속도 제한에 도달하는 경우:
|
||||
- 적절한 `max_rpm` 구현
|
||||
- 반복적인 작업에 캐싱 사용
|
||||
- 요청을 일괄 처리(batch)하는 것 고려
|
||||
|
||||
2. **Context Window Errors(컨텍스트 윈도우 오류)**: 컨텍스트 한계를 초과하는 경우:
|
||||
- `respect_context_window` 활성화
|
||||
- 더 효율적인 프롬프트 사용
|
||||
- 주기적으로 에이전트 메모리 정리
|
||||
|
||||
3. **Code Execution Issues(코드 실행 문제)**: 코드 실행이 실패하는 경우:
|
||||
- 안전 모드를 위해 Docker 설치 여부 확인
|
||||
- 실행 권한 확인
|
||||
- 코드 샌드박스 설정 검토
|
||||
|
||||
4. **Memory Issues(메모리 문제)**: 에이전트 응답이 일관되지 않은 경우:
|
||||
- knowledge 소스 구성 확인
|
||||
- 대화 기록 관리 검토
|
||||
|
||||
에이전트는 특정 사용 사례에 맞게 구성될 때 가장 효과적입니다. 자신의 요구 사항을 이해하고 이에 맞게 이러한 매개변수를 조정하는 데 시간을 투자하세요.
|
||||
390
docs/ko/concepts/cli.mdx
Normal file
@@ -0,0 +1,390 @@
|
||||
---
|
||||
title: CLI
|
||||
description: CrewAI CLI를 사용하여 CrewAI와 상호 작용하는 방법을 알아보세요.
|
||||
icon: terminal
|
||||
---
|
||||
|
||||
<Warning>릴리즈 0.140.0부터 CrewAI Enterprise는 로그인 제공자 마이그레이션 프로세스를 시작했습니다. 이에 따라 CLI를 통한 인증 흐름이 업데이트되었습니다. Google을 통해 로그인하거나 2025년 7월 3일 이후에 계정을 생성한 사용자는 이전 버전의 `crewai` 라이브러리로는 로그인할 수 없습니다.</Warning>
|
||||
|
||||
## 개요
|
||||
|
||||
CrewAI CLI는 CrewAI와 상호작용할 수 있는 명령어 세트를 제공하여 crew 및 flow를 생성, 학습, 실행, 관리할 수 있습니다.
|
||||
|
||||
## 설치
|
||||
|
||||
CrewAI CLI를 사용하려면, CrewAI가 설치되어 있어야 합니다:
|
||||
|
||||
```shell Terminal
|
||||
pip install crewai
|
||||
```
|
||||
|
||||
## 기본 사용법
|
||||
|
||||
CrewAI CLI 명령어의 기본 구조는 다음과 같습니다:
|
||||
|
||||
```shell Terminal
|
||||
crewai [COMMAND] [OPTIONS] [ARGUMENTS]
|
||||
```
|
||||
|
||||
## 사용 가능한 명령어
|
||||
|
||||
### 1. 생성
|
||||
|
||||
새로운 crew 또는 flow를 생성합니다.
|
||||
|
||||
```shell Terminal
|
||||
crewai create [OPTIONS] TYPE NAME
|
||||
```
|
||||
|
||||
- `TYPE`: "crew" 또는 "flow" 중에서 선택
|
||||
- `NAME`: crew 또는 flow의 이름
|
||||
|
||||
예시:
|
||||
```shell Terminal
|
||||
crewai create crew my_new_crew
|
||||
crewai create flow my_new_flow
|
||||
```
|
||||
|
||||
### 2. 버전
|
||||
|
||||
설치된 CrewAI의 버전을 표시합니다.
|
||||
|
||||
```shell Terminal
|
||||
crewai version [OPTIONS]
|
||||
```
|
||||
|
||||
- `--tools`: (선택 사항) 설치된 CrewAI tools의 버전을 표시합니다.
|
||||
|
||||
예시:
|
||||
```shell Terminal
|
||||
crewai version
|
||||
crewai version --tools
|
||||
```
|
||||
|
||||
### 3. 훈련
|
||||
|
||||
지정된 횟수만큼 crew를 훈련시킵니다.
|
||||
|
||||
```shell Terminal
|
||||
crewai train [OPTIONS]
|
||||
```
|
||||
|
||||
- `-n, --n_iterations INTEGER`: crew를 훈련할 반복 횟수 (기본값: 5)
|
||||
- `-f, --filename TEXT`: 훈련에 사용할 커스텀 파일의 경로 (기본값: "trained_agents_data.pkl")
|
||||
|
||||
예시:
|
||||
```shell Terminal
|
||||
crewai train -n 10 -f my_training_data.pkl
|
||||
```
|
||||
|
||||
### 4. 다시 실행
|
||||
|
||||
특정 task에서 crew 실행을 다시 재생합니다.
|
||||
|
||||
```shell Terminal
|
||||
crewai replay [OPTIONS]
|
||||
```
|
||||
|
||||
- `-t, --task_id TEXT`: 이 task ID에서부터 crew를 다시 재생하며, 이후의 모든 task를 포함합니다.
|
||||
|
||||
예시:
|
||||
```shell Terminal
|
||||
crewai replay -t task_123456
|
||||
```
|
||||
|
||||
### 5. Log-tasks-outputs
|
||||
|
||||
가장 최근의 crew.kickoff() 작업 결과를 조회합니다.
|
||||
|
||||
```shell Terminal
|
||||
crewai log-tasks-outputs
|
||||
```
|
||||
|
||||
### 6. Reset-memories
|
||||
|
||||
크루의 메모리(롱, 쇼트, 엔티티, latest_crew_kickoff_outputs)를 초기화합니다.
|
||||
|
||||
```shell Terminal
|
||||
crewai reset-memories [OPTIONS]
|
||||
```
|
||||
|
||||
- `-l, --long`: LONG TERM 메모리 초기화
|
||||
- `-s, --short`: SHORT TERM 메모리 초기화
|
||||
- `-e, --entities`: ENTITIES 메모리 초기화
|
||||
- `-k, --kickoff-outputs`: LATEST KICKOFF TASK OUTPUTS 초기화
|
||||
- `-kn, --knowledge`: KNOWLEDGE 저장소 초기화
|
||||
- `-akn, --agent-knowledge`: AGENT KNOWLEDGE 저장소 초기화
|
||||
- `-a, --all`: 모든 메모리 초기화
|
||||
|
||||
예시:
|
||||
```shell Terminal
|
||||
crewai reset-memories --long --short
|
||||
crewai reset-memories --all
|
||||
```
|
||||
|
||||
### 7. 테스트
|
||||
|
||||
crew를 테스트하고 결과를 평가합니다.
|
||||
|
||||
```shell Terminal
|
||||
crewai test [OPTIONS]
|
||||
```
|
||||
|
||||
- `-n, --n_iterations INTEGER`: crew를 테스트할 반복 횟수 (기본값: 3)
|
||||
- `-m, --model TEXT`: Crew에서 테스트를 실행할 LLM 모델 (기본값: "gpt-4o-mini")
|
||||
|
||||
예시:
|
||||
```shell Terminal
|
||||
crewai test -n 5 -m gpt-3.5-turbo
|
||||
```
|
||||
|
||||
### 8. 실행
|
||||
|
||||
crew 또는 flow를 실행합니다.
|
||||
|
||||
```shell Terminal
|
||||
crewai run
|
||||
```
|
||||
|
||||
<Note>
|
||||
버전 0.103.0부터 `crewai run` 명령은 표준 crew와 flow 모두를 실행하는 데 사용할 수 있습니다. flow의 경우 pyproject.toml에서 유형을 자동으로 감지하여 적절한 명령을 실행합니다. 이제 crew와 flow 모두를 실행하는 권장 방법입니다.
|
||||
</Note>
|
||||
|
||||
<Note>
|
||||
이 명령들은 CrewAI 프로젝트가 설정된 디렉터리에서 실행해야 합니다.
|
||||
일부 명령은 프로젝트 구조 내에서 추가 구성 또는 설정이 필요할 수 있습니다.
|
||||
</Note>
|
||||
|
||||
### 9. Chat
|
||||
|
||||
버전 `0.98.0`부터 `crewai chat` 명령어를 실행하면 크루와의 대화형 세션이 시작됩니다. AI 어시스턴트가 크루를 실행하는 데 필요한 입력값을 요청하며 안내합니다. 모든 입력값이 제공되면 크루가 작업을 실행합니다.
|
||||
|
||||
결과를 받은 후에도 추가 지시나 질문을 위해 어시스턴트와 계속 상호작용할 수 있습니다.
|
||||
|
||||
```shell Terminal
|
||||
crewai chat
|
||||
```
|
||||
<Note>
|
||||
이 명령어들은 CrewAI 프로젝트의 루트 디렉터리에서 실행해야 합니다.
|
||||
</Note>
|
||||
<Note>
|
||||
중요: 이 명령어를 사용하려면 `crew.py` 파일에서 `chat_llm` 속성을 설정해야 합니다.
|
||||
|
||||
```python
|
||||
@crew
|
||||
def crew(self) -> Crew:
|
||||
return Crew(
|
||||
agents=self.agents,
|
||||
tasks=self.tasks,
|
||||
process=Process.sequential,
|
||||
verbose=True,
|
||||
chat_llm="gpt-4o", # LLM for chat orchestration
|
||||
)
|
||||
```
|
||||
</Note>
|
||||
|
||||
### 10. 배포
|
||||
|
||||
crew 또는 flow를 [CrewAI Enterprise](https://app.crewai.com)에 배포하세요.
|
||||
|
||||
- **인증**: CrewAI Enterprise에 배포하려면 인증이 필요합니다.
|
||||
아래 명령어로 로그인하거나 계정을 생성할 수 있습니다:
|
||||
```shell Terminal
|
||||
crewai login
|
||||
```
|
||||
|
||||
- **배포 생성**: 인증이 완료되면, 로컬 프로젝트의 루트에서 crew 또는 flow에 대한 배포를 생성할 수 있습니다.
|
||||
```shell Terminal
|
||||
crewai deploy create
|
||||
```
|
||||
- 로컬 프로젝트 구성을 읽어옵니다.
|
||||
- 로컬에서 확인된 환경 변수(`OPENAI_API_KEY`, `SERPER_API_KEY` 등)를 확인하도록 안내합니다. 이 변수들은 Enterprise 플랫폼에 배포할 때 안전하게 저장됩니다. 실행 전에 중요한 키가 로컬(예: `.env` 파일)에 올바르게 구성되어 있는지 확인하세요.
|
||||
|
||||
### 11. 조직 관리
|
||||
|
||||
CrewAI Enterprise 조직을 관리합니다.
|
||||
|
||||
```shell Terminal
|
||||
crewai org [COMMAND] [OPTIONS]
|
||||
```
|
||||
|
||||
#### 명령어:
|
||||
|
||||
- `list`: 사용자가 속한 모든 조직을 나열합니다.
|
||||
```shell Terminal
|
||||
crewai org list
|
||||
```
|
||||
|
||||
- `current`: 현재 활성화된 조직을 표시합니다.
|
||||
```shell Terminal
|
||||
crewai org current
|
||||
```
|
||||
|
||||
- `switch`: 특정 조직으로 전환합니다.
|
||||
```shell Terminal
|
||||
crewai org switch <organization_id>
|
||||
```
|
||||
|
||||
<Note>
|
||||
이러한 조직 관리 명령어를 사용하려면 CrewAI Enterprise에 인증되어 있어야 합니다.
|
||||
</Note>
|
||||
|
||||
- **배포 생성** (계속):
|
||||
- 배포를 해당 원격 GitHub 저장소에 연결합니다 (일반적으로 자동으로 감지됩니다).
|
||||
|
||||
- **Crew 배포**: 인증이 완료되면 crew 또는 flow를 CrewAI Enterprise에 배포할 수 있습니다.
|
||||
```shell Terminal
|
||||
crewai deploy push
|
||||
```
|
||||
- CrewAI Enterprise 플랫폼에서 배포 프로세스를 시작합니다.
|
||||
- 성공적으로 시작되면, Deployment created successfully! 메시지와 함께 Deployment Name 및 고유한 Deployment ID(UUID)가 출력됩니다.
|
||||
|
||||
- **배포 상태**: 배포 상태를 확인하려면 다음을 사용합니다:
|
||||
```shell Terminal
|
||||
crewai deploy status
|
||||
```
|
||||
이 명령은 가장 최근의 배포 시도에 대한 최신 배포 상태(예: `Building Images for Crew`, `Deploy Enqueued`, `Online`)를 가져옵니다.
|
||||
|
||||
- **배포 로그**: 배포 로그를 확인하려면 다음을 사용합니다:
|
||||
```shell Terminal
|
||||
crewai deploy logs
|
||||
```
|
||||
이 명령은 배포 로그를 터미널로 스트리밍합니다.
|
||||
|
||||
- **배포 목록**: 모든 배포를 나열하려면 다음을 사용합니다:
|
||||
```shell Terminal
|
||||
crewai deploy list
|
||||
```
|
||||
이 명령은 모든 배포를 나열합니다.
|
||||
|
||||
- **배포 삭제**: 배포를 삭제하려면 다음을 사용합니다:
|
||||
```shell Terminal
|
||||
crewai deploy remove
|
||||
```
|
||||
이 명령은 CrewAI Enterprise 플랫폼에서 배포를 삭제합니다.
|
||||
|
||||
- **도움말 명령어**: CLI에 대한 도움말을 보려면 다음을 사용합니다:
|
||||
```shell Terminal
|
||||
crewai deploy --help
|
||||
```
|
||||
이 명령은 CrewAI Deploy CLI에 대한 도움말 메시지를 표시합니다.
|
||||
|
||||
CLI를 사용하여 [CrewAI Enterprise](http://app.crewai.com)에 crew를 배포하는 단계별 시연은 아래 비디오 튜토리얼을 참조하십시오.
|
||||
|
||||
<iframe
|
||||
width="100%"
|
||||
height="400"
|
||||
src="https://www.youtube.com/embed/3EqSV-CYDZA"
|
||||
title="CrewAI Deployment Guide"
|
||||
frameborder="0"
|
||||
style={{ borderRadius: '10px' }}
|
||||
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
|
||||
allowfullscreen
|
||||
></iframe>
|
||||
|
||||
### 11. API 키
|
||||
|
||||
```crewai create crew``` 명령어를 실행하면, CLI에서 선택할 수 있는 LLM 제공업체 목록이 표시되고, 그 다음으로 선택한 제공업체에 대한 모델 선택이 이어집니다.
|
||||
|
||||
LLM 제공업체와 모델을 선택하면, API 키를 입력하라는 메시지가 표시됩니다.
|
||||
|
||||
#### 사용 가능한 LLM 공급자
|
||||
|
||||
다음은 CLI에서 제안하는 가장 인기 있는 LLM 공급자 목록입니다:
|
||||
|
||||
* OpenAI
|
||||
* Groq
|
||||
* Anthropic
|
||||
* Google Gemini
|
||||
* SambaNova
|
||||
|
||||
공급자를 선택하면, CLI가 해당 공급자에서 사용 가능한 모델을 보여주고 API 키 입력을 요청합니다.
|
||||
|
||||
#### 기타 옵션
|
||||
|
||||
"기타"를 선택하면 LiteLLM에서 지원하는 공급자 목록에서 선택할 수 있습니다.
|
||||
|
||||
공급자를 선택하면 CLI에서 Key 이름과 API 키 입력을 요청합니다.
|
||||
|
||||
각 공급자의 Key 이름은 다음 링크에서 확인할 수 있습니다:
|
||||
|
||||
* [LiteLLM 공급자](https://docs.litellm.ai/docs/providers)
|
||||
|
||||
### 12. 구성 관리
|
||||
|
||||
CrewAI의 CLI 구성 설정을 관리합니다.
|
||||
|
||||
```shell Terminal
|
||||
crewai config [COMMAND] [OPTIONS]
|
||||
```
|
||||
|
||||
#### 명령어:
|
||||
|
||||
- `list`: 모든 CLI 구성 매개변수 표시
|
||||
```shell Terminal
|
||||
crewai config list
|
||||
```
|
||||
|
||||
- `set`: CLI 구성 매개변수 설정
|
||||
```shell Terminal
|
||||
crewai config set <key> <value>
|
||||
```
|
||||
|
||||
- `reset`: 모든 CLI 구성 매개변수를 기본값으로 초기화
|
||||
```shell Terminal
|
||||
crewai config reset
|
||||
```
|
||||
|
||||
#### 사용 가능한 구성 파라미터
|
||||
|
||||
- `enterprise_base_url`: CrewAI Enterprise 인스턴스의 기본 URL
|
||||
- `oauth2_provider`: 인증에 사용되는 OAuth2 공급자 (예: workos, okta, auth0)
|
||||
- `oauth2_audience`: OAuth2 audience 값으로, 일반적으로 대상 API 또는 리소스를 식별하는 데 사용됨
|
||||
- `oauth2_client_id`: 인증 요청 시 사용되는 공급자가 발급한 OAuth2 클라이언트 ID
|
||||
- `oauth2_domain`: 토큰 발급에 사용되는 OAuth2 공급자의 도메인 (예: your-org.auth0.com)
|
||||
|
||||
#### 예시
|
||||
|
||||
현재 설정 표시:
|
||||
```shell Terminal
|
||||
crewai config list
|
||||
```
|
||||
|
||||
예시 출력:
|
||||
```
|
||||
CrewAI CLI Configuration
|
||||
┏━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
|
||||
┃ Setting ┃ Value ┃ Description ┃
|
||||
┡━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
|
||||
│ enterprise_base_url│ https://app.crewai.com │ CrewAI Enterprise 인스턴스의 기본 URL │
|
||||
│ org_name │ Not set │ 현재 활성화된 조직의 이름 │
|
||||
│ org_uuid │ Not set │ 현재 활성화된 조직의 UUID │
|
||||
│ oauth2_provider │ workos │ 인증에 사용되는 OAuth2 제공자 (예: workos, okta, auth0) │
|
||||
│ oauth2_audience │ client_01YYY │ 일반적으로 대상 API나 리소스를 식별하는 데 사용되는 OAuth2 audience 값 │
|
||||
│ oauth2_client_id │ client_01XXX │ 제공자로부터 발급된 OAuth2 client ID로, 인증 요청 시 사용됨 │
|
||||
│ oauth2_domain │ login.crewai.com │ 토큰 발급에 사용되는 OAuth2 제공자의 도메인(예: your-org.auth0.com) │
|
||||
```
|
||||
|
||||
엔터프라이즈 기본 URL 설정:
|
||||
```shell Terminal
|
||||
crewai config set enterprise_base_url https://my-enterprise.crewai.com
|
||||
```
|
||||
|
||||
OAuth2 제공자 설정:
|
||||
```shell Terminal
|
||||
crewai config set oauth2_provider auth0
|
||||
```
|
||||
|
||||
OAuth2 도메인 설정:
|
||||
```shell Terminal
|
||||
crewai config set oauth2_domain my-company.auth0.com
|
||||
```
|
||||
|
||||
모든 설정을 기본값으로 재설정:
|
||||
```shell Terminal
|
||||
crewai config reset
|
||||
```
|
||||
|
||||
<Note>
|
||||
설정 값은 `~/.config/crewai/settings.json`에 저장됩니다. 조직 이름과 UUID와 같은 일부 설정 값은 읽기 전용이며 인증 및 조직 명령을 통해 관리됩니다. 도구 저장소 관련 설정은 숨겨져 있으며 사용자가 직접 설정할 수 없습니다.
|
||||
</Note>
|
||||
362
docs/ko/concepts/collaboration.mdx
Normal file
@@ -0,0 +1,362 @@
|
||||
---
|
||||
title: 협업
|
||||
description: CrewAI 팀 내에서 에이전트가 함께 작업하고, 작업을 위임하며, 효과적으로 소통하는 방법에 대해 설명합니다.
|
||||
icon: screen-users
|
||||
---
|
||||
|
||||
## 개요
|
||||
|
||||
CrewAI에서의 협업은 에이전트들이 팀으로서 함께 작업하며, 각자의 전문성을 활용하기 위해 작업을 위임하고 질문을 주고받을 수 있도록 합니다. `allow_delegation=True`로 설정하면, 에이전트들은 자동으로 강력한 협업 도구에 접근할 수 있습니다.
|
||||
|
||||
## 빠른 시작: 협업 활성화
|
||||
|
||||
```python
|
||||
from crewai import Agent, Crew, Task
|
||||
|
||||
# Enable collaboration for agents
|
||||
researcher = Agent(
|
||||
role="Research Specialist",
|
||||
goal="Conduct thorough research on any topic",
|
||||
backstory="Expert researcher with access to various sources",
|
||||
allow_delegation=True, # 🔑 Key setting for collaboration
|
||||
verbose=True
|
||||
)
|
||||
|
||||
writer = Agent(
|
||||
role="Content Writer",
|
||||
goal="Create engaging content based on research",
|
||||
backstory="Skilled writer who transforms research into compelling content",
|
||||
allow_delegation=True, # 🔑 Enables asking questions to other agents
|
||||
verbose=True
|
||||
)
|
||||
|
||||
# Agents can now collaborate automatically
|
||||
crew = Crew(
|
||||
agents=[researcher, writer],
|
||||
tasks=[...],
|
||||
verbose=True
|
||||
)
|
||||
```
|
||||
|
||||
## 에이전트 협업 방식
|
||||
|
||||
`allow_delegation=True`로 설정하면, CrewAI는 에이전트에게 두 가지 강력한 도구를 자동으로 제공합니다.
|
||||
|
||||
### 1. **업무 위임 도구**
|
||||
에이전트가 특정 전문성을 가진 팀원에게 작업을 할당할 수 있습니다.
|
||||
|
||||
```python
|
||||
# Agent automatically gets this tool:
|
||||
# Delegate work to coworker(task: str, context: str, coworker: str)
|
||||
```
|
||||
|
||||
### 2. **질문하기 도구**
|
||||
에이전트가 동료로부터 정보를 수집하기 위해 특정 질문을 할 수 있게 해줍니다.
|
||||
|
||||
```python
|
||||
# Agent automatically gets this tool:
|
||||
# Ask question to coworker(question: str, context: str, coworker: str)
|
||||
```
|
||||
|
||||
## 협업의 실제
|
||||
|
||||
아래는 에이전트들이 콘텐츠 제작 작업에 협력하는 완성된 예시입니다:
|
||||
|
||||
```python
|
||||
from crewai import Agent, Crew, Task, Process
|
||||
|
||||
# Create collaborative agents
|
||||
researcher = Agent(
|
||||
role="Research Specialist",
|
||||
goal="Find accurate, up-to-date information on any topic",
|
||||
backstory="""You're a meticulous researcher with expertise in finding
|
||||
reliable sources and fact-checking information across various domains.""",
|
||||
allow_delegation=True,
|
||||
verbose=True
|
||||
)
|
||||
|
||||
writer = Agent(
|
||||
role="Content Writer",
|
||||
goal="Create engaging, well-structured content",
|
||||
backstory="""You're a skilled content writer who excels at transforming
|
||||
research into compelling, readable content for different audiences.""",
|
||||
allow_delegation=True,
|
||||
verbose=True
|
||||
)
|
||||
|
||||
editor = Agent(
|
||||
role="Content Editor",
|
||||
goal="Ensure content quality and consistency",
|
||||
backstory="""You're an experienced editor with an eye for detail,
|
||||
ensuring content meets high standards for clarity and accuracy.""",
|
||||
allow_delegation=True,
|
||||
verbose=True
|
||||
)
|
||||
|
||||
# Create a task that encourages collaboration
|
||||
article_task = Task(
|
||||
description="""Write a comprehensive 1000-word article about 'The Future of AI in Healthcare'.
|
||||
|
||||
The article should include:
|
||||
- Current AI applications in healthcare
|
||||
- Emerging trends and technologies
|
||||
- Potential challenges and ethical considerations
|
||||
- Expert predictions for the next 5 years
|
||||
|
||||
Collaborate with your teammates to ensure accuracy and quality.""",
|
||||
expected_output="A well-researched, engaging 1000-word article with proper structure and citations",
|
||||
agent=writer # Writer leads, but can delegate research to researcher
|
||||
)
|
||||
|
||||
# Create collaborative crew
|
||||
crew = Crew(
|
||||
agents=[researcher, writer, editor],
|
||||
tasks=[article_task],
|
||||
process=Process.sequential,
|
||||
verbose=True
|
||||
)
|
||||
|
||||
result = crew.kickoff()
|
||||
```
|
||||
|
||||
## 협업 패턴
|
||||
|
||||
### 패턴 1: 조사 → 작성 → 편집
|
||||
```python
|
||||
research_task = Task(
|
||||
description="Research the latest developments in quantum computing",
|
||||
expected_output="Comprehensive research summary with key findings and sources",
|
||||
agent=researcher
|
||||
)
|
||||
|
||||
writing_task = Task(
|
||||
description="Write an article based on the research findings",
|
||||
expected_output="Engaging 800-word article about quantum computing",
|
||||
agent=writer,
|
||||
context=[research_task] # Gets research output as context
|
||||
)
|
||||
|
||||
editing_task = Task(
|
||||
description="Edit and polish the article for publication",
|
||||
expected_output="Publication-ready article with improved clarity and flow",
|
||||
agent=editor,
|
||||
context=[writing_task] # Gets article draft as context
|
||||
)
|
||||
```
|
||||
|
||||
### 패턴 2: 협업 단일 작업
|
||||
```python
|
||||
collaborative_task = Task(
|
||||
description="""Create a marketing strategy for a new AI product.
|
||||
|
||||
Writer: Focus on messaging and content strategy
|
||||
Researcher: Provide market analysis and competitor insights
|
||||
|
||||
Work together to create a comprehensive strategy.""",
|
||||
expected_output="Complete marketing strategy with research backing",
|
||||
agent=writer # Lead agent, but can delegate to researcher
|
||||
)
|
||||
```
|
||||
|
||||
## 계층적 협업
|
||||
|
||||
복잡한 프로젝트의 경우, 매니저 에이전트를 활용하여 계층적 프로세스를 사용하세요:
|
||||
|
||||
```python
|
||||
from crewai import Agent, Crew, Task, Process
|
||||
|
||||
# Manager agent coordinates the team
|
||||
manager = Agent(
|
||||
role="Project Manager",
|
||||
goal="Coordinate team efforts and ensure project success",
|
||||
backstory="Experienced project manager skilled at delegation and quality control",
|
||||
allow_delegation=True,
|
||||
verbose=True
|
||||
)
|
||||
|
||||
# Specialist agents
|
||||
researcher = Agent(
|
||||
role="Researcher",
|
||||
goal="Provide accurate research and analysis",
|
||||
backstory="Expert researcher with deep analytical skills",
|
||||
allow_delegation=False, # Specialists focus on their expertise
|
||||
verbose=True
|
||||
)
|
||||
|
||||
writer = Agent(
|
||||
role="Writer",
|
||||
goal="Create compelling content",
|
||||
backstory="Skilled writer who creates engaging content",
|
||||
allow_delegation=False,
|
||||
verbose=True
|
||||
)
|
||||
|
||||
# Manager-led task
|
||||
project_task = Task(
|
||||
description="Create a comprehensive market analysis report with recommendations",
|
||||
expected_output="Executive summary, detailed analysis, and strategic recommendations",
|
||||
agent=manager # Manager will delegate to specialists
|
||||
)
|
||||
|
||||
# Hierarchical crew
|
||||
crew = Crew(
|
||||
agents=[manager, researcher, writer],
|
||||
tasks=[project_task],
|
||||
process=Process.hierarchical, # Manager coordinates everything
|
||||
manager_llm="gpt-4o", # Specify LLM for manager
|
||||
verbose=True
|
||||
)
|
||||
```
|
||||
|
||||
## 협업을 위한 모범 사례
|
||||
|
||||
### 1. **명확한 역할 정의**
|
||||
```python
|
||||
# ✅ Good: Specific, complementary roles
|
||||
researcher = Agent(role="Market Research Analyst", ...)
|
||||
writer = Agent(role="Technical Content Writer", ...)
|
||||
|
||||
# ❌ Avoid: Overlapping or vague roles
|
||||
agent1 = Agent(role="General Assistant", ...)
|
||||
agent2 = Agent(role="Helper", ...)
|
||||
```
|
||||
|
||||
### 2. **전략적 위임 활성화**
|
||||
```python
|
||||
# ✅ Enable delegation for coordinators and generalists
|
||||
lead_agent = Agent(
|
||||
role="Content Lead",
|
||||
allow_delegation=True, # Can delegate to specialists
|
||||
...
|
||||
)
|
||||
|
||||
# ✅ Disable for focused specialists (optional)
|
||||
specialist_agent = Agent(
|
||||
role="Data Analyst",
|
||||
allow_delegation=False, # Focuses on core expertise
|
||||
...
|
||||
)
|
||||
```
|
||||
|
||||
### 3. **컨텍스트 공유**
|
||||
```python
|
||||
# ✅ Use context parameter for task dependencies
|
||||
writing_task = Task(
|
||||
description="Write article based on research",
|
||||
agent=writer,
|
||||
context=[research_task], # Shares research results
|
||||
...
|
||||
)
|
||||
```
|
||||
|
||||
### 4. **명확한 작업 설명**
|
||||
```python
|
||||
# ✅ 구체적이고 실행 가능한 설명
|
||||
Task(
|
||||
description="""Research competitors in the AI chatbot space.
|
||||
Focus on: pricing models, key features, target markets.
|
||||
Provide data in a structured format.""",
|
||||
...
|
||||
)
|
||||
|
||||
# ❌ 협업에 도움이 되지 않는 모호한 설명
|
||||
Task(description="Do some research about chatbots", ...)
|
||||
```
|
||||
|
||||
## 협업 문제 해결
|
||||
|
||||
### 문제: 에이전트들이 협업하지 않음
|
||||
**증상:** 에이전트들이 각자 작업하며, 위임이 이루어지지 않음
|
||||
```python
|
||||
# ✅ Solution: Ensure delegation is enabled
|
||||
agent = Agent(
|
||||
role="...",
|
||||
allow_delegation=True, # This is required!
|
||||
...
|
||||
)
|
||||
```
|
||||
|
||||
### 문제: 지나친 이중 확인
|
||||
**증상:** 에이전트가 과도하게 질문을 하여 진행이 느려짐
|
||||
```python
|
||||
# ✅ Solution: Provide better context and specific roles
|
||||
Task(
|
||||
description="""Write a technical blog post about machine learning.
|
||||
|
||||
Context: Target audience is software developers with basic ML knowledge.
|
||||
Length: 1200 words
|
||||
Include: code examples, practical applications, best practices
|
||||
|
||||
If you need specific technical details, delegate research to the researcher.""",
|
||||
...
|
||||
)
|
||||
```
|
||||
|
||||
### 문제: 위임 루프
|
||||
**증상:** 에이전트들이 무한히 서로에게 위임함
|
||||
```python
|
||||
# ✅ Solution: Clear hierarchy and responsibilities
|
||||
manager = Agent(role="Manager", allow_delegation=True)
|
||||
specialist1 = Agent(role="Specialist A", allow_delegation=False) # No re-delegation
|
||||
specialist2 = Agent(role="Specialist B", allow_delegation=False)
|
||||
```
|
||||
|
||||
## 고급 협업 기능
|
||||
|
||||
### 맞춤 협업 규칙
|
||||
```python
|
||||
# Set specific collaboration guidelines in agent backstory
|
||||
agent = Agent(
|
||||
role="Senior Developer",
|
||||
backstory="""You lead development projects and coordinate with team members.
|
||||
|
||||
Collaboration guidelines:
|
||||
- Delegate research tasks to the Research Analyst
|
||||
- Ask the Designer for UI/UX guidance
|
||||
- Consult the QA Engineer for testing strategies
|
||||
- Only escalate blocking issues to the Project Manager""",
|
||||
allow_delegation=True
|
||||
)
|
||||
```
|
||||
|
||||
### 협업 모니터링
|
||||
```python
|
||||
def track_collaboration(output):
|
||||
"""Track collaboration patterns"""
|
||||
if "Delegate work to coworker" in output.raw:
|
||||
print("🤝 Delegation occurred")
|
||||
if "Ask question to coworker" in output.raw:
|
||||
print("❓ Question asked")
|
||||
|
||||
crew = Crew(
|
||||
agents=[...],
|
||||
tasks=[...],
|
||||
step_callback=track_collaboration, # Monitor collaboration
|
||||
verbose=True
|
||||
)
|
||||
```
|
||||
|
||||
## 메모리와 학습
|
||||
|
||||
에이전트가 과거 협업을 기억할 수 있도록 합니다:
|
||||
|
||||
```python
|
||||
agent = Agent(
|
||||
role="Content Lead",
|
||||
memory=True, # Remembers past interactions
|
||||
allow_delegation=True,
|
||||
verbose=True
|
||||
)
|
||||
```
|
||||
|
||||
메모리가 활성화되면, 에이전트는 이전 협업에서 학습하여 시간이 지남에 따라 더 나은 위임 결정을 내릴 수 있습니다.
|
||||
|
||||
## 다음 단계
|
||||
|
||||
- **예제 시도하기**: 기본 협업 예제부터 시작하세요
|
||||
- **역할 실험하기**: 다양한 에이전트 역할 조합을 테스트해 보세요
|
||||
- **상호작용 모니터링**: 협업 과정을 직접 보려면 `verbose=True`를 사용하세요
|
||||
- **작업 설명 최적화**: 명확한 작업이 더 나은 협업으로 이어집니다
|
||||
- **확장하기**: 복잡한 프로젝트에는 계층적 프로세스를 시도해 보세요
|
||||
|
||||
협업은 개별 AI 에이전트를 복잡하고 다면적인 문제를 함께 해결할 수 있는 강력한 팀으로 변화시킵니다.
|
||||
368
docs/ko/concepts/crews.mdx
Normal file
@@ -0,0 +1,368 @@
|
||||
---
|
||||
title: 크루
|
||||
description: crewAI 프레임워크에서 크루를 이해하고 다양한 속성과 기능을 활용하기.
|
||||
icon: people-group
|
||||
---
|
||||
|
||||
## 개요
|
||||
|
||||
crewAI에서 crew는 일련의 작업을 달성하기 위해 함께 협력하는 에이전트들의 그룹을 나타냅니다. 각 crew는 작업 실행, 에이전트 간 협업, 그리고 전체 워크플로우에 대한 전략을 정의합니다.
|
||||
|
||||
## Crew 속성
|
||||
|
||||
| 속성 | 파라미터 | 설명 |
|
||||
| :-------------------------------------- | :---------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| **Tasks** | `tasks` | crew에 할당된 작업들의 리스트. |
|
||||
| **Agents** | `agents` | crew의 일원이 되는 에이전트들의 리스트. |
|
||||
| **Process** _(선택사항)_ | `process` | crew가 따르는 프로세스 플로우(예: 순차, 계층적). 기본값은 `sequential`. |
|
||||
| **Verbose** _(선택사항)_ | `verbose` | 실행 중 로그의 상세도 설정. 기본값은 `False`. |
|
||||
| **Manager LLM** _(선택사항)_ | `manager_llm` | 계층적 프로세스에서 매니저 에이전트가 사용하는 언어 모델. **계층적 프로세스를 사용할 때 필수.** |
|
||||
| **Function Calling LLM** _(선택사항)_ | `function_calling_llm` | 전달 시, crew 전체의 모든 agent에 대해 도구의 function calling에 이 LLM을 사용. 각 agent마다 개별 LLM을 가질 수 있으며, 이 경우 crew의 function calling LLM을 오버라이드 함. |
|
||||
| **Config** _(선택사항)_ | `config` | crew용으로 선택적인 구성 설정. `Json` 또는 `Dict[str, Any]` 형식 사용. |
|
||||
| **Max RPM** _(선택사항)_ | `max_rpm` | 실행 중 crew가 준수하는 분당 최대 요청 수. 기본값은 `None`. |
|
||||
| **Memory** _(선택사항)_ | `memory` | 실행 메모리(단기, 장기, 엔터티 메모리) 저장에 사용됨. |
|
||||
| **Cache** _(선택사항)_ | `cache` | 도구 실행 결과를 캐시에 저장할지 여부. 기본값은 `True`. |
|
||||
| **Embedder** _(선택사항)_ | `embedder` | crew에서 사용할 embedder 설정. 현재는 주로 메모리에서 사용. 기본값은 `{"provider": "openai"}`. |
|
||||
| **Step Callback** _(선택사항)_ | `step_callback` | 각 agent의 단계가 끝난 후 호출되는 함수. agent의 작업 기록이나 기타 작업 수행에 사용 가능; agent별 `step_callback`을 오버라이드하지 않음. |
|
||||
| **Task Callback** _(선택사항)_ | `task_callback` | 각 작업 완료 후 호출되는 함수. 작업 실행 후 모니터링이나 추가 작업에 유용. |
|
||||
| **Share Crew** _(선택사항)_ | `share_crew` | 라이브러리 개선 및 모델 학습을 위해 crew 정보와 실행을 crewAI 팀에 공유할지 여부. |
|
||||
| **Output Log File** _(선택사항)_ | `output_log_file` | `True`로 설정 시 로그를 현재 디렉터리에 logs.txt로 저장하거나 파일 경로 지정 가능. 파일명이 .json으로 끝나면 JSON 형식, 아니면 txt 형식으로 로그를 저장. 기본값은 `None`. |
|
||||
| **Manager Agent** _(선택사항)_ | `manager_agent` | 매니저로 사용할 커스텀 agent를 설정. |
|
||||
| **Prompt File** _(선택사항)_ | `prompt_file` | crew에서 사용할 prompt JSON 파일 경로. |
|
||||
| **Planning** *(선택사항)* | `planning` | Crew에 계획 수립 기능을 추가. 활성화하면 각 Crew 반복 전에 모든 Crew 데이터를 AgentPlanner로 전송하여 작업계획을 세우고, 이 계획이 각 작업 설명에 추가됨. |
|
||||
| **Planning LLM** *(선택사항)* | `planning_llm` | 계획 과정에서 AgentPlanner가 사용하는 언어 모델. |
|
||||
| **Knowledge Sources** _(선택사항)_ | `knowledge_sources` | crew 수준에서 사용 가능한 지식 소스. 모든 agent가 접근 가능. |
|
||||
|
||||
<Tip>
|
||||
**Crew Max RPM**: `max_rpm` 속성은 crew가 분당 처리할 수 있는 최대 요청 수를 설정하며, 개별 agent의 `max_rpm` 설정을 crew 단위로 지정할 경우 오버라이드합니다.
|
||||
</Tip>
|
||||
|
||||
## 크루 생성하기
|
||||
|
||||
CrewAI에서 크루를 생성하는 방법은 두 가지가 있습니다: **YAML 구성(권장)**을 사용하는 방법과 **코드에서 직접 정의**하는 방법입니다.
|
||||
|
||||
### YAML 구성 (권장)
|
||||
|
||||
YAML 구성을 사용하면 crew를 정의할 때 더 깔끔하고 유지 관리하기 쉬운 방법을 제공하며, CrewAI 프로젝트에서 agent 및 task를 정의하는 방식과 일관성을 유지할 수 있습니다.
|
||||
|
||||
[설치](/ko/installation) 섹션에 설명된 대로 CrewAI 프로젝트를 생성한 후, `CrewBase`를 상속받는 클래스에서 데코레이터를 이용해 agent, task, 그리고 crew 자체를 정의할 수 있습니다.
|
||||
|
||||
#### 데코레이터가 적용된 예시 Crew 클래스
|
||||
|
||||
```python code
|
||||
from crewai import Agent, Crew, Task, Process
|
||||
from crewai.project import CrewBase, agent, task, crew, before_kickoff, after_kickoff
|
||||
from crewai.agents.agent_builder.base_agent import BaseAgent
|
||||
from typing import List
|
||||
|
||||
@CrewBase
|
||||
class YourCrewName:
|
||||
"""Description of your crew"""
|
||||
|
||||
agents: List[BaseAgent]
|
||||
tasks: List[Task]
|
||||
|
||||
# YAML 구성 파일 경로
|
||||
# YAML로 정의된 에이전트와 태스크의 예시는 아래 링크를 참고하세요:
|
||||
# - 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'
|
||||
|
||||
@before_kickoff
|
||||
def prepare_inputs(self, inputs):
|
||||
# crew 시작 전에 입력값을 수정합니다
|
||||
inputs['additional_data'] = "Some extra information"
|
||||
return inputs
|
||||
|
||||
@after_kickoff
|
||||
def process_output(self, output):
|
||||
# crew가 종료된 후 출력값을 수정합니다
|
||||
output.raw += "\nProcessed after kickoff."
|
||||
return output
|
||||
|
||||
@agent
|
||||
def agent_one(self) -> Agent:
|
||||
return Agent(
|
||||
config=self.agents_config['agent_one'], # type: ignore[index]
|
||||
verbose=True
|
||||
)
|
||||
|
||||
@agent
|
||||
def agent_two(self) -> Agent:
|
||||
return Agent(
|
||||
config=self.agents_config['agent_two'], # type: ignore[index]
|
||||
verbose=True
|
||||
)
|
||||
|
||||
@task
|
||||
def task_one(self) -> Task:
|
||||
return Task(
|
||||
config=self.tasks_config['task_one'] # type: ignore[index]
|
||||
)
|
||||
|
||||
@task
|
||||
def task_two(self) -> Task:
|
||||
return Task(
|
||||
config=self.tasks_config['task_two'] # type: ignore[index]
|
||||
)
|
||||
|
||||
@crew
|
||||
def crew(self) -> Crew:
|
||||
return Crew(
|
||||
agents=self.agents, # @agent 데코레이터로 자동 수집
|
||||
tasks=self.tasks, # @task 데코레이터로 자동 수집
|
||||
process=Process.sequential,
|
||||
verbose=True,
|
||||
)
|
||||
```
|
||||
|
||||
위 코드를 실행하는 방법:
|
||||
|
||||
```python code
|
||||
YourCrewName().crew().kickoff(inputs={"any": "input here"})
|
||||
```
|
||||
|
||||
<Note>
|
||||
태스크들은 정의된 순서대로 실행됩니다.
|
||||
</Note>
|
||||
|
||||
`CrewBase` 클래스와 이 데코레이터들은 에이전트와 태스크의 수집을 자동화하여
|
||||
수동으로 관리할 필요를 줄여줍니다.
|
||||
|
||||
#### `annotations.py`의 데코레이터 개요
|
||||
|
||||
CrewAI는 `annotations.py` 파일에서 크루 클래스 내의 메서드를 특별히 처리하기 위해 사용하는 여러 데코레이터를 제공합니다:
|
||||
|
||||
- `@CrewBase`: 클래스를 크루 기본 클래스로 표시합니다.
|
||||
- `@agent`: `Agent` 객체를 반환하는 메서드임을 나타냅니다.
|
||||
- `@task`: `Task` 객체를 반환하는 메서드임을 나타냅니다.
|
||||
- `@crew`: `Crew` 객체를 반환하는 메서드임을 나타냅니다.
|
||||
- `@before_kickoff`: (옵션) 크루가 시작되기 전에 실행될 메서드를 표시합니다.
|
||||
- `@after_kickoff`: (옵션) 크루가 종료된 후에 실행될 메서드를 표시합니다.
|
||||
|
||||
이러한 데코레이터들은 크루의 구조를 구성하는 데 도움이 되며, 에이전트와 태스크를 수동으로 나열하지 않아도 자동으로 수집할 수 있도록 해줍니다.
|
||||
|
||||
### 직접 코드 정의 (대안)
|
||||
|
||||
또는 YAML 구성 파일을 사용하지 않고 코드에서 직접 crew를 정의할 수 있습니다.
|
||||
|
||||
```python code
|
||||
from crewai import Agent, Crew, Task, Process
|
||||
from crewai_tools import YourCustomTool
|
||||
|
||||
class YourCrewName:
|
||||
def agent_one(self) -> Agent:
|
||||
return Agent(
|
||||
role="Data Analyst",
|
||||
goal="Analyze data trends in the market",
|
||||
backstory="An experienced data analyst with a background in economics",
|
||||
verbose=True,
|
||||
tools=[YourCustomTool()]
|
||||
)
|
||||
|
||||
def agent_two(self) -> Agent:
|
||||
return Agent(
|
||||
role="Market Researcher",
|
||||
goal="Gather information on market dynamics",
|
||||
backstory="A diligent researcher with a keen eye for detail",
|
||||
verbose=True
|
||||
)
|
||||
|
||||
def task_one(self) -> Task:
|
||||
return Task(
|
||||
description="Collect recent market data and identify trends.",
|
||||
expected_output="A report summarizing key trends in the market.",
|
||||
agent=self.agent_one()
|
||||
)
|
||||
|
||||
def task_two(self) -> Task:
|
||||
return Task(
|
||||
description="Research factors affecting market dynamics.",
|
||||
expected_output="An analysis of factors influencing the market.",
|
||||
agent=self.agent_two()
|
||||
)
|
||||
|
||||
def crew(self) -> Crew:
|
||||
return Crew(
|
||||
agents=[self.agent_one(), self.agent_two()],
|
||||
tasks=[self.task_one(), self.task_two()],
|
||||
process=Process.sequential,
|
||||
verbose=True
|
||||
)
|
||||
```
|
||||
|
||||
위 코드를 실행하는 방법:
|
||||
|
||||
```python code
|
||||
YourCrewName().crew().kickoff(inputs={})
|
||||
```
|
||||
|
||||
이 예시에서:
|
||||
|
||||
- 에이전트와 태스크는 데코레이터 없이 클래스 내에서 직접 정의됩니다.
|
||||
- 에이전트와 태스크 목록을 수동으로 생성하고 관리합니다.
|
||||
- 이 방식은 더 많은 제어를 제공하지만, 대규모 프로젝트의 경우 유지보수가 어려울 수 있습니다.
|
||||
|
||||
## Crew Output
|
||||
|
||||
CrewAI 프레임워크에서 crew의 출력은 `CrewOutput` 클래스 내에 캡슐화되어 있습니다.
|
||||
이 클래스는 crew 실행 결과를 구조화된 방식으로 접근할 수 있도록 하며, 원시 문자열, JSON, Pydantic 모델과 같은 다양한 형식을 포함합니다.
|
||||
`CrewOutput`에는 최종 task 출력 결과, 토큰 사용량, 그리고 개별 task 출력 결과가 포함됩니다.
|
||||
|
||||
### Crew 출력 속성
|
||||
|
||||
| 속성 | 매개변수 | 타입 | 설명 |
|
||||
| :--------------- | :--------------- | :--------------------------- | :----------------------------------------------------------------------------------------- |
|
||||
| **Raw** | `raw` | `str` | crew의 원시 출력값입니다. 출력의 기본 형식입니다. |
|
||||
| **Pydantic** | `pydantic` | `Optional[BaseModel]` | crew의 구조화된 출력을 나타내는 Pydantic 모델 객체입니다. |
|
||||
| **JSON Dict** | `json_dict` | `Optional[Dict[str, Any]]` | crew의 JSON 출력을 나타내는 딕셔너리입니다. |
|
||||
| **Tasks Output** | `tasks_output` | `List[TaskOutput]` | crew 내 각 작업의 출력을 나타내는 `TaskOutput` 객체의 리스트입니다. |
|
||||
| **Token Usage** | `token_usage` | `Dict[str, Any]` | 실행 중 언어 모델의 성능에 대한 통찰을 제공하는 토큰 사용 요약 정보입니다. |
|
||||
|
||||
### Crew 출력 메서드 및 속성
|
||||
|
||||
| 메서드/속성 | 설명 |
|
||||
| :-------------- | :------------------------------------------------------------------------------------------------ |
|
||||
| **json** | 출력 형식이 JSON인 경우 crew 출력의 JSON 문자열 표현을 반환합니다. |
|
||||
| **to_dict** | JSON 및 Pydantic 출력을 사전으로 변환합니다. |
|
||||
| \***\*str\*\*** | crew 출력의 문자열 표현을 반환합니다. 우선순위는 Pydantic, 그 다음 JSON, 마지막으로 raw입니다. |
|
||||
|
||||
### Crew 출력 접근하기
|
||||
|
||||
crew가 실행된 후에는 `Crew` 객체의 `output` 속성을 통해 출력값에 접근할 수 있습니다. `CrewOutput` 클래스는 이 출력값을 다루고 표시하는 다양한 방법을 제공합니다.
|
||||
|
||||
#### 예시
|
||||
|
||||
```python Code
|
||||
# Example crew execution
|
||||
crew = Crew(
|
||||
agents=[research_agent, writer_agent],
|
||||
tasks=[research_task, write_article_task],
|
||||
verbose=True
|
||||
)
|
||||
|
||||
crew_output = crew.kickoff()
|
||||
|
||||
# Accessing the crew output
|
||||
print(f"Raw Output: {crew_output.raw}")
|
||||
if crew_output.json_dict:
|
||||
print(f"JSON Output: {json.dumps(crew_output.json_dict, indent=2)}")
|
||||
if crew_output.pydantic:
|
||||
print(f"Pydantic Output: {crew_output.pydantic}")
|
||||
print(f"Tasks Output: {crew_output.tasks_output}")
|
||||
print(f"Token Usage: {crew_output.token_usage}")
|
||||
```
|
||||
|
||||
## 크루 로그 접근하기
|
||||
|
||||
`output_log_file`을 `True(Boolean)` 또는 `file_name(str)`로 설정하면 크루 실행의 실시간 로그를 볼 수 있습니다. 이벤트 로그는 `file_name.txt`와 `file_name.json` 두 가지 형식 모두를 지원합니다.
|
||||
`True(Boolean)`로 설정할 경우에는 `logs.txt`로 저장됩니다.
|
||||
|
||||
`output_log_file`이 `False(Boolean)` 또는 `None`으로 설정된 경우에는 로그가 저장되지 않습니다.
|
||||
|
||||
```python Code
|
||||
# 크루 로그 저장하기
|
||||
crew = Crew(output_log_file = True) # 로그는 logs.txt로 저장됩니다
|
||||
crew = Crew(output_log_file = file_name) # 로그는 file_name.txt로 저장됩니다
|
||||
crew = Crew(output_log_file = file_name.txt) # 로그는 file_name.txt로 저장됩니다
|
||||
crew = Crew(output_log_file = file_name.json) # 로그는 file_name.json으로 저장됩니다
|
||||
```
|
||||
|
||||
## 메모리 활용
|
||||
|
||||
crew는 메모리(단기, 장기 및 엔티티 메모리)를 활용하여 시간이 지남에 따라 실행 및 학습을 향상시킬 수 있습니다. 이 기능을 통해 crew는 실행 메모리를 저장하고 회상할 수 있어, 의사결정 및 작업 실행 전략에 도움이 됩니다.
|
||||
|
||||
## 캐시 활용
|
||||
|
||||
캐시는 도구 실행 결과를 저장하는 데 사용될 수 있으며, 동일한 작업을 반복 실행할 필요를 줄여 프로세스의 효율성을 높입니다.
|
||||
|
||||
## Crew 사용 메트릭
|
||||
|
||||
crew 실행 후, `usage_metrics` 속성에 접근하여 crew가 실행한 모든 작업에 대한 언어 모델(LLM) 사용 메트릭을 확인할 수 있습니다. 이를 통해 운영 효율성과 개선이 필요한 영역에 대한 인사이트를 얻을 수 있습니다.
|
||||
|
||||
```python Code
|
||||
# Access the crew's usage metrics
|
||||
crew = Crew(agents=[agent1, agent2], tasks=[task1, task2])
|
||||
crew.kickoff()
|
||||
print(crew.usage_metrics)
|
||||
```
|
||||
|
||||
## Crew 실행 프로세스
|
||||
|
||||
- **순차적 프로세스**: 작업이 하나씩 차례로 실행되어 linear flow의 작업 흐름을 제공합니다.
|
||||
- **계층적 프로세스**: 매니저 agent가 crew를 조정하여 작업을 위임하고 결과를 검증한 후 다음 단계로 이동합니다. **참고**: 이 프로세스에는 `manager_llm` 또는 `manager_agent`가 필요하며, 프로세스 flow 검증을 위해 필수적입니다.
|
||||
|
||||
### 크루 시작하기
|
||||
|
||||
크루가 구성되면, `kickoff()` 메서드를 사용하여 워크플로를 시작하세요. 이렇게 하면 정의된 프로세스 플로우에 따라 실행 과정이 시작됩니다.
|
||||
|
||||
```python Code
|
||||
# Start the crew's task execution
|
||||
result = my_crew.kickoff()
|
||||
print(result)
|
||||
```
|
||||
|
||||
### Crew를 시작하는 다양한 방법
|
||||
|
||||
crew가 구성되면, 적절한 시작 방법으로 workflow를 시작하세요. CrewAI는 kickoff 프로세스를 더 잘 제어할 수 있도록 여러 방법을 제공합니다: `kickoff()`, `kickoff_for_each()`, `kickoff_async()`, 그리고 `kickoff_for_each_async()`.
|
||||
|
||||
- `kickoff()`: 정의된 process flow에 따라 실행 프로세스를 시작합니다.
|
||||
- `kickoff_for_each()`: 입력 이벤트나 컬렉션 내 각 항목에 대해 순차적으로 task를 실행합니다.
|
||||
- `kickoff_async()`: 비동기적으로 workflow를 시작합니다.
|
||||
- `kickoff_for_each_async()`: 입력 이벤트나 각 항목에 대해 비동기 처리를 활용하여 task를 동시에 실행합니다.
|
||||
|
||||
```python Code
|
||||
# Start the crew's task execution
|
||||
result = my_crew.kickoff()
|
||||
print(result)
|
||||
|
||||
# Example of using kickoff_for_each
|
||||
inputs_array = [{'topic': 'AI in healthcare'}, {'topic': 'AI in finance'}]
|
||||
results = my_crew.kickoff_for_each(inputs=inputs_array)
|
||||
for result in results:
|
||||
print(result)
|
||||
|
||||
# Example of using kickoff_async
|
||||
inputs = {'topic': 'AI in healthcare'}
|
||||
async_result = await my_crew.kickoff_async(inputs=inputs)
|
||||
print(async_result)
|
||||
|
||||
# Example of using kickoff_for_each_async
|
||||
inputs_array = [{'topic': 'AI in healthcare'}, {'topic': 'AI in finance'}]
|
||||
async_results = await my_crew.kickoff_for_each_async(inputs=inputs_array)
|
||||
for async_result in async_results:
|
||||
print(async_result)
|
||||
```
|
||||
|
||||
이러한 메서드는 crew 내에서 task를 관리하고 실행하는 데 유연성을 제공하며, 동기 및 비동기 workflow 모두 필요에 맞게 사용할 수 있도록 지원합니다.
|
||||
|
||||
### 특정 Task에서 다시 실행하기
|
||||
|
||||
이제 CLI 명령어 `replay`를 사용하여 특정 task에서 다시 실행할 수 있습니다.
|
||||
|
||||
CrewAI의 replay 기능을 사용하면 커맨드라인 인터페이스(CLI)를 통해 특정 task에서 다시 실행할 수 있습니다. `crewai replay -t <task_id>` 명령어를 실행하면 replay 과정에서 사용할 `task_id`를 지정할 수 있습니다.
|
||||
|
||||
Kickoff은 이제 최신 kickoff에서 반환된 task output을 로컬에 저장하므로, 해당 지점부터 다시 실행할 수 있습니다.
|
||||
|
||||
### CLI를 사용하여 특정 작업에서 다시 실행하기
|
||||
|
||||
replay 기능을 사용하려면 다음 단계를 따라주세요:
|
||||
|
||||
1. 터미널 또는 명령 프롬프트를 엽니다.
|
||||
2. CrewAI 프로젝트가 위치한 디렉터리로 이동합니다.
|
||||
3. 아래 명령어를 실행합니다:
|
||||
|
||||
최신 kickoff 작업 ID를 확인하려면 다음을 사용하세요:
|
||||
|
||||
```shell
|
||||
crewai log-tasks-outputs
|
||||
```
|
||||
|
||||
그런 다음, 특정 작업에서 다시 실행하려면 다음을 사용하세요:
|
||||
|
||||
```shell
|
||||
crewai replay -t <task_id>
|
||||
```
|
||||
|
||||
이 명령어들을 사용하면 이전에 실행된 작업의 컨텍스트를 유지하면서 최신 kickoff 작업부터 다시 실행할 수 있습니다.
|
||||
312
docs/ko/concepts/event-listener.mdx
Normal file
@@ -0,0 +1,312 @@
|
||||
---
|
||||
title: '이벤트 리스너'
|
||||
description: 'CrewAI 이벤트에 연결하여 맞춤형 통합 및 모니터링 구축'
|
||||
icon: spinner
|
||||
---
|
||||
|
||||
## 개요
|
||||
|
||||
CrewAI는 강력한 이벤트 시스템을 제공하여 crew 실행 중 발생하는 다양한 이벤트를 수신하고 이에 반응할 수 있도록 합니다. 이 기능을 통해 맞춤형 통합, 모니터링 솔루션, 로깅 시스템 또는 CrewAI의 내부 이벤트에 따라 트리거되어야 하는 기타 모든 기능을 구축할 수 있습니다.
|
||||
|
||||
## 작동 방식
|
||||
|
||||
CrewAI는 실행 수명 주기 전반에 걸쳐 이벤트를 발생시키는 이벤트 버스 아키텍처를 사용합니다. 이벤트 시스템은 다음과 같은 구성 요소로 구축되어 있습니다:
|
||||
|
||||
1. **CrewAIEventsBus**: 이벤트 등록 및 발생을 관리하는 싱글톤 이벤트 버스
|
||||
2. **BaseEvent**: 시스템 내 모든 이벤트의 기본 클래스
|
||||
3. **BaseEventListener**: 커스텀 이벤트 리스너 생성을 위한 추상 기본 클래스
|
||||
|
||||
CrewAI에서 특정 동작(예: Crew가 실행을 시작하거나 Agent가 task를 완료하거나 tool이 사용될 때)이 발생하면, 시스템은 해당 이벤트를 발생시킵니다. 이러한 이벤트에 대한 핸들러를 등록하여 해당 이벤트가 발생할 때 커스텀 코드를 실행할 수 있습니다.
|
||||
|
||||
<Note type="info" title="Enterprise Enhancement: Prompt Tracing">
|
||||
CrewAI Enterprise는 event 시스템을 활용하여 모든 prompt, completion 및 관련 메타데이터를 추적, 저장 및 시각화하는 내장 Prompt Tracing 기능을 제공합니다. 이 기능을 통해 agent 운영에 대한 강력한 디버깅 기능과 투명성을 얻을 수 있습니다.
|
||||
|
||||

|
||||
|
||||
Prompt Tracing을 통해 다음과 같은 작업이 가능합니다:
|
||||
- LLM에 전송된 모든 prompt의 전체 기록 보기
|
||||
- token 사용량 및 비용 추적
|
||||
- agent reasoning 실패 디버깅
|
||||
- 팀 내에서 prompt 시퀀스 공유
|
||||
- 다양한 prompt 전략 비교
|
||||
- 컴플라이언스 및 감사를 위한 trace 내보내기
|
||||
</Note>
|
||||
|
||||
## 커스텀 이벤트 리스너 생성하기
|
||||
|
||||
커스텀 이벤트 리스너를 생성하려면 다음 단계를 따라야 합니다:
|
||||
|
||||
1. `BaseEventListener`를 상속하는 클래스를 생성합니다.
|
||||
2. `setup_listeners` 메서드를 구현합니다.
|
||||
3. 원하는 이벤트에 대한 핸들러를 등록합니다.
|
||||
4. 해당 파일에서 리스너의 인스턴스를 생성합니다.
|
||||
|
||||
아래는 커스텀 이벤트 리스너 클래스의 간단한 예시입니다:
|
||||
|
||||
```python
|
||||
from crewai.utilities.events import (
|
||||
CrewKickoffStartedEvent,
|
||||
CrewKickoffCompletedEvent,
|
||||
AgentExecutionCompletedEvent,
|
||||
)
|
||||
from crewai.utilities.events.base_event_listener import BaseEventListener
|
||||
|
||||
class MyCustomListener(BaseEventListener):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
|
||||
def setup_listeners(self, crewai_event_bus):
|
||||
@crewai_event_bus.on(CrewKickoffStartedEvent)
|
||||
def on_crew_started(source, event):
|
||||
print(f"Crew '{event.crew_name}' has started execution!")
|
||||
|
||||
@crewai_event_bus.on(CrewKickoffCompletedEvent)
|
||||
def on_crew_completed(source, event):
|
||||
print(f"Crew '{event.crew_name}' has completed execution!")
|
||||
print(f"Output: {event.output}")
|
||||
|
||||
@crewai_event_bus.on(AgentExecutionCompletedEvent)
|
||||
def on_agent_execution_completed(source, event):
|
||||
print(f"Agent '{event.agent.role}' completed task")
|
||||
print(f"Output: {event.output}")
|
||||
```
|
||||
|
||||
## 리스너를 올바르게 등록하기
|
||||
|
||||
리스너 클래스를 정의하는 것만으로는 충분하지 않습니다. 해당 클래스의 인스턴스를 생성하고 애플리케이션에 임포트되었는지 확인해야 합니다. 이렇게 하면 다음과 같은 효과가 있습니다:
|
||||
|
||||
1. 이벤트 핸들러가 이벤트 버스에 등록됩니다.
|
||||
2. 리스너 인스턴스가 메모리에 유지됩니다(가비지 컬렉션되지 않음).
|
||||
3. 이벤트가 발생할 때 리스너가 활성화됩니다.
|
||||
|
||||
### 옵션 1: Crew 또는 Flow 구현에서 가져오기 및 인스턴스화
|
||||
|
||||
가장 중요한 것은 Crew 또는 Flow가 정의되고 실행되는 파일에서 리스너의 인스턴스를 생성하는 것입니다.
|
||||
|
||||
#### 크루 기반 애플리케이션의 경우
|
||||
|
||||
크루 구현 파일 상단에 리스너를 생성하고 임포트하세요:
|
||||
|
||||
```python
|
||||
# In your crew.py file
|
||||
from crewai import Agent, Crew, Task
|
||||
from my_listeners import MyCustomListener
|
||||
|
||||
# Create an instance of your listener
|
||||
my_listener = MyCustomListener()
|
||||
|
||||
class MyCustomCrew:
|
||||
# Your crew implementation...
|
||||
|
||||
def crew(self):
|
||||
return Crew(
|
||||
agents=[...],
|
||||
tasks=[...],
|
||||
# ...
|
||||
)
|
||||
```
|
||||
|
||||
#### 플로우 기반 애플리케이션의 경우
|
||||
|
||||
플로우 구현 파일 상단에 리스너를 생성하고 임포트하세요:
|
||||
|
||||
```python
|
||||
# main.py 또는 flow.py 파일에서
|
||||
from crewai.flow import Flow, listen, start
|
||||
from my_listeners import MyCustomListener
|
||||
|
||||
# 리스너 인스턴스 생성
|
||||
my_listener = MyCustomListener()
|
||||
|
||||
class MyCustomFlow(Flow):
|
||||
# 플로우 구현...
|
||||
|
||||
@start()
|
||||
def first_step(self):
|
||||
# ...
|
||||
```
|
||||
|
||||
이렇게 하면 크루 또는 플로우가 실행될 때 리스너가 로드되고 활성화됩니다.
|
||||
|
||||
### 옵션 2: 리스너를 위한 패키지 생성
|
||||
|
||||
여러 개의 리스너가 있는 경우 등 보다 구조적인 접근 방식을 원한다면 다음과 같이 진행하세요:
|
||||
|
||||
1. 리스너를 위한 패키지를 생성합니다:
|
||||
|
||||
```
|
||||
my_project/
|
||||
├── listeners/
|
||||
│ ├── __init__.py
|
||||
│ ├── my_custom_listener.py
|
||||
│ └── another_listener.py
|
||||
```
|
||||
|
||||
2. `my_custom_listener.py`에서 리스너 클래스를 정의하고 인스턴스를 생성합니다:
|
||||
|
||||
```python
|
||||
# my_custom_listener.py
|
||||
from crewai.utilities.events.base_event_listener import BaseEventListener
|
||||
# ... import events ...
|
||||
|
||||
class MyCustomListener(BaseEventListener):
|
||||
# ... implementation ...
|
||||
|
||||
# 리스너 인스턴스 생성
|
||||
my_custom_listener = MyCustomListener()
|
||||
```
|
||||
|
||||
3. `__init__.py`에서 리스너 인스턴스를 임포트하여 로드되도록 합니다:
|
||||
|
||||
```python
|
||||
# __init__.py
|
||||
from .my_custom_listener import my_custom_listener
|
||||
from .another_listener import another_listener
|
||||
|
||||
# 다른 곳에서 접근이 필요하다면 익스포트할 수도 있습니다
|
||||
__all__ = ['my_custom_listener', 'another_listener']
|
||||
```
|
||||
|
||||
4. Crew나 Flow 파일에서 리스너 패키지를 임포트합니다:
|
||||
|
||||
```python
|
||||
# crew.py 또는 flow.py 파일 내에서
|
||||
import my_project.listeners # 모든 리스너가 로드됩니다
|
||||
|
||||
class MyCustomCrew:
|
||||
# Your crew implementation...
|
||||
```
|
||||
|
||||
이것이 CrewAI 코드베이스에서 서드파티 이벤트 리스너가 등록되는 방식입니다.
|
||||
|
||||
## 사용 가능한 이벤트 유형
|
||||
|
||||
CrewAI는 여러분이 청취할 수 있는 다양한 이벤트를 제공합니다:
|
||||
|
||||
### Crew 이벤트
|
||||
|
||||
- **CrewKickoffStartedEvent**: Crew가 실행을 시작할 때 발생
|
||||
- **CrewKickoffCompletedEvent**: Crew가 실행을 완료할 때 발생
|
||||
- **CrewKickoffFailedEvent**: Crew가 실행을 완료하지 못할 때 발생
|
||||
- **CrewTestStartedEvent**: Crew가 테스트를 시작할 때 발생
|
||||
- **CrewTestCompletedEvent**: Crew가 테스트를 완료할 때 발생
|
||||
- **CrewTestFailedEvent**: Crew가 테스트를 완료하지 못할 때 발생
|
||||
- **CrewTrainStartedEvent**: Crew가 훈련을 시작할 때 발생
|
||||
- **CrewTrainCompletedEvent**: Crew가 훈련을 완료할 때 발생
|
||||
- **CrewTrainFailedEvent**: Crew가 훈련을 완료하지 못할 때 발생
|
||||
|
||||
### 에이전트 이벤트
|
||||
|
||||
- **AgentExecutionStartedEvent**: 에이전트가 작업 실행을 시작할 때 발생함
|
||||
- **AgentExecutionCompletedEvent**: 에이전트가 작업 실행을 완료할 때 발생함
|
||||
- **AgentExecutionErrorEvent**: 에이전트가 실행 도중 오류를 만날 때 발생함
|
||||
|
||||
### 작업 이벤트
|
||||
|
||||
- **TaskStartedEvent**: 작업이 실행을 시작할 때 발생
|
||||
- **TaskCompletedEvent**: 작업이 실행을 완료할 때 발생
|
||||
- **TaskFailedEvent**: 작업이 실행을 완료하지 못할 때 발생
|
||||
- **TaskEvaluationEvent**: 작업이 평가될 때 발생
|
||||
|
||||
### 도구 사용 이벤트
|
||||
|
||||
- **ToolUsageStartedEvent**: 도구 실행이 시작될 때 발생함
|
||||
- **ToolUsageFinishedEvent**: 도구 실행이 완료될 때 발생함
|
||||
- **ToolUsageErrorEvent**: 도구 실행 중 오류가 발생할 때 발생함
|
||||
- **ToolValidateInputErrorEvent**: 도구 입력 검증 중 오류가 발생할 때 발생함
|
||||
- **ToolExecutionErrorEvent**: 도구 실행 중 오류가 발생할 때 발생함
|
||||
- **ToolSelectionErrorEvent**: 도구 선택 시 오류가 발생할 때 발생함
|
||||
|
||||
### 지식 이벤트
|
||||
|
||||
- **KnowledgeRetrievalStartedEvent**: 지식 검색이 시작될 때 발생
|
||||
- **KnowledgeRetrievalCompletedEvent**: 지식 검색이 완료될 때 발생
|
||||
- **KnowledgeQueryStartedEvent**: 지식 쿼리가 시작될 때 발생
|
||||
- **KnowledgeQueryCompletedEvent**: 지식 쿼리가 완료될 때 발생
|
||||
- **KnowledgeQueryFailedEvent**: 지식 쿼리가 실패할 때 발생
|
||||
- **KnowledgeSearchQueryFailedEvent**: 지식 검색 쿼리가 실패할 때 발생
|
||||
|
||||
### LLM 가드레일 이벤트
|
||||
|
||||
- **LLMGuardrailStartedEvent**: 가드레일 검증이 시작될 때 발생합니다. 적용되는 가드레일에 대한 세부 정보와 재시도 횟수를 포함합니다.
|
||||
- **LLMGuardrailCompletedEvent**: 가드레일 검증이 완료될 때 발생합니다. 검증의 성공/실패, 결과 및 오류 메시지(있는 경우)에 대한 세부 정보를 포함합니다.
|
||||
|
||||
### Flow 이벤트
|
||||
|
||||
- **FlowCreatedEvent**: Flow가 생성될 때 발생
|
||||
- **FlowStartedEvent**: Flow가 실행을 시작할 때 발생
|
||||
- **FlowFinishedEvent**: Flow가 실행을 완료할 때 발생
|
||||
- **FlowPlotEvent**: Flow가 플롯될 때 발생
|
||||
- **MethodExecutionStartedEvent**: Flow 메서드가 실행을 시작할 때 발생
|
||||
- **MethodExecutionFinishedEvent**: Flow 메서드가 실행을 완료할 때 발생
|
||||
- **MethodExecutionFailedEvent**: Flow 메서드가 실행을 완료하지 못할 때 발생
|
||||
|
||||
### LLM 이벤트
|
||||
|
||||
- **LLMCallStartedEvent**: LLM 호출이 시작될 때 발생
|
||||
- **LLMCallCompletedEvent**: LLM 호출이 완료될 때 발생
|
||||
- **LLMCallFailedEvent**: LLM 호출이 실패할 때 발생
|
||||
- **LLMStreamChunkEvent**: 스트리밍 LLM 응답 중 각 청크를 받을 때마다 발생
|
||||
|
||||
### 메모리 이벤트
|
||||
|
||||
- **MemoryQueryStartedEvent**: 메모리 쿼리가 시작될 때 발생합니다. 쿼리, limit, 선택적 score threshold를 포함합니다.
|
||||
- **MemoryQueryCompletedEvent**: 메모리 쿼리가 성공적으로 완료될 때 발생합니다. 쿼리, 결과, limit, score threshold, 쿼리 실행 시간을 포함합니다.
|
||||
- **MemoryQueryFailedEvent**: 메모리 쿼리 실행에 실패할 때 발생합니다. 쿼리, limit, score threshold, 오류 메시지를 포함합니다.
|
||||
- **MemorySaveStartedEvent**: 메모리 저장 작업이 시작될 때 발생합니다. 저장할 값, 메타데이터, 선택적 agent 역할을 포함합니다.
|
||||
- **MemorySaveCompletedEvent**: 메모리 저장 작업이 성공적으로 완료될 때 발생합니다. 저장된 값, 메타데이터, agent 역할, 저장 실행 시간을 포함합니다.
|
||||
- **MemorySaveFailedEvent**: 메모리 저장 작업에 실패할 때 발생합니다. 값, 메타데이터, agent 역할, 오류 메시지를 포함합니다.
|
||||
- **MemoryRetrievalStartedEvent**: 태스크 프롬프트를 위한 메모리 검색이 시작될 때 발생합니다. 선택적 태스크 ID를 포함합니다.
|
||||
- **MemoryRetrievalCompletedEvent**: 태스크 프롬프트를 위한 메모리 검색이 성공적으로 완료될 때 발생합니다. 태스크 ID, 메모리 내용, 검색 실행 시간을 포함합니다.
|
||||
|
||||
## 이벤트 핸들러 구조
|
||||
|
||||
각 이벤트 핸들러는 두 개의 매개변수를 받습니다:
|
||||
|
||||
1. **source**: 이벤트를 발생시킨 객체
|
||||
2. **event**: 이벤트별 데이터를 포함하는 이벤트 인스턴스
|
||||
|
||||
이벤트 객체의 구조는 이벤트 타입에 따라 다르지만, 모든 이벤트는 `BaseEvent`를 상속하며 다음을 포함합니다:
|
||||
|
||||
- **timestamp**: 이벤트가 발생한 시간
|
||||
- **type**: 이벤트 타입을 나타내는 문자열 식별자
|
||||
|
||||
추가 필드는 이벤트 타입에 따라 다릅니다. 예를 들어, `CrewKickoffCompletedEvent`에는 `crew_name`과 `output` 필드가 포함됩니다.
|
||||
|
||||
|
||||
## 고급 사용법: Scoped Handlers
|
||||
|
||||
임시 이벤트 처리가 필요한 경우(테스트 또는 특정 작업에 유용함), `scoped_handlers` 컨텍스트 관리자를 사용할 수 있습니다:
|
||||
|
||||
```python
|
||||
from crewai.utilities.events import crewai_event_bus, CrewKickoffStartedEvent
|
||||
|
||||
with crewai_event_bus.scoped_handlers():
|
||||
@crewai_event_bus.on(CrewKickoffStartedEvent)
|
||||
def temp_handler(source, event):
|
||||
print("This handler only exists within this context")
|
||||
|
||||
# Do something that emits events
|
||||
|
||||
# 컨텍스트 밖에서는 임시 핸들러가 제거됩니다
|
||||
```
|
||||
|
||||
## 사용 사례
|
||||
|
||||
이벤트 리스너는 다양한 목적으로 사용할 수 있습니다:
|
||||
|
||||
1. **로깅 및 모니터링**: Crew의 실행을 추적하고 중요한 이벤트를 기록합니다
|
||||
2. **분석**: Crew의 성능과 동작에 대한 데이터를 수집합니다
|
||||
3. **디버깅**: 특정 문제를 디버깅하기 위해 임시 리스너를 설정합니다
|
||||
4. **통합**: CrewAI를 모니터링 플랫폼, 데이터베이스 또는 알림 서비스와 같은 외부 시스템과 연결합니다
|
||||
5. **사용자 정의 동작**: 특정 이벤트에 따라 사용자 정의 동작을 트리거합니다
|
||||
|
||||
## 모범 사례
|
||||
|
||||
1. **핸들러를 가볍게 유지하세요**: 이벤트 핸들러는 경량이어야 하며, 블로킹 작업을 피해야 합니다.
|
||||
2. **오류 처리**: 예외가 메인 실행에 영향을 주지 않도록 이벤트 핸들러에 적절한 오류 처리를 포함하세요.
|
||||
3. **정리**: 리스너가 자원을 할당한다면, 이를 적절하게 정리하는지 확인하세요.
|
||||
4. **선택적 리스닝**: 실제로 처리해야 하는 이벤트에만 리스닝하세요.
|
||||
5. **테스트**: 이벤트 리스너가 예상대로 동작하는지 독립적으로 테스트하세요.
|
||||
|
||||
CrewAI의 이벤트 시스템을 활용하면 기능을 확장하고 기존 인프라와 원활하게 통합할 수 있습니다.
|
||||
909
docs/ko/concepts/flows.mdx
Normal file
@@ -0,0 +1,909 @@
|
||||
---
|
||||
title: Flows
|
||||
description: CrewAI Flows를 사용하여 AI 워크플로우를 생성하고 관리하는 방법을 알아보세요.
|
||||
icon: arrow-progress
|
||||
---
|
||||
|
||||
## 개요
|
||||
|
||||
CrewAI Flows는 AI 워크플로우의 생성 및 관리를 간소화하기 위해 설계된 강력한 기능입니다. Flows를 사용하면 개발자는 다양한 코딩 작업과 각 Crew를 효율적으로 결합하고 조정할 수 있어, 정교한 AI 자동화를 구축할 수 있는 견고한 프레임워크를 제공합니다.
|
||||
|
||||
Flows는 구조화된 이벤트 기반 워크플로우를 생성할 수 있게 해줍니다. 이를 통해 여러 작업을 원활하게 연결하고, 상태를 관리하며, AI 애플리케이션에서 실행 흐름을 제어할 수 있습니다. Flows를 사용하면 CrewAI의 전체 역량을 활용하는 다단계 프로세스를 손쉽게 설계하고 구현할 수 있습니다.
|
||||
|
||||
1. **간편한 워크플로우 생성**: 여러 Crew와 작업을 손쉽게 연결하여 복잡한 AI 워크플로우를 만듭니다.
|
||||
|
||||
2. **상태 관리**: Flows를 통해 워크플로우 내의 다양한 작업 간에 상태를 쉽고 효율적으로 관리 및 공유할 수 있습니다.
|
||||
|
||||
3. **이벤트 기반 아키텍처**: 이벤트 기반 모델을 기반으로 하여, 역동적이고 반응성 높은 워크플로우를 구현할 수 있습니다.
|
||||
|
||||
4. **유연한 제어 흐름**: 워크플로우 내에서 조건문, 반복문, 분기 등을 구현할 수 있습니다.
|
||||
|
||||
## 시작하기
|
||||
|
||||
OpenAI를 사용하여 한 작업에서 무작위 도시를 생성하고, 그 도시를 사용해 다른 작업에서 재미있는 사실을 생성하는 간단한 Flow를 만들어보겠습니다.
|
||||
|
||||
```python Code
|
||||
|
||||
from crewai.flow.flow import Flow, listen, start
|
||||
from dotenv import load_dotenv
|
||||
from litellm import completion
|
||||
|
||||
|
||||
class ExampleFlow(Flow):
|
||||
model = "gpt-4o-mini"
|
||||
|
||||
@start()
|
||||
def generate_city(self):
|
||||
print("Starting flow")
|
||||
# Each flow state automatically gets a unique ID
|
||||
print(f"Flow State ID: {self.state['id']}")
|
||||
|
||||
response = completion(
|
||||
model=self.model,
|
||||
messages=[
|
||||
{
|
||||
"role": "user",
|
||||
"content": "Return the name of a random city in the world.",
|
||||
},
|
||||
],
|
||||
)
|
||||
|
||||
random_city = response["choices"][0]["message"]["content"]
|
||||
# Store the city in our state
|
||||
self.state["city"] = random_city
|
||||
print(f"Random City: {random_city}")
|
||||
|
||||
return random_city
|
||||
|
||||
@listen(generate_city)
|
||||
def generate_fun_fact(self, random_city):
|
||||
response = completion(
|
||||
model=self.model,
|
||||
messages=[
|
||||
{
|
||||
"role": "user",
|
||||
"content": f"Tell me a fun fact about {random_city}",
|
||||
},
|
||||
],
|
||||
)
|
||||
|
||||
fun_fact = response["choices"][0]["message"]["content"]
|
||||
# Store the fun fact in our state
|
||||
self.state["fun_fact"] = fun_fact
|
||||
return fun_fact
|
||||
|
||||
|
||||
|
||||
flow = ExampleFlow()
|
||||
flow.plot()
|
||||
result = flow.kickoff()
|
||||
|
||||
print(f"Generated fun fact: {result}")
|
||||
```
|
||||

|
||||
위 예제에서는 OpenAI를 사용하여 무작위 도시를 생성하고, 해당 도시에 대한 재미있는 사실을 생성하는 간단한 Flow를 만들었습니다. 이 Flow는 `generate_city`와 `generate_fun_fact`라는 두 가지 작업으로 구성되어 있습니다. `generate_city` 작업이 Flow의 시작점이며, `generate_fun_fact` 작업이 `generate_city` 작업의 출력을 감지합니다.
|
||||
|
||||
각 Flow 인스턴스는 상태(state)에 자동으로 고유 식별자(UUID)를 부여 받아, 흐름 실행을 추적하고 관리하는 데 도움이 됩니다. 상태에는 실행 중에 유지되는 추가 데이터(예: 생성된 도시와 재미있는 사실)도 저장할 수 있습니다.
|
||||
|
||||
Flow를 실행하면 다음과 같은 과정을 따릅니다:
|
||||
1. 상태를 위한 고유 ID를 생성
|
||||
2. 무작위 도시를 생성하여 상태에 저장
|
||||
3. 해당 도시에 대한 재미있는 사실을 생성하여 상태에 저장
|
||||
4. 결과를 콘솔에 출력
|
||||
|
||||
상태의 고유 ID와 저장된 데이터는 흐름 실행을 추적하고, 작업 간의 컨텍스트를 유지하는 데 유용합니다.
|
||||
|
||||
**참고:** OpenAI API 요청 인증을 위해 `OPENAI_API_KEY`를 `.env` 파일에 설정해야 합니다. 이 키는 필수입니다.
|
||||
|
||||
### @start()
|
||||
|
||||
`@start()` 데코레이터는 메서드를 Flow의 시작 지점으로 표시하는 데 사용됩니다. Flow가 시작되면 `@start()`로 데코레이트된 모든 메서드가 병렬로 실행됩니다. 하나의 Flow에서 여러 개의 start 메서드를 가질 수 있으며, Flow가 시작될 때 이들은 모두 실행됩니다.
|
||||
|
||||
### @listen()
|
||||
|
||||
`@listen()` 데코레이터는 Flow 내에서 다른 태스크의 출력을 수신하는 리스너로 메서드를 표시하는 데 사용됩니다. `@listen()`으로 데코레이션된 메서드는 지정된 태스크가 출력을 내보낼 때 실행됩니다. 이 메서드는 자신이 리스닝하고 있는 태스크의 출력을 인자로 접근할 수 있습니다.
|
||||
|
||||
#### 사용법
|
||||
|
||||
`@listen()` 데코레이터는 여러 가지 방법으로 사용할 수 있습니다:
|
||||
|
||||
1. **메서드 이름으로 리스닝하기**: 리스닝하고자 하는 메서드의 이름을 문자열로 전달할 수 있습니다. 해당 메서드가 완료되면, 리스너 메서드가 트리거됩니다.
|
||||
|
||||
```python Code
|
||||
@listen("generate_city")
|
||||
def generate_fun_fact(self, random_city):
|
||||
# Implementation
|
||||
```
|
||||
|
||||
2. **메서드 자체로 리스닝하기**: 메서드 자체를 전달할 수도 있습니다. 해당 메서드가 완료되면, 리스너 메서드가 트리거됩니다.
|
||||
```python Code
|
||||
@listen(generate_city)
|
||||
def generate_fun_fact(self, random_city):
|
||||
# Implementation
|
||||
```
|
||||
|
||||
### Flow 출력
|
||||
|
||||
Flow의 출력을 접근하고 다루는 것은 AI 워크플로우를 더 큰 애플리케이션이나 시스템에 통합하는 데 필수적입니다. CrewAI Flow는 최종 출력물을 쉽게 가져오고, 중간 결과에 접근하며, Flow의 전체 상태를 관리할 수 있는 직관적인 메커니즘을 제공합니다.
|
||||
|
||||
#### 최종 출력값 가져오기
|
||||
|
||||
Flow를 실행하면, 최종 출력값은 마지막으로 완료된 메서드에 의해 결정됩니다. `kickoff()` 메서드는 이 마지막 메서드의 결과를 반환합니다.
|
||||
|
||||
최종 출력값을 확인하는 방법은 다음과 같습니다:
|
||||
|
||||
<CodeGroup>
|
||||
```python Code
|
||||
from crewai.flow.flow import Flow, listen, start
|
||||
|
||||
class OutputExampleFlow(Flow):
|
||||
@start()
|
||||
def first_method(self):
|
||||
return "Output from first_method"
|
||||
|
||||
@listen(first_method)
|
||||
def second_method(self, first_output):
|
||||
return f"Second method received: {first_output}"
|
||||
|
||||
|
||||
flow = OutputExampleFlow()
|
||||
flow.plot("my_flow_plot")
|
||||
final_output = flow.kickoff()
|
||||
|
||||
print("---- Final Output ----")
|
||||
print(final_output)
|
||||
```
|
||||
|
||||
```text Output
|
||||
---- Final Output ----
|
||||
Second method received: Output from first_method
|
||||
```
|
||||
|
||||
</CodeGroup>
|
||||

|
||||
|
||||
이 예제에서 `second_method`가 마지막으로 완료된 메서드이므로, 해당 메서드의 결과가 Flow의 최종 출력값이 됩니다.
|
||||
`kickoff()` 메서드는 이 최종 출력값을 반환하며, 이 값은 콘솔에 출력됩니다.
|
||||
`plot()` 메서드는 HTML 파일을 생성하며, 이를 통해 flow를 쉽게 이해할 수 있습니다.
|
||||
|
||||
#### 상태에 접근하고 업데이트하기
|
||||
|
||||
최종 출력을 가져오는 것 외에도, Flow 내에서 상태(state)에 접근하고 업데이트할 수 있습니다. 상태는 Flow의 다양한 메소드 간 데이터를 저장하고 공유하는 데 사용할 수 있습니다. Flow가 실행된 후에는, 실행 중에 추가되거나 업데이트된 정보를 조회하기 위해 상태에 접근할 수 있습니다.
|
||||
|
||||
다음은 상태를 업데이트하고 접근하는 방법의 예시입니다:
|
||||
|
||||
<CodeGroup>
|
||||
|
||||
```python Code
|
||||
from crewai.flow.flow import Flow, listen, start
|
||||
from pydantic import BaseModel
|
||||
|
||||
class ExampleState(BaseModel):
|
||||
counter: int = 0
|
||||
message: str = ""
|
||||
|
||||
class StateExampleFlow(Flow[ExampleState]):
|
||||
|
||||
@start()
|
||||
def first_method(self):
|
||||
self.state.message = "Hello from first_method"
|
||||
self.state.counter += 1
|
||||
|
||||
@listen(first_method)
|
||||
def second_method(self):
|
||||
self.state.message += " - updated by second_method"
|
||||
self.state.counter += 1
|
||||
return self.state.message
|
||||
|
||||
flow = StateExampleFlow()
|
||||
flow.plot("my_flow_plot")
|
||||
final_output = flow.kickoff()
|
||||
print(f"Final Output: {final_output}")
|
||||
print("Final State:")
|
||||
print(flow.state)
|
||||
```
|
||||
|
||||
```text Output
|
||||
Final Output: Hello from first_method - updated by second_method
|
||||
Final State:
|
||||
counter=2 message='Hello from first_method - updated by second_method'
|
||||
```
|
||||
|
||||
</CodeGroup>
|
||||
|
||||

|
||||
|
||||
이 예시에서 상태는 `first_method`와 `second_method` 모두에 의해 업데이트됩니다.
|
||||
Flow가 실행된 후, 이러한 메소드들에 의해 수행된 업데이트 내용을 확인하려면 최종 상태에 접근할 수 있습니다.
|
||||
|
||||
최종 메소드의 출력이 반환되고 상태에 접근할 수 있도록 함으로써, CrewAI Flow는 AI 워크플로우의 결과를 더 큰 애플리케이션이나 시스템에 쉽게 통합할 수 있게 하며,
|
||||
Flow 실행 과정 전반에 걸쳐 상태를 유지하고 접근하면서도 이를 용이하게 만듭니다.
|
||||
|
||||
## 플로우 상태 관리
|
||||
|
||||
상태를 효과적으로 관리하는 것은 신뢰할 수 있고 유지 보수가 용이한 AI 워크플로를 구축하는 데 매우 중요합니다. CrewAI 플로우는 비정형 및 정형 상태 관리를 위한 강력한 메커니즘을 제공하여, 개발자가 자신의 애플리케이션에 가장 적합한 접근 방식을 선택할 수 있도록 합니다.
|
||||
|
||||
### 비구조적 상태 관리
|
||||
|
||||
비구조적 상태 관리에서는 모든 상태가 `Flow` 클래스의 `state` 속성에 저장됩니다.
|
||||
이 방식은 엄격한 스키마를 정의하지 않고도 개발자가 상태 속성을 즉석에서 추가하거나 수정할 수 있는 유연성을 제공합니다.
|
||||
비구조적 상태에서도 CrewAI Flows는 각 상태 인스턴스에 대한 고유 식별자(UUID)를 자동으로 생성하고 유지합니다.
|
||||
|
||||
```python Code
|
||||
from crewai.flow.flow import Flow, listen, start
|
||||
|
||||
class UnstructuredExampleFlow(Flow):
|
||||
|
||||
@start()
|
||||
def first_method(self):
|
||||
# The state automatically includes an 'id' field
|
||||
print(f"State ID: {self.state['id']}")
|
||||
self.state['counter'] = 0
|
||||
self.state['message'] = "Hello from structured flow"
|
||||
|
||||
@listen(first_method)
|
||||
def second_method(self):
|
||||
self.state['counter'] += 1
|
||||
self.state['message'] += " - updated"
|
||||
|
||||
@listen(second_method)
|
||||
def third_method(self):
|
||||
self.state['counter'] += 1
|
||||
self.state['message'] += " - updated again"
|
||||
|
||||
print(f"State after third_method: {self.state}")
|
||||
|
||||
|
||||
flow = UnstructuredExampleFlow()
|
||||
flow.plot("my_flow_plot")
|
||||
flow.kickoff()
|
||||
```
|
||||
|
||||

|
||||
|
||||
**참고:** `id` 필드는 흐름의 실행 전체에 걸쳐 자동으로 생성되어 보존됩니다. 이를 직접 관리하거나 설정할 필요가 없으며, 새로운 데이터로 상태를 업데이트할 때도 자동으로 유지됩니다.
|
||||
|
||||
**핵심 포인트:**
|
||||
|
||||
- **유연성:** `self.state`에 미리 정해진 제약 없이 속성을 동적으로 추가할 수 있습니다.
|
||||
- **단순성:** 상태 구조가 최소이거나 크게 달라지는 단순한 워크플로우에 이상적입니다.
|
||||
|
||||
### 구조화된 상태 관리
|
||||
|
||||
구조화된 상태 관리는 미리 정의된 스키마를 활용하여 워크플로 전반에 걸쳐 일관성과 타입 안전성을 보장합니다. Pydantic의 `BaseModel`과 같은 모델을 사용하면 상태의 정확한 형태를 정의할 수 있어, 개발 환경에서 더 나은 검증 및 자동 완성이 가능합니다.
|
||||
|
||||
CrewAI Flows의 각 상태는 인스턴스 추적 및 관리를 돕기 위해 자동으로 고유 식별자(UUID)를 할당받습니다. 이 ID는 Flow 시스템에 의해 자동으로 생성되고 관리됩니다.
|
||||
|
||||
```python Code
|
||||
from crewai.flow.flow import Flow, listen, start
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
||||
class ExampleState(BaseModel):
|
||||
# Note: 'id' field is automatically added to all states
|
||||
counter: int = 0
|
||||
message: str = ""
|
||||
|
||||
|
||||
class StructuredExampleFlow(Flow[ExampleState]):
|
||||
|
||||
@start()
|
||||
def first_method(self):
|
||||
# Access the auto-generated ID if needed
|
||||
print(f"State ID: {self.state.id}")
|
||||
self.state.message = "Hello from structured flow"
|
||||
|
||||
@listen(first_method)
|
||||
def second_method(self):
|
||||
self.state.counter += 1
|
||||
self.state.message += " - updated"
|
||||
|
||||
@listen(second_method)
|
||||
def third_method(self):
|
||||
self.state.counter += 1
|
||||
self.state.message += " - updated again"
|
||||
|
||||
print(f"State after third_method: {self.state}")
|
||||
|
||||
|
||||
flow = StructuredExampleFlow()
|
||||
flow.kickoff()
|
||||
```
|
||||
|
||||

|
||||
|
||||
**핵심 포인트:**
|
||||
|
||||
- **정의된 스키마:** `ExampleState`는 상태 구조를 명확히 정의하여 코드 가독성과 유지보수성을 향상시킵니다.
|
||||
- **타입 안전성:** Pydantic을 활용하면 상태의 속성이 지정된 타입을 준수하도록 보장하여 런타임 오류를 줄일 수 있습니다.
|
||||
- **자동 완성:** IDE에서 정의된 상태 모델을 기반으로 더 나은 자동 완성과 오류 확인이 가능합니다.
|
||||
|
||||
### 비구조적 상태 관리와 구조적 상태 관리 선택하기
|
||||
|
||||
- **비구조적 상태 관리를 사용할 때:**
|
||||
|
||||
- 워크플로의 상태가 단순하거나 매우 동적일 때.
|
||||
- 엄격한 상태 정의보다 유연성이 우선시될 때.
|
||||
- 스키마 정의의 오버헤드 없이 빠른 프로토타이핑이 필요할 때.
|
||||
|
||||
- **구조적 상태 관리를 사용할 때:**
|
||||
- 워크플로에 잘 정의되고 일관된 상태 구조가 필요할 때.
|
||||
- 애플리케이션의 신뢰성을 위해 타입 안전성과 검증이 중요할 때.
|
||||
- 더 나은 개발자 경험을 위해 IDE의 자동 완성 및 타입 체크 기능을 활용하고자 할 때.
|
||||
|
||||
CrewAI Flows는 비구조적 및 구조적 상태 관리 옵션을 모두 제공함으로써, 개발자들이 다양한 애플리케이션 요구 사항에 맞춰 유연하면서도 견고한 AI 워크플로를 구축할 수 있도록 지원합니다.
|
||||
|
||||
## 플로우 지속성
|
||||
|
||||
@persist 데코레이터는 CrewAI 플로우에서 자동 상태 지속성을 활성화하여, 플로우 상태를 재시작이나 다른 워크플로우 실행 간에도 유지할 수 있도록 합니다. 이 데코레이터는 클래스 수준이나 메서드 수준 모두에 적용할 수 있어, 상태 지속성을 관리하는 데 유연성을 제공합니다.
|
||||
|
||||
### 클래스 레벨 영속성
|
||||
|
||||
클래스 레벨에서 @persist 데코레이터를 적용하면 모든 flow 메서드 상태가 자동으로 영속됩니다:
|
||||
|
||||
```python
|
||||
@persist # 기본적으로 SQLiteFlowPersistence 사용
|
||||
class MyFlow(Flow[MyState]):
|
||||
@start()
|
||||
def initialize_flow(self):
|
||||
# 이 메서드는 상태가 자동으로 영속됩니다
|
||||
self.state.counter = 1
|
||||
print("Initialized flow. State ID:", self.state.id)
|
||||
|
||||
@listen(initialize_flow)
|
||||
def next_step(self):
|
||||
# 상태(self.state.id 포함)는 자동으로 다시 로드됩니다
|
||||
self.state.counter += 1
|
||||
print("Flow state is persisted. Counter:", self.state.counter)
|
||||
```
|
||||
|
||||
### 메서드 수준의 지속성
|
||||
|
||||
더 세밀한 제어를 위해, @persist를 특정 메서드에 적용할 수 있습니다:
|
||||
|
||||
```python
|
||||
class AnotherFlow(Flow[dict]):
|
||||
@persist # Persists only this method's state
|
||||
@start()
|
||||
def begin(self):
|
||||
if "runs" not in self.state:
|
||||
self.state["runs"] = 0
|
||||
self.state["runs"] += 1
|
||||
print("Method-level persisted runs:", self.state["runs"])
|
||||
```
|
||||
|
||||
### 작동 방식
|
||||
|
||||
1. **고유 상태 식별**
|
||||
- 각 flow 상태에는 자동으로 고유한 UUID가 할당됩니다.
|
||||
- 이 ID는 상태 업데이트 및 메소드 호출 시에도 유지됩니다.
|
||||
- 구조화된 상태(Pydantic BaseModel)와 비구조화된 상태(딕셔너리) 모두를 지원합니다.
|
||||
|
||||
2. **기본 SQLite 백엔드**
|
||||
- SQLiteFlowPersistence는 기본 저장 백엔드입니다.
|
||||
- 상태는 자동으로 로컬 SQLite 데이터베이스에 저장됩니다.
|
||||
- 데이터베이스 작업 실패 시 명확한 메시지를 제공하는 견고한 오류 처리가 제공됩니다.
|
||||
|
||||
3. **오류 처리**
|
||||
- 데이터베이스 작업에 대한 포괄적인 오류 메시지가 제공됩니다.
|
||||
- 저장 및 로드 중에 상태가 자동으로 검증됩니다.
|
||||
- 지속성 작업에 문제가 발생할 경우 명확한 피드백을 제공합니다.
|
||||
|
||||
### 중요한 고려사항
|
||||
|
||||
- **상태 유형**: 구조화된(Pydantic BaseModel) 상태와 비구조화된(딕셔너리) 상태 모두 지원됩니다
|
||||
- **자동 ID**: `id` 필드는 존재하지 않을 경우 자동으로 추가됩니다
|
||||
- **상태 복구**: 실패하거나 재시작된 flow는 이전 상태를 자동으로 불러올 수 있습니다
|
||||
- **커스텀 구현**: 특수한 저장소 요구 사항을 위해 직접 FlowPersistence 구현을 제공할 수 있습니다
|
||||
|
||||
### 기술적 이점
|
||||
|
||||
1. **저수준 접근을 통한 정밀한 제어**
|
||||
- 고급 사용 사례를 위한 영속성 작업에 대한 직접 접근
|
||||
- 메서드 수준의 영속성 데코레이터를 통한 세밀한 제어
|
||||
- 내장된 상태 검사 및 디버깅 기능
|
||||
- 상태 변경 및 영속성 작업에 대한 완전한 가시성
|
||||
|
||||
2. **향상된 신뢰성**
|
||||
- 시스템 장애 또는 재시작 후 자동 상태 복구
|
||||
- 데이터 무결성을 위한 트랜잭션 기반 상태 업데이트
|
||||
- 명확한 오류 메시지를 제공하는 포괄적인 오류 처리
|
||||
- 상태 저장 및 로드 작업 시 강력한 검증
|
||||
|
||||
3. **확장 가능한 아키텍처**
|
||||
- FlowPersistence 인터페이스를 통한 사용자 정의 가능한 영속성 백엔드
|
||||
- SQLite를 넘어선 특수 저장 솔루션 지원
|
||||
- 구조화된(Pydantic) 상태와 비구조화(dict) 상태 모두와 호환
|
||||
- 기존 CrewAI 흐름 패턴과의 원활한 통합
|
||||
|
||||
영속성 시스템의 아키텍처는 기술적 정밀성과 맞춤화 옵션을 강조하여, 개발자가 내장된 신뢰성 기능의 이점을 누리면서 상태 관리에 대한 완전한 제어권을 유지할 수 있게 해줍니다.
|
||||
|
||||
## 흐름 제어
|
||||
|
||||
### 조건부 로직: `or`
|
||||
|
||||
Flows에서 `or_` 함수는 여러 메서드를 감지하고 지정된 메서드 중 하나에서 출력이 발생하면 리스너 메서드를 트리거합니다.
|
||||
|
||||
<CodeGroup>
|
||||
|
||||
```python Code
|
||||
from crewai.flow.flow import Flow, listen, or_, start
|
||||
|
||||
class OrExampleFlow(Flow):
|
||||
|
||||
@start()
|
||||
def start_method(self):
|
||||
return "Hello from the start method"
|
||||
|
||||
@listen(start_method)
|
||||
def second_method(self):
|
||||
return "Hello from the second method"
|
||||
|
||||
@listen(or_(start_method, second_method))
|
||||
def logger(self, result):
|
||||
print(f"Logger: {result}")
|
||||
|
||||
|
||||
|
||||
flow = OrExampleFlow()
|
||||
flow.plot("my_flow_plot")
|
||||
flow.kickoff()
|
||||
```
|
||||
|
||||
```text Output
|
||||
Logger: Hello from the start method
|
||||
Logger: Hello from the second method
|
||||
```
|
||||
|
||||
</CodeGroup>
|
||||
|
||||

|
||||
|
||||
이 Flow를 실행하면, `logger` 메서드는 `start_method` 또는 `second_method`의 출력에 의해 트리거됩니다.
|
||||
`or_` 함수는 여러 메서드를 감지하고 지정된 메서드 중 하나에서 출력이 발생하면 리스너 메서드를 트리거하는 데 사용됩니다.
|
||||
|
||||
### 조건부 로직: `and`
|
||||
|
||||
Flows에서 `and_` 함수는 여러 메서드를 리슨하고, 지정된 모든 메서드가 출력을 발생시킬 때만 리스너 메서드가 트리거되도록 합니다.
|
||||
|
||||
<CodeGroup>
|
||||
|
||||
```python Code
|
||||
from crewai.flow.flow import Flow, and_, listen, start
|
||||
|
||||
class AndExampleFlow(Flow):
|
||||
|
||||
@start()
|
||||
def start_method(self):
|
||||
self.state["greeting"] = "Hello from the start method"
|
||||
|
||||
@listen(start_method)
|
||||
def second_method(self):
|
||||
self.state["joke"] = "What do computers eat? Microchips."
|
||||
|
||||
@listen(and_(start_method, second_method))
|
||||
def logger(self):
|
||||
print("---- Logger ----")
|
||||
print(self.state)
|
||||
|
||||
flow = AndExampleFlow()
|
||||
flow.plot()
|
||||
flow.kickoff()
|
||||
```
|
||||
|
||||
```text Output
|
||||
---- Logger ----
|
||||
{'greeting': 'Hello from the start method', 'joke': 'What do computers eat? Microchips.'}
|
||||
```
|
||||
|
||||
</CodeGroup>
|
||||
|
||||

|
||||
|
||||
이 Flow를 실행하면, `logger` 메서드는 `start_method`와 `second_method`가 모두 출력을 발생시켰을 때만 트리거됩니다.
|
||||
`and_` 함수는 여러 메서드를 리슨하고, 지정된 모든 메서드가 출력을 발생시킬 때만 리스너 메서드를 트리거하는 데 사용됩니다.
|
||||
|
||||
### Router
|
||||
|
||||
Flows의 `@router()` 데코레이터를 사용하면 메서드의 출력값에 따라 조건부 라우팅 로직을 정의할 수 있습니다.
|
||||
메서드의 출력에 따라 서로 다른 경로를 지정할 수 있어 실행 흐름을 동적으로 제어할 수 있습니다.
|
||||
|
||||
<CodeGroup>
|
||||
|
||||
```python Code
|
||||
import random
|
||||
from crewai.flow.flow import Flow, listen, router, start
|
||||
from pydantic import BaseModel
|
||||
|
||||
class ExampleState(BaseModel):
|
||||
success_flag: bool = False
|
||||
|
||||
class RouterFlow(Flow[ExampleState]):
|
||||
|
||||
@start()
|
||||
def start_method(self):
|
||||
print("Starting the structured flow")
|
||||
random_boolean = random.choice([True, False])
|
||||
self.state.success_flag = random_boolean
|
||||
|
||||
@router(start_method)
|
||||
def second_method(self):
|
||||
if self.state.success_flag:
|
||||
return "success"
|
||||
else:
|
||||
return "failed"
|
||||
|
||||
@listen("success")
|
||||
def third_method(self):
|
||||
print("Third method running")
|
||||
|
||||
@listen("failed")
|
||||
def fourth_method(self):
|
||||
print("Fourth method running")
|
||||
|
||||
|
||||
flow = RouterFlow()
|
||||
flow.plot("my_flow_plot")
|
||||
flow.kickoff()
|
||||
```
|
||||
|
||||
```text Output
|
||||
Starting the structured flow
|
||||
Third method running
|
||||
Fourth method running
|
||||
```
|
||||
|
||||
</CodeGroup>
|
||||
|
||||

|
||||
|
||||
위 예제에서 `start_method`는 랜덤 불리언 값을 생성하여 state에 저장합니다.
|
||||
`second_method`는 `@router()` 데코레이터를 사용해 불리언 값에 따라 조건부 라우팅 로직을 정의합니다.
|
||||
불리언 값이 `True`이면 메서드는 `"success"`를 반환하고, `False`이면 `"failed"`를 반환합니다.
|
||||
`third_method`와 `fourth_method`는 `second_method`의 출력값을 기다렸다가 반환된 값에 따라 실행됩니다.
|
||||
|
||||
이 Flow를 실행하면, `start_method`에서 생성된 랜덤 불리언 값에 따라 출력값이 달라집니다.
|
||||
|
||||
## 플로우에 에이전트 추가하기
|
||||
|
||||
에이전트는 플로우에 원활하게 통합할 수 있으며, 단순하고 집중된 작업 실행이 필요할 때 전체 Crew의 경량 대안으로 활용됩니다. 아래는 에이전트를 플로우 내에서 사용하여 시장 조사를 수행하는 예시입니다:
|
||||
|
||||
```python
|
||||
import asyncio
|
||||
from typing import Any, Dict, List
|
||||
|
||||
from crewai_tools import SerperDevTool
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
from crewai.agent import Agent
|
||||
from crewai.flow.flow import Flow, listen, start
|
||||
|
||||
|
||||
# Define a structured output format
|
||||
class MarketAnalysis(BaseModel):
|
||||
key_trends: List[str] = Field(description="List of identified market trends")
|
||||
market_size: str = Field(description="Estimated market size")
|
||||
competitors: List[str] = Field(description="Major competitors in the space")
|
||||
|
||||
|
||||
# Define flow state
|
||||
class MarketResearchState(BaseModel):
|
||||
product: str = ""
|
||||
analysis: MarketAnalysis | None = None
|
||||
|
||||
|
||||
# Create a flow class
|
||||
class MarketResearchFlow(Flow[MarketResearchState]):
|
||||
@start()
|
||||
def initialize_research(self) -> Dict[str, Any]:
|
||||
print(f"Starting market research for {self.state.product}")
|
||||
return {"product": self.state.product}
|
||||
|
||||
@listen(initialize_research)
|
||||
async def analyze_market(self) -> Dict[str, Any]:
|
||||
# Create an Agent for market research
|
||||
analyst = Agent(
|
||||
role="Market Research Analyst",
|
||||
goal=f"Analyze the market for {self.state.product}",
|
||||
backstory="You are an experienced market analyst with expertise in "
|
||||
"identifying market trends and opportunities.",
|
||||
tools=[SerperDevTool()],
|
||||
verbose=True,
|
||||
)
|
||||
|
||||
# Define the research query
|
||||
query = f"""
|
||||
Research the market for {self.state.product}. Include:
|
||||
1. Key market trends
|
||||
2. Market size
|
||||
3. Major competitors
|
||||
|
||||
Format your response according to the specified structure.
|
||||
"""
|
||||
|
||||
# Execute the analysis with structured output format
|
||||
result = await analyst.kickoff_async(query, response_format=MarketAnalysis)
|
||||
if result.pydantic:
|
||||
print("result", result.pydantic)
|
||||
else:
|
||||
print("result", result)
|
||||
|
||||
# Return the analysis to update the state
|
||||
return {"analysis": result.pydantic}
|
||||
|
||||
@listen(analyze_market)
|
||||
def present_results(self, analysis) -> None:
|
||||
print("\nMarket Analysis Results")
|
||||
print("=====================")
|
||||
|
||||
if isinstance(analysis, dict):
|
||||
# If we got a dict with 'analysis' key, extract the actual analysis object
|
||||
market_analysis = analysis.get("analysis")
|
||||
else:
|
||||
market_analysis = analysis
|
||||
|
||||
if market_analysis and isinstance(market_analysis, MarketAnalysis):
|
||||
print("\nKey Market Trends:")
|
||||
for trend in market_analysis.key_trends:
|
||||
print(f"- {trend}")
|
||||
|
||||
print(f"\nMarket Size: {market_analysis.market_size}")
|
||||
|
||||
print("\nMajor Competitors:")
|
||||
for competitor in market_analysis.competitors:
|
||||
print(f"- {competitor}")
|
||||
else:
|
||||
print("No structured analysis data available.")
|
||||
print("Raw analysis:", analysis)
|
||||
|
||||
|
||||
# Usage example
|
||||
async def run_flow():
|
||||
flow = MarketResearchFlow()
|
||||
flow.plot("MarketResearchFlowPlot")
|
||||
result = await flow.kickoff_async(inputs={"product": "AI-powered chatbots"})
|
||||
return result
|
||||
|
||||
|
||||
# Run the flow
|
||||
if __name__ == "__main__":
|
||||
asyncio.run(run_flow())
|
||||
```
|
||||
|
||||

|
||||
|
||||
이 예시는 플로우에서 에이전트를 사용할 때의 몇 가지 주요 기능을 보여줍니다:
|
||||
|
||||
1. **구조화된 출력**: Pydantic 모델을 사용하여 예상 출력 형식(`MarketAnalysis`)을 정의함으로써 플로우 전체에서 타입 안정성과 구조화된 데이터를 보장합니다.
|
||||
|
||||
2. **상태 관리**: 플로우 상태(`MarketResearchState`)는 단계 간의 컨텍스트를 유지하고 입력과 출력을 모두 저장합니다.
|
||||
|
||||
3. **도구 통합**: 에이전트는 기능 강화를 위해 `WebsiteSearchTool`과 같은 도구를 사용할 수 있습니다.
|
||||
|
||||
## Flows에 Crews 추가하기
|
||||
|
||||
CrewAI에서 여러 crews로 flow를 생성하는 것은 간단합니다.
|
||||
|
||||
다음 명령어를 실행하여 여러 crews가 포함된 flow를 생성하는 데 필요한 모든 스캐폴딩이 포함된 새 CrewAI 프로젝트를 생성할 수 있습니다.
|
||||
|
||||
```bash
|
||||
crewai create flow name_of_flow
|
||||
```
|
||||
|
||||
이 명령어는 필요한 폴더 구조를 갖춘 새 CrewAI 프로젝트를 생성합니다. 생성된 프로젝트에는 이미 동작 중인 미리 구축된 crew인 `poem_crew`가 포함되어 있습니다. 이 crew를 템플릿으로 사용하여 복사, 붙여넣기, 수정함으로써 다른 crew를 만들 수 있습니다.
|
||||
|
||||
### 폴더 구조
|
||||
|
||||
`crewai create flow name_of_flow` 명령을 실행하면 다음과 유사한 폴더 구조를 볼 수 있습니다:
|
||||
|
||||
| 디렉터리/파일 | 설명 |
|
||||
| :--------------------- | :----------------------------------------------------------------- |
|
||||
| `name_of_flow/` | flow의 루트 디렉터리입니다. |
|
||||
| ├── `crews/` | 특정 crew에 대한 디렉터리를 포함합니다. |
|
||||
| │ └── `poem_crew/` | "poem_crew"의 설정 및 스크립트가 포함된 디렉터리입니다. |
|
||||
| │ ├── `config/` | "poem_crew"의 설정 파일 디렉터리입니다. |
|
||||
| │ │ ├── `agents.yaml` | "poem_crew"의 agent를 정의하는 YAML 파일입니다. |
|
||||
| │ │ └── `tasks.yaml` | "poem_crew"의 task를 정의하는 YAML 파일입니다. |
|
||||
| │ ├── `poem_crew.py` | "poem_crew"의 기능을 위한 스크립트입니다. |
|
||||
| ├── `tools/` | flow에서 사용되는 추가 도구를 위한 디렉터리입니다. |
|
||||
| │ └── `custom_tool.py` | 사용자 정의 도구 구현 파일입니다. |
|
||||
| ├── `main.py` | flow를 실행하는 메인 스크립트입니다. |
|
||||
| ├── `README.md` | 프로젝트 설명 및 안내 문서입니다. |
|
||||
| ├── `pyproject.toml` | 프로젝트의 종속성 및 설정을 위한 구성 파일입니다. |
|
||||
| └── `.gitignore` | 버전 관리에서 무시할 파일과 디렉터리를 지정합니다. |
|
||||
|
||||
### 크루 빌드하기
|
||||
|
||||
`crews` 폴더에서는 여러 개의 크루를 정의할 수 있습니다. 각 크루는 자체 폴더를 가지며, 설정 파일과 크루 정의 파일을 포함합니다. 예를 들어, `poem_crew` 폴더에는 다음과 같은 파일이 있습니다:
|
||||
|
||||
- `config/agents.yaml`: 크루의 agent를 정의합니다.
|
||||
- `config/tasks.yaml`: 크루의 task를 정의합니다.
|
||||
- `poem_crew.py`: agent, task, 그리고 크루 자체를 포함한 crew 정의가 들어 있습니다.
|
||||
|
||||
`poem_crew`를 복사, 붙여넣기, 그리고 편집하여 다른 크루를 생성할 수 있습니다.
|
||||
|
||||
### `main.py`에서 Crew 연결하기
|
||||
|
||||
`main.py` 파일은 flow를 생성하고 crew들을 서로 연결하는 곳입니다. `Flow` 클래스를 사용하고, `@start`와 `@listen` 데코레이터를 사용하여 실행 흐름을 지정하여 flow를 정의할 수 있습니다.
|
||||
|
||||
다음은 `main.py` 파일에서 `poem_crew`를 연결하는 예제입니다:
|
||||
|
||||
```python Code
|
||||
#!/usr/bin/env python
|
||||
from random import randint
|
||||
|
||||
from pydantic import BaseModel
|
||||
from crewai.flow.flow import Flow, listen, start
|
||||
from .crews.poem_crew.poem_crew import PoemCrew
|
||||
|
||||
class PoemState(BaseModel):
|
||||
sentence_count: int = 1
|
||||
poem: str = ""
|
||||
|
||||
class PoemFlow(Flow[PoemState]):
|
||||
|
||||
@start()
|
||||
def generate_sentence_count(self):
|
||||
print("Generating sentence count")
|
||||
self.state.sentence_count = randint(1, 5)
|
||||
|
||||
@listen(generate_sentence_count)
|
||||
def generate_poem(self):
|
||||
print("Generating poem")
|
||||
result = PoemCrew().crew().kickoff(inputs={"sentence_count": self.state.sentence_count})
|
||||
|
||||
print("Poem generated", result.raw)
|
||||
self.state.poem = result.raw
|
||||
|
||||
@listen(generate_poem)
|
||||
def save_poem(self):
|
||||
print("Saving poem")
|
||||
with open("poem.txt", "w") as f:
|
||||
f.write(self.state.poem)
|
||||
|
||||
def kickoff():
|
||||
poem_flow = PoemFlow()
|
||||
poem_flow.kickoff()
|
||||
|
||||
|
||||
def plot():
|
||||
poem_flow = PoemFlow()
|
||||
poem_flow.plot("PoemFlowPlot")
|
||||
|
||||
if __name__ == "__main__":
|
||||
kickoff()
|
||||
plot()
|
||||
```
|
||||
|
||||
이 예제에서 `PoemFlow` 클래스는 문장 수를 생성하고, `PoemCrew`를 사용하여 시를 생성한 후, 시를 파일에 저장하는 flow를 정의합니다. 이 flow는 `kickoff()` 메서드를 호출하여 시작됩니다. `plot()` 메서드로 PoemFlowPlot이 생성됩니다.
|
||||
|
||||

|
||||
|
||||
### 플로우 실행하기
|
||||
|
||||
(선택 사항) 플로우를 실행하기 전에, 다음 명령어를 실행하여 의존성을 설치할 수 있습니다:
|
||||
|
||||
```bash
|
||||
crewai install
|
||||
```
|
||||
|
||||
모든 의존성이 설치되면, 다음 명령어를 실행하여 가상 환경을 활성화해야 합니다:
|
||||
|
||||
```bash
|
||||
source .venv/bin/activate
|
||||
```
|
||||
|
||||
가상 환경을 활성화한 후, 아래 명령어 중 하나를 실행하여 플로우를 실행할 수 있습니다:
|
||||
|
||||
```bash
|
||||
crewai flow kickoff
|
||||
```
|
||||
|
||||
또는
|
||||
|
||||
```bash
|
||||
uv run kickoff
|
||||
```
|
||||
|
||||
플로우가 실행되면, 콘솔에서 출력을 확인할 수 있습니다.
|
||||
|
||||
## 플롯 플로우
|
||||
|
||||
AI 워크플로우를 시각화하면 플로우의 구조와 실행 경로에 대한 중요한 인사이트를 얻을 수 있습니다. CrewAI는 플로우의 인터랙티브 플롯을 생성할 수 있는 강력한 시각화 도구를 제공하여 AI 워크플로우를 보다 쉽게 이해하고 최적화할 수 있도록 도와줍니다.
|
||||
|
||||
### 플롯(Plots)이란 무엇인가요?
|
||||
|
||||
CrewAI에서 플롯(Plots)은 AI 워크플로우의 그래픽 표현입니다. 플롯은 다양한 태스크와 그들의 연결, 그리고 태스크 간 데이터 흐름을 시각적으로 보여줍니다. 이러한 시각화는 작업 순서를 이해하고, 병목 현상을 식별하며, 워크플로우 논리가 기대에 부합하는지 확인하는 데 도움이 됩니다.
|
||||
|
||||
### 플롯 생성 방법
|
||||
|
||||
CrewAI는 플로우의 플롯을 생성하는 두 가지 편리한 방법을 제공합니다:
|
||||
|
||||
#### 옵션 1: `plot()` 메서드 사용하기
|
||||
|
||||
flow 인스턴스와 직접 작업하는 경우, flow 객체에서 `plot()` 메서드를 호출하여 플롯을 생성할 수 있습니다. 이 메서드는 flow의 인터랙티브 플롯이 포함된 HTML 파일을 생성합니다.
|
||||
|
||||
```python Code
|
||||
# Assuming you have a flow instance
|
||||
flow.plot("my_flow_plot")
|
||||
```
|
||||
|
||||
이렇게 하면 현재 디렉토리에 `my_flow_plot.html`이라는 파일이 생성됩니다. 이 파일을 웹 브라우저에서 열어 인터랙티브 플롯을 볼 수 있습니다.
|
||||
|
||||
#### 옵션 2: 커맨드 라인 사용
|
||||
|
||||
구조화된 CrewAI 프로젝트 내에서 작업 중이라면 커맨드 라인을 사용하여 플롯을 생성할 수 있습니다. 이는 전체 플로우 설정을 시각화하고자 하는 대규모 프로젝트에서 특히 유용합니다.
|
||||
|
||||
```bash
|
||||
crewai flow plot
|
||||
```
|
||||
|
||||
이 명령은 플로우의 플롯이 포함된 HTML 파일을 생성하며, 이는 `plot()` 메서드와 유사합니다. 파일은 프로젝트 디렉터리에 저장되며, 웹 브라우저에서 열어 플로우를 탐색할 수 있습니다.
|
||||
|
||||
### 플롯 이해하기
|
||||
|
||||
생성된 플롯은 flow 내의 작업을 나타내는 노드와 실행 흐름을 나타내는 방향성이 있는 엣지를 표시합니다. 플롯은 인터랙티브하게 제공되어, 확대/축소를 하거나 노드 위에 마우스를 올려 추가 정보를 볼 수 있습니다.
|
||||
|
||||
flow를 시각화하면 워크플로의 구조를 더욱 명확하게 이해할 수 있어 디버깅, 최적화, 그리고 AI 프로세스를 다른 사람들에게 설명하는 데 도움이 됩니다.
|
||||
|
||||
### 결론
|
||||
|
||||
플로우를 시각적으로 표현하는 것은 CrewAI의 강력한 기능으로, 복잡한 AI 워크플로우를 설계하고 관리하는 능력을 크게 향상시켜줍니다. `plot()` 메서드나 커맨드 라인 중 어떤 방법을 사용하더라도, 플롯을 생성하면 워크플로우의 시각적 표현을 얻을 수 있어 개발과 발표 모두에 도움이 됩니다.
|
||||
|
||||
## 다음 단계
|
||||
|
||||
추가적인 flow 예제를 살펴보고 싶으시다면, 저희 examples 레포지토리에서 다양한 추천 예제를 확인하실 수 있습니다. 아래는 각각 고유한 사용 사례를 보여주는 네 가지 구체적인 flow 예제로, 현재 문제 유형에 맞는 예시를 찾는 데 도움이 될 것입니다:
|
||||
|
||||
1. **이메일 자동 응답자 Flow**: 이 예제는 백그라운드 작업이 계속 실행되면서 이메일 응답을 자동화하는 무한 루프를 보여줍니다. 수동 개입 없이 반복적으로 수행해야 하는 작업에 적합한 사용 사례입니다. [예제 보기](https://github.com/crewAIInc/crewAI-examples/tree/main/email_auto_responder_flow)
|
||||
|
||||
2. **리드 점수 Flow**: 이 flow 예제는 human-in-the-loop 피드백을 추가하고 router를 사용하여 다양한 조건 분기를 처리하는 방법을 보여줍니다. 워크플로우에 동적 의사결정과 인간의 관리·감독을 통합하는 방식을 확인할 수 있는 훌륭한 예시입니다. [예제 보기](https://github.com/crewAIInc/crewAI-examples/tree/main/lead-score-flow)
|
||||
|
||||
3. **책 집필 Flow**: 이 예제는 여러 crew를 연속적으로 연결하는 데 탁월하며, 한 crew의 출력 결과가 다른 crew에 의해 사용됩니다. 구체적으로, 한 crew가 전체 책의 개요를 작성하고, 다른 crew가 그 개요를 바탕으로 챕터를 생성합니다. 결국 모든 것이 연결되어 완성된 책이 만들어집니다. 여러 작업 간 조율이 필요한 복잡한 다단계 프로세스에 적합한 flow입니다. [예제 보기](https://github.com/crewAIInc/crewAI-examples/tree/main/write_a_book_with_flows)
|
||||
|
||||
4. **미팅 어시스턴트 Flow**: 이 flow는 하나의 이벤트가 여러 후속 작업을 트리거하도록 브로드캐스트하는 방법을 보여줍니다. 예를 들어, 미팅이 끝난 후 Trello 보드를 업데이트하고 Slack 메시지를 전송하며 결과를 저장할 수 있습니다. 하나의 이벤트로부터 여러 결과를 처리하는 좋은 예시로, 포괄적인 작업 관리 및 알림 시스템에 이상적입니다. [예제 보기](https://github.com/crewAIInc/crewAI-examples/tree/main/meeting_assistant_flow)
|
||||
|
||||
이 예제들을 통해 반복되는 작업 자동화부터 동적 의사결정과 인간 피드백이 포함된 복잡한 다단계 프로세스 관리에 이르기까지 다양한 사용 사례에서 CrewAI Flows를 어떻게 활용할 수 있는지에 대한 통찰력을 얻을 수 있습니다.
|
||||
|
||||
또한, 아래의 CrewAI에서 flows를 사용하는 방법에 대한 YouTube 영상을 확인해보세요!
|
||||
|
||||
<iframe
|
||||
width="560"
|
||||
height="315"
|
||||
src="https://www.youtube.com/embed/MTb5my6VOT8"
|
||||
title="YouTube video player"
|
||||
frameborder="0"
|
||||
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
|
||||
referrerpolicy="strict-origin-when-cross-origin"
|
||||
allowfullscreen
|
||||
></iframe>
|
||||
|
||||
## 플로우 실행하기
|
||||
|
||||
플로우를 실행하는 방법에는 두 가지가 있습니다:
|
||||
|
||||
### Flow API 사용하기
|
||||
|
||||
플로우를 프로그래밍 방식으로 실행하려면, 플로우 클래스의 인스턴스를 생성하고 `kickoff()` 메서드를 호출하면 됩니다:
|
||||
|
||||
```python
|
||||
flow = ExampleFlow()
|
||||
result = flow.kickoff()
|
||||
```
|
||||
|
||||
### CLI 사용하기
|
||||
|
||||
버전 0.103.0부터 `crewai run` 명령어를 사용하여 flow를 실행할 수 있습니다:
|
||||
|
||||
```shell
|
||||
crewai run
|
||||
```
|
||||
|
||||
이 명령어는 프로젝트가 pyproject.toml의 `type = "flow"` 설정을 기반으로 flow인지 자동으로 감지하여 해당 방식으로 실행합니다. 명령줄에서 flow를 실행하는 권장 방법입니다.
|
||||
|
||||
하위 호환성을 위해 다음 명령어도 사용할 수 있습니다:
|
||||
|
||||
```shell
|
||||
crewai flow kickoff
|
||||
```
|
||||
|
||||
하지만 `crewai run` 명령어가 이제 crew와 flow 모두에 작동하므로 더욱 선호되는 방법입니다.
|
||||
961
docs/ko/concepts/knowledge.mdx
Normal file
@@ -0,0 +1,961 @@
|
||||
---
|
||||
title: Knowledge
|
||||
description: CrewAI에서 knowledge란 무엇이며 어떻게 사용하는지 알아봅니다.
|
||||
icon: book
|
||||
---
|
||||
|
||||
## 개요
|
||||
|
||||
Knowledge in CrewAI는 AI 에이전트가 작업 중에 외부 정보 소스에 접근하고 이를 활용할 수 있게 해주는 강력한 시스템입니다.
|
||||
이는 에이전트에게 작업할 때 참고할 수 있는 참조 도서관을 제공하는 것과 같습니다.
|
||||
|
||||
<Info>
|
||||
Knowledge를 사용함으로써 얻는 주요 이점:
|
||||
- 에이전트에게 도메인 특화 정보를 제공
|
||||
- 실제 데이터를 통한 의사 결정 지원
|
||||
- 대화 전체의 맥락 유지
|
||||
- 응답을 사실 기반 정보에 근거
|
||||
</Info>
|
||||
|
||||
## 빠른 시작 예제
|
||||
|
||||
<Tip>
|
||||
파일 기반 Knowledge Sources의 경우, 프로젝트의 루트에 `knowledge` 디렉토리를 생성하고 그 안에 파일을 배치해야 합니다.
|
||||
또한, 소스를 생성할 때는 `knowledge` 디렉토리로부터의 상대 경로를 사용하세요.
|
||||
</Tip>
|
||||
|
||||
### 기본 문자열 지식 예제
|
||||
|
||||
```python Code
|
||||
from crewai import Agent, Task, Crew, Process, LLM
|
||||
from crewai.knowledge.source.string_knowledge_source import StringKnowledgeSource
|
||||
|
||||
# Create a knowledge source
|
||||
content = "Users name is John. He is 30 years old and lives in San Francisco."
|
||||
string_source = StringKnowledgeSource(content=content)
|
||||
|
||||
# Create an LLM with a temperature of 0 to ensure deterministic outputs
|
||||
llm = LLM(model="gpt-4o-mini", temperature=0)
|
||||
|
||||
# Create an agent with the knowledge store
|
||||
agent = Agent(
|
||||
role="About User",
|
||||
goal="You know everything about the user.",
|
||||
backstory="You are a master at understanding people and their preferences.",
|
||||
verbose=True,
|
||||
allow_delegation=False,
|
||||
llm=llm,
|
||||
)
|
||||
|
||||
task = Task(
|
||||
description="Answer the following questions about the user: {question}",
|
||||
expected_output="An answer to the question.",
|
||||
agent=agent,
|
||||
)
|
||||
|
||||
crew = Crew(
|
||||
agents=[agent],
|
||||
tasks=[task],
|
||||
verbose=True,
|
||||
process=Process.sequential,
|
||||
knowledge_sources=[string_source], # Enable knowledge by adding the sources here
|
||||
)
|
||||
|
||||
result = crew.kickoff(inputs={"question": "What city does John live in and how old is he?"})
|
||||
```
|
||||
|
||||
### 웹 콘텐츠 지식 예시
|
||||
|
||||
<Note>
|
||||
다음 예시가 작동하려면 `docling`을 설치해야 합니다: `uv add docling`
|
||||
</Note>
|
||||
|
||||
```python Code
|
||||
from crewai import LLM, Agent, Crew, Process, Task
|
||||
from crewai.knowledge.source.crew_docling_source import CrewDoclingSource
|
||||
|
||||
# Create a knowledge source from web content
|
||||
content_source = CrewDoclingSource(
|
||||
file_paths=[
|
||||
"https://lilianweng.github.io/posts/2024-11-28-reward-hacking",
|
||||
"https://lilianweng.github.io/posts/2024-07-07-hallucination",
|
||||
],
|
||||
)
|
||||
|
||||
# Create an LLM with a temperature of 0 to ensure deterministic outputs
|
||||
llm = LLM(model="gpt-4o-mini", temperature=0)
|
||||
|
||||
# Create an agent with the knowledge store
|
||||
agent = Agent(
|
||||
role="About papers",
|
||||
goal="You know everything about the papers.",
|
||||
backstory="You are a master at understanding papers and their content.",
|
||||
verbose=True,
|
||||
allow_delegation=False,
|
||||
llm=llm,
|
||||
)
|
||||
|
||||
task = Task(
|
||||
description="Answer the following questions about the papers: {question}",
|
||||
expected_output="An answer to the question.",
|
||||
agent=agent,
|
||||
)
|
||||
|
||||
crew = Crew(
|
||||
agents=[agent],
|
||||
tasks=[task],
|
||||
verbose=True,
|
||||
process=Process.sequential,
|
||||
knowledge_sources=[content_source],
|
||||
)
|
||||
|
||||
result = crew.kickoff(
|
||||
inputs={"question": "What is the reward hacking paper about? Be sure to provide sources."}
|
||||
)
|
||||
```
|
||||
|
||||
## 지원되는 Knowledge Sources
|
||||
|
||||
CrewAI는 다양한 유형의 knowledge source를 기본적으로 지원합니다:
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card title="텍스트 소스" icon="text">
|
||||
- 원시 문자열
|
||||
- 텍스트 파일 (.txt)
|
||||
- PDF 문서
|
||||
</Card>
|
||||
<Card title="구조화된 데이터" icon="table">
|
||||
- CSV 파일
|
||||
- 엑셀 스프레드시트
|
||||
- JSON 문서
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
### 텍스트 파일 지식 소스
|
||||
```python
|
||||
from crewai.knowledge.source.text_file_knowledge_source import TextFileKnowledgeSource
|
||||
|
||||
text_source = TextFileKnowledgeSource(
|
||||
file_paths=["document.txt", "another.txt"]
|
||||
)
|
||||
```
|
||||
|
||||
### PDF 지식 소스
|
||||
```python
|
||||
from crewai.knowledge.source.pdf_knowledge_source import PDFKnowledgeSource
|
||||
|
||||
pdf_source = PDFKnowledgeSource(
|
||||
file_paths=["document.pdf", "another.pdf"]
|
||||
)
|
||||
```
|
||||
|
||||
### CSV 지식 소스
|
||||
```python
|
||||
from crewai.knowledge.source.csv_knowledge_source import CSVKnowledgeSource
|
||||
|
||||
csv_source = CSVKnowledgeSource(
|
||||
file_paths=["data.csv"]
|
||||
)
|
||||
```
|
||||
|
||||
### Excel 지식 소스
|
||||
```python
|
||||
from crewai.knowledge.source.excel_knowledge_source import ExcelKnowledgeSource
|
||||
|
||||
excel_source = ExcelKnowledgeSource(
|
||||
file_paths=["spreadsheet.xlsx"]
|
||||
)
|
||||
```
|
||||
|
||||
### JSON 지식 소스
|
||||
```python
|
||||
from crewai.knowledge.source.json_knowledge_source import JSONKnowledgeSource
|
||||
|
||||
json_source = JSONKnowledgeSource(
|
||||
file_paths=["data.json"]
|
||||
)
|
||||
```
|
||||
|
||||
<Note>
|
||||
반드시 ./knowledge 폴더를 생성해 주세요. 모든 소스 파일(예: .txt, .pdf, .xlsx, .json)은 중앙 집중식 관리를 위해 이 폴더에 보관해야 합니다.
|
||||
</Note>
|
||||
|
||||
## Agent vs Crew Knowledge: 완벽 가이드
|
||||
|
||||
<Info>
|
||||
**Knowledge 레벨 이해하기**: CrewAI는 agent와 crew 두 가지 레벨의 knowledge를 지원합니다. 이 섹션에서는 각각이 어떻게 동작하는지, 언제 초기화되는지, 그리고 dependency에 대한 일반적인 오해를 명확히 설명합니다.
|
||||
</Info>
|
||||
|
||||
### 지식 초기화가 실제로 작동하는 방식
|
||||
|
||||
다음은 지식을 사용할 때 실제로 발생하는 일입니다:
|
||||
|
||||
#### 에이전트 수준 지식 (독립적)
|
||||
|
||||
```python
|
||||
from crewai import Agent, Task, Crew
|
||||
from crewai.knowledge.source.string_knowledge_source import StringKnowledgeSource
|
||||
|
||||
# Agent with its own knowledge - NO crew knowledge needed
|
||||
specialist_knowledge = StringKnowledgeSource(
|
||||
content="Specialized technical information for this agent only"
|
||||
)
|
||||
|
||||
specialist_agent = Agent(
|
||||
role="Technical Specialist",
|
||||
goal="Provide technical expertise",
|
||||
backstory="Expert in specialized technical domains",
|
||||
knowledge_sources=[specialist_knowledge] # Agent-specific knowledge
|
||||
)
|
||||
|
||||
task = Task(
|
||||
description="Answer technical questions",
|
||||
agent=specialist_agent,
|
||||
expected_output="Technical answer"
|
||||
)
|
||||
|
||||
# No crew-level knowledge required
|
||||
crew = Crew(
|
||||
agents=[specialist_agent],
|
||||
tasks=[task]
|
||||
)
|
||||
|
||||
result = crew.kickoff() # Agent knowledge works independently
|
||||
```
|
||||
|
||||
#### `crew.kickoff()` 중에 일어나는 일
|
||||
|
||||
`crew.kickoff()`를 호출하면 다음과 같은 순서로 동작합니다:
|
||||
|
||||
```python
|
||||
# During kickoff
|
||||
for agent in self.agents:
|
||||
agent.crew = self # Agent gets reference to crew
|
||||
agent.set_knowledge(crew_embedder=self.embedder) # Agent knowledge initialized
|
||||
agent.create_agent_executor()
|
||||
```
|
||||
|
||||
#### 스토리지 독립성
|
||||
|
||||
각 knowledge 수준은 독립적인 스토리지 컬렉션을 사용합니다:
|
||||
|
||||
```python
|
||||
# Agent knowledge storage
|
||||
agent_collection_name = agent.role # e.g., "Technical Specialist"
|
||||
|
||||
# Crew knowledge storage
|
||||
crew_collection_name = "crew"
|
||||
|
||||
# Both stored in same ChromaDB instance but different collections
|
||||
# Path: ~/.local/share/CrewAI/{project}/knowledge/
|
||||
# ├── crew/ # Crew knowledge collection
|
||||
# ├── Technical Specialist/ # Agent knowledge collection
|
||||
# └── Another Agent Role/ # Another agent's collection
|
||||
```
|
||||
|
||||
### 전체 작동 예제
|
||||
|
||||
#### 예시 1: Agent-Only Knowledge
|
||||
```python
|
||||
from crewai import Agent, Task, Crew
|
||||
from crewai.knowledge.source.string_knowledge_source import StringKnowledgeSource
|
||||
|
||||
# Agent-specific knowledge
|
||||
agent_knowledge = StringKnowledgeSource(
|
||||
content="Agent-specific information that only this agent needs"
|
||||
)
|
||||
|
||||
agent = Agent(
|
||||
role="Specialist",
|
||||
goal="Use specialized knowledge",
|
||||
backstory="Expert with specific knowledge",
|
||||
knowledge_sources=[agent_knowledge],
|
||||
embedder={ # Agent can have its own embedder
|
||||
"provider": "openai",
|
||||
"config": {"model": "text-embedding-3-small"}
|
||||
}
|
||||
)
|
||||
|
||||
task = Task(
|
||||
description="Answer using your specialized knowledge",
|
||||
agent=agent,
|
||||
expected_output="Answer based on agent knowledge"
|
||||
)
|
||||
|
||||
# No crew knowledge needed
|
||||
crew = Crew(agents=[agent], tasks=[task])
|
||||
result = crew.kickoff() # Works perfectly
|
||||
```
|
||||
|
||||
#### 예시 2: 에이전트 및 크루 지식 모두
|
||||
|
||||
```python
|
||||
# Crew-wide knowledge (shared by all agents)
|
||||
crew_knowledge = StringKnowledgeSource(
|
||||
content="Company policies and general information for all agents"
|
||||
)
|
||||
|
||||
# Agent-specific knowledge
|
||||
specialist_knowledge = StringKnowledgeSource(
|
||||
content="Technical specifications only the specialist needs"
|
||||
)
|
||||
|
||||
specialist = Agent(
|
||||
role="Technical Specialist",
|
||||
goal="Provide technical expertise",
|
||||
backstory="Technical expert",
|
||||
knowledge_sources=[specialist_knowledge] # Agent-specific
|
||||
)
|
||||
|
||||
generalist = Agent(
|
||||
role="General Assistant",
|
||||
goal="Provide general assistance",
|
||||
backstory="General helper"
|
||||
# No agent-specific knowledge
|
||||
)
|
||||
|
||||
crew = Crew(
|
||||
agents=[specialist, generalist],
|
||||
tasks=[...],
|
||||
knowledge_sources=[crew_knowledge] # Crew-wide knowledge
|
||||
)
|
||||
|
||||
# Result:
|
||||
# - specialist gets: crew_knowledge + specialist_knowledge
|
||||
# - generalist gets: crew_knowledge only
|
||||
```
|
||||
|
||||
#### 예제 3: 서로 다른 지식을 가진 다중 에이전트
|
||||
```python
|
||||
# Different knowledge for different agents
|
||||
sales_knowledge = StringKnowledgeSource(content="Sales procedures and pricing")
|
||||
tech_knowledge = StringKnowledgeSource(content="Technical documentation")
|
||||
support_knowledge = StringKnowledgeSource(content="Support procedures")
|
||||
|
||||
sales_agent = Agent(
|
||||
role="Sales Representative",
|
||||
knowledge_sources=[sales_knowledge],
|
||||
embedder={"provider": "openai", "config": {"model": "text-embedding-3-small"}}
|
||||
)
|
||||
|
||||
tech_agent = Agent(
|
||||
role="Technical Expert",
|
||||
knowledge_sources=[tech_knowledge],
|
||||
embedder={"provider": "ollama", "config": {"model": "mxbai-embed-large"}}
|
||||
)
|
||||
|
||||
support_agent = Agent(
|
||||
role="Support Specialist",
|
||||
knowledge_sources=[support_knowledge]
|
||||
# Will use crew embedder as fallback
|
||||
)
|
||||
|
||||
crew = Crew(
|
||||
agents=[sales_agent, tech_agent, support_agent],
|
||||
tasks=[...],
|
||||
embedder={ # Fallback embedder for agents without their own
|
||||
"provider": "google",
|
||||
"config": {"model": "text-embedding-004"}
|
||||
}
|
||||
)
|
||||
|
||||
# Each agent gets only their specific knowledge
|
||||
# Each can use different embedding providers
|
||||
```
|
||||
|
||||
<Tip>
|
||||
벡터 데이터베이스에서 도구를 사용한 검색과 달리, 사전에 지식이 탑재된 에이전트는 검색 퍼소나나 태스크가 필요하지 않습니다.
|
||||
에이전트나 crew가 동작하는 데 필요한 관련 지식 소스만 추가하면 됩니다.
|
||||
|
||||
지식 소스는 에이전트 또는 crew 레벨에 추가할 수 있습니다.
|
||||
crew 레벨 지식 소스는 **crew 내 모든 에이전트**가 사용하게 됩니다.
|
||||
에이전트 레벨 지식 소스는 해당 지식이 사전 탑재된 **특정 에이전트**만 사용하게 됩니다.
|
||||
</Tip>
|
||||
|
||||
## Knowledge 구성
|
||||
|
||||
crew 또는 agent에 대해 knowledge 구성을 할 수 있습니다.
|
||||
|
||||
```python Code
|
||||
from crewai.knowledge.knowledge_config import KnowledgeConfig
|
||||
|
||||
knowledge_config = KnowledgeConfig(results_limit=10, score_threshold=0.5)
|
||||
|
||||
agent = Agent(
|
||||
...
|
||||
knowledge_config=knowledge_config
|
||||
)
|
||||
```
|
||||
|
||||
<Tip>
|
||||
`results_limit`: 반환할 관련 문서의 개수입니다. 기본값은 3입니다.
|
||||
`score_threshold`: 문서가 관련성이 있다고 간주되기 위한 최소 점수입니다. 기본값은 0.35입니다.
|
||||
</Tip>
|
||||
|
||||
## 지원되는 Knowledge 매개변수
|
||||
|
||||
<ParamField body="sources" type="List[BaseKnowledgeSource]" required="Yes">
|
||||
저장 및 쿼리할 콘텐츠를 제공하는 knowledge source들의 리스트입니다. PDF, CSV, Excel, JSON, 텍스트 파일 또는 문자열 콘텐츠를 포함할 수 있습니다.
|
||||
</ParamField>
|
||||
<ParamField body="collection_name" type="str">
|
||||
knowledge가 저장될 컬렉션의 이름입니다. 서로 다른 knowledge 세트를 식별하는 데 사용됩니다. 제공하지 않을 경우 기본값은 "knowledge"입니다.
|
||||
</ParamField>
|
||||
<ParamField body="storage" type="Optional[KnowledgeStorage]">
|
||||
knowledge가 저장되고 검색되는 방식을 관리하기 위한 커스텀 저장소 구성입니다. 별도로 제공하지 않는 경우 기본 storage가 생성됩니다.
|
||||
</ParamField>
|
||||
|
||||
## 지식 저장 투명성
|
||||
|
||||
<Info>
|
||||
**지식 저장 이해하기**: CrewAI는 ChromaDB를 사용하여 벡터 저장소에 지식 소스를 플랫폼별 디렉토리에 자동으로 저장합니다. 이러한 위치와 기본값을 이해하면 프로덕션 배포, 디버깅, 저장소 관리에 도움이 됩니다.
|
||||
</Info>
|
||||
|
||||
### CrewAI가 Knowledge 파일을 저장하는 위치
|
||||
|
||||
기본적으로 CrewAI는 memory와 동일한 저장 시스템을 사용하여, knowledge를 플랫폼별 디렉터리에 저장합니다.
|
||||
|
||||
#### 플랫폼별 기본 저장 위치
|
||||
|
||||
**macOS:**
|
||||
```
|
||||
~/Library/Application Support/CrewAI/{project_name}/
|
||||
└── knowledge/ # Knowledge ChromaDB files
|
||||
├── chroma.sqlite3 # ChromaDB metadata
|
||||
├── {collection_id}/ # Vector embeddings
|
||||
└── knowledge_{collection}/ # Named collections
|
||||
```
|
||||
|
||||
**Linux:**
|
||||
```
|
||||
~/.local/share/CrewAI/{project_name}/
|
||||
└── knowledge/
|
||||
├── chroma.sqlite3
|
||||
├── {collection_id}/
|
||||
└── knowledge_{collection}/
|
||||
```
|
||||
|
||||
**Windows:**
|
||||
```
|
||||
C:\Users\{username}\AppData\Local\CrewAI\{project_name}\
|
||||
└── knowledge\
|
||||
├── chroma.sqlite3
|
||||
├── {collection_id}\
|
||||
└── knowledge_{collection}\
|
||||
```
|
||||
|
||||
### 지식 저장 위치 찾기
|
||||
|
||||
CrewAI가 지식 파일을 저장하는 위치를 정확히 확인하려면:
|
||||
|
||||
```python
|
||||
from crewai.utilities.paths import db_storage_path
|
||||
import os
|
||||
|
||||
# Get the knowledge storage path
|
||||
knowledge_path = os.path.join(db_storage_path(), "knowledge")
|
||||
print(f"Knowledge storage location: {knowledge_path}")
|
||||
|
||||
# List knowledge collections and files
|
||||
if os.path.exists(knowledge_path):
|
||||
print("\nKnowledge storage contents:")
|
||||
for item in os.listdir(knowledge_path):
|
||||
item_path = os.path.join(knowledge_path, item)
|
||||
if os.path.isdir(item_path):
|
||||
print(f"📁 Collection: {item}/")
|
||||
# Show collection contents
|
||||
try:
|
||||
for subitem in os.listdir(item_path):
|
||||
print(f" └── {subitem}")
|
||||
except PermissionError:
|
||||
print(f" └── (permission denied)")
|
||||
else:
|
||||
print(f"📄 {item}")
|
||||
else:
|
||||
print("No knowledge storage found yet.")
|
||||
```
|
||||
|
||||
### 지식 저장 위치 제어
|
||||
|
||||
#### 옵션 1: 환경 변수 (권장)
|
||||
```python
|
||||
import os
|
||||
from crewai import Crew
|
||||
|
||||
# Set custom storage location for all CrewAI data
|
||||
os.environ["CREWAI_STORAGE_DIR"] = "./my_project_storage"
|
||||
|
||||
# All knowledge will now be stored in ./my_project_storage/knowledge/
|
||||
crew = Crew(
|
||||
agents=[...],
|
||||
tasks=[...],
|
||||
knowledge_sources=[...]
|
||||
)
|
||||
```
|
||||
|
||||
#### 옵션 2: 사용자 지정 Knowledge 저장소
|
||||
```python
|
||||
from crewai.knowledge.storage.knowledge_storage import KnowledgeStorage
|
||||
from crewai.knowledge.source.string_knowledge_source import StringKnowledgeSource
|
||||
|
||||
# Create custom storage with specific embedder
|
||||
custom_storage = KnowledgeStorage(
|
||||
embedder={
|
||||
"provider": "ollama",
|
||||
"config": {"model": "mxbai-embed-large"}
|
||||
},
|
||||
collection_name="my_custom_knowledge"
|
||||
)
|
||||
|
||||
# Use with knowledge sources
|
||||
knowledge_source = StringKnowledgeSource(
|
||||
content="Your knowledge content here"
|
||||
)
|
||||
knowledge_source.storage = custom_storage
|
||||
```
|
||||
|
||||
#### 옵션 3: 프로젝트별 Knowledge 저장소
|
||||
```python
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
# Store knowledge in project directory
|
||||
project_root = Path(__file__).parent
|
||||
knowledge_dir = project_root / "knowledge_storage"
|
||||
|
||||
os.environ["CREWAI_STORAGE_DIR"] = str(knowledge_dir)
|
||||
|
||||
# Now all knowledge will be stored in your project directory
|
||||
```
|
||||
|
||||
### 기본 임베딩 제공자 동작
|
||||
|
||||
<Info>
|
||||
**기본 임베딩 제공자**: CrewAI는 다른 LLM 제공자를 사용할 때도 지식 저장을 위해 기본적으로 OpenAI 임베딩(`text-embedding-3-small`)을 사용합니다. 설정에 맞게 쉽게 이 옵션을 커스터마이즈할 수 있습니다.
|
||||
</Info>
|
||||
|
||||
#### 기본 동작 이해하기
|
||||
```python
|
||||
from crewai import Agent, Crew, LLM
|
||||
from crewai.knowledge.source.string_knowledge_source import StringKnowledgeSource
|
||||
|
||||
# When using Claude as your LLM...
|
||||
agent = Agent(
|
||||
role="Researcher",
|
||||
goal="Research topics",
|
||||
backstory="Expert researcher",
|
||||
llm=LLM(provider="anthropic", model="claude-3-sonnet") # Using Claude
|
||||
)
|
||||
|
||||
# CrewAI will still use OpenAI embeddings by default for knowledge
|
||||
# This ensures consistency but may not match your LLM provider preference
|
||||
knowledge_source = StringKnowledgeSource(content="Research data...")
|
||||
|
||||
crew = Crew(
|
||||
agents=[agent],
|
||||
tasks=[...],
|
||||
knowledge_sources=[knowledge_source]
|
||||
# Default: Uses OpenAI embeddings even with Claude LLM
|
||||
)
|
||||
```
|
||||
|
||||
#### 지식 임베딩 공급자 사용자 정의
|
||||
```python
|
||||
# Option 1: Voyage AI 사용 (Claude 사용자에게 Anthropic이 권장)
|
||||
crew = Crew(
|
||||
agents=[agent],
|
||||
tasks=[...],
|
||||
knowledge_sources=[knowledge_source],
|
||||
embedder={
|
||||
"provider": "voyageai", # Claude 사용자에게 권장
|
||||
"config": {
|
||||
"api_key": "your-voyage-api-key",
|
||||
"model": "voyage-3" # 최고 품질을 원하면 "voyage-3-large" 사용
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
# Option 2: 로컬 임베딩 사용 (외부 API 호출 없음)
|
||||
crew = Crew(
|
||||
agents=[agent],
|
||||
tasks=[...],
|
||||
knowledge_sources=[knowledge_source],
|
||||
embedder={
|
||||
"provider": "ollama",
|
||||
"config": {
|
||||
"model": "mxbai-embed-large",
|
||||
"url": "http://localhost:11434/api/embeddings"
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
# Option 3: 에이전트 수준의 임베딩 사용자 정의
|
||||
agent = Agent(
|
||||
role="Researcher",
|
||||
goal="Research topics",
|
||||
backstory="Expert researcher",
|
||||
knowledge_sources=[knowledge_source],
|
||||
embedder={
|
||||
"provider": "google",
|
||||
"config": {
|
||||
"model": "models/text-embedding-004",
|
||||
"api_key": "your-google-key"
|
||||
}
|
||||
}
|
||||
)
|
||||
```
|
||||
|
||||
#### Azure OpenAI 임베딩 구성
|
||||
|
||||
Azure OpenAI 임베딩을 사용할 때:
|
||||
1. 먼저 Azure 플랫폼에 임베딩 모델을 배포했는지 확인하세요.
|
||||
2. 그런 다음 다음과 같은 구성을 사용해야 합니다:
|
||||
|
||||
```python
|
||||
agent = Agent(
|
||||
role="Researcher",
|
||||
goal="Research topics",
|
||||
backstory="Expert researcher",
|
||||
knowledge_sources=[knowledge_source],
|
||||
embedder={
|
||||
"provider": "azure",
|
||||
"config": {
|
||||
"api_key": "your-azure-api-key",
|
||||
"model": "text-embedding-ada-002", # change to the model you are using and is deployed in Azure
|
||||
"api_base": "https://your-azure-endpoint.openai.azure.com/",
|
||||
"api_version": "2024-02-01"
|
||||
}
|
||||
}
|
||||
)
|
||||
```
|
||||
|
||||
## 고급 기능
|
||||
|
||||
### 쿼리 리라이팅
|
||||
|
||||
CrewAI는 지식 검색을 최적화하기 위해 지능형 쿼리 리라이팅 메커니즘을 구현합니다. 에이전트가 지식 소스를 검색해야 할 때, 원시 태스크 프롬프트는 자동으로 더 효과적인 검색 쿼리로 변환됩니다.
|
||||
|
||||
#### 쿼리 재작성 방식
|
||||
|
||||
1. 에이전트가 knowledge 소스를 사용할 수 있을 때 작업을 실행하면 `_get_knowledge_search_query` 메서드가 트리거됩니다.
|
||||
2. 에이전트의 LLM을 사용하여 원래 작업 프롬프트를 최적화된 검색 쿼리로 변환합니다.
|
||||
3. 이 최적화된 쿼리는 knowledge 소스에서 관련 정보를 검색하는 데 사용됩니다.
|
||||
|
||||
#### 쿼리 리라이트(Query Rewriting)의 이점
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card title="향상된 검색 정확도" icon="bullseye-arrow">
|
||||
주요 개념에 집중하고 불필요한 내용을 제거함으로써, 쿼리 리라이트는 보다 관련성 높은 정보를 검색할 수 있게 도와줍니다.
|
||||
</Card>
|
||||
<Card title="컨텍스트 인식" icon="brain">
|
||||
리라이트된 쿼리는 벡터 데이터베이스 검색을 위해 더욱 구체적이고 컨텍스트를 인식할 수 있도록 설계되어 있습니다.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
#### 예시
|
||||
|
||||
```python
|
||||
# Original task prompt
|
||||
task_prompt = "Answer the following questions about the user's favorite movies: What movie did John watch last week? Format your answer in JSON."
|
||||
|
||||
# Behind the scenes, this might be rewritten as:
|
||||
rewritten_query = "What movies did John watch last week?"
|
||||
```
|
||||
|
||||
재작성된 쿼리는 핵심 정보 요구에 더 집중하며, 출력 형식에 대한 불필요한 지시사항을 제거합니다.
|
||||
|
||||
<Tip>
|
||||
이 메커니즘은 완전히 자동으로 동작하며 사용자가 별도의 설정을 할 필요가 없습니다. agent의 LLM을 사용하여 쿼리 재작성을 수행하므로, 더 강력한 LLM을 사용할 경우 재작성된 쿼리의 품질이 향상될 수 있습니다.
|
||||
</Tip>
|
||||
|
||||
### Knowledge 이벤트
|
||||
|
||||
CrewAI는 knowledge 검색 과정에서 이벤트를 발생시키며, 이벤트 시스템을 사용하여 이를 감지할 수 있습니다. 이러한 이벤트를 통해 에이전트가 knowledge를 어떻게 검색하고 사용하는지 모니터링, 디버깅, 분석할 수 있습니다.
|
||||
|
||||
#### 사용 가능한 Knowledge 이벤트
|
||||
|
||||
- **KnowledgeRetrievalStartedEvent**: 에이전트가 소스에서 knowledge를 검색하기 시작할 때 발생
|
||||
- **KnowledgeRetrievalCompletedEvent**: knowledge 검색이 완료되었을 때 발생하며, 사용된 쿼리와 검색된 콘텐츠를 포함
|
||||
- **KnowledgeQueryStartedEvent**: knowledge 소스에 쿼리를 시작할 때 발생
|
||||
- **KnowledgeQueryCompletedEvent**: 쿼리가 성공적으로 완료되었을 때 발생
|
||||
- **KnowledgeQueryFailedEvent**: knowledge 소스에 대한 쿼리가 실패했을 때 발생
|
||||
- **KnowledgeSearchQueryFailedEvent**: 검색 쿼리가 실패했을 때 발생
|
||||
|
||||
#### 예시: Knowledge Retrieval 모니터링
|
||||
|
||||
```python
|
||||
from crewai.utilities.events import (
|
||||
KnowledgeRetrievalStartedEvent,
|
||||
KnowledgeRetrievalCompletedEvent,
|
||||
)
|
||||
from crewai.utilities.events.base_event_listener import BaseEventListener
|
||||
|
||||
class KnowledgeMonitorListener(BaseEventListener):
|
||||
def setup_listeners(self, crewai_event_bus):
|
||||
@crewai_event_bus.on(KnowledgeRetrievalStartedEvent)
|
||||
def on_knowledge_retrieval_started(source, event):
|
||||
print(f"Agent '{event.agent.role}' started retrieving knowledge")
|
||||
|
||||
@crewai_event_bus.on(KnowledgeRetrievalCompletedEvent)
|
||||
def on_knowledge_retrieval_completed(source, event):
|
||||
print(f"Agent '{event.agent.role}' completed knowledge retrieval")
|
||||
print(f"Query: {event.query}")
|
||||
print(f"Retrieved {len(event.retrieved_knowledge)} knowledge chunks")
|
||||
|
||||
# Create an instance of your listener
|
||||
knowledge_monitor = KnowledgeMonitorListener()
|
||||
```
|
||||
|
||||
이벤트 사용에 대한 자세한 내용은 [이벤트 리스너](https://docs.crewai.com/concepts/event-listener) 문서를 참고하세요.
|
||||
|
||||
### 맞춤형 지식 소스
|
||||
|
||||
CrewAI를 사용하면 `BaseKnowledgeSource` 클래스를 확장하여 모든 유형의 데이터에 대한 맞춤형 지식 소스를 만들 수 있습니다. 이제 우주 뉴스 기사를 가져오고 처리하는 실용적인 예제를 만들어보겠습니다.
|
||||
|
||||
최근 우주 탐사 동향은 다음과 같습니다. 최신 우주 뉴스 기사들을 기반으로 정리하였습니다:
|
||||
|
||||
1. SpaceX가 2023년 11월 17일 오전에 예정된, 두 번째 Starship/Super Heavy 통합 발사를 위한 최종 규제 승인을 받았습니다. 이는 SpaceX의 우주 탐사 및 우주 식민화에 대한 야심찬 계획에서 중요한 단계입니다. [출처: SpaceNews](https://spacenews.com/starship-cleared-for-nov-17-launch/)
|
||||
|
||||
2. SpaceX는 미국 연방통신위원회(FCC)에 1세대 차세대 Starlink Gen2 위성의 첫 발사를 시작할 계획임을 알렸습니다. 이는 전 세계에 고속 인터넷을 제공하는 Starlink 위성 인터넷 서비스의 주요 업그레이드입니다. [출처: Teslarati](https://www.teslarati.com/spacex-first-starlink-gen2-satellite-launch-2022/)
|
||||
|
||||
3. AI 스타트업 Synthetaic이 시리즈 B 펀딩에서 1,500만 달러를 유치했습니다. 이 회사는 인공 지능을 사용하여 우주 및 공중 센서에서 데이터를 분석하며, 이는 우주 탐사와 위성 기술에 큰 응용 가능성이 있습니다. [출처: SpaceNews](https://spacenews.com/ai-startup-synthetaic-raises-15-million-in-series-b-funding/)
|
||||
|
||||
4. 미 우주군(Space Force)은 미국 인도-태평양 사령부(Indo-Pacific Command) 내에 부대를 공식적으로 창설하여 인도-태평양 지역에 항구적인 존재감을 확보하였습니다. 이는 우주 안보 및 지정학에 중대한 영향을 미칠 수 있습니다. [출처: SpaceNews](https://spacenews.com/space-force-establishes-permanent-presence-in-indo-pacific-region/)
|
||||
|
||||
5. 우주 추적 및 데이터 분석 기업 Slingshot Aerospace는 저지구 궤도(LEO) 커버리지를 확대하기 위해 지상 광학 망원경 네트워크를 확장하고 있습니다. 이는 저지구 궤도의 위성 및 우주 잔해 추적과 분석 능력을 향상시킬 수 있습니다. [출처: SpaceNews](https://spacenews.com/slingshots-space-tracking-network-to-extend-coverage-of-low-earth-orbit/)
|
||||
|
||||
6. 중국 국가자연과학기금위원회는 연구자들이 초대형 우주선 조립을 연구하기 위한 5개년 프로젝트를 발표했습니다. 이는 우주선 기술과 우주 탐사 역량의 비약적인 발전을 가져올 수 있습니다. [출처: SpaceNews](https://spacenews.com/china-researching-challenges-of-kilometer-scale-ultra-large-spacecraft/)
|
||||
|
||||
7. 스탠포드 대학교의 AEroSpace Autonomy Research 센터(CAESAR)는 우주선 자율성에 초점을 맞추고 있습니다. 센터는 2024년 5월 22일에 업계, 학계, 정부 간 협력을 촉진하기 위한 시작 행사를 개최하였습니다. 이는 자율 우주선 기술의 발전에 중대한 기여를 할 수 있습니다. [출처: SpaceNews](https://spacenews.com/stanford-center-focuses-on-spacecraft-autonomy/)
|
||||
```
|
||||
|
||||
</CodeGroup>
|
||||
|
||||
## 디버깅 및 문제 해결
|
||||
|
||||
### 지식 문제 디버깅
|
||||
|
||||
#### 에이전트 지식 초기화 확인
|
||||
```python
|
||||
from crewai import Agent, Crew, Task
|
||||
from crewai.knowledge.source.string_knowledge_source import StringKnowledgeSource
|
||||
|
||||
knowledge_source = StringKnowledgeSource(content="Test knowledge")
|
||||
|
||||
agent = Agent(
|
||||
role="Test Agent",
|
||||
goal="Test knowledge",
|
||||
backstory="Testing",
|
||||
knowledge_sources=[knowledge_source]
|
||||
)
|
||||
|
||||
crew = Crew(agents=[agent], tasks=[Task(...)])
|
||||
|
||||
# Before kickoff - knowledge not initialized
|
||||
print(f"Before kickoff - Agent knowledge: {getattr(agent, 'knowledge', None)}")
|
||||
|
||||
crew.kickoff()
|
||||
|
||||
# After kickoff - knowledge initialized
|
||||
print(f"After kickoff - Agent knowledge: {agent.knowledge}")
|
||||
print(f"Agent knowledge collection: {agent.knowledge.storage.collection_name}")
|
||||
print(f"Number of sources: {len(agent.knowledge.sources)}")
|
||||
```
|
||||
|
||||
#### Knowledge 저장 위치 확인
|
||||
|
||||
```python
|
||||
import os
|
||||
from crewai.utilities.paths import db_storage_path
|
||||
|
||||
# Check storage structure
|
||||
storage_path = db_storage_path()
|
||||
knowledge_path = os.path.join(storage_path, "knowledge")
|
||||
|
||||
if os.path.exists(knowledge_path):
|
||||
print("Knowledge collections found:")
|
||||
for collection in os.listdir(knowledge_path):
|
||||
collection_path = os.path.join(knowledge_path, collection)
|
||||
if os.path.isdir(collection_path):
|
||||
print(f" - {collection}/")
|
||||
# Show collection contents
|
||||
for item in os.listdir(collection_path):
|
||||
print(f" └── {item}")
|
||||
```
|
||||
|
||||
#### 테스트 지식 검색
|
||||
```python
|
||||
# Test agent knowledge retrieval
|
||||
if hasattr(agent, 'knowledge') and agent.knowledge:
|
||||
test_query = ["test query"]
|
||||
results = agent.knowledge.query(test_query)
|
||||
print(f"Agent knowledge results: {len(results)} documents found")
|
||||
|
||||
# Test crew knowledge retrieval (if exists)
|
||||
if hasattr(crew, 'knowledge') and crew.knowledge:
|
||||
crew_results = crew.query_knowledge(test_query)
|
||||
print(f"Crew knowledge results: {len(crew_results)} documents found")
|
||||
```
|
||||
|
||||
#### 지식 컬렉션 검사하기
|
||||
```python
|
||||
import chromadb
|
||||
from crewai.utilities.paths import db_storage_path
|
||||
import os
|
||||
|
||||
# Connect to CrewAI's knowledge ChromaDB
|
||||
knowledge_path = os.path.join(db_storage_path(), "knowledge")
|
||||
|
||||
if os.path.exists(knowledge_path):
|
||||
client = chromadb.PersistentClient(path=knowledge_path)
|
||||
collections = client.list_collections()
|
||||
|
||||
print("Knowledge Collections:")
|
||||
for collection in collections:
|
||||
print(f" - {collection.name}: {collection.count()} documents")
|
||||
|
||||
# Sample a few documents to verify content
|
||||
if collection.count() > 0:
|
||||
sample = collection.peek(limit=2)
|
||||
print(f" Sample content: {sample['documents'][0][:100]}...")
|
||||
else:
|
||||
print("No knowledge storage found")
|
||||
```
|
||||
|
||||
#### 지식 처리 확인
|
||||
```python
|
||||
from crewai.knowledge.source.string_knowledge_source import StringKnowledgeSource
|
||||
|
||||
# Create a test knowledge source
|
||||
test_source = StringKnowledgeSource(
|
||||
content="Test knowledge content for debugging",
|
||||
chunk_size=100, # Small chunks for testing
|
||||
chunk_overlap=20
|
||||
)
|
||||
|
||||
# Check chunking behavior
|
||||
print(f"Original content length: {len(test_source.content)}")
|
||||
print(f"Chunk size: {test_source.chunk_size}")
|
||||
print(f"Chunk overlap: {test_source.chunk_overlap}")
|
||||
|
||||
# Process and inspect chunks
|
||||
test_source.add()
|
||||
print(f"Number of chunks created: {len(test_source.chunks)}")
|
||||
for i, chunk in enumerate(test_source.chunks[:3]): # Show first 3 chunks
|
||||
print(f"Chunk {i+1}: {chunk[:50]}...")
|
||||
```
|
||||
|
||||
### 일반적인 Knowledge Storage 문제
|
||||
|
||||
**"파일을 찾을 수 없음" 오류:**
|
||||
```python
|
||||
# Ensure files are in the correct location
|
||||
from crewai.utilities.constants import KNOWLEDGE_DIRECTORY
|
||||
import os
|
||||
|
||||
knowledge_dir = KNOWLEDGE_DIRECTORY # Usually "knowledge"
|
||||
file_path = os.path.join(knowledge_dir, "your_file.pdf")
|
||||
|
||||
if not os.path.exists(file_path):
|
||||
print(f"File not found: {file_path}")
|
||||
print(f"Current working directory: {os.getcwd()}")
|
||||
print(f"Expected knowledge directory: {os.path.abspath(knowledge_dir)}")
|
||||
```
|
||||
|
||||
**"Embedding dimension mismatch" 오류:**
|
||||
```python
|
||||
# This happens when switching embedding providers
|
||||
# Reset knowledge storage to clear old embeddings
|
||||
crew.reset_memories(command_type='knowledge')
|
||||
|
||||
# Or use consistent embedding providers
|
||||
crew = Crew(
|
||||
agents=[...],
|
||||
tasks=[...],
|
||||
knowledge_sources=[...],
|
||||
embedder={"provider": "openai", "config": {"model": "text-embedding-3-small"}}
|
||||
)
|
||||
```
|
||||
|
||||
**"ChromaDB permission denied" 오류:**
|
||||
```bash
|
||||
# Fix storage permissions
|
||||
chmod -R 755 ~/.local/share/CrewAI/
|
||||
```
|
||||
|
||||
**Knowledge가 여러 번 실행 시 유지되지 않음:**
|
||||
```python
|
||||
# Verify storage location consistency
|
||||
import os
|
||||
from crewai.utilities.paths import db_storage_path
|
||||
|
||||
print("CREWAI_STORAGE_DIR:", os.getenv("CREWAI_STORAGE_DIR"))
|
||||
print("Computed storage path:", db_storage_path())
|
||||
print("Knowledge path:", os.path.join(db_storage_path(), "knowledge"))
|
||||
```
|
||||
|
||||
### 지식 초기화 명령어
|
||||
|
||||
```python
|
||||
# Reset only agent-specific knowledge
|
||||
crew.reset_memories(command_type='agent_knowledge')
|
||||
|
||||
# Reset both crew and agent knowledge
|
||||
crew.reset_memories(command_type='knowledge')
|
||||
|
||||
# CLI commands
|
||||
# crewai reset-memories --agent-knowledge # Agent knowledge only
|
||||
# crewai reset-memories --knowledge # All knowledge
|
||||
```
|
||||
|
||||
### 지식 초기화
|
||||
|
||||
CrewAI에 저장된 지식을 초기화해야 하는 경우, `crewai reset-memories` 명령어를 `--knowledge` 옵션과 함께 사용할 수 있습니다.
|
||||
|
||||
```bash Command
|
||||
crewai reset-memories --knowledge
|
||||
```
|
||||
|
||||
이 기능은 지식 소스를 업데이트했고, 에이전트들이 최신 정보를 사용하도록 보장하고 싶을 때 유용합니다.
|
||||
|
||||
## 베스트 프랙티스
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="콘텐츠 구성">
|
||||
- 콘텐츠 유형에 맞는 적절한 청크 크기를 유지하세요
|
||||
- 컨텍스트 보존을 위해 콘텐츠 중복을 고려하세요
|
||||
- 관련 정보를 별도의 지식 소스로 체계화하세요
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="성능 팁">
|
||||
- 콘텐츠의 복잡성에 따라 청크 크기를 조정하세요
|
||||
- 적절한 임베딩 모델을 설정하세요
|
||||
- 더 빠른 처리를 위해 로컬 임베딩 프로바이더 사용을 고려하세요
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="원타임 지식">
|
||||
- CrewAI에서 제공하는 일반적인 파일 구조에서는 kickoff가 트리거될 때마다 knowledge 소스가 임베딩됩니다.
|
||||
- knowledge 소스가 크면, 매번 동일한 데이터가 임베딩되어 비효율성과 지연이 발생합니다.
|
||||
- 이를 해결하려면 knowledge_sources 파라미터 대신 knowledge 파라미터를 직접 초기화하세요.
|
||||
- 전체 아이디어를 얻으려면 이 이슈를 참고하세요 [Github Issue](https://github.com/crewAIInc/crewAI/issues/2755)
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="지식 관리">
|
||||
- 역할별 정보에는 agent 레벨의 knowledge를 사용하세요
|
||||
- 모든 agent가 필요로 하는 공유 정보에는 crew 레벨의 knowledge를 사용하세요
|
||||
- 서로 다른 임베딩 전략이 필요하다면 agent 레벨에서 embedder를 설정하세요
|
||||
- agent 역할을 설명적으로 유지하여 일관된 콜렉션 이름을 사용하세요
|
||||
- kickoff 후 agent.knowledge를 확인하여 knowledge 초기화를 테스트하세요
|
||||
- 지식이 저장되는 위치를 모니터링하여 storage 위치를 파악하세요
|
||||
- 올바른 명령 유형을 사용하여 적절하게 knowledge를 초기화(리셋)하세요
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="프로덕션 환경 베스트 프랙티스">
|
||||
- 프로덕션에서는 `CREWAI_STORAGE_DIR`를 지정된 위치로 설정하세요
|
||||
- LLM 구성과 맞도록 임베딩 프로바이더를 명확히 선택하고, API 키 충돌을 방지하세요
|
||||
- 문서가 추가될수록 knowledge storage 용량을 모니터링하세요
|
||||
- 도메인 또는 목적에 따라 knowledge 소스를 콜렉션 이름으로 체계화하세요
|
||||
- 지식 디렉터리를 백업 및 배포 전략에 포함시키세요
|
||||
- knowledge 파일과 storage 디렉터리에 적절한 파일 권한을 부여하세요
|
||||
- API 키와 민감한 설정에는 환경 변수를 사용하세요
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
956
docs/ko/concepts/llms.mdx
Normal file
@@ -0,0 +1,956 @@
|
||||
---
|
||||
title: 'LLMs'
|
||||
description: 'CrewAI 프로젝트에서 대형 언어 모델(LLM)을 구성하고 사용하는 방법에 대한 종합 안내서'
|
||||
icon: 'microchip-ai'
|
||||
---
|
||||
|
||||
## 개요
|
||||
|
||||
CrewAI는 LiteLLM을 통해 다양한 LLM 제공업체와 통합되어, 특정 사용 사례에 맞는 올바른 모델을 선택할 수 있는 유연성을 제공합니다. 이 가이드는 CrewAI 프로젝트에서 다양한 LLM 제공업체를 구성하고 사용하는 방법을 이해하는 데 도움이 될 것입니다.
|
||||
|
||||
## LLM이란 무엇인가요?
|
||||
|
||||
Large Language Models(LLM)는 CrewAI 에이전트의 핵심 지능입니다. 에이전트가 문맥을 이해하고, 결정을 내리며, 인간과 유사한 응답을 생성할 수 있도록 합니다. 알아두어야 할 내용은 다음과 같습니다:
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card title="LLM 기본" icon="brain">
|
||||
Large Language Models는 방대한 양의 텍스트 데이터로 학습된 AI 시스템입니다. CrewAI 에이전트의 지능을 구동하여, 인간과 유사한 텍스트를 이해하고 생성할 수 있도록 합니다.
|
||||
</Card>
|
||||
<Card title="컨텍스트 윈도우" icon="window">
|
||||
컨텍스트 윈도우는 LLM이 한 번에 처리할 수 있는 텍스트 양을 결정합니다. 더 큰 윈도우(예: 128K 토큰)는 더 많은 문맥을 다룰 수 있지만, 비용과 속도 면에서 더 부담이 될 수 있습니다.
|
||||
</Card>
|
||||
<Card title="Temperature" icon="temperature-three-quarters">
|
||||
Temperature(0.0에서 1.0)는 응답의 무작위성을 조절합니다. 낮은 값(예: 0.2)은 더 집중적이고 결정적인 결과를, 높은 값(예: 0.8)은 창의성과 다양성을 높입니다.
|
||||
</Card>
|
||||
<Card title="제공자 선택" icon="server">
|
||||
각 LLM 제공자(예: OpenAI, Anthropic, Google)는 다양한 기능, 가격, 특성을 가진 모델을 제공합니다. 정확성, 속도, 비용 등 요구 사항에 따라 선택하세요.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
## LLM 설정하기
|
||||
|
||||
CrewAI 코드 내에는 사용할 모델을 지정할 수 있는 여러 위치가 있습니다. 모델을 지정한 후에는 사용하는 각 모델 제공자에 대한 설정(예: API 키)을 제공해야 합니다. 각 제공자에 맞는 [제공자 설정 예제](#provider-configuration-examples) 섹션을 참고하세요.
|
||||
|
||||
<Tabs>
|
||||
<Tab title="1. 환경 변수">
|
||||
가장 간단하게 시작할 수 있는 방법입니다. `.env` 파일이나 앱 코드에서 환경 변수로 직접 모델을 설정할 수 있습니다. `crewai create`를 사용해 프로젝트를 부트스트랩했다면 이미 설정되어 있을 수 있습니다.
|
||||
|
||||
```bash .env
|
||||
MODEL=model-id # e.g. gpt-4o, gemini-2.0-flash, claude-3-sonnet-...
|
||||
|
||||
# 반드시 여기에서 API 키도 설정하세요. 아래 제공자
|
||||
# 섹션을 참고하세요.
|
||||
```
|
||||
|
||||
<Warning>
|
||||
API 키를 절대 버전 관리 시스템에 커밋하지 마세요. 환경 파일(.env)이나 시스템의 비밀 관리 기능을 사용하세요.
|
||||
</Warning>
|
||||
</Tab>
|
||||
<Tab title="2. YAML 구성">
|
||||
에이전트 구성을 정의하는 YAML 파일을 만드세요. 이 방법은 버전 관리와 팀 협업에 적합합니다:
|
||||
|
||||
```yaml agents.yaml {6}
|
||||
researcher:
|
||||
role: Research Specialist
|
||||
goal: Conduct comprehensive research and analysis
|
||||
backstory: A dedicated research professional with years of experience
|
||||
verbose: true
|
||||
llm: provider/model-id # e.g. openai/gpt-4o, google/gemini-2.0-flash, anthropic/claude...
|
||||
# (아래 제공자 구성 예제 참고)
|
||||
```
|
||||
|
||||
<Info>
|
||||
YAML 구성의 장점:
|
||||
- 에이전트 설정을 버전 관리할 수 있습니다.
|
||||
- 다양한 모델 간 전환이 쉽습니다.
|
||||
- 팀원들과 구성을 공유할 수 있습니다.
|
||||
- 모델 선택과 목적을 문서화할 수 있습니다.
|
||||
</Info>
|
||||
</Tab>
|
||||
<Tab title="3. 직접 코드 작성">
|
||||
최대한 유연하게 LLM을 Python 코드에서 직접 구성할 수 있습니다:
|
||||
|
||||
```python {4,8}
|
||||
from crewai import LLM
|
||||
|
||||
# 기본 설정
|
||||
llm = LLM(model="model-id-here") # gpt-4o, gemini-2.0-flash, anthropic/claude...
|
||||
|
||||
# 자세한 파라미터로 고급 설정
|
||||
llm = LLM(
|
||||
model="model-id-here", # gpt-4o, gemini-2.0-flash, anthropic/claude...
|
||||
temperature=0.7, # 더욱 창의적인 결과를 원할 때 높게 설정
|
||||
timeout=120, # 응답을 기다릴 최대 초
|
||||
max_tokens=4000, # 응답의 최대 길이
|
||||
top_p=0.9, # 누클리어스 샘플링 파라미터
|
||||
frequency_penalty=0.1 , # 반복 줄이기
|
||||
presence_penalty=0.1, # 주제 다양성 높이기
|
||||
response_format={"type": "json"}, # 구조화된 출력용
|
||||
seed=42 # 결과 재현성 확보용
|
||||
)
|
||||
```
|
||||
|
||||
<Info>
|
||||
파라미터 설명:
|
||||
- `temperature`: 랜덤성 제어 (0.0-1.0)
|
||||
- `timeout`: 응답 대기 최대 시간
|
||||
- `max_tokens`: 응답 길이 제한
|
||||
- `top_p`: 샘플링 시 temperature의 대체값
|
||||
- `frequency_penalty`: 단어 반복 감소
|
||||
- `presence_penalty`: 새로운 주제 생성 유도
|
||||
- `response_format`: 출력 구조 지정
|
||||
- `seed`: 일관된 출력 보장
|
||||
</Info>
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
## 공급자 구성 예시
|
||||
|
||||
CrewAI는 고유한 기능, 인증 방법, 모델 역량을 제공하는 다양한 LLM 공급자를 지원합니다.
|
||||
이 섹션에서는 프로젝트의 요구에 가장 적합한 LLM을 선택, 구성, 최적화하는 데 도움이 되는 자세한 예시를 제공합니다.
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="OpenAI">
|
||||
`.env` 파일에 다음 환경 변수를 설정하십시오:
|
||||
|
||||
```toml Code
|
||||
# Required
|
||||
OPENAI_API_KEY=sk-...
|
||||
|
||||
# Optional
|
||||
OPENAI_API_BASE=<custom-base-url>
|
||||
OPENAI_ORGANIZATION=<your-org-id>
|
||||
```
|
||||
|
||||
CrewAI 프로젝트에서의 예시 사용법:
|
||||
```python Code
|
||||
from crewai import LLM
|
||||
|
||||
llm = LLM(
|
||||
model="openai/gpt-4", # call model by provider/model_name
|
||||
temperature=0.8,
|
||||
max_tokens=150,
|
||||
top_p=0.9,
|
||||
frequency_penalty=0.1,
|
||||
presence_penalty=0.1,
|
||||
stop=["END"],
|
||||
seed=42
|
||||
)
|
||||
```
|
||||
|
||||
OpenAI는 다양한 모델과 기능을 제공하는 대표적인 LLM 공급자 중 하나입니다.
|
||||
|
||||
| 모델 | 컨텍스트 윈도우 | 최적 용도 |
|
||||
|-------------------|-------------------|-----------------------------------------------|
|
||||
| GPT-4 | 8,192 토큰 | 고정확도 작업, 복잡한 추론 |
|
||||
| GPT-4 Turbo | 128,000 토큰 | 장문 콘텐츠, 문서 분석 |
|
||||
| GPT-4o & GPT-4o-mini | 128,000 토큰 | 비용 효율적인 대용량 컨텍스트 처리 |
|
||||
| o3-mini | 200,000 토큰 | 빠른 추론, 복잡한 추론 |
|
||||
| o1-mini | 128,000 토큰 | 빠른 추론, 복잡한 추론 |
|
||||
| o1-preview | 128,000 토큰 | 빠른 추론, 복잡한 추론 |
|
||||
| o1 | 200,000 토큰 | 빠른 추론, 복잡한 추론 |
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="Meta-Llama">
|
||||
Meta의 Llama API는 Meta의 대형 언어 모델 패밀리 접근을 제공합니다.
|
||||
API는 [Meta Llama API](https://llama.developer.meta.com?utm_source=partner-crewai&utm_medium=website)에서 사용할 수 있습니다.
|
||||
`.env` 파일에 다음 환경 변수를 설정하십시오:
|
||||
|
||||
```toml Code
|
||||
# Meta Llama API Key Configuration
|
||||
LLAMA_API_KEY=LLM|your_api_key_here
|
||||
```
|
||||
|
||||
CrewAI 프로젝트에서의 예시 사용법:
|
||||
```python Code
|
||||
from crewai import LLM
|
||||
|
||||
# Meta Llama LLM 초기화
|
||||
llm = LLM(
|
||||
model="meta_llama/Llama-4-Scout-17B-16E-Instruct-FP8",
|
||||
temperature=0.8,
|
||||
stop=["END"],
|
||||
seed=42
|
||||
)
|
||||
```
|
||||
|
||||
https://llama.developer.meta.com/docs/models/ 에 기재된 모든 모델이 지원됩니다.
|
||||
|
||||
| 모델 ID | 입력 컨텍스트 길이 | 출력 컨텍스트 길이 | 입력 모달리티 | 출력 모달리티 |
|
||||
| ------- | ------------------ | ------------------ | ---------------- | ---------------- |
|
||||
| `meta_llama/Llama-4-Scout-17B-16E-Instruct-FP8` | 128k | 4028 | 텍스트, 이미지 | 텍스트 |
|
||||
| `meta_llama/Llama-4-Maverick-17B-128E-Instruct-FP8` | 128k | 4028 | 텍스트, 이미지 | 텍스트 |
|
||||
| `meta_llama/Llama-3.3-70B-Instruct` | 128k | 4028 | 텍스트 | 텍스트 |
|
||||
| `meta_llama/Llama-3.3-8B-Instruct` | 128k | 4028 | 텍스트 | 텍스트 |
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="Anthropic">
|
||||
```toml Code
|
||||
# Required
|
||||
ANTHROPIC_API_KEY=sk-ant-...
|
||||
|
||||
# Optional
|
||||
ANTHROPIC_API_BASE=<custom-base-url>
|
||||
```
|
||||
|
||||
CrewAI 프로젝트에서의 예시 사용법:
|
||||
```python Code
|
||||
llm = LLM(
|
||||
model="anthropic/claude-3-sonnet-20240229-v1:0",
|
||||
temperature=0.7
|
||||
)
|
||||
```
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="Google (Gemini API)">
|
||||
`.env` 파일에 API 키를 설정하십시오. 키가 필요하거나 기존 키를 찾으려면 [AI Studio](https://aistudio.google.com/apikey)를 확인하세요.
|
||||
|
||||
```toml .env
|
||||
# https://ai.google.dev/gemini-api/docs/api-key
|
||||
GEMINI_API_KEY=<your-api-key>
|
||||
```
|
||||
|
||||
CrewAI 프로젝트에서의 예시 사용법:
|
||||
```python Code
|
||||
from crewai import LLM
|
||||
|
||||
llm = LLM(
|
||||
model="gemini/gemini-2.0-flash",
|
||||
temperature=0.7,
|
||||
)
|
||||
```
|
||||
|
||||
### Gemini 모델
|
||||
|
||||
Google은 다양한 용도에 최적화된 강력한 모델을 제공합니다.
|
||||
|
||||
| 모델 | 컨텍스트 윈도우 | 최적 용도 |
|
||||
|----------------------------------|-----------------|------------------------------------------------------------------------|
|
||||
| gemini-2.5-flash-preview-04-17 | 1M 토큰 | 적응형 사고, 비용 효율성 |
|
||||
| gemini-2.5-pro-preview-05-06 | 1M 토큰 | 향상된 사고 및 추론, 멀티모달 이해, 고급 코딩 등 |
|
||||
| gemini-2.0-flash | 1M 토큰 | 차세대 기능, 속도, 사고, 실시간 스트리밍 |
|
||||
| gemini-2.0-flash-lite | 1M 토큰 | 비용 효율성과 낮은 대기 시간 |
|
||||
| gemini-1.5-flash | 1M 토큰 | 밸런스 잡힌 멀티모달 모델, 대부분의 작업에 적합 |
|
||||
| gemini-1.5-flash-8B | 1M 토큰 | 가장 빠르고, 비용 효율적, 고빈도 작업에 적합 |
|
||||
| gemini-1.5-pro | 2M 토큰 | 최고의 성능, 논리적 추론, 코딩, 창의적 협업 등 다양한 추론 작업에 적합 |
|
||||
|
||||
전체 모델 목록은 [Gemini 모델 문서](https://ai.google.dev/gemini-api/docs/models)에서 확인할 수 있습니다.
|
||||
|
||||
### Gemma
|
||||
|
||||
Gemini API를 통해 Google 인프라에서 호스팅되는 [Gemma 모델](https://ai.google.dev/gemma/docs)도 API 키를 이용해 사용할 수 있습니다.
|
||||
|
||||
| 모델 | 컨텍스트 윈도우 |
|
||||
|----------------|----------------|
|
||||
| gemma-3-1b-it | 32k 토큰 |
|
||||
| gemma-3-4b-it | 32k 토큰 |
|
||||
| gemma-3-12b-it | 32k 토큰 |
|
||||
| gemma-3-27b-it | 128k 토큰 |
|
||||
|
||||
</Accordion>
|
||||
<Accordion title="Google (Vertex AI)">
|
||||
Google Cloud Console에서 자격증명을 받아 JSON 파일로 저장한 후, 다음 코드로 로드하세요:
|
||||
```python Code
|
||||
import json
|
||||
|
||||
file_path = 'path/to/vertex_ai_service_account.json'
|
||||
|
||||
# Load the JSON file
|
||||
with open(file_path, 'r') as file:
|
||||
vertex_credentials = json.load(file)
|
||||
|
||||
# Convert the credentials to a JSON string
|
||||
vertex_credentials_json = json.dumps(vertex_credentials)
|
||||
```
|
||||
|
||||
CrewAI 프로젝트에서의 예시 사용법:
|
||||
```python Code
|
||||
from crewai import LLM
|
||||
|
||||
llm = LLM(
|
||||
model="gemini-1.5-pro-latest", # or vertex_ai/gemini-1.5-pro-latest
|
||||
temperature=0.7,
|
||||
vertex_credentials=vertex_credentials_json
|
||||
)
|
||||
```
|
||||
|
||||
Google은 다양한 용도에 최적화된 강력한 모델들을 제공합니다:
|
||||
|
||||
| 모델 | 컨텍스트 윈도우 | 최적 용도 |
|
||||
|----------------------------------|-----------------|------------------------------------------------------------------------|
|
||||
| gemini-2.5-flash-preview-04-17 | 1M 토큰 | 적응형 사고, 비용 효율성 |
|
||||
| gemini-2.5-pro-preview-05-06 | 1M 토큰 | 향상된 사고 및 추론, 멀티모달 이해, 고급 코딩 등 |
|
||||
| gemini-2.0-flash | 1M 토큰 | 차세대 기능, 속도, 사고, 실시간 스트리밍 |
|
||||
| gemini-2.0-flash-lite | 1M 토큰 | 비용 효율성과 낮은 대기 시간 |
|
||||
| gemini-1.5-flash | 1M 토큰 | 밸런스 잡힌 멀티모달 모델, 대부분의 작업에 적합 |
|
||||
| gemini-1.5-flash-8B | 1M 토큰 | 가장 빠르고, 비용 효율적, 고빈도 작업에 적합 |
|
||||
| gemini-1.5-pro | 2M 토큰 | 최고의 성능, 논리적 추론, 코딩, 창의적 협업 등 다양한 추론 작업에 적합 |
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="Azure">
|
||||
```toml Code
|
||||
# Required
|
||||
AZURE_API_KEY=<your-api-key>
|
||||
AZURE_API_BASE=<your-resource-url>
|
||||
AZURE_API_VERSION=<api-version>
|
||||
|
||||
# Optional
|
||||
AZURE_AD_TOKEN=<your-azure-ad-token>
|
||||
AZURE_API_TYPE=<your-azure-api-type>
|
||||
```
|
||||
|
||||
CrewAI 프로젝트에서의 예시 사용법:
|
||||
```python Code
|
||||
llm = LLM(
|
||||
model="azure/gpt-4",
|
||||
api_version="2023-05-15"
|
||||
)
|
||||
```
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="AWS Bedrock">
|
||||
```toml Code
|
||||
AWS_ACCESS_KEY_ID=<your-access-key>
|
||||
AWS_SECRET_ACCESS_KEY=<your-secret-key>
|
||||
AWS_DEFAULT_REGION=<your-region>
|
||||
```
|
||||
|
||||
CrewAI 프로젝트에서의 예시 사용법:
|
||||
```python Code
|
||||
llm = LLM(
|
||||
model="bedrock/anthropic.claude-3-sonnet-20240229-v1:0"
|
||||
)
|
||||
```
|
||||
|
||||
Amazon Bedrock을 사용하기 전에, 환경에 boto3가 설치되어 있는지 확인하십시오.
|
||||
|
||||
[Amazon Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/models-regions.html)은 대표적인 AI 회사들의 여러 파운데이션 모델에 통합 API를 통해 접근할 수 있는 매니지드 서비스로, 안전하고 책임감 있는 AI 응용프로그램 개발을 가능하게 해줍니다.
|
||||
|
||||
| 모델 | 컨텍스트 윈도우 | 최적 용도 |
|
||||
|-----------------------------|--------------------|------------------------------------------------------------------------|
|
||||
| Amazon Nova Pro | 최대 300k 토큰 | 다양한 작업에서 정확성, 속도, 비용을 균형 있게 제공하는 고성능 모델 |
|
||||
| Amazon Nova Micro | 최대 128k 토큰 | 텍스트 전용, 최소 레이턴시 응답에 최적화된 비용 효율적 고성능 모델 |
|
||||
| Amazon Nova Lite | 최대 300k 토큰 | 이미지, 비디오, 텍스트를 아우르는 실시간 멀티모달 처리 |
|
||||
| Claude 3.7 Sonnet | 최대 128k 토큰 | 복잡한 추론, 코딩 및 AI 에이전트에 적합한 고성능 모델 |
|
||||
| Claude 3.5 Sonnet v2 | 최대 200k 토큰 | 소프트웨어 공학, 에이전트 기능, 컴퓨터 상호작용에 특화된 최신 모델 |
|
||||
| Claude 3.5 Sonnet | 최대 200k 토큰 | 다양한 작업에 탁월한 지능 및 추론 제공, 최적의 속도·비용 모델 |
|
||||
| Claude 3.5 Haiku | 최대 200k 토큰 | 빠르고 컴팩트한 멀티모달 모델, 신속하고 자연스러운 대화에 최적 |
|
||||
| Claude 3 Sonnet | 최대 200k 토큰 | 지능과 속도의 균형 잡힌 멀티모달 모델, 대규모 배포에 적합 |
|
||||
| Claude 3 Haiku | 최대 200k 토큰 | 컴팩트한 고속 멀티모달 모델, 신속한 응답과 자연스러운 대화형 상호작용 |
|
||||
| Claude 3 Opus | 최대 200k 토큰 | 인간 같은 추론과 우수한 문맥 이해로 복잡한 작업 수행 |
|
||||
| Claude 2.1 | 최대 200k 토큰 | 확장된 컨텍스트, 신뢰도 개선, 로봇화 감소, 장문 및 RAG 적용에 적합 |
|
||||
| Claude | 최대 100k 토큰 | 복잡한 대화, 창의적 콘텐츠 생성, 정교한 지시 수행에 탁월 |
|
||||
| Claude Instant | 최대 100k 토큰 | 일상 대화, 분석, 요약, 문서 Q&A 등 빠르고 비용 효율적인 모델 |
|
||||
| Llama 3.1 405B Instruct | 최대 128k 토큰 | 챗봇, 코딩, 도메인 특화 작업을 위한 합성 데이터 생성 및 추론용 첨단 LLM |
|
||||
| Llama 3.1 70B Instruct | 최대 128k 토큰 | 복잡한 대화, 우수한 문맥 및 추론, 텍스트 생성 능력 강화 |
|
||||
| Llama 3.1 8B Instruct | 최대 128k 토큰 | 우수한 언어 이해, 추론, 텍스트 생성 기능의 최첨단 모델 |
|
||||
| Llama 3 70B Instruct | 최대 8k 토큰 | 복잡한 대화, 우수한 문맥 및 추론, 텍스트 생성 기능 강화 |
|
||||
| Llama 3 8B Instruct | 최대 8k 토큰 | 첨단 언어 이해력, 추론, 텍스트 생성이 가능한 최첨단 LLM |
|
||||
| Titan Text G1 - Lite | 최대 4k 토큰 | 영어 과제 및 요약, 콘텐츠 생성에 최적화된 경량 비용 효율적 모델 |
|
||||
| Titan Text G1 - Express | 최대 8k 토큰 | 일반 언어, 대화, RAG 지원, 영어 및 100여 개 언어 지원 |
|
||||
| Cohere Command | 최대 4k 토큰 | 사용자의 명령 수행, 실질적 기업 솔루션 제공에 특화된 모델 |
|
||||
| Jurassic-2 Mid | 최대 8,191 토큰 | 다양한 언어 과제(Q&A, 요약, 생성 등)에 적합한 품질-비용 균형 모델 |
|
||||
| Jurassic-2 Ultra | 최대 8,191 토큰 | 고급 텍스트 생성과 이해, 분석 및 콘텐츠 제작 등 복잡한 작업 수행 |
|
||||
| Jamba-Instruct | 최대 256k 토큰 | 비용 효율적인 대용량 문맥 창작, 요약, Q&A에 최적화된 모델 |
|
||||
| Mistral 7B Instruct | 최대 32k 토큰 | 명령을 따르고, 요청을 완성하며, 창의적 텍스트를 생성하는 LLM |
|
||||
| Mistral 8x7B Instruct | 최대 32k 토큰 | 명령 및 요청 완성, 창의적 텍스트 생성이 가능한 MOE LLM |
|
||||
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="Amazon SageMaker">
|
||||
```toml Code
|
||||
AWS_ACCESS_KEY_ID=<your-access-key>
|
||||
AWS_SECRET_ACCESS_KEY=<your-secret-key>
|
||||
AWS_DEFAULT_REGION=<your-region>
|
||||
```
|
||||
|
||||
CrewAI 프로젝트에서의 예시 사용법:
|
||||
```python Code
|
||||
llm = LLM(
|
||||
model="sagemaker/<my-endpoint>"
|
||||
)
|
||||
```
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="Mistral">
|
||||
`.env` 파일에 다음 환경 변수를 설정하십시오:
|
||||
```toml Code
|
||||
MISTRAL_API_KEY=<your-api-key>
|
||||
```
|
||||
|
||||
CrewAI 프로젝트에서의 예시 사용법:
|
||||
```python Code
|
||||
llm = LLM(
|
||||
model="mistral/mistral-large-latest",
|
||||
temperature=0.7
|
||||
)
|
||||
```
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="Nvidia NIM">
|
||||
`.env` 파일에 다음 환경 변수를 설정하십시오:
|
||||
```toml Code
|
||||
NVIDIA_API_KEY=<your-api-key>
|
||||
```
|
||||
|
||||
CrewAI 프로젝트에서의 예시 사용법:
|
||||
```python Code
|
||||
llm = LLM(
|
||||
model="nvidia_nim/meta/llama3-70b-instruct",
|
||||
temperature=0.7
|
||||
)
|
||||
```
|
||||
|
||||
Nvidia NIM은 일반 목적 작업부터 특수 목적 응용까지 다양한 용도를 위한 모델 제품군을 제공합니다.
|
||||
|
||||
| 모델 | 컨텍스트 윈도우 | 최적 용도 |
|
||||
|------------------------------------------------------------------------|----------------|---------------------------------------------------------------------|
|
||||
| nvidia/mistral-nemo-minitron-8b-8k-instruct | 8,192 토큰 | 챗봇, 가상 비서, 콘텐츠 생성을 위한 최신형 소형 언어 모델 |
|
||||
| nvidia/nemotron-4-mini-hindi-4b-instruct | 4,096 토큰 | 힌디-영어 SLM, 힌디 언어 전용 온디바이스 추론 |
|
||||
| nvidia/llama-3.1-nemotron-70b-instruct | 128k 토큰 | 더욱 도움이 되는 답변을 위해 커스터마이즈됨 |
|
||||
| nvidia/llama3-chatqa-1.5-8b | 128k 토큰 | 챗봇, 검색엔진용 맥락 인식 응답 생성에 탁월한 고급 LLM |
|
||||
| nvidia/llama3-chatqa-1.5-70b | 128k 토큰 | 챗봇, 검색엔진용 맥락 인식 응답 생성에 탁월한 고급 LLM |
|
||||
| nvidia/vila | 128k 토큰 | 텍스트/이미지/비디오 이해 및 정보성 응답 생성을 지원하는 멀티모달 모델 |
|
||||
| nvidia/neva-22 | 4,096 토큰 | 텍스트/이미지 이해 및 정보성 응답 생성을 지원하는 멀티모달 모델 |
|
||||
| nvidia/nemotron-mini-4b-instruct | 8,192 토큰 | 일반 목적 작업 |
|
||||
| nvidia/usdcode-llama3-70b-instruct | 128k 토큰 | OpenUSD 지식 질의 응답, USD-Python 코드 생성이 가능한 최신 LLM |
|
||||
| nvidia/nemotron-4-340b-instruct | 4,096 토큰 | 실제 데이터를 모사하는 다양한 합성 데이터 생성 |
|
||||
| meta/codellama-70b | 100k 토큰 | 자연어 → 코드 및 코드 → 자연어 전환 가능한 LLM |
|
||||
| meta/llama2-70b | 4,096 토큰 | 텍스트, 코드 생성에 최적화된 최첨단 대형 언어 모델 |
|
||||
| meta/llama3-8b-instruct | 8,192 토큰 | 최첨단 언어 이해 및 추론, 텍스트 생성 기능 모델 |
|
||||
| meta/llama3-70b-instruct | 8,192 토큰 | 복잡한 대화, 우수한 문맥 및 추론, 텍스트 생성 |
|
||||
| meta/llama-3.1-8b-instruct | 128k 토큰 | 최첨단 언어 이해 및 추론, 텍스트 생성 기능의 첨단 모델 |
|
||||
| meta/llama-3.1-70b-instruct | 128k 토큰 | 복잡한 대화, 우수한 문맥 및 추론, 텍스트 생성 |
|
||||
| meta/llama-3.1-405b-instruct | 128k 토큰 | 챗봇, 코딩, 도메인 특화 작업 합성 데이터 생성 및 추론 |
|
||||
| meta/llama-3.2-1b-instruct | 128k 토큰 | 최첨단 소형 언어 이해, 추론, 텍스트 생성 모델 |
|
||||
| meta/llama-3.2-3b-instruct | 128k 토큰 | 최첨단 소형 언어 이해, 추론, 텍스트 생성 |
|
||||
| meta/llama-3.2-11b-vision-instruct | 128k 토큰 | 최첨단 소형 언어 이해, 추론, 텍스트 생성 |
|
||||
| meta/llama-3.2-90b-vision-instruct | 128k 토큰 | 최첨단 소형 언어 이해, 추론, 텍스트 생성 |
|
||||
| google/gemma-7b | 8,192 토큰 | 문자열의 이해, 변환, 코드 생성을 지원하는 최첨단 텍스트 생성 모델 |
|
||||
| google/gemma-2b | 8,192 토큰 | 문자열의 이해, 변환, 코드 생성을 지원하는 최첨단 텍스트 생성 모델 |
|
||||
| google/codegemma-7b | 8,192 토큰 | 코드 생성 및 보완에 특화된 Google Gemma-7B 기반 모델 |
|
||||
| google/codegemma-1.1-7b | 8,192 토큰 | 코드 생성, 보완, 추론, 명령 수행에 강점을 가진 고급 프로그래밍 모델 |
|
||||
| google/recurrentgemma-2b | 8,192 토큰 | 긴 시퀀스 생성 시 빠른 추론을 가능케 하는 순환 아키텍처 LLM |
|
||||
| google/gemma-2-9b-it | 8,192 토큰 | 문자열의 이해, 변환, 코드 생성을 지원하는 최첨단 텍스트 생성 모델 |
|
||||
| google/gemma-2-27b-it | 8,192 토큰 | 문자열의 이해, 변환, 코드 생성을 지원하는 최첨단 텍스트 생성 모델 |
|
||||
| google/gemma-2-2b-it | 8,192 토큰 | 문자열의 이해, 변환, 코드 생성을 지원하는 최첨단 텍스트 생성 모델 |
|
||||
| google/deplot | 512 토큰 | 플롯 이미지를 표로 변환하는 원샷 비주얼 언어 이해 모델 |
|
||||
| google/paligemma | 8,192 토큰 | 텍스트, 이미지 입력 이해 및 정보성 응답 생성에 능한 비전 언어 모델 |
|
||||
| mistralai/mistral-7b-instruct-v0.2 | 32k 토큰 | 명령을 따르고, 요청을 완성하며, 창의적 텍스트 생성이 가능한 LLM |
|
||||
| mistralai/mixtral-8x7b-instruct-v0.1 | 8,192 토큰 | 명령 및 요청 완성, 창의 텍스트 생성이 가능한 MOE LLM |
|
||||
| mistralai/mistral-large | 4,096 토큰 | 실제 데이터 특성을 모방하는 다양한 합성 데이터 생성 |
|
||||
| mistralai/mixtral-8x22b-instruct-v0.1 | 8,192 토큰 | 실제 데이터 특성을 모방하는 다양한 합성 데이터 생성 |
|
||||
| mistralai/mistral-7b-instruct-v0.3 | 32k 토큰 | 명령을 따르고, 요청을 완성하며, 창의적 텍스트 생성이 가능한 LLM |
|
||||
| nv-mistralai/mistral-nemo-12b-instruct | 128k 토큰 | 추론, 코드, 다국어 작업에 적합한 최첨단 언어 모델; 단일 GPU에서 구동 |
|
||||
| mistralai/mamba-codestral-7b-v0.1 | 256k 토큰 | 광범위한 프로그래밍 언어 및 작업에서 코드 작성 및 상호작용 전용 모델 |
|
||||
| microsoft/phi-3-mini-128k-instruct | 128K 토큰 | 수학·논리 추론에 강한 경량 최신 공개 LLM |
|
||||
| microsoft/phi-3-mini-4k-instruct | 4,096 토큰 | 수학·논리 추론에 강한 경량 최신 공개 LLM |
|
||||
| microsoft/phi-3-small-8k-instruct | 8,192 토큰 | 수학·논리 추론에 강한 경량 최신 공개 LLM |
|
||||
| microsoft/phi-3-small-128k-instruct | 128K 토큰 | 수학·논리 추론에 강한 경량 최신 공개 LLM |
|
||||
| microsoft/phi-3-medium-4k-instruct | 4,096 토큰 | 수학·논리 추론에 강한 경량 최신 공개 LLM |
|
||||
| microsoft/phi-3-medium-128k-instruct | 128K 토큰 | 수학·논리 추론에 강한 경량 최신 공개 LLM |
|
||||
| microsoft/phi-3.5-mini-instruct | 128K 토큰 | 지연, 메모리/컴퓨트 한계 환경에서 AI 응용프로그램 구동 가능한 다국어 LLM |
|
||||
| microsoft/phi-3.5-moe-instruct | 128K 토큰 | 연산 효율적 콘텐츠 생성을 위한 Mixture of Experts 기반 첨단 LLM |
|
||||
| microsoft/kosmos-2 | 1,024 토큰 | 이미지의 시각적 요소 이해 및 추론을 위한 획기적 멀티모달 모델 |
|
||||
| microsoft/phi-3-vision-128k-instruct | 128k 토큰 | 이미지에서 고품질 추론이 가능한 최첨단 공개 멀티모달 모델 |
|
||||
| microsoft/phi-3.5-vision-instruct | 128k 토큰 | 이미지에서 고품질 추론이 가능한 최첨단 공개 멀티모달 모델 |
|
||||
| databricks/dbrx-instruct | 12k 토큰 | 언어 이해, 코딩, RAG에 최신 성능을 제공하는 범용 LLM |
|
||||
| snowflake/arctic | 1,024 토큰 | SQL 생성 및 코딩에 집중한 기업용 고효율 추론 모델 |
|
||||
| aisingapore/sea-lion-7b-instruct | 4,096 토큰 | 동남아 언어 및 문화 다양성을 반영하는 LLM |
|
||||
| ibm/granite-8b-code-instruct | 4,096 토큰 | 소프트웨어 프로그래밍 LLM, 코드 생성, 완성, 설명, 멀티턴 전환 |
|
||||
| ibm/granite-34b-code-instruct | 8,192 토큰 | 소프트웨어 프로그래밍 LLM, 코드 생성, 완성, 설명, 멀티턴 전환 |
|
||||
| ibm/granite-3.0-8b-instruct | 4,096 토큰 | RAG, 요약, 분류, 코드, 에이전틱AI 지원 첨단 소형 언어 모델 |
|
||||
| ibm/granite-3.0-3b-a800m-instruct | 4,096 토큰 | RAG, 요약, 엔터티 추출, 분류에 최적화된 고효율 Mixture of Experts 모델 |
|
||||
| mediatek/breeze-7b-instruct | 4,096 토큰 | 실제 데이터 특성을 모방하는 다양한 합성 데이터 생성 |
|
||||
| upstage/solar-10.7b-instruct | 4,096 토큰 | 지시 따르기, 추론, 수학 등에서 뛰어난 NLP 작업 수행 |
|
||||
| writer/palmyra-med-70b-32k | 32k 토큰 | 의료 분야에서 정확하고 문맥에 맞는 응답 생성에 선도적인 LLM |
|
||||
| writer/palmyra-med-70b | 32k 토큰 | 의료 분야에서 정확하고 문맥에 맞는 응답 생성에 선도적인 LLM |
|
||||
| writer/palmyra-fin-70b-32k | 32k 토큰 | 금융 분석, 보고, 데이터 처리에 특화된 LLM |
|
||||
| 01-ai/yi-large | 32k 토큰 | 영어, 중국어로 훈련, 챗봇 및 창의적 글쓰기 등 다양한 작업에 사용 |
|
||||
| deepseek-ai/deepseek-coder-6.7b-instruct | 2k 토큰 | 고급 코드 생성, 완성, 인필링 등의 기능을 제공하는 강력한 코딩 모델 |
|
||||
| rakuten/rakutenai-7b-instruct | 1,024 토큰 | 언어 이해, 추론, 텍스트 생성이 탁월한 최첨단 LLM |
|
||||
| rakuten/rakutenai-7b-chat | 1,024 토큰 | 언어 이해, 추론, 텍스트 생성이 탁월한 최첨단 LLM |
|
||||
| baichuan-inc/baichuan2-13b-chat | 4,096 토큰 | 중국어 및 영어 대화, 코딩, 수학, 지시 따르기, 퀴즈 풀이 지원 |
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="Local NVIDIA NIM Deployed using WSL2">
|
||||
|
||||
NVIDIA NIM을 이용하면 Windows 기기에서 WSL2(Windows Subsystem for Linux)를 통해 강력한 LLM을 로컬로 실행할 수 있습니다.
|
||||
이 방식은 Nvidia GPU를 활용하여 프라이빗하고, 안전하며, 비용 효율적인 AI 추론을 클라우드 서비스에 의존하지 않고 구현할 수 있습니다.
|
||||
데이터 프라이버시, 오프라인 기능이 필요한 개발, 테스트, 또는 프로덕션 환경에 최적입니다.
|
||||
|
||||
로컬 NVIDIA NIM 모델 설치 단계별 가이드는 다음과 같습니다:
|
||||
|
||||
1. [NVIDIA 홈페이지](https://docs.nvidia.com/nim/wsl2/latest/getting-started.html)의 설치 안내를 따르세요.
|
||||
|
||||
2. 로컬 모델을 설치합니다. Llama 3.1-8b는 [여기](https://build.nvidia.com/meta/llama-3_1-8b-instruct/deploy) 안내를 참조하세요.
|
||||
|
||||
3. crewai 로컬 모델을 구성하세요:
|
||||
|
||||
```python Code
|
||||
from crewai.llm import LLM
|
||||
|
||||
local_nvidia_nim_llm = LLM(
|
||||
model="openai/meta/llama-3.1-8b-instruct", # it's an openai-api compatible model
|
||||
base_url="http://localhost:8000/v1",
|
||||
api_key="<your_api_key|any text if you have not configured it>", # api_key is required, but you can use any text
|
||||
)
|
||||
|
||||
# 그런 다음 crew에서 사용할 수 있습니다:
|
||||
|
||||
@CrewBase
|
||||
class MyCrew():
|
||||
# ...
|
||||
|
||||
@agent
|
||||
def researcher(self) -> Agent:
|
||||
return Agent(
|
||||
config=self.agents_config['researcher'], # type: ignore[index]
|
||||
llm=local_nvidia_nim_llm
|
||||
)
|
||||
|
||||
# ...
|
||||
```
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="Groq">
|
||||
`.env` 파일에 다음 환경 변수를 설정하십시오:
|
||||
|
||||
```toml Code
|
||||
GROQ_API_KEY=<your-api-key>
|
||||
```
|
||||
|
||||
CrewAI 프로젝트에서의 예시 사용법:
|
||||
```python Code
|
||||
llm = LLM(
|
||||
model="groq/llama-3.2-90b-text-preview",
|
||||
temperature=0.7
|
||||
)
|
||||
```
|
||||
| 모델 | 컨텍스트 윈도우 | 최적 용도 |
|
||||
|-----------------|-------------------|----------------------------------|
|
||||
| Llama 3.1 70B/8B| 131,072 토큰 | 고성능, 대용량 문맥 작업 |
|
||||
| Llama 3.2 Series| 8,192 토큰 | 범용 작업 |
|
||||
| Mixtral 8x7B | 32,768 토큰 | 성능과 문맥의 균형 |
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="IBM watsonx.ai">
|
||||
`.env` 파일에 다음 환경 변수를 설정하십시오:
|
||||
```toml Code
|
||||
# Required
|
||||
WATSONX_URL=<your-url>
|
||||
WATSONX_APIKEY=<your-apikey>
|
||||
WATSONX_PROJECT_ID=<your-project-id>
|
||||
|
||||
# Optional
|
||||
WATSONX_TOKEN=<your-token>
|
||||
WATSONX_DEPLOYMENT_SPACE_ID=<your-space-id>
|
||||
```
|
||||
|
||||
CrewAI 프로젝트에서의 예시 사용법:
|
||||
```python Code
|
||||
llm = LLM(
|
||||
model="watsonx/meta-llama/llama-3-1-70b-instruct",
|
||||
base_url="https://api.watsonx.ai/v1"
|
||||
)
|
||||
```
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="Ollama (Local LLMs)">
|
||||
1. Ollama 설치: [ollama.ai](https://ollama.ai/)
|
||||
2. 모델 실행: `ollama run llama3`
|
||||
3. 구성:
|
||||
|
||||
```python Code
|
||||
llm = LLM(
|
||||
model="ollama/llama3:70b",
|
||||
base_url="http://localhost:11434"
|
||||
)
|
||||
```
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="Fireworks AI">
|
||||
`.env` 파일에 다음 환경 변수를 설정하십시오:
|
||||
```toml Code
|
||||
FIREWORKS_API_KEY=<your-api-key>
|
||||
```
|
||||
|
||||
CrewAI 프로젝트에서의 예시 사용법:
|
||||
```python Code
|
||||
llm = LLM(
|
||||
model="fireworks_ai/accounts/fireworks/models/llama-v3-70b-instruct",
|
||||
temperature=0.7
|
||||
)
|
||||
```
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="Perplexity AI">
|
||||
`.env` 파일에 다음 환경 변수를 설정하십시오:
|
||||
```toml Code
|
||||
PERPLEXITY_API_KEY=<your-api-key>
|
||||
```
|
||||
|
||||
CrewAI 프로젝트에서의 예시 사용법:
|
||||
```python Code
|
||||
llm = LLM(
|
||||
model="llama-3.1-sonar-large-128k-online",
|
||||
base_url="https://api.perplexity.ai/"
|
||||
)
|
||||
```
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="Hugging Face">
|
||||
`.env` 파일에 다음 환경 변수를 설정하십시오:
|
||||
```toml Code
|
||||
HF_TOKEN=<your-api-key>
|
||||
```
|
||||
|
||||
CrewAI 프로젝트에서의 예시 사용법:
|
||||
```python Code
|
||||
llm = LLM(
|
||||
model="huggingface/meta-llama/Meta-Llama-3.1-8B-Instruct"
|
||||
)
|
||||
```
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="SambaNova">
|
||||
`.env` 파일에 다음 환경 변수를 설정하십시오:
|
||||
|
||||
```toml Code
|
||||
SAMBANOVA_API_KEY=<your-api-key>
|
||||
```
|
||||
|
||||
CrewAI 프로젝트에서의 예시 사용법:
|
||||
```python Code
|
||||
llm = LLM(
|
||||
model="sambanova/Meta-Llama-3.1-8B-Instruct",
|
||||
temperature=0.7
|
||||
)
|
||||
```
|
||||
| 모델 | 컨텍스트 윈도우 | 최적 용도 |
|
||||
|-----------------|---------------------|--------------------------------------|
|
||||
| Llama 3.1 70B/8B| 최대 131,072 토큰 | 고성능, 대용량 문맥 작업 |
|
||||
| Llama 3.1 405B | 8,192 토큰 | 고성능, 높은 출력 품질 |
|
||||
| Llama 3.2 Series| 8,192 토큰 | 범용, 멀티모달 작업 |
|
||||
| Llama 3.3 70B | 최대 131,072 토큰 | 고성능, 높은 출력 품질 |
|
||||
| Qwen2 familly | 8,192 토큰 | 고성능, 높은 출력 품질 |
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="Cerebras">
|
||||
`.env` 파일에 다음 환경 변수를 설정하십시오:
|
||||
```toml Code
|
||||
# Required
|
||||
CEREBRAS_API_KEY=<your-api-key>
|
||||
```
|
||||
|
||||
CrewAI 프로젝트에서의 예시 사용법:
|
||||
```python Code
|
||||
llm = LLM(
|
||||
model="cerebras/llama3.1-70b",
|
||||
temperature=0.7,
|
||||
max_tokens=8192
|
||||
)
|
||||
```
|
||||
|
||||
<Info>
|
||||
Cerebras 특징:
|
||||
- 빠른 추론 속도
|
||||
- 경쟁력 있는 가격
|
||||
- 속도와 품질의 우수한 밸런스
|
||||
- 긴 컨텍스트 윈도우 지원
|
||||
</Info>
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="Open Router">
|
||||
`.env` 파일에 다음 환경 변수를 설정하십시오:
|
||||
```toml Code
|
||||
OPENROUTER_API_KEY=<your-api-key>
|
||||
```
|
||||
|
||||
CrewAI 프로젝트에서의 예시 사용법:
|
||||
```python Code
|
||||
llm = LLM(
|
||||
model="openrouter/deepseek/deepseek-r1",
|
||||
base_url="https://openrouter.ai/api/v1",
|
||||
api_key=OPENROUTER_API_KEY
|
||||
)
|
||||
```
|
||||
|
||||
<Info>
|
||||
Open Router 모델:
|
||||
- openrouter/deepseek/deepseek-r1
|
||||
- openrouter/deepseek/deepseek-chat
|
||||
</Info>
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="Nebius AI Studio">
|
||||
`.env` 파일에 다음 환경 변수를 설정하십시오:
|
||||
```toml Code
|
||||
NEBIUS_API_KEY=<your-api-key>
|
||||
```
|
||||
|
||||
CrewAI 프로젝트에서의 예시 사용법:
|
||||
```python Code
|
||||
llm = LLM(
|
||||
model="nebius/Qwen/Qwen3-30B-A3B"
|
||||
)
|
||||
```
|
||||
|
||||
<Info>
|
||||
Nebius AI Studio 특징:
|
||||
- 대규모 오픈소스 모델 보유
|
||||
- 높은 속도 제한
|
||||
- 경쟁력 있는 가격
|
||||
- 속도와 품질의 우수한 밸런스
|
||||
</Info>
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
## 스트리밍 응답
|
||||
|
||||
CrewAI는 LLM의 스트리밍 응답을 지원하여, 애플리케이션이 출력물을 생성되는 즉시 실시간으로 수신하고 처리할 수 있습니다.
|
||||
|
||||
<Tabs>
|
||||
<Tab title="기본 설정">
|
||||
LLM을 초기화할 때 `stream` 파라미터를 `True`로 설정하여 스트리밍을 활성화합니다:
|
||||
|
||||
```python
|
||||
from crewai import LLM
|
||||
|
||||
# 스트리밍이 활성화된 LLM 생성
|
||||
llm = LLM(
|
||||
model="openai/gpt-4o",
|
||||
stream=True # 스트리밍 활성화
|
||||
)
|
||||
```
|
||||
|
||||
스트리밍이 활성화되면, 응답이 생성되는 대로 청크 단위로 전달되어 보다 반응성 있는 사용자 경험을 만듭니다.
|
||||
</Tab>
|
||||
|
||||
<Tab title="이벤트 처리">
|
||||
CrewAI는 스트리밍 중 수신되는 각 청크에 대해 이벤트를 발생시킵니다:
|
||||
|
||||
```python
|
||||
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(self, event: LLMStreamChunkEvent):
|
||||
# 각 청크가 도착할 때마다 처리
|
||||
print(f"Received chunk: {event.chunk}")
|
||||
|
||||
my_listener = MyCustomListener()
|
||||
```
|
||||
|
||||
<Tip>
|
||||
[자세한 내용은 여기를 클릭하세요](https://docs.crewai.com/concepts/event-listener#event-listeners)
|
||||
</Tip>
|
||||
</Tab>
|
||||
|
||||
<Tab title="에이전트 & 태스크 추적">
|
||||
CrewAI의 모든 LLM 이벤트에는 에이전트 및 태스크 정보가 포함되어 있어, 특정 에이전트나 태스크별로 LLM 상호작용을 추적하고 필터링할 수 있습니다:
|
||||
|
||||
```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>
|
||||
이 기능은 다음과 같은 경우에 특히 유용합니다:
|
||||
- 특정 에이전트 동작을 디버깅할 때
|
||||
- 태스크 유형별 LLM 사용 기록을 남길 때
|
||||
- 어떤 에이전트가 어떤 유형의 LLM 호출을 하는지 감사할 때
|
||||
- 특정 태스크의 성능을 모니터링할 때
|
||||
</Info>
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
## 구조화된 LLM 호출
|
||||
|
||||
CrewAI는 Pydantic 모델을 사용하여 `response_format`을 정의함으로써 LLM 호출에서 구조화된 응답을 지원합니다. 이를 통해 프레임워크가 출력을 자동으로 파싱하고 검증할 수 있어, 수동 후처리 없이도 응답을 애플리케이션에 쉽게 통합할 수 있습니다.
|
||||
|
||||
예를 들어, 예상되는 응답 구조를 나타내는 Pydantic 모델을 정의하고 LLM을 인스턴스화할 때 `response_format`으로 전달할 수 있습니다. 이 모델은 LLM 출력을 구조화된 Python 객체로 변환하는 데 사용됩니다.
|
||||
|
||||
```python Code
|
||||
from crewai import LLM
|
||||
|
||||
class Dog(BaseModel):
|
||||
name: str
|
||||
age: int
|
||||
breed: str
|
||||
|
||||
|
||||
llm = LLM(model="gpt-4o", response_format=Dog)
|
||||
|
||||
response = llm.call(
|
||||
"Analyze the following messages and return the name, age, and breed. "
|
||||
"Meet Kona! She is 3 years old and is a black german shepherd."
|
||||
)
|
||||
print(response)
|
||||
|
||||
# Output:
|
||||
# Dog(name='Kona', age=3, breed='black german shepherd')
|
||||
```
|
||||
|
||||
## 고급 기능 및 최적화
|
||||
|
||||
LLM 설정을 최대한 활용하는 방법을 알아보세요:
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="컨텍스트 윈도우 관리">
|
||||
CrewAI는 스마트한 컨텍스트 관리 기능을 제공합니다:
|
||||
|
||||
```python
|
||||
from crewai import LLM
|
||||
|
||||
# CrewAI는 자동으로 다음을 처리합니다:
|
||||
# 1. 토큰 계산 및 추적
|
||||
# 2. 필요시 콘텐츠 요약
|
||||
# 3. 큰 컨텍스트에 대한 작업 분할
|
||||
|
||||
llm = LLM(
|
||||
model="gpt-4",
|
||||
max_tokens=4000, # 응답 길이 제한
|
||||
)
|
||||
```
|
||||
|
||||
<Info>
|
||||
컨텍스트 관리 모범 사례:
|
||||
1. 적절한 컨텍스트 윈도우를 가진 모델 선택
|
||||
2. 가능하면 긴 입력값을 사전 처리
|
||||
3. 큰 문서에는 청킹(chunking) 사용
|
||||
4. 비용 최적화를 위해 토큰 사용량 모니터링
|
||||
</Info>
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="성능 최적화">
|
||||
<Steps>
|
||||
<Step title="토큰 사용 최적화">
|
||||
작업에 맞는 컨텍스트 윈도우를 선택하세요:
|
||||
- 작은 작업 (최대 4K 토큰): 표준 모델
|
||||
- 중간 작업 (4K~32K 사이): 확장 모델
|
||||
- 큰 작업 (32K 이상): 대형 컨텍스트 모델
|
||||
|
||||
```python
|
||||
# 모델을 적절한 설정으로 구성
|
||||
llm = LLM(
|
||||
model="openai/gpt-4-turbo-preview",
|
||||
temperature=0.7, # 작업에 따라 조정
|
||||
max_tokens=4096, # 출력 요구 사항에 맞게 설정
|
||||
timeout=300 # 복잡한 작업을 위한 더 긴 타임아웃
|
||||
)
|
||||
```
|
||||
<Tip>
|
||||
- 사실 기반 응답에는 낮은 temperature(0.1~0.3)
|
||||
- 창의적인 작업에는 높은 temperature(0.7~0.9)
|
||||
</Tip>
|
||||
</Step>
|
||||
|
||||
<Step title="모범 사례">
|
||||
1. 토큰 사용량 모니터링
|
||||
2. 속도 제한(rate limiting) 구현
|
||||
3. 가능하면 캐싱 사용
|
||||
4. 적절한 max_tokens 제한 설정
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
<Info>
|
||||
비용 및 성능을 최적화하기 위해 토큰 사용량을 정기적으로 모니터링하고 필요에 따라 설정을 조정하세요.
|
||||
</Info>
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="추가 파라미터 드롭">
|
||||
CrewAI는 내부적으로 LLM 호출에 Litellm을 사용하며, 이를 통해 특정 사용 사례에 필요하지 않은 추가 파라미터를 제거할 수 있습니다. 이를 통해 코드가 간소화되며 LLM 구성의 복잡성을 줄일 수 있습니다.
|
||||
예를 들어, <code>stop</code> 파라미터를 보낼 필요가 없다면 LLM 호출에서 제외할 수 있습니다:
|
||||
|
||||
```python
|
||||
from crewai import LLM
|
||||
import os
|
||||
|
||||
os.environ["OPENAI_API_KEY"] = "<api-key>"
|
||||
|
||||
o3_llm = LLM(
|
||||
model="o3",
|
||||
drop_params=True,
|
||||
additional_drop_params=["stop"]
|
||||
)
|
||||
```
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
## 일반적인 문제 및 해결 방법
|
||||
|
||||
<Tabs>
|
||||
<Tab title="인증">
|
||||
<Warning>
|
||||
대부분의 인증 문제는 API 키 형식과 환경 변수 이름을 확인하여 해결할 수 있습니다.
|
||||
</Warning>
|
||||
|
||||
```bash
|
||||
# OpenAI
|
||||
OPENAI_API_KEY=sk-...
|
||||
|
||||
# Anthropic
|
||||
ANTHROPIC_API_KEY=sk-ant-...
|
||||
```
|
||||
</Tab>
|
||||
<Tab title="모델 이름">
|
||||
<Check>
|
||||
항상 모델 이름에 provider 접두사를 포함하세요.
|
||||
</Check>
|
||||
|
||||
```python
|
||||
# 올바른 예시
|
||||
llm = LLM(model="openai/gpt-4")
|
||||
|
||||
# 잘못된 예시
|
||||
llm = LLM(model="gpt-4")
|
||||
```
|
||||
</Tab>
|
||||
<Tab title="컨텍스트 길이">
|
||||
<Tip>
|
||||
대규모 작업에는 더 큰 컨텍스트 모델을 사용하세요.
|
||||
</Tip>
|
||||
|
||||
```python
|
||||
# 대용량 컨텍스트 모델
|
||||
llm = LLM(model="openai/gpt-4o") # 128K tokens
|
||||
```
|
||||
</Tab>
|
||||
</Tabs>
|
||||
1159
docs/ko/concepts/memory.mdx
Normal file
152
docs/ko/concepts/planning.mdx
Normal file
@@ -0,0 +1,152 @@
|
||||
---
|
||||
title: 계획
|
||||
description: CrewAI Crew에 계획을 추가하고 성능을 향상시키는 방법을 알아보세요.
|
||||
icon: ruler-combined
|
||||
---
|
||||
|
||||
## 개요
|
||||
|
||||
CrewAI의 planning 기능을 통해 crew에 계획 수립 기능을 추가할 수 있습니다. 해당 기능을 활성화하면, 각 Crew 반복 전에 모든 Crew 정보가 AgentPlanner로 전송되어 작업이 단계별로 계획되며, 이 계획이 각 작업 설명에 추가됩니다.
|
||||
|
||||
### Planning 기능 사용하기
|
||||
|
||||
Planning 기능을 시작하는 것은 매우 간단합니다. 필요한 유일한 단계는 Crew에 `planning=True`를 추가하는 것입니다:
|
||||
|
||||
<CodeGroup>
|
||||
```python Code
|
||||
from crewai import Crew, Agent, Task, Process
|
||||
|
||||
# Assemble your crew with planning capabilities
|
||||
my_crew = Crew(
|
||||
agents=self.agents,
|
||||
tasks=self.tasks,
|
||||
process=Process.sequential,
|
||||
planning=True,
|
||||
)
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
이 시점부터 crew는 planning이 활성화되며, 각 반복 전에 작업이 계획됩니다.
|
||||
|
||||
<Warning>
|
||||
Planning이 활성화되면, crewAI는 planning을 위해 기본 LLM으로 `gpt-4o-mini`를 사용합니다. 이 기능은 유효한 OpenAI API 키가 필요합니다. 에이전트가 서로 다른 LLM을 사용할 수도 있기 때문에, OpenAI API 키가 설정되어 있지 않거나 LLM API 호출과 관련된 예상치 못한 동작이 발생할 경우 혼란을 일으킬 수 있습니다.
|
||||
</Warning>
|
||||
|
||||
#### LLM 계획하기
|
||||
|
||||
이제 작업을 계획할 때 사용할 LLM을 정의할 수 있습니다.
|
||||
|
||||
기본 사례 예제를 실행하면 아래와 같은 출력이 나타나는데, 이는 AgentPlanner의 출력으로, 에이전트 작업에 추가할 단계별 논리를 생성합니다.
|
||||
|
||||
<CodeGroup>
|
||||
```python Code
|
||||
from crewai import Crew, Agent, Task, Process
|
||||
|
||||
# Assemble your crew with planning capabilities and custom LLM
|
||||
my_crew = Crew(
|
||||
agents=self.agents,
|
||||
tasks=self.tasks,
|
||||
process=Process.sequential,
|
||||
planning=True,
|
||||
planning_llm="gpt-4o"
|
||||
)
|
||||
|
||||
# Run the crew
|
||||
my_crew.kickoff()
|
||||
```
|
||||
|
||||
```markdown Result
|
||||
[2024-07-15 16:49:11][INFO]: Planning the crew execution
|
||||
**작업 실행을 위한 단계별 계획**
|
||||
|
||||
**작업 번호 1: AI LLM에 대해 철저히 조사하기**
|
||||
|
||||
**에이전트:** AI LLMs 시니어 데이터 리서처
|
||||
|
||||
**에이전트 목표:** AI LLM의 최신 개발 동향 파악
|
||||
|
||||
**작업 예상 결과:** AI LLM에 대한 가장 관련성 높은 정보 10가지가 포함된 리스트
|
||||
|
||||
**작업 도구:** 명시되지 않음
|
||||
|
||||
**에이전트 도구:** 명시되지 않음
|
||||
|
||||
**단계별 계획:**
|
||||
|
||||
1. **조사 범위 정의:**
|
||||
|
||||
- 아키텍처의 발전, 사용 사례, 윤리적 고려사항, 성능 측정 기준 등 AI LLM의 특정 영역을 결정합니다.
|
||||
|
||||
2. **신뢰할 수 있는 출처 식별:**
|
||||
|
||||
- 학술지, 산업 리포트, 컨퍼런스(예: NeurIPS, ACL), AI 연구소(예: OpenAI, Google AI), 온라인 데이터베이스(예: IEEE Xplore, arXiv) 등 AI 연구를 위한 평판 좋은 출처를 나열합니다.
|
||||
|
||||
3. **데이터 수집:**
|
||||
|
||||
- 2024년 및 2025년 초에 발표된 최신 논문, 기사, 리포트를 검색합니다.
|
||||
- "Large Language Models 2025", "AI LLM advancements", "AI ethics 2025"와 같은 키워드를 사용합니다.
|
||||
|
||||
4. **발견 사항 분석:**
|
||||
|
||||
- 각 출처에서 핵심 내용을 읽고 요약합니다.
|
||||
- 지난 1년간 소개된 새로운 기술, 모델, 애플리케이션 등을 강조합니다.
|
||||
|
||||
5. **정보 정리:**
|
||||
|
||||
- 정보를 관련 주제별로 분류합니다(예: 새로운 아키텍처, 윤리적 영향, 실세계 적용 등).
|
||||
- 각 핵심 포인트는 간결하면서도 정보가 풍부하도록 합니다.
|
||||
|
||||
6. **리스트 작성:**
|
||||
|
||||
- 가장 관련성 높은 10가지 정보를 불릿 포인트로 정리합니다.
|
||||
- 리스트가 명확하고 적절한지 검토합니다.
|
||||
|
||||
**예상 결과:**
|
||||
|
||||
AI LLM에 대한 가장 관련성 높은 정보 10가지를 담은 불릿 포인트 리스트.
|
||||
|
||||
---
|
||||
|
||||
**작업 번호 2: 받은 컨텍스트를 검토하고 각 주제를 리포트의 전체 섹션으로 확장하기**
|
||||
|
||||
**에이전트:** AI LLMs 리포팅 애널리스트
|
||||
|
||||
**에이전트 목표:** AI LLM 데이터 분석 및 연구 결과를 기반으로 상세 리포트를 작성
|
||||
|
||||
**작업 예상 결과:** 주요 주제별로 각 섹션이 포함된 완전한 리포트 (마크다운 형식, '```' 없이)
|
||||
|
||||
**작업 도구:** 명시되지 않음
|
||||
|
||||
**에이전트 도구:** 명시되지 않음
|
||||
|
||||
**단계별 계획:**
|
||||
|
||||
1. **불릿 포인트 검토:**
|
||||
- AI LLMs 시니어 데이터 리서처가 제공한 10가지 불릿 포인트 리스트를 꼼꼼히 읽습니다.
|
||||
|
||||
2. **리포트 개요 작성:**
|
||||
- 각 불릿 포인트를 주요 섹션 제목으로 삼아 개요를 만듭니다.
|
||||
- 각 주요 제목 아래 하위 섹션을 기획하여 해당 주제의 다양한 측면을 다룹니다.
|
||||
|
||||
3. **추가 세부 사항 조사:**
|
||||
- 각 불릿 포인트별로, 더 자세한 정보를 수집하기 위해 필요 시 추가 조사를 진행합니다.
|
||||
- 각 섹션을 뒷받침할 사례 연구, 예시, 통계자료 등을 찾습니다.
|
||||
|
||||
4. **상세 섹션 작성:**
|
||||
- 각 불릿 포인트를 포괄적인 섹션으로 확장합니다.
|
||||
- 각 섹션에는 도입, 상세 설명, 예시, 결론이 포함되어야 합니다.
|
||||
- 제목, 부제목, 리스트, 강조 등 마크다운 포맷을 사용합니다.
|
||||
|
||||
5. **검토 및 편집:**
|
||||
- 리포트의 명확성, 일관성, 정확성을 위해 교정합니다.
|
||||
- 리포트가 각 섹션에서 논리적으로 자연스럽게 흐르는지 확인합니다.
|
||||
- 마크다운 기준에 맞게 포맷을 맞춥니다.
|
||||
|
||||
6. **리포트 최종화:**
|
||||
- 모든 섹션이 확장되고 상세하게 작성되어 완전한 리포트가 되었는지 확인합니다.
|
||||
- 포맷을 다시 확인하고 필요한 경우 수정합니다.
|
||||
|
||||
**예상 결과:**
|
||||
주요 주제별로 각 섹션이 포함된 완전한 리포트 (마크다운 형식, '```' 없이).
|
||||
```
|
||||
</CodeGroup>
|
||||
66
docs/ko/concepts/processes.mdx
Normal file
@@ -0,0 +1,66 @@
|
||||
---
|
||||
title: 프로세스
|
||||
description: CrewAI에서 프로세스를 통한 워크플로우 관리에 대한 상세 가이드와 최신 구현 세부 사항.
|
||||
icon: bars-staggered
|
||||
---
|
||||
|
||||
## 개요
|
||||
|
||||
<Tip>
|
||||
프로세스는 에이전트에 의해 작업이 실행되도록 조정하며, 이는 인간 팀에서의 프로젝트 관리와 유사합니다.
|
||||
이러한 프로세스는 작업이 미리 정의된 전략에 따라 효율적으로 분배되고 실행되도록 보장합니다.
|
||||
</Tip>
|
||||
|
||||
## 프로세스 구현
|
||||
|
||||
- **순차적(Sequential)**: 작업을 순차적으로 실행하여 작업이 질서 있게 진행되도록 보장합니다.
|
||||
- **계층적(Hierarchical)**: 작업을 관리 계층 구조로 조직하며, 작업은 체계적인 명령 체계를 기반으로 위임 및 실행됩니다. 계층적 프로세스를 활성화하려면 매니저 언어 모델(`manager_llm`) 또는 커스텀 매니저 에이전트(`manager_agent`)를 crew에서 지정해야 하며, 이를 통해 매니저가 작업을 생성하고 관리할 수 있도록 지원합니다.
|
||||
- **합의 프로세스(Consensual Process, 계획됨)**: 에이전트들 간에 작업 실행에 대한 협력적 의사결정을 목표로 하며, 이 프로세스 유형은 CrewAI 내에서 작업 관리를 민주적으로 접근하도록 도입됩니다. 앞으로 개발될 예정이며, 현재 코드베이스에는 구현되어 있지 않습니다.
|
||||
|
||||
## 팀워크에서 프로세스의 역할
|
||||
프로세스는 개별 에이전트가 통합된 단위로 작동할 수 있도록 하여, 공통된 목표를 효율적이고 일관성 있게 달성하도록 노력하는 과정을 간소화합니다.
|
||||
|
||||
## 프로세스를 Crew에 할당하기
|
||||
프로세스를 crew에 할당하려면, crew 생성 시 프로세스 유형을 지정하여 실행 전략을 설정합니다. 계층적 프로세스의 경우, 매니저 에이전트에 대해 `manager_llm` 또는 `manager_agent`를 반드시 정의해야 합니다.
|
||||
|
||||
```python
|
||||
from crewai import Crew, Process
|
||||
|
||||
# Example: Creating a crew with a sequential process
|
||||
crew = Crew(
|
||||
agents=my_agents,
|
||||
tasks=my_tasks,
|
||||
process=Process.sequential
|
||||
)
|
||||
|
||||
# Example: Creating a crew with a hierarchical process
|
||||
# Ensure to provide a manager_llm or manager_agent
|
||||
crew = Crew(
|
||||
agents=my_agents,
|
||||
tasks=my_tasks,
|
||||
process=Process.hierarchical,
|
||||
manager_llm="gpt-4o"
|
||||
# or
|
||||
# manager_agent=my_manager_agent
|
||||
)
|
||||
```
|
||||
**참고:** `Crew` 객체를 생성하기 전에 반드시 `my_agents`와 `my_tasks`가 정의되어 있어야 하며, 계층적 프로세스의 경우 `manager_llm` 또는 `manager_agent` 중 하나도 필요합니다.
|
||||
|
||||
## 순차적 프로세스
|
||||
|
||||
이 방법은 동적인 팀 워크플로우를 반영하며, 작업을 신중하고 체계적으로 진행합니다. 작업 수행은 작업 목록에 정의된 순서를 따르며, 한 작업의 출력이 다음 작업의 컨텍스트로 사용됩니다.
|
||||
|
||||
작업 컨텍스트를 사용자 지정하려면, `Task` 클래스의 `context` 매개변수를 사용하여 이후 작업에 컨텍스트로 사용될 출력을 지정하세요.
|
||||
|
||||
## 계층적 프로세스
|
||||
|
||||
기업의 계층 구조를 모방하는 CrewAI는 사용자 지정 관리자 에이전트를 지정하거나 자동으로 생성할 수 있으며, 이때 관리자 언어 모델(`manager_llm`)의 지정을 요구합니다. 이 에이전트는 계획 수립, 위임, 검증 등 작업 실행을 감독합니다. 작업은 미리 할당되지 않으며, 관리자가 에이전트의 역량에 따라 작업을 분배하고, 산출물을 검토하며, 작업 완료 여부를 평가합니다.
|
||||
|
||||
## Process 클래스: 상세 개요
|
||||
|
||||
`Process` 클래스는 열거형(`Enum`)으로 구현되어 타입 안전성을 보장하며, 프로세스 값을 정의된 타입(`sequential`, `hierarchical`)으로 제한합니다. 합의 기반(consensual) 프로세스는 향후 추가될 예정이며, 이는 지속적인 개발과 혁신에 대한 우리의 의지를 강조합니다.
|
||||
|
||||
## 결론
|
||||
|
||||
CrewAI 내의 프로세스를 통해 촉진되는 구조화된 협업은 에이전트 간 체계적인 팀워크를 가능하게 하는 데 매우 중요합니다.
|
||||
이 문서는 최신 기능, 향상 사항, 그리고 예정된 Consensual Process 통합을 반영하도록 업데이트되었으며, 사용자가 가장 최신이고 포괄적인 정보를 이용할 수 있도록 보장합니다.
|
||||
147
docs/ko/concepts/reasoning.mdx
Normal file
@@ -0,0 +1,147 @@
|
||||
---
|
||||
title: Reasoning
|
||||
description: "에이전트 reasoning을 활성화하고 사용하는 방법을 배워 작업 실행을 향상하세요."
|
||||
icon: brain
|
||||
---
|
||||
|
||||
## 개요
|
||||
|
||||
Agent reasoning은 에이전트가 작업을 수행하기 전에 해당 작업을 반성하고 계획을 수립할 수 있도록 해주는 기능입니다. 이를 통해 에이전트는 작업에 더 체계적으로 접근할 수 있으며, 할당된 업무를 수행할 준비가 되었는지 확인할 수 있습니다.
|
||||
|
||||
## 사용 방법
|
||||
|
||||
에이전트에 reasoning을 활성화하려면 에이전트를 생성할 때 `reasoning=True`로 설정하면 됩니다.
|
||||
|
||||
```python
|
||||
from crewai import Agent
|
||||
|
||||
agent = Agent(
|
||||
role="Data Analyst",
|
||||
goal="Analyze complex datasets and provide insights",
|
||||
backstory="You are an experienced data analyst with expertise in finding patterns in complex data.",
|
||||
reasoning=True, # Enable reasoning
|
||||
max_reasoning_attempts=3 # Optional: Set a maximum number of reasoning attempts
|
||||
)
|
||||
```
|
||||
|
||||
## 작동 방식
|
||||
|
||||
reasoning이 활성화되면, 작업을 실행하기 전에 에이전트는 다음을 수행합니다:
|
||||
|
||||
1. 작업을 반영하고 상세한 계획을 수립합니다.
|
||||
2. 작업을 실행할 준비가 되었는지 평가합니다.
|
||||
3. 준비가 완료되거나 max_reasoning_attempts에 도달할 때까지 필요에 따라 계획을 다듬습니다.
|
||||
4. reasoning 계획을 실행 전에 작업 설명에 삽입합니다.
|
||||
|
||||
이 프로세스는 에이전트가 복잡한 작업을 관리하기 쉬운 단계로 분해하고, 시작하기 전에 잠재적인 문제를 식별하는 데 도움을 줍니다.
|
||||
|
||||
## 구성 옵션
|
||||
|
||||
<ParamField body="reasoning" type="bool" default="False">
|
||||
reasoning 활성화 또는 비활성화
|
||||
</ParamField>
|
||||
|
||||
<ParamField body="max_reasoning_attempts" type="int" default="None">
|
||||
실행을 진행하기 전에 계획을 개선할 최대 시도 횟수입니다. None(기본값)인 경우, agent는 준비될 때까지 계속해서 개선을 시도합니다.
|
||||
</ParamField>
|
||||
|
||||
## 예제
|
||||
|
||||
다음은 전체 예제입니다:
|
||||
|
||||
```python
|
||||
from crewai import Agent, Task, Crew
|
||||
|
||||
# Create an agent with reasoning enabled
|
||||
analyst = Agent(
|
||||
role="Data Analyst",
|
||||
goal="Analyze data and provide insights",
|
||||
backstory="You are an expert data analyst.",
|
||||
reasoning=True,
|
||||
max_reasoning_attempts=3 # Optional: Set a limit on reasoning attempts
|
||||
)
|
||||
|
||||
# Create a task
|
||||
analysis_task = Task(
|
||||
description="Analyze the provided sales data and identify key trends.",
|
||||
expected_output="A report highlighting the top 3 sales trends.",
|
||||
agent=analyst
|
||||
)
|
||||
|
||||
# Create a crew and run the task
|
||||
crew = Crew(agents=[analyst], tasks=[analysis_task])
|
||||
result = crew.kickoff()
|
||||
|
||||
print(result)
|
||||
```
|
||||
|
||||
## 오류 처리
|
||||
|
||||
reasoning 프로세스는 견고하게 설계되어 있으며, 오류 처리가 내장되어 있습니다. reasoning 중에 오류가 발생하면, 에이전트는 reasoning 계획 없이 작업을 계속 실행합니다. 이는 reasoning 프로세스가 실패하더라도 작업이 계속 실행될 수 있도록 보장합니다.
|
||||
|
||||
코드에서 발생할 수 있는 오류를 처리하는 방법은 다음과 같습니다:
|
||||
|
||||
```python
|
||||
from crewai import Agent, Task
|
||||
import logging
|
||||
|
||||
# reasoning 오류를 캡처하기 위해 로깅을 설정합니다
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
|
||||
# reasoning이 활성화된 에이전트를 생성합니다
|
||||
agent = Agent(
|
||||
role="Data Analyst",
|
||||
goal="Analyze data and provide insights",
|
||||
reasoning=True,
|
||||
max_reasoning_attempts=3
|
||||
)
|
||||
|
||||
# 작업을 생성합니다
|
||||
task = Task(
|
||||
description="Analyze the provided sales data and identify key trends.",
|
||||
expected_output="A report highlighting the top 3 sales trends.",
|
||||
agent=agent
|
||||
)
|
||||
|
||||
# 작업 실행
|
||||
# reasoning 중 오류가 발생해도 로그에 기록되며 실행은 계속됩니다
|
||||
result = agent.execute_task(task)
|
||||
```
|
||||
|
||||
## 예시 Reasoning 출력
|
||||
|
||||
다음은 데이터 분석 작업을 위한 reasoning 계획의 예시입니다:
|
||||
|
||||
```
|
||||
Task: Analyze the provided sales data and identify key trends.
|
||||
|
||||
Reasoning Plan:
|
||||
I'll analyze the sales data to identify the top 3 trends.
|
||||
|
||||
1. Understanding of the task:
|
||||
I need to analyze sales data to identify key trends that would be valuable for business decision-making.
|
||||
|
||||
2. Key steps I'll take:
|
||||
- First, I'll examine the data structure to understand what fields are available
|
||||
- Then I'll perform exploratory data analysis to identify patterns
|
||||
- Next, I'll analyze sales by time periods to identify temporal trends
|
||||
- I'll also analyze sales by product categories and customer segments
|
||||
- Finally, I'll identify the top 3 most significant trends
|
||||
|
||||
3. Approach to challenges:
|
||||
- If the data has missing values, I'll decide whether to fill or filter them
|
||||
- If the data has outliers, I'll investigate whether they're valid data points or errors
|
||||
- If trends aren't immediately obvious, I'll apply statistical methods to uncover patterns
|
||||
|
||||
4. Use of available tools:
|
||||
- I'll use data analysis tools to explore and visualize the data
|
||||
- I'll use statistical tools to identify significant patterns
|
||||
- I'll use knowledge retrieval to access relevant information about sales analysis
|
||||
|
||||
5. Expected outcome:
|
||||
A concise report highlighting the top 3 sales trends with supporting evidence from the data.
|
||||
|
||||
READY: I am ready to execute the task.
|
||||
```
|
||||
|
||||
이 reasoning 계획은 agent가 작업에 접근하는 방식을 체계적으로 구성하고, 발생할 수 있는 잠재적 문제를 고려하며, 기대되는 결과를 제공하도록 돕습니다.
|
||||
902
docs/ko/concepts/tasks.mdx
Normal file
@@ -0,0 +1,902 @@
|
||||
---
|
||||
title: 작업
|
||||
description: CrewAI 프레임워크 내에서 작업을 관리하고 생성하는 방법에 대한 자세한 안내서입니다.
|
||||
icon: list-check
|
||||
---
|
||||
|
||||
## 개요
|
||||
|
||||
CrewAI 프레임워크에서 `Task`는 `Agent`가 완료하는 구체적인 과제입니다.
|
||||
|
||||
Task는 실행을 위한 모든 세부 정보를 제공합니다. 여기에는 설명, 책임 Agent, 필요한 도구 등이 포함되어 다양한 작업 복잡성을 지원합니다.
|
||||
|
||||
CrewAI 내의 Task는 협업이 가능하며, 여러 Agent가 함께 작업해야 할 수도 있습니다. 이는 Task 속성을 통해 관리되며, Crew의 프로세스를 통해 조율되어 팀워크와 효율성을 향상시킵니다.
|
||||
|
||||
<Note type="info" title="엔터프라이즈 기능: 비주얼 Task 빌더">
|
||||
CrewAI 엔터프라이즈에는 복잡한 Task 생성과 연결을 단순화하는 Crew Studio의 비주얼 Task 빌더가 포함되어 있습니다. Task 흐름을 시각적으로 설계하고, 코드를 작성하지 않고도 실시간으로 테스트해 볼 수 있습니다.
|
||||
|
||||

|
||||
|
||||
비주얼 Task 빌더의 주요 기능:
|
||||
- 드래그 앤 드롭 방식의 Task 생성
|
||||
- 시각적 Task 종속성과 흐름 관리
|
||||
- 실시간 테스트 및 검증
|
||||
- 손쉬운 공유 및 협업
|
||||
</Note>
|
||||
|
||||
### 작업 실행 흐름
|
||||
|
||||
작업은 두 가지 방법으로 실행될 수 있습니다:
|
||||
- **순차적**: 작업이 정의된 순서대로 실행됩니다
|
||||
- **계층적**: 작업이 역할과 전문성에 따라 에이전트에게 할당됩니다
|
||||
|
||||
실행 흐름은 crew를 생성할 때 정의됩니다:
|
||||
```python Code
|
||||
crew = Crew(
|
||||
agents=[agent1, agent2],
|
||||
tasks=[task1, task2],
|
||||
process=Process.sequential # or Process.hierarchical
|
||||
)
|
||||
```
|
||||
|
||||
## 태스크 속성
|
||||
|
||||
| 속성 | 매개변수 | 타입 | 설명 |
|
||||
| :------------------------------- | :-------------------- | :------------------------------- | :------------------------------------------------------------------------------------------------------------ |
|
||||
| **설명** | `description` | `str` | 태스크가 다루는 내용을 명확하고 간결하게 설명합니다. |
|
||||
| **예상 출력** | `expected_output` | `str` | 태스크가 완료된 모습에 대한 구체적인 설명입니다. |
|
||||
| **이름** _(선택 사항)_ | `name` | `Optional[str]` | 태스크의 이름 식별자입니다. |
|
||||
| **에이전트** _(선택 사항)_ | `agent` | `Optional[BaseAgent]` | 태스크 실행을 담당하는 에이전트입니다. |
|
||||
| **도구** _(선택 사항)_ | `tools` | `List[BaseTool]` | 이 태스크를 위해 에이전트가 사용할 수 있는 도구/리소스 목록입니다. |
|
||||
| **컨텍스트** _(선택 사항)_ | `context` | `Optional[List["Task"]]` | 이 태스크의 컨텍스트로 사용될 다른 태스크의 출력입니다. |
|
||||
| **비동기 실행** _(선택 사항)_ | `async_execution` | `Optional[bool]` | 태스크를 비동기적으로 실행할지 여부입니다. 기본값은 False입니다. |
|
||||
| **사용자 입력** _(선택 사항)_ | `human_input` | `Optional[bool]` | 태스크의 최종 답안을 에이전트가 제출한 뒤 사람이 검토할지 여부입니다. 기본값은 False입니다. |
|
||||
| **마크다운** _(선택 사항)_ | `markdown` | `Optional[bool]` | 태스크가 에이전트에게 최종 답안을 마크다운으로 포매팅해서 반환하도록 지시할지 여부입니다. 기본값은 False입니다. |
|
||||
| **설정** _(선택 사항)_ | `config` | `Optional[Dict[str, Any]]` | 태스크별 설정 파라미터입니다. |
|
||||
| **출력 파일** _(선택 사항)_ | `output_file` | `Optional[str]` | 태스크 결과를 저장할 파일 경로입니다. |
|
||||
| **디렉터리 생성** _(선택 사항)_ | `create_directory` | `Optional[bool]` | output_file의 디렉터리가 존재하지 않을 경우 생성할지 여부입니다. 기본값은 True입니다. |
|
||||
| **출력 JSON** _(선택 사항)_ | `output_json` | `Optional[Type[BaseModel]]` | JSON 출력을 구조화하기 위한 Pydantic 모델입니다. |
|
||||
| **Pydantic 출력** _(선택 사항)_ | `output_pydantic` | `Optional[Type[BaseModel]]` | 태스크 출력용 Pydantic 모델입니다. |
|
||||
| **콜백** _(선택 사항)_ | `callback` | `Optional[Any]` | 태스크 완료 후 실행할 함수/객체입니다. |
|
||||
| **가드레일** _(선택 사항)_ | `guardrail` | `Optional[Callable]` | 다음 태스크로 진행하기 전에 태스크 출력을 검증하는 함수입니다. |
|
||||
|
||||
## 작업 생성하기
|
||||
|
||||
CrewAI에서 작업을 생성하는 방법에는 **YAML 구성(권장)** 을 사용하는 방법과 **코드에서 직접 정의하는 방법** 두 가지가 있습니다.
|
||||
|
||||
### YAML 구성 (권장)
|
||||
|
||||
YAML 구성을 사용하면 작업을 정의할 때 더 깔끔하고 유지 관리가 용이한 방법을 제공합니다. CrewAI 프로젝트에서 작업을 정의할 때 이 방식을 사용하는 것을 강력히 권장합니다.
|
||||
|
||||
[설치](/ko/installation) 섹션에 따라 CrewAI 프로젝트를 생성한 후, `src/latest_ai_development/config/tasks.yaml` 파일로 이동하여 템플릿을 귀하의 특정 작업 요구 사항에 맞게 수정하세요.
|
||||
|
||||
<Note>
|
||||
YAML 파일 내 변수(예: `{topic}`)는 크루를 실행할 때 입력값에서 가져온 값으로 대체됩니다:
|
||||
```python Code
|
||||
crew.kickoff(inputs={'topic': 'AI Agents'})
|
||||
```
|
||||
</Note>
|
||||
|
||||
아래는 YAML을 사용하여 작업을 구성하는 방법의 예시입니다:
|
||||
|
||||
```yaml tasks.yaml
|
||||
research_task:
|
||||
description: >
|
||||
Conduct a thorough research about {topic}
|
||||
Make sure you find any interesting and relevant information given
|
||||
the current year is 2025.
|
||||
expected_output: >
|
||||
A list with 10 bullet points of the most relevant information about {topic}
|
||||
agent: researcher
|
||||
|
||||
reporting_task:
|
||||
description: >
|
||||
Review the context you got and expand each topic into a full section for a report.
|
||||
Make sure the report is detailed and contains any and all relevant information.
|
||||
expected_output: >
|
||||
A fully fledge reports with the mains topics, each with a full section of information.
|
||||
Formatted as markdown without '```'
|
||||
agent: reporting_analyst
|
||||
markdown: true
|
||||
output_file: report.md
|
||||
```
|
||||
|
||||
이 YAML 구성을 코드에서 사용하려면 `CrewBase`를 상속받는 크루 클래스를 생성하세요:
|
||||
|
||||
```python crew.py
|
||||
# src/latest_ai_development/crew.py
|
||||
|
||||
from crewai import Agent, Crew, Process, Task
|
||||
from crewai.project import CrewBase, agent, crew, task
|
||||
from crewai_tools import SerperDevTool
|
||||
|
||||
@CrewBase
|
||||
class LatestAiDevelopmentCrew():
|
||||
"""LatestAiDevelopment crew"""
|
||||
|
||||
@agent
|
||||
def researcher(self) -> Agent:
|
||||
return Agent(
|
||||
config=self.agents_config['researcher'], # type: ignore[index]
|
||||
verbose=True,
|
||||
tools=[SerperDevTool()]
|
||||
)
|
||||
|
||||
@agent
|
||||
def reporting_analyst(self) -> Agent:
|
||||
return Agent(
|
||||
config=self.agents_config['reporting_analyst'], # type: ignore[index]
|
||||
verbose=True
|
||||
)
|
||||
|
||||
@task
|
||||
def research_task(self) -> Task:
|
||||
return Task(
|
||||
config=self.tasks_config['research_task'] # type: ignore[index]
|
||||
)
|
||||
|
||||
@task
|
||||
def reporting_task(self) -> Task:
|
||||
return Task(
|
||||
config=self.tasks_config['reporting_task'] # type: ignore[index]
|
||||
)
|
||||
|
||||
@crew
|
||||
def crew(self) -> Crew:
|
||||
return Crew(
|
||||
agents=[
|
||||
self.researcher(),
|
||||
self.reporting_analyst()
|
||||
],
|
||||
tasks=[
|
||||
self.research_task(),
|
||||
self.reporting_task()
|
||||
],
|
||||
process=Process.sequential
|
||||
)
|
||||
```
|
||||
|
||||
<Note>
|
||||
YAML 파일(`agents.yaml` 및 `tasks.yaml`)에서 사용하는 이름은 Python 코드의 메서드 이름과 일치해야 합니다.
|
||||
</Note>
|
||||
|
||||
### 코드에서 직접 태스크 정의 (대안)
|
||||
|
||||
또는 YAML 구성 없이 코드에서 직접 태스크를 정의할 수 있습니다:
|
||||
|
||||
```python task.py
|
||||
from crewai import Task
|
||||
|
||||
research_task = Task(
|
||||
description="""
|
||||
Conduct a thorough research about AI Agents.
|
||||
Make sure you find any interesting and relevant information given
|
||||
the current year is 2025.
|
||||
""",
|
||||
expected_output="""
|
||||
A list with 10 bullet points of the most relevant information about AI Agents
|
||||
""",
|
||||
agent=researcher
|
||||
)
|
||||
|
||||
reporting_task = Task(
|
||||
description="""
|
||||
Review the context you got and expand each topic into a full section for a report.
|
||||
Make sure the report is detailed and contains any and all relevant information.
|
||||
""",
|
||||
expected_output="""
|
||||
A fully fledge reports with the mains topics, each with a full section of information.
|
||||
""",
|
||||
agent=reporting_analyst,
|
||||
markdown=True, # Enable markdown formatting for the final output
|
||||
output_file="report.md"
|
||||
)
|
||||
```
|
||||
|
||||
<Tip>
|
||||
`agent`를 직접 지정하여 할당하거나, 역할·가용성 등에 따라 `hierarchical` CrewAI 프로세스가 자동으로 결정하도록 둘 수 있습니다.
|
||||
</Tip>
|
||||
|
||||
## 작업 결과
|
||||
|
||||
작업 결과를 이해하는 것은 효과적인 AI 워크플로우를 구축하는 데 매우 중요합니다. CrewAI는 여러 출력 형식을 지원하는 `TaskOutput` 클래스를 통해 작업 결과를 구조적으로 처리할 수 있는 방식을 제공합니다. 이 클래스는 작업 간에 출력값을 쉽게 전달할 수 있도록 지원합니다.
|
||||
|
||||
CrewAI 프레임워크에서 작업의 출력은 `TaskOutput` 클래스에 캡슐화되어 있습니다. 이 클래스는 작업의 결과를 구조적으로 접근할 수 있도록 해주며, raw 출력, JSON, Pydantic 모델 등 다양한 형식을 지원합니다.
|
||||
|
||||
기본적으로 `TaskOutput`에는 `raw` 출력만 포함됩니다. 원래의 `Task` 객체가 각각 `output_pydantic` 또는 `output_json`으로 구성된 경우에만 `TaskOutput`에 `pydantic` 또는 `json_dict` 출력이 포함됩니다.
|
||||
|
||||
### 작업 출력 속성
|
||||
|
||||
| 속성 | 파라미터 | 타입 | 설명 |
|
||||
| :---------------- | :----------------- | :------------------------- | :---------------------------------------------------------------------------------------------------- |
|
||||
| **설명** | `description` | `str` | 작업에 대한 설명입니다. |
|
||||
| **요약** | `summary` | `Optional[str]` | 설명의 처음 10단어에서 자동 생성된 작업의 요약입니다. |
|
||||
| **Raw** | `raw` | `str` | 작업의 원시 출력값입니다. 출력의 기본 형식입니다. |
|
||||
| **Pydantic** | `pydantic` | `Optional[BaseModel]` | 작업의 구조화된 출력을 나타내는 Pydantic 모델 객체입니다. |
|
||||
| **JSON Dict** | `json_dict` | `Optional[Dict[str, Any]]` | 작업의 JSON 출력을 나타내는 딕셔너리입니다. |
|
||||
| **Agent** | `agent` | `str` | 작업을 실행한 agent입니다. |
|
||||
| **Output Format** | `output_format` | `OutputFormat` | 작업 출력의 형식입니다. RAW, JSON, Pydantic 옵션이 있으며, 기본값은 RAW입니다. |
|
||||
|
||||
### 태스크 메서드 및 프로퍼티
|
||||
|
||||
| Method/Property | 설명 |
|
||||
| :-------------- | :------------------------------------------------------------------------------------------------- |
|
||||
| **json** | 출력 포맷이 JSON일 경우 태스크 출력의 JSON 문자열 표현을 반환합니다. |
|
||||
| **to_dict** | JSON 및 Pydantic 출력을 딕셔너리로 변환합니다. |
|
||||
| **str** | 태스크 출력의 문자열 표현을 반환하며, Pydantic을 우선으로 하고 그 다음은 JSON, 그 다음은 raw를 사용합니다. |
|
||||
|
||||
### 작업 출력 액세스
|
||||
|
||||
작업이 실행된 후에는 `Task` 객체의 `output` 속성을 통해 그 출력을 액세스할 수 있습니다. `TaskOutput` 클래스는 이 출력을 다양한 방식으로 상호작용하고 표시할 수 있는 기능을 제공합니다.
|
||||
|
||||
#### 예시
|
||||
|
||||
```python Code
|
||||
# Example task
|
||||
task = Task(
|
||||
description='Find and summarize the latest AI news',
|
||||
expected_output='A bullet list summary of the top 5 most important AI news',
|
||||
agent=research_agent,
|
||||
tools=[search_tool]
|
||||
)
|
||||
|
||||
# Execute the crew
|
||||
crew = Crew(
|
||||
agents=[research_agent],
|
||||
tasks=[task],
|
||||
verbose=True
|
||||
)
|
||||
|
||||
result = crew.kickoff()
|
||||
|
||||
# Accessing the task output
|
||||
task_output = task.output
|
||||
|
||||
print(f"Task Description: {task_output.description}")
|
||||
print(f"Task Summary: {task_output.summary}")
|
||||
print(f"Raw Output: {task_output.raw}")
|
||||
if task_output.json_dict:
|
||||
print(f"JSON Output: {json.dumps(task_output.json_dict, indent=2)}")
|
||||
if task_output.pydantic:
|
||||
print(f"Pydantic Output: {task_output.pydantic}")
|
||||
```
|
||||
|
||||
## 마크다운 출력 포매팅
|
||||
|
||||
`markdown` 매개변수는 작업 출력에 대해 자동 마크다운 포매팅을 활성화합니다. 이 값을 `True`로 설정하면, 작업은 에이전트에게 최종 답변을 올바른 마크다운 문법으로 포매팅하도록 지시합니다.
|
||||
|
||||
### 마크다운(Markdown) 포매팅 사용하기
|
||||
|
||||
```python Code
|
||||
# Example task with markdown formatting enabled
|
||||
formatted_task = Task(
|
||||
description="Create a comprehensive report on AI trends",
|
||||
expected_output="A well-structured report with headers, sections, and bullet points",
|
||||
agent=reporter_agent,
|
||||
markdown=True # Enable automatic markdown formatting
|
||||
)
|
||||
```
|
||||
|
||||
`markdown=True`일 때, 에이전트는 다음과 같이 출력을 포매팅하라는 추가 지시를 받게 됩니다:
|
||||
- 헤더에는 `#` 사용
|
||||
- 볼드체는 `**텍스트**` 사용
|
||||
- 이탤릭체는 `*텍스트*` 사용
|
||||
- 불릿 포인트에는 `-` 또는 `*` 사용
|
||||
- 인라인 코드는 `` `코드` `` 사용
|
||||
- 코드 블록은 ``` ```언어 ``` 사용
|
||||
|
||||
### 마크다운을 활용한 YAML 구성
|
||||
|
||||
```yaml tasks.yaml
|
||||
analysis_task:
|
||||
description: >
|
||||
Analyze the market data and create a detailed report
|
||||
expected_output: >
|
||||
A comprehensive analysis with charts and key findings
|
||||
agent: analyst
|
||||
markdown: true # Enable markdown formatting
|
||||
output_file: analysis.md
|
||||
```
|
||||
|
||||
### 마크다운 출력의 이점
|
||||
|
||||
- **일관된 포맷팅**: 모든 출력이 올바른 마크다운 규칙을 따르도록 보장합니다
|
||||
- **향상된 가독성**: 헤더, 목록, 강조 등으로 구조화된 콘텐츠
|
||||
- **문서화에 적합**: 출력을 문서 시스템에서 바로 사용할 수 있습니다
|
||||
- **크로스 플랫폼 호환성**: 마크다운은 보편적으로 지원됩니다
|
||||
|
||||
<Note>
|
||||
마크다운 포맷팅 지침은 `markdown=True`일 때 작업 프롬프트에 자동으로 추가되므로, 작업 설명에 포맷팅 요구사항을 따로 명시할 필요가 없습니다.
|
||||
</Note>
|
||||
|
||||
## 작업 종속성 및 컨텍스트
|
||||
|
||||
작업은 `context` 속성을 사용하여 다른 작업의 출력에 의존할 수 있습니다. 예를 들어:
|
||||
|
||||
```python Code
|
||||
research_task = Task(
|
||||
description="Research the latest developments in AI",
|
||||
expected_output="A list of recent AI developments",
|
||||
agent=researcher
|
||||
)
|
||||
|
||||
analysis_task = Task(
|
||||
description="Analyze the research findings and identify key trends",
|
||||
expected_output="Analysis report of AI trends",
|
||||
agent=analyst,
|
||||
context=[research_task] # This task will wait for research_task to complete
|
||||
)
|
||||
```
|
||||
|
||||
## 작업 가드레일
|
||||
|
||||
작업 가드레일은 작업 출력물을 다음 작업에 전달하기 전에 유효성을 검사하고 변환할 수 있는 방식을 제공합니다. 이 기능은 데이터 품질을 보장하고 에이전트의 출력이 특정 기준을 충족하지 않을 때 피드백을 제공하는 데 도움이 됩니다.
|
||||
|
||||
가드레일은 사용자 지정 유효성 검사 로직을 포함하는 Python 함수로 구현되며, 유효성 검사 프로세스를 완전히 제어할 수 있어 신뢰할 수 있고 결정적인 결과를 보장합니다.
|
||||
|
||||
### 함수 기반 가드레일
|
||||
|
||||
함수 기반 가드레일을 태스크에 추가하려면 `guardrail` 파라미터를 통해 검증 함수를 제공하세요:
|
||||
|
||||
```python Code
|
||||
from typing import Tuple, Union, Dict, Any
|
||||
from crewai import TaskOutput
|
||||
|
||||
def validate_blog_content(result: TaskOutput) -> Tuple[bool, Any]:
|
||||
"""Validate blog content meets requirements."""
|
||||
try:
|
||||
# Check word count
|
||||
word_count = len(result.split())
|
||||
if word_count > 200:
|
||||
return (False, "Blog content exceeds 200 words")
|
||||
|
||||
# Additional validation logic here
|
||||
return (True, result.strip())
|
||||
except Exception as e:
|
||||
return (False, "Unexpected error during validation")
|
||||
|
||||
blog_task = Task(
|
||||
description="Write a blog post about AI",
|
||||
expected_output="A blog post under 200 words",
|
||||
agent=blog_agent,
|
||||
guardrail=validate_blog_content # Add the guardrail function
|
||||
)
|
||||
```
|
||||
|
||||
### Guardrail 함수 요구사항
|
||||
|
||||
1. **함수 시그니처**:
|
||||
- 정확히 하나의 매개변수(태스크 출력)를 받아야 함
|
||||
- `(bool, Any)` 형태의 튜플을 반환해야 함
|
||||
- 타입 힌트는 권장하지만 필수는 아님
|
||||
|
||||
2. **반환 값**:
|
||||
- 성공 시: `(bool, Any)` 형태의 튜플을 반환. 예: `(True, validated_result)`
|
||||
- 실패 시: `(bool, str)` 형태의 튜플을 반환. 예: `(False, "Error message explain the failure")`
|
||||
|
||||
### 오류 처리 모범 사례
|
||||
|
||||
1. **구조화된 오류 응답**:
|
||||
```python Code
|
||||
from crewai import TaskOutput, LLMGuardrail
|
||||
|
||||
def validate_with_context(result: TaskOutput) -> Tuple[bool, Any]:
|
||||
try:
|
||||
# Main validation logic
|
||||
validated_data = perform_validation(result)
|
||||
return (True, validated_data)
|
||||
except ValidationError as e:
|
||||
return (False, f"VALIDATION_ERROR: {str(e)}")
|
||||
except Exception as e:
|
||||
return (False, str(e))
|
||||
```
|
||||
|
||||
2. **오류 범주**:
|
||||
- 구체적인 오류 코드 사용
|
||||
- 관련 컨텍스트 포함
|
||||
- 실행 가능한 피드백 제공
|
||||
|
||||
3. **검증 체인**:
|
||||
```python Code
|
||||
from typing import Any, Dict, List, Tuple, Union
|
||||
from crewai import TaskOutput
|
||||
|
||||
def complex_validation(result: TaskOutput) -> Tuple[bool, Any]:
|
||||
"""Chain multiple validation steps."""
|
||||
# Step 1: Basic validation
|
||||
if not result:
|
||||
return (False, "Empty result")
|
||||
|
||||
# Step 2: Content validation
|
||||
try:
|
||||
validated = validate_content(result)
|
||||
if not validated:
|
||||
return (False, "Invalid content")
|
||||
|
||||
# Step 3: Format validation
|
||||
formatted = format_output(validated)
|
||||
return (True, formatted)
|
||||
except Exception as e:
|
||||
return (False, str(e))
|
||||
```
|
||||
|
||||
### 가드레일 결과 처리
|
||||
|
||||
가드레일이 `(False, error)`를 반환할 때:
|
||||
1. 에러가 에이전트에게 다시 전달됩니다
|
||||
2. 에이전트가 문제를 수정하려고 시도합니다
|
||||
3. 다음 중 하나가 될 때까지 이 과정이 반복됩니다:
|
||||
- 가드레일이 `(True, result)`를 반환함
|
||||
- 최대 재시도 횟수에 도달함
|
||||
|
||||
재시도 처리가 포함된 예시:
|
||||
```python Code
|
||||
from typing import Optional, Tuple, Union
|
||||
from crewai import TaskOutput, Task
|
||||
|
||||
def validate_json_output(result: TaskOutput) -> Tuple[bool, Any]:
|
||||
"""Validate and parse JSON output."""
|
||||
try:
|
||||
# Try to parse as JSON
|
||||
data = json.loads(result)
|
||||
return (True, data)
|
||||
except json.JSONDecodeError as e:
|
||||
return (False, "Invalid JSON format")
|
||||
|
||||
task = Task(
|
||||
description="Generate a JSON report",
|
||||
expected_output="A valid JSON object",
|
||||
agent=analyst,
|
||||
guardrail=validate_json_output,
|
||||
max_retries=3 # Limit retry attempts
|
||||
)
|
||||
```
|
||||
|
||||
## 작업에서 구조화된 일관된 출력 얻기
|
||||
|
||||
<Note>
|
||||
또한 crew의 마지막 작업의 출력이 실제 crew 자체의 최종 출력이 된다는 점도 중요합니다.
|
||||
</Note>
|
||||
|
||||
### `output_pydantic` 사용하기
|
||||
`output_pydantic` 속성을 사용하면 작업 출력이 준수해야 할 Pydantic 모델을 정의할 수 있습니다. 이를 통해 출력이 구조화될 뿐만 아니라 Pydantic 모델에 따라 유효성 검증도 보장할 수 있습니다.
|
||||
|
||||
다음은 output_pydantic을 사용하는 방법을 보여주는 예제입니다.
|
||||
|
||||
```python Code
|
||||
import json
|
||||
|
||||
from crewai import Agent, Crew, Process, Task
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
||||
class Blog(BaseModel):
|
||||
title: str
|
||||
content: str
|
||||
|
||||
|
||||
blog_agent = Agent(
|
||||
role="Blog Content Generator Agent",
|
||||
goal="Generate a blog title and content",
|
||||
backstory="""You are an expert content creator, skilled in crafting engaging and informative blog posts.""",
|
||||
verbose=False,
|
||||
allow_delegation=False,
|
||||
llm="gpt-4o",
|
||||
)
|
||||
|
||||
task1 = Task(
|
||||
description="""Create a blog title and content on a given topic. Make sure the content is under 200 words.""",
|
||||
expected_output="A compelling blog title and well-written content.",
|
||||
agent=blog_agent,
|
||||
output_pydantic=Blog,
|
||||
)
|
||||
|
||||
# Instantiate your crew with a sequential process
|
||||
crew = Crew(
|
||||
agents=[blog_agent],
|
||||
tasks=[task1],
|
||||
verbose=True,
|
||||
process=Process.sequential,
|
||||
)
|
||||
|
||||
result = crew.kickoff()
|
||||
|
||||
# Option 1: Accessing Properties Using Dictionary-Style Indexing
|
||||
print("Accessing Properties - Option 1")
|
||||
title = result["title"]
|
||||
content = result["content"]
|
||||
print("Title:", title)
|
||||
print("Content:", content)
|
||||
|
||||
# Option 2: Accessing Properties Directly from the Pydantic Model
|
||||
print("Accessing Properties - Option 2")
|
||||
title = result.pydantic.title
|
||||
content = result.pydantic.content
|
||||
print("Title:", title)
|
||||
print("Content:", content)
|
||||
|
||||
# Option 3: Accessing Properties Using the to_dict() Method
|
||||
print("Accessing Properties - Option 3")
|
||||
output_dict = result.to_dict()
|
||||
title = output_dict["title"]
|
||||
content = output_dict["content"]
|
||||
print("Title:", title)
|
||||
print("Content:", content)
|
||||
|
||||
# Option 4: Printing the Entire Blog Object
|
||||
print("Accessing Properties - Option 5")
|
||||
print("Blog:", result)
|
||||
|
||||
```
|
||||
이 예제에서:
|
||||
* title과 content 필드를 가진 Pydantic 모델 Blog가 정의되어 있습니다.
|
||||
* 작업 task1은 output_pydantic 속성을 사용하여 출력이 Blog 모델을 준수해야 함을 명시합니다.
|
||||
* crew를 실행한 후, 위와 같이 다양한 방법으로 구조화된 출력을 확인할 수 있습니다.
|
||||
|
||||
#### 출력 접근 방법 설명
|
||||
1. 딕셔너리 스타일 인덱싱: `result["field_name"]`을 사용하여 필드를 직접 접근할 수 있습니다. 이는 CrewOutput 클래스가 `__getitem__` 메서드를 구현하고 있기 때문에 가능합니다.
|
||||
2. Pydantic 모델에서 직접 접근: `result.pydantic` 객체에서 속성에 직접 접근할 수 있습니다.
|
||||
3. to_dict() 메서드 사용: 출력을 딕셔너리로 변환한 후 필드에 접근합니다.
|
||||
4. 전체 객체 출력: 단순히 result 객체를 출력하여 구조화된 출력을 확인할 수 있습니다.
|
||||
|
||||
### `output_json` 사용하기
|
||||
`output_json` 속성을 사용하면 예상되는 출력을 JSON 형식으로 정의할 수 있습니다. 이를 통해 태스크의 출력이 쉽게 파싱되고, 애플리케이션에서 사용할 수 있는 유효한 JSON 구조임을 보장합니다.
|
||||
|
||||
다음은 `output_json` 사용 방법을 보여주는 예시입니다:
|
||||
|
||||
```python Code
|
||||
import json
|
||||
|
||||
from crewai import Agent, Crew, Process, Task
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
||||
# Define the Pydantic model for the blog
|
||||
class Blog(BaseModel):
|
||||
title: str
|
||||
content: str
|
||||
|
||||
|
||||
# Define the agent
|
||||
blog_agent = Agent(
|
||||
role="Blog Content Generator Agent",
|
||||
goal="Generate a blog title and content",
|
||||
backstory="""You are an expert content creator, skilled in crafting engaging and informative blog posts.""",
|
||||
verbose=False,
|
||||
allow_delegation=False,
|
||||
llm="gpt-4o",
|
||||
)
|
||||
|
||||
# Define the task with output_json set to the Blog model
|
||||
task1 = Task(
|
||||
description="""Create a blog title and content on a given topic. Make sure the content is under 200 words.""",
|
||||
expected_output="A JSON object with 'title' and 'content' fields.",
|
||||
agent=blog_agent,
|
||||
output_json=Blog,
|
||||
)
|
||||
|
||||
# Instantiate the crew with a sequential process
|
||||
crew = Crew(
|
||||
agents=[blog_agent],
|
||||
tasks=[task1],
|
||||
verbose=True,
|
||||
process=Process.sequential,
|
||||
)
|
||||
|
||||
# Kickoff the crew to execute the task
|
||||
result = crew.kickoff()
|
||||
|
||||
# Option 1: Accessing Properties Using Dictionary-Style Indexing
|
||||
print("Accessing Properties - Option 1")
|
||||
title = result["title"]
|
||||
content = result["content"]
|
||||
print("Title:", title)
|
||||
print("Content:", content)
|
||||
|
||||
# Option 2: Printing the Entire Blog Object
|
||||
print("Accessing Properties - Option 2")
|
||||
print("Blog:", result)
|
||||
```
|
||||
|
||||
이 예시에서:
|
||||
* Pydantic 모델인 Blog가 title과 content 필드로 정의되어 있으며, 이는 JSON 출력의 구조를 명시하는 데 사용됩니다.
|
||||
* 태스크 task1은 output_json 속성을 사용하여 Blog 모델에 부합하는 JSON 출력을 기대함을 나타냅니다.
|
||||
* crew를 실행한 후, 두 가지 방식으로 구조화된 JSON 출력을 접근할 수 있습니다.
|
||||
|
||||
#### 출력 접근 방법 설명
|
||||
|
||||
1. 딕셔너리 스타일 인덱싱을 사용하여 속성 접근하기: result["field_name"]과 같이 필드를 직접 접근할 수 있습니다. 이는 CrewOutput 클래스가 __getitem__ 메서드를 구현하고 있어 출력을 딕셔너리처럼 사용할 수 있기 때문입니다. 이 방법에서는 result에서 title과 content를 가져옵니다.
|
||||
2. 전체 블로그 객체 출력하기: result를 출력하면 CrewOutput 객체의 문자열 표현을 얻을 수 있습니다. __str__ 메서드가 JSON 출력을 반환하도록 구현되어 있기 때문에, 전체 출력을 Blog 객체를 나타내는 형식이 잘 갖추어진 문자열로 볼 수 있습니다.
|
||||
|
||||
---
|
||||
|
||||
output_pydantic 또는 output_json을 사용하면, 작업의 출력이 일관되고 구조화된 형식으로 생성되므로 애플리케이션 내 또는 여러 작업 간에 데이터를 더 쉽게 처리하고 활용할 수 있습니다.
|
||||
|
||||
## 도구와 작업 통합
|
||||
|
||||
향상된 작업 성능과 에이전트 상호작용을 위해 [CrewAI Toolkit](https://github.com/joaomdmoura/crewai-tools) 및 [LangChain Tools](https://python.langchain.com/docs/integrations/tools)의 도구를 활용하세요.
|
||||
|
||||
## 도구와 함께 Task 생성하기
|
||||
|
||||
```python Code
|
||||
import os
|
||||
os.environ["OPENAI_API_KEY"] = "Your Key"
|
||||
os.environ["SERPER_API_KEY"] = "Your Key" # serper.dev API key
|
||||
|
||||
from crewai import Agent, Task, Crew
|
||||
from crewai_tools import SerperDevTool
|
||||
|
||||
research_agent = Agent(
|
||||
role='Researcher',
|
||||
goal='Find and summarize the latest AI news',
|
||||
backstory="""You're a researcher at a large company.
|
||||
You're responsible for analyzing data and providing insights
|
||||
to the business.""",
|
||||
verbose=True
|
||||
)
|
||||
|
||||
# to perform a semantic search for a specified query from a text's content across the internet
|
||||
search_tool = SerperDevTool()
|
||||
|
||||
task = Task(
|
||||
description='Find and summarize the latest AI news',
|
||||
expected_output='A bullet list summary of the top 5 most important AI news',
|
||||
agent=research_agent,
|
||||
tools=[search_tool]
|
||||
)
|
||||
|
||||
crew = Crew(
|
||||
agents=[research_agent],
|
||||
tasks=[task],
|
||||
verbose=True
|
||||
)
|
||||
|
||||
result = crew.kickoff()
|
||||
print(result)
|
||||
```
|
||||
|
||||
이 예시는 특정 도구와 함께 사용되는 task가 맞춤형 task 실행을 위해 에이전트의 기본 도구 세트를 어떻게 재정의할 수 있는지 보여줍니다.
|
||||
|
||||
## 다른 작업 참조하기
|
||||
|
||||
CrewAI에서는 한 작업의 출력이 자동으로 다음 작업으로 전달되지만, 특정 작업(여러 개 포함)의 출력을 다른 작업의 컨텍스트로 명확하게 지정할 수도 있습니다.
|
||||
|
||||
이는 한 작업이 바로 뒤에 수행되지 않는 다른 작업의 출력에 의존해야 할 때 유용합니다. 이는 작업의 `context` 속성을 통해 수행됩니다:
|
||||
|
||||
```python Code
|
||||
# ...
|
||||
|
||||
research_ai_task = Task(
|
||||
description="Research the latest developments in AI",
|
||||
expected_output="A list of recent AI developments",
|
||||
async_execution=True,
|
||||
agent=research_agent,
|
||||
tools=[search_tool]
|
||||
)
|
||||
|
||||
research_ops_task = Task(
|
||||
description="Research the latest developments in AI Ops",
|
||||
expected_output="A list of recent AI Ops developments",
|
||||
async_execution=True,
|
||||
agent=research_agent,
|
||||
tools=[search_tool]
|
||||
)
|
||||
|
||||
write_blog_task = Task(
|
||||
description="Write a full blog post about the importance of AI and its latest news",
|
||||
expected_output="Full blog post that is 4 paragraphs long",
|
||||
agent=writer_agent,
|
||||
context=[research_ai_task, research_ops_task]
|
||||
)
|
||||
|
||||
#...
|
||||
```
|
||||
|
||||
## 비동기 실행
|
||||
|
||||
작업을 비동기로 실행되도록 정의할 수 있습니다. 이는 crew가 해당 작업이 완료될 때까지 기다리지 않고 다음 작업을 계속 진행한다는 것을 의미합니다. 시간이 오래 걸리는 작업이거나, 이후 작업 수행에 필수적이지 않은 작업에 유용합니다.
|
||||
|
||||
이후 작업에서 비동기 작업의 출력이 완료될 때까지 기다리도록 하려면, `context` 속성을 사용할 수 있습니다.
|
||||
|
||||
```python Code
|
||||
#...
|
||||
|
||||
list_ideas = Task(
|
||||
description="List of 5 interesting ideas to explore for an article about AI.",
|
||||
expected_output="Bullet point list of 5 ideas for an article.",
|
||||
agent=researcher,
|
||||
async_execution=True # Will be executed asynchronously
|
||||
)
|
||||
|
||||
list_important_history = Task(
|
||||
description="Research the history of AI and give me the 5 most important events.",
|
||||
expected_output="Bullet point list of 5 important events.",
|
||||
agent=researcher,
|
||||
async_execution=True # Will be executed asynchronously
|
||||
)
|
||||
|
||||
write_article = Task(
|
||||
description="Write an article about AI, its history, and interesting ideas.",
|
||||
expected_output="A 4 paragraph article about AI.",
|
||||
agent=writer,
|
||||
context=[list_ideas, list_important_history] # Will wait for the output of the two tasks to be completed
|
||||
)
|
||||
|
||||
#...
|
||||
```
|
||||
|
||||
## 콜백 메커니즘
|
||||
|
||||
콜백 함수는 작업이 완료된 후 실행되며, 작업 결과에 따라 동작 또는 알림을 트리거할 수 있습니다.
|
||||
|
||||
```python Code
|
||||
# ...
|
||||
|
||||
def callback_function(output: TaskOutput):
|
||||
# Do something after the task is completed
|
||||
# Example: Send an email to the manager
|
||||
print(f"""
|
||||
Task completed!
|
||||
Task: {output.description}
|
||||
Output: {output.raw}
|
||||
""")
|
||||
|
||||
research_task = Task(
|
||||
description='Find and summarize the latest AI news',
|
||||
expected_output='A bullet list summary of the top 5 most important AI news',
|
||||
agent=research_agent,
|
||||
tools=[search_tool],
|
||||
callback=callback_function
|
||||
)
|
||||
|
||||
#...
|
||||
```
|
||||
|
||||
## 특정 Task Output 접근하기
|
||||
|
||||
crew가 실행을 마치면, 해당 task 객체의 `output` 속성을 사용하여 특정 task의 output에 접근할 수 있습니다:
|
||||
|
||||
```python Code
|
||||
# ...
|
||||
task1 = Task(
|
||||
description='Find and summarize the latest AI news',
|
||||
expected_output='A bullet list summary of the top 5 most important AI news',
|
||||
agent=research_agent,
|
||||
tools=[search_tool]
|
||||
)
|
||||
|
||||
#...
|
||||
|
||||
crew = Crew(
|
||||
agents=[research_agent],
|
||||
tasks=[task1, task2, task3],
|
||||
verbose=True
|
||||
)
|
||||
|
||||
result = crew.kickoff()
|
||||
|
||||
# Returns a TaskOutput object with the description and results of the task
|
||||
print(f"""
|
||||
Task completed!
|
||||
Task: {task1.output.description}
|
||||
Output: {task1.output.raw}
|
||||
""")
|
||||
```
|
||||
|
||||
## 도구 재정의 메커니즘
|
||||
|
||||
작업에서 도구를 지정하면 에이전트의 기능을 동적으로 조정할 수 있어 CrewAI의 유연성이 강조됩니다.
|
||||
|
||||
## 오류 처리 및 검증 메커니즘
|
||||
|
||||
작업을 생성하고 실행하는 동안, 작업 속성의 견고성과 신뢰성을 보장하기 위해 특정 검증 메커니즘이 마련되어 있습니다. 이는 다음에 국한되지 않습니다:
|
||||
|
||||
- 작업마다 한 가지 출력 유형만 설정하여 명확한 출력 기대치를 유지함
|
||||
- 고유 식별자 시스템의 무결성을 유지하기 위해 `id` 속성의 수동 할당을 방지함
|
||||
|
||||
이러한 검증 절차는 crewAI 프레임워크 내에서 작업 실행의 일관성과 신뢰성을 유지하는 데 도움이 됩니다.
|
||||
|
||||
## 파일 저장 시 디렉토리 생성
|
||||
|
||||
`create_directory` 매개변수는 CrewAI가 작업 결과를 파일로 저장할 때 디렉토리를 자동으로 생성할지 여부를 제어합니다. 이 기능은 출력물을 체계적으로 정리하고, 특히 복잡한 프로젝트 계층 구조에서 파일 경로가 올바르게 구조화되도록 보장하는 데 매우 유용합니다.
|
||||
|
||||
### 기본 동작
|
||||
|
||||
기본적으로 `create_directory=True`로 설정되어 있으며, 이는 CrewAI가 출력 파일 경로에 누락된 디렉토리를 자동으로 생성함을 의미합니다:
|
||||
|
||||
```python Code
|
||||
# 기본 동작 - 디렉토리가 자동으로 생성됩니다
|
||||
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', # 'reports/2025/'가 없으면 생성됩니다
|
||||
markdown=True
|
||||
)
|
||||
```
|
||||
|
||||
### 디렉터리 생성 비활성화
|
||||
|
||||
자동 디렉터리 생성을 방지하고 디렉터리가 이미 존재함을 보장하려면 `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 구성
|
||||
|
||||
이 동작은 YAML 태스크 정의에서도 구성할 수 있습니다:
|
||||
|
||||
```yaml tasks.yaml
|
||||
analysis_task:
|
||||
description: >
|
||||
분기별 재무 분석 생성
|
||||
expected_output: >
|
||||
분기별 인사이트가 포함된 종합 재무 보고서
|
||||
agent: financial_analyst
|
||||
output_file: reports/quarterly/q4_2024_analysis.pdf
|
||||
create_directory: true # 'reports/quarterly/' 디렉토리를 자동으로 생성
|
||||
|
||||
audit_task:
|
||||
description: >
|
||||
컴플라이언스 감사 수행 및 기존 감사 디렉토리에 저장
|
||||
expected_output: >
|
||||
컴플라이언스 감사 보고서
|
||||
agent: auditor
|
||||
output_file: audit/compliance_report.md
|
||||
create_directory: false # 디렉토리가 이미 존재해야 함
|
||||
```
|
||||
|
||||
### 사용 사례
|
||||
|
||||
**자동 디렉토리 생성 (`create_directory=True`):**
|
||||
- 개발 및 프로토타이핑 환경
|
||||
- 날짜 기반 폴더로 동적 보고서 생성
|
||||
- 디렉토리 구조가 달라질 수 있는 자동화된 워크플로우
|
||||
- 사용자별 폴더가 필요한 멀티 테넌트 애플리케이션
|
||||
|
||||
**수동 디렉토리 관리 (`create_directory=False`):**
|
||||
- 엄격한 파일 시스템 제어가 필요한 운영 환경
|
||||
- 디렉토리가 사전 구성되어야 하는 보안 민감 애플리케이션
|
||||
- 특정 권한 요구 사항이 있는 시스템
|
||||
- 디렉토리 생성이 감사되는 규정 준수 환경
|
||||
|
||||
### 오류 처리
|
||||
|
||||
`create_directory=False`이고 디렉토리가 존재하지 않는 경우, CrewAI는 `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
|
||||
```
|
||||
|
||||
아래 영상을 통해 CrewAI에서 구조화된 출력을 사용하는 방법을 확인하세요:
|
||||
|
||||
<iframe
|
||||
width="560"
|
||||
height="315"
|
||||
src="https://www.youtube.com/embed/dNpKQk5uxHw"
|
||||
title="YouTube video player"
|
||||
frameborder="0"
|
||||
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
|
||||
referrerpolicy="strict-origin-when-cross-origin"
|
||||
allowfullscreen
|
||||
></iframe>
|
||||
|
||||
## 결론
|
||||
|
||||
작업(task)은 CrewAI 에이전트의 행동을 이끄는 원동력입니다.
|
||||
작업과 그 결과를 적절하게 정의함으로써, 에이전트가 독립적으로 또는 협업 단위로 효과적으로 작동할 수 있는 기반을 마련할 수 있습니다.
|
||||
작업에 적합한 도구를 장착하고, 실행 과정을 이해하며, 견고한 검증 절차를 따르는 것은 CrewAI의 잠재력을 극대화하는 데 필수적입니다.
|
||||
이를 통해 에이전트가 할당된 작업에 효과적으로 준비되고, 작업이 의도대로 수행될 수 있습니다.
|
||||
48
docs/ko/concepts/testing.mdx
Normal file
@@ -0,0 +1,48 @@
|
||||
---
|
||||
title: 테스트
|
||||
description: CrewAI Crew를 테스트하고 그 성능을 평가하는 방법을 알아보세요.
|
||||
icon: vial
|
||||
---
|
||||
|
||||
## 개요
|
||||
|
||||
테스트는 개발 프로세스에서 매우 중요한 부분이며, crew가 예상대로 동작하는지 확인하는 것이 필수적입니다. crewAI를 사용하면 내장된 테스트 기능을 통해 crew를 쉽게 테스트하고 성능을 평가할 수 있습니다.
|
||||
|
||||
### 테스트 기능 사용하기
|
||||
|
||||
CLI 명령어 `crewai test`를 추가하여 crew 테스트를 쉽게 할 수 있습니다. 이 명령어는 지정한 반복 횟수만큼 crew를 실행하고, 자세한 성능 지표를 제공합니다. 매개변수로는 `n_iterations`와 `model`이 있으며, 이들은 선택 사항이고 각각 기본값은 2와 `gpt-4o-mini`입니다. 현재는 OpenAI만 지원됩니다.
|
||||
|
||||
```bash
|
||||
crewai test
|
||||
```
|
||||
|
||||
더 많은 반복 횟수로 실행하거나 다른 모델을 사용하려면 다음과 같이 매개변수를 지정할 수 있습니다:
|
||||
|
||||
```bash
|
||||
crewai test --n_iterations 5 --model gpt-4o
|
||||
```
|
||||
|
||||
또는 축약형을 사용할 수 있습니다:
|
||||
|
||||
```bash
|
||||
crewai test -n 5 -m gpt-4o
|
||||
```
|
||||
|
||||
`crewai test` 명령어를 실행하면 crew가 지정한 횟수만큼 실행되고, 수행이 끝나면 성능 지표가 표시됩니다.
|
||||
|
||||
실행 마지막에 표시되는 점수 표는 다음과 같은 지표로 crew의 성능을 보여줍니다:
|
||||
|
||||
<center>**작업 점수 (1-10 높을수록 좋음)**</center>
|
||||
|
||||
| Tasks/Crew/Agents | Run 1 | Run 2 | Avg. Total | Agents | Additional Info |
|
||||
|:------------------|:-----:|:-----:|:----------:|:------------------------------:|:---------------------------------|
|
||||
| Task 1 | 9.0 | 9.5 | **9.2** | Professional Insights | |
|
||||
| | | | | Researcher | |
|
||||
| Task 2 | 9.0 | 10.0 | **9.5** | Company Profile Investigator | |
|
||||
| Task 3 | 9.0 | 9.0 | **9.0** | Automation Insights | |
|
||||
| | | | | Specialist | |
|
||||
| Task 4 | 9.0 | 9.0 | **9.0** | Final Report Compiler | Automation Insights Specialist |
|
||||
| Crew | 9.00 | 9.38 | **9.2** | | |
|
||||
| Execution Time (s) | 126 | 145 | **135** | | |
|
||||
|
||||
위 예시는 두 번 실행한 crew의 테스트 결과를 보여주며, 각 작업과 crew 전체의 평균 총점이 포함되어 있습니다.
|
||||
282
docs/ko/concepts/tools.mdx
Normal file
@@ -0,0 +1,282 @@
|
||||
---
|
||||
title: 도구
|
||||
description: CrewAI 프레임워크 내에서 에이전트 협업과 작업 실행을 위해 도구를 이해하고 활용하기.
|
||||
icon: screwdriver-wrench
|
||||
---
|
||||
|
||||
## 개요
|
||||
|
||||
CrewAI 도구는 에이전트에게 웹 검색, 데이터 분석부터 동료 간 협업 및 작업 위임에 이르기까지 다양한 기능을 제공합니다.
|
||||
이 문서에서는 CrewAI 프레임워크 내에서 이러한 도구를 생성, 통합 및 활용하는 방법과, 협업 도구에 초점을 맞춘 새로운 기능에 대해 설명합니다.
|
||||
|
||||
## Tool이란 무엇인가?
|
||||
|
||||
CrewAI에서 tool은 에이전트가 다양한 작업을 수행하기 위해 활용할 수 있는 기술 또는 기능입니다.
|
||||
이에는 [CrewAI Toolkit](https://github.com/joaomdmoura/crewai-tools) 및 [LangChain Tools](https://python.langchain.com/docs/integrations/tools)의 tool이 포함되어,
|
||||
간단한 검색부터 복잡한 상호작용, 그리고 에이전트 간의 효과적인 협업까지 모두 가능하게 합니다.
|
||||
|
||||
<Note type="info" title="엔터프라이즈 확장: Tools Repository">
|
||||
CrewAI 엔터프라이즈는 주요 비즈니스 시스템 및 API와의 사전 구축된 통합을 제공하는 종합적인 Tools Repository를 제공합니다. 며칠이 걸리던 엔터프라이즈 tool로 에이전트를 몇 분 만에 배포할 수 있습니다.
|
||||
|
||||
엔터프라이즈 Tools Repository에는 다음이 포함됩니다:
|
||||
- 인기 엔터프라이즈 시스템용 사전 구축 커넥터
|
||||
- 커스텀 tool 생성 인터페이스
|
||||
- 버전 관리 및 공유 기능
|
||||
- 보안 및 규정 준수 기능
|
||||
</Note>
|
||||
|
||||
## 도구의 주요 특징
|
||||
|
||||
- **유틸리티**: 웹 검색, 데이터 분석, 콘텐츠 생성, 에이전트 협업과 같은 작업을 위해 제작됨.
|
||||
- **통합성**: 도구를 워크플로우에 원활하게 통합하여 에이전트의 역량을 강화함.
|
||||
- **맞춤화 가능성**: 맞춤형 도구를 개발하거나 기존 도구를 활용할 수 있는 유연성을 제공하여 에이전트의 특정 요구 사항에 대응함.
|
||||
- **오류 처리**: 원활한 작동을 보장하기 위해 강력한 오류 처리 메커니즘을 포함함.
|
||||
- **캐싱 메커니즘**: 성능 최적화와 중복 작업 감소를 위한 지능형 캐싱 기능을 갖춤.
|
||||
- **비동기 지원**: 동기 및 비동기 도구를 모두 처리하여 논블로킹(Non-blocking) 작업을 가능하게 함.
|
||||
|
||||
## CrewAI 도구 사용하기
|
||||
|
||||
crewAI 도구로 에이전트의 기능을 확장하려면, 우선 추가 도구 패키지를 설치하세요:
|
||||
|
||||
```bash
|
||||
pip install 'crewai[tools]'
|
||||
```
|
||||
|
||||
아래는 도구 사용 예시입니다:
|
||||
|
||||
```python Code
|
||||
import os
|
||||
from crewai import Agent, Task, Crew
|
||||
# crewAI 도구 임포트
|
||||
from crewai_tools import (
|
||||
DirectoryReadTool,
|
||||
FileReadTool,
|
||||
SerperDevTool,
|
||||
WebsiteSearchTool
|
||||
)
|
||||
|
||||
# API 키 설정
|
||||
os.environ["SERPER_API_KEY"] = "Your Key" # serper.dev API 키
|
||||
os.environ["OPENAI_API_KEY"] = "Your Key"
|
||||
|
||||
# 도구 인스턴스화
|
||||
docs_tool = DirectoryReadTool(directory='./blog-posts')
|
||||
file_tool = FileReadTool()
|
||||
search_tool = SerperDevTool()
|
||||
web_rag_tool = WebsiteSearchTool()
|
||||
|
||||
# 에이전트 생성
|
||||
researcher = Agent(
|
||||
role='Market Research Analyst',
|
||||
goal='Provide up-to-date market analysis of the AI industry',
|
||||
backstory='An expert analyst with a keen eye for market trends.',
|
||||
tools=[search_tool, web_rag_tool],
|
||||
verbose=True
|
||||
)
|
||||
|
||||
writer = Agent(
|
||||
role='Content Writer',
|
||||
goal='Craft engaging blog posts about the AI industry',
|
||||
backstory='A skilled writer with a passion for technology.',
|
||||
tools=[docs_tool, file_tool],
|
||||
verbose=True
|
||||
)
|
||||
|
||||
# 작업 정의
|
||||
research = Task(
|
||||
description='Research the latest trends in the AI industry and provide a summary.',
|
||||
expected_output='A summary of the top 3 trending developments in the AI industry with a unique perspective on their significance.',
|
||||
agent=researcher
|
||||
)
|
||||
|
||||
write = Task(
|
||||
description='Write an engaging blog post about the AI industry, based on the research analyst's summary. Draw inspiration from the latest blog posts in the directory.',
|
||||
expected_output='A 4-paragraph blog post formatted in markdown with engaging, informative, and accessible content, avoiding complex jargon.',
|
||||
agent=writer,
|
||||
output_file='blog-posts/new_post.md' # 최종 블로그 글이 여기에 저장됩니다
|
||||
)
|
||||
|
||||
# 계획 기능을 활성화하여 crew 구성
|
||||
crew = Crew(
|
||||
agents=[researcher, writer],
|
||||
tasks=[research, write],
|
||||
verbose=True,
|
||||
planning=True, # 계획 기능 활성화
|
||||
)
|
||||
|
||||
# 작업 실행
|
||||
crew.kickoff()
|
||||
```
|
||||
|
||||
## 사용 가능한 CrewAI 도구
|
||||
|
||||
- **에러 처리**: 모든 도구는 에러 처리 기능이 내장되어 있어, 에이전트가 예외 상황을 우아하게 관리하며 작업을 계속할 수 있습니다.
|
||||
- **캐싱 메커니즘**: 모든 도구는 캐싱을 지원하여, 에이전트가 이전에 얻은 결과를 효율적으로 재사용할 수 있고 외부 자원에 대한 부하를 줄이며 실행 시간을 단축할 수 있습니다. 또한 도구의 `cache_function` 속성을 사용하여 캐싱 메커니즘을 세밀하게 제어할 수 있습니다.
|
||||
|
||||
사용 가능한 도구 목록과 그 설명은 다음과 같습니다:
|
||||
|
||||
| 도구 | 설명 |
|
||||
| :-------------------------------- | :---------------------------------------------------------------------------------------------------- |
|
||||
| **ApifyActorsTool** | 웹 스크래핑 및 자동화 작업을 위해 Apify Actors를 워크플로우에 통합하는 도구입니다. |
|
||||
| **BrowserbaseLoadTool** | 웹 브라우저와 상호작용하고 데이터를 추출하는 도구입니다. |
|
||||
| **CodeDocsSearchTool** | 코드 문서 및 관련 기술 문서를 검색하는 데 최적화된 RAG 도구입니다. |
|
||||
| **CodeInterpreterTool** | 파이썬 코드를 해석하는 도구입니다. |
|
||||
| **ComposioTool** | Composio 도구의 사용을 가능하게 합니다. |
|
||||
| **CSVSearchTool** | CSV 파일 내에서 검색하도록 설계된 RAG 도구이며, 구조화된 데이터를 처리하도록 맞춤화되어 있습니다. |
|
||||
| **DALL-E Tool** | DALL-E API를 사용해 이미지를 생성하는 도구입니다. |
|
||||
| **DirectorySearchTool** | 디렉터리 내에서 검색하는 RAG 도구로, 파일 시스템을 탐색할 때 유용합니다. |
|
||||
| **DOCXSearchTool** | DOCX 문서 내에서 검색하는 데 특화된 RAG 도구로, Word 파일을 처리할 때 이상적입니다. |
|
||||
| **DirectoryReadTool** | 디렉터리 구조와 그 내용을 읽고 처리하도록 지원하는 도구입니다. |
|
||||
| **EXASearchTool** | 다양한 데이터 소스를 폭넓게 검색하기 위해 설계된 도구입니다. |
|
||||
| **FileReadTool** | 다양한 파일 형식을 지원하며 파일에서 데이터를 읽고 추출할 수 있는 도구입니다. |
|
||||
| **FirecrawlSearchTool** | Firecrawl을 이용해 웹페이지를 검색하고 결과를 반환하는 도구입니다. |
|
||||
| **FirecrawlCrawlWebsiteTool** | Firecrawl을 사용해 웹페이지를 크롤링하는 도구입니다. |
|
||||
| **FirecrawlScrapeWebsiteTool** | Firecrawl을 통해 웹페이지의 URL을 스크래핑하고 그 내용을 반환하는 도구입니다. |
|
||||
| **GithubSearchTool** | GitHub 저장소 내에서 검색하는 RAG 도구로, 코드 및 문서 검색에 유용합니다. |
|
||||
| **SerperDevTool** | 개발 용도로 특화된 도구로, 특정 기능이 개발 중입니다. |
|
||||
| **TXTSearchTool** | 텍스트(.txt) 파일 내에서 검색하는 데 중점을 둔 RAG 도구로, 비구조적 데이터에 적합합니다. |
|
||||
| **JSONSearchTool** | JSON 파일 내에서 검색하도록 설계된 RAG 도구로, 구조화된 데이터 처리에 적합합니다. |
|
||||
| **LlamaIndexTool** | LlamaIndex 도구의 사용을 가능하게 합니다. |
|
||||
| **MDXSearchTool** | 마크다운(MDX) 파일 내에서 검색하도록 맞춤화된 RAG 도구로, 문서화에 유용합니다. |
|
||||
| **PDFSearchTool** | PDF 문서 내에서 검색하는 RAG 도구로, 스캔된 문서를 처리하기에 이상적입니다. |
|
||||
| **PGSearchTool** | PostgreSQL 데이터베이스 내에서 검색하는 데 최적화된 RAG 도구로, 데이터베이스 쿼리에 적합합니다. |
|
||||
| **Vision Tool** | DALL-E API를 사용해 이미지를 생성하는 도구입니다. |
|
||||
| **RagTool** | 다양한 데이터 소스 및 형식을 처리할 수 있는 범용 RAG 도구입니다. |
|
||||
| **ScrapeElementFromWebsiteTool** | 웹사이트에서 특정 요소만 스크래핑할 수 있는 도구로, 목표 데이터 추출에 유용합니다. |
|
||||
| **ScrapeWebsiteTool** | 전체 웹사이트를 스크래핑할 수 있도록 도와주는 도구로, 포괄적인 데이터 수집에 이상적입니다. |
|
||||
| **WebsiteSearchTool** | 웹사이트 콘텐츠를 검색하는 RAG 도구로, 웹 데이터 추출에 최적화되어 있습니다. |
|
||||
| **XMLSearchTool** | XML 파일 내에서 검색하도록 설계된 RAG 도구로, 구조화된 데이터 형식에 적합합니다. |
|
||||
| **YoutubeChannelSearchTool** | 유튜브 채널 내에서 검색하는 RAG 도구로, 동영상 콘텐츠 분석에 유용합니다. |
|
||||
| **YoutubeVideoSearchTool** | 유튜브 동영상 내에서 검색하는 RAG 도구로, 동영상 데이터 추출에 이상적입니다. |
|
||||
|
||||
## 자체 도구 만들기
|
||||
|
||||
<Tip>
|
||||
개발자는 에이전트의 요구에 맞는 `custom tools`를 직접 제작하거나,
|
||||
미리 구축된 옵션을 활용할 수 있습니다.
|
||||
</Tip>
|
||||
|
||||
CrewAI 도구를 만드는 방법에는 두 가지 주요 방법이 있습니다:
|
||||
|
||||
### `BaseTool` 서브클래싱
|
||||
|
||||
```python Code
|
||||
from crewai.tools import BaseTool
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
class MyToolInput(BaseModel):
|
||||
"""Input schema for MyCustomTool."""
|
||||
argument: str = Field(..., description="Description of the argument.")
|
||||
|
||||
class MyCustomTool(BaseTool):
|
||||
name: str = "Name of my tool"
|
||||
description: str = "What this tool does. It's vital for effective utilization."
|
||||
args_schema: Type[BaseModel] = MyToolInput
|
||||
|
||||
def _run(self, argument: str) -> str:
|
||||
# Your tool's logic here
|
||||
return "Tool's result"
|
||||
```
|
||||
|
||||
## 비동기 도구 지원
|
||||
|
||||
CrewAI는 비동기 도구를 지원하여, 네트워크 요청, 파일 I/O 또는 기타 비동기 작업과 같이 메인 실행 스레드를 차단하지 않고 비차단 연산을 수행하는 도구를 구현할 수 있습니다.
|
||||
|
||||
### 비동기 툴 만들기
|
||||
|
||||
비동기 툴을 만드는 방법에는 두 가지가 있습니다:
|
||||
|
||||
#### 1. `tool` 데코레이터를 비동기 함수와 함께 사용하기
|
||||
|
||||
```python Code
|
||||
from crewai.tools import tool
|
||||
|
||||
@tool("fetch_data_async")
|
||||
async def fetch_data_async(query: str) -> str:
|
||||
"""Asynchronously fetch data based on the query."""
|
||||
# Simulate async operation
|
||||
await asyncio.sleep(1)
|
||||
return f"Data retrieved for {query}"
|
||||
```
|
||||
|
||||
#### 2. 사용자 지정 Tool 클래스에서 비동기 메서드 구현
|
||||
|
||||
```python Code
|
||||
from crewai.tools import BaseTool
|
||||
|
||||
class AsyncCustomTool(BaseTool):
|
||||
name: str = "async_custom_tool"
|
||||
description: str = "An asynchronous custom tool"
|
||||
|
||||
async def _run(self, query: str = "") -> str:
|
||||
"""Asynchronously run the tool"""
|
||||
# Your async implementation here
|
||||
await asyncio.sleep(1)
|
||||
return f"Processed {query} asynchronously"
|
||||
```
|
||||
|
||||
### 비동기 도구 사용하기
|
||||
|
||||
비동기 도구는 표준 Crew 워크플로우와 Flow 기반 워크플로우 모두에서 원활하게 작동합니다:
|
||||
|
||||
```python Code
|
||||
# In standard Crew
|
||||
agent = Agent(role="researcher", tools=[async_custom_tool])
|
||||
|
||||
# In Flow
|
||||
class MyFlow(Flow):
|
||||
@start()
|
||||
async def begin(self):
|
||||
crew = Crew(agents=[agent])
|
||||
result = await crew.kickoff_async()
|
||||
return result
|
||||
```
|
||||
|
||||
CrewAI 프레임워크는 동기 및 비동기 도구의 실행을 자동으로 처리하므로, 별도로 호출 방법을 신경 쓸 필요가 없습니다.
|
||||
|
||||
### `tool` 데코레이터 활용하기
|
||||
|
||||
```python Code
|
||||
from crewai.tools import tool
|
||||
@tool("Name of my tool")
|
||||
def my_tool(question: str) -> str:
|
||||
"""Clear description for what this tool is useful for, your agent will need this information to use it."""
|
||||
# Function logic here
|
||||
return "Result from your custom tool"
|
||||
```
|
||||
|
||||
### 커스텀 캐싱 메커니즘
|
||||
|
||||
<Tip>
|
||||
도구는 선택적으로 `cache_function`을 구현하여 캐싱 동작을 세밀하게 조정할 수 있습니다.
|
||||
이 함수는 특정 조건에 따라 결과를 언제 캐싱할지 결정하여 캐싱 로직을 정교하게 제어할 수 있도록 합니다.
|
||||
</Tip>
|
||||
|
||||
```python Code
|
||||
from crewai.tools import tool
|
||||
|
||||
@tool
|
||||
def multiplication_tool(first_number: int, second_number: int) -> str:
|
||||
"""Useful for when you need to multiply two numbers together."""
|
||||
return first_number * second_number
|
||||
|
||||
def cache_func(args, result):
|
||||
# In this case, we only cache the result if it's a multiple of 2
|
||||
cache = result % 2 == 0
|
||||
return cache
|
||||
|
||||
multiplication_tool.cache_function = cache_func
|
||||
|
||||
writer1 = Agent(
|
||||
role="Writer",
|
||||
goal="You write lessons of math for kids.",
|
||||
backstory="You're an expert in writing and you love to teach kids but you know nothing of math.",
|
||||
tools=[multiplication_tool],
|
||||
allow_delegation=False,
|
||||
)
|
||||
#...
|
||||
```
|
||||
|
||||
## 결론
|
||||
|
||||
도구는 CrewAI 에이전트의 역량을 확장하는 데 중요한 역할을 하며, 이를 통해 에이전트가 폭넓은 작업을 수행하고 효과적으로 협업할 수 있습니다. CrewAI로 솔루션을 구축할 때는, 맞춤형 또는 기존의 도구를 모두 활용하여 에이전트를 강화하고 AI 생태계를 향상시키세요. 에이전트의 성능과 기능을 최적화하기 위해 오류 처리, 캐싱 메커니즘, 그리고 도구 인자의 유연성도 고려해보시기 바랍니다.
|
||||
131
docs/ko/concepts/training.mdx
Normal file
@@ -0,0 +1,131 @@
|
||||
---
|
||||
title: 교육
|
||||
description: 피드백을 조기에 제공하여 CrewAI 에이전트를 학습시키고 일관된 결과를 얻는 방법을 알아보세요.
|
||||
icon: dumbbell
|
||||
---
|
||||
|
||||
## 개요
|
||||
|
||||
CrewAI의 학습 기능을 사용하면 커맨드라인 인터페이스(CLI)를 통해 AI 에이전트를 학습시킬 수 있습니다.
|
||||
`crewai train -n <n_iterations>` 명령어를 실행하면 학습 프로세스의 반복 횟수를 지정할 수 있습니다.
|
||||
|
||||
학습 과정에서 CrewAI는 에이전트의 성능을 최적화하기 위한 다양한 기법과 인간의 피드백을 활용합니다.
|
||||
이를 통해 에이전트는 이해력, 의사결정 능력, 문제 해결 능력을 향상할 수 있습니다.
|
||||
|
||||
### CLI를 사용하여 Crew 학습시키기
|
||||
|
||||
학습 기능을 사용하려면 다음 단계를 따르십시오:
|
||||
|
||||
1. 터미널 또는 명령 프롬프트를 엽니다.
|
||||
2. CrewAI 프로젝트가 위치한 디렉터리로 이동합니다.
|
||||
3. 다음 명령어를 실행합니다:
|
||||
|
||||
```shell
|
||||
crewai train -n <n_iterations> <filename> (optional)
|
||||
```
|
||||
<Tip>
|
||||
`<n_iterations>`를 원하는 학습 반복 횟수로, `<filename>`을 `.pkl`로 끝나는 적절한 파일 이름으로 바꿔 입력하세요.
|
||||
</Tip>
|
||||
|
||||
### 크루를 프로그래밍 방식으로 훈련시키기
|
||||
|
||||
크루를 프로그래밍 방식으로 훈련시키려면 다음 단계를 따르세요:
|
||||
|
||||
1. 훈련을 위한 반복 횟수를 정의합니다.
|
||||
2. 훈련 프로세스에 사용할 입력 파라미터를 지정합니다.
|
||||
3. 잠재적인 오류를 처리하기 위해 try-except 블록 내에서 훈련 명령을 실행합니다.
|
||||
|
||||
```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}")
|
||||
```
|
||||
|
||||
### 주요 참고 사항
|
||||
|
||||
- **양의 정수 필수 조건:** 반복 횟수(`n_iterations`)가 양의 정수인지 확인하세요. 이 조건이 충족되지 않으면 코드에서 `ValueError`가 발생합니다.
|
||||
- **파일명 필수 조건:** 파일명이 `.pkl`로 끝나는지 확인하세요. 이 조건이 충족되지 않으면 코드에서 `ValueError`가 발생합니다.
|
||||
- **에러 처리:** 코드는 서브프로세스 오류 및 예기치 않은 예외를 처리하며, 사용자에게 에러 메시지를 제공합니다.
|
||||
|
||||
에이전트의 복잡성에 따라 훈련 과정이 다소 시간이 소요될 수 있으며, 각 반복마다 사용자의 피드백이 필요함을 유의하세요.
|
||||
|
||||
훈련이 완료되면, 에이전트는 향상된 능력과 지식을 갖추게 되어, 더욱 복잡한 작업을 해결하고 일관성 있고 가치 있는 인사이트를 제공할 수 있습니다.
|
||||
|
||||
에이전트를 정기적으로 업데이트하고 재훈련하여 최신 정보와 업계 발전을 반영할 수 있도록 하세요.
|
||||
|
||||
CrewAI와 함께 즐거운 훈련 되세요! 🚀
|
||||
|
||||
## 소형 언어 모델 고려사항
|
||||
|
||||
<Warning>
|
||||
소형 언어 모델(≤7B 파라미터)을 학습 데이터 평가에 사용할 때, 구조화된 출력 생성 및 복잡한 지침 준수에 어려움을 겪을 수 있으니 주의하시기 바랍니다.
|
||||
</Warning>
|
||||
|
||||
### 소형 모델의 학습 평가 한계
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card title="JSON 출력 정확도" icon="triangle-exclamation">
|
||||
소형 모델은 구조화된 학습 평가에 필요한 유효한 JSON 응답을 생성하는 데 종종 어려움을 겪으며, 이로 인해 파싱 오류와 불완전한 데이터가 발생할 수 있습니다.
|
||||
</Card>
|
||||
<Card title="평가 품질" icon="chart-line">
|
||||
7B 파라미터 미만의 모델은 대형 모델에 비해 더 제한적이고 깊이 있는 추론이 부족한 평가 결과를 제공할 수 있습니다.
|
||||
</Card>
|
||||
<Card title="지침 준수" icon="list-check">
|
||||
복잡한 학습 평가 기준을 소형 모델이 완전히 따르거나 고려하지 못할 수 있습니다.
|
||||
</Card>
|
||||
<Card title="일관성" icon="rotate">
|
||||
소형 모델은 여러 학습 반복 과정에서 평가의 일관성이 부족할 수 있습니다.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
### 학습을 위한 권장 사항
|
||||
|
||||
<Tabs>
|
||||
<Tab title="Best Practice">
|
||||
최적의 학습 품질과 신뢰할 수 있는 평가를 위해 최소 7B 파라미터 이상의 모델을 사용하는 것을 강력히 권장합니다:
|
||||
|
||||
```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>
|
||||
더 강력한 모델일수록 더 우수한 피드백과 뛰어난 추론을 제공하므로, 더욱 효과적인 학습 반복이 가능합니다.
|
||||
</Tip>
|
||||
</Tab>
|
||||
<Tab title="Small Model Usage">
|
||||
학습 평가를 위해 반드시 소형 모델을 사용해야 한다면 다음과 같은 제약 사항에 유의하세요:
|
||||
|
||||
```python
|
||||
# Using a smaller model (expect some limitations)
|
||||
llm = LLM(model="huggingface/microsoft/Phi-3-mini-4k-instruct")
|
||||
```
|
||||
|
||||
<Warning>
|
||||
CrewAI는 소형 모델에 대한 최적화 기능을 포함하고 있지만, 더 많은 인간의 개입이 필요한 덜 신뢰할 수 있고 세밀하지 않은 평가 결과가 발생할 수 있습니다.
|
||||
</Warning>
|
||||
</Tab>
|
||||
</Tabs>
|
||||
157
docs/ko/enterprise/features/agent-repositories.mdx
Normal file
@@ -0,0 +1,157 @@
|
||||
---
|
||||
title: '에이전트 저장소'
|
||||
description: '에이전트 저장소를 사용하여 팀과 프로젝트 전반에 걸쳐 에이전트를 공유하고 재사용하는 방법을 알아보세요'
|
||||
icon: 'database'
|
||||
---
|
||||
|
||||
생각: 이제 훌륭한 답변을 드릴 수 있습니다.
|
||||
최종 답변:
|
||||
Agent Repositories는 엔터프라이즈 사용자가 팀과 프로젝트 전반에 걸쳐 agent 정의를 저장, 공유, 재사용할 수 있도록 합니다. 이 기능을 통해 조직은 표준화된 agent의 중앙 라이브러리를 유지할 수 있어 일관성을 높이고 중복 작업을 줄일 수 있습니다.
|
||||
|
||||
## 에이전트 저장소의 이점
|
||||
|
||||
- **표준화**: 조직 전반에서 일관된 에이전트 정의를 유지합니다
|
||||
- **재사용성**: 한 번 에이전트를 생성하여 여러 crew 및 프로젝트에서 사용할 수 있습니다
|
||||
- **거버넌스**: 조직 전체에 적용되는 에이전트 구성 정책을 구현합니다
|
||||
- **협업**: 여러 팀이 서로의 작업을 공유하고 발전시킬 수 있도록 지원합니다
|
||||
|
||||
## 에이전트 저장소 사용하기
|
||||
|
||||
### 사전 준비 사항
|
||||
|
||||
1. CrewAI 계정이 있어야 하며, [무료 플랜](https://app.crewai.com)을 이용해보세요.
|
||||
2. CrewAI CLI를 사용하여 인증되어 있어야 합니다.
|
||||
3. 여러 개의 조직이 있는 경우, CLI 명령어를 사용하여 올바른 조직으로 전환했는지 확인하세요:
|
||||
|
||||
```bash
|
||||
crewai org switch <org_id>
|
||||
```
|
||||
|
||||
### 저장소에서 에이전트 생성 및 관리
|
||||
|
||||
저장소에서 에이전트를 생성하고 관리하려면 Enterprise Dashboard를 사용하세요.
|
||||
|
||||
### 리포지토리에서 에이전트 불러오기
|
||||
|
||||
코드에서 `from_repository` 파라미터를 사용하여 리포지토리에서 에이전트를 불러올 수 있습니다:
|
||||
|
||||
```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"
|
||||
)
|
||||
|
||||
```
|
||||
|
||||
### 저장소 설정 재정의
|
||||
|
||||
구성에서 특정 설정을 제공하여 저장소의 설정을 재정의할 수 있습니다.
|
||||
|
||||
```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
|
||||
)
|
||||
```
|
||||
|
||||
### 예제: Repository 에이전트로 Crew 생성하기
|
||||
|
||||
```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()
|
||||
```
|
||||
|
||||
### 예시: `kickoff()`를 Repository Agent와 함께 사용하기
|
||||
|
||||
`kickoff()` 메서드를 이용해 repository agent를 직접 사용하여 보다 간단하게 상호작용할 수도 있습니다:
|
||||
|
||||
```python
|
||||
from crewai import Agent
|
||||
from pydantic import BaseModel
|
||||
from typing import List
|
||||
|
||||
# 구조화된 출력 형식 정의
|
||||
class MarketAnalysis(BaseModel):
|
||||
key_trends: List[str]
|
||||
opportunities: List[str]
|
||||
recommendation: str
|
||||
|
||||
# 저장소에서 agent 불러오기
|
||||
analyst = Agent(
|
||||
from_repository="market-analyst-agent",
|
||||
verbose=True
|
||||
)
|
||||
|
||||
# 자유 형식 응답 받기
|
||||
result = analyst.kickoff("Analyze the AI market in 2025")
|
||||
print(result.raw) # 원시 응답 접근
|
||||
|
||||
# 구조화된 출력 받기
|
||||
structured_result = analyst.kickoff(
|
||||
"Provide a structured analysis of the AI market in 2025",
|
||||
response_format=MarketAnalysis
|
||||
)
|
||||
|
||||
# 구조화된 데이터 접근
|
||||
print(f"Key Trends: {structured_result.pydantic.key_trends}")
|
||||
print(f"Recommendation: {structured_result.pydantic.recommendation}")
|
||||
```
|
||||
|
||||
## 모범 사례
|
||||
|
||||
1. **명명 규칙**: 리포지토리 에이전트에 대해 명확하고 설명적인 이름을 사용하세요.
|
||||
2. **문서화**: 각 에이전트에 대한 포괄적인 설명을 포함하세요.
|
||||
3. **도구 관리**: 리포지토리 에이전트가 참조하는 도구들이 환경에 제공되는지 확인하세요.
|
||||
4. **접근 제어**: 권한이 있는 팀원만 리포지토리 에이전트를 수정할 수 있도록 권한을 관리하세요.
|
||||
|
||||
## 조직 관리
|
||||
|
||||
조직을 전환하거나 현재 조직을 확인하려면 CrewAI CLI를 사용하세요:
|
||||
|
||||
```bash
|
||||
# 현재 조직 보기
|
||||
crewai org current
|
||||
|
||||
# 다른 조직으로 전환
|
||||
crewai org switch <org_id>
|
||||
|
||||
# 사용 가능한 모든 조직 목록 확인
|
||||
crewai org list
|
||||
```
|
||||
|
||||
<Note>
|
||||
리포지토리에서 agent를 불러올 때는 인증이 완료되어 있어야 하며, 올바른 조직으로 전환되어 있어야 합니다. 오류가 발생하면 위의 CLI 명령어를 사용하여 인증 상태와 조직 설정을 확인하세요.
|
||||
</Note>
|
||||
250
docs/ko/enterprise/features/hallucination-guardrail.mdx
Normal file
@@ -0,0 +1,250 @@
|
||||
---
|
||||
title: 환각 방어책
|
||||
description: "CrewAI 작업에서 AI 환각을 방지하고 감지합니다"
|
||||
icon: "shield-check"
|
||||
---
|
||||
|
||||
## 개요
|
||||
|
||||
Hallucination Guardrail은 AI가 생성한 콘텐츠가 사실에 기반하고 환각이 포함되어 있지 않은지 검증하는 엔터프라이즈 기능입니다. 이 기능은 작업 출력물을 참조 컨텍스트와 비교 분석하여, 잠재적으로 환각이 감지되었을 때 상세한 피드백을 제공합니다.
|
||||
|
||||
## 환각(Hallucinations)이란 무엇인가요?
|
||||
|
||||
AI 환각은 언어 모델이 그럴듯해 보이지만 사실과 다르거나 제공된 맥락에 의해 뒷받침되지 않는 내용을 생성할 때 발생합니다. Hallucination Guardrail은 다음과 같은 방법으로 이러한 문제를 방지합니다:
|
||||
|
||||
- 출력물을 참조 맥락과 비교
|
||||
- 원본 자료에 대한 충실도 평가
|
||||
- 문제 있는 콘텐츠에 대한 상세 피드백 제공
|
||||
- 검증 엄격성을 위한 사용자 정의 임계값 지원
|
||||
|
||||
## 기본 사용법
|
||||
|
||||
### 가드레일 설정하기
|
||||
|
||||
```python
|
||||
from crewai.tasks.hallucination_guardrail import HallucinationGuardrail
|
||||
from crewai import LLM
|
||||
|
||||
# Basic usage - will use task's expected_output as context
|
||||
guardrail = HallucinationGuardrail(
|
||||
llm=LLM(model="gpt-4o-mini")
|
||||
)
|
||||
|
||||
# With explicit reference context
|
||||
context_guardrail = HallucinationGuardrail(
|
||||
context="AI helps with various tasks including analysis and generation.",
|
||||
llm=LLM(model="gpt-4o-mini")
|
||||
)
|
||||
```
|
||||
|
||||
### 작업에 추가하기
|
||||
|
||||
```python
|
||||
from crewai import Task
|
||||
|
||||
# Create your task with the guardrail
|
||||
task = Task(
|
||||
description="Write a summary about AI capabilities",
|
||||
expected_output="A factual summary based on the provided context",
|
||||
agent=my_agent,
|
||||
guardrail=guardrail # Add the guardrail to validate output
|
||||
)
|
||||
```
|
||||
|
||||
## 고급 구성
|
||||
|
||||
### 사용자 지정 임계값 검증
|
||||
|
||||
보다 엄격한 검증을 위해 사용자 지정 신뢰성 임계값(0-10 범위)를 설정할 수 있습니다:
|
||||
|
||||
```python
|
||||
# Strict guardrail requiring high faithfulness score
|
||||
strict_guardrail = HallucinationGuardrail(
|
||||
context="Quantum computing uses qubits that exist in superposition states.",
|
||||
llm=LLM(model="gpt-4o-mini"),
|
||||
threshold=8.0 # Requires score >= 8 to pass validation
|
||||
)
|
||||
```
|
||||
|
||||
### 도구 응답 컨텍스트 포함하기
|
||||
|
||||
작업에서 도구를 사용할 때 더 정확한 검증을 위해 도구 응답을 포함할 수 있습니다:
|
||||
|
||||
```python
|
||||
# Guardrail with tool response context
|
||||
weather_guardrail = HallucinationGuardrail(
|
||||
context="Current weather information for the requested location",
|
||||
llm=LLM(model="gpt-4o-mini"),
|
||||
tool_response="Weather API returned: Temperature 22°C, Humidity 65%, Clear skies"
|
||||
)
|
||||
```
|
||||
|
||||
## 작동 원리
|
||||
|
||||
### 검증 프로세스
|
||||
|
||||
1. **컨텍스트 분석**: 가드레일은 작업 결과를 제공된 참조 컨텍스트와 비교합니다.
|
||||
2. **정확성 점수 부여**: 내부 평가자를 사용하여 정확성 점수(0-10)를 부여합니다.
|
||||
3. **판단 결정**: 콘텐츠가 정확한지 또는 환각이 포함되어 있는지 결정합니다.
|
||||
4. **임계값 확인**: 사용자 지정 임계값이 설정된 경우 해당 점수와 비교하여 검증합니다.
|
||||
5. **피드백 생성**: 검증에 실패할 때 상세한 사유를 제공합니다.
|
||||
|
||||
### 검증 논리
|
||||
|
||||
- **기본 모드**: 판정 기반 검증(FAITHFUL vs HALLUCINATED)을 사용함
|
||||
- **임계값 모드**: 신뢰성 점수가 지정된 임계값에 도달하거나 이를 초과해야 함
|
||||
- **오류 처리**: 평가 오류를 우아하게 처리하고 유익한 피드백을 제공함
|
||||
|
||||
## 가드레일 결과
|
||||
|
||||
가드레일은 검증 상태를 나타내는 구조화된 결과를 반환합니다:
|
||||
|
||||
```python
|
||||
# Example of guardrail result structure
|
||||
{
|
||||
"valid": False,
|
||||
"feedback": "Content appears to be hallucinated (score: 4.2/10, verdict: HALLUCINATED). The output contains information not supported by the provided context."
|
||||
}
|
||||
```
|
||||
|
||||
### 결과 속성
|
||||
|
||||
- **valid**: 출력이 검증을 통과했는지 여부를 나타내는 불리언 값
|
||||
- **feedback**: 검증 실패 시 상세 설명. 다음을 포함:
|
||||
- 신뢰도 점수
|
||||
- 판정 분류
|
||||
- 실패의 구체적인 이유
|
||||
|
||||
## 작업 시스템과의 통합
|
||||
|
||||
### 자동 검증
|
||||
|
||||
가드레일이 태스크에 추가되면, 태스크가 완료로 표시되기 전에 출력값이 자동으로 검증됩니다:
|
||||
|
||||
```python
|
||||
# Task output validation flow
|
||||
task_output = agent.execute_task(task)
|
||||
validation_result = guardrail(task_output)
|
||||
|
||||
if validation_result.valid:
|
||||
# Task completes successfully
|
||||
return task_output
|
||||
else:
|
||||
# Task fails with validation feedback
|
||||
raise ValidationError(validation_result.feedback)
|
||||
```
|
||||
|
||||
### 이벤트 추적
|
||||
|
||||
guardrail은 CrewAI의 이벤트 시스템과 통합되어 가시성을 제공합니다:
|
||||
|
||||
- **검증 시작됨**: guardrail 평가가 시작될 때
|
||||
- **검증 완료됨**: 평가가 결과와 함께 종료될 때
|
||||
- **검증 실패**: 평가 중 기술적 오류가 발생할 때
|
||||
|
||||
## 모범 사례
|
||||
|
||||
### 컨텍스트 가이드라인
|
||||
|
||||
<Steps>
|
||||
<Step title="포괄적인 컨텍스트 제공">
|
||||
AI가 출력할 때 기반이 되어야 할 모든 관련 사실 정보를 포함하세요:
|
||||
|
||||
```python
|
||||
context = """
|
||||
Company XYZ was founded in 2020 and specializes in renewable energy solutions.
|
||||
They have 150 employees and generated $50M revenue in 2023.
|
||||
Their main products include solar panels and wind turbines.
|
||||
"""
|
||||
```
|
||||
</Step>
|
||||
|
||||
<Step title="관련 있는 컨텍스트만 유지하기">
|
||||
혼란을 피하기 위해 작업과 직접적으로 관련된 정보만 포함하세요:
|
||||
|
||||
```python
|
||||
# Good: Focused context
|
||||
context = "The current weather in New York is 18°C with light rain."
|
||||
|
||||
# Avoid: Unrelated information
|
||||
context = "The weather is 18°C. The city has 8 million people. Traffic is heavy."
|
||||
```
|
||||
</Step>
|
||||
|
||||
<Step title="컨텍스트를 정기적으로 업데이트하기">
|
||||
참고하는 컨텍스트가 최신이고 정확한 정보를 반영하는지 확인하세요.
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
### 임계값 선택
|
||||
|
||||
<Steps>
|
||||
<Step title="기본 검증으로 시작하기">
|
||||
맞춤 임계값 없이 시작하여 기준 성능을 파악합니다.
|
||||
</Step>
|
||||
|
||||
<Step title="요구사항에 따라 조정하기">
|
||||
- **중요 콘텐츠**: 최대 정확도를 위해 임계값 8-10 사용
|
||||
- **일반 콘텐츠**: 균형 잡힌 검증을 위해 임계값 6-7 사용
|
||||
- **창의적 콘텐츠**: 임계값 4-5 또는 기본 판정 기반 검증 사용
|
||||
</Step>
|
||||
|
||||
<Step title="모니터링 및 반복">
|
||||
검증 결과를 추적하고, 오탐/미탐을 기반으로 임계값을 조정합니다.
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## 성능 고려사항
|
||||
|
||||
### 실행 시간에 미치는 영향
|
||||
|
||||
- **검증 오버헤드**: 각 가드레일마다 작업당 약 1~3초가 추가됩니다
|
||||
- **LLM 효율성**: 평가에는 효율적인 모델을 선택하세요 (예: gpt-4o-mini)
|
||||
|
||||
### 비용 최적화
|
||||
|
||||
- **모델 선택**: guardrail 평가에는 더 작고 효율적인 모델을 사용하세요
|
||||
- **컨텍스트 크기**: 참조 컨텍스트는 간결하면서도 포괄적으로 유지하세요
|
||||
- **캐싱**: 반복적인 콘텐츠의 검증 결과를 캐싱하는 것을 고려하세요
|
||||
|
||||
## 문제 해결
|
||||
|
||||
<Accordion title="검증이 항상 실패함">
|
||||
**가능한 원인:**
|
||||
- 컨텍스트가 너무 제한적이거나 작업 결과와 관련이 없음
|
||||
- 임계값이 콘텐츠 유형에 비해 너무 높게 설정됨
|
||||
- 참조 컨텍스트에 오래된 정보가 포함되어 있음
|
||||
|
||||
**해결 방법:**
|
||||
- 작업 요구사항에 맞게 컨텍스트를 검토하고 업데이트하세요
|
||||
- 임계값을 낮추거나 기본 판정 기반 검증을 사용하세요
|
||||
- 컨텍스트가 최신이며 정확한지 확인하세요
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="오탐 (유효한 콘텐츠가 무효로 판정됨)">
|
||||
**가능한 원인:**
|
||||
- 창의적이거나 해석적인 작업에 임계값이 너무 높음
|
||||
- 컨텍스트가 결과의 모든 유효한 측면을 포함하지 않음
|
||||
- 평가 모델이 과도하게 보수적임
|
||||
|
||||
**해결 방법:**
|
||||
- 임계값을 낮추거나 기본 검증을 사용하세요
|
||||
- 폭넓은 허용 가능한 콘텐츠를 포함하도록 컨텍스트를 확장하세요
|
||||
- 다른 평가 모델로 테스트하세요
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="평가 오류">
|
||||
**가능한 원인:**
|
||||
- 네트워크 연결 문제
|
||||
- LLM 모델 사용 불가 또는 속도 제한
|
||||
- 잘못된 형식의 작업 출력 또는 컨텍스트
|
||||
|
||||
**해결 방법:**
|
||||
- 네트워크 연결 및 LLM 서비스 상태를 확인하세요
|
||||
- 일시적 오류에 대해 재시도 로직을 구현하세요
|
||||
- guardrail 평가 전에 작업 출력 형식을 검증하세요
|
||||
</Accordion>
|
||||
|
||||
<Card title="도움이 필요하신가요?" icon="headset" href="mailto:support@crewai.com">
|
||||
환각 guardrail 구성 또는 문제 해결에 도움이 필요하시면 지원팀에 문의하세요.
|
||||
</Card>
|
||||
179
docs/ko/enterprise/features/integrations.mdx
Normal file
@@ -0,0 +1,179 @@
|
||||
---
|
||||
title: 통합
|
||||
description: "에이전트가 조치를 취할 수 있도록 연결된 애플리케이션입니다."
|
||||
icon: "plug"
|
||||
---
|
||||
|
||||
## 개요
|
||||
|
||||
에이전트가 OAuth를 지원하는 모든 공급자와 인증하고 작업을 수행할 수 있도록 지원합니다. Salesforce와 HubSpot부터 Google 및 GitHub까지, 16개 이상의 통합 서비스를 제공합니다.
|
||||
|
||||
<Frame>
|
||||

|
||||
</Frame>
|
||||
|
||||
## 지원되는 통합
|
||||
|
||||
### **커뮤니케이션 & 협업**
|
||||
- **Gmail** - 이메일 및 임시 저장 관리
|
||||
- **Slack** - 워크스페이스 알림 및 경고
|
||||
- **Microsoft** - Office 365 및 Teams 통합
|
||||
|
||||
### **프로젝트 관리**
|
||||
- **Jira** - 이슈 추적 및 프로젝트 관리
|
||||
- **ClickUp** - 작업 및 생산성 관리
|
||||
- **Asana** - 팀 작업 및 프로젝트 조정
|
||||
- **Notion** - 페이지 및 데이터베이스 관리
|
||||
- **Linear** - 소프트웨어 프로젝트 및 버그 추적
|
||||
- **GitHub** - 저장소 및 이슈 관리
|
||||
|
||||
### **고객 관계 관리**
|
||||
- **Salesforce** - CRM 계정 및 기회 관리
|
||||
- **HubSpot** - 영업 파이프라인 및 연락처 관리
|
||||
- **Zendesk** - 고객 지원 티켓 관리
|
||||
|
||||
### **비즈니스 & 금융**
|
||||
- **Stripe** - 결제 처리 및 고객 관리
|
||||
- **Shopify** - 전자상거래 스토어 및 상품 관리
|
||||
|
||||
### **생산성 및 저장소**
|
||||
- **Google Sheets** - 스프레드시트 데이터 동기화
|
||||
- **Google Calendar** - 일정 및 스케줄 관리
|
||||
- **Box** - 파일 저장 및 문서 관리
|
||||
|
||||
추가 기능도 곧 제공됩니다!
|
||||
|
||||
## 사전 준비 사항
|
||||
|
||||
Authentication Integrations를 사용하기 전에 다음이 준비되어 있는지 확인하세요:
|
||||
|
||||
- [CrewAI Enterprise](https://app.crewai.com) 계정. 무료 체험으로 시작할 수 있습니다.
|
||||
|
||||
## 통합 설정
|
||||
|
||||
### 1. 계정 연결하기
|
||||
|
||||
1. [CrewAI Enterprise](https://app.crewai.com)로 이동합니다.
|
||||
2. **Integrations** 탭으로 이동합니다 - https://app.crewai.com/crewai_plus/connectors
|
||||
3. Authentication Integrations 섹션에서 원하는 서비스의 **Connect** 버튼을 클릭합니다.
|
||||
4. OAuth 인증 과정을 완료합니다.
|
||||
5. 사용 사례에 필요한 권한을 부여합니다.
|
||||
6. [CrewAI Enterprise](https://app.crewai.com) 계정 페이지 - https://app.crewai.com/crewai_plus/settings/account 에서 Enterprise Token을 받습니다.
|
||||
|
||||
<Frame>
|
||||

|
||||
</Frame>
|
||||
|
||||
### 2. 통합 도구 설치
|
||||
|
||||
최신 버전의 `crewai-tools` 패키지만 있으면 됩니다.
|
||||
|
||||
```bash
|
||||
uv add crewai-tools
|
||||
```
|
||||
|
||||
## 사용 예시
|
||||
|
||||
### 기본 사용법
|
||||
<Tip>
|
||||
인증한 모든 서비스가 도구로 제공됩니다. 따라서 필요한 것은 `CrewaiEnterpriseTools`를 에이전트에 추가하는 것뿐이며, 바로 사용하실 수 있습니다.
|
||||
</Tip>
|
||||
|
||||
```python
|
||||
from crewai import Agent, Task, Crew
|
||||
from crewai_tools import CrewaiEnterpriseTools
|
||||
|
||||
# Get enterprise tools (Gmail tool will be included)
|
||||
enterprise_tools = CrewaiEnterpriseTools(
|
||||
enterprise_token="your_enterprise_token"
|
||||
)
|
||||
# print the tools
|
||||
print(enterprise_tools)
|
||||
|
||||
# Create an agent with Gmail capabilities
|
||||
email_agent = Agent(
|
||||
role="Email Manager",
|
||||
goal="Manage and organize email communications",
|
||||
backstory="An AI assistant specialized in email management and communication.",
|
||||
tools=enterprise_tools
|
||||
)
|
||||
|
||||
# Task to send an email
|
||||
email_task = Task(
|
||||
description="Draft and send a follow-up email to john@example.com about the project update",
|
||||
agent=email_agent,
|
||||
expected_output="Confirmation that email was sent successfully"
|
||||
)
|
||||
|
||||
# Run the task
|
||||
crew = Crew(
|
||||
agents=[email_agent],
|
||||
tasks=[email_task]
|
||||
)
|
||||
|
||||
# Run the crew
|
||||
crew.kickoff()
|
||||
```
|
||||
|
||||
### 필터링 도구
|
||||
|
||||
```python
|
||||
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["gmail_find_email"]
|
||||
|
||||
gmail_agent = Agent(
|
||||
role="Gmail Manager",
|
||||
goal="Manage gmail communications and notifications",
|
||||
backstory="An AI assistant that helps coordinate gmail communications.",
|
||||
tools=[gmail_tool]
|
||||
)
|
||||
|
||||
notification_task = Task(
|
||||
description="Find the email from john@example.com",
|
||||
agent=gmail_agent,
|
||||
expected_output="Email found from john@example.com"
|
||||
)
|
||||
|
||||
# Run the task
|
||||
crew = Crew(
|
||||
agents=[slack_agent],
|
||||
tasks=[notification_task]
|
||||
)
|
||||
```
|
||||
|
||||
## 모범 사례
|
||||
|
||||
### 보안
|
||||
- **최소 권한 원칙**: 에이전트의 작업에 필요한 최소한의 권한만 부여하세요
|
||||
- **정기적인 감사**: 연결된 통합 및 해당 권한을 주기적으로 검토하세요
|
||||
- **자격 증명 보안**: 자격 증명을 하드코딩하지 말고, CrewAI의 안전한 인증 플로우를 사용하세요
|
||||
|
||||
### 필터링 도구
|
||||
배포된 crew에서 연결된 서비스의 설정 페이지에서 각 통합에 대해 사용할 수 있는 작업을 지정할 수 있습니다.
|
||||
|
||||
<Frame>
|
||||

|
||||
</Frame>
|
||||
|
||||
### 다중 사용자 조직을 위한 Scoped Deployments
|
||||
crew를 배포하고 각 통합을 특정 사용자에게 범위 지정할 수 있습니다. 예를 들어, google에 연결하는 crew는 특정 사용자의 gmail 계정을 사용할 수 있습니다.
|
||||
|
||||
<Tip>
|
||||
이것은 통합을 특정 사용자에게 범위 지정하고자 하는 다중 사용자 조직에서 유용합니다.
|
||||
</Tip>
|
||||
|
||||
`user_bearer_token`을 사용하여 통합을 특정 사용자에 범위 지정하면 crew가 시작될 때 사용자의 bearer token을 사용해 통합에 인증합니다. 사용자가 로그인하지 않은 경우, crew는 연결된 통합을 사용하지 않습니다. 기본 bearer token을 사용하여 crew와 함께 배포된 통합에 인증할 수 있습니다.
|
||||
|
||||
<Frame>
|
||||

|
||||
</Frame>
|
||||
|
||||
### 도움 받기
|
||||
|
||||
<Card title="도움이 필요하신가요?" icon="headset" href="mailto:support@crewai.com">
|
||||
통합 설정이나 문제 해결에 대한 지원이 필요하시면 저희 지원팀에 문의하세요.
|
||||
</Card>
|
||||
103
docs/ko/enterprise/features/rbac.mdx
Normal file
@@ -0,0 +1,103 @@
|
||||
---
|
||||
title: "역할 기반 접근 제어 (RBAC)"
|
||||
description: "역할과 자동화별 가시성으로 crews, 도구, 데이터 접근을 제어합니다."
|
||||
icon: "shield"
|
||||
---
|
||||
|
||||
## 개요
|
||||
|
||||
CrewAI Enterprise의 RBAC는 **조직 수준 역할**과 **자동화(Automation) 수준 가시성**을 결합하여 안전하고 확장 가능한 접근 제어를 제공합니다.
|
||||
|
||||
<Frame>
|
||||
<img src="/images/enterprise/users_and_roles.png" alt="CrewAI Enterprise RBAC 개요" />
|
||||
|
||||
</Frame>
|
||||
|
||||
## 사용자와 역할
|
||||
|
||||
워크스페이스의 각 구성원은 역할이 있으며, 이는 기능 접근 범위를 결정합니다.
|
||||
|
||||
가능한 작업:
|
||||
|
||||
- 사전 정의된 역할 사용 (Owner, Member)
|
||||
- 권한을 세분화한 커스텀 역할 생성
|
||||
- 설정 화면에서 언제든 역할 할당/변경
|
||||
|
||||
설정 위치: Settings → Roles
|
||||
|
||||
<Steps>
|
||||
<Step title="Roles 열기">
|
||||
<b>Settings → Roles</b>로 이동합니다.
|
||||
</Step>
|
||||
<Step title="역할 선택">
|
||||
<b>Owner</b> 또는 <b>Member</b>를 사용하거나 <b>Create role</b>로 커스텀 역할을 만듭니다.
|
||||
</Step>
|
||||
<Step title="멤버에 할당">
|
||||
사용자들을 선택하여 역할을 지정합니다. 언제든 변경할 수 있습니다.
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
### 구성 요약
|
||||
|
||||
| 영역 | 위치 | 옵션 |
|
||||
|:---|:---|:---|
|
||||
| 사용자 & 역할 | Settings → Roles | Owner, Member; 커스텀 역할 |
|
||||
| 자동화 가시성 | Automation → Settings → Visibility | Private; 사용자/역할 화이트리스트 |
|
||||
|
||||
## 자동화 수준 접근 제어
|
||||
|
||||
조직 역할과 별개로, **Automations**는 사용자/역할별로 특정 자동화 접근을 제한하는 가시성 설정을 제공합니다.
|
||||
|
||||
유용한 경우:
|
||||
|
||||
- 민감/실험 자동화를 비공개로 유지
|
||||
- 대규모 팀/외부 협업에서 가시성 관리
|
||||
- 격리된 컨텍스트에서 자동화 테스트
|
||||
|
||||
Private 모드에서는 화이트리스트에 포함된 사용자/역할만 다음 작업이 가능합니다:
|
||||
|
||||
- 자동화 보기
|
||||
- 실행/API 사용
|
||||
- 로그, 메트릭, 설정 접근
|
||||
|
||||
조직 Owner는 항상 접근 가능하며, 가시성 설정에 영향을 받지 않습니다.
|
||||
|
||||
설정 위치: Automation → Settings → Visibility
|
||||
|
||||
<Steps>
|
||||
<Step title="Visibility 탭 열기">
|
||||
<b>Automation → Settings → Visibility</b>로 이동합니다.
|
||||
</Step>
|
||||
<Step title="가시성 설정">
|
||||
<b>Private</b>를 선택합니다. Owner는 항상 접근 가능합니다.
|
||||
</Step>
|
||||
<Step title="허용 대상 추가">
|
||||
보기/실행/로그·메트릭·설정 접근이 가능한 사용자/역할을 추가합니다.
|
||||
</Step>
|
||||
<Step title="저장 및 확인">
|
||||
저장 후, 목록에 없는 사용자가 보거나 실행할 수 없는지 확인합니다.
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
### Private 모드 접근 결과
|
||||
|
||||
| 동작 | Owner | 화이트리스트 사용자/역할 | 비포함 |
|
||||
|:---|:---|:---|:---|
|
||||
| 자동화 보기 | ✓ | ✓ | ✗ |
|
||||
| 실행/API | ✓ | ✓ | ✗ |
|
||||
| 로그/메트릭/설정 | ✓ | ✓ | ✗ |
|
||||
|
||||
<Tip>
|
||||
Owner는 항상 접근 가능하며, Private 모드에서는 화이트리스트에 포함된 사용자/역할만 권한이 부여됩니다.
|
||||
</Tip>
|
||||
|
||||
<Frame>
|
||||
<img src="/images/enterprise/visibility.png" alt="CrewAI Enterprise 가시성 설정" />
|
||||
|
||||
</Frame>
|
||||
|
||||
<Card title="도움이 필요하신가요?" icon="headset" href="mailto:support@crewai.com">
|
||||
RBAC 구성과 점검에 대한 지원이 필요하면 연락해 주세요.
|
||||
</Card>
|
||||
|
||||
|
||||
106
docs/ko/enterprise/features/tool-repository.mdx
Normal file
@@ -0,0 +1,106 @@
|
||||
---
|
||||
title: 도구 저장소
|
||||
description: "도구 저장소를 사용하여 도구를 관리하기"
|
||||
icon: "toolbox"
|
||||
---
|
||||
|
||||
## 개요
|
||||
|
||||
Tool Repository는 CrewAI 도구를 위한 패키지 관리자입니다. 사용자는 CrewAI crew와 flow에 통합되는 도구를 게시, 설치 및 관리할 수 있습니다.
|
||||
|
||||
도구는 다음과 같이 분류됩니다:
|
||||
|
||||
- **비공개**: 조직 내에서만 접근할 수 있습니다(기본값)
|
||||
- **공개**: `--public` 플래그로 게시하면 모든 CrewAI 사용자가 접근할 수 있습니다
|
||||
|
||||
이 저장소는 버전 관리 시스템이 아닙니다. 코드 변경 사항을 추적하고 협업을 활성화하려면 Git을 사용하십시오.
|
||||
|
||||
## 사전 요구 사항
|
||||
|
||||
Tool Repository를 사용하기 전에 다음이 준비되어 있어야 합니다:
|
||||
|
||||
- [CrewAI Enterprise](https://app.crewai.com) 계정
|
||||
- [CrewAI CLI](https://docs.crewai.com/concepts/cli#cli) 설치됨
|
||||
- uv>=0.5.0 이 설치되어 있어야 합니다. [업그레이드 방법](https://docs.astral.sh/uv/getting-started/installation/#upgrading-uv)을 참고하세요.
|
||||
- [Git](https://git-scm.com) 설치 및 구성 완료
|
||||
- CrewAI Enterprise 조직에서 도구를 게시하거나 설치할 수 있는 액세스 권한
|
||||
|
||||
## 도구 설치
|
||||
|
||||
도구를 설치하려면:
|
||||
|
||||
```bash
|
||||
crewai tool install <tool-name>
|
||||
```
|
||||
|
||||
이 명령은 도구를 설치하고 `pyproject.toml`에 추가합니다.
|
||||
|
||||
## 도구 생성 및 게시
|
||||
|
||||
새 도구 프로젝트를 생성하려면:
|
||||
|
||||
```bash
|
||||
crewai tool create <tool-name>
|
||||
```
|
||||
|
||||
이 명령은 로컬에 스캐폴딩된 도구 프로젝트를 생성합니다.
|
||||
|
||||
변경 사항을 적용한 후, Git 저장소를 초기화하고 코드를 커밋합니다:
|
||||
|
||||
```bash
|
||||
git init
|
||||
git add .
|
||||
git commit -m "Initial version"
|
||||
```
|
||||
|
||||
도구를 게시하려면:
|
||||
|
||||
```bash
|
||||
crewai tool publish
|
||||
```
|
||||
|
||||
기본적으로 도구는 비공개로 게시됩니다. 도구를 공개로 설정하려면:
|
||||
|
||||
```bash
|
||||
crewai tool publish --public
|
||||
```
|
||||
|
||||
도구 빌드에 대한 자세한 내용은 [나만의 도구 만들기](https://docs.crewai.com/concepts/tools#creating-your-own-tools)를 참고하세요.
|
||||
|
||||
## 도구 업데이트
|
||||
|
||||
공개된 도구를 업데이트하려면:
|
||||
|
||||
1. 로컬에서 도구를 수정합니다.
|
||||
2. `pyproject.toml`에서 버전을 업데이트합니다(예: `0.1.0`에서 `0.1.1`로).
|
||||
3. 변경 사항을 커밋하고 배포합니다.
|
||||
|
||||
```bash
|
||||
git commit -m "Update version to 0.1.1"
|
||||
crewai tool publish
|
||||
```
|
||||
|
||||
## 도구 삭제
|
||||
|
||||
도구를 삭제하려면:
|
||||
|
||||
1. [CrewAI Enterprise](https://app.crewai.com)로 이동합니다.
|
||||
2. **Tools**로 이동합니다.
|
||||
3. 도구를 선택합니다.
|
||||
4. **Delete**를 클릭합니다.
|
||||
|
||||
<Warning>
|
||||
삭제는 영구적입니다. 삭제된 도구는 복구하거나 다시 설치할 수 없습니다.
|
||||
</Warning>
|
||||
|
||||
## 보안 점검
|
||||
|
||||
모든 공개된 버전은 자동화된 보안 점검을 거치며, 통과한 후에만 설치할 수 있습니다.
|
||||
|
||||
도구의 보안 점검 상태는 다음에서 확인할 수 있습니다:
|
||||
|
||||
`CrewAI Enterprise > Tools > Your Tool > Versions`
|
||||
|
||||
<Card title="도움이 필요하신가요?" icon="headset" href="mailto:support@crewai.com">
|
||||
API 통합 또는 문제 해결에 대한 지원이 필요하시면 지원팀에 문의해 주세요.
|
||||
</Card>
|
||||
145
docs/ko/enterprise/features/traces.mdx
Normal file
@@ -0,0 +1,145 @@
|
||||
---
|
||||
title: 트레이스
|
||||
description: "Traces를 사용하여 내 크루 모니터링하기"
|
||||
icon: "timeline"
|
||||
---
|
||||
|
||||
## 개요
|
||||
|
||||
Trace는 crew 실행에 대한 포괄적인 가시성을 제공하여 성능 모니터링, 문제 디버깅, AI agent workflow 최적화에 도움을 줍니다.
|
||||
|
||||
## Traces란 무엇인가요?
|
||||
|
||||
CrewAI Enterprise의 Traces는 crew의 작동 과정을 처음 입력에서 최종 출력까지 모든 측면에서 포착하는 상세 실행 기록입니다. Traces에는 다음 내용이 기록됩니다:
|
||||
|
||||
- Agent의 생각 및 추론
|
||||
- 작업 실행 세부 정보
|
||||
- 도구 사용 및 출력
|
||||
- 토큰 소모 메트릭
|
||||
- 실행 시간
|
||||
- 비용 추정치
|
||||
|
||||
<Frame>
|
||||

|
||||
</Frame>
|
||||
|
||||
## 트레이스(Traces) 접근하기
|
||||
|
||||
<Steps>
|
||||
<Step title="트레이스 탭으로 이동">
|
||||
CrewAI Enterprise 대시보드에 들어가면, **트레이스**를 클릭하여 모든 실행 기록을 볼 수 있습니다.
|
||||
</Step>
|
||||
|
||||
<Step title="실행 선택하기">
|
||||
모든 crew 실행 목록이 날짜별로 정렬되어 표시됩니다. 상세 트레이스를 보려면 원하는 실행을 클릭하세요.
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## 트레이스 인터페이스 이해하기
|
||||
|
||||
트레이스 인터페이스는 여러 섹션으로 나뉘어 있으며, 각 섹션은 crew의 실행에 대한 다양한 인사이트를 제공합니다.
|
||||
|
||||
### 1. 실행 요약
|
||||
|
||||
상단 섹션에서는 실행에 대한 고수준 메트릭을 표시합니다:
|
||||
|
||||
- **총 토큰**: 모든 작업에서 소모된 토큰 수
|
||||
- **프롬프트 토큰**: LLM에 프롬프트로 사용된 토큰
|
||||
- **컴플리션 토큰**: LLM 응답에서 생성된 토큰
|
||||
- **요청 수**: 수행된 API 호출 수
|
||||
- **실행 시간**: crew 런의 전체 소요 시간
|
||||
- **예상 비용**: 토큰 사용량을 기반으로 한 대략적인 비용
|
||||
|
||||
<Frame>
|
||||

|
||||
</Frame>
|
||||
|
||||
### 2. Tasks & Agents
|
||||
|
||||
이 섹션에서는 crew 실행에 포함된 모든 task와 agent를 보여줍니다:
|
||||
|
||||
- task 이름 및 agent 할당
|
||||
- 각 task에 사용된 agent 및 LLM
|
||||
- 상태 (완료/실패)
|
||||
- task의 개별 실행 시간
|
||||
|
||||
<Frame>
|
||||

|
||||
</Frame>
|
||||
|
||||
### 3. 최종 결과
|
||||
|
||||
모든 작업이 완료된 후 crew가 생성한 최종 결과를 표시합니다.
|
||||
|
||||
<Frame>
|
||||

|
||||
</Frame>
|
||||
|
||||
### 4. 실행 타임라인
|
||||
|
||||
각 작업이 시작되고 종료된 시점을 시각적으로 표현하여 병목 현상이나 병렬 실행 패턴을 파악하는 데 도움이 됩니다.
|
||||
|
||||
<Frame>
|
||||

|
||||
</Frame>
|
||||
|
||||
### 5. 상세 작업 보기
|
||||
|
||||
타임라인이나 작업 목록에서 특정 작업을 클릭하면 다음을 볼 수 있습니다:
|
||||
|
||||
<Frame>
|
||||

|
||||
</Frame>
|
||||
|
||||
- **작업 키**: 작업의 고유 식별자
|
||||
- **작업 ID**: 시스템 내의 기술적 식별자
|
||||
- **상태**: 현재 상태 (완료/진행 중/실패)
|
||||
- **에이전트**: 해당 작업을 수행한 에이전트
|
||||
- **LLM**: 이 작업에 사용된 언어 모델
|
||||
- **시작/종료 시간**: 작업이 시작되고 완료된 시간
|
||||
- **실행 시간**: 이 특정 작업의 소요 시간
|
||||
- **작업 설명**: 에이전트에게 지시된 작업 내용
|
||||
- **예상 출력**: 요청된 출력 형식
|
||||
- **입력**: 이전 작업에서 이 작업에 제공된 입력값
|
||||
- **출력**: 에이전트가 실제로 생성한 결과
|
||||
|
||||
## 디버깅을 위한 트레이스 사용
|
||||
|
||||
트레이스는 crew 문제 해결에 매우 유용합니다:
|
||||
|
||||
<Steps>
|
||||
<Step title="실패 지점 식별">
|
||||
crew 실행이 예상한 결과를 내지 못할 때, 트레이스를 확인하여 어디에서 문제가 발생했는지 찾으세요. 다음을 확인하세요:
|
||||
|
||||
- 실패한 작업
|
||||
- 에이전트의 예상 밖 결정
|
||||
- 도구 사용 오류
|
||||
- 잘못 해석된 지침
|
||||
|
||||
<Frame>
|
||||

|
||||
</Frame>
|
||||
</Step>
|
||||
|
||||
<Step title="성능 최적화">
|
||||
실행 메트릭을 사용하여 성능 병목 현상을 파악하세요:
|
||||
|
||||
- 예상보다 오래 걸린 작업
|
||||
- 과도한 토큰 사용
|
||||
- 중복된 도구 작업
|
||||
- 불필요한 API 호출
|
||||
</Step>
|
||||
|
||||
<Step title="비용 효율성 향상">
|
||||
토큰 사용량 및 비용 추정치를 분석해 crew의 효율성을 최적화하세요:
|
||||
|
||||
- 더 간단한 작업에는 더 작은 모델을 사용 고려
|
||||
- 프롬프트를 더 간결하게 다듬기
|
||||
- 자주 액세스하는 정보 캐싱
|
||||
- 중복 작업을 최소화하도록 작업 구조화하기
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
<Card title="도움이 필요하신가요?" icon="headset" href="mailto:support@crewai.com">
|
||||
트레이스 분석이나 기타 CrewAI 엔터프라이즈 기능에 대한 지원이 필요하시면 저희 지원팀에 문의하세요.
|
||||
</Card>
|
||||
81
docs/ko/enterprise/features/webhook-streaming.mdx
Normal file
@@ -0,0 +1,81 @@
|
||||
---
|
||||
title: 웹훅 스트리밍
|
||||
description: "웹훅 스트리밍을 사용하여 이벤트를 웹훅으로 스트리밍하기"
|
||||
icon: "webhook"
|
||||
---
|
||||
|
||||
## 개요
|
||||
|
||||
Enterprise Event Streaming을 사용하면 CrewAI Enterprise에 배포된 crew 및 flow에 대한 실시간 웹훅 업데이트(예: 모델 호출, 도구 사용, flow 단계)를 받을 수 있습니다.
|
||||
|
||||
## 사용법
|
||||
|
||||
Kickoff API를 사용할 때, 요청에 `webhooks` 객체를 포함시키세요. 예를 들면 아래와 같습니다:
|
||||
|
||||
```json
|
||||
{
|
||||
"inputs": {"foo": "bar"},
|
||||
"webhooks": {
|
||||
"events": ["crew_kickoff_started", "llm_call_started"],
|
||||
"url": "https://your.endpoint/webhook",
|
||||
"realtime": false,
|
||||
"authentication": {
|
||||
"strategy": "bearer",
|
||||
"token": "my-secret-token"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
`realtime`이 `true`로 설정되면, 각 이벤트가 개별적으로 그리고 즉시 전달되지만 crew/flow 성능에 영향을 미칠 수 있습니다.
|
||||
|
||||
## Webhook 형식
|
||||
|
||||
각 webhook은 이벤트 목록을 전송합니다:
|
||||
|
||||
```json
|
||||
{
|
||||
"events": [
|
||||
{
|
||||
"id": "event-id",
|
||||
"execution_id": "crew-run-id",
|
||||
"timestamp": "2025-02-16T10:58:44.965Z",
|
||||
"type": "llm_call_started",
|
||||
"data": {
|
||||
"model": "gpt-4",
|
||||
"messages": [
|
||||
{"role": "system", "content": "You are an assistant."},
|
||||
{"role": "user", "content": "Summarize this article."}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
`data` 객체의 구조는 이벤트 타입에 따라 다릅니다. 자세한 내용은 GitHub의 [이벤트 목록](https://github.com/crewAIInc/crewAI/tree/main/src/crewai/utilities/events)을 참조하세요.
|
||||
|
||||
요청이 HTTP를 통해 전송되므로, 이벤트의 순서가 보장되지 않습니다. 순서가 필요하다면 `timestamp` 필드를 사용하세요.
|
||||
|
||||
## 지원되는 이벤트
|
||||
|
||||
CrewAI는 Enterprise Event Streaming에서 시스템 이벤트와 사용자 지정 이벤트 둘 다를 지원합니다. 이러한 이벤트는 crew 및 flow 실행 중에 구성한 웹훅 엔드포인트로 전송됩니다.
|
||||
|
||||
- `crew_kickoff_started`
|
||||
- `crew_step_started`
|
||||
- `crew_step_completed`
|
||||
- `crew_execution_completed`
|
||||
- `llm_call_started`
|
||||
- `llm_call_completed`
|
||||
- `tool_usage_started`
|
||||
- `tool_usage_completed`
|
||||
- `crew_test_failed`
|
||||
- *...그리고 기타 여러 가지*
|
||||
|
||||
이벤트 이름은 내부 이벤트 버스와 일치합니다. 전체 목록은 [GitHub 소스](https://github.com/crewAIInc/crewAI/tree/main/src/crewai/utilities/events)에서 확인할 수 있습니다.
|
||||
|
||||
사용자 지정 이벤트도 직접 발생시킬 수 있으며, 시스템 이벤트와 함께 웹훅 스트림을 통해 전달됩니다.
|
||||
|
||||
<Card title="도움이 필요하신가요?" icon="headset" href="mailto:support@crewai.com">
|
||||
웹훅 통합 또는 문제 해결에 대한 지원이 필요하다면 저희 지원팀에 문의해 주세요.
|
||||
</Card>
|
||||
51
docs/ko/enterprise/guides/azure-openai-setup.mdx
Normal file
@@ -0,0 +1,51 @@
|
||||
---
|
||||
title: "Azure OpenAI 설정"
|
||||
description: "엔터프라이즈 LLM 연결을 위해 Crew Studio와 함께 Azure OpenAI를 구성합니다"
|
||||
icon: "microsoft"
|
||||
---
|
||||
|
||||
이 가이드는 Azure OpenAI와 Crew Studio를 연동하여 원활한 엔터프라이즈 AI 운영을 수행하는 방법을 안내합니다.
|
||||
|
||||
## 설정 프로세스
|
||||
|
||||
<Steps>
|
||||
<Step title="Azure OpenAI Studio 접속">
|
||||
1. Azure에서 `Azure AI Services > 배포 선택 > Azure OpenAI Studio 열기`로 이동합니다.
|
||||
2. 왼쪽 메뉴에서 `Deployments`를 클릭합니다. 배포가 없다면 원하는 모델로 새 배포를 생성하세요.
|
||||
3. 생성이 완료되면 해당 배포를 선택하고, 페이지 오른쪽에서 `Target URI`와 `Key`를 찾습니다. 이 정보가 필요하니 페이지를 열어둔 상태로 두세요.
|
||||
<Frame>
|
||||
<img src="/images/enterprise/azure-openai-studio.png" alt="Azure OpenAI Studio" />
|
||||
</Frame>
|
||||
</Step>
|
||||
|
||||
<Step title="CrewAI Enterprise 연결 구성">
|
||||
4. 다른 탭에서 `CrewAI Enterprise > LLM Connections`를 엽니다. LLM Connection에 이름을 지정하고, 공급자로 Azure를 선택한 다음, Azure에서 선택한 것과 동일한 모델을 선택하세요.
|
||||
5. 같은 페이지에서 3단계에서 가져온 환경 변수를 추가하세요:
|
||||
- 하나는 `AZURE_DEPLOYMENT_TARGET_URL` (Target URI 사용)로 명명합니다. URL은 다음과 같이 표시됩니다: https://your-deployment.openai.azure.com/openai/deployments/gpt-4o/chat/completions?api-version=2024-08-01-preview
|
||||
- 다른 하나는 `AZURE_API_KEY` (Key 사용)로 명명합니다.
|
||||
6. `Add Connection`을 클릭하여 LLM Connection을 저장합니다.
|
||||
</Step>
|
||||
|
||||
<Step title="기본 구성 설정">
|
||||
7. `CrewAI Enterprise > Settings > Defaults > Crew Studio LLM Settings`에서 새 LLM Connection과 모델을 기본값으로 설정합니다.
|
||||
</Step>
|
||||
|
||||
<Step title="네트워크 액세스 구성">
|
||||
8. 네트워크 액세스 설정을 확인하세요:
|
||||
- Azure에서 `Azure OpenAI > 배포 선택`으로 이동합니다.
|
||||
- `Resource Management > Networking`으로 이동합니다.
|
||||
- `Allow access from all networks`가 활성화되어 있는지 확인하세요. 이 설정이 제한되어 있으면 CrewAI가 Azure OpenAI 엔드포인트에 접근하지 못할 수 있습니다.
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## 확인
|
||||
|
||||
모두 준비되었습니다! 이제 Crew Studio는 Azure OpenAI 연결을 사용합니다. 모든 기능이 제대로 작동하는지 확인하려면 간단한 crew 또는 task를 만들어 연결을 테스트해 보세요.
|
||||
|
||||
## 문제 해결
|
||||
|
||||
문제가 발생한 경우:
|
||||
- Target URI 형식이 예상 패턴과 일치하는지 확인하세요
|
||||
- API 키가 올바르고 적절한 권한을 가지고 있는지 확인하세요
|
||||
- 네트워크 액세스가 CrewAI 연결을 허용하도록 구성되어 있는지 확인하세요
|
||||
- 배포 모델이 CrewAI에서 구성한 것과 일치하는지 확인하세요
|
||||
43
docs/ko/enterprise/guides/build-crew.mdx
Normal file
@@ -0,0 +1,43 @@
|
||||
---
|
||||
title: "Crew 빌드"
|
||||
description: "Crew는 함께 작업을 완수하기 위해 협력하는 에이전트 그룹입니다."
|
||||
icon: "people-arrows"
|
||||
---
|
||||
|
||||
## 개요
|
||||
|
||||
[CrewAI Enterprise](https://app.crewai.com)는 프로덕션 환경에서 AI 에이전트를 **생성**, **배포** 및 **관리**하는 과정을 간소화합니다.
|
||||
|
||||
## 시작하기
|
||||
|
||||
<iframe
|
||||
width="100%"
|
||||
height="400"
|
||||
src="https://www.youtube.com/embed/-kSOTtYzgEw"
|
||||
title="Building Crews with CrewAI CLI"
|
||||
frameborder="0"
|
||||
style={{ borderRadius: '10px' }}
|
||||
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
|
||||
allowfullscreen
|
||||
></iframe>
|
||||
|
||||
### 설치 및 설정
|
||||
|
||||
<Card title="표준 설치 따라하기" icon="wrench" href="/ko/installation">
|
||||
CrewAI CLI를 설정하고 첫 번째 프로젝트를 생성하기 위해 표준 설치 가이드를 따라주세요.
|
||||
</Card>
|
||||
|
||||
### 크루 구성하기
|
||||
|
||||
<Card title="빠른 시작 튜토리얼" icon="rocket" href="/ko/quickstart">
|
||||
YAML 구성을 사용하여 첫 번째 에이전트 크루를 만드는 방법은 빠른 시작 가이드를 따라주세요.
|
||||
</Card>
|
||||
|
||||
## 지원 및 리소스
|
||||
|
||||
Enterprise 전용 지원 또는 문의가 필요하신 경우, [support@crewai.com](mailto:support@crewai.com)으로 저희 전담 지원팀에 연락해 주시기 바랍니다.
|
||||
|
||||
|
||||
<Card title="데모 예약" icon="calendar" href="mailto:support@crewai.com">
|
||||
Enterprise 기능과 해당 기능이 귀사의 조직에 어떻게 도움이 될 수 있는지 알아보시려면 저희 팀과 상담 일정을 예약하세요.
|
||||
</Card>
|
||||
290
docs/ko/enterprise/guides/deploy-crew.mdx
Normal file
@@ -0,0 +1,290 @@
|
||||
---
|
||||
title: "Crew 배포"
|
||||
description: "CrewAI 엔터프라이즈에서 Crew 배포하기"
|
||||
icon: "rocket"
|
||||
---
|
||||
|
||||
<Note>
|
||||
로컬에서 또는 Crew Studio를 통해 crew를 생성한 후, 다음 단계는 이를 CrewAI Enterprise 플랫폼에 배포하는 것입니다. 본 가이드에서는 다양한 배포 방법을 다루며, 여러분의 워크플로우에 가장 적합한 방식을 선택할 수 있도록 안내합니다.
|
||||
</Note>
|
||||
|
||||
## 사전 준비 사항
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card title="배포 준비가 된 Crew" icon="users">
|
||||
작동 중인 crew가 로컬에서 빌드되었거나 Crew Studio를 통해 생성되어 있어야 합니다.
|
||||
</Card>
|
||||
<Card title="GitHub 저장소" icon="github">
|
||||
crew 코드가 GitHub 저장소에 있어야 합니다(GitHub 연동 방식의 경우).
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
## 옵션 1: CrewAI CLI를 사용한 배포
|
||||
|
||||
CLI는 로컬에서 개발된 crew를 Enterprise 플랫폼에 가장 빠르게 배포할 수 있는 방법을 제공합니다.
|
||||
|
||||
<Steps>
|
||||
<Step title="CrewAI CLI 설치">
|
||||
아직 설치하지 않았다면 CrewAI CLI를 설치하세요:
|
||||
|
||||
```bash
|
||||
pip install crewai[tools]
|
||||
```
|
||||
|
||||
<Tip>
|
||||
CLI는 기본 CrewAI 패키지에 포함되어 있지만, `[tools]` 추가 옵션을 사용하면 모든 배포 종속성을 함께 설치할 수 있습니다.
|
||||
</Tip>
|
||||
|
||||
</Step>
|
||||
|
||||
<Step title="Enterprise 플랫폼에 인증">
|
||||
먼저, CrewAI Enterprise 플랫폼에 CLI를 인증해야 합니다:
|
||||
|
||||
```bash
|
||||
# 이미 CrewAI Enterprise 계정이 있거나 새로 생성하고 싶을 때:
|
||||
crewai login
|
||||
```
|
||||
|
||||
위 명령어를 실행하면 CLI가 다음을 진행합니다:
|
||||
1. URL과 고유 기기 코드를 표시합니다
|
||||
2. 브라우저를 열어 인증 페이지로 이동합니다
|
||||
3. 기기 확인을 요청합니다
|
||||
4. 인증 과정을 완료합니다
|
||||
|
||||
인증이 성공적으로 완료되면 터미널에 확인 메시지가 표시됩니다!
|
||||
|
||||
</Step>
|
||||
|
||||
<Step title="배포 생성">
|
||||
|
||||
프로젝트 디렉터리에서 다음 명령어를 실행하세요:
|
||||
|
||||
```bash
|
||||
crewai deploy create
|
||||
```
|
||||
|
||||
이 명령어는 다음을 수행합니다:
|
||||
1. GitHub 저장소 정보를 감지합니다
|
||||
2. 로컬 `.env` 파일의 환경 변수를 식별합니다
|
||||
3. 이러한 변수를 Enterprise 플랫폼으로 안전하게 전송합니다
|
||||
4. 고유 식별자가 부여된 새 배포를 만듭니다
|
||||
|
||||
성공적으로 생성되면 다음과 같은 메시지가 표시됩니다:
|
||||
```shell
|
||||
Deployment created successfully!
|
||||
Name: your_project_name
|
||||
Deployment ID: 01234567-89ab-cdef-0123-456789abcdef
|
||||
Current Status: Deploy Enqueued
|
||||
```
|
||||
|
||||
</Step>
|
||||
|
||||
<Step title="배포 진행 상황 모니터링">
|
||||
|
||||
다음 명령어로 배포 상태를 추적할 수 있습니다:
|
||||
|
||||
```bash
|
||||
crewai deploy status
|
||||
```
|
||||
|
||||
빌드 과정의 상세 로그가 필요하다면:
|
||||
|
||||
```bash
|
||||
crewai deploy logs
|
||||
```
|
||||
|
||||
<Tip>
|
||||
첫 배포는 컨테이너 이미지를 빌드하므로 일반적으로 10~15분 정도 소요됩니다. 이후 배포는 훨씬 빠릅니다.
|
||||
</Tip>
|
||||
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## 추가 CLI 명령어
|
||||
|
||||
CrewAI CLI는 배포를 관리하기 위한 여러 명령어를 제공합니다:
|
||||
|
||||
```bash
|
||||
# 모든 배포 목록 확인
|
||||
crewai deploy list
|
||||
|
||||
# 배포 상태 확인
|
||||
crewai deploy status
|
||||
|
||||
# 배포 로그 보기
|
||||
crewai deploy logs
|
||||
|
||||
# 코드 변경 후 업데이트 푸시
|
||||
crewai deploy push
|
||||
|
||||
# 배포 삭제
|
||||
crewai deploy remove <deployment_id>
|
||||
```
|
||||
|
||||
## 옵션 2: 웹 인터페이스를 통한 직접 배포
|
||||
|
||||
GitHub 계정을 연결하여 CrewAI Enterprise 웹 인터페이스를 통해 crews를 직접 배포할 수도 있습니다. 이 방법은 로컬 머신에서 CLI를 사용할 필요가 없습니다.
|
||||
|
||||
<Steps>
|
||||
|
||||
<Step title="GitHub로 푸시하기">
|
||||
|
||||
crew를 GitHub 저장소에 푸시해야 합니다. 아직 crew를 만들지 않았다면, [이 튜토리얼](/ko/quickstart)을 따라할 수 있습니다.
|
||||
|
||||
</Step>
|
||||
|
||||
<Step title="GitHub를 CrewAI Enterprise에 연결하기">
|
||||
|
||||
1. [CrewAI Enterprise](https://app.crewai.com)에 로그인합니다.
|
||||
2. "Connect GitHub" 버튼을 클릭합니다.
|
||||
|
||||
<Frame>
|
||||

|
||||
</Frame>
|
||||
|
||||
</Step>
|
||||
|
||||
<Step title="저장소 선택하기">
|
||||
|
||||
GitHub 계정을 연결한 후 배포할 저장소를 선택할 수 있습니다:
|
||||
|
||||
<Frame>
|
||||

|
||||
</Frame>
|
||||
|
||||
</Step>
|
||||
|
||||
<Step title="환경 변수 설정하기">
|
||||
|
||||
배포 전에, LLM 제공업체 또는 기타 서비스에 연결할 환경 변수를 설정해야 합니다:
|
||||
|
||||
1. 변수를 개별적으로 또는 일괄적으로 추가할 수 있습니다.
|
||||
2. 환경 변수는 `KEY=VALUE` 형식(한 줄에 하나씩)으로 입력합니다.
|
||||
|
||||
<Frame>
|
||||

|
||||
</Frame>
|
||||
|
||||
</Step>
|
||||
|
||||
<Step title="Crew 배포하기">
|
||||
|
||||
1. "Deploy" 버튼을 클릭하여 배포 프로세스를 시작합니다.
|
||||
2. 진행 바를 통해 진행 상황을 모니터링할 수 있습니다.
|
||||
3. 첫 번째 배포에는 일반적으로 약 10-15분 정도 소요되며, 이후 배포는 더 빠릅니다.
|
||||
|
||||
<Frame>
|
||||

|
||||
</Frame>
|
||||
|
||||
배포가 완료되면 다음을 확인할 수 있습니다:
|
||||
- crew의 고유 URL
|
||||
- crew API를 보호할 Bearer 토큰
|
||||
- 배포를 삭제해야 하는 경우 "Delete" 버튼
|
||||
|
||||
</Step>
|
||||
|
||||
</Steps>
|
||||
|
||||
## ⚠️ 환경 변수 보안 요구사항
|
||||
|
||||
<Warning>
|
||||
**중요**: CrewAI Enterprise는 환경 변수 이름에 대한 보안 제한이 있으며, 이를 따르지 않을 경우 배포가 실패할 수 있습니다.
|
||||
</Warning>
|
||||
|
||||
### 차단된 환경 변수 패턴
|
||||
|
||||
보안상의 이유로, 다음과 같은 환경 변수 명명 패턴은 **자동으로 필터링**되며 배포에 문제가 발생할 수 있습니다:
|
||||
|
||||
**차단된 패턴:**
|
||||
- `_TOKEN`으로 끝나는 변수 (예: `MY_API_TOKEN`)
|
||||
- `_PASSWORD`로 끝나는 변수 (예: `DB_PASSWORD`)
|
||||
- `_SECRET`로 끝나는 변수 (예: `API_SECRET`)
|
||||
- 특정 상황에서 `_KEY`로 끝나는 변수
|
||||
|
||||
**특정 차단 변수:**
|
||||
- `GITHUB_USER`, `GITHUB_TOKEN`
|
||||
- `AWS_REGION`, `AWS_DEFAULT_REGION`
|
||||
- 다양한 내부 CrewAI 시스템 변수
|
||||
|
||||
### 허용된 예외
|
||||
|
||||
일부 변수는 차단된 패턴과 일치하더라도 명시적으로 허용됩니다:
|
||||
- `AZURE_AD_TOKEN`
|
||||
- `AZURE_OPENAI_AD_TOKEN`
|
||||
- `ENTERPRISE_ACTION_TOKEN`
|
||||
- `CREWAI_ENTEPRISE_TOOLS_TOKEN`
|
||||
|
||||
### 네이밍 문제 해결 방법
|
||||
|
||||
환경 변수 제한으로 인해 배포가 실패하는 경우:
|
||||
|
||||
```bash
|
||||
# ❌ 이러한 이름은 배포 실패를 초래합니다
|
||||
OPENAI_TOKEN=sk-...
|
||||
DATABASE_PASSWORD=mypassword
|
||||
API_SECRET=secret123
|
||||
|
||||
# ✅ 대신 다음과 같은 네이밍 패턴을 사용하세요
|
||||
OPENAI_API_KEY=sk-...
|
||||
DATABASE_CREDENTIALS=mypassword
|
||||
API_CONFIG=secret123
|
||||
```
|
||||
|
||||
### 모범 사례
|
||||
|
||||
1. **표준 명명 규칙 사용**: `PROVIDER_TOKEN` 대신 `PROVIDER_API_KEY` 사용
|
||||
2. **먼저 로컬에서 테스트**: crew가 이름이 변경된 변수로 제대로 동작하는지 확인
|
||||
3. **코드 업데이트**: 이전 변수 이름을 참조하는 부분을 모두 변경
|
||||
4. **변경 내용 문서화**: 팀을 위해 이름이 변경된 변수를 기록
|
||||
|
||||
<Tip>
|
||||
배포 실패 시, 환경 변수 에러 메시지가 난해하다면 먼저 변수 이름이 이 패턴을 따르는지 확인하세요.
|
||||
</Tip>
|
||||
|
||||
### 배포된 Crew와 상호작용하기
|
||||
|
||||
배포가 완료되면 다음을 통해 crew에 접근할 수 있습니다:
|
||||
|
||||
1. **REST API**: 플랫폼에서 아래의 주요 경로가 포함된 고유한 HTTPS 엔드포인트를 생성합니다:
|
||||
- `/inputs`: 필요한 입력 파라미터 목록
|
||||
- `/kickoff`: 제공된 입력값으로 실행 시작
|
||||
- `/status/{kickoff_id}`: 실행 상태 확인
|
||||
|
||||
2. **웹 인터페이스**: [app.crewai.com](https://app.crewai.com)에 방문하여 다음을 확인할 수 있습니다:
|
||||
- **Status 탭**: 배포 정보, API 엔드포인트 세부 정보 및 인증 토큰 확인
|
||||
- **Run 탭**: crew 구조의 시각적 표현
|
||||
- **Executions 탭**: 모든 실행 내역
|
||||
- **Metrics 탭**: 성능 분석
|
||||
- **Traces 탭**: 상세 실행 인사이트
|
||||
|
||||
### 실행 트리거하기
|
||||
|
||||
Enterprise 대시보드에서 다음 작업을 수행할 수 있습니다:
|
||||
|
||||
1. crew 이름을 클릭하여 상세 정보를 엽니다
|
||||
2. 관리 인터페이스에서 "Trigger Crew"를 선택합니다
|
||||
3. 나타나는 모달에 필요한 입력값을 입력합니다
|
||||
4. 파이프라인을 따라 실행의 진행 상황을 모니터링합니다
|
||||
|
||||
### 모니터링 및 분석
|
||||
|
||||
Enterprise 플랫폼은 포괄적인 가시성 기능을 제공합니다:
|
||||
|
||||
- **실행 관리**: 활성 및 완료된 실행 추적
|
||||
- **트레이스**: 각 실행의 상세 분해
|
||||
- **메트릭**: 토큰 사용량, 실행 시간, 비용
|
||||
- **타임라인 보기**: 작업 시퀀스의 시각적 표현
|
||||
|
||||
### 고급 기능
|
||||
|
||||
Enterprise 플랫폼은 또한 다음을 제공합니다:
|
||||
|
||||
- **환경 변수 관리**: API 키를 안전하게 저장 및 관리
|
||||
- **LLM 연결**: 다양한 LLM 공급자와의 통합 구성
|
||||
- **Custom Tools Repository**: 도구 생성, 공유 및 설치
|
||||
- **Crew Studio**: 코드를 작성하지 않고 채팅 인터페이스를 통해 crew 빌드
|
||||
|
||||
<Card title="도움이 필요하신가요?" icon="headset" href="mailto:support@crewai.com">
|
||||
Enterprise 플랫폼의 배포 문제 또는 문의 사항이 있으시면 지원팀에 연락해 주십시오.
|
||||
</Card>
|
||||
165
docs/ko/enterprise/guides/enable-crew-studio.mdx
Normal file
@@ -0,0 +1,165 @@
|
||||
---
|
||||
title: "Crew Studio 활성화"
|
||||
description: "CrewAI Enterprise에서 Crew Studio 활성화하기"
|
||||
icon: "comments"
|
||||
---
|
||||
|
||||
<Tip>
|
||||
Crew Studio는 대화형 인터페이스를 통해 빠르게 Crew를 스캐폴딩하거나 구축할 수 있는 강력한 **노코드/로우코드** 도구입니다.
|
||||
</Tip>
|
||||
|
||||
## Crew Studio란?
|
||||
|
||||
Crew Studio는 코드를 작성하지 않고도 AI agent crew를 생성할 수 있는 혁신적인 방법입니다.
|
||||
|
||||
<Frame>
|
||||

|
||||
</Frame>
|
||||
|
||||
Crew Studio를 사용하면 다음과 같은 작업이 가능합니다:
|
||||
|
||||
- Crew Assistant와 채팅하여 문제를 설명
|
||||
- agent 및 task를 자동으로 생성
|
||||
- 적절한 tool 선택
|
||||
- 필요한 입력값 구성
|
||||
- 커스터마이징을 위한 다운로드 가능한 코드 생성
|
||||
- CrewAI Enterprise 플랫폼에 직접 배포
|
||||
|
||||
## 구성 단계
|
||||
|
||||
Crew Studio를 사용하기 전에 LLM 연결을 구성해야 합니다:
|
||||
|
||||
<Steps>
|
||||
<Step title="LLM 연결 설정">
|
||||
CrewAI Enterprise 대시보드의 **LLM Connections** 탭으로 이동하여 새 LLM 연결을 만듭니다.
|
||||
|
||||
<Note>
|
||||
CrewAI에서 지원하는 원하는 LLM 공급자를 자유롭게 사용하실 수 있습니다.
|
||||
</Note>
|
||||
|
||||
LLM 연결을 구성하세요:
|
||||
|
||||
- `Connection Name`(예: `OpenAI`)을 입력하세요.
|
||||
- 모델 공급자를 선택하세요: `openai` 또는 `azure`
|
||||
- Studio에서 생성되는 Crews에 사용할 모델을 선택하세요.
|
||||
- 최소한 `gpt-4o`, `o1-mini`, `gpt-4o-mini`를 권장합니다.
|
||||
- API 키를 환경 변수로 추가하세요:
|
||||
- OpenAI의 경우: `OPENAI_API_KEY`에 API 키를 추가
|
||||
- Azure OpenAI의 경우: [이 글](https://blog.crewai.com/configuring-azure-openai-with-crewai-a-comprehensive-guide/)을 참고하여 구성
|
||||
- `Add Connection`을 클릭하여 구성을 저장하세요.
|
||||
|
||||
<Frame>
|
||||

|
||||
</Frame>
|
||||
</Step>
|
||||
|
||||
<Step title="연결 추가 확인">
|
||||
설정이 완료되면 새 연결이 사용 가능한 연결 목록에 추가된 것을 볼 수 있습니다.
|
||||
|
||||
<Frame>
|
||||

|
||||
</Frame>
|
||||
</Step>
|
||||
|
||||
<Step title="LLM 기본값 구성">
|
||||
메인 메뉴에서 **Settings → Defaults**로 이동하여 LLM 기본값을 구성하세요:
|
||||
|
||||
- 에이전트 및 기타 구성 요소의 기본 모델을 선택하세요
|
||||
- Crew Studio의 기본 구성을 설정하세요
|
||||
|
||||
변경 사항을 적용하려면 `Save Settings`를 클릭하세요.
|
||||
|
||||
<Frame>
|
||||

|
||||
</Frame>
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## Crew Studio 사용하기
|
||||
|
||||
LLM 연결과 기본 설정을 구성했다면 이제 Crew Studio 사용을 시작할 준비가 완료되었습니다!
|
||||
|
||||
<Steps>
|
||||
<Step title="Studio 접속">
|
||||
CrewAI Enterprise 대시보드에서 **Studio** 섹션으로 이동하세요.
|
||||
</Step>
|
||||
|
||||
<Step title="대화 시작">
|
||||
Crew Assistant와 대화를 시작하며 해결하고자 하는 문제를 설명하세요:
|
||||
|
||||
```md
|
||||
I need a crew that can research the latest AI developments and create a summary report.
|
||||
```
|
||||
|
||||
Crew Assistant는 귀하의 요구 사항을 더 잘 이해하기 위해 추가 질문을 할 것입니다.
|
||||
</Step>
|
||||
|
||||
<Step title="생성된 crew 검토">
|
||||
생성된 crew 구성을 검토하세요. 구성에는 다음이 포함됩니다:
|
||||
|
||||
- 에이전트 및 그들의 역할
|
||||
- 수행할 작업
|
||||
- 필요한 입력값
|
||||
- 사용할 도구
|
||||
|
||||
이 단계에서 구성 내용을 세부적으로 수정할 수 있습니다.
|
||||
</Step>
|
||||
|
||||
<Step title="배포 또는 다운로드">
|
||||
구성에 만족하면 다음을 수행할 수 있습니다:
|
||||
|
||||
- 생성된 코드를 다운로드하여 로컬에서 커스터마이징
|
||||
- crew를 CrewAI Enterprise 플랫폼에 직접 배포
|
||||
- 구성을 수정하고 crew를 재생성
|
||||
</Step>
|
||||
|
||||
<Step title="crew 테스트">
|
||||
배포 후 샘플 입력으로 crew를 테스트하여 기대한 대로 동작하는지 확인하세요.
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
<Tip>
|
||||
최상의 결과를 얻으려면 crew가 달성해야 할 목표를 명확하고 상세하게 설명하세요. 원하는 입력값과 예상 결과를 설명에 포함시키는 것이 좋습니다.
|
||||
</Tip>
|
||||
|
||||
## 예시 워크플로우
|
||||
|
||||
다음은 Crew Studio를 사용하여 crew를 생성하는 일반적인 워크플로우입니다:
|
||||
|
||||
<Steps>
|
||||
<Step title="문제 설명하기">
|
||||
먼저 문제를 설명하세요:
|
||||
|
||||
```md
|
||||
I need a crew that can analyze financial news and provide investment recommendations
|
||||
```
|
||||
</Step>
|
||||
|
||||
<Step title="질문에 답하기">
|
||||
crew assistant가 요구 사항을 구체화할 수 있도록 하는 추가 질문에 답변하세요.
|
||||
</Step>
|
||||
|
||||
<Step title="계획 검토하기">
|
||||
생성된 crew 계획을 검토하세요. 여기에는 다음과 같은 항목이 포함될 수 있습니다:
|
||||
|
||||
- 금융 뉴스를 수집하는 Research Agent
|
||||
- 데이터를 해석하는 Analysis Agent
|
||||
- 투자 조언을 제공하는 Recommendations Agent
|
||||
</Step>
|
||||
|
||||
<Step title="승인 또는 수정">
|
||||
계획을 승인하거나 필요하다면 변경을 요청하세요.
|
||||
</Step>
|
||||
|
||||
<Step title="다운로드 또는 배포">
|
||||
사용자화를 위해 코드를 다운로드하거나 플랫폼에 직접 배포하세요.
|
||||
</Step>
|
||||
|
||||
<Step title="테스트 및 개선">
|
||||
샘플 입력으로 crew를 테스트하고 필요에 따라 개선하세요.
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
<Card title="도움이 필요하세요?" icon="headset" href="mailto:support@crewai.com">
|
||||
Crew Studio 또는 기타 CrewAI Enterprise 기능 지원이 필요하다면 지원팀에 문의하세요.
|
||||
</Card>
|
||||
53
docs/ko/enterprise/guides/hubspot-trigger.mdx
Normal file
@@ -0,0 +1,53 @@
|
||||
---
|
||||
title: "HubSpot 트리거"
|
||||
description: "HubSpot 워크플로우에서 CrewAI 크루를 직접 트리거하세요"
|
||||
icon: "hubspot"
|
||||
---
|
||||
|
||||
이 가이드는 HubSpot Workflows에서 직접 crew를 시작할 수 있도록 CrewAI Enterprise용 HubSpot 트리거를 설정하는 단계별 과정을 제공합니다.
|
||||
|
||||
## 사전 준비 사항
|
||||
|
||||
- CrewAI Enterprise 계정
|
||||
- [HubSpot Workflows](https://knowledge.hubspot.com/workflows/create-workflows) 기능이 활성화된 HubSpot 계정
|
||||
|
||||
## 설정 단계
|
||||
|
||||
<Steps>
|
||||
<Step title="HubSpot 계정을 CrewAI Enterprise와 연결하기">
|
||||
- `CrewAI Enterprise 계정 > 트리거`에 로그인합니다.
|
||||
- 사용 가능한 트리거 목록에서 `HubSpot`을 선택합니다.
|
||||
- CrewAI Enterprise와 연결하고자 하는 HubSpot 계정을 선택합니다.
|
||||
- 화면에 나타나는 안내에 따라 CrewAI Enterprise가 HubSpot 계정에 접근하도록 승인합니다.
|
||||
- HubSpot이 CrewAI Enterprise와 성공적으로 연결되면 확인 메시지가 표시됩니다.
|
||||
</Step>
|
||||
<Step title="HubSpot 워크플로우 생성하기">
|
||||
- `HubSpot 계정 > 자동화 > 워크플로우 > 새 워크플로우`에 로그인합니다.
|
||||
- 필요에 맞는 워크플로우 유형을 선택합니다 (예: 처음부터 시작).
|
||||
- 워크플로우 빌더에서 더하기(+) 아이콘을 클릭하여 새로운 작업을 추가합니다.
|
||||
- `통합 앱 > CrewAI > Crew 시작하기`를 선택합니다.
|
||||
- 시작할 Crew를 선택합니다.
|
||||
- `저장`을 클릭하여 워크플로우에 작업을 추가합니다.
|
||||
<Frame>
|
||||
<img src="/images/enterprise/hubspot-workflow-1.png" alt="HubSpot Workflow 1" />
|
||||
</Frame>
|
||||
</Step>
|
||||
<Step title="Crew 결과를 다른 작업과 함께 사용하기">
|
||||
- Crew 시작 단계 이후, 더하기(+) 아이콘을 클릭하여 새로운 작업을 추가합니다.
|
||||
- 예를 들어, 내부 이메일 알림을 전송하려면 `커뮤니케이션 > 내부 이메일 알림 전송`을 선택합니다.
|
||||
- 본문 필드에서 `데이터 삽입`을 클릭하고, `다음에서 속성 또는 작업 결과 보기 > 작업 결과 > Crew 결과`를 선택하여 이메일에 Crew 데이터를 포함합니다.
|
||||
<Frame>
|
||||
<img src="/images/enterprise/hubspot-workflow-2.png" alt="HubSpot Workflow 2" />
|
||||
</Frame>
|
||||
- 필요에 따라 추가 작업을 구성합니다.
|
||||
- 모든 워크플로우 단계를 검토하여 올바르게 설정되었는지 확인합니다.
|
||||
- 워크플로우를 활성화합니다.
|
||||
<Frame>
|
||||
<img src="/images/enterprise/hubspot-workflow-3.png" alt="HubSpot Workflow 3" />
|
||||
</Frame>
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## 추가 자료
|
||||
|
||||
사용 가능한 작업과 사용자 지정 옵션에 대한 자세한 정보는 [HubSpot 워크플로우 문서](https://knowledge.hubspot.com/workflows/create-workflows)를 참고하세요.
|
||||
78
docs/ko/enterprise/guides/human-in-the-loop.mdx
Normal file
@@ -0,0 +1,78 @@
|
||||
---
|
||||
title: "HITL 워크플로우"
|
||||
description: "CrewAI에서 의사결정 향상을 위한 Human-In-The-Loop 워크플로우 구현 방법을 알아보세요"
|
||||
icon: "user-check"
|
||||
---
|
||||
|
||||
인간-중심(Human-In-The-Loop, HITL)은 인공지능과 인간 전문 지식을 결합하여 의사결정을 강화하고 작업 결과를 향상시키는 강력한 접근 방식입니다. 이 가이드는 CrewAI 내에서 HITL을 구현하는 방법을 보여줍니다.
|
||||
|
||||
## HITL 워크플로 설정
|
||||
|
||||
<Steps>
|
||||
<Step title="작업 구성">
|
||||
사람 입력이 활성화된 상태로 작업을 설정하세요:
|
||||
<Frame>
|
||||
<img src="/images/enterprise/crew-human-input.png" alt="Crew Human Input" />
|
||||
</Frame>
|
||||
</Step>
|
||||
|
||||
<Step title="Webhook URL 제공">
|
||||
crew를 시작할 때 인간 입력을 위한 webhook URL을 포함하세요:
|
||||
<Frame>
|
||||
<img src="/images/enterprise/crew-webhook-url.png" alt="Crew Webhook URL" />
|
||||
</Frame>
|
||||
</Step>
|
||||
|
||||
<Step title="Webhook 알림 받기">
|
||||
crew가 사람 입력이 필요한 작업을 완료하면 다음 정보를 포함한 webhook 알림을 받게 됩니다:
|
||||
- **Execution ID**
|
||||
- **Task ID**
|
||||
- **Task output**
|
||||
</Step>
|
||||
|
||||
<Step title="작업 출력 검토">
|
||||
시스템이 `Pending Human Input` 상태에서 일시 중지됩니다. 작업 출력을 신중하게 검토하세요.
|
||||
</Step>
|
||||
|
||||
<Step title="사람 피드백 제출">
|
||||
다음 정보를 포함하여 crew의 resume endpoint를 호출하세요:
|
||||
<Frame>
|
||||
<img src="/images/enterprise/crew-resume-endpoint.png" alt="Crew Resume Endpoint" />
|
||||
</Frame>
|
||||
<Warning>
|
||||
**피드백이 작업 실행에 미치는 영향**:
|
||||
피드백 전체 내용이 이후 작업 실행을 위한 추가 컨텍스트로 통합되므로 피드백 제공 시 신중함이 매우 중요합니다.
|
||||
</Warning>
|
||||
이는 다음을 의미합니다:
|
||||
- 피드백에 입력한 모든 정보가 작업의 컨텍스트 일부가 됩니다.
|
||||
- 관련 없는 상세 정보는 부정적인 영향을 줄 수 있습니다.
|
||||
- 간결하고 관련성 높은 피드백이 작업의 집중도와 효율성을 유지하는 데 도움이 됩니다.
|
||||
- 제출 전 항상 피드백을 신중히 검토하여 작업 실행을 긍정적으로 안내할 수 있는 관련 정보만 포함되어 있는지 확인하세요.
|
||||
</Step>
|
||||
<Step title="부정적 피드백 처리">
|
||||
부정적인 피드백을 제공하는 경우:
|
||||
- crew가 귀하의 피드백에서 추가된 컨텍스트와 함께 작업을 재시도합니다.
|
||||
- 추가 확인을 위한 다른 webhook 알림을 받게 됩니다.
|
||||
- 만족할 때까지 4-6단계를 반복하세요.
|
||||
</Step>
|
||||
|
||||
<Step title="작업 실행 계속 진행">
|
||||
긍정적인 피드백을 제출하면 실행이 다음 단계로 진행됩니다.
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## 모범 사례
|
||||
|
||||
- **구체적으로 작성하세요**: 해당 작업에 직접적으로 관련된 명확하고 실행 가능한 피드백을 제공하세요
|
||||
- **관련성 유지**: 작업 수행 개선에 도움이 되는 정보만 포함하세요
|
||||
- **적시에 응답하세요**: 워크플로우 지연을 피하기 위해 HITL 프롬프트에 신속하게 응답하세요
|
||||
- **꼼꼼하게 검토하세요**: 제출 전에 피드백을 다시 확인하여 정확성을 보장하세요
|
||||
|
||||
## 일반적인 사용 사례
|
||||
|
||||
HITL 워크플로우는 특히 다음과 같은 경우에 유용합니다:
|
||||
- 품질 보증 및 검증
|
||||
- 복잡한 의사 결정 시나리오
|
||||
- 민감하거나 위험도가 높은 작업
|
||||
- 인간의 판단이 필요한 창의적 작업
|
||||
- 준수 및 규제 검토
|
||||
185
docs/ko/enterprise/guides/kickoff-crew.mdx
Normal file
@@ -0,0 +1,185 @@
|
||||
---
|
||||
title: "Kickoff Crew"
|
||||
description: "CrewAI Enterprise에서 Crew를 시작하세요"
|
||||
icon: "flag-checkered"
|
||||
---
|
||||
|
||||
## 개요
|
||||
|
||||
Crew를 CrewAI Enterprise 플랫폼에 배포한 후에는 웹 인터페이스 또는 API를 통해 실행을 시작할 수 있습니다. 이 가이드는 두 가지 접근 방식을 모두 다룹니다.
|
||||
|
||||
## 방법 1: 웹 인터페이스 사용
|
||||
|
||||
### 1단계: 배포된 Crew로 이동하기
|
||||
|
||||
1. [CrewAI Enterprise](https://app.crewai.com)에 로그인합니다.
|
||||
2. 프로젝트 목록에서 crew 이름을 클릭합니다.
|
||||
3. crew의 상세 페이지로 이동합니다.
|
||||
|
||||
<Frame>
|
||||

|
||||
</Frame>
|
||||
|
||||
### 2단계: 실행 시작
|
||||
|
||||
crew의 상세 페이지에서 실행을 시작할 수 있는 두 가지 옵션이 있습니다:
|
||||
|
||||
#### 옵션 A: 빠른 시작
|
||||
|
||||
1. Test Endpoints 섹션에서 `Kickoff` 링크를 클릭합니다.
|
||||
2. JSON 에디터에서 crew에 필요한 입력 파라미터를 입력합니다.
|
||||
3. `Send Request` 버튼을 클릭합니다.
|
||||
|
||||
<Frame>
|
||||

|
||||
</Frame>
|
||||
|
||||
#### 옵션 B: 시각적 인터페이스 사용
|
||||
|
||||
1. crew 상세 페이지에서 `Run` 탭을 클릭합니다.
|
||||
2. 양식 필드에 필요한 입력값을 입력합니다.
|
||||
3. `Run Crew` 버튼을 클릭합니다.
|
||||
|
||||
<Frame>
|
||||

|
||||
</Frame>
|
||||
|
||||
### 3단계: 실행 진행 상황 모니터링
|
||||
|
||||
실행을 시작한 후:
|
||||
|
||||
1. `kickoff_id`가 포함된 응답을 받게 됩니다. - **이 ID를 복사하세요**
|
||||
2. 이 ID는 실행을 추적하는 데 필수적입니다
|
||||
|
||||
<Frame>
|
||||

|
||||
</Frame>
|
||||
|
||||
### 4단계: 실행 상태 확인
|
||||
|
||||
실행 진행 상황을 모니터링하려면:
|
||||
|
||||
1. Test Endpoints 섹션에서 "Status" 엔드포인트를 클릭하세요
|
||||
2. 지정된 필드에 `kickoff_id`를 붙여넣으세요
|
||||
3. "Get Status" 버튼을 클릭하세요
|
||||
|
||||
<Frame>
|
||||

|
||||
</Frame>
|
||||
|
||||
상태 응답에는 다음이 표시됩니다:
|
||||
- 현재 실행 상태(`running`, `completed` 등)
|
||||
- 진행 중인 작업에 대한 세부 정보
|
||||
- 지금까지 생성된 모든 출력
|
||||
|
||||
### 5단계: 최종 결과 보기
|
||||
|
||||
실행이 완료되면:
|
||||
|
||||
1. 상태가 `completed`로 변경됩니다.
|
||||
2. 전체 실행 결과와 출력을 확인할 수 있습니다.
|
||||
3. 더 자세한 내용을 보려면 crew 상세 페이지의 `Executions` 탭을 확인하세요.
|
||||
|
||||
## 방법 2: API 사용
|
||||
|
||||
CrewAI Enterprise REST API를 사용하여 프로그래밍 방식으로 crews를 시작할 수도 있습니다.
|
||||
|
||||
### 인증
|
||||
|
||||
모든 API 요청에는 인증을 위한 베어러 토큰이 필요합니다:
|
||||
|
||||
```bash
|
||||
curl -H "Authorization: Bearer YOUR_CREW_TOKEN" https://your-crew-url.crewai.com
|
||||
```
|
||||
|
||||
베어러 토큰은 crew의 상세 페이지의 Status 탭에서 확인할 수 있습니다.
|
||||
|
||||
### 크루 상태 확인
|
||||
|
||||
작업을 실행하기 전에 크루가 정상적으로 실행되고 있는지 확인할 수 있습니다:
|
||||
|
||||
```bash
|
||||
curl -H "Authorization: Bearer YOUR_CREW_TOKEN" https://your-crew-url.crewai.com
|
||||
```
|
||||
|
||||
요청이 성공하면 크루가 정상적으로 동작 중임을 나타내는 메시지가 반환됩니다:
|
||||
|
||||
```
|
||||
Healthy%
|
||||
```
|
||||
|
||||
### 1단계: 필요한 입력값 확인
|
||||
|
||||
먼저, crew에서 요구하는 입력값이 무엇인지 확인합니다:
|
||||
|
||||
```bash
|
||||
curl -X GET \
|
||||
-H "Authorization: Bearer YOUR_CREW_TOKEN" \
|
||||
https://your-crew-url.crewai.com/inputs
|
||||
```
|
||||
|
||||
응답은 예를 들어 다음과 같이 필수 입력 파라미터 배열을 포함한 JSON 객체로 반환됩니다:
|
||||
|
||||
```json
|
||||
{"inputs":["topic","current_year"]}
|
||||
```
|
||||
|
||||
이 예시에서는 해당 crew에서 두 개의 입력값인 `topic`과 `current_year`를 필요로 함을 보여줍니다.
|
||||
|
||||
### 2단계: kickoff 실행
|
||||
|
||||
필수 입력값을 제공하여 실행을 시작합니다:
|
||||
|
||||
```bash
|
||||
curl -X POST \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "Authorization: Bearer YOUR_CREW_TOKEN" \
|
||||
-d '{"inputs": {"topic": "AI Agent Frameworks", "current_year": "2025"}}' \
|
||||
https://your-crew-url.crewai.com/kickoff
|
||||
```
|
||||
|
||||
응답에는 추적에 필요한 `kickoff_id`가 포함됩니다:
|
||||
|
||||
```json
|
||||
{"kickoff_id":"abcd1234-5678-90ef-ghij-klmnopqrstuv"}
|
||||
```
|
||||
|
||||
### 3단계: 실행 상태 확인
|
||||
|
||||
kickoff_id를 사용하여 실행 진행 상황을 모니터링하세요:
|
||||
|
||||
```bash
|
||||
curl -X GET \
|
||||
-H "Authorization: Bearer YOUR_CREW_TOKEN" \
|
||||
https://your-crew-url.crewai.com/status/abcd1234-5678-90ef-ghij-klmnopqrstuv
|
||||
```
|
||||
|
||||
## 실행 처리
|
||||
|
||||
### 장기 실행
|
||||
|
||||
오랜 시간이 걸릴 수 있는 실행의 경우:
|
||||
|
||||
1. 주기적으로 상태를 확인하는 폴링 메커니즘을 구현하는 것을 고려하세요
|
||||
2. 실행 완료 시 알림을 받을 수 있도록 웹훅(가능한 경우)을 사용하세요
|
||||
3. 잠재적인 타임아웃에 대비하여 오류 처리를 구현하세요
|
||||
|
||||
### 실행 컨텍스트
|
||||
|
||||
실행 컨텍스트에는 다음이 포함됩니다:
|
||||
|
||||
- 시작 시 제공된 입력값
|
||||
- 배포 중에 구성된 환경 변수
|
||||
- 태스크 간에 유지되는 상태
|
||||
|
||||
### 실행 실패 디버깅
|
||||
|
||||
실행이 실패할 경우:
|
||||
|
||||
1. "Executions" 탭에서 자세한 로그를 확인하세요
|
||||
2. "Traces" 탭에서 단계별 실행 세부 정보를 검토하세요
|
||||
3. 트레이스 세부 정보에서 LLM 응답과 도구 사용 내역을 확인하세요
|
||||
|
||||
<Card title="도움이 필요하신가요?" icon="headset" href="mailto:support@crewai.com">
|
||||
실행 문제 또는 엔터프라이즈 플랫폼 관련 질문이 있으신 경우, 지원팀에 문의하세요.
|
||||
</Card>
|
||||
103
docs/ko/enterprise/guides/react-component-export.mdx
Normal file
@@ -0,0 +1,103 @@
|
||||
---
|
||||
title: "React 컴포넌트 내보내기"
|
||||
description: "CrewAI Enterprise React 컴포넌트를 애플리케이션에 내보내고 통합하는 방법을 알아보세요"
|
||||
icon: "react"
|
||||
---
|
||||
|
||||
이 가이드는 CrewAI Enterprise crew를 React 컴포넌트로 내보내고 이를 여러분의 애플리케이션에 통합하는 방법을 설명합니다.
|
||||
|
||||
## React 컴포넌트 내보내기
|
||||
|
||||
<Steps>
|
||||
<Step title="컴포넌트 내보내기">
|
||||
배포된 crew 오른쪽에 있는 줄임표(세 개의 점)를 클릭한 다음 내보내기 옵션을 선택하고 파일을 로컬에 저장하세요. 본 예시에서는 `CrewLead.jsx`를 사용합니다.
|
||||
|
||||
<Frame>
|
||||
<img src="/images/enterprise/export-react-component.png" alt="React 컴포넌트 내보내기" />
|
||||
</Frame>
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## 리액트 환경 설정
|
||||
|
||||
이 리액트 컴포넌트를 로컬에서 실행하려면 리액트 개발 환경을 설정하고 이 컴포넌트를 리액트 프로젝트에 통합해야 합니다.
|
||||
|
||||
<Steps>
|
||||
<Step title="Node.js 설치">
|
||||
- 공식 웹사이트(https://nodejs.org/)에서 Node.js를 다운로드하고 설치하세요.
|
||||
- 안정성을 위해 LTS(장기 지원) 버전을 선택하세요.
|
||||
</Step>
|
||||
|
||||
<Step title="새 리액트 프로젝트 생성">
|
||||
- 명령 프롬프트 또는 PowerShell을 엽니다.
|
||||
- 프로젝트를 생성하고자 하는 디렉터리로 이동하세요.
|
||||
- 다음 명령어를 실행하여 새로운 리액트 프로젝트를 생성합니다:
|
||||
|
||||
```bash
|
||||
npx create-react-app my-crew-app
|
||||
```
|
||||
- 프로젝트 디렉터리로 이동합니다:
|
||||
|
||||
```bash
|
||||
cd my-crew-app
|
||||
```
|
||||
</Step>
|
||||
|
||||
<Step title="필요한 의존성 설치">
|
||||
```bash
|
||||
npm install react-dom
|
||||
```
|
||||
</Step>
|
||||
|
||||
<Step title="CrewLead 컴포넌트 생성">
|
||||
- 다운로드한 파일 `CrewLead.jsx`를 프로젝트의 `src` 폴더로 이동하세요.
|
||||
</Step>
|
||||
|
||||
<Step title="App.js를 수정하여 CrewLead 컴포넌트 사용">
|
||||
- `src/App.js`를 엽니다.
|
||||
- 내용물을 아래와 같이 교체하세요:
|
||||
|
||||
```jsx
|
||||
import React from 'react';
|
||||
import CrewLead from './CrewLead';
|
||||
|
||||
function App() {
|
||||
return (
|
||||
<div className="App">
|
||||
<CrewLead baseUrl="YOUR_API_BASE_URL" bearerToken="YOUR_BEARER_TOKEN" />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default App;
|
||||
```
|
||||
- `YOUR_API_BASE_URL` 및 `YOUR_BEARER_TOKEN` 부분을 실제 API 값으로 바꿔주세요.
|
||||
</Step>
|
||||
|
||||
<Step title="개발 서버 시작">
|
||||
- 프로젝트 디렉터리에서 다음 명령어를 실행하세요:
|
||||
|
||||
```bash
|
||||
npm start
|
||||
```
|
||||
- 개발 서버가 시작되며, 기본 웹 브라우저가 자동으로 http://localhost:3000 을 열고 리액트 앱이 실행되는 것을 확인할 수 있습니다.
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## 커스터마이징
|
||||
|
||||
그런 다음 `CrewLead.jsx`를 커스터마이즈하여 색상, 제목 등을 추가할 수 있습니다.
|
||||
|
||||
<Frame>
|
||||
<img src="/images/enterprise/customise-react-component.png" alt="React 컴포넌트 커스터마이즈" />
|
||||
</Frame>
|
||||
<Frame>
|
||||
<img src="/images/enterprise/customise-react-component-2.png" alt="React 컴포넌트 커스터마이즈" />
|
||||
</Frame>
|
||||
|
||||
## 다음 단계
|
||||
|
||||
- 구성 요소 스타일을 애플리케이션 디자인에 맞게 맞춤화하세요
|
||||
- 추가 구성을 위한 props를 추가하세요
|
||||
- 애플리케이션의 상태 관리와 통합하세요
|
||||
- 오류 처리 및 로딩 상태를 추가하세요
|
||||
44
docs/ko/enterprise/guides/salesforce-trigger.mdx
Normal file
@@ -0,0 +1,44 @@
|
||||
---
|
||||
title: "Salesforce 트리거"
|
||||
description: "Salesforce 워크플로우에서 CrewAI crew를 트리거하여 CRM 자동화"
|
||||
icon: "salesforce"
|
||||
---
|
||||
|
||||
CrewAI Enterprise는 Salesforce에서 트리거되어 고객 관계 관리 워크플로우를 자동화하고 영업 운영을 강화할 수 있습니다.
|
||||
|
||||
## 개요
|
||||
|
||||
Salesforce는 기업이 영업, 서비스, 마케팅 운영을 효율화할 수 있도록 돕는 선도적인 고객 관계 관리(CRM) 플랫폼입니다. Salesforce에서 CrewAI 트리거를 설정하면 다음과 같은 작업을 수행할 수 있습니다:
|
||||
|
||||
- 리드 점수 산정 및 자격 심사 자동화
|
||||
- 개인화된 영업 자료 생성
|
||||
- AI 기반 응답으로 고객 서비스 강화
|
||||
- 데이터 분석 및 보고 간소화
|
||||
|
||||
## 데모
|
||||
|
||||
<Frame>
|
||||
<iframe width="100%" height="400" src="https://www.youtube.com/embed/oJunVqjjfu4" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
|
||||
</Frame>
|
||||
|
||||
## 시작하기
|
||||
|
||||
Salesforce 트리거를 설정하려면:
|
||||
|
||||
1. **지원팀 문의**: Salesforce 트리거 설정을 위해 CrewAI Enterprise 지원팀에 연락하세요.
|
||||
2. **요구 사항 검토**: 필요한 Salesforce 권한과 API 액세스 권한이 있는지 확인하세요.
|
||||
3. **연결 구성**: 지원팀과 협력하여 CrewAI와 귀하의 Salesforce 인스턴스 간의 연결을 설정하세요.
|
||||
4. **트리거 테스트**: 트리거가 귀하의 특정 사용 사례에 맞게 올바르게 작동하는지 확인하세요.
|
||||
|
||||
## 사용 사례
|
||||
|
||||
일반적인 Salesforce + CrewAI 트리거 시나리오는 다음과 같습니다:
|
||||
|
||||
- **Lead 처리**: 들어오는 리드를 자동으로 분석하고 점수화
|
||||
- **제안서 생성**: 기회 데이터를 기반으로 맞춤형 제안서 생성
|
||||
- **고객 인사이트**: 고객 상호작용 이력에서 분석 보고서 생성
|
||||
- **후속 조치 자동화**: 개인화된 후속 메시지 및 추천 생성
|
||||
|
||||
## 다음 단계
|
||||
|
||||
자세한 설정 지침 및 고급 구성 옵션에 대해서는 CrewAI Enterprise 지원팀에 문의해 주시기 바랍니다. 지원팀은 귀하의 특정 Salesforce 환경과 비즈니스 요구에 맞는 맞춤형 안내를 제공해 드릴 수 있습니다.
|
||||
61
docs/ko/enterprise/guides/slack-trigger.mdx
Normal file
@@ -0,0 +1,61 @@
|
||||
---
|
||||
title: "Slack 트리거"
|
||||
description: "슬래시 명령어를 사용해 Slack에서 CrewAI crew를 직접 트리거합니다"
|
||||
icon: "slack"
|
||||
---
|
||||
|
||||
이 가이드는 CrewAI 트리거를 사용하여 Slack에서 직접 crew를 시작하는 방법을 설명합니다.
|
||||
|
||||
## 사전 요구 사항
|
||||
|
||||
- CrewAI Slack 트리거가 설치되어 있고 Slack 워크스페이스에 연결되어 있음
|
||||
- CrewAI에서 하나 이상의 crew가 구성되어 있음
|
||||
|
||||
## 설정 단계
|
||||
|
||||
<Steps>
|
||||
<Step title="CrewAI Slack 트리거가 설정되어 있는지 확인">
|
||||
CrewAI 대시보드에서 **트리거** 섹션으로 이동합니다.
|
||||
|
||||
<Frame>
|
||||
<img src="/images/enterprise/slack-integration.png" alt="CrewAI Slack Integration" />
|
||||
</Frame>
|
||||
|
||||
Slack이 나열되어 있고 연결되어 있는지 확인합니다.
|
||||
</Step>
|
||||
<Step title="Slack 채널을 엽니다">
|
||||
- crew를 시작하려는 채널로 이동합니다.
|
||||
- 슬래시 명령어 "**/kickoff**"를 입력하여 crew 시작 프로세스를 시작합니다.
|
||||
- 입력하는 동안 "**Kickoff crew**"가 나타나야 합니다:
|
||||
<Frame>
|
||||
<img src="/images/enterprise/kickoff-slack-crew.png" alt="Kickoff crew" />
|
||||
</Frame>
|
||||
- Enter를 누르거나 "**Kickoff crew**" 옵션을 선택합니다. "**Kickoff an AI Crew**"라는 제목의 대화상자가 나타납니다.
|
||||
</Step>
|
||||
<Step title="시작할 crew를 선택합니다">
|
||||
- "**Select of the crews online:**"라는 드롭다운 메뉴에서 시작할 crew를 선택합니다.
|
||||
- 아래 예시에서는 "**prep-for-meeting**"이 선택되어 있습니다:
|
||||
<Frame>
|
||||
<img src="/images/enterprise/kickoff-slack-crew-dropdown.png" alt="Kickoff crew dropdown" />
|
||||
</Frame>
|
||||
- crew에 입력값이 필요한 경우 "**Add Inputs**" 버튼을 클릭하여 입력값을 제공합니다.
|
||||
<Note>
|
||||
위 예시에서 "**Add Inputs**" 버튼이 보이지만 아직 클릭되지 않았습니다.
|
||||
</Note>
|
||||
</Step>
|
||||
<Step title="Kickoff을 클릭하고 crew가 완료될 때까지 기다립니다">
|
||||
- crew를 선택하고 필요한 입력값을 추가했다면, "**Kickoff**"를 클릭하여 crew를 시작합니다.
|
||||
<Frame>
|
||||
<img src="/images/enterprise/kickoff-slack-crew-kickoff.png" alt="Kickoff crew" />
|
||||
</Frame>
|
||||
- crew가 실행을 시작하면 Slack 채널에서 결과를 확인할 수 있습니다.
|
||||
<Frame>
|
||||
<img src="/images/enterprise/kickoff-slack-crew-results.png" alt="Kickoff crew results" />
|
||||
</Frame>
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## 팁
|
||||
|
||||
- Slack 워크스페이스에서 `/kickoff` 명령어를 사용할 수 있는 필요한 권한이 있는지 확인하세요.
|
||||
- 드롭다운에서 원하는 crew가 보이지 않는 경우, CrewAI에서 해당 crew가 올바르게 구성되어 있고 온라인 상태인지 확인하세요.
|
||||
87
docs/ko/enterprise/guides/team-management.mdx
Normal file
@@ -0,0 +1,87 @@
|
||||
---
|
||||
title: "팀 관리"
|
||||
description: "CrewAI Enterprise 조직에서 팀원을 초대하고 관리하는 방법을 알아보세요"
|
||||
icon: "users"
|
||||
---
|
||||
|
||||
CrewAI Enterprise 계정의 관리자라면 새로운 팀원을 조직에 쉽게 초대할 수 있습니다. 이 안내서는 단계별로 프로세스를 안내합니다.
|
||||
|
||||
## 팀 멤버 초대하기
|
||||
|
||||
<Steps>
|
||||
<Step title="설정 페이지 접속">
|
||||
- CrewAI Enterprise 계정에 로그인합니다
|
||||
- 대시보드 오른쪽 상단에 있는 기어 아이콘(⚙️)을 찾습니다
|
||||
- 기어 아이콘을 클릭하여 **설정** 페이지에 접속합니다:
|
||||
<Frame>
|
||||
<img src="/images/enterprise/settings-page.png" alt="Settings Page" />
|
||||
</Frame>
|
||||
</Step>
|
||||
<Step title="멤버 섹션으로 이동">
|
||||
- 설정 페이지에서 `Members` 탭이 보입니다
|
||||
- `Members` 탭을 클릭하여 **멤버** 페이지에 접속합니다:
|
||||
<Frame>
|
||||
<img src="/images/enterprise/members-tab.png" alt="Members Tab" />
|
||||
</Frame>
|
||||
</Step>
|
||||
<Step title="새 멤버 초대">
|
||||
- 멤버 섹션에서 현재 멤버 목록(본인 포함)을 확인할 수 있습니다
|
||||
- `Email` 입력 필드를 찾습니다
|
||||
- 초대하고자 하는 사람의 이메일 주소를 입력합니다
|
||||
- `Invite` 버튼을 클릭하여 초대장을 보냅니다
|
||||
</Step>
|
||||
<Step title="필요에 따라 반복">
|
||||
- 이 과정을 반복하여 여러 팀 멤버를 초대할 수 있습니다
|
||||
- 초대한 각 멤버는 조직에 가입할 수 있는 이메일 초대장을 받게 됩니다
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## 역할 추가하기
|
||||
|
||||
플랫폼의 다양한 부분에 대한 접근 권한을 제어하기 위해 팀원들에게 역할을 추가할 수 있습니다.
|
||||
|
||||
<Steps>
|
||||
<Step title="설정 페이지 접근">
|
||||
- CrewAI Enterprise 계정에 로그인하세요
|
||||
- 대시보드 오른쪽 상단에서 기어 아이콘(⚙️)을 찾으세요
|
||||
- 기어 아이콘을 클릭하여 **설정** 페이지에 접근하세요:
|
||||
<Frame>
|
||||
<img src="/images/enterprise/settings-page.png" alt="설정 페이지" />
|
||||
</Frame>
|
||||
</Step>
|
||||
<Step title="멤버 섹션으로 이동">
|
||||
- 설정 페이지에서 `Roles` 탭을 확인할 수 있습니다
|
||||
- `Roles` 탭을 클릭하여 **Roles** 페이지로 이동하세요.
|
||||
<Frame>
|
||||
<img src="/images/enterprise/roles-tab.png" alt="Roles 탭" />
|
||||
</Frame>
|
||||
- 새로운 역할을 추가하려면 `Add Role` 버튼을 클릭하세요.
|
||||
- 역할의 세부 정보와 권한을 입력한 후 `Create Role` 버튼을 클릭하여 역할을 생성하세요.
|
||||
<Frame>
|
||||
<img src="/images/enterprise/add-role-modal.png" alt="Add Role 모달" />
|
||||
</Frame>
|
||||
</Step>
|
||||
<Step title="멤버에게 역할 추가하기">
|
||||
- 멤버 섹션에서 현재 멤버(본인 포함) 목록을 확인할 수 있습니다
|
||||
<Frame>
|
||||
<img src="/images/enterprise/member-accepted-invitation.png" alt="멤버 초대 수락 완료" />
|
||||
</Frame>
|
||||
- 멤버가 초대를 수락하면 역할을 추가할 수 있습니다.
|
||||
- 다시 `Roles` 탭으로 이동하세요
|
||||
- 역할을 추가할 멤버로 이동한 후 `Role` 열에서 드롭다운을 클릭하세요
|
||||
- 멤버에게 추가할 역할을 선택하세요
|
||||
- `Update` 버튼을 클릭하여 역할을 저장하세요
|
||||
<Frame>
|
||||
<img src="/images/enterprise/assign-role.png" alt="멤버에 역할 추가" />
|
||||
</Frame>
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## 중요 참고 사항
|
||||
|
||||
- **관리자 권한**: 관리자 권한이 있는 사용자만 새 멤버를 초대할 수 있습니다
|
||||
- **이메일 정확성**: 팀 멤버의 정확한 이메일 주소를 확인하세요
|
||||
- **초대 수락**: 초대된 멤버는 조직에 가입하기 위해 초대를 수락해야 합니다
|
||||
- **이메일 알림**: 팀 멤버에게 초대 이메일(스팸 폴더 포함)을 확인하도록 안내할 수 있습니다
|
||||
|
||||
이 단계들을 따르면 팀을 손쉽게 확장하고 CrewAI Enterprise 조직 내에서 더욱 효과적으로 협업할 수 있습니다.
|
||||
88
docs/ko/enterprise/guides/update-crew.mdx
Normal file
@@ -0,0 +1,88 @@
|
||||
---
|
||||
title: "크루 업데이트"
|
||||
description: "CrewAI Enterprise에서 크루 업데이트하기"
|
||||
icon: "pencil"
|
||||
---
|
||||
|
||||
<Note>
|
||||
CrewAI Enterprise에 crew를 배포한 후, 코드, 보안 설정 또는 구성을 업데이트해야 할 수 있습니다.
|
||||
이 가이드는 이러한 일반적인 업데이트 작업을 수행하는 방법을 설명합니다.
|
||||
</Note>
|
||||
|
||||
## 왜 Crew를 업데이트해야 하나요?
|
||||
|
||||
CrewAI는 기본적으로 GitHub 업데이트를 자동으로 반영하지 않으므로, 배포 시 `Auto-update` 옵션을 선택하지 않았다면 수동으로 업데이트를 트리거해야 합니다.
|
||||
|
||||
Crew 배포를 업데이트하고 싶은 이유는 여러 가지가 있을 수 있습니다:
|
||||
- GitHub에 푸시한 최신 커밋으로 코드를 업데이트하고 싶은 경우
|
||||
- 보안상의 이유로 bearer 토큰을 재설정하고 싶은 경우
|
||||
- 환경 변수를 업데이트하고 싶은 경우
|
||||
|
||||
## 1. 최신 커밋으로 Crew 코드 업데이트하기
|
||||
|
||||
GitHub 저장소에 새로운 커밋을 푸시한 후 배포를 업데이트하려면 다음 단계를 따르세요:
|
||||
|
||||
1. CrewAI Enterprise 플랫폼에서 자신의 crew로 이동하세요.
|
||||
2. crew 상세 페이지에서 `Re-deploy` 버튼을 클릭하세요.
|
||||
|
||||
<Frame>
|
||||

|
||||
</Frame>
|
||||
|
||||
이 작업을 수행하면 진행률 표시줄을 통해 추적할 수 있는 업데이트가 트리거됩니다. 시스템은 저장소에서 최신 코드를 가져와서 배포를 다시 빌드합니다.
|
||||
|
||||
## 2. 베어러 토큰 재설정
|
||||
|
||||
현재 토큰이 유출되었을 가능성이 있다고 의심되는 경우 등, 새 베어러 토큰을 생성해야 한다면 다음 단계를 따르세요:
|
||||
|
||||
1. CrewAI Enterprise 플랫폼에서 해당 crew로 이동하세요.
|
||||
2. `Bearer Token` 섹션을 찾으세요.
|
||||
3. 현재 토큰 옆에 있는 `Reset` 버튼을 클릭하세요.
|
||||
|
||||
<Frame>
|
||||

|
||||
</Frame>
|
||||
|
||||
<Warning>
|
||||
베어러 토큰을 재설정하면 이전 토큰은 즉시 사용할 수 없게 됩니다. 이전 토큰을 사용하고 있는 모든 애플리케이션이나 스크립트에서 토큰을 반드시 업데이트하세요.
|
||||
</Warning>
|
||||
|
||||
## 3. 환경 변수 업데이트하기
|
||||
|
||||
crew의 환경 변수를 업데이트하려면 다음 단계를 따르세요:
|
||||
|
||||
1. 먼저 crew 이름을 클릭하여 배포 페이지에 접속합니다.
|
||||
|
||||
<Frame>
|
||||

|
||||
</Frame>
|
||||
|
||||
2. `Environment Variables` 섹션을 찾습니다 (`Settings` 아이콘을 클릭해야 접근할 수 있습니다)
|
||||
3. 제공된 필드에서 기존 변수를 수정하거나 새 변수를 추가합니다
|
||||
4. 수정한 각 변수 옆의 `Update` 버튼을 클릭합니다
|
||||
|
||||
<Frame>
|
||||

|
||||
</Frame>
|
||||
|
||||
5. 마지막으로, 변경 사항을 적용하려면 페이지 하단의 `Update Deployment` 버튼을 클릭합니다
|
||||
|
||||
<Note>
|
||||
환경 변수를 업데이트하면 새로운 배포가 트리거되지만, 이는 환경 설정만 업데이트하며 코드 자체는 변경되지 않습니다.
|
||||
</Note>
|
||||
|
||||
## 업데이트 후
|
||||
|
||||
업데이트를 수행한 후:
|
||||
|
||||
1. 시스템이 crew를 다시 빌드하고 배포합니다
|
||||
2. 실시간으로 배포 진행 상황을 모니터링할 수 있습니다
|
||||
3. 완료되면 변경 사항이 예상대로 작동하는지 crew를 테스트합니다
|
||||
|
||||
<Tip>
|
||||
업데이트 후 문제가 발생하면 플랫폼에서 배포 로그를 확인하거나 지원팀에 문의하여 도움을 받을 수 있습니다.
|
||||
</Tip>
|
||||
|
||||
<Card title="도움이 필요하신가요?" icon="headset" href="mailto:support@crewai.com">
|
||||
crew 업데이트나 배포 문제 해결에 대해 지원이 필요하시면 지원팀에 문의해 주세요.
|
||||
</Card>
|
||||
121
docs/ko/enterprise/guides/webhook-automation.mdx
Normal file
@@ -0,0 +1,121 @@
|
||||
---
|
||||
title: "웹후크 자동화"
|
||||
description: "ActivePieces, Zapier, Make.com과 같은 플랫폼을 사용하여 CrewAI Enterprise 워크플로우를 웹후크로 자동화하세요"
|
||||
icon: "webhook"
|
||||
---
|
||||
|
||||
CrewAI Enterprise를 사용하면 웹훅을 통해 워크플로우를 자동화할 수 있습니다. 이 문서에서는 웹훅을 설정하고 사용하는 과정을 안내하며, Zapier와 Make.com과 유사한 워크플로우 자동화 플랫폼인 ActivePieces와의 통합에 중점을 두고 crew 실행을 시작하는 방법을 설명합니다.
|
||||
|
||||
## Webhook 설정하기
|
||||
|
||||
<Steps>
|
||||
<Step title="Kickoff 인터페이스 접근">
|
||||
- CrewAI Enterprise 대시보드로 이동하세요.
|
||||
- crew 실행을 시작할 때 사용하는 `/kickoff` 섹션을 찾으세요.
|
||||
<Frame>
|
||||
<img src="/images/enterprise/kickoff-interface.png" alt="Kickoff 인터페이스" />
|
||||
</Frame>
|
||||
</Step>
|
||||
|
||||
<Step title="JSON Content 구성하기">
|
||||
JSON Content 섹션에서 다음 정보를 입력해야 합니다:
|
||||
|
||||
- **inputs**: 다음 항목이 포함된 JSON 객체:
|
||||
- `company`: 회사 이름 (예: "tesla")
|
||||
- `product_name`: 제품 이름 (예: "crewai")
|
||||
- `form_response`: 응답 유형 (예: "financial")
|
||||
- `icp_description`: 이상적인 고객 프로필(ICP)에 대한 간략한 설명
|
||||
- `product_description`: 제품에 대한 짧은 설명
|
||||
- `taskWebhookUrl`, `stepWebhookUrl`, `crewWebhookUrl`: 다양한 webhook 엔드포인트의 URL (ActivePieces, Zapier, Make.com 또는 기타 호환 플랫폼)
|
||||
</Step>
|
||||
|
||||
<Step title="ActivePieces와 통합하기">
|
||||
이 예시에서는 ActivePieces를 사용합니다. 또한 Zapier, Make.com 등 다른 플랫폼도 사용할 수 있습니다.
|
||||
|
||||
ActivePieces와 통합하려면:
|
||||
|
||||
1. ActivePieces에서 새 flow를 설정하세요.
|
||||
2. 트리거를 추가하세요 (예: `Every Day` 스케줄).
|
||||
<Frame>
|
||||
<img src="/images/enterprise/activepieces-trigger.png" alt="ActivePieces 트리거" />
|
||||
</Frame>
|
||||
|
||||
3. HTTP 액션 단계를 추가하세요.
|
||||
- 액션을 `Send HTTP request`로 설정하세요.
|
||||
- 메소드는 `POST`로 사용하세요.
|
||||
- URL은 CrewAI Enterprise kickoff 엔드포인트로 설정하세요.
|
||||
- 필요한 헤더 추가 (예: `Bearer Token`)
|
||||
<Frame>
|
||||
<img src="/images/enterprise/activepieces-headers.png" alt="ActivePieces 헤더" />
|
||||
</Frame>
|
||||
|
||||
- Body에는 2단계에서 구성한 JSON content를 포함하세요.
|
||||
<Frame>
|
||||
<img src="/images/enterprise/activepieces-body.png" alt="ActivePieces 본문" />
|
||||
</Frame>
|
||||
|
||||
- crew가 미리 정의된 시간에 kickoff됩니다.
|
||||
</Step>
|
||||
|
||||
<Step title="Webhook 설정하기">
|
||||
1. ActivePieces에서 새 flow를 만들고 이름을 지정하세요.
|
||||
<Frame>
|
||||
<img src="/images/enterprise/activepieces-flow.png" alt="ActivePieces Flow" />
|
||||
</Frame>
|
||||
|
||||
2. 트리거로 webhook 단계를 추가하세요:
|
||||
- 트리거 유형으로 `Catch Webhook`을 선택하세요.
|
||||
- 이 작업을 통해 HTTP 요청을 수신하고 flow를 트리거하는 고유 URL이 생성됩니다.
|
||||
<Frame>
|
||||
<img src="/images/enterprise/activepieces-webhook.png" alt="ActivePieces Webhook" />
|
||||
</Frame>
|
||||
|
||||
- 이메일이 crew webhook 본문 텍스트를 사용하도록 구성하세요.
|
||||
<Frame>
|
||||
<img src="/images/enterprise/activepieces-email.png" alt="ActivePieces 이메일" />
|
||||
</Frame>
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## Webhook 출력 예시
|
||||
|
||||
<Tabs>
|
||||
<Tab title="Step Webhook">
|
||||
`stepWebhookUrl` - 각 agent의 inner thought가 실행될 때마다 호출되는 콜백
|
||||
|
||||
```json
|
||||
{
|
||||
"action": "**crewai 엔터프라이즈 솔루션을 위한 금융 산업에 대한 예비 조사 보고서**\n1. 산업 개요 및 동향\n금융 산업은 ....\n결론:\n금융 산업은 디지털 고객 참여, 위험 관리, 규정 준수와 같은 분야에서 crewai와 같은 AI 솔루션을 적용하기에 비옥한 토양을 제공합니다. 고객의 구체적인 요구와 규모에 더 맞춘 crewai 솔루션을 제안하기 위해 리드와의 추가적인 접촉이 추천됩니다.",
|
||||
"task_id": "97eba64f-958c-40a0-b61c-625fe635a3c0"
|
||||
}
|
||||
```
|
||||
</Tab>
|
||||
<Tab title="Task Webhook">
|
||||
`taskWebhookUrl` - 각 task가 종료될 때마다 호출되는 콜백
|
||||
|
||||
```json
|
||||
{
|
||||
"description": "리드의 데이터에서 수집한 정보를 활용해 리드가 속한 산업, 기업 배경, 그리고 crewai의 잠재적 활용 사례에 대해 예비 조사를 수행합니다. 리드 스코어링 및 crewai 피치 전략 수립에 도움이 되는 관련 데이터를 중심으로 조사하세요. 금융 산업은 디지털 고객 참여, 리스크 관리, 규제 준수와 같은 분야에서 crewai와 같은 AI 솔루션을 적용하기에 매우 적합한 환경을 제공합니다. 리드에 맞춤화된 crewai 솔루션을 제안하기 위해 추가적인 접촉을 권장합니다.",
|
||||
"task_id": "97eba64f-958c-40a0-b61c-625fe635a3c0"
|
||||
}
|
||||
```
|
||||
</Tab>
|
||||
<Tab title="Crew Webhook">
|
||||
`crewWebhookUrl` - crew 실행 종료 시 호출되는 콜백
|
||||
|
||||
```json
|
||||
{
|
||||
"task_id": "97eba64f-958c-40a0-b61c-625fe635a3c0",
|
||||
"result": {
|
||||
"lead_score": "고객 서비스 향상 및 컴플라이언스가 특히 관련성이 높습니다.",
|
||||
"talking_points": [
|
||||
"crewai의 AI 솔루션이 자동화된 맞춤형 경험과 24/7 지원으로 고객 서비스를 혁신하고, 고객 만족도와 운영 효율성을 모두 개선할 수 있음을 강조하세요.",
|
||||
"crewai가 더 나은 데이터 분석 및 의사 결정으로 기관의 지속 가능성 목표 달성(책임 투자 및 친환경 이니셔티브 기여)에 도움이 될 수 있음을 논의하세요.",
|
||||
"지속적으로 변화하는 규정에 효율적인 데이터 처리 및 보고 기능으로 crewai가 컴플라이언스 준수를 강화하고, 위반 시 발생할 수 있는 벌금을 줄일 수 있음을 강조하세요.",
|
||||
"crewai의 뛰어난 적응성으로 인해 대규모 다국적 운영뿐 아니라 소규모 맞춤형 프로젝트도 지원하여, 기관의 성장과 함께 솔루션도 확장될 수 있음을 강조하세요."
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
</Tab>
|
||||
</Tabs>
|
||||
103
docs/ko/enterprise/guides/zapier-trigger.mdx
Normal file
@@ -0,0 +1,103 @@
|
||||
---
|
||||
title: "Zapier 트리거"
|
||||
description: "Zapier 워크플로우에서 CrewAI crew를 트리거하여 앱 간 워크플로우를 자동화합니다"
|
||||
icon: "bolt"
|
||||
---
|
||||
|
||||
이 가이드는 CrewAI Enterprise용 Zapier 트리거를 설정하는 과정을 안내합니다. 이를 통해 CrewAI Enterprise와 기타 애플리케이션 간의 워크플로우를 자동화할 수 있습니다.
|
||||
|
||||
## 사전 요구 사항
|
||||
|
||||
- CrewAI Enterprise 계정
|
||||
- Zapier 계정
|
||||
- Slack 계정 (이 특정 예시에 해당)
|
||||
|
||||
## 단계별 설정
|
||||
|
||||
<Steps>
|
||||
<Step title="Slack 트리거 설정">
|
||||
- Zapier에서 새 Zap을 만듭니다.
|
||||
|
||||
<Frame>
|
||||
<img src="/images/enterprise/zapier-1.png" alt="Zapier 1" />
|
||||
</Frame>
|
||||
</Step>
|
||||
|
||||
<Step title="트리거 앱으로 Slack 선택">
|
||||
<Frame>
|
||||
<img src="/images/enterprise/zapier-2.png" alt="Zapier 2" />
|
||||
</Frame>
|
||||
- 트리거 이벤트로 `New Pushed Message`를 선택합니다.
|
||||
- 아직 Slack 계정을 연결하지 않았다면 연결하세요.
|
||||
</Step>
|
||||
|
||||
<Step title="CrewAI Enterprise 액션 구성">
|
||||
- Zap에 새 액션 단계를 추가합니다.
|
||||
- CrewAI+를 액션 앱으로, Kickoff를 액션 이벤트로 선택합니다.
|
||||
|
||||
<Frame>
|
||||
<img src="/images/enterprise/zapier-3.png" alt="Zapier 5" />
|
||||
</Frame>
|
||||
</Step>
|
||||
|
||||
<Step title="CrewAI Enterprise 계정 연결">
|
||||
- CrewAI Enterprise 계정을 연결하세요.
|
||||
- 워크플로에 적합한 Crew를 선택하세요.
|
||||
|
||||
<Frame>
|
||||
<img src="/images/enterprise/zapier-4.png" alt="Zapier 6" />
|
||||
</Frame>
|
||||
- Slack 메시지의 데이터를 사용하여 Crew의 입력값을 구성하세요.
|
||||
</Step>
|
||||
|
||||
<Step title="CrewAI Enterprise 출력 포맷팅">
|
||||
- CrewAI Enterprise에서 출력된 텍스트를 포맷팅하기 위해 추가 액션 단계를 추가합니다.
|
||||
- Zapier의 포매팅 도구를 사용하여 Markdown 출력을 HTML로 변환합니다.
|
||||
|
||||
<Frame>
|
||||
<img src="/images/enterprise/zapier-5.png" alt="Zapier 8" />
|
||||
</Frame>
|
||||
<Frame>
|
||||
<img src="/images/enterprise/zapier-6.png" alt="Zapier 9" />
|
||||
</Frame>
|
||||
</Step>
|
||||
|
||||
<Step title="출력 이메일로 전송">
|
||||
- 포맷팅된 출력을 이메일로 전송하는 마지막 액션 단계를 추가합니다.
|
||||
- 원하는 이메일 서비스를 선택하세요 (예: Gmail, Outlook).
|
||||
- 수신자, 제목, 본문 등 이메일 상세 정보를 구성하세요.
|
||||
- 포맷팅된 CrewAI Enterprise 출력을 이메일 본문에 삽입합니다.
|
||||
|
||||
<Frame>
|
||||
<img src="/images/enterprise/zapier-7.png" alt="Zapier 7" />
|
||||
</Frame>
|
||||
</Step>
|
||||
|
||||
<Step title="Slack에서 crew 실행">
|
||||
- Slack 채널에 텍스트를 입력하세요.
|
||||
|
||||
<Frame>
|
||||
<img src="/images/enterprise/zapier-7b.png" alt="Zapier 10" />
|
||||
</Frame>
|
||||
|
||||
- 3점 버튼을 선택한 후 'Push to Zapier'를 선택하세요.
|
||||
|
||||
<Frame>
|
||||
<img src="/images/enterprise/zapier-8.png" alt="Zapier 11" />
|
||||
</Frame>
|
||||
</Step>
|
||||
|
||||
<Step title="crew 선택 후 Kick Off로 Push">
|
||||
<Frame>
|
||||
<img src="/images/enterprise/zapier-9.png" alt="Zapier 12" />
|
||||
</Frame>
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## 성공을 위한 팁
|
||||
|
||||
- CrewAI Enterprise 입력값이 Slack 메시지에서 올바르게 매핑되었는지 확인하세요.
|
||||
- Zap을 활성화하기 전에 철저히 테스트하여 잠재적인 문제를 미리 파악하세요.
|
||||
- 워크플로우 내에서 발생할 수 있는 실패 상황을 관리하기 위해 오류 처리 단계를 추가하는 것을 고려하세요.
|
||||
|
||||
이 단계를 따르면 Slack 메시지로 트리거되는 자동화된 워크플로우와 CrewAI Enterprise 출력이 포함된 이메일 알림을 설정할 수 있습니다.
|
||||
253
docs/ko/enterprise/integrations/asana.mdx
Normal file
@@ -0,0 +1,253 @@
|
||||
---
|
||||
title: Asana 연동
|
||||
description: "CrewAI를 위한 Asana 연동으로 팀 작업 및 프로젝트 조정."
|
||||
icon: "circle"
|
||||
---
|
||||
|
||||
## 개요
|
||||
|
||||
에이전트가 Asana를 통해 업무, 프로젝트, 팀 협업을 관리할 수 있도록 지원하세요. 작업 생성, 프로젝트 상태 업데이트, 담당 할당 관리, AI 기반 자동화를 통한 팀의 워크플로우 최적화를 손쉽게 할 수 있습니다.
|
||||
|
||||
## 사전 준비 사항
|
||||
|
||||
Asana 연동을 사용하기 전에 다음을 확인하세요:
|
||||
|
||||
- 활성 구독이 있는 [CrewAI Enterprise](https://app.crewai.com) 계정
|
||||
- 적절한 권한이 있는 Asana 계정
|
||||
- [통합 페이지](https://app.crewai.com/crewai_plus/connectors)를 통해 Asana 계정 연결
|
||||
|
||||
## 아사나(Asana) 연동 설정
|
||||
|
||||
### 1. Asana 계정 연결하기
|
||||
|
||||
1. [CrewAI Enterprise Integrations](https://app.crewai.com/crewai_plus/connectors)로 이동합니다.
|
||||
2. 인증 통합 섹션에서 **Asana**를 찾습니다.
|
||||
3. **Connect**를 클릭하고 OAuth 플로우를 완료합니다.
|
||||
4. 작업 및 프로젝트 관리를 위한 필요한 권한을 부여합니다.
|
||||
5. [계정 설정](https://app.crewai.com/crewai_plus/settings/account)에서 Enterprise Token을 복사합니다.
|
||||
|
||||
### 2. 필수 패키지 설치
|
||||
|
||||
```bash
|
||||
uv add crewai-tools
|
||||
```
|
||||
|
||||
## 사용 가능한 작업
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="ASANA_CREATE_COMMENT">
|
||||
**설명:** Asana에 댓글을 생성합니다.
|
||||
|
||||
**매개변수:**
|
||||
- `task` (string, 필수): 작업 ID - 댓글이 추가될 작업의 ID입니다. 댓글 작성자는 현재 인증된 사용자입니다.
|
||||
- `text` (string, 필수): 텍스트 (예: "This is a comment.").
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="ASANA_CREATE_PROJECT">
|
||||
**설명:** Asana에 프로젝트를 생성합니다.
|
||||
|
||||
**매개변수:**
|
||||
- `name` (string, 필수): 이름 (예: "Stuff to buy").
|
||||
- `workspace` (string, 필수): 워크스페이스 - Connect Portal Workflow 설정을 사용해 사용자가 프로젝트를 생성할 워크스페이스를 선택할 수 있도록 합니다. 공란인 경우 기본적으로 사용자의 첫 번째 워크스페이스가 선택됩니다.
|
||||
- `team` (string, 선택): 팀 - Connect Portal Workflow 설정을 사용해 사용자가 이 프로젝트를 공유할 팀을 선택할 수 있도록 합니다. 공란인 경우 기본적으로 사용자의 첫 번째 팀이 선택됩니다.
|
||||
- `notes` (string, 선택): 노트 (예: "These are things we need to purchase.").
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="ASANA_GET_PROJECTS">
|
||||
**설명:** Asana의 프로젝트 목록을 가져옵니다.
|
||||
|
||||
**매개변수:**
|
||||
- `archived` (string, 선택): 보관됨 - 보관된 프로젝트를 보려면 "true", 활성 프로젝트만 보려면 "false", 보관됨과 활성 모두 보려면 "default"를 선택합니다.
|
||||
- 옵션: `default`, `true`, `false`
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="ASANA_GET_PROJECT_BY_ID">
|
||||
**설명:** Asana에서 ID로 프로젝트를 가져옵니다.
|
||||
|
||||
**매개변수:**
|
||||
- `projectFilterId` (string, 필수): 프로젝트 ID.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="ASANA_CREATE_TASK">
|
||||
**설명:** Asana에 작업을 생성합니다.
|
||||
|
||||
**매개변수:**
|
||||
- `name` (string, 필수): 이름 (예: "Task Name").
|
||||
- `workspace` (string, 선택): 워크스페이스 - Connect Portal Workflow 설정을 사용해 사용자가 작업을 생성할 워크스페이스를 선택할 수 있도록 합니다. 공란인 경우 기본적으로 사용자의 첫 번째 워크스페이스가 선택됩니다.
|
||||
- `project` (string, 선택): 프로젝트 - Connect Portal Workflow 설정을 사용해 사용자가 이 작업을 생성할 프로젝트를 선택할 수 있도록 합니다.
|
||||
- `notes` (string, 선택): 노트.
|
||||
- `dueOnDate` (string, 선택): 마감일 - 이 작업이 완료되어야 하는 날짜입니다. Due At과 함께 사용할 수 없습니다. (예: "YYYY-MM-DD").
|
||||
- `dueAtDate` (string, 선택): 마감 시각 - 이 작업이 완료되어야 하는 날짜와 시간 (ISO 타임스탬프) 입니다. Due On과 함께 사용할 수 없습니다. (예: "2019-09-15T02:06:58.147Z").
|
||||
- `assignee` (string, 선택): 담당자 - 이 작업이 할당될 Asana 사용자의 ID입니다. Connect Portal Workflow 설정을 사용해 사용자가 담당자를 선택할 수 있도록 합니다.
|
||||
- `gid` (string, 선택): 외부 ID - 이 작업과 연결할 애플리케이션의 ID입니다. 이 ID를 사용하여 이후 작업 업데이트를 동기화할 수 있습니다.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="ASANA_UPDATE_TASK">
|
||||
**설명:** Asana의 작업을 업데이트합니다.
|
||||
|
||||
**매개변수:**
|
||||
- `taskId` (string, 필수): 작업 ID - 업데이트할 작업의 ID입니다.
|
||||
- `completeStatus` (string, 선택): 완료 상태.
|
||||
- 옵션: `true`, `false`
|
||||
- `name` (string, 선택): 이름 (예: "Task Name").
|
||||
- `notes` (string, 선택): 노트.
|
||||
- `dueOnDate` (string, 선택): 마감일 - 이 작업이 완료되어야 하는 날짜입니다. Due At과 함께 사용할 수 없습니다. (예: "YYYY-MM-DD").
|
||||
- `dueAtDate` (string, 선택): 마감 시각 - 이 작업이 완료되어야 하는 날짜와 시간 (ISO 타임스탬프) 입니다. Due On과 함께 사용할 수 없습니다. (예: "2019-09-15T02:06:58.147Z").
|
||||
- `assignee` (string, 선택): 담당자 - 이 작업이 할당될 Asana 사용자의 ID입니다. Connect Portal Workflow 설정을 사용해 사용자가 담당자를 선택할 수 있도록 합니다.
|
||||
- `gid` (string, 선택): 외부 ID - 이 작업과 연결할 애플리케이션의 ID입니다. 이 ID를 사용하여 이후 작업 업데이트를 동기화할 수 있습니다.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="ASANA_GET_TASKS">
|
||||
**설명:** Asana의 작업 목록을 가져옵니다.
|
||||
|
||||
**매개변수:**
|
||||
- `workspace` (string, 선택): 워크스페이스 - 작업을 필터링할 워크스페이스의 ID입니다. Connect Portal Workflow 설정을 사용해 사용자가 워크스페이스를 선택할 수 있도록 합니다.
|
||||
- `project` (string, 선택): 프로젝트 - 작업을 필터링할 프로젝트의 ID입니다. Connect Portal Workflow 설정을 사용해 사용자가 프로젝트를 선택할 수 있도록 합니다.
|
||||
- `assignee` (string, 선택): 담당자 - 작업을 필터링할 담당자의 ID입니다. Connect Portal Workflow 설정을 사용해 사용자가 담당자를 선택할 수 있도록 합니다.
|
||||
- `completedSince` (string, 선택): 이후 완료됨 - 미완료이거나 해당 시간(ISO 또는 Unix 타임스탬프) 이후에 완료된 작업만 반환합니다. (예: "2014-04-25T16:15:47-04:00").
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="ASANA_GET_TASKS_BY_ID">
|
||||
**설명:** Asana에서 ID로 작업 목록을 가져옵니다.
|
||||
|
||||
**매개변수:**
|
||||
- `taskId` (string, 필수): 작업 ID.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="ASANA_GET_TASK_BY_EXTERNAL_ID">
|
||||
**설명:** Asana에서 외부 ID로 작업을 가져옵니다.
|
||||
|
||||
**매개변수:**
|
||||
- `gid` (string, 필수): 외부 ID - 이 작업이 애플리케이션과 연동(또는 동기화)된 ID입니다.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="ASANA_ADD_TASK_TO_SECTION">
|
||||
**설명:** Asana에서 섹션에 작업을 추가합니다.
|
||||
|
||||
**매개변수:**
|
||||
- `sectionId` (string, 필수): 섹션 ID - 작업을 추가할 섹션의 ID입니다.
|
||||
- `taskId` (string, 필수): 작업 ID - 작업의 ID입니다. (예: "1204619611402340").
|
||||
- `beforeTaskId` (string, 선택): 이전 작업 ID - 이 작업이 삽입될 섹션 내의 작업 ID입니다. 이후 작업 ID와 함께 사용할 수 없습니다. (예: "1204619611402340").
|
||||
- `afterTaskId` (string, 선택): 이후 작업 ID - 이 작업이 삽입될 섹션 내의 작업 ID입니다. 이전 작업 ID와 함께 사용할 수 없습니다. (예: "1204619611402340").
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="ASANA_GET_TEAMS">
|
||||
**설명:** Asana에서 팀 목록을 가져옵니다.
|
||||
|
||||
**매개변수:**
|
||||
- `workspace` (string, 필수): 워크스페이스 - 인증된 사용자가 볼 수 있는 이 워크스페이스 내의 팀을 반환합니다.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="ASANA_GET_WORKSPACES">
|
||||
**설명:** Asana에서 워크스페이스 목록을 가져옵니다.
|
||||
|
||||
**매개변수:** 필요 없음.
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
## 사용 예시
|
||||
|
||||
### 기본 Asana 에이전트 설정
|
||||
|
||||
```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()
|
||||
```
|
||||
|
||||
### 특정 Asana 도구 필터링
|
||||
|
||||
```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()
|
||||
```
|
||||
|
||||
### 고급 프로젝트 관리
|
||||
|
||||
```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/ko/enterprise/integrations/box.mdx
Normal file
@@ -0,0 +1,268 @@
|
||||
---
|
||||
title: Box 통합
|
||||
description: "CrewAI용 Box 통합을 통한 파일 저장 및 문서 관리."
|
||||
icon: "box"
|
||||
---
|
||||
|
||||
## 개요
|
||||
|
||||
에이전트가 Box를 통해 파일, 폴더, 문서를 관리할 수 있도록 지원하세요. 파일을 업로드하고, 폴더 구조를 조직하며, 콘텐츠를 검색하고, AI 기반 자동화를 통해 팀의 문서 관리를 효율적으로 진행할 수 있습니다.
|
||||
|
||||
## 사전 준비 사항
|
||||
|
||||
Box 통합을 사용하기 전에 다음을 확인하세요:
|
||||
|
||||
- 활성 구독이 있는 [CrewAI Enterprise](https://app.crewai.com) 계정
|
||||
- 적절한 권한이 있는 Box 계정
|
||||
- [통합 페이지](https://app.crewai.com/crewai_plus/connectors)를 통해 Box 계정 연결
|
||||
|
||||
## Box 통합 설정
|
||||
|
||||
### 1. Box 계정 연결하기
|
||||
|
||||
1. [CrewAI Enterprise Integrations](https://app.crewai.com/crewai_plus/connectors)로 이동합니다.
|
||||
2. 인증 통합 섹션에서 **Box**를 찾습니다.
|
||||
3. **Connect**를 클릭하고 OAuth 흐름을 완료합니다.
|
||||
4. 파일 및 폴더 관리를 위한 필요한 권한을 부여합니다.
|
||||
5. [Account Settings](https://app.crewai.com/crewai_plus/settings/account)에서 Enterprise Token을 복사합니다.
|
||||
|
||||
### 2. 필수 패키지 설치
|
||||
|
||||
```bash
|
||||
uv add crewai-tools
|
||||
```
|
||||
|
||||
## 사용 가능한 액션
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="BOX_SAVE_FILE">
|
||||
**설명:** Box에서 URL로부터 파일을 저장합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `fileAttributes` (object, 필수): 속성 - 이름, 상위 폴더, 타임스탬프 등 파일 메타데이터.
|
||||
```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, 필수): 파일 URL - 파일 크기는 50MB 미만이어야 합니다. (예시: "https://picsum.photos/200/300").
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="BOX_SAVE_FILE_FROM_OBJECT">
|
||||
**설명:** Box에 파일을 저장합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `file` (string, 필수): 파일 - 파일 데이터를 포함하는 파일 객체를 허용합니다. 파일 크기는 50MB 미만이어야 합니다.
|
||||
- `fileName` (string, 필수): 파일명 (예시: "qwerty.png").
|
||||
- `folder` (string, 선택): 폴더 - Connect Portal Workflow Settings를 사용하여 사용자가 파일의 폴더 목적지를 선택할 수 있도록 합니다. 비워두면 기본적으로 사용자의 루트 폴더에 저장됩니다.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="BOX_GET_FILE_BY_ID">
|
||||
**설명:** Box에서 ID로 파일을 가져옵니다.
|
||||
|
||||
**파라미터:**
|
||||
- `fileId` (string, 필수): 파일 ID - 파일을 나타내는 고유 식별자. (예시: "12345").
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="BOX_LIST_FILES">
|
||||
**설명:** Box에서 파일 목록을 조회합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `folderId` (string, 필수): 폴더 ID - 폴더를 나타내는 고유 식별자. (예시: "0").
|
||||
- `filterFormula` (object, 선택): 쿼리 normal form (DNF)의 필터 - 단일 조건의 AND 그룹의 OR.
|
||||
```json
|
||||
{
|
||||
"operator": "OR",
|
||||
"conditions": [
|
||||
{
|
||||
"operator": "AND",
|
||||
"conditions": [
|
||||
{
|
||||
"field": "direction",
|
||||
"operator": "$stringExactlyMatches",
|
||||
"value": "ASC"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="BOX_CREATE_FOLDER">
|
||||
**설명:** Box에 폴더를 생성합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `folderName` (string, 필수): 이름 - 새 폴더의 이름. (예시: "New Folder").
|
||||
- `folderParent` (object, 필수): 상위 폴더 - 새 폴더가 생성될 상위 폴더.
|
||||
```json
|
||||
{
|
||||
"id": "123456"
|
||||
}
|
||||
```
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="BOX_MOVE_FOLDER">
|
||||
**설명:** Box에서 폴더를 이동합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `folderId` (string, 필수): 폴더 ID - 폴더를 나타내는 고유 식별자. (예시: "0").
|
||||
- `folderName` (string, 필수): 이름 - 폴더의 이름. (예시: "New Folder").
|
||||
- `folderParent` (object, 필수): 상위 폴더 - 새 상위 폴더 목적지.
|
||||
```json
|
||||
{
|
||||
"id": "123456"
|
||||
}
|
||||
```
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="BOX_GET_FOLDER_BY_ID">
|
||||
**설명:** Box에서 ID로 폴더를 가져옵니다.
|
||||
|
||||
**파라미터:**
|
||||
- `folderId` (string, 필수): 폴더 ID - 폴더를 나타내는 고유 식별자. (예시: "0").
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="BOX_SEARCH_FOLDERS">
|
||||
**설명:** Box에서 폴더를 검색합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `folderId` (string, 필수): 폴더 ID - 검색할 폴더.
|
||||
- `filterFormula` (object, 선택): 쿼리 normal form (DNF)의 필터 - 단일 조건의 AND 그룹의 OR.
|
||||
```json
|
||||
{
|
||||
"operator": "OR",
|
||||
"conditions": [
|
||||
{
|
||||
"operator": "AND",
|
||||
"conditions": [
|
||||
{
|
||||
"field": "sort",
|
||||
"operator": "$stringExactlyMatches",
|
||||
"value": "name"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="BOX_DELETE_FOLDER">
|
||||
**설명:** Box에서 폴더를 삭제합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `folderId` (string, 필수): 폴더 ID - 폴더를 나타내는 고유 식별자. (예시: "0").
|
||||
- `recursive` (boolean, 선택): 재귀적 삭제 - 폴더가 비어 있지 않을 경우, 폴더와 그 모든 내용을 재귀적으로 삭제합니다.
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
## 사용 예시
|
||||
|
||||
### 기본 Box Agent 설정
|
||||
|
||||
```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()
|
||||
```
|
||||
|
||||
### 특정 Box 도구 필터링
|
||||
|
||||
```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()
|
||||
```
|
||||
|
||||
### 고급 파일 관리
|
||||
|
||||
```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/ko/enterprise/integrations/clickup.mdx
Normal file
@@ -0,0 +1,293 @@
|
||||
---
|
||||
title: ClickUp 연동
|
||||
description: "CrewAI를 위한 ClickUp 연동을 통한 작업 및 생산성 관리."
|
||||
icon: "list-check"
|
||||
---
|
||||
|
||||
## 개요
|
||||
|
||||
에이전트가 ClickUp을 통해 작업, 프로젝트 및 생산성 워크플로우를 관리할 수 있도록 지원하세요. 작업을 생성 및 업데이트하고, 프로젝트를 구성하며, 팀 할당을 관리하고, AI 기반 자동화를 통해 생산성 관리를 간소화할 수 있습니다.
|
||||
|
||||
## 사전 준비사항
|
||||
|
||||
ClickUp 통합을 사용하기 전에 다음을 준비해야 합니다:
|
||||
|
||||
- 활성 구독이 있는 [CrewAI Enterprise](https://app.crewai.com) 계정
|
||||
- 적절한 권한이 있는 ClickUp 계정
|
||||
- [통합 페이지](https://app.crewai.com/crewai_plus/connectors)를 통해 ClickUp 계정 연결
|
||||
|
||||
## ClickUp 통합 설정
|
||||
|
||||
### 1. ClickUp 계정 연결하기
|
||||
|
||||
1. [CrewAI Enterprise Integrations](https://app.crewai.com/crewai_plus/connectors)로 이동합니다.
|
||||
2. 인증 통합 섹션에서 **ClickUp**을 찾습니다.
|
||||
3. **Connect**를 클릭하고 OAuth 과정을 완료합니다.
|
||||
4. 작업 및 프로젝트 관리에 필요한 권한을 부여합니다.
|
||||
5. [계정 설정](https://app.crewai.com/crewai_plus/settings/account)에서 Enterprise Token을 복사합니다.
|
||||
|
||||
### 2. 필수 패키지 설치
|
||||
|
||||
```bash
|
||||
uv add crewai-tools
|
||||
```
|
||||
|
||||
## 사용 가능한 동작
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="CLICKUP_SEARCH_TASKS">
|
||||
**설명:** 고급 필터를 사용하여 ClickUp에서 작업을 검색합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `taskFilterFormula` (object, 선택): 이항 표준형(DNF)의 필터 - 단일 조건의 AND 그룹들의 OR.
|
||||
```json
|
||||
{
|
||||
"operator": "OR",
|
||||
"conditions": [
|
||||
{
|
||||
"operator": "AND",
|
||||
"conditions": [
|
||||
{
|
||||
"field": "statuses%5B%5D",
|
||||
"operator": "$stringExactlyMatches",
|
||||
"value": "open"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
사용 가능한 필드: `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">
|
||||
**설명:** ClickUp의 특정 목록에서 작업을 가져옵니다.
|
||||
|
||||
**파라미터:**
|
||||
- `listId` (string, 필수): 목록 - 작업을 가져올 목록을 선택합니다. 사용자가 ClickUp 목록을 선택할 수 있도록 Connect Portal 사용자 설정을 사용하세요.
|
||||
- `taskFilterFormula` (string, 선택): 지정된 필터와 일치하는 작업을 검색합니다. 예: name=task1.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="CLICKUP_CREATE_TASK">
|
||||
**설명:** ClickUp에 작업을 생성합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `listId` (string, 필수): 목록 - 이 작업을 생성할 목록을 선택합니다. 사용자가 ClickUp 목록을 선택할 수 있도록 Connect Portal 사용자 설정을 사용하세요.
|
||||
- `name` (string, 필수): 이름 - 작업 이름.
|
||||
- `description` (string, 선택): 설명 - 작업 설명.
|
||||
- `status` (string, 선택): 상태 - 이 작업에 대한 상태를 선택합니다. 사용자가 ClickUp 상태를 선택할 수 있도록 Connect Portal 사용자 설정을 사용하세요.
|
||||
- `assignees` (string, 선택): 담당자 - 이 작업에 할당할 멤버(또는 멤버 ID 배열)를 선택합니다. 사용자가 ClickUp 멤버를 선택할 수 있도록 Connect Portal 사용자 설정을 사용하세요.
|
||||
- `dueDate` (string, 선택): 마감일 - 이 작업의 마감일을 지정합니다.
|
||||
- `additionalFields` (string, 선택): 추가 필드 - 이 작업에 포함할 추가 필드를 JSON으로 지정합니다.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="CLICKUP_UPDATE_TASK">
|
||||
**설명:** ClickUp의 작업을 업데이트합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `taskId` (string, 필수): 작업 ID - 업데이트할 작업의 ID입니다.
|
||||
- `listId` (string, 필수): 목록 - 이 작업을 생성할 목록을 선택합니다. 사용자가 ClickUp 목록을 선택할 수 있도록 Connect Portal 사용자 설정을 사용하세요.
|
||||
- `name` (string, 선택): 이름 - 작업 이름.
|
||||
- `description` (string, 선택): 설명 - 작업 설명.
|
||||
- `status` (string, 선택): 상태 - 이 작업에 대한 상태를 선택합니다. 사용자가 ClickUp 상태를 선택할 수 있도록 Connect Portal 사용자 설정을 사용하세요.
|
||||
- `assignees` (string, 선택): 담당자 - 이 작업에 할당할 멤버(또는 멤버 ID 배열)를 선택합니다. 사용자가 ClickUp 멤버를 선택할 수 있도록 Connect Portal 사용자 설정을 사용하세요.
|
||||
- `dueDate` (string, 선택): 마감일 - 이 작업의 마감일을 지정합니다.
|
||||
- `additionalFields` (string, 선택): 추가 필드 - 이 작업에 포함할 추가 필드를 JSON으로 지정합니다.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="CLICKUP_DELETE_TASK">
|
||||
**설명:** ClickUp에서 작업을 삭제합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `taskId` (string, 필수): 작업 ID - 삭제할 작업의 ID입니다.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="CLICKUP_GET_LIST">
|
||||
**설명:** ClickUp에서 목록 정보를 가져옵니다.
|
||||
|
||||
**파라미터:**
|
||||
- `spaceId` (string, 필수): 스페이스 ID - 목록이 포함된 스페이스의 ID입니다.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="CLICKUP_GET_CUSTOM_FIELDS_IN_LIST">
|
||||
**설명:** ClickUp에서 목록의 사용자 정의 필드를 가져옵니다.
|
||||
|
||||
**파라미터:**
|
||||
- `listId` (string, 필수): 목록 ID - 사용자 정의 필드를 가져올 목록의 ID입니다.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="CLICKUP_GET_ALL_FIELDS_IN_LIST">
|
||||
**설명:** ClickUp에서 목록의 모든 필드를 가져옵니다.
|
||||
|
||||
**파라미터:**
|
||||
- `listId` (string, 필수): 목록 ID - 모든 필드를 가져올 목록의 ID입니다.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="CLICKUP_GET_SPACE">
|
||||
**설명:** ClickUp에서 스페이스 정보를 가져옵니다.
|
||||
|
||||
**파라미터:**
|
||||
- `spaceId` (string, 선택): 스페이스 ID - 조회할 스페이스의 ID입니다.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="CLICKUP_GET_FOLDERS">
|
||||
**설명:** ClickUp에서 폴더를 가져옵니다.
|
||||
|
||||
**파라미터:**
|
||||
- `spaceId` (string, 필수): 스페이스 ID - 폴더가 포함된 스페이스의 ID입니다.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="CLICKUP_GET_MEMBER">
|
||||
**설명:** ClickUp에서 멤버 정보를 가져옵니다.
|
||||
|
||||
**파라미터:** 필요 없음.
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
## 사용 예시
|
||||
|
||||
### 기본 ClickUp 에이전트 설정
|
||||
|
||||
```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()
|
||||
```
|
||||
|
||||
### 특정 ClickUp 도구 필터링
|
||||
|
||||
```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()
|
||||
```
|
||||
|
||||
### 고급 프로젝트 관리
|
||||
|
||||
```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()
|
||||
```
|
||||
|
||||
### 작업 검색 및 관리
|
||||
|
||||
```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()
|
||||
```
|
||||
|
||||
### 도움 받기
|
||||
|
||||
<Card title="도움이 필요하신가요?" icon="headset" href="mailto:support@crewai.com">
|
||||
ClickUp 연동 설정 또는 문제 해결에 대한 지원이 필요하신 경우 저희 지원팀에 문의하세요.
|
||||
</Card>
|
||||
323
docs/ko/enterprise/integrations/github.mdx
Normal file
@@ -0,0 +1,323 @@
|
||||
---
|
||||
title: GitHub 통합
|
||||
description: "CrewAI를 위한 GitHub 통합을 통한 리포지토리 및 이슈 관리."
|
||||
icon: "github"
|
||||
---
|
||||
|
||||
## 개요
|
||||
|
||||
에이전트가 GitHub를 통해 리포지토리, 이슈, 릴리스를 관리할 수 있도록 지원합니다. 이슈를 생성 및 업데이트하고, 릴리스를 관리하고, 프로젝트 개발을 추적하며, AI 기반 자동화를 통해 소프트웨어 개발 워크플로우를 효율화하세요.
|
||||
|
||||
## 사전 요구 사항
|
||||
|
||||
GitHub 통합을 사용하기 전에 다음을 확인하세요:
|
||||
|
||||
- 활성 구독이 있는 [CrewAI Enterprise](https://app.crewai.com) 계정
|
||||
- 해당 리포지토리에 대한 적절한 권한이 있는 GitHub 계정
|
||||
- [통합 페이지](https://app.crewai.com/crewai_plus/connectors)를 통해 GitHub 계정 연결 완료
|
||||
|
||||
## GitHub 연동 설정
|
||||
|
||||
### 1. GitHub 계정 연결하기
|
||||
|
||||
1. [CrewAI Enterprise Integrations](https://app.crewai.com/crewai_plus/connectors)로 이동합니다.
|
||||
2. 인증 통합 섹션에서 **GitHub**을 찾습니다.
|
||||
3. **Connect**를 클릭하고 OAuth 흐름을 완료합니다.
|
||||
4. 리포지토리 및 이슈 관리를 위한 필수 권한을 부여합니다.
|
||||
5. [계정 설정](https://app.crewai.com/crewai_plus/settings/account)에서 Enterprise Token을 복사합니다.
|
||||
|
||||
### 2. 필수 패키지 설치
|
||||
|
||||
```bash
|
||||
uv add crewai-tools
|
||||
```
|
||||
|
||||
## 사용 가능한 작업
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="GITHUB_CREATE_ISSUE">
|
||||
**설명:** GitHub에 이슈를 생성합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `owner` (string, 필수): 소유자 - 이 이슈와 연관된 저장소의 계정 소유자 이름을 지정합니다. (예시: "abc").
|
||||
- `repo` (string, 필수): 저장소 - 이 이슈와 연관된 저장소 이름을 지정합니다.
|
||||
- `title` (string, 필수): 이슈 제목 - 생성할 이슈의 제목을 지정합니다.
|
||||
- `body` (string, 선택): 이슈 본문 - 생성할 이슈의 본문 내용을 지정합니다.
|
||||
- `assignees` (string, 선택): 담당자 - 이 이슈의 담당자 GitHub 로그인을 문자열 배열로 지정합니다. (예시: `["octocat"]`).
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="GITHUB_UPDATE_ISSUE">
|
||||
**설명:** GitHub에서 이슈를 업데이트합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `owner` (string, 필수): 소유자 - 이 이슈와 연관된 저장소의 계정 소유자 이름을 지정합니다. (예시: "abc").
|
||||
- `repo` (string, 필수): 저장소 - 이 이슈와 연관된 저장소 이름을 지정합니다.
|
||||
- `issue_number` (string, 필수): 이슈 번호 - 업데이트할 이슈의 번호를 지정합니다.
|
||||
- `title` (string, 필수): 이슈 제목 - 업데이트할 이슈의 제목을 지정합니다.
|
||||
- `body` (string, 선택): 이슈 본문 - 업데이트할 이슈의 본문 내용을 지정합니다.
|
||||
- `assignees` (string, 선택): 담당자 - 이 이슈의 담당자 GitHub 로그인을 문자열 배열로 지정합니다. (예시: `["octocat"]`).
|
||||
- `state` (string, 선택): 상태 - 이슈의 변경된 상태를 지정합니다.
|
||||
- 옵션: `open`, `closed`
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="GITHUB_GET_ISSUE_BY_NUMBER">
|
||||
**설명:** GitHub에서 번호로 이슈를 조회합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `owner` (string, 필수): 소유자 - 이 이슈와 연관된 저장소의 계정 소유자 이름을 지정합니다. (예시: "abc").
|
||||
- `repo` (string, 필수): 저장소 - 이 이슈와 연관된 저장소 이름을 지정합니다.
|
||||
- `issue_number` (string, 필수): 이슈 번호 - 가져올 이슈의 번호를 지정합니다.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="GITHUB_LOCK_ISSUE">
|
||||
**설명:** GitHub에서 이슈를 잠급니다.
|
||||
|
||||
**파라미터:**
|
||||
- `owner` (string, 필수): 소유자 - 이 이슈와 연관된 저장소의 계정 소유자 이름을 지정합니다. (예시: "abc").
|
||||
- `repo` (string, 필수): 저장소 - 이 이슈와 연관된 저장소 이름을 지정합니다.
|
||||
- `issue_number` (string, 필수): 이슈 번호 - 잠글 이슈의 번호를 지정합니다.
|
||||
- `lock_reason` (string, 필수): 잠금 사유 - 이슈 또는 풀 리퀘스트 대화에 대한 잠금 이유를 지정합니다.
|
||||
- 옵션: `off-topic`, `too heated`, `resolved`, `spam`
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="GITHUB_SEARCH_ISSUE">
|
||||
**설명:** GitHub에서 이슈를 검색합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `owner` (string, 필수): 소유자 - 이 이슈와 연관된 저장소의 계정 소유자 이름을 지정합니다. (예시: "abc").
|
||||
- `repo` (string, 필수): 저장소 - 이 이슈와 연관된 저장소 이름을 지정합니다.
|
||||
- `filter` (object, 필수): 불리언 표준형의 필터 - 단일 조건의 AND 그룹의 OR 조합.
|
||||
```json
|
||||
{
|
||||
"operator": "OR",
|
||||
"conditions": [
|
||||
{
|
||||
"operator": "AND",
|
||||
"conditions": [
|
||||
{
|
||||
"field": "assignee",
|
||||
"operator": "$stringExactlyMatches",
|
||||
"value": "octocat"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
사용 가능한 필드: `assignee`, `creator`, `mentioned`, `labels`
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="GITHUB_CREATE_RELEASE">
|
||||
**설명:** GitHub에 릴리스를 생성합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `owner` (string, 필수): 소유자 - 이 릴리스와 연관된 저장소의 계정 소유자 이름을 지정합니다. (예시: "abc").
|
||||
- `repo` (string, 필수): 저장소 - 이 릴리스와 연관된 저장소 이름을 지정합니다.
|
||||
- `tag_name` (string, 필수): 이름 - 생성할 릴리스 태그의 이름을 지정합니다. (예시: "v1.0.0").
|
||||
- `target_commitish` (string, 선택): 대상 - 릴리스의 대상을 지정합니다. 브랜치 이름이나 커밋 SHA가 될 수 있으며, 기본값은 메인 브랜치입니다. (예시: "master").
|
||||
- `body` (string, 선택): 본문 - 이 릴리스에 대한 설명을 지정합니다.
|
||||
- `draft` (string, 선택): 초안 - 생성할 릴리스를 초안(비공개) 릴리스로 지정할지 여부를 지정합니다.
|
||||
- 옵션: `true`, `false`
|
||||
- `prerelease` (string, 선택): 프리릴리스 - 생성할 릴리스를 프리릴리스로 지정할지 여부를 지정합니다.
|
||||
- 옵션: `true`, `false`
|
||||
- `discussion_category_name` (string, 선택): 토론 카테고리 이름 - 지정 시, 해당 카테고리의 토론이 생성되어 릴리스와 연결됩니다. 값은 저장소에 이미 존재하는 카테고리여야 합니다.
|
||||
- `generate_release_notes` (string, 선택): 릴리스 노트 - 지정한 이름과 본문을 사용하여 릴리스 노트를 자동으로 생성할지 여부를 지정합니다.
|
||||
- 옵션: `true`, `false`
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="GITHUB_UPDATE_RELEASE">
|
||||
**설명:** GitHub에서 릴리스를 업데이트합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `owner` (string, 필수): 소유자 - 이 릴리스와 연관된 저장소의 계정 소유자 이름을 지정합니다. (예시: "abc").
|
||||
- `repo` (string, 필수): 저장소 - 이 릴리스와 연관된 저장소 이름을 지정합니다.
|
||||
- `id` (string, 필수): 릴리스 ID - 업데이트할 릴리스의 ID를 지정합니다.
|
||||
- `tag_name` (string, 선택): 이름 - 업데이트할 릴리스 태그의 이름을 지정합니다. (예시: "v1.0.0").
|
||||
- `target_commitish` (string, 선택): 대상 - 릴리스의 대상을 지정합니다. 브랜치 이름이나 커밋 SHA가 될 수 있으며, 기본값은 메인 브랜치입니다. (예시: "master").
|
||||
- `body` (string, 선택): 본문 - 이 릴리스에 대한 설명을 지정합니다.
|
||||
- `draft` (string, 선택): 초안 - 생성할 릴리스를 초안(비공개) 릴리스로 지정할지 여부를 지정합니다.
|
||||
- 옵션: `true`, `false`
|
||||
- `prerelease` (string, 선택): 프리릴리스 - 생성할 릴리스를 프리릴리스로 지정할지 여부를 지정합니다.
|
||||
- 옵션: `true`, `false`
|
||||
- `discussion_category_name` (string, 선택): 토론 카테고리 이름 - 지정 시, 해당 카테고리의 토론이 생성되어 릴리스와 연결됩니다. 값은 저장소에 이미 존재하는 카테고리여야 합니다.
|
||||
- `generate_release_notes` (string, 선택): 릴리스 노트 - 지정한 이름과 본문을 사용하여 릴리스 노트를 자동으로 생성할지 여부를 지정합니다.
|
||||
- 옵션: `true`, `false`
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="GITHUB_GET_RELEASE_BY_ID">
|
||||
**설명:** GitHub에서 ID로 릴리스를 조회합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `owner` (string, 필수): 소유자 - 이 릴리스와 연관된 저장소의 계정 소유자 이름을 지정합니다. (예시: "abc").
|
||||
- `repo` (string, 필수): 저장소 - 이 릴리스와 연관된 저장소 이름을 지정합니다.
|
||||
- `id` (string, 필수): 릴리스 ID - 조회할 릴리스의 ID를 지정합니다.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="GITHUB_GET_RELEASE_BY_TAG_NAME">
|
||||
**설명:** GitHub에서 태그 이름으로 릴리스를 조회합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `owner` (string, 필수): 소유자 - 이 릴리스와 연관된 저장소의 계정 소유자 이름을 지정합니다. (예시: "abc").
|
||||
- `repo` (string, 필수): 저장소 - 이 릴리스와 연관된 저장소 이름을 지정합니다.
|
||||
- `tag_name` (string, 필수): 이름 - 가져올 릴리스의 태그를 지정합니다. (예시: "v1.0.0").
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="GITHUB_DELETE_RELEASE">
|
||||
**설명:** GitHub에서 릴리스를 삭제합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `owner` (string, 필수): 소유자 - 이 릴리스와 연관된 저장소의 계정 소유자 이름을 지정합니다. (예시: "abc").
|
||||
- `repo` (string, 필수): 저장소 - 이 릴리스와 연관된 저장소 이름을 지정합니다.
|
||||
- `id` (string, 필수): 릴리스 ID - 삭제할 릴리스의 ID를 지정합니다.
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
## 사용 예시
|
||||
|
||||
### 기본 GitHub 에이전트 설정
|
||||
|
||||
```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()
|
||||
```
|
||||
|
||||
### 특정 GitHub 도구 필터링
|
||||
|
||||
```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()
|
||||
```
|
||||
|
||||
### 릴리즈 관리
|
||||
|
||||
```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()
|
||||
```
|
||||
|
||||
### 이슈 추적 및 관리
|
||||
|
||||
```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()
|
||||
```
|
||||
|
||||
### 도움 받기
|
||||
|
||||
<Card title="도움이 필요하신가요?" icon="headset" href="mailto:support@crewai.com">
|
||||
GitHub 통합 설정 또는 문제 해결에 대해 지원팀에 문의하세요.
|
||||
</Card>
|
||||
356
docs/ko/enterprise/integrations/gmail.mdx
Normal file
@@ -0,0 +1,356 @@
|
||||
---
|
||||
title: Gmail 연동
|
||||
description: "CrewAI를 위한 Gmail 연동을 통한 이메일 및 연락처 관리."
|
||||
icon: "envelope"
|
||||
---
|
||||
|
||||
## 개요
|
||||
|
||||
에이전트가 Gmail을 통해 이메일, 연락처, 임시 저장 메시지를 관리할 수 있도록 합니다. 이메일을 보내고, 메시지를 검색하며, 연락처를 관리하고, 임시 저장 메시지를 작성하며, AI 기반 자동화를 통해 이메일 커뮤니케이션을 효율화하세요.
|
||||
|
||||
## 사전 준비 사항
|
||||
|
||||
Gmail 통합을 사용하기 전에 다음을 확인하세요:
|
||||
|
||||
- 활성 구독이 있는 [CrewAI Enterprise](https://app.crewai.com) 계정
|
||||
- 적절한 권한이 있는 Gmail 계정
|
||||
- [통합 페이지](https://app.crewai.com/crewai_plus/connectors)를 통해 Gmail 계정 연결
|
||||
|
||||
## Gmail 연동 설정
|
||||
|
||||
### 1. Gmail 계정 연결하기
|
||||
|
||||
1. [CrewAI Enterprise Integrations](https://app.crewai.com/crewai_plus/connectors)로 이동합니다.
|
||||
2. 인증 통합 섹션에서 **Gmail**을 찾습니다.
|
||||
3. **Connect**를 클릭하고 OAuth 흐름을 완료합니다.
|
||||
4. 이메일 및 연락처 관리를 위한 필요한 권한을 부여합니다.
|
||||
5. [Account Settings](https://app.crewai.com/crewai_plus/settings/account)에서 Enterprise Token을 복사합니다.
|
||||
|
||||
### 2. 필수 패키지 설치
|
||||
|
||||
```bash
|
||||
uv add crewai-tools
|
||||
```
|
||||
|
||||
## 사용 가능한 작업
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="GMAIL_SEND_EMAIL">
|
||||
**설명:** Gmail에서 이메일을 보냅니다.
|
||||
|
||||
**파라미터:**
|
||||
- `toRecipients` (array, 필수): 받는 사람 - 하나의 문자열 또는 JSON 배열로 받는 사람을 지정합니다.
|
||||
```json
|
||||
[
|
||||
"recipient1@domain.com",
|
||||
"recipient2@domain.com"
|
||||
]
|
||||
```
|
||||
- `from` (string, 필수): 보내는 사람 - 발신자의 이메일을 지정합니다.
|
||||
- `subject` (string, 필수): 제목 - 메시지의 제목을 지정합니다.
|
||||
- `messageContent` (string, 필수): 메시지 내용 - 이메일 메시지의 내용을 일반 텍스트 또는 HTML로 지정합니다.
|
||||
- `attachments` (string, 선택): 첨부파일 - 단일 파일 객체 또는 파일 객체의 JSON 배열을 허용합니다.
|
||||
- `additionalHeaders` (object, 선택): 추가 헤더 - 추가 헤더 필드를 지정할 수 있습니다.
|
||||
```json
|
||||
{
|
||||
"reply-to": "Sender Name <sender@domain.com>"
|
||||
}
|
||||
```
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="GMAIL_GET_EMAIL_BY_ID">
|
||||
**설명:** Gmail에서 ID로 이메일을 조회합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `userId` (string, 필수): 사용자 ID - 사용자의 이메일 주소를 지정합니다. (예: "user@domain.com").
|
||||
- `messageId` (string, 필수): 메시지 ID - 조회할 메시지의 ID를 지정합니다.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="GMAIL_SEARCH_FOR_EMAIL">
|
||||
**설명:** 고급 필터를 사용하여 Gmail에서 이메일을 검색합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `emailFilterFormula` (object, 선택): 불리언 식(OR로 연결된 AND 그룹의 단일 조건)으로 된 필터.
|
||||
```json
|
||||
{
|
||||
"operator": "OR",
|
||||
"conditions": [
|
||||
{
|
||||
"operator": "AND",
|
||||
"conditions": [
|
||||
{
|
||||
"field": "from",
|
||||
"operator": "$stringContains",
|
||||
"value": "example@domain.com"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
사용 가능한 필드: `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, 선택): 페이지네이션 파라미터.
|
||||
```json
|
||||
{
|
||||
"pageCursor": "page_cursor_string"
|
||||
}
|
||||
```
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="GMAIL_DELETE_EMAIL">
|
||||
**설명:** Gmail에서 이메일을 삭제합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `userId` (string, 필수): 사용자 ID - 사용자의 이메일 주소를 지정합니다. (예: "user@domain.com").
|
||||
- `messageId` (string, 필수): 메시지 ID - 휴지통으로 보낼 메시지의 ID를 지정합니다.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="GMAIL_CREATE_A_CONTACT">
|
||||
**설명:** Gmail에서 연락처를 생성합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `givenName` (string, 필수): 이름 - 생성할 연락처의 이름을 지정합니다. (예: "John").
|
||||
- `familyName` (string, 필수): 성 - 생성할 연락처의 성을 지정합니다. (예: "Doe").
|
||||
- `email` (string, 필수): 이메일 - 생성할 연락처의 이메일 주소를 지정합니다.
|
||||
- `additionalFields` (object, 선택): 추가 필드 - 기타 연락처 정보를 입력할 수 있습니다.
|
||||
```json
|
||||
{
|
||||
"addresses": [
|
||||
{
|
||||
"streetAddress": "1000 North St.",
|
||||
"city": "Los Angeles"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="GMAIL_GET_CONTACT_BY_RESOURCE_NAME">
|
||||
**설명:** Gmail에서 리소스 이름으로 연락처를 조회합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `resourceName` (string, 필수): 리소스 이름 - 조회할 연락처의 리소스 이름을 지정합니다.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="GMAIL_SEARCH_FOR_CONTACT">
|
||||
**설명:** Gmail에서 연락처를 검색합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `searchTerm` (string, 필수): 검색어 - 이름, 닉네임, 이메일 주소, 전화번호 또는 조직 연락처 속성에서 유사하거나 정확히 일치하는 항목을 검색할 검색어를 지정합니다.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="GMAIL_DELETE_CONTACT">
|
||||
**설명:** Gmail에서 연락처를 삭제합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `resourceName` (string, 필수): 리소스 이름 - 삭제할 연락처의 리소스 이름을 지정합니다.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="GMAIL_CREATE_DRAFT">
|
||||
**설명:** Gmail에서 임시 저장 메일을 만듭니다.
|
||||
|
||||
**파라미터:**
|
||||
- `toRecipients` (array, 선택): 받는 사람 - 하나의 문자열 또는 JSON 배열로 받는 사람을 지정합니다.
|
||||
```json
|
||||
[
|
||||
"recipient1@domain.com",
|
||||
"recipient2@domain.com"
|
||||
]
|
||||
```
|
||||
- `from` (string, 선택): 보내는 사람 - 발신자의 이메일을 지정합니다.
|
||||
- `subject` (string, 선택): 제목 - 메시지의 제목을 지정합니다.
|
||||
- `messageContent` (string, 선택): 메시지 내용 - 이메일 메시지의 내용을 일반 텍스트 또는 HTML로 지정합니다.
|
||||
- `attachments` (string, 선택): 첨부파일 - 단일 파일 객체 또는 파일 객체의 JSON 배열을 허용합니다.
|
||||
- `additionalHeaders` (object, 선택): 추가 헤더 - 추가 헤더 필드를 지정할 수 있습니다.
|
||||
```json
|
||||
{
|
||||
"reply-to": "Sender Name <sender@domain.com>"
|
||||
}
|
||||
```
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
## 사용 예시
|
||||
|
||||
### 기본 Gmail 에이전트 설정
|
||||
|
||||
```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()
|
||||
```
|
||||
|
||||
### 특정 Gmail 도구 필터링
|
||||
|
||||
```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()
|
||||
```
|
||||
|
||||
### 연락처 관리
|
||||
|
||||
```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. 'example.com' 도메인에서 연락처를 검색합니다.
|
||||
2. 연락처 목록에 없는 최근 이메일 발신자에 대해 새 연락처를 생성합니다.
|
||||
3. 최근 상호 작용 데이터를 반영하여 연락처 정보를 업데이트합니다.
|
||||
""",
|
||||
agent=contact_manager,
|
||||
expected_output="새 연락처와 최근 상호 작용으로 연락처 데이터베이스가 업데이트됨"
|
||||
)
|
||||
|
||||
crew = Crew(
|
||||
agents=[contact_manager],
|
||||
tasks=[contact_task]
|
||||
)
|
||||
|
||||
crew.kickoff()
|
||||
```
|
||||
|
||||
### 이메일 검색 및 분석
|
||||
|
||||
```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()
|
||||
```
|
||||
|
||||
### 자동화된 이메일 워크플로우
|
||||
|
||||
```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. 지난 24시간 동안 제목에 'urgent'가 포함된 이메일 검색
|
||||
2. 각 긴급 이메일에 대한 답장 초안 생성
|
||||
3. 발신자에게 자동 확인 이메일 전송
|
||||
4. 주의가 필요한 긴급 항목의 요약 보고서 작성
|
||||
""",
|
||||
agent=workflow_manager,
|
||||
expected_output="긴급 이메일이 자동 응답 및 요약 보고서와 함께 처리됨"
|
||||
)
|
||||
|
||||
crew = Crew(
|
||||
agents=[workflow_manager],
|
||||
tasks=[workflow_task]
|
||||
)
|
||||
|
||||
crew.kickoff()
|
||||
```
|
||||
|
||||
### 도움 받기
|
||||
|
||||
<Card title="도움이 필요하신가요?" icon="headset" href="mailto:support@crewai.com">
|
||||
Gmail 통합 설정 또는 문제 해결에 대한 지원이 필요하시다면 저희 지원팀에 문의해 주세요.
|
||||
</Card>
|
||||
391
docs/ko/enterprise/integrations/google_calendar.mdx
Normal file
@@ -0,0 +1,391 @@
|
||||
---
|
||||
title: Google 캘린더 연동
|
||||
description: "CrewAI를 위한 Google 캘린더 연동을 통한 이벤트 및 일정 관리."
|
||||
icon: "calendar"
|
||||
---
|
||||
|
||||
## 개요
|
||||
|
||||
에이전트가 Google Calendar를 통해 캘린더 이벤트, 일정, 가용 시간을 관리할 수 있도록 지원합니다. 이벤트를 생성 및 업데이트하고 참석자를 관리하며, 가용성을 확인하고 AI 기반 자동화로 일정 관리 워크플로우를 효율적으로 운영하세요.
|
||||
|
||||
## 필수 조건
|
||||
|
||||
Google Calendar 통합을 사용하기 전에 다음을 준비해야 합니다:
|
||||
|
||||
- 활성 구독이 있는 [CrewAI Enterprise](https://app.crewai.com) 계정
|
||||
- Google Calendar에 접근 가능한 Google 계정
|
||||
- [통합 페이지](https://app.crewai.com/crewai_plus/connectors)를 통해 Google 계정을 연결 완료
|
||||
|
||||
## Google Calendar 연동 설정
|
||||
|
||||
### 1. Google 계정 연결하기
|
||||
|
||||
1. [CrewAI Enterprise Integrations](https://app.crewai.com/crewai_plus/connectors)로 이동합니다.
|
||||
2. 인증 통합 섹션에서 **Google Calendar**를 찾습니다.
|
||||
3. **Connect**를 클릭하고 OAuth 과정을 완료합니다.
|
||||
4. 캘린더 및 연락처 접근 권한을 허용합니다.
|
||||
5. [Account Settings](https://app.crewai.com/crewai_plus/settings/account)에서 Enterprise Token을 복사합니다.
|
||||
|
||||
### 2. 필수 패키지 설치
|
||||
|
||||
```bash
|
||||
uv add crewai-tools
|
||||
```
|
||||
|
||||
## 사용 가능한 작업
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="GOOGLE_CALENDAR_CREATE_EVENT">
|
||||
**설명:** Google 캘린더에 이벤트를 생성합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `eventName` (string, 필수): 이벤트 이름.
|
||||
- `startTime` (string, 필수): 시작 시간 - Unix 타임스탬프 또는 ISO8601 날짜 형식 허용.
|
||||
- `endTime` (string, 선택): 종료 시간 - 비워두면 시작 시간 기준 1시간 후로 기본 설정됩니다.
|
||||
- `calendar` (string, 선택): 캘린더 - Connect Portal Workflow Settings를 사용하여 사용자가 이벤트를 추가할 캘린더를 선택할 수 있도록 합니다. 비워두면 사용자의 기본 캘린더로 기본 설정됩니다.
|
||||
- `attendees` (string, 선택): 참석자 - 이메일 주소 배열 또는 쉼표로 구분된 이메일 주소 허용.
|
||||
- `eventLocation` (string, 선택): 이벤트 위치.
|
||||
- `eventDescription` (string, 선택): 이벤트 설명.
|
||||
- `eventId` (string, 선택): 이벤트 ID - 이 이벤트와 연결할 애플리케이션의 ID입니다. 이후 이 ID를 사용하여 이벤트를 동기화할 수 있습니다.
|
||||
- `includeMeetLink` (boolean, 선택): Google Meet 링크 포함 여부? - 이 이벤트에 대해 Google Meet 컨퍼런스 링크를 자동으로 생성합니다.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="GOOGLE_CALENDAR_UPDATE_EVENT">
|
||||
**설명:** Google 캘린더에서 기존 이벤트를 업데이트합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `eventId` (string, 필수): 이벤트 ID - 업데이트할 이벤트의 ID입니다.
|
||||
- `eventName` (string, 선택): 이벤트 이름.
|
||||
- `startTime` (string, 선택): 시작 시간 - Unix 타임스탬프 또는 ISO8601 날짜 형식 허용.
|
||||
- `endTime` (string, 선택): 종료 시간 - 비워두면 시작 시간 기준 1시간 후로 기본 설정됩니다.
|
||||
- `calendar` (string, 선택): 캘린더 - Connect Portal Workflow Settings를 사용하여 사용자가 이벤트를 추가할 캘린더를 선택할 수 있도록 합니다. 비워두면 사용자의 기본 캘린더로 기본 설정됩니다.
|
||||
- `attendees` (string, 선택): 참석자 - 이메일 주소 배열 또는 쉼표로 구분된 이메일 주소 허용.
|
||||
- `eventLocation` (string, 선택): 이벤트 위치.
|
||||
- `eventDescription` (string, 선택): 이벤트 설명.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="GOOGLE_CALENDAR_LIST_EVENTS">
|
||||
**설명:** Google 캘린더에서 이벤트 목록을 가져옵니다.
|
||||
|
||||
**파라미터:**
|
||||
- `calendar` (string, 선택): 캘린더 - Connect Portal Workflow Settings를 사용하여 사용자가 이벤트를 추가할 캘린더를 선택할 수 있도록 합니다. 비워두면 사용자의 기본 캘린더로 기본 설정됩니다.
|
||||
- `after` (string, 선택): 이후 - 제공된 날짜 이후에 시작하는 이벤트를 필터링합니다 (밀리초 단위의 Unix 또는 ISO 타임스탬프). (예시: "2025-04-12T10:00:00Z 또는 1712908800000").
|
||||
- `before` (string, 선택): 이전 - 제공된 날짜 이전에 종료되는 이벤트를 필터링합니다 (밀리초 단위의 Unix 또는 ISO 타임스탬프). (예시: "2025-04-12T10:00:00Z 또는 1712908800000").
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="GOOGLE_CALENDAR_GET_EVENT_BY_ID">
|
||||
**설명:** Google 캘린더에서 ID로 특정 이벤트를 가져옵니다.
|
||||
|
||||
**파라미터:**
|
||||
- `eventId` (string, 필수): 이벤트 ID.
|
||||
- `calendar` (string, 선택): 캘린더 - Connect Portal Workflow Settings를 사용하여 사용자가 이벤트를 추가할 캘린더를 선택할 수 있도록 합니다. 비워두면 사용자의 기본 캘린더로 기본 설정됩니다.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="GOOGLE_CALENDAR_DELETE_EVENT">
|
||||
**설명:** Google 캘린더에서 이벤트를 삭제합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `eventId` (string, 필수): 이벤트 ID - 삭제할 캘린더 이벤트의 ID입니다.
|
||||
- `calendar` (string, 선택): 캘린더 - Connect Portal Workflow Settings를 사용하여 사용자가 이벤트를 추가할 캘린더를 선택할 수 있도록 합니다. 비워두면 사용자의 기본 캘린더로 기본 설정됩니다.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="GOOGLE_CALENDAR_GET_CONTACTS">
|
||||
**설명:** Google 캘린더에서 연락처를 가져옵니다.
|
||||
|
||||
**파라미터:**
|
||||
- `paginationParameters` (object, 선택): 페이지네이션 파라미터.
|
||||
```json
|
||||
{
|
||||
"pageCursor": "page_cursor_string"
|
||||
}
|
||||
```
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="GOOGLE_CALENDAR_SEARCH_CONTACTS">
|
||||
**설명:** Google 캘린더에서 연락처를 검색합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `query` (string, 선택): 연락처를 검색할 검색 쿼리.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="GOOGLE_CALENDAR_LIST_DIRECTORY_PEOPLE">
|
||||
**설명:** 디렉토리 구성원 목록을 가져옵니다.
|
||||
|
||||
**파라미터:**
|
||||
- `paginationParameters` (object, 선택): 페이지네이션 파라미터.
|
||||
```json
|
||||
{
|
||||
"pageCursor": "page_cursor_string"
|
||||
}
|
||||
```
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="GOOGLE_CALENDAR_SEARCH_DIRECTORY_PEOPLE">
|
||||
**설명:** 디렉토리 구성원을 검색합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `query` (string, 필수): 연락처를 검색할 검색 쿼리.
|
||||
- `paginationParameters` (object, 선택): 페이지네이션 파라미터.
|
||||
```json
|
||||
{
|
||||
"pageCursor": "page_cursor_string"
|
||||
}
|
||||
```
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="GOOGLE_CALENDAR_LIST_OTHER_CONTACTS">
|
||||
**설명:** 기타 연락처 목록을 가져옵니다.
|
||||
|
||||
**파라미터:**
|
||||
- `paginationParameters` (object, 선택): 페이지네이션 파라미터.
|
||||
```json
|
||||
{
|
||||
"pageCursor": "page_cursor_string"
|
||||
}
|
||||
```
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="GOOGLE_CALENDAR_SEARCH_OTHER_CONTACTS">
|
||||
**설명:** 기타 연락처를 검색합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `query` (string, 선택): 연락처를 검색할 검색 쿼리.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="GOOGLE_CALENDAR_GET_AVAILABILITY">
|
||||
**설명:** 캘린더의 가용성 정보를 가져옵니다.
|
||||
|
||||
**파라미터:**
|
||||
- `timeMin` (string, 필수): 기간의 시작. ISO 형식.
|
||||
- `timeMax` (string, 필수): 기간의 끝. ISO 형식.
|
||||
- `timeZone` (string, 선택): 응답에 사용되는 시간대. 선택 사항입니다. 기본값은 UTC입니다.
|
||||
- `items` (array, 선택): 조회할 캘린더 및/또는 그룹 목록. 비워두면 사용자 기본 캘린더가 기본값입니다.
|
||||
```json
|
||||
[
|
||||
{
|
||||
"id": "calendar_id_1"
|
||||
},
|
||||
{
|
||||
"id": "calendar_id_2"
|
||||
}
|
||||
]
|
||||
```
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
## 사용 예시
|
||||
|
||||
### 기본 캘린더 에이전트 설정
|
||||
|
||||
```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()
|
||||
```
|
||||
|
||||
### 특정 캘린더 도구 필터링
|
||||
|
||||
```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()
|
||||
```
|
||||
|
||||
### 이벤트 관리 및 업데이트
|
||||
|
||||
```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()
|
||||
```
|
||||
|
||||
### 연락처 및 가용성 관리
|
||||
|
||||
```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. 엔지니어링 부서의 연락처를 검색합니다.
|
||||
2. 다음 주 금요일 오후에 모든 엔지니어의 가용성을 확인합니다.
|
||||
3. 가장 먼저 가능한 2시간 슬롯에 팀 미팅을 만듭니다.
|
||||
4. Google Meet 링크를 포함하고 초대장을 발송합니다.
|
||||
""",
|
||||
agent=availability_coordinator,
|
||||
expected_output="가용성에 따라 팀 미팅이 일정 예약되고 모든 엔지니어가 초대됨"
|
||||
)
|
||||
|
||||
crew = Crew(
|
||||
agents=[availability_coordinator],
|
||||
tasks=[availability_task]
|
||||
)
|
||||
|
||||
crew.kickoff()
|
||||
```
|
||||
|
||||
### 자동화된 일정 관리 워크플로우
|
||||
|
||||
```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. 앞으로 2주간 예정된 모든 이벤트를 나열합니다.
|
||||
2. 일정 충돌 또는 연이어 배정된 미팅을 식별합니다.
|
||||
3. 가용 시간을 확인하여 최적의 미팅 시간을 제안합니다.
|
||||
4. 필요한 경우 미팅 사이에 버퍼 시간을 생성합니다.
|
||||
5. 아젠다 항목 및 미팅 링크가 포함된 이벤트 설명을 업데이트합니다.
|
||||
""",
|
||||
agent=scheduling_automator,
|
||||
expected_output="일정 충돌이 해결되고 버퍼 타임 및 미팅 세부 정보가 업데이트된 최적화된 캘린더"
|
||||
)
|
||||
|
||||
crew = Crew(
|
||||
agents=[scheduling_automator],
|
||||
tasks=[automation_task]
|
||||
)
|
||||
|
||||
crew.kickoff()
|
||||
```
|
||||
|
||||
## 문제 해결
|
||||
|
||||
### 일반적인 문제
|
||||
|
||||
**인증 오류**
|
||||
- Google 계정에 캘린더 접근에 필요한 권한이 있는지 확인하세요
|
||||
- OAuth 연결에 Google Calendar API에 필요한 모든 범위가 포함되어 있는지 확인하세요
|
||||
- 캘린더 공유 설정이 필요한 접근 수준을 허용하는지 확인하세요
|
||||
|
||||
**이벤트 생성 문제**
|
||||
- 시간 형식이 올바른지(ISO8601 또는 Unix 타임스탬프) 확인하세요
|
||||
- 참석자 이메일 주소가 올바르게 형식화되어 있는지 확인하세요
|
||||
- 대상 캘린더가 존재하며 접근 가능한지 확인하세요
|
||||
- 올바른 시간대가 지정되어 있는지 확인하세요
|
||||
|
||||
**가용성 및 시간 충돌**
|
||||
- 가용성 확인 시 시간 범위에 올바른 ISO 형식을 사용하세요
|
||||
- 모든 작업에서 시간대가 일관성 있는지 확인하세요
|
||||
- 여러 캘린더를 확인할 때 캘린더 ID가 올바른지 확인하세요
|
||||
|
||||
**연락처 및 사용자 검색**
|
||||
- 검색 쿼리가 올바르게 형식화되어 있는지 확인하세요
|
||||
- 디렉터리 접근 권한이 부여되었는지 확인하세요
|
||||
- 연락처 정보가 최신이며 접근 가능한지 확인하세요
|
||||
|
||||
**이벤트 업데이트 및 삭제**
|
||||
- 이벤트 ID가 올바르며 이벤트가 존재하는지 확인하세요
|
||||
- 이벤트를 편집할 수 있는 권한이 있는지 확인하세요
|
||||
- 캘린더 소유권이 수정 작업을 허용하는지 확인하세요
|
||||
|
||||
### 도움 받기
|
||||
|
||||
<Card title="도움이 필요하신가요?" icon="headset" href="mailto:support@crewai.com">
|
||||
Google Calendar 연동 설정 또는 문제 해결에 대한 지원이 필요하면 저희 지원팀에 문의하세요.
|
||||
</Card>
|
||||
321
docs/ko/enterprise/integrations/google_sheets.mdx
Normal file
@@ -0,0 +1,321 @@
|
||||
---
|
||||
title: Google Sheets 연동
|
||||
description: "CrewAI를 위한 Google Sheets 연동을 통해 스프레드시트 데이터 동기화."
|
||||
icon: "google"
|
||||
---
|
||||
|
||||
## 개요
|
||||
|
||||
에이전트가 Google Sheets를 통해 스프레드시트 데이터를 관리할 수 있도록 합니다. 행을 읽고, 새 항목을 생성하며, 기존 데이터를 업데이트하고, AI 기반 자동화를 통해 데이터 관리 워크플로우를 간소화하세요. 데이터 추적, 보고, 협업 데이터 관리에 최적화되어 있습니다.
|
||||
|
||||
## 사전 준비 사항
|
||||
|
||||
Google Sheets 통합을 사용하기 전에 다음을 확인하세요:
|
||||
|
||||
- 활성 구독이 되어 있는 [CrewAI Enterprise](https://app.crewai.com) 계정
|
||||
- Google Sheets에 액세스할 수 있는 Google 계정
|
||||
- [통합 페이지](https://app.crewai.com/crewai_plus/connectors)를 통해 Google 계정 연결
|
||||
- 데이터 작업을 위한 올바른 열 헤더가 있는 스프레드시트
|
||||
|
||||
## Google Sheets 통합 설정
|
||||
|
||||
### 1. Google 계정 연결하기
|
||||
|
||||
1. [CrewAI Enterprise Integrations](https://app.crewai.com/crewai_plus/connectors)로 이동합니다.
|
||||
2. 인증 통합 섹션에서 **Google Sheets**를 찾습니다.
|
||||
3. **Connect**를 클릭하고 OAuth 흐름을 완료합니다.
|
||||
4. 스프레드시트 접근에 필요한 권한을 허용합니다.
|
||||
5. [Account Settings](https://app.crewai.com/crewai_plus/settings/account)에서 Enterprise Token을 복사합니다.
|
||||
|
||||
### 2. 필수 패키지 설치
|
||||
|
||||
```bash
|
||||
uv add crewai-tools
|
||||
```
|
||||
|
||||
## 사용 가능한 작업
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="GOOGLE_SHEETS_GET_ROW">
|
||||
**설명:** Google Sheets 스프레드시트에서 행을 가져옵니다.
|
||||
|
||||
**매개변수:**
|
||||
- `spreadsheetId` (string, 필수): 스프레드시트 - Connect Portal Workflow Settings를 사용하여 사용자가 스프레드시트를 선택할 수 있도록 합니다. 선택한 스프레드시트의 첫 번째 워크시트를 기본값으로 사용합니다.
|
||||
- `limit` (string, 선택): 행 제한 - 반환할 최대 행 수를 제한합니다.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="GOOGLE_SHEETS_CREATE_ROW">
|
||||
**설명:** Google Sheets 스프레드시트에 새로운 행을 만듭니다.
|
||||
|
||||
**매개변수:**
|
||||
- `spreadsheetId` (string, 필수): 스프레드시트 - Connect Portal Workflow Settings를 사용하여 사용자가 스프레드시트를 선택할 수 있도록 합니다. 선택한 스프레드시트의 첫 번째 워크시트를 기본값으로 사용합니다.
|
||||
- `worksheet` (string, 필수): 워크시트 - 워크시트에는 반드시 열 헤더가 있어야 합니다.
|
||||
- `additionalFields` (object, 필수): 필드 - 추가할 행의 필드를 열 이름을 key로 하는 객체로 포함합니다. Connect Portal Workflow Settings를 사용하여 사용자가 열 매핑을 선택할 수 있도록 합니다.
|
||||
```json
|
||||
{
|
||||
"columnName1": "columnValue1",
|
||||
"columnName2": "columnValue2",
|
||||
"columnName3": "columnValue3",
|
||||
"columnName4": "columnValue4"
|
||||
}
|
||||
```
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="GOOGLE_SHEETS_UPDATE_ROW">
|
||||
**설명:** Google Sheets 스프레드시트의 기존 행을 업데이트합니다.
|
||||
|
||||
**매개변수:**
|
||||
- `spreadsheetId` (string, 필수): 스프레드시트 - Connect Portal Workflow Settings를 사용하여 사용자가 스프레드시트를 선택할 수 있도록 합니다. 선택한 스프레드시트의 첫 번째 워크시트를 기본값으로 사용합니다.
|
||||
- `worksheet` (string, 필수): 워크시트 - 워크시트에는 반드시 열 헤더가 있어야 합니다.
|
||||
- `filterFormula` (object, 선택): 필터 - 업데이트할 행을 식별하기 위한 단일 조건의 AND 그룹으로 이루어진 OR의 형태(분리 정규형)로 작성합니다.
|
||||
```json
|
||||
{
|
||||
"operator": "OR",
|
||||
"conditions": [
|
||||
{
|
||||
"operator": "AND",
|
||||
"conditions": [
|
||||
{
|
||||
"field": "status",
|
||||
"operator": "$stringExactlyMatches",
|
||||
"value": "pending"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
사용 가능한 연산자: `$stringContains`, `$stringDoesNotContain`, `$stringExactlyMatches`, `$stringDoesNotExactlyMatch`, `$stringStartsWith`, `$stringDoesNotStartWith`, `$stringEndsWith`, `$stringDoesNotEndWith`, `$numberGreaterThan`, `$numberLessThan`, `$numberEquals`, `$numberDoesNotEqual`, `$dateTimeAfter`, `$dateTimeBefore`, `$dateTimeEquals`, `$booleanTrue`, `$booleanFalse`, `$exists`, `$doesNotExist`
|
||||
- `additionalFields` (object, 필수): 필드 - 업데이트할 필드를 열 이름을 key로 하는 객체로 포함합니다. Connect Portal Workflow Settings를 사용하여 사용자가 열 매핑을 선택할 수 있도록 합니다.
|
||||
```json
|
||||
{
|
||||
"columnName1": "newValue1",
|
||||
"columnName2": "newValue2",
|
||||
"columnName3": "newValue3",
|
||||
"columnName4": "newValue4"
|
||||
}
|
||||
```
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
## 사용 예시
|
||||
|
||||
### 기본 Google Sheets 에이전트 설정
|
||||
|
||||
```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()
|
||||
```
|
||||
|
||||
### 특정 Google Sheets 도구 필터링
|
||||
|
||||
```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()
|
||||
```
|
||||
|
||||
### 데이터 분석 및 보고
|
||||
|
||||
```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()
|
||||
```
|
||||
|
||||
### 자동화된 데이터 업데이트
|
||||
|
||||
```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. 주문 스프레드시트에서 모든 보류 중인 주문을 찾으세요
|
||||
2. 해당 주문의 상태를 'processing'으로 업데이트하세요
|
||||
3. 상태가 업데이트된 시점의 타임스탬프를 추가하세요
|
||||
4. 변경 사항을 별도의 추적 시트에 기록하세요
|
||||
""",
|
||||
agent=data_updater,
|
||||
expected_output="모든 보류 중인 주문이 processing 상태로 업데이트되고, 타임스탬프가 기록됨"
|
||||
)
|
||||
|
||||
crew = Crew(
|
||||
agents=[data_updater],
|
||||
tasks=[update_task]
|
||||
)
|
||||
|
||||
crew.kickoff()
|
||||
```
|
||||
|
||||
### 복잡한 데이터 관리 워크플로우
|
||||
|
||||
```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. 메인 고객 스프레드시트에서 모든 고객 데이터를 가져옵니다
|
||||
2. 활성 고객에 대한 월별 요약 항목을 생성합니다
|
||||
3. 최근 30일간의 활동을 기반으로 고객 상태를 업데이트합니다
|
||||
4. 고객 지표가 포함된 월간 보고서를 생성합니다
|
||||
5. 비활성 고객 기록을 별도의 시트로 보관합니다
|
||||
""",
|
||||
agent=workflow_manager,
|
||||
expected_output="월간 고객 워크플로우가 완료되어 상태가 업데이트되고 보고서가 생성됨"
|
||||
)
|
||||
|
||||
crew = Crew(
|
||||
agents=[workflow_manager],
|
||||
tasks=[workflow_task]
|
||||
)
|
||||
|
||||
crew.kickoff()
|
||||
```
|
||||
|
||||
## 문제 해결
|
||||
|
||||
### 일반적인 문제
|
||||
|
||||
**권한 오류**
|
||||
- Google 계정이 대상 스프레드시트에 대해 편집 권한이 있는지 확인하세요
|
||||
- OAuth 연결에 Google Sheets API에 필요한 scope가 포함되어 있는지 검증하세요
|
||||
- 스프레드시트가 인증된 계정과 공유되어 있는지 확인하세요
|
||||
|
||||
**스프레드시트 구조 문제**
|
||||
- 행을 생성하거나 업데이트하기 전에 워크시트에 올바른 열 헤더가 있는지 확인하세요
|
||||
- `additionalFields`의 열 이름이 실제 열 헤더와 일치하는지 검증하세요
|
||||
- 지정된 워크시트가 스프레드시트에 존재하는지 확인하세요
|
||||
|
||||
**데이터 유형 및 형식 문제**
|
||||
- 데이터 값이 각 열에 대해 예상되는 형식과 일치하는지 확인하세요
|
||||
- 날짜 열에는 올바른 날짜 형식(ISO 형식 권장)을 사용하세요
|
||||
- 숫자 열에 입력되는 값이 적절한 형식인지 검증하세요
|
||||
|
||||
**필터 수식 문제**
|
||||
- 필터 수식이 부정 정규형(disjunctive normal form)의 올바른 JSON 구조를 따르는지 확인하세요
|
||||
- 실제 열 헤더와 일치하는 유효한 필드명을 사용하세요
|
||||
- 복잡한 다중 조건 쿼리를 작성하기 전에 간단한 필터로 테스트하세요
|
||||
- 연산자 유형이 열의 데이터 유형과 일치하는지 검증하세요
|
||||
|
||||
**행 제한 및 성능**
|
||||
- `GOOGLE_SHEETS_GET_ROW`를 사용할 때 행 제한에 유의하세요
|
||||
- 대용량 데이터셋의 경우 페이지네이션을 고려하세요
|
||||
- 처리되는 데이터의 양을 줄이기 위해 구체적인 필터를 사용하세요
|
||||
|
||||
**업데이트 작업**
|
||||
- 필터 조건이 업데이트하려는 행을 정확하게 식별하는지 확인하세요
|
||||
- 대규모 업데이트 전에 작은 데이터셋으로 필터 조건을 테스트하세요
|
||||
- 모든 필수 필드가 업데이트 작업에 포함되어 있는지 검증하세요
|
||||
|
||||
### 도움 받기
|
||||
|
||||
<Card title="도움이 필요하신가요?" icon="headset" href="mailto:support@crewai.com">
|
||||
Google Sheets 통합 설정 또는 문제 해결에 대한 지원이 필요하시면 저희 지원팀으로 문의해 주세요.
|
||||
</Card>
|
||||
579
docs/ko/enterprise/integrations/hubspot.mdx
Normal file
@@ -0,0 +1,579 @@
|
||||
---
|
||||
title: "HubSpot 연동"
|
||||
description: "CrewAI로 HubSpot에서 회사 및 연락처를 관리하세요."
|
||||
icon: "briefcase"
|
||||
---
|
||||
|
||||
## 개요
|
||||
|
||||
에이전트가 HubSpot 내에서 회사 및 연락처를 관리할 수 있도록 지원합니다. 새로운 레코드를 생성하고 AI 기반 자동화로 CRM 프로세스를 효율화하세요.
|
||||
|
||||
## 사전 준비 사항
|
||||
|
||||
HubSpot 통합을 사용하기 전에 다음을 확인하세요.
|
||||
|
||||
- 활성 구독이 있는 [CrewAI Enterprise](https://app.crewai.com) 계정
|
||||
- 적절한 권한이 있는 HubSpot 계정
|
||||
- [통합 페이지](https://app.crewai.com/crewai_plus/connectors)를 통해 HubSpot 계정이 연결되어 있음
|
||||
|
||||
## HubSpot 통합 설정
|
||||
|
||||
### 1. HubSpot 계정 연결하기
|
||||
|
||||
1. [CrewAI Enterprise Integrations](https://app.crewai.com/crewai_plus/connectors)로 이동합니다.
|
||||
2. 인증 통합 섹션에서 **HubSpot**을 찾습니다.
|
||||
3. **Connect**를 클릭하고 OAuth 플로우를 완료합니다.
|
||||
4. 회사 및 연락처 관리를 위한 필요한 권한을 부여합니다.
|
||||
5. [계정 설정](https://app.crewai.com/crewai_plus/settings/account)에서 Enterprise Token을 복사합니다.
|
||||
|
||||
### 2. 필수 패키지 설치
|
||||
|
||||
```bash
|
||||
uv add crewai-tools
|
||||
```
|
||||
|
||||
## 사용 가능한 액션
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="HUBSPOT_CREATE_RECORD_COMPANIES">
|
||||
**설명:** HubSpot에서 새로운 회사 레코드를 생성합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `name` (string, 필수): 회사명.
|
||||
- `domain` (string, 선택): 회사 도메인명.
|
||||
- `industry` (string, 선택): 산업군. HubSpot에서 미리 정의된 값 중 하나여야 합니다.
|
||||
- `phone` (string, 선택): 전화번호.
|
||||
- `hubspot_owner_id` (string, 선택): 회사 소유자 ID.
|
||||
- `type` (string, 선택): 회사 유형. 사용 가능한 값: `PROSPECT`, `PARTNER`, `RESELLER`, `VENDOR`, `OTHER`.
|
||||
- `city` (string, 선택): 도시.
|
||||
- `state` (string, 선택): 주/지역.
|
||||
- `zip` (string, 선택): 우편번호.
|
||||
- `numberofemployees` (number, 선택): 직원 수.
|
||||
- `annualrevenue` (number, 선택): 연간 매출.
|
||||
- `timezone` (string, 선택): 시간대.
|
||||
- `description` (string, 선택): 설명.
|
||||
- `linkedin_company_page` (string, 선택): LinkedIn 회사 페이지 URL.
|
||||
- `company_email` (string, 선택): 회사 이메일.
|
||||
- `first_name` (string, 선택): 회사 연락처의 이름.
|
||||
- `last_name` (string, 선택): 회사 연락처의 성.
|
||||
- `about_us` (string, 선택): 회사 소개.
|
||||
- `hs_csm_sentiment` (string, 선택): CSM 만족도. 사용 가능한 값: `at_risk`, `neutral`, `healthy`.
|
||||
- `closedate` (string, 선택): 마감일.
|
||||
- `hs_keywords` (string, 선택): 회사 키워드. 미리 정의된 값 중 하나여야 합니다.
|
||||
- `country` (string, 선택): 국가/지역.
|
||||
- `hs_country_code` (string, 선택): 국가/지역 코드.
|
||||
- `hs_employee_range` (string, 선택): 직원 범위.
|
||||
- `facebook_company_page` (string, 선택): Facebook 회사 페이지 URL.
|
||||
- `facebookfans` (number, 선택): Facebook 팬 수.
|
||||
- `hs_gps_coordinates` (string, 선택): GPS 좌표.
|
||||
- `hs_gps_error` (string, 선택): GPS 오류.
|
||||
- `googleplus_page` (string, 선택): Google Plus 페이지 URL.
|
||||
- `owneremail` (string, 선택): HubSpot 소유자 이메일.
|
||||
- `ownername` (string, 선택): HubSpot 소유자 이름.
|
||||
- `hs_ideal_customer_profile` (string, 선택): 이상적인 고객 프로필 티어. 사용 가능한 값: `tier_1`, `tier_2`, `tier_3`.
|
||||
- `hs_industry_group` (string, 선택): 산업 그룹.
|
||||
- `is_public` (boolean, 선택): 공개 여부.
|
||||
- `hs_last_metered_enrichment_timestamp` (string, 선택): 마지막 enrichment 타임스탬프.
|
||||
- `hs_lead_status` (string, 선택): 리드 상태. 사용 가능한 값: `NEW`, `OPEN`, `IN_PROGRESS`, `OPEN_DEAL`, `UNQUALIFIED`, `ATTEMPTED_TO_CONTACT`, `CONNECTED`, `BAD_TIMING`.
|
||||
- `lifecyclestage` (string, 선택): 라이프사이클 단계. 사용 가능한 값: `subscriber`, `lead`, `marketingqualifiedlead`, `salesqualifiedlead`, `opportunity`, `customer`, `evangelist`, `other`.
|
||||
- `linkedinbio` (string, 선택): LinkedIn 바이오.
|
||||
- `hs_linkedin_handle` (string, 선택): LinkedIn 핸들.
|
||||
- `hs_live_enrichment_deadline` (string, 선택): 라이브 enrichment 기한.
|
||||
- `hs_logo_url` (string, 선택): 로고 URL.
|
||||
- `hs_analytics_source` (string, 선택): 원래 유입 경로.
|
||||
- `hs_pinned_engagement_id` (number, 선택): 고정된 참여 ID.
|
||||
- `hs_quick_context` (string, 선택): 간략한 컨텍스트.
|
||||
- `hs_revenue_range` (string, 선택): 매출 범위.
|
||||
- `hs_state_code` (string, 선택): 주/지역 코드.
|
||||
- `address` (string, 선택): 거리 주소.
|
||||
- `address2` (string, 선택): 거리 주소 2.
|
||||
- `hs_is_target_account` (boolean, 선택): 타깃 계정 여부.
|
||||
- `hs_target_account` (string, 선택): 타깃 계정 티어. 사용 가능한 값: `tier_1`, `tier_2`, `tier_3`.
|
||||
- `hs_target_account_recommendation_snooze_time` (string, 선택): 타깃 계정 추천 일시중지 시간.
|
||||
- `hs_target_account_recommendation_state` (string, 선택): 타깃 계정 추천 상태. 사용 가능한 값: `DISMISSED`, `NONE`, `SNOOZED`.
|
||||
- `total_money_raised` (string, 선택): 총 조달 금액.
|
||||
- `twitterbio` (string, 선택): 트위터 바이오.
|
||||
- `twitterfollowers` (number, 선택): 트위터 팔로워 수.
|
||||
- `twitterhandle` (string, 선택): 트위터 핸들.
|
||||
- `web_technologies` (string, 선택): 사용한 웹 기술. 미리 정의된 값 중 하나여야 합니다.
|
||||
- `website` (string, 선택): 웹사이트 URL.
|
||||
- `founded_year` (string, 선택): 설립 연도.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="HUBSPOT_CREATE_RECORD_CONTACTS">
|
||||
**설명:** HubSpot에서 새로운 연락처 레코드를 생성합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `email` (string, 필수): 연락처 이메일 주소.
|
||||
- `firstname` (string, 선택): 이름.
|
||||
- `lastname` (string, 선택): 성.
|
||||
- `phone` (string, 선택): 전화번호.
|
||||
- `hubspot_owner_id` (string, 선택): 연락처 소유자.
|
||||
- `lifecyclestage` (string, 선택): 라이프사이클 단계. 사용 가능한 값: `subscriber`, `lead`, `marketingqualifiedlead`, `salesqualifiedlead`, `opportunity`, `customer`, `evangelist`, `other`.
|
||||
- `hs_lead_status` (string, 선택): 리드 상태. 사용 가능한 값: `NEW`, `OPEN`, `IN_PROGRESS`, `OPEN_DEAL`, `UNQUALIFIED`, `ATTEMPTED_TO_CONTACT`, `CONNECTED`, `BAD_TIMING`.
|
||||
- `annualrevenue` (string, 선택): 연간 매출.
|
||||
- `hs_buying_role` (string, 선택): 구매 역할.
|
||||
- `cc_emails` (string, 선택): 참조(CC) 이메일.
|
||||
- `ch_customer_id` (string, 선택): Chargify 고객 ID.
|
||||
- `ch_customer_reference` (string, 선택): Chargify 고객 참조.
|
||||
- `chargify_sites` (string, 선택): Chargify 사이트(들).
|
||||
- `city` (string, 선택): 도시.
|
||||
- `hs_facebook_ad_clicked` (boolean, 선택): Facebook 광고 클릭 여부.
|
||||
- `hs_linkedin_ad_clicked` (string, 선택): LinkedIn 광고 클릭 여부.
|
||||
- `hs_clicked_linkedin_ad` (string, 선택): LinkedIn 광고 클릭 여부.
|
||||
- `closedate` (string, 선택): 마감일.
|
||||
- `company` (string, 선택): 회사명.
|
||||
- `company_size` (string, 선택): 회사 규모.
|
||||
- `country` (string, 선택): 국가/지역.
|
||||
- `hs_country_region_code` (string, 선택): 국가/지역 코드.
|
||||
- `date_of_birth` (string, 선택): 생년월일.
|
||||
- `degree` (string, 선택): 학위.
|
||||
- `hs_email_customer_quarantined_reason` (string, 선택): 이메일 주소 격리 사유.
|
||||
- `hs_role` (string, 선택): 고용 역할. 미리 정의된 값 중 하나여야 합니다.
|
||||
- `hs_seniority` (string, 선택): 고용 직급. 미리 정의된 값 중 하나여야 합니다.
|
||||
- `hs_sub_role` (string, 선택): 고용 하위 역할. 미리 정의된 값 중 하나여야 합니다.
|
||||
- `hs_employment_change_detected_date` (string, 선택): 고용 변경 감지 날짜.
|
||||
- `hs_enriched_email_bounce_detected` (boolean, 선택): 향상된 이메일 바운스 감지됨.
|
||||
- `hs_facebookid` (string, 선택): Facebook ID.
|
||||
- `hs_facebook_click_id` (string, 선택): Facebook 클릭 ID.
|
||||
- `fax` (string, 선택): 팩스번호.
|
||||
- `field_of_study` (string, 선택): 전공.
|
||||
- `followercount` (number, 선택): 팔로워 수.
|
||||
- `gender` (string, 선택): 성별.
|
||||
- `hs_google_click_id` (string, 선택): Google 광고 클릭 ID.
|
||||
- `graduation_date` (string, 선택): 졸업 날짜.
|
||||
- `owneremail` (string, 선택): HubSpot 소유자 이메일(레거시).
|
||||
- `ownername` (string, 선택): HubSpot 소유자 이름(레거시).
|
||||
- `industry` (string, 선택): 산업군.
|
||||
- `hs_inferred_language_codes` (string, 선택): 추정 언어 코드. 미리 정의된 값 중 하나여야 합니다.
|
||||
- `jobtitle` (string, 선택): 직책.
|
||||
- `hs_job_change_detected_date` (string, 선택): 직장 변경 감지 날짜.
|
||||
- `job_function` (string, 선택): 직무.
|
||||
- `hs_journey_stage` (string, 선택): 여정 단계. 미리 정의된 값 중 하나여야 합니다.
|
||||
- `kloutscoregeneral` (number, 선택): Klout 점수.
|
||||
- `hs_last_metered_enrichment_timestamp` (string, 선택): 마지막 enrichment 타임스탬프.
|
||||
- `hs_latest_source` (string, 선택): 최신 유입 경로.
|
||||
- `hs_latest_source_timestamp` (string, 선택): 최신 유입 경로 날짜.
|
||||
- `hs_legal_basis` (string, 선택): 연락처 데이터 처리를 위한 법적 근거.
|
||||
- `linkedinbio` (string, 선택): LinkedIn 바이오.
|
||||
- `linkedinconnections` (number, 선택): LinkedIn 연결 수.
|
||||
- `hs_linkedin_url` (string, 선택): LinkedIn URL.
|
||||
- `hs_linkedinid` (string, 선택): LinkedIn ID.
|
||||
- `hs_live_enrichment_deadline` (string, 선택): 라이브 enrichment 기한.
|
||||
- `marital_status` (string, 선택): 결혼 상태.
|
||||
- `hs_content_membership_email` (string, 선택): 멤버 이메일.
|
||||
- `hs_content_membership_notes` (string, 선택): 멤버십 노트.
|
||||
- `message` (string, 선택): 메시지.
|
||||
- `military_status` (string, 선택): 군복무 상태.
|
||||
- `mobilephone` (string, 선택): 휴대전화 번호.
|
||||
- `numemployees` (string, 선택): 직원 수.
|
||||
- `hs_analytics_source` (string, 선택): 원래 유입 경로.
|
||||
- `photo` (string, 선택): 사진.
|
||||
- `hs_pinned_engagement_id` (number, 선택): 고정된 참여 ID.
|
||||
- `zip` (string, 선택): 우편번호.
|
||||
- `hs_language` (string, 선택): 선호 언어. 미리 정의된 값 중 하나여야 합니다.
|
||||
- `associatedcompanyid` (number, 선택): 기본 연결된 회사 ID.
|
||||
- `hs_email_optout_survey_reason` (string, 선택): 이메일 수신 거부 사유.
|
||||
- `relationship_status` (string, 선택): 관계 상태.
|
||||
- `hs_returning_to_office_detected_date` (string, 선택): 사무실 복귀 감지 날짜.
|
||||
- `salutation` (string, 선택): 호칭.
|
||||
- `school` (string, 선택): 학교.
|
||||
- `seniority` (string, 선택): 직급.
|
||||
- `hs_feedback_show_nps_web_survey` (boolean, 선택): NPS 웹 설문조사를 표시할지 여부.
|
||||
- `start_date` (string, 선택): 시작일.
|
||||
- `state` (string, 선택): 주/지역.
|
||||
- `hs_state_code` (string, 선택): 주/지역 코드.
|
||||
- `hs_content_membership_status` (string, 선택): 상태.
|
||||
- `address` (string, 선택): 거리 주소.
|
||||
- `tax_exempt` (string, 선택): 세금 면제.
|
||||
- `hs_timezone` (string, 선택): 시간대. 미리 정의된 값 중 하나여야 합니다.
|
||||
- `twitterbio` (string, 선택): 트위터 바이오.
|
||||
- `hs_twitterid` (string, 선택): 트위터 ID.
|
||||
- `twitterprofilephoto` (string, 선택): 트위터 프로필 사진.
|
||||
- `twitterhandle` (string, 선택): 트위터 사용자명.
|
||||
- `vat_number` (string, 선택): 부가가치세 번호.
|
||||
- `ch_verified` (string, 선택): ACH/eCheck 결제 인증됨.
|
||||
- `website` (string, 선택): 웹사이트 URL.
|
||||
- `hs_whatsapp_phone_number` (string, 선택): WhatsApp 전화번호.
|
||||
- `work_email` (string, 선택): 업무용 이메일.
|
||||
- `hs_googleplusid` (string, 선택): googleplus ID.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="HUBSPOT_CREATE_RECORD_DEALS">
|
||||
**설명:** HubSpot에서 새로운 거래(deal) 레코드를 생성합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `dealname` (string, 필수): 거래 이름.
|
||||
- `amount` (number, 선택): 거래 금액.
|
||||
- `dealstage` (string, 선택): 거래의 파이프라인 단계.
|
||||
- `pipeline` (string, 선택): 거래가 속한 파이프라인.
|
||||
- `closedate` (string, 선택): 예상 마감일.
|
||||
- `hubspot_owner_id` (string, 선택): 거래 소유자.
|
||||
- `dealtype` (string, 선택): 거래 유형. 사용 가능한 값: `newbusiness`, `existingbusiness`.
|
||||
- `description` (string, 선택): 거래 설명.
|
||||
- `hs_priority` (string, 선택): 거래 우선순위. 사용 가능한 값: `low`, `medium`, `high`.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="HUBSPOT_CREATE_RECORD_ENGAGEMENTS">
|
||||
**설명:** HubSpot에서 새로운 참여(예: 노트, 이메일, 통화, 미팅, 작업)를 생성합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `engagementType` (string, 필수): 참여 유형. 사용 가능한 값: `NOTE`, `EMAIL`, `CALL`, `MEETING`, `TASK`.
|
||||
- `hubspot_owner_id` (string, 선택): 이 활동이 할당된 사용자.
|
||||
- `hs_timestamp` (string, 선택): 활동 날짜 및 시간.
|
||||
- `hs_note_body` (string, 선택): 노트 본문. (`NOTE`에서 사용)
|
||||
- `hs_task_subject` (string, 선택): 작업 제목. (`TASK`에서 사용)
|
||||
- `hs_task_body` (string, 선택): 작업 노트. (`TASK`에서 사용)
|
||||
- `hs_task_status` (string, 선택): 작업 상태. (`TASK`에서 사용)
|
||||
- `hs_meeting_title` (string, 선택): 미팅 제목. (`MEETING`에서 사용)
|
||||
- `hs_meeting_body` (string, 선택): 미팅 설명. (`MEETING`에서 사용)
|
||||
- `hs_meeting_start_time` (string, 선택): 미팅 시작 시간. (`MEETING`에서 사용)
|
||||
- `hs_meeting_end_time` (string, 선택): 미팅 종료 시간. (`MEETING`에서 사용)
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="HUBSPOT_UPDATE_RECORD_COMPANIES">
|
||||
**설명:** HubSpot에서 기존 회사 레코드를 업데이트합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `recordId` (string, 필수): 업데이트할 회사의 ID.
|
||||
- `name` (string, 선택): 회사명.
|
||||
- `domain` (string, 선택): 회사 도메인명.
|
||||
- `industry` (string, 선택): 산업군.
|
||||
- `phone` (string, 선택): 전화번호.
|
||||
- `city` (string, 선택): 도시.
|
||||
- `state` (string, 선택): 주/지역.
|
||||
- `zip` (string, 선택): 우편번호.
|
||||
- `numberofemployees` (number, 선택): 직원 수.
|
||||
- `annualrevenue` (number, 선택): 연간 매출.
|
||||
- `description` (string, 선택): 설명.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="HUBSPOT_CREATE_RECORD_ANY">
|
||||
**설명:** HubSpot에서 지정된 오브젝트 타입의 레코드를 생성합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `recordType` (string, 필수): 커스텀 오브젝트의 오브젝트 타입 ID.
|
||||
- 추가 파라미터는 커스텀 오브젝트의 스키마에 따라 다릅니다.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="HUBSPOT_UPDATE_RECORD_CONTACTS">
|
||||
**설명:** HubSpot에서 기존 연락처 레코드를 업데이트합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `recordId` (string, 필수): 업데이트할 연락처의 ID.
|
||||
- `firstname` (string, 선택): 이름.
|
||||
- `lastname` (string, 선택): 성.
|
||||
- `email` (string, 선택): 이메일 주소.
|
||||
- `phone` (string, 선택): 전화번호.
|
||||
- `company` (string, 선택): 회사명.
|
||||
- `jobtitle` (string, 선택): 직책.
|
||||
- `lifecyclestage` (string, 선택): 라이프사이클 단계.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="HUBSPOT_UPDATE_RECORD_DEALS">
|
||||
**설명:** HubSpot에서 기존 거래 레코드를 업데이트합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `recordId` (string, 필수): 업데이트할 거래의 ID.
|
||||
- `dealname` (string, 선택): 거래 이름.
|
||||
- `amount` (number, 선택): 거래 금액.
|
||||
- `dealstage` (string, 선택): 거래의 파이프라인 단계.
|
||||
- `pipeline` (string, 선택): 거래가 속한 파이프라인.
|
||||
- `closedate` (string, 선택): 예상 마감일.
|
||||
- `dealtype` (string, 선택): 거래 유형.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="HUBSPOT_UPDATE_RECORD_ENGAGEMENTS">
|
||||
**설명:** HubSpot에서 기존 참여(engagement)를 업데이트합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `recordId` (string, 필수): 업데이트할 참여의 ID.
|
||||
- `hs_note_body` (string, 선택): 노트 본문.
|
||||
- `hs_task_subject` (string, 선택): 작업 제목.
|
||||
- `hs_task_body` (string, 선택): 작업 노트.
|
||||
- `hs_task_status` (string, 선택): 작업 상태.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="HUBSPOT_UPDATE_RECORD_ANY">
|
||||
**설명:** HubSpot에서 지정된 오브젝트 타입의 레코드를 업데이트합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `recordId` (string, 필수): 업데이트할 레코드의 ID.
|
||||
- `recordType` (string, 필수): 커스텀 오브젝트의 오브젝트 타입 ID.
|
||||
- 추가 파라미터는 커스텀 오브젝트의 스키마에 따라 다릅니다.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="HUBSPOT_GET_RECORDS_COMPANIES">
|
||||
**설명:** HubSpot에서 회사 레코드 목록을 가져옵니다.
|
||||
|
||||
**파라미터:**
|
||||
- `paginationParameters` (object, 선택): 다음 페이지를 가져오려면 `pageCursor`를 사용하세요.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="HUBSPOT_GET_RECORDS_CONTACTS">
|
||||
**설명:** HubSpot에서 연락처 레코드 목록을 가져옵니다.
|
||||
|
||||
**파라미터:**
|
||||
- `paginationParameters` (object, 선택): 다음 페이지를 가져오려면 `pageCursor`를 사용하세요.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="HUBSPOT_GET_RECORDS_DEALS">
|
||||
**설명:** HubSpot에서 거래 레코드 목록을 가져옵니다.
|
||||
|
||||
**파라미터:**
|
||||
- `paginationParameters` (object, 선택): 다음 페이지를 가져오려면 `pageCursor`를 사용하세요.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="HUBSPOT_GET_RECORDS_ENGAGEMENTS">
|
||||
**설명:** HubSpot에서 참여(engagement) 레코드 목록을 가져옵니다.
|
||||
|
||||
**파라미터:**
|
||||
- `objectName` (string, 필수): 가져올 참여 유형(예: "notes").
|
||||
- `paginationParameters` (object, 선택): 다음 페이지를 가져오려면 `pageCursor`를 사용하세요.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="HUBSPOT_GET_RECORDS_ANY">
|
||||
**설명:** HubSpot에서 지정된 오브젝트 타입의 레코드 목록을 가져옵니다.
|
||||
|
||||
**파라미터:**
|
||||
- `recordType` (string, 필수): 커스텀 오브젝트의 오브젝트 타입 ID.
|
||||
- `paginationParameters` (object, 선택): 다음 페이지를 가져오려면 `pageCursor`를 사용하세요.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="HUBSPOT_GET_RECORD_BY_ID_COMPANIES">
|
||||
**설명:** ID로 단일 회사 레코드를 가져옵니다.
|
||||
|
||||
**파라미터:**
|
||||
- `recordId` (string, 필수): 가져올 회사의 ID.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="HUBSPOT_GET_RECORD_BY_ID_CONTACTS">
|
||||
**설명:** ID로 단일 연락처 레코드를 가져옵니다.
|
||||
|
||||
**파라미터:**
|
||||
- `recordId` (string, 필수): 가져올 연락처의 ID.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="HUBSPOT_GET_RECORD_BY_ID_DEALS">
|
||||
**설명:** ID로 단일 거래 레코드를 가져옵니다.
|
||||
|
||||
**파라미터:**
|
||||
- `recordId` (string, 필수): 가져올 거래의 ID.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="HUBSPOT_GET_RECORD_BY_ID_ENGAGEMENTS">
|
||||
**설명:** ID로 단일 참여(engagement) 레코드를 가져옵니다.
|
||||
|
||||
**파라미터:**
|
||||
- `recordId` (string, 필수): 가져올 참여의 ID.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="HUBSPOT_GET_RECORD_BY_ID_ANY">
|
||||
**설명:** 지정된 오브젝트 타입의 단일 레코드를 ID로 가져옵니다.
|
||||
|
||||
**파라미터:**
|
||||
- `recordType` (string, 필수): 커스텀 오브젝트의 오브젝트 타입 ID.
|
||||
- `recordId` (string, 필수): 가져올 레코드의 ID.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="HUBSPOT_SEARCH_RECORDS_COMPANIES">
|
||||
**설명:** 필터 수식을 사용해 HubSpot에서 회사 레코드를 검색합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `filterFormula` (object, 선택): 분리 정규형(OR of ANDs) 필터.
|
||||
- `paginationParameters` (object, 선택): 다음 페이지를 가져오려면 `pageCursor`를 사용하세요.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="HUBSPOT_SEARCH_RECORDS_CONTACTS">
|
||||
**설명:** 필터 수식을 사용해 HubSpot에서 연락처 레코드를 검색합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `filterFormula` (object, 선택): 분리 정규형(OR of ANDs) 필터.
|
||||
- `paginationParameters` (object, 선택): 다음 페이지를 가져오려면 `pageCursor`를 사용하세요.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="HUBSPOT_SEARCH_RECORDS_DEALS">
|
||||
**설명:** 필터 수식을 사용해 HubSpot에서 거래 레코드를 검색합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `filterFormula` (object, 선택): 분리 정규형(OR of ANDs) 필터.
|
||||
- `paginationParameters` (object, 선택): 다음 페이지를 가져오려면 `pageCursor`를 사용하세요.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="HUBSPOT_SEARCH_RECORDS_ENGAGEMENTS">
|
||||
**설명:** 필터 수식을 사용해 HubSpot에서 참여(engagement) 레코드를 검색합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `engagementFilterFormula` (object, 선택): 참여 필터.
|
||||
- `paginationParameters` (object, 선택): 다음 페이지를 가져오려면 `pageCursor`를 사용하세요.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="HUBSPOT_SEARCH_RECORDS_ANY">
|
||||
**설명:** HubSpot에서 지정된 오브젝트 타입의 레코드를 검색합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `recordType` (string, 필수): 검색할 오브젝트 타입 ID.
|
||||
- `filterFormula` (string, 선택): 적용할 필터 수식.
|
||||
- `paginationParameters` (object, 선택): 다음 페이지를 가져오려면 `pageCursor`를 사용하세요.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="HUBSPOT_DELETE_RECORD_COMPANIES">
|
||||
**설명:** ID로 회사 레코드를 삭제합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `recordId` (string, 필수): 삭제할 회사의 ID.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="HUBSPOT_DELETE_RECORD_CONTACTS">
|
||||
**설명:** ID로 연락처 레코드를 삭제합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `recordId` (string, 필수): 삭제할 연락처의 ID.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="HUBSPOT_DELETE_RECORD_DEALS">
|
||||
**설명:** ID로 거래 레코드를 삭제합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `recordId` (string, 필수): 삭제할 거래의 ID.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="HUBSPOT_DELETE_RECORD_ENGAGEMENTS">
|
||||
**설명:** ID로 참여(engagement) 레코드를 삭제합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `recordId` (string, 필수): 삭제할 참여의 ID.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="HUBSPOT_DELETE_RECORD_ANY">
|
||||
**설명:** 지정된 오브젝트 타입의 레코드를 ID로 삭제합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `recordType` (string, 필수): 커스텀 오브젝트의 오브젝트 타입 ID.
|
||||
- `recordId` (string, 필수): 삭제할 레코드의 ID.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="HUBSPOT_GET_CONTACTS_BY_LIST_ID">
|
||||
**설명:** 지정된 리스트 ID로부터 연락처 목록을 가져옵니다.
|
||||
|
||||
**파라미터:**
|
||||
- `listId` (string, 필수): 연락처를 가져올 리스트의 ID.
|
||||
- `paginationParameters` (object, 선택): 이후 페이지를 위해 `pageCursor` 사용.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="HUBSPOT_DESCRIBE_ACTION_SCHEMA">
|
||||
**설명:** 특정 오브젝트 타입 및 작업에 대한 예상 스키마를 가져옵니다.
|
||||
|
||||
**파라미터:**
|
||||
- `recordType` (string, 필수): 오브젝트 타입 ID(예: 'companies').
|
||||
- `operation` (string, 필수): 작업 유형(예: 'CREATE_RECORD').
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
## 사용 예시
|
||||
|
||||
### 기본 HubSpot 에이전트 설정
|
||||
|
||||
```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()
|
||||
```
|
||||
|
||||
### 특정 HubSpot 도구 필터링
|
||||
|
||||
```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()
|
||||
```
|
||||
|
||||
### 연락처 관리
|
||||
|
||||
```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()
|
||||
```
|
||||
|
||||
### 도움 받기
|
||||
|
||||
<Card title="도움이 필요하신가요?" icon="headset" href="mailto:support@crewai.com">
|
||||
HubSpot 연동 설정 또는 문제 해결에 도움이 필요하시면 지원팀에 문의해 주세요.
|
||||
</Card>
|
||||
394
docs/ko/enterprise/integrations/jira.mdx
Normal file
@@ -0,0 +1,394 @@
|
||||
---
|
||||
title: Jira 연동
|
||||
description: "CrewAI를 위한 Jira 연동을 통한 이슈 추적 및 프로젝트 관리."
|
||||
icon: "bug"
|
||||
---
|
||||
|
||||
## 개요
|
||||
|
||||
에이전트가 Jira를 통해 이슈, 프로젝트, 워크플로우를 관리할 수 있도록 합니다. 이슈를 생성 및 업데이트하고, 프로젝트 진행 상황을 추적하며, 할당 작업을 관리하고, AI 기반 자동화로 프로젝트 관리를 효율화하세요.
|
||||
|
||||
## 사전 준비 사항
|
||||
|
||||
Jira 통합을 사용하기 전에 다음을 준비하세요:
|
||||
|
||||
- 활성 구독이 있는 [CrewAI Enterprise](https://app.crewai.com) 계정
|
||||
- 적절한 프로젝트 권한이 있는 Jira 계정
|
||||
- [통합 페이지](https://app.crewai.com/crewai_plus/connectors)를 통해 Jira 계정 연결
|
||||
|
||||
## Jira 연동 설정
|
||||
|
||||
### 1. Jira 계정 연결하기
|
||||
|
||||
1. [CrewAI Enterprise Integrations](https://app.crewai.com/crewai_plus/connectors)로 이동합니다.
|
||||
2. **Jira**를 인증 통합 섹션에서 찾습니다.
|
||||
3. **Connect**를 클릭하고 OAuth 절차를 완료합니다.
|
||||
4. 이슈 및 프로젝트 관리를 위한 필요한 권한을 부여합니다.
|
||||
5. [Account Settings](https://app.crewai.com/crewai_plus/settings/account)에서 Enterprise Token을 복사합니다.
|
||||
|
||||
### 2. 필수 패키지 설치
|
||||
|
||||
```bash
|
||||
uv add crewai-tools
|
||||
```
|
||||
|
||||
## 사용 가능한 작업
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="JIRA_CREATE_ISSUE">
|
||||
**설명:** Jira에서 이슈를 생성합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `summary` (string, 필수): 요약 - 이슈에 대한 간단한 한 줄 요약입니다. (예시: "프린터가 작동을 멈췄습니다").
|
||||
- `project` (string, 선택): 프로젝트 - 이슈가 속한 프로젝트입니다. 제공되지 않으면 사용자의 첫 번째 프로젝트로 기본 설정됩니다. 사용자가 프로젝트를 선택할 수 있도록 Connect Portal Workflow Settings를 사용하세요.
|
||||
- `issueType` (string, 선택): 이슈 유형 - 제공되지 않으면 기본값은 Task입니다.
|
||||
- `jiraIssueStatus` (string, 선택): 상태 - 제공되지 않으면 프로젝트의 첫 번째 상태가 기본입니다.
|
||||
- `assignee` (string, 선택): 담당자 - 제공되지 않으면 인증된 사용자로 기본 설정됩니다.
|
||||
- `descriptionType` (string, 선택): 설명 유형 - 설명 유형을 선택하세요.
|
||||
- 옵션: `description`, `descriptionJSON`
|
||||
- `description` (string, 선택): 설명 - 이슈에 대한 자세한 설명입니다. 이 필드는 'descriptionType'이 'description'일 때만 나타납니다.
|
||||
- `additionalFields` (string, 선택): 추가 필드 - 포함해야 하는 다른 필드를 JSON 형식으로 지정하세요. 사용자가 업데이트할 이슈 필드를 선택할 수 있도록 Connect Portal Workflow Settings를 사용하세요.
|
||||
```json
|
||||
{
|
||||
"customfield_10001": "value"
|
||||
}
|
||||
```
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="JIRA_UPDATE_ISSUE">
|
||||
**설명:** Jira에서 이슈를 업데이트합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `issueKey` (string, 필수): 이슈 키 (예시: "TEST-1234").
|
||||
- `summary` (string, 선택): 요약 - 이슈에 대한 간단한 한 줄 요약입니다. (예시: "프린터가 작동을 멈췄습니다").
|
||||
- `issueType` (string, 선택): 이슈 유형 - 사용자가 이슈 유형을 선택할 수 있도록 Connect Portal Workflow Settings를 사용하세요.
|
||||
- `jiraIssueStatus` (string, 선택): 상태 - 사용자가 상태를 선택할 수 있도록 Connect Portal Workflow Settings를 사용하세요.
|
||||
- `assignee` (string, 선택): 담당자 - 사용자가 담당자를 선택할 수 있도록 Connect Portal Workflow Settings를 사용하세요.
|
||||
- `descriptionType` (string, 선택): 설명 유형 - 설명 유형을 선택하세요.
|
||||
- 옵션: `description`, `descriptionJSON`
|
||||
- `description` (string, 선택): 설명 - 이슈에 대한 자세한 설명입니다. 이 필드는 'descriptionType'이 'description'일 때만 나타납니다.
|
||||
- `additionalFields` (string, 선택): 추가 필드 - 포함해야 하는 다른 필드를 JSON 형식으로 지정하세요.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="JIRA_GET_ISSUE_BY_KEY">
|
||||
**설명:** Jira에서 키로 이슈를 조회합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `issueKey` (string, 필수): 이슈 키 (예시: "TEST-1234").
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="JIRA_FILTER_ISSUES">
|
||||
**설명:** 필터를 사용하여 Jira에서 이슈를 검색합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `jqlQuery` (object, 선택): 불리언 합정규형(OR의 AND 그룹)으로 구성된 필터.
|
||||
```json
|
||||
{
|
||||
"operator": "OR",
|
||||
"conditions": [
|
||||
{
|
||||
"operator": "AND",
|
||||
"conditions": [
|
||||
{
|
||||
"field": "status",
|
||||
"operator": "$stringExactlyMatches",
|
||||
"value": "Open"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
사용 가능한 연산자: `$stringExactlyMatches`, `$stringDoesNotExactlyMatch`, `$stringIsIn`, `$stringIsNotIn`, `$stringContains`, `$stringDoesNotContain`, `$stringGreaterThan`, `$stringLessThan`
|
||||
- `limit` (string, 선택): 결과 제한 - 반환되는 최대 이슈 수를 제한합니다. 입력하지 않으면 기본값은 10입니다.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="JIRA_SEARCH_BY_JQL">
|
||||
**설명:** Jira에서 JQL로 이슈를 검색합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `jqlQuery` (string, 필수): JQL 쿼리 (예시: "project = PROJECT").
|
||||
- `paginationParameters` (object, 선택): 페이지네이션 결과를 위한 파라미터.
|
||||
```json
|
||||
{
|
||||
"pageCursor": "cursor_string"
|
||||
}
|
||||
```
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="JIRA_UPDATE_ISSUE_ANY">
|
||||
**설명:** Jira에서 임의의 이슈를 업데이트합니다. 이 기능의 속성 스키마를 얻으려면 DESCRIBE_ACTION_SCHEMA를 사용하세요.
|
||||
|
||||
**파라미터:** 특정 파라미터 없음 - 예상 스키마를 먼저 확인하려면 JIRA_DESCRIBE_ACTION_SCHEMA를 사용하세요.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="JIRA_DESCRIBE_ACTION_SCHEMA">
|
||||
**설명:** 이슈 유형에 대한 예상 스키마를 가져옵니다. 사용하려는 이슈 유형과 일치하는 다른 기능이 없을 경우 먼저 이 기능을 사용하세요.
|
||||
|
||||
**파라미터:**
|
||||
- `issueTypeId` (string, 필수): 이슈 유형 ID.
|
||||
- `projectKey` (string, 필수): 프로젝트 키.
|
||||
- `operation` (string, 필수): 작업 유형 값(예: CREATE_ISSUE 또는 UPDATE_ISSUE).
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="JIRA_GET_PROJECTS">
|
||||
**설명:** Jira에서 프로젝트를 가져옵니다.
|
||||
|
||||
**파라미터:**
|
||||
- `paginationParameters` (object, 선택): 페이지네이션 파라미터.
|
||||
```json
|
||||
{
|
||||
"pageCursor": "cursor_string"
|
||||
}
|
||||
```
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="JIRA_GET_ISSUE_TYPES_BY_PROJECT">
|
||||
**설명:** Jira에서 프로젝트별 이슈 유형을 조회합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `project` (string, 필수): 프로젝트 키.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="JIRA_GET_ISSUE_TYPES">
|
||||
**설명:** Jira에서 모든 이슈 유형을 조회합니다.
|
||||
|
||||
**파라미터:** 필요 없음.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="JIRA_GET_ISSUE_STATUS_BY_PROJECT">
|
||||
**설명:** 주어진 프로젝트의 이슈 상태를 조회합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `project` (string, 필수): 프로젝트 키.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="JIRA_GET_ALL_ASSIGNEES_BY_PROJECT">
|
||||
**설명:** 주어진 프로젝트의 담당자 목록을 조회합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `project` (string, 필수): 프로젝트 키.
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
## 사용 예시
|
||||
|
||||
### 기본 Jira 에이전트 설정
|
||||
|
||||
```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()
|
||||
```
|
||||
|
||||
### 특정 Jira 도구 필터링
|
||||
|
||||
```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()
|
||||
```
|
||||
|
||||
### 프로젝트 분석 및 보고
|
||||
|
||||
```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()
|
||||
```
|
||||
|
||||
### 자동화된 이슈 관리
|
||||
|
||||
```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()
|
||||
```
|
||||
|
||||
### 고급 스키마 기반 작업
|
||||
|
||||
```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. 모든 프로젝트와 해당 커스텀 이슈 유형을 가져옵니다
|
||||
2. 각 커스텀 이슈 유형에 대해, 액션 스키마를 설명합니다
|
||||
3. 복잡한 커스텀 필드를 위한 동적 스키마를 사용해 이슈를 생성합니다
|
||||
4. 비즈니스 규칙에 따라 커스텀 필드 값을 사용해 이슈를 업데이트합니다
|
||||
""",
|
||||
agent=schema_specialist,
|
||||
expected_output="동적 스키마를 사용하여 커스텀 이슈가 생성되고 업데이트됨"
|
||||
)
|
||||
|
||||
crew = Crew(
|
||||
agents=[schema_specialist],
|
||||
tasks=[schema_task]
|
||||
)
|
||||
|
||||
crew.kickoff()
|
||||
```
|
||||
|
||||
## 문제 해결
|
||||
|
||||
### 일반적인 문제
|
||||
|
||||
**권한 오류**
|
||||
- Jira 계정이 대상 프로젝트에 필요한 권한을 가지고 있는지 확인하세요
|
||||
- OAuth 연결에 Jira API에 필요한 범위가 포함되어 있는지 확인하세요
|
||||
- 지정된 프로젝트에서 이슈 생성/편집 권한이 있는지 확인하세요
|
||||
|
||||
**잘못된 프로젝트 또는 이슈 키**
|
||||
- 프로젝트 키와 이슈 키가 올바른 형식(예: "PROJ-123")인지 다시 확인하세요
|
||||
- 프로젝트가 존재하며 계정으로 접근 가능한지 확인하세요
|
||||
- 이슈 키가 실제로 존재하는 이슈를 참조하는지 확인하세요
|
||||
|
||||
**이슈 유형 및 상태 관련 문제**
|
||||
- 프로젝트에 대한 유효한 이슈 유형을 얻으려면 JIRA_GET_ISSUE_TYPES_BY_PROJECT를 사용하세요
|
||||
- 유효한 상태를 얻으려면 JIRA_GET_ISSUE_STATUS_BY_PROJECT를 사용하세요
|
||||
- 이슈 유형과 상태가 대상 프로젝트에 제공되는지 확인하세요
|
||||
|
||||
**JQL 쿼리 문제**
|
||||
- API 호출에 사용하기 전에 Jira의 이슈 검색에서 JQL 쿼리를 테스트하세요
|
||||
- JQL에 사용된 필드명이 정확하게 철자되어 있고, Jira 인스턴스에 존재하는지 확인하세요
|
||||
- 복잡한 쿼리에는 올바른 JQL 문법을 사용하세요
|
||||
|
||||
**커스텀 필드 및 스키마 문제**
|
||||
- 복잡한 이슈 유형에 대해 올바른 스키마를 얻으려면 JIRA_DESCRIBE_ACTION_SCHEMA를 사용하세요
|
||||
- 커스텀 필드 ID가 정확한지 확인하세요 (예: "customfield_10001")
|
||||
- 커스텀 필드가 대상 프로젝트와 이슈 유형에서 사용 가능한지 확인하세요
|
||||
|
||||
**필터 공식 문제**
|
||||
- 필터 공식이 올바른 JSON 구조(불리언 합의 정규형)를 따르는지 확인하세요
|
||||
- Jira 구성에 존재하는 유효한 필드명을 사용하세요
|
||||
- 복잡한 다중 조건 쿼리를 만들기 전에 간단한 필터를 테스트하세요
|
||||
|
||||
### 도움 받기
|
||||
|
||||
<Card title="도움이 필요하신가요?" icon="headset" href="mailto:support@crewai.com">
|
||||
Jira 연동 설정 또는 문제 해결에 대한 지원이 필요하시면 저희 지원팀에 문의하십시오.
|
||||
</Card>
|
||||
453
docs/ko/enterprise/integrations/linear.mdx
Normal file
@@ -0,0 +1,453 @@
|
||||
---
|
||||
title: Linear 연동
|
||||
description: "CrewAI를 위한 Linear 연동을 통한 소프트웨어 프로젝트 및 버그 추적."
|
||||
icon: "list-check"
|
||||
---
|
||||
|
||||
## 개요
|
||||
|
||||
에이전트가 Linear를 통해 이슈, 프로젝트, 개발 워크플로우를 관리할 수 있도록 지원합니다. 이슈를 생성 및 업데이트하고, 프로젝트 타임라인을 관리하며, 팀을 조직하고, AI 기반 자동화로 소프트웨어 개발 프로세스를 간소화할 수 있습니다.
|
||||
|
||||
## 필수 조건
|
||||
|
||||
Linear 통합을 사용하기 전에 다음을 확인하세요:
|
||||
|
||||
- 활성 구독이 있는 [CrewAI Enterprise](https://app.crewai.com) 계정
|
||||
- 적절한 워크스페이스 권한이 있는 Linear 계정
|
||||
- [통합 페이지](https://app.crewai.com/crewai_plus/connectors)에서 Linear 계정 연결
|
||||
|
||||
## 리니어 통합 설정
|
||||
|
||||
### 1. Linear 계정 연결하기
|
||||
|
||||
1. [CrewAI Enterprise Integrations](https://app.crewai.com/crewai_plus/connectors)로 이동합니다.
|
||||
2. 인증 통합( Authentication Integrations ) 섹션에서 **Linear**를 찾습니다.
|
||||
3. **Connect**를 클릭하고 OAuth 절차를 완료합니다.
|
||||
4. 이슈 및 프로젝트 관리를 위한 필수 권한을 부여합니다.
|
||||
5. [계정 설정](https://app.crewai.com/crewai_plus/settings/account)에서 Enterprise Token을 복사합니다.
|
||||
|
||||
### 2. 필수 패키지 설치
|
||||
|
||||
```bash
|
||||
uv add crewai-tools
|
||||
```
|
||||
|
||||
## 사용 가능한 작업
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="LINEAR_CREATE_ISSUE">
|
||||
**설명:** Linear에서 새로운 이슈를 생성합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `teamId` (string, 필수): 팀 ID - 이 새로운 이슈의 상위 팀 ID를 지정합니다. Connect Portal Workflow Settings를 사용하여 사용자가 팀 ID를 선택할 수 있도록 하세요. (예: "a70bdf0f-530a-4887-857d-46151b52b47c").
|
||||
- `title` (string, 필수): 제목 - 이 이슈의 제목을 지정합니다.
|
||||
- `description` (string, 선택): 설명 - 이 이슈의 설명을 지정합니다.
|
||||
- `statusId` (string, 선택): 상태 - 이 이슈의 상태를 지정합니다.
|
||||
- `priority` (string, 선택): 우선순위 - 이 이슈의 우선순위를 정수로 지정합니다.
|
||||
- `dueDate` (string, 선택): 마감일 - 이 이슈의 마감일을 ISO 8601 형식으로 지정합니다.
|
||||
- `cycleId` (string, 선택): 사이클 ID - 이 이슈가 속한 사이클을 지정합니다.
|
||||
- `additionalFields` (object, 선택): 추가 필드.
|
||||
```json
|
||||
{
|
||||
"assigneeId": "a70bdf0f-530a-4887-857d-46151b52b47c",
|
||||
"labelIds": ["a70bdf0f-530a-4887-857d-46151b52b47c"]
|
||||
}
|
||||
```
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="LINEAR_UPDATE_ISSUE">
|
||||
**설명:** Linear에서 이슈를 업데이트합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `issueId` (string, 필수): 이슈 ID - 업데이트할 이슈의 ID를 지정합니다. (예: "90fbc706-18cd-42c9-ae66-6bd344cc8977").
|
||||
- `title` (string, 선택): 제목 - 이 이슈의 제목을 지정합니다.
|
||||
- `description` (string, 선택): 설명 - 이 이슈의 설명을 지정합니다.
|
||||
- `statusId` (string, 선택): 상태 - 이 이슈의 상태를 지정합니다.
|
||||
- `priority` (string, 선택): 우선순위 - 이 이슈의 우선순위를 정수로 지정합니다.
|
||||
- `dueDate` (string, 선택): 마감일 - 이 이슈의 마감일을 ISO 8601 형식으로 지정합니다.
|
||||
- `cycleId` (string, 선택): 사이클 ID - 이 이슈가 속한 사이클을 지정합니다.
|
||||
- `additionalFields` (object, 선택): 추가 필드.
|
||||
```json
|
||||
{
|
||||
"assigneeId": "a70bdf0f-530a-4887-857d-46151b52b47c",
|
||||
"labelIds": ["a70bdf0f-530a-4887-857d-46151b52b47c"]
|
||||
}
|
||||
```
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="LINEAR_GET_ISSUE_BY_ID">
|
||||
**설명:** Linear에서 ID로 이슈를 가져옵니다.
|
||||
|
||||
**파라미터:**
|
||||
- `issueId` (string, 필수): 이슈 ID - 가져올 이슈의 레코드 ID를 지정합니다. (예: "90fbc706-18cd-42c9-ae66-6bd344cc8977").
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="LINEAR_GET_ISSUE_BY_ISSUE_IDENTIFIER">
|
||||
**설명:** Linear에서 이슈 식별자로 이슈를 가져옵니다.
|
||||
|
||||
**파라미터:**
|
||||
- `externalId` (string, 필수): 외부 ID - 가져올 이슈의 사람이 읽을 수 있는 이슈 식별자를 지정합니다. (예: "ABC-1").
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="LINEAR_SEARCH_ISSUE">
|
||||
**설명:** Linear에서 이슈를 검색합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `queryTerm` (string, 필수): 검색어 - 찾을 검색어입니다.
|
||||
- `issueFilterFormula` (object, 선택): 부정합적 정규형(DNF)의 필터 - 단일 조건의 AND 그룹들에 대한 OR.
|
||||
```json
|
||||
{
|
||||
"operator": "OR",
|
||||
"conditions": [
|
||||
{
|
||||
"operator": "AND",
|
||||
"conditions": [
|
||||
{
|
||||
"field": "title",
|
||||
"operator": "$stringContains",
|
||||
"value": "bug"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
사용 가능한 필드: `title`, `number`, `project`, `createdAt`
|
||||
사용 가능한 연산자: `$stringExactlyMatches`, `$stringDoesNotExactlyMatch`, `$stringIsIn`, `$stringIsNotIn`, `$stringStartsWith`, `$stringDoesNotStartWith`, `$stringEndsWith`, `$stringDoesNotEndWith`, `$stringContains`, `$stringDoesNotContain`, `$stringGreaterThan`, `$stringLessThan`, `$numberGreaterThanOrEqualTo`, `$numberLessThanOrEqualTo`, `$numberGreaterThan`, `$numberLessThan`, `$dateTimeAfter`, `$dateTimeBefore`
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="LINEAR_DELETE_ISSUE">
|
||||
**설명:** Linear에서 이슈를 삭제합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `issueId` (string, 필수): 이슈 ID - 삭제할 이슈의 레코드 ID를 지정합니다. (예: "90fbc706-18cd-42c9-ae66-6bd344cc8977").
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="LINEAR_ARCHIVE_ISSUE">
|
||||
**설명:** Linear에서 이슈를 아카이브합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `issueId` (string, 필수): 이슈 ID - 아카이브할 이슈의 레코드 ID를 지정합니다. (예: "90fbc706-18cd-42c9-ae66-6bd344cc8977").
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="LINEAR_CREATE_SUB_ISSUE">
|
||||
**설명:** Linear에서 하위 이슈를 생성합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `parentId` (string, 필수): 상위 ID - 이 새로운 이슈의 상위 이슈 ID를 지정합니다.
|
||||
- `teamId` (string, 필수): 팀 ID - 이 새로운 하위 이슈의 상위 팀 ID를 지정합니다. Connect Portal Workflow Settings를 사용하여 사용자가 팀 ID를 선택할 수 있도록 하세요. (예: "a70bdf0f-530a-4887-857d-46151b52b47c").
|
||||
- `title` (string, 필수): 제목 - 이 이슈의 제목을 지정합니다.
|
||||
- `description` (string, 선택): 설명 - 이 이슈의 설명을 지정합니다.
|
||||
- `additionalFields` (object, 선택): 추가 필드.
|
||||
```json
|
||||
{
|
||||
"lead": "linear_user_id"
|
||||
}
|
||||
```
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="LINEAR_CREATE_PROJECT">
|
||||
**설명:** Linear에서 새로운 프로젝트를 생성합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `teamIds` (object, 필수): 팀 ID - 이 프로젝트와 연관된 팀 ID 혹은 팀 ID의 JSON 배열을 문자열로 지정합니다. Connect Portal User Settings를 사용하여 사용자가 팀 ID를 선택할 수 있도록 하세요.
|
||||
```json
|
||||
[
|
||||
"a70bdf0f-530a-4887-857d-46151b52b47c",
|
||||
"4ac7..."
|
||||
]
|
||||
```
|
||||
- `projectName` (string, 필수): 프로젝트 이름 - 프로젝트의 이름을 지정합니다. (예: "My Linear Project").
|
||||
- `description` (string, 선택): 프로젝트 설명 - 프로젝트에 대한 설명을 지정합니다.
|
||||
- `additionalFields` (object, 선택): 추가 필드.
|
||||
```json
|
||||
{
|
||||
"state": "planned",
|
||||
"description": ""
|
||||
}
|
||||
```
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="LINEAR_UPDATE_PROJECT">
|
||||
**설명:** Linear에서 프로젝트를 업데이트합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `projectId` (string, 필수): 프로젝트 ID - 업데이트할 프로젝트의 ID를 지정합니다. (예: "a6634484-6061-4ac7-9739-7dc5e52c796b").
|
||||
- `projectName` (string, 선택): 프로젝트 이름 - 업데이트할 프로젝트의 이름을 지정합니다. (예: "My Linear Project").
|
||||
- `description` (string, 선택): 프로젝트 설명 - 프로젝트에 대한 설명을 지정합니다.
|
||||
- `additionalFields` (object, 선택): 추가 필드.
|
||||
```json
|
||||
{
|
||||
"state": "planned",
|
||||
"description": ""
|
||||
}
|
||||
```
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="LINEAR_GET_PROJECT_BY_ID">
|
||||
**설명:** Linear에서 ID로 프로젝트를 가져옵니다.
|
||||
|
||||
**파라미터:**
|
||||
- `projectId` (string, 필수): 프로젝트 ID - 가져올 프로젝트의 프로젝트 ID를 지정합니다. (예: "a6634484-6061-4ac7-9739-7dc5e52c796b").
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="LINEAR_DELETE_PROJECT">
|
||||
**설명:** Linear에서 프로젝트를 삭제합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `projectId` (string, 필수): 프로젝트 ID - 삭제할 프로젝트의 프로젝트 ID를 지정합니다. (예: "a6634484-6061-4ac7-9739-7dc5e52c796b").
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="LINEAR_SEARCH_TEAMS">
|
||||
**설명:** Linear에서 팀을 검색합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `teamFilterFormula` (object, 선택): 부정합적 정규형(DNF)의 필터 - 단일 조건의 AND 그룹들에 대한 OR.
|
||||
```json
|
||||
{
|
||||
"operator": "OR",
|
||||
"conditions": [
|
||||
{
|
||||
"operator": "AND",
|
||||
"conditions": [
|
||||
{
|
||||
"field": "name",
|
||||
"operator": "$stringContains",
|
||||
"value": "Engineering"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
사용 가능한 필드: `id`, `name`
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
## 사용 예시
|
||||
|
||||
### 기본 Linear 에이전트 설정
|
||||
|
||||
```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()
|
||||
```
|
||||
|
||||
### 특정 Linear 도구 필터링
|
||||
|
||||
```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()
|
||||
```
|
||||
|
||||
### 프로젝트 및 팀 관리
|
||||
|
||||
```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()
|
||||
```
|
||||
|
||||
### 이슈 계층 구조 및 하위 작업 관리
|
||||
|
||||
```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. 세분화가 필요한 대형 기능 이슈를 검색합니다
|
||||
2. 각 복잡한 이슈에 대해 다양한 컴포넌트별로 하위 이슈를 생성합니다
|
||||
3. 부모 이슈를 적절한 설명과 하위 이슈에 대한 링크로 업데이트합니다
|
||||
4. 전문성에 따라 적합한 팀원에게 하위 이슈를 할당합니다
|
||||
""",
|
||||
agent=task_organizer,
|
||||
expected_output="복잡한 이슈가 적절히 할당된 관리 가능한 하위 작업 단위로 분해됨"
|
||||
)
|
||||
|
||||
crew = Crew(
|
||||
agents=[task_organizer],
|
||||
tasks=[hierarchy_task]
|
||||
)
|
||||
|
||||
crew.kickoff()
|
||||
```
|
||||
|
||||
### 자동화된 개발 워크플로우
|
||||
|
||||
```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. 7일 이상 진행 중인 이슈를 검색합니다
|
||||
2. 마감일과 프로젝트 중요도에 따라 우선순위를 업데이트합니다
|
||||
3. 각 팀을 위한 주간 스프린트 계획 이슈를 생성합니다
|
||||
4. 이전 사이클에서 완료된 이슈를 보관합니다
|
||||
5. 프로젝트 상태 보고서를 새로운 이슈로 생성합니다
|
||||
""",
|
||||
agent=workflow_automator,
|
||||
expected_output="우선순위, 스프린트 계획, 상태 보고서가 업데이트된 자동화된 개발 워크플로우"
|
||||
)
|
||||
|
||||
crew = Crew(
|
||||
agents=[workflow_automator],
|
||||
tasks=[automation_task]
|
||||
)
|
||||
|
||||
crew.kickoff()
|
||||
```
|
||||
|
||||
## 문제 해결
|
||||
|
||||
### 일반적인 문제
|
||||
|
||||
**권한 오류**
|
||||
- Linear 계정이 대상 워크스페이스에 필요한 권한을 가지고 있는지 확인하세요
|
||||
- OAuth 연결에 Linear API에 필요한 스코프가 포함되어 있는지 확인하세요
|
||||
- 워크스페이스에서 이슈 및 프로젝트를 생성/편집할 권한이 있는지 확인하세요
|
||||
|
||||
**잘못된 ID 및 참조**
|
||||
- 팀 ID, 이슈 ID, 프로젝트 ID가 올바른 UUID 형식인지 다시 한번 확인하세요
|
||||
- 참조된 엔티티(팀, 프로젝트, 사이클)가 존재하며 접근 가능한지 확인하세요
|
||||
- 이슈 식별자가 올바른 형식(예: "ABC-1")을 따르는지 검증하세요
|
||||
|
||||
**팀 및 프로젝트 연관 문제**
|
||||
- 이슈나 프로젝트를 생성하기 전에 LINEAR_SEARCH_TEAMS를 사용하여 유효한 팀 ID를 조회하세요
|
||||
- 워크스페이스 내에 팀이 존재하고 활성화되어 있는지 확인하세요
|
||||
- 팀 ID가 올바르게 UUID 형식으로 구성되어 있는지 검증하세요
|
||||
|
||||
**이슈 상태 및 우선순위 문제**
|
||||
- 상태 ID가 팀의 유효한 워크플로우 상태를 참조하는지 확인하세요
|
||||
- 우선순위 값이 Linear 구성에서 허용된 범위 내에 있는지 확인하세요
|
||||
- 참조하기 전에 사용자 지정 필드와 라벨이 존재하는지 검증하세요
|
||||
|
||||
**날짜 및 시간 형식 문제**
|
||||
- 마감일 및 타임스탬프에 ISO 8601 형식을 사용하세요
|
||||
- 마감일 계산 시 타임존을 올바로 처리하는지 확인하세요
|
||||
- 마감일의 날짜 값이 유효하며 미래인지 검증하세요
|
||||
|
||||
**검색 및 필터 문제**
|
||||
- 검색 쿼리가 올바르게 형식화되어 있으며 비어 있지 않은지 확인하세요
|
||||
- 필터 공식에서 유효한 필드 이름을 사용하세요: `title`, `number`, `project`, `createdAt`
|
||||
- 복잡한 다중 조건 쿼리를 만들기 전에 단순한 필터를 먼저 테스트해 보세요
|
||||
- 연산자 타입이 필터링 대상 필드의 데이터 타입과 일치하는지 확인하세요
|
||||
|
||||
**서브이슈 생성 문제**
|
||||
- 상위 이슈 ID가 유효하고 접근 가능한지 확인하세요
|
||||
- 서브이슈의 팀 ID가 상위 이슈 팀과 일치하거나 호환되는지 검증하세요
|
||||
- 상위 이슈가 이미 보관/삭제되지 않았는지 확인하세요
|
||||
|
||||
### 도움 받기
|
||||
|
||||
<Card title="도움이 필요하신가요?" icon="headset" href="mailto:support@crewai.com">
|
||||
Linear 연동 설정 또는 문제 해결에 대해 지원팀에 문의하세요.
|
||||
</Card>
|
||||
509
docs/ko/enterprise/integrations/notion.mdx
Normal file
@@ -0,0 +1,509 @@
|
||||
---
|
||||
title: Notion 연동
|
||||
description: "CrewAI를 위한 Notion 연동을 통한 페이지 및 데이터베이스 관리."
|
||||
icon: "book"
|
||||
---
|
||||
|
||||
## 개요
|
||||
|
||||
에이전트가 Notion을 통해 페이지, 데이터베이스, 콘텐츠를 관리할 수 있도록 지원합니다. 페이지 생성 및 업데이트, 콘텐츠 블록 관리, 지식 베이스 구성, AI 기반 자동화를 통해 문서화 작업 흐름을 효율화할 수 있습니다.
|
||||
|
||||
## 필수 조건
|
||||
|
||||
Notion 통합을 사용하기 전에 다음을 확인하세요:
|
||||
|
||||
- 활성 구독이 있는 [CrewAI Enterprise](https://app.crewai.com) 계정
|
||||
- 적절한 워크스페이스 권한이 있는 Notion 계정
|
||||
- [통합 페이지](https://app.crewai.com/crewai_plus/connectors)를 통해 Notion 계정을 연결함
|
||||
|
||||
## Notion 연동 설정
|
||||
|
||||
### 1. Notion 계정 연결하기
|
||||
|
||||
1. [CrewAI Enterprise Integrations](https://app.crewai.com/crewai_plus/connectors)로 이동합니다.
|
||||
2. 인증 통합(Auhtentication Integrations) 섹션에서 **Notion**을(를) 찾습니다.
|
||||
3. **Connect**를 클릭하고 OAuth 플로우를 완료합니다.
|
||||
4. 페이지 및 데이터베이스 관리를 위한 필요한 권한을 부여합니다.
|
||||
5. [Account Settings](https://app.crewai.com/crewai_plus/settings/account)에서 Enterprise Token을 복사합니다.
|
||||
|
||||
### 2. 필수 패키지 설치
|
||||
|
||||
```bash
|
||||
uv add crewai-tools
|
||||
```
|
||||
|
||||
## 사용 가능한 액션
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="NOTION_CREATE_PAGE">
|
||||
**설명:** Notion에서 페이지를 생성합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `parent` (object, 필수): 상위 - 새 페이지가 삽입될 상위 페이지 또는 데이터베이스를 나타내는 JSON 객체로, page_id 또는 database_id 키를 포함합니다.
|
||||
```json
|
||||
{
|
||||
"database_id": "DATABASE_ID"
|
||||
}
|
||||
```
|
||||
- `properties` (object, 필수): 속성 - 페이지 속성의 값입니다. 상위가 데이터베이스인 경우, 스키마는 상위 데이터베이스의 속성과 일치해야 합니다.
|
||||
```json
|
||||
{
|
||||
"title": [
|
||||
{
|
||||
"text": {
|
||||
"content": "My Page"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
- `icon` (object, 필수): 아이콘 - 페이지 아이콘입니다.
|
||||
```json
|
||||
{
|
||||
"emoji": "🥬"
|
||||
}
|
||||
```
|
||||
- `children` (object, 선택): 자식 - 페이지에 추가할 콘텐츠 블록입니다.
|
||||
```json
|
||||
[
|
||||
{
|
||||
"object": "block",
|
||||
"type": "heading_2",
|
||||
"heading_2": {
|
||||
"rich_text": [
|
||||
{
|
||||
"type": "text",
|
||||
"text": {
|
||||
"content": "Lacinato kale"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
```
|
||||
- `cover` (object, 선택): 표지 - 페이지 표지 이미지입니다.
|
||||
```json
|
||||
{
|
||||
"external": {
|
||||
"url": "https://upload.wikimedia.org/wikipedia/commons/6/62/Tuscankale.jpg"
|
||||
}
|
||||
}
|
||||
```
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="NOTION_UPDATE_PAGE">
|
||||
**설명:** Notion에서 페이지를 업데이트합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `pageId` (string, 필수): 페이지 ID - 업데이트할 페이지의 ID를 지정합니다. (예: "59833787-2cf9-4fdf-8782-e53db20768a5").
|
||||
- `icon` (object, 필수): 아이콘 - 페이지 아이콘입니다.
|
||||
```json
|
||||
{
|
||||
"emoji": "🥬"
|
||||
}
|
||||
```
|
||||
- `archived` (boolean, 선택): 보관됨 - 페이지가 보관(삭제)되었는지 여부입니다. true로 설정하면 페이지를 보관합니다. false로 설정하면 보관 해제(복원)합니다.
|
||||
- `properties` (object, 선택): 속성 - 페이지에서 업데이트할 속성 값입니다.
|
||||
```json
|
||||
{
|
||||
"title": [
|
||||
{
|
||||
"text": {
|
||||
"content": "My Updated Page"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
- `cover` (object, 선택): 표지 - 페이지 표지 이미지입니다.
|
||||
```json
|
||||
{
|
||||
"external": {
|
||||
"url": "https://upload.wikimedia.org/wikipedia/commons/6/62/Tuscankale.jpg"
|
||||
}
|
||||
}
|
||||
```
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="NOTION_GET_PAGE_BY_ID">
|
||||
**설명:** Notion에서 ID로 페이지를 가져옵니다.
|
||||
|
||||
**파라미터:**
|
||||
- `pageId` (string, 필수): 페이지 ID - 가져올 페이지의 ID를 지정합니다. (예: "59833787-2cf9-4fdf-8782-e53db20768a5").
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="NOTION_ARCHIVE_PAGE">
|
||||
**설명:** Notion에서 페이지를 보관합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `pageId` (string, 필수): 페이지 ID - 보관할 페이지의 ID를 지정합니다. (예: "59833787-2cf9-4fdf-8782-e53db20768a5").
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="NOTION_SEARCH_PAGES">
|
||||
**설명:** 필터를 사용하여 Notion에서 페이지를 검색합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `searchByTitleFilterSearch` (object, 선택): 불리언 정규형(OR 조건 그룹의 AND 그룹) 형태의 필터입니다.
|
||||
```json
|
||||
{
|
||||
"operator": "OR",
|
||||
"conditions": [
|
||||
{
|
||||
"operator": "AND",
|
||||
"conditions": [
|
||||
{
|
||||
"field": "query",
|
||||
"operator": "$stringExactlyMatches",
|
||||
"value": "meeting notes"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
사용 가능한 필드: `query`, `filter.value`, `direction`, `page_size`
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="NOTION_GET_PAGE_CONTENT">
|
||||
**설명:** Notion에서 페이지 콘텐츠(블록)를 가져옵니다.
|
||||
|
||||
**파라미터:**
|
||||
- `blockId` (string, 필수): 페이지 ID - 해당 블록이나 페이지의 모든 자식 블록을 순서대로 가져오기 위해 Block 또는 Page ID를 지정합니다. (예: "59833787-2cf9-4fdf-8782-e53db20768a5").
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="NOTION_UPDATE_BLOCK">
|
||||
**설명:** Notion에서 블록을 업데이트합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `blockId` (string, 필수): 블록 ID - 업데이트할 블록의 ID를 지정합니다. (예: "9bc30ad4-9373-46a5-84ab-0a7845ee52e6").
|
||||
- `archived` (boolean, 선택): 보관됨 - true로 설정하면 블록을 보관(삭제)합니다. false로 설정하면 보관 해제(복원)합니다.
|
||||
- `paragraph` (object, 선택): 단락 콘텐츠.
|
||||
```json
|
||||
{
|
||||
"rich_text": [
|
||||
{
|
||||
"type": "text",
|
||||
"text": {
|
||||
"content": "Lacinato kale",
|
||||
"link": null
|
||||
}
|
||||
}
|
||||
],
|
||||
"color": "default"
|
||||
}
|
||||
```
|
||||
- `image` (object, 선택): 이미지 블록.
|
||||
```json
|
||||
{
|
||||
"type": "external",
|
||||
"external": {
|
||||
"url": "https://website.domain/images/image.png"
|
||||
}
|
||||
}
|
||||
```
|
||||
- `bookmark` (object, 선택): 북마크 블록.
|
||||
```json
|
||||
{
|
||||
"caption": [],
|
||||
"url": "https://companywebsite.com"
|
||||
}
|
||||
```
|
||||
- `code` (object, 선택): 코드 블록.
|
||||
```json
|
||||
{
|
||||
"rich_text": [
|
||||
{
|
||||
"type": "text",
|
||||
"text": {
|
||||
"content": "const a = 3"
|
||||
}
|
||||
}
|
||||
],
|
||||
"language": "javascript"
|
||||
}
|
||||
```
|
||||
- `pdf` (object, 선택): PDF 블록.
|
||||
```json
|
||||
{
|
||||
"type": "external",
|
||||
"external": {
|
||||
"url": "https://website.domain/files/doc.pdf"
|
||||
}
|
||||
}
|
||||
```
|
||||
- `table` (object, 선택): 테이블 블록.
|
||||
```json
|
||||
{
|
||||
"table_width": 2,
|
||||
"has_column_header": false,
|
||||
"has_row_header": false
|
||||
}
|
||||
```
|
||||
- `tableOfContent` (object, 선택): 목차 블록.
|
||||
```json
|
||||
{
|
||||
"color": "default"
|
||||
}
|
||||
```
|
||||
- `additionalFields` (object, 선택): 추가 블록 유형.
|
||||
```json
|
||||
{
|
||||
"child_page": {
|
||||
"title": "Lacinato kale"
|
||||
},
|
||||
"child_database": {
|
||||
"title": "My database"
|
||||
}
|
||||
}
|
||||
```
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="NOTION_GET_BLOCK_BY_ID">
|
||||
**설명:** Notion에서 ID로 블록을 가져옵니다.
|
||||
|
||||
**파라미터:**
|
||||
- `blockId` (string, 필수): 블록 ID - 가져올 블록의 ID를 지정합니다. (예: "9bc30ad4-9373-46a5-84ab-0a7845ee52e6").
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="NOTION_DELETE_BLOCK">
|
||||
**설명:** Notion에서 블록을 삭제합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `blockId` (string, 필수): 블록 ID - 삭제할 블록의 ID를 지정합니다. (예: "9bc30ad4-9373-46a5-84ab-0a7845ee52e6").
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
## 사용 예시
|
||||
|
||||
### 기본 Notion Agent 설정
|
||||
|
||||
```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()
|
||||
```
|
||||
|
||||
### 특정 Notion 도구 필터링
|
||||
|
||||
```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()
|
||||
```
|
||||
|
||||
### 지식 베이스 관리
|
||||
|
||||
```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. 새로운 제품 기능과 관련된 기존 문서 페이지를 검색합니다.
|
||||
2. 적절한 구조로 포괄적인 기능 문서 페이지를 생성합니다.
|
||||
3. 코드 예제, 이미지 및 관련 리소스에 대한 링크를 추가합니다.
|
||||
4. 기존 페이지를 업데이트하여 새 문서에 대한 교차 참조를 추가합니다.
|
||||
""",
|
||||
agent=knowledge_curator,
|
||||
expected_output="Feature documentation created and integrated with existing knowledge base"
|
||||
)
|
||||
|
||||
crew = Crew(
|
||||
agents=[knowledge_curator],
|
||||
tasks=[curation_task]
|
||||
)
|
||||
|
||||
crew.kickoff()
|
||||
```
|
||||
|
||||
### 콘텐츠 구조 및 구성
|
||||
|
||||
```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()
|
||||
```
|
||||
|
||||
### 자동화된 문서화 워크플로우
|
||||
|
||||
```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. 최근 30일 이내에 업데이트되지 않은 페이지 검색
|
||||
2. 오래된 콘텐츠 블록 검토 및 업데이트
|
||||
3. 일관된 포맷으로 주간 팀 업데이트 페이지 생성
|
||||
4. 프로젝트 페이지에 상태 표시기 및 진행 상황 추적 추가
|
||||
5. 월간 문서 헬스 리포트 생성
|
||||
6. 완료된 프로젝트 페이지를 아카이브 섹션에 정리 및 보관
|
||||
""",
|
||||
agent=doc_automator,
|
||||
expected_output="업데이트된 콘텐츠, 주간 리포트, 정리된 아카이브로 문서화 자동화 완료"
|
||||
)
|
||||
|
||||
crew = Crew(
|
||||
agents=[doc_automator],
|
||||
tasks=[automation_task]
|
||||
)
|
||||
|
||||
crew.kickoff()
|
||||
```
|
||||
|
||||
## 문제 해결
|
||||
|
||||
### 일반적인 문제
|
||||
|
||||
**권한 오류**
|
||||
- Notion 계정이 대상 워크스페이스에 대한 편집 권한이 있는지 확인하세요
|
||||
- OAuth 연결에 Notion API에 필요한 범위가 포함되어 있는지 확인하세요
|
||||
- 페이지와 데이터베이스가 인증된 통합에 공유되어 있는지 확인하세요
|
||||
|
||||
**잘못된 페이지 및 블록 ID**
|
||||
- 페이지 ID 및 블록 ID가 올바른 UUID 형식인지 다시 확인하세요
|
||||
- 참조되는 페이지와 블록이 존재하고 접근 가능한지 확인하세요
|
||||
- 새 페이지를 생성할 때 상위 페이지 또는 데이터베이스 ID가 유효한지 검증하세요
|
||||
|
||||
**속성 스키마 문제**
|
||||
- 데이터베이스에 페이지를 생성할 때 페이지 속성이 데이터베이스 스키마와 일치하는지 확인하세요
|
||||
- 대상 데이터베이스에 대해 속성 이름과 타입이 올바른지 확인하세요
|
||||
- 페이지를 생성하거나 업데이트할 때 필수 속성이 포함되어 있는지 확인하세요
|
||||
|
||||
**콘텐츠 블록 구조**
|
||||
- 블록 콘텐츠가 Notion의 리치 텍스트 형식 사양을 따르는지 확인하세요
|
||||
- 중첩된 블록 구조가 올바르게 포맷되어 있는지 확인하세요
|
||||
- 미디어 URL이 접근 가능하며 올바른 형식인지 확인하세요
|
||||
|
||||
**검색 및 필터 문제**
|
||||
- 검색 쿼리가 올바르게 포맷되어 있고 비어 있지 않은지 확인하세요
|
||||
- 필터 공식에서 유효한 필드명을 사용하세요: `query`, `filter.value`, `direction`, `page_size`
|
||||
- 복잡한 필터 조건을 만들기 전에 간단한 검색을 테스트하세요
|
||||
|
||||
**상위-하위 관계**
|
||||
- 하위 페이지를 생성하기 전에 상위 페이지 또는 데이터베이스가 존재하는지 확인하세요
|
||||
- 상위 컨테이너에 대한 적절한 권한이 있는지 확인하세요
|
||||
- 데이터베이스 스키마가 설정하려는 속성을 허용하는지 확인하세요
|
||||
|
||||
**리치 텍스트 및 미디어 콘텐츠**
|
||||
- 외부 이미지, PDF, 북마크의 URL이 접근 가능한지 확인하세요
|
||||
- 리치 텍스트 포매팅이 Notion의 API 사양을 따르는지 확인하세요
|
||||
- 코드 블록의 언어 타입이 Notion에서 지원되는지 확인하세요
|
||||
|
||||
**아카이브 및 삭제 작업**
|
||||
- 아카이브(복구 가능)와 삭제(영구적)의 차이를 이해하세요
|
||||
- 대상 콘텐츠를 아카이브 또는 삭제할 수 있는 권한이 있는지 확인하세요
|
||||
- 여러 페이지 또는 블록에 영향을 줄 수 있는 대량 작업은 신중히 진행하세요
|
||||
|
||||
### 도움 받기
|
||||
|
||||
<Card title="도움이 필요하신가요?" icon="headset" href="mailto:support@crewai.com">
|
||||
Notion 연동 설정 또는 문제 해결에 대해 지원팀에 문의해 주세요.
|
||||
</Card>
|
||||
632
docs/ko/enterprise/integrations/salesforce.mdx
Normal file
@@ -0,0 +1,632 @@
|
||||
---
|
||||
title: Salesforce 통합
|
||||
description: "CrewAI를 위한 Salesforce 통합을 통한 CRM 및 영업 자동화."
|
||||
icon: "salesforce"
|
||||
---
|
||||
|
||||
## 개요
|
||||
|
||||
에이전트가 Salesforce를 통해 고객 관계, 영업 프로세스 및 데이터를 관리할 수 있도록 합니다. 레코드를 생성 및 업데이트하고, 리드와 기회를 관리하며, SOQL 쿼리를 실행하고, AI 기반 자동화로 CRM 워크플로를 간소화하세요.
|
||||
|
||||
## 사전 준비 사항
|
||||
|
||||
Salesforce 통합을 사용하기 전에 다음을 확인하세요:
|
||||
|
||||
- 활성 구독이 있는 [CrewAI Enterprise](https://app.crewai.com) 계정
|
||||
- 적절한 권한이 있는 Salesforce 계정
|
||||
- [통합 페이지](https://app.crewai.com/integrations)를 통해 Salesforce 계정 연결
|
||||
|
||||
## 사용 가능한 도구
|
||||
|
||||
### **레코드 관리**
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="SALESFORCE_CREATE_RECORD_CONTACT">
|
||||
**설명:** Salesforce에서 새로운 Contact 레코드를 생성합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `FirstName` (string, 선택): 이름
|
||||
- `LastName` (string, 필수): 성 - 이 필드는 필수입니다
|
||||
- `accountId` (string, 선택): Account ID - 이 Contact가 소속된 Account
|
||||
- `Email` (string, 선택): 이메일 주소
|
||||
- `Title` (string, 선택): 담당자의 직함(예: CEO 또는 Vice President 등)
|
||||
- `Description` (string, 선택): Contact에 대한 설명
|
||||
- `additionalFields` (object, 선택): 사용자 정의 Contact 필드를 위한 JSON 형식의 추가 필드
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="SALESFORCE_CREATE_RECORD_LEAD">
|
||||
**설명:** Salesforce에서 새로운 Lead 레코드를 생성합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `FirstName` (string, 선택): 이름
|
||||
- `LastName` (string, 필수): 성 - 이 필드는 필수입니다
|
||||
- `Company` (string, 필수): 회사명 - 이 필드는 필수입니다
|
||||
- `Email` (string, 선택): 이메일 주소
|
||||
- `Phone` (string, 선택): 전화번호
|
||||
- `Website` (string, 선택): 웹사이트 URL
|
||||
- `Title` (string, 선택): 담당자의 직함(예: CEO 또는 Vice President 등)
|
||||
- `Status` (string, 선택): 리드 상태 - 리드 상태를 선택하려면 Connect Portal Workflow 설정을 사용하세요
|
||||
- `Description` (string, 선택): Lead에 대한 설명
|
||||
- `additionalFields` (object, 선택): 사용자 정의 Lead 필드를 위한 JSON 형식의 추가 필드
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="SALESFORCE_CREATE_RECORD_OPPORTUNITY">
|
||||
**설명:** Salesforce에서 새로운 Opportunity 레코드를 생성합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `Name` (string, 필수): Opportunity 이름 - 이 필드는 필수입니다
|
||||
- `StageName` (string, 선택): Opportunity 단계 - 단계를 선택하려면 Connect Portal Workflow 설정을 사용하세요
|
||||
- `CloseDate` (string, 선택): 마감일(YYYY-MM-DD 형식) - 기본값은 현재 날짜로부터 30일 이후
|
||||
- `AccountId` (string, 선택): 이 Opportunity가 소속된 Account
|
||||
- `Amount` (string, 선택): 예상 전체 판매 금액
|
||||
- `Description` (string, 선택): Opportunity에 대한 설명
|
||||
- `OwnerId` (string, 선택): 이 Opportunity를 담당하는 Salesforce 사용자
|
||||
- `NextStep` (string, 선택): Opportunity 마감을 위한 다음 작업의 설명
|
||||
- `additionalFields` (object, 선택): 사용자 정의 Opportunity 필드를 위한 JSON 형식의 추가 필드
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="SALESFORCE_CREATE_RECORD_TASK">
|
||||
**설명:** Salesforce에서 새로운 Task 레코드를 생성합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `whatId` (string, 선택): 관련 ID - 이 Task가 관련된 Account 또는 Opportunity의 ID
|
||||
- `whoId` (string, 선택): 이름 ID - 이 Task가 관련된 Contact 또는 Lead의 ID
|
||||
- `subject` (string, 필수): 작업 제목
|
||||
- `activityDate` (string, 선택): 작업 날짜(YYYY-MM-DD 형식)
|
||||
- `description` (string, 선택): Task에 대한 설명
|
||||
- `taskSubtype` (string, 필수): Task 하위 유형 - 선택 항목: task, email, listEmail, call
|
||||
- `Status` (string, 선택): 상태 - 선택 항목: Not Started, In Progress, Completed
|
||||
- `ownerId` (string, 선택): 담당자 ID - 이 Task를 담당하는 Salesforce 사용자
|
||||
- `callDurationInSeconds` (string, 선택): 통화 시간(초)
|
||||
- `isReminderSet` (boolean, 선택): 알림 설정 여부
|
||||
- `reminderDateTime` (string, 선택): 알림 날짜/시간(ISO 형식)
|
||||
- `additionalFields` (object, 선택): 사용자 정의 Task 필드를 위한 JSON 형식의 추가 필드
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="SALESFORCE_CREATE_RECORD_ACCOUNT">
|
||||
**설명:** Salesforce에서 새로운 Account 레코드를 생성합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `Name` (string, 필수): Account 이름 - 이 필드는 필수입니다
|
||||
- `OwnerId` (string, 선택): 이 Account를 담당하는 Salesforce 사용자
|
||||
- `Website` (string, 선택): 웹사이트 URL
|
||||
- `Phone` (string, 선택): 전화번호
|
||||
- `Description` (string, 선택): Account 설명
|
||||
- `additionalFields` (object, 선택): 사용자 정의 Account 필드를 위한 JSON 형식의 추가 필드
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="SALESFORCE_CREATE_RECORD_ANY">
|
||||
**설명:** Salesforce에서 모든 오브젝트 유형의 레코드를 생성합니다.
|
||||
|
||||
**참고:** 이 기능은 사용자 정의 또는 알려지지 않은 오브젝트 유형의 레코드를 생성할 때 유연하게 사용할 수 있습니다.
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
### **레코드 업데이트**
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="SALESFORCE_UPDATE_RECORD_CONTACT">
|
||||
**설명:** Salesforce에서 기존 연락처(Contact) 레코드를 업데이트합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `recordId` (string, 필수): 업데이트할 레코드의 ID
|
||||
- `FirstName` (string, 선택): 이름
|
||||
- `LastName` (string, 선택): 성
|
||||
- `accountId` (string, 선택): 계정 ID - 연락처가 속한 계정
|
||||
- `Email` (string, 선택): 이메일 주소
|
||||
- `Title` (string, 선택): 연락처의 직함
|
||||
- `Description` (string, 선택): 연락처에 대한 설명
|
||||
- `additionalFields` (object, 선택): 커스텀 연락처 필드를 위한 JSON 형식의 추가 필드
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="SALESFORCE_UPDATE_RECORD_LEAD">
|
||||
**설명:** Salesforce에서 기존 리드(Lead) 레코드를 업데이트합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `recordId` (string, 필수): 업데이트할 레코드의 ID
|
||||
- `FirstName` (string, 선택): 이름
|
||||
- `LastName` (string, 선택): 성
|
||||
- `Company` (string, 선택): 회사명
|
||||
- `Email` (string, 선택): 이메일 주소
|
||||
- `Phone` (string, 선택): 전화번호
|
||||
- `Website` (string, 선택): 웹사이트 URL
|
||||
- `Title` (string, 선택): 연락처의 직함
|
||||
- `Status` (string, 선택): 리드 상태
|
||||
- `Description` (string, 선택): 리드에 대한 설명
|
||||
- `additionalFields` (object, 선택): 커스텀 리드 필드를 위한 JSON 형식의 추가 필드
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="SALESFORCE_UPDATE_RECORD_OPPORTUNITY">
|
||||
**설명:** Salesforce에서 기존 기회(Opportunity) 레코드를 업데이트합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `recordId` (string, 필수): 업데이트할 레코드의 ID
|
||||
- `Name` (string, 선택): 기회명
|
||||
- `StageName` (string, 선택): 기회 단계
|
||||
- `CloseDate` (string, 선택): 마감 날짜 (YYYY-MM-DD 형식)
|
||||
- `AccountId` (string, 선택): 기회가 속한 계정
|
||||
- `Amount` (string, 선택): 예상 총 판매 금액
|
||||
- `Description` (string, 선택): 기회에 대한 설명
|
||||
- `OwnerId` (string, 선택): 이 기회를 담당하는 Salesforce 사용자
|
||||
- `NextStep` (string, 선택): 기회 마감을 위한 다음 작업의 설명
|
||||
- `additionalFields` (object, 선택): 커스텀 기회 필드를 위한 JSON 형식의 추가 필드
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="SALESFORCE_UPDATE_RECORD_TASK">
|
||||
**설명:** Salesforce에서 기존 작업(Task) 레코드를 업데이트합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `recordId` (string, 필수): 업데이트할 레코드의 ID
|
||||
- `whatId` (string, 선택): 관련 ID - 이 작업이 연결된 계정 또는 기회의 ID
|
||||
- `whoId` (string, 선택): 이름 ID - 이 작업이 연결된 연락처 또는 리드의 ID
|
||||
- `subject` (string, 선택): 작업의 주제
|
||||
- `activityDate` (string, 선택): 활동 날짜 (YYYY-MM-DD 형식)
|
||||
- `description` (string, 선택): 작업에 대한 설명
|
||||
- `Status` (string, 선택): 상태 - 옵션: Not Started, In Progress, Completed
|
||||
- `ownerId` (string, 선택): 담당자 ID - 이 작업을 할당받은 Salesforce 사용자
|
||||
- `callDurationInSeconds` (string, 선택): 통화 시간(초)
|
||||
- `isReminderSet` (boolean, 선택): 알림 설정 여부
|
||||
- `reminderDateTime` (string, 선택): 알림 날짜/시간 (ISO 형식)
|
||||
- `additionalFields` (object, 선택): 커스텀 작업 필드를 위한 JSON 형식의 추가 필드
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="SALESFORCE_UPDATE_RECORD_ACCOUNT">
|
||||
**설명:** Salesforce에서 기존 계정(Account) 레코드를 업데이트합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `recordId` (string, 필수): 업데이트할 레코드의 ID
|
||||
- `Name` (string, 선택): 계정 이름
|
||||
- `OwnerId` (string, 선택): 이 계정에 할당된 Salesforce 사용자
|
||||
- `Website` (string, 선택): 웹사이트 URL
|
||||
- `Phone` (string, 선택): 전화번호
|
||||
- `Description` (string, 선택): 계정 설명
|
||||
- `additionalFields` (object, 선택): 커스텀 계정 필드를 위한 JSON 형식의 추가 필드
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="SALESFORCE_UPDATE_RECORD_ANY">
|
||||
**설명:** Salesforce에서 어떤 객체 유형이든 레코드를 업데이트합니다.
|
||||
|
||||
**참고:** 이는 커스텀 또는 미확인 객체 유형의 레코드 업데이트를 위한 유연한 도구입니다.
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
### **레코드 조회**
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="SALESFORCE_GET_RECORD_BY_ID_CONTACT">
|
||||
**설명:** ID로 Contact 레코드를 조회합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `recordId` (string, 필수): Contact의 레코드 ID
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="SALESFORCE_GET_RECORD_BY_ID_LEAD">
|
||||
**설명:** ID로 Lead 레코드를 조회합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `recordId` (string, 필수): Lead의 레코드 ID
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="SALESFORCE_GET_RECORD_BY_ID_OPPORTUNITY">
|
||||
**설명:** ID로 Opportunity 레코드를 조회합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `recordId` (string, 필수): Opportunity의 레코드 ID
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="SALESFORCE_GET_RECORD_BY_ID_TASK">
|
||||
**설명:** ID로 Task 레코드를 조회합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `recordId` (string, 필수): Task의 레코드 ID
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="SALESFORCE_GET_RECORD_BY_ID_ACCOUNT">
|
||||
**설명:** ID로 Account 레코드를 조회합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `recordId` (string, 필수): Account의 레코드 ID
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="SALESFORCE_GET_RECORD_BY_ID_ANY">
|
||||
**설명:** ID로 임의 객체 유형의 레코드를 조회합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `recordType` (string, 필수): 레코드 유형 (예: "CustomObject__c")
|
||||
- `recordId` (string, 필수): 레코드 ID
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
### **레코드 검색**
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="SALESFORCE_SEARCH_RECORDS_CONTACT">
|
||||
**설명:** 고급 필터링으로 연락처(Contact) 레코드를 검색합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `filterFormula` (object, 선택): 필드별 연산자가 지정된 분리적 정규형(Disjunctive Normal Form)의 고급 필터
|
||||
- `sortBy` (string, 선택): 정렬 기준 필드 (예: "CreatedDate")
|
||||
- `sortDirection` (string, 선택): 정렬 방향 - 옵션: ASC, DESC
|
||||
- `includeAllFields` (boolean, 선택): 결과에 모든 필드를 포함
|
||||
- `paginationParameters` (object, 선택): pageCursor를 포함한 페이지네이션 설정
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="SALESFORCE_SEARCH_RECORDS_LEAD">
|
||||
**설명:** 고급 필터링으로 리드(Lead) 레코드를 검색합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `filterFormula` (object, 선택): 필드별 연산자가 지정된 분리적 정규형의 고급 필터
|
||||
- `sortBy` (string, 선택): 정렬 기준 필드 (예: "CreatedDate")
|
||||
- `sortDirection` (string, 선택): 정렬 방향 - 옵션: ASC, DESC
|
||||
- `includeAllFields` (boolean, 선택): 결과에 모든 필드를 포함
|
||||
- `paginationParameters` (object, 선택): pageCursor를 포함한 페이지네이션 설정
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="SALESFORCE_SEARCH_RECORDS_OPPORTUNITY">
|
||||
**설명:** 고급 필터링으로 기회(Opportunity) 레코드를 검색합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `filterFormula` (object, 선택): 필드별 연산자가 지정된 분리적 정규형의 고급 필터
|
||||
- `sortBy` (string, 선택): 정렬 기준 필드 (예: "CreatedDate")
|
||||
- `sortDirection` (string, 선택): 정렬 방향 - 옵션: ASC, DESC
|
||||
- `includeAllFields` (boolean, 선택): 결과에 모든 필드를 포함
|
||||
- `paginationParameters` (object, 선택): pageCursor를 포함한 페이지네이션 설정
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="SALESFORCE_SEARCH_RECORDS_TASK">
|
||||
**설명:** 고급 필터링으로 작업(Task) 레코드를 검색합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `filterFormula` (object, 선택): 필드별 연산자가 지정된 분리적 정규형의 고급 필터
|
||||
- `sortBy` (string, 선택): 정렬 기준 필드 (예: "CreatedDate")
|
||||
- `sortDirection` (string, 선택): 정렬 방향 - 옵션: ASC, DESC
|
||||
- `includeAllFields` (boolean, 선택): 결과에 모든 필드를 포함
|
||||
- `paginationParameters` (object, 선택): pageCursor를 포함한 페이지네이션 설정
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="SALESFORCE_SEARCH_RECORDS_ACCOUNT">
|
||||
**설명:** 고급 필터링으로 계정(Account) 레코드를 검색합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `filterFormula` (object, 선택): 필드별 연산자가 지정된 분리적 정규형의 고급 필터
|
||||
- `sortBy` (string, 선택): 정렬 기준 필드 (예: "CreatedDate")
|
||||
- `sortDirection` (string, 선택): 정렬 방향 - 옵션: ASC, DESC
|
||||
- `includeAllFields` (boolean, 선택): 결과에 모든 필드를 포함
|
||||
- `paginationParameters` (object, 선택): pageCursor를 포함한 페이지네이션 설정
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="SALESFORCE_SEARCH_RECORDS_ANY">
|
||||
**설명:** 모든 오브젝트 유형의 레코드를 검색합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `recordType` (string, 필수): 검색할 레코드 유형
|
||||
- `filterFormula` (string, 선택): 필터 검색 조건
|
||||
- `includeAllFields` (boolean, 선택): 결과에 모든 필드를 포함
|
||||
- `paginationParameters` (object, 선택): pageCursor를 포함한 페이지네이션 설정
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
### **리스트 뷰 조회**
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="SALESFORCE_GET_RECORD_BY_VIEW_ID_CONTACT">
|
||||
**설명:** 특정 리스트 뷰에서 Contact 레코드를 가져옵니다.
|
||||
|
||||
**파라미터:**
|
||||
- `listViewId` (string, 필수): 리스트 뷰 ID
|
||||
- `paginationParameters` (object, 선택): pageCursor와 함께 사용하는 페이지네이션 설정
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="SALESFORCE_GET_RECORD_BY_VIEW_ID_LEAD">
|
||||
**설명:** 특정 리스트 뷰에서 Lead 레코드를 가져옵니다.
|
||||
|
||||
**파라미터:**
|
||||
- `listViewId` (string, 필수): 리스트 뷰 ID
|
||||
- `paginationParameters` (object, 선택): pageCursor와 함께 사용하는 페이지네이션 설정
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="SALESFORCE_GET_RECORD_BY_VIEW_ID_OPPORTUNITY">
|
||||
**설명:** 특정 리스트 뷰에서 Opportunity 레코드를 가져옵니다.
|
||||
|
||||
**파라미터:**
|
||||
- `listViewId` (string, 필수): 리스트 뷰 ID
|
||||
- `paginationParameters` (object, 선택): pageCursor와 함께 사용하는 페이지네이션 설정
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="SALESFORCE_GET_RECORD_BY_VIEW_ID_TASK">
|
||||
**설명:** 특정 리스트 뷰에서 Task 레코드를 가져옵니다.
|
||||
|
||||
**파라미터:**
|
||||
- `listViewId` (string, 필수): 리스트 뷰 ID
|
||||
- `paginationParameters` (object, 선택): pageCursor와 함께 사용하는 페이지네이션 설정
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="SALESFORCE_GET_RECORD_BY_VIEW_ID_ACCOUNT">
|
||||
**설명:** 특정 리스트 뷰에서 Account 레코드를 가져옵니다.
|
||||
|
||||
**파라미터:**
|
||||
- `listViewId` (string, 필수): 리스트 뷰 ID
|
||||
- `paginationParameters` (object, 선택): pageCursor와 함께 사용하는 페이지네이션 설정
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="SALESFORCE_GET_RECORD_BY_VIEW_ID_ANY">
|
||||
**설명:** 특정 리스트 뷰에서 임의의 객체 유형의 레코드를 가져옵니다.
|
||||
|
||||
**파라미터:**
|
||||
- `recordType` (string, 필수): 레코드 유형
|
||||
- `listViewId` (string, 필수): 리스트 뷰 ID
|
||||
- `paginationParameters` (object, 선택): pageCursor와 함께 사용하는 페이지네이션 설정
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
### **커스텀 필드**
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="SALESFORCE_CREATE_CUSTOM_FIELD_CONTACT">
|
||||
**설명:** Contact 오브젝트에 대한 커스텀 필드를 배포합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `label` (string, 필수): 표시 및 내부 참조를 위한 필드 라벨
|
||||
- `type` (string, 필수): 필드 유형 - 옵션: Checkbox, Currency, Date, Email, Number, Percent, Phone, Picklist, MultiselectPicklist, Text, TextArea, LongTextArea, Html, Time, Url
|
||||
- `defaultCheckboxValue` (boolean, 선택): 체크박스 필드의 기본값
|
||||
- `length` (string, 필수): 숫자/텍스트 필드의 길이
|
||||
- `decimalPlace` (string, 필수): 숫자 필드의 소수 자릿수
|
||||
- `pickListValues` (string, 필수): 피클리스트 필드의 값(줄바꿈으로 구분)
|
||||
- `visibleLines` (string, 필수): 멀티셀렉트/텍스트 영역 필드의 표시 줄 수
|
||||
- `description` (string, 선택): 필드 설명
|
||||
- `helperText` (string, 선택): 마우스를 올렸을 때 표시되는 도움말 텍스트
|
||||
- `defaultFieldValue` (string, 선택): 필드의 기본값
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="SALESFORCE_CREATE_CUSTOM_FIELD_LEAD">
|
||||
**설명:** Lead 오브젝트에 대한 커스텀 필드를 배포합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `label` (string, 필수): 표시 및 내부 참조를 위한 필드 라벨
|
||||
- `type` (string, 필수): 필드 유형 - 옵션: Checkbox, Currency, Date, Email, Number, Percent, Phone, Picklist, MultiselectPicklist, Text, TextArea, LongTextArea, Html, Time, Url
|
||||
- `defaultCheckboxValue` (boolean, 선택): 체크박스 필드의 기본값
|
||||
- `length` (string, 필수): 숫자/텍스트 필드의 길이
|
||||
- `decimalPlace` (string, 필수): 숫자 필드의 소수 자릿수
|
||||
- `pickListValues` (string, 필수): 피클리스트 필드의 값(줄바꿈으로 구분)
|
||||
- `visibleLines` (string, 필수): 멀티셀렉트/텍스트 영역 필드의 표시 줄 수
|
||||
- `description` (string, 선택): 필드 설명
|
||||
- `helperText` (string, 선택): 마우스를 올렸을 때 표시되는 도움말 텍스트
|
||||
- `defaultFieldValue` (string, 선택): 필드의 기본값
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="SALESFORCE_CREATE_CUSTOM_FIELD_OPPORTUNITY">
|
||||
**설명:** Opportunity 오브젝트에 대한 커스텀 필드를 배포합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `label` (string, 필수): 표시 및 내부 참조를 위한 필드 라벨
|
||||
- `type` (string, 필수): 필드 유형 - 옵션: Checkbox, Currency, Date, Email, Number, Percent, Phone, Picklist, MultiselectPicklist, Text, TextArea, LongTextArea, Html, Time, Url
|
||||
- `defaultCheckboxValue` (boolean, 선택): 체크박스 필드의 기본값
|
||||
- `length` (string, 필수): 숫자/텍스트 필드의 길이
|
||||
- `decimalPlace` (string, 필수): 숫자 필드의 소수 자릿수
|
||||
- `pickListValues` (string, 필수): 피클리스트 필드의 값(줄바꿈으로 구분)
|
||||
- `visibleLines` (string, 필수): 멀티셀렉트/텍스트 영역 필드의 표시 줄 수
|
||||
- `description` (string, 선택): 필드 설명
|
||||
- `helperText` (string, 선택): 마우스를 올렸을 때 표시되는 도움말 텍스트
|
||||
- `defaultFieldValue` (string, 선택): 필드의 기본값
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="SALESFORCE_CREATE_CUSTOM_FIELD_TASK">
|
||||
**설명:** Task 오브젝트에 대한 커스텀 필드를 배포합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `label` (string, 필수): 표시 및 내부 참조를 위한 필드 라벨
|
||||
- `type` (string, 필수): 필드 유형 - 옵션: Checkbox, Currency, Date, Email, Number, Percent, Phone, Picklist, MultiselectPicklist, Text, TextArea, Time, Url
|
||||
- `defaultCheckboxValue` (boolean, 선택): 체크박스 필드의 기본값
|
||||
- `length` (string, 필수): 숫자/텍스트 필드의 길이
|
||||
- `decimalPlace` (string, 필수): 숫자 필드의 소수 자릿수
|
||||
- `pickListValues` (string, 필수): 피클리스트 필드의 값(줄바꿈으로 구분)
|
||||
- `visibleLines` (string, 필수): 멀티셀렉트 필드의 표시 줄 수
|
||||
- `description` (string, 선택): 필드 설명
|
||||
- `helperText` (string, 선택): 마우스를 올렸을 때 표시되는 도움말 텍스트
|
||||
- `defaultFieldValue` (string, 선택): 필드의 기본값
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="SALESFORCE_CREATE_CUSTOM_FIELD_ACCOUNT">
|
||||
**설명:** Account 오브젝트에 대한 커스텀 필드를 배포합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `label` (string, 필수): 표시 및 내부 참조를 위한 필드 라벨
|
||||
- `type` (string, 필수): 필드 유형 - 옵션: Checkbox, Currency, Date, Email, Number, Percent, Phone, Picklist, MultiselectPicklist, Text, TextArea, LongTextArea, Html, Time, Url
|
||||
- `defaultCheckboxValue` (boolean, 선택): 체크박스 필드의 기본값
|
||||
- `length` (string, 필수): 숫자/텍스트 필드의 길이
|
||||
- `decimalPlace` (string, 필수): 숫자 필드의 소수 자릿수
|
||||
- `pickListValues` (string, 필수): 피클리스트 필드의 값(줄바꿈으로 구분)
|
||||
- `visibleLines` (string, 필수): 멀티셀렉트/텍스트 영역 필드의 표시 줄 수
|
||||
- `description` (string, 선택): 필드 설명
|
||||
- `helperText` (string, 선택): 마우스를 올렸을 때 표시되는 도움말 텍스트
|
||||
- `defaultFieldValue` (string, 선택): 필드의 기본값
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="SALESFORCE_CREATE_CUSTOM_FIELD_ANY">
|
||||
**설명:** 모든 오브젝트 타입에 대한 커스텀 필드를 배포합니다.
|
||||
|
||||
**참고:** 커스텀 또는 미지의 오브젝트 타입에 커스텀 필드를 생성할 수 있는 유연한 도구입니다.
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
### **고급 작업**
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="SALESFORCE_WRITE_SOQL_QUERY">
|
||||
**설명:** Salesforce 데이터에 대해 커스텀 SOQL 쿼리를 실행합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `query` (string, 필수): SOQL 쿼리 (예: "SELECT Id, Name FROM Account WHERE Name = 'Example'")
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="SALESFORCE_CREATE_CUSTOM_OBJECT">
|
||||
**설명:** Salesforce에 새로운 커스텀 오브젝트를 배포합니다.
|
||||
|
||||
**파라미터:**
|
||||
- `label` (string, 필수): 탭, 페이지 레이아웃, 리포트에 사용되는 오브젝트 라벨
|
||||
- `pluralLabel` (string, 필수): 복수형 라벨 (예: "Accounts")
|
||||
- `description` (string, 선택): 커스텀 오브젝트에 대한 설명
|
||||
- `recordName` (string, 필수): 레이아웃과 검색에 표시되는 레코드 이름 (예: "Account Name")
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="SALESFORCE_DESCRIBE_ACTION_SCHEMA">
|
||||
**설명:** 특정 오브젝트 타입에 대한 작업의 예상 스키마를 가져옵니다.
|
||||
|
||||
**파라미터:**
|
||||
- `recordType` (string, 필수): 설명할 레코드 타입
|
||||
- `operation` (string, 필수): 작업 타입 (예: "CREATE_RECORD" 또는 "UPDATE_RECORD")
|
||||
|
||||
**참고:** 커스텀 오브젝트 작업 시, 해당 스키마를 이해하기 위해 제일 먼저 이 기능을 사용하세요.
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
## 사용 예시
|
||||
|
||||
### 기본 Salesforce 에이전트 설정
|
||||
|
||||
```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()
|
||||
```
|
||||
|
||||
### 특정 Salesforce 도구 필터링
|
||||
|
||||
```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()
|
||||
```
|
||||
|
||||
### 연락처 및 계정 관리
|
||||
|
||||
```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()
|
||||
```
|
||||
|
||||
### 고급 SOQL 쿼리 및 리포팅
|
||||
|
||||
```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()
|
||||
```
|
||||
|
||||
이 포괄적인 문서는 모든 Salesforce 도구를 기능별로 정리하여, 사용자가 CRM 자동화 작업에 필요한 특정 작업을 쉽게 찾을 수 있도록 도와줍니다.
|
||||
|
||||
### 도움 받기
|
||||
|
||||
<Card title="도움이 필요하신가요?" icon="headset" href="mailto:support@crewai.com">
|
||||
Salesforce 통합 설정 또는 문제 해결에 대해 지원팀에 문의하세요.
|
||||
</Card>
|
||||