fix(docs): restore missing code block in pt-BR first-flow guide#5780
Conversation
The pt-BR translation of the 'Build Your First Flow' guide had a placeholder comment '# [CÓDIGO NÃO TRADUZIDO, MANTER COMO ESTÁ]' instead of the actual Python code in Step 5. This restores the full main.py code block from the English source, matching the original since code should not be translated.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThis pull request translates and completes a Portuguese-language guide on building flows by replacing an untranslated code placeholder with a full working example. The example demonstrates a guide creator flow that accepts user input, generates a structured outline via LLM, writes sections sequentially with content reuse, and compiles the final guide document. ChangesGuide Creator Flow Implementation Example
🎯 2 (Simple) | ⏱️ ~10 minutes
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
docs/pt-BR/guides/flows/first-flow.mdx (1)
291-296: ⚡ Quick winUse Optional typing and
default_factoryfor Pydantic state model fieldsLines 294–295 use non-idiomatic patterns for Pydantic v2:
guide_outline: GuideOutline = Nonelacks an Optional type annotation, andsections_content: Dict[str, str] = {}uses a mutable default literal instead ofField(default_factory=dict). In documentation examples, this should follow Pydantic v2 best practices to avoid misleading users.Suggested patch
class GuideCreatorState(BaseModel): topic: str = "" audience_level: str = "" - guide_outline: GuideOutline = None - sections_content: Dict[str, str] = {} + guide_outline: GuideOutline | None = None + sections_content: Dict[str, str] = Field(default_factory=dict)🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@docs/pt-BR/guides/flows/first-flow.mdx` around lines 291 - 296, Update the Pydantic model GuideCreatorState to use idiomatic Pydantic v2 types: change the guide_outline annotation to an Optional type (e.g., Optional[GuideOutline]) with a None default, and replace the mutable default on sections_content by using Field(default_factory=dict) (keeping the type as Dict[str, str]); also ensure the module imports Optional from typing and Field from pydantic so the annotations compile.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/pt-BR/guides/flows/first-flow.mdx`:
- Line 325: The guide currently hardcodes the model string in the LLM
instantiation (llm = LLM(model="openai/gpt-4o-mini",
response_format=GuideOutline)), which conflicts with the multi-provider setup;
change the call to use a provider-agnostic variable (e.g., model_name,
selectedModel, or provider_model) populated from the guide's earlier
configuration/options (the values described for OpenAI/Gemini/Anthropic), and
ensure a sensible fallback/default is documented if the variable is not set;
update the text to reference that variable instead of "openai/gpt-4o-mini" so
all provider paths work.
---
Nitpick comments:
In `@docs/pt-BR/guides/flows/first-flow.mdx`:
- Around line 291-296: Update the Pydantic model GuideCreatorState to use
idiomatic Pydantic v2 types: change the guide_outline annotation to an Optional
type (e.g., Optional[GuideOutline]) with a None default, and replace the mutable
default on sections_content by using Field(default_factory=dict) (keeping the
type as Dict[str, str]); also ensure the module imports Optional from typing and
Field from pydantic so the annotations compile.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 311b9c7f-0ef5-4735-bce3-50cb79bfada0
📒 Files selected for processing (1)
docs/pt-BR/guides/flows/first-flow.mdx
Code comments in the tutorial should be in Portuguese for the pt-BR audience, since they are part of the guide's educational content.
Problem
The pt-BR translation of the Build Your First Flow guide had a placeholder comment instead of the actual Python code in Step 5 (Passo 5):
# [CÓDIGO NÃO TRADUZIDO, MANTER COMO ESTÁ]This left users following the Portuguese docs with no code to reference for the main flow implementation.
Live page: https://docs.crewai.com/pt-BR/guides/flows/first-flow#passo-5-crie-o-flow
Fix
Restored the full main.py code block from the English source. Code blocks should not be translated, so the English original is the correct content here.
Summary by CodeRabbit