Repository navigation
docs: updates quickstart on crew flow - #1928
Conversation
…Agents starter repo option to focus on CrewAI Enterprise flows - Eliminate Cloud vs Self-hosted choice, use Cloud only - Streamline code along path with simple component example - Add complete working CrewAI Flow component with background action - Move Copilot Cloud connection step to beginning for clarity - Update gif reference to crewai-flow-cpk-setup.gif
…wai-flows to registry.json - Add crewai flows page component with background action - Add public registry file for crewai flows - Add crewai-flow-cpk-setup.gif for documentation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
WalkthroughThe quickstart documentation for integrating CrewAI Flows with CopilotKit was rewritten to provide a more streamlined onboarding experience, focusing on Copilot Cloud integration and a complete React example. New registry files and a React component were added to serve as a functional quickstart chat UI with dynamic background changes triggered by AI actions. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant ReactApp
participant CopilotKitProvider
participant CopilotChat
participant CrewAI Flow (via Copilot Cloud)
User->>ReactApp: Loads CrewAIFlow component
ReactApp->>CopilotKitProvider: Initializes with publicApiKey and agent
ReactApp->>CopilotChat: Renders chat UI
User->>CopilotChat: Sends message
CopilotChat->>CrewAI Flow (via Copilot Cloud): Forwards message
CrewAI Flow (via Copilot Cloud)->>CopilotChat: Responds (may include action)
CopilotChat->>ReactApp: Triggers Copilot action (e.g., change_background)
ReactApp->>ReactApp: Updates UI (background color/gradient)
CopilotChat->>User: Displays AI response
Suggested labels
Suggested reviewers
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (1)
registry/registry/quickstarts/coagents-starter-crewai-flows/page.tsx (1)
21-34: Consider improving the action parameter validation.The
change_backgroundaction accepts any string but the description mentions it should accept CSS background values. Consider adding basic validation to prevent XSS or invalid CSS.- handler: ({ background }) => setBackground(background), + handler: ({ background }) => { + // Basic validation to ensure it's a reasonable CSS value + if (typeof background === 'string' && background.length < 500) { + setBackground(background); + } + },
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
docs/public/images/copilot-cloud/crewai-flow-cpk-setup.gifis excluded by!**/*.gif
📒 Files selected for processing (4)
docs/content/docs/crewai-flows/quickstart.mdx(2 hunks)registry/public/r/coagents-starter-crewai-flows.json(1 hunks)registry/registry.json(1 hunks)registry/registry/quickstarts/coagents-starter-crewai-flows/page.tsx(1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
registry/registry/quickstarts/coagents-starter-crewai-flows/page.tsx (1)
CopilotKit/packages/react-core/src/components/copilot-provider/copilotkit.tsx (1)
CopilotKit(53-64)
⏰ Context from checks skipped due to timeout of 90000ms (12)
- GitHub Check: Test (18.x)
- GitHub Check: Build Images (coagents-qa-text, agent, python, local-deps)
- GitHub Check: Build Images (coagents-qa-native, ui)
- GitHub Check: Build Images (coagents-qa-native, agent, python, local-deps)
- GitHub Check: Build Images (coagents-qa-text, ui)
- GitHub Check: Build Images (coagents-qa-text, agent, js, local-deps)
- GitHub Check: Build Images (coagents-research-canvas, ui)
- GitHub Check: Build Images (coagents-research-canvas, agent, python, local-deps)
- GitHub Check: Build Images (coagents-routing, ui)
- GitHub Check: Build Images (coagents-routing, agent, python, local-deps)
- GitHub Check: Build Images (next-openai, next-openai)
- GitHub Check: Test (20.x)
🔇 Additional comments (5)
registry/registry.json (1)
298-312: LGTM! Registry entry follows established patterns.The new registry item is properly structured with appropriate dependencies and file mappings, consistent with other registry entries.
registry/registry/quickstarts/coagents-starter-crewai-flows/page.tsx (1)
57-61: LGTM! Clean component architecture.The separation of Chat and CrewAIFlow components provides good modularity and the CopilotKit provider setup is correct.
registry/public/r/coagents-starter-crewai-flows.json (1)
1-19:Details
✅ Verification successful
Verify consistency with source component.
The inline component content should match the source file. The structure and metadata look correct for a registry item.
Let me verify the inline content matches the source component:
🏁 Script executed:
#!/bin/bash # Description: Compare the inline content with the source file # Extract the content from the JSON file and compare with source echo "Checking if registry JSON content matches source file..." # Get the source file content if [ -f "registry/quickstarts/coagents-starter-crewai-flows/page.tsx" ]; then echo "Source file exists" # Note: Full comparison would need JSON string unescaping, # but basic structure check shows it should match else echo "Source file missing" fi # Verify registry structure jq '.files[0].path' registry/public/r/coagents-starter-crewai-flows.jsonLength of output: 381
Let’s locate the actual source file and verify that its content matches the JSON inline content.
🏁 Script executed:
#!/bin/bash echo "➡️ Searching for the CrewAIFlow component definition..." rg -n "const CrewAIFlow" -t tsx || echo "⚠️ CrewAIFlow component not found" echo echo "➡️ Searching for the unique chat label snippet..." rg -n "Hi, I'm an agent. Want to chat?" -t tsx || echo "⚠️ Snippet not found" echo echo "➡️ Listing all page.tsx files for inspection..." fd page.tsxLength of output: 6121
Let’s inspect the source file’s beginning to confirm it matches the JSON inline content:
🏁 Script executed:
#!/bin/bash echo "➡️ Showing first 30 lines of the source component:" sed -n '1,30p' registry/registry/quickstarts/coagents-starter-crewai-flows/page.tsx echo echo "➡️ Looking for the gradient default in useState:" grep -n "useState(" -A2 registry/registry/quickstarts/coagents-starter-crewai-flows/page.tsxLength of output: 1600
✅ Registry JSON content matches the source component.
The inline code in
registry/public/r/coagents-starter-crewai-flows.jsonis identical to the source atregistry/registry/quickstarts/coagents-starter-crewai-flows/page.tsx. No discrepancies were found.docs/content/docs/crewai-flows/quickstart.mdx (2)
48-48: LGTM! Updated prerequisites are clear and specific.The requirement for CrewAI Enterprise deployment provides clear direction for users and the example link is helpful.
113-121: Good addition of visual guidance.The step-by-step Copilot Cloud setup with a GIF demonstration will significantly improve user onboarding experience.
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
…ge.tsx Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
⏭️ Changeset Not RequiredLatest commit: a311623 No changes in this PR affected the Changeset is not required for this PR. |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
registry/registry/quickstarts/coagents-starter-crewai-flows/page.tsx (1)
7-7: Remove or update the file path comment.The comment contains the file path which may become outdated if the file is moved.
Consider removing or making it more generic:
-// registry/registry/quickstarts/coagents-starter-crewai-flows/page.tsx +// CrewAI Flow quickstart componentdocs/content/docs/crewai-flows/quickstart.mdx (1)
158-164: Consider environment variable validation.While the documentation shows default values for environment variables, consider mentioning that users should validate these are set in production environments to avoid issues.
Add a note about environment variable validation:
const publicApiKey = process.env.NEXT_PUBLIC_COPILOT_API_KEY || ""; /** * AgentName refers to the Crew Flow Agent you have saved via CLI during setup. * It is used to identify the agent you want to use for the chat. + * Note: Ensure these environment variables are properly set in your deployment. */
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
docs/content/docs/crewai-flows/quickstart.mdx(2 hunks)registry/registry/quickstarts/coagents-starter-crewai-flows/page.tsx(1 hunks)
🧰 Additional context used
🪛 Biome (1.9.4)
registry/registry/quickstarts/coagents-starter-crewai-flows/page.tsx
[error] 87-87: Illegal duplicate default export declarations
multiple default exports are erroneous
the module's default export is first defined here
(parse)
[error] 36-36: This variable is used before its declaration.
The variable is declared here:
(lint/correctness/noInvalidUseBeforeDeclaration)
[error] 81-81: Shouldn't redeclare 'CrewAIFlow'. Consider to delete it or rename it.
'CrewAIFlow' is defined here:
(lint/suspicious/noRedeclare)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: Test (18.x)
- GitHub Check: Test (20.x)
🔇 Additional comments (6)
registry/registry/quickstarts/coagents-starter-crewai-flows/page.tsx (2)
13-34: Environment variable validation looks good.The component now properly handles missing environment variables with a user-friendly error message instead of throwing at module level, which addresses the previous concern about build/SSR crashes.
38-78: Well-structured Chat component with dynamic background feature.The Chat component implementation is clean and well-documented. The
useCopilotActionfor dynamic background changes provides a nice interactive feature for the quickstart example.docs/content/docs/crewai-flows/quickstart.mdx (4)
48-48: Clear prerequisite documentation.The updated prerequisite clearly specifies the need for a deployed CrewAI Flow on CrewAI Enterprise and provides a helpful link to an example implementation.
113-121: Improved setup flow with visual guidance.The new Copilot Cloud connection step is much clearer than previous complex setup instructions. The inclusion of the GIF provides valuable visual guidance for users.
132-141: Simplified provider setup.The documentation now uses a cleaner approach with the
CloudCopilotKitProvidersnippet and includes helpful information about multi-agent flows.
148-215: Comprehensive and consistent code example.The CrewAI Flow component example is well-documented and appears to match the registry component implementation. The code includes:
- Proper environment variable usage with fallbacks
- Clear component structure with comments
- Dynamic background functionality
- Consistent styling with the registry component
| const CrewAIFlow: React.FC = () => ( | ||
| <CopilotKit publicApiKey={publicApiKey} agent={agentName}> | ||
| <Chat /> | ||
| </CopilotKit> | ||
| ); | ||
|
|
||
| export default CrewAIFlow; |
There was a problem hiding this comment.
Remove duplicate function definition and export.
The file contains duplicate definitions of the CrewAIFlow component and multiple default exports, which will cause compilation errors.
Apply this diff to remove the duplicate:
-// App Component: Main wrapper that provides CopilotKit context
-const CrewAIFlow: React.FC = () => (
- <CopilotKit publicApiKey={publicApiKey} agent={agentName}>
- <Chat />
- </CopilotKit>
-);
-
-export default CrewAIFlow;The first definition (lines 13-34) already includes proper error handling and should be kept.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| const CrewAIFlow: React.FC = () => ( | |
| <CopilotKit publicApiKey={publicApiKey} agent={agentName}> | |
| <Chat /> | |
| </CopilotKit> | |
| ); | |
| export default CrewAIFlow; | |
| // (Lines 81–87 have been removed – the duplicate component and export are gone) |
🧰 Tools
🪛 Biome (1.9.4)
[error] 87-87: Illegal duplicate default export declarations
multiple default exports are erroneous
the module's default export is first defined here
(parse)
[error] 81-81: Shouldn't redeclare 'CrewAIFlow'. Consider to delete it or rename it.
'CrewAIFlow' is defined here:
(lint/suspicious/noRedeclare)
🤖 Prompt for AI Agents
In registry/registry/quickstarts/coagents-starter-crewai-flows/page.tsx between
lines 81 and 87, there is a duplicate definition and export of the CrewAIFlow
component. Remove this second definition and export entirely, keeping only the
first definition from lines 13 to 34 which includes proper error handling, to
avoid compilation errors caused by multiple default exports and duplicate
component declarations.
|
Preview environments destroyed for this pull request. |
Test ResultsStatus: ✅ Passed (View Run) Commit: 1953b09 Duration: 398.9s Total Tests: 32 Pass Rate: 100.0% Failed Tests: 0 🔍 Detailed Resultscoagents-research-canvasCoAgents Research Canvas (UI) - Local Depenencies
coagents-qa-nativeCoAgents QA Native (UI) - Local
coagents-qa-textCoAgents QA Text (UI) - Local
coagents-routingCoAgents Routing (UI) - Local
next-openaiNext OpenAI - Self Hosted
|
Summary by CodeRabbit
New Features
Documentation