diff --git a/docs/pt-BR/concepts/agents.mdx b/docs/pt-BR/concepts/agents.mdx index 0bfdc69ac..0da37e5f2 100644 --- a/docs/pt-BR/concepts/agents.mdx +++ b/docs/pt-BR/concepts/agents.mdx @@ -149,34 +149,33 @@ from crewai_tools import SerperDevTool # Crie um agente com todos os parâmetros disponíveis 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", # Default: OPENAI_MODEL_NAME or "gpt-4" - function_calling_llm=None, # Optional: Separate LLM for tool calling - verbose=False, # Default: False - allow_delegation=False, # Default: False - max_iter=20, # Default: 20 iterations - max_rpm=None, # Optional: Rate limit for API calls - max_execution_time=None, # Optional: Maximum execution time in seconds - max_retry_limit=2, # Default: 2 retries on error - allow_code_execution=False, # Default: False - code_execution_mode="safe", # Default: "safe" (options: "safe", "unsafe") - respect_context_window=True, # Default: True - use_system_prompt=True, # Default: True - multimodal=False, # Default: False - inject_date=False, # Default: False - date_format="%Y-%m-%d", # Default: ISO format - reasoning=False, # Default: False - max_reasoning_attempts=None, # Default: None - tools=[SerperDevTool()], # Optional: List of tools - knowledge_sources=None, # Optional: List of knowledge sources - embedder=None, # Optional: Custom embedder configuration - system_template=None, # Optional: Custom system prompt template - prompt_template=None, # Optional: Custom prompt template - response_template=None, # Optional: Custom response template - step_callback=None, # Optional: Callback function for monitoring + role="Cientista de Dados Sênior", + goal="Analisar e interpretar conjuntos de dados complexos para fornecer insights acionáveis", + backstory="Com mais de 10 anos de experiência em ciência de dados e aprendizado de máquina, você é especialista em encontrar padrões em grandes volumes de dados.", + llm="gpt-4", # Padrão: OPENAI_MODEL_NAME ou "gpt-4" + function_calling_llm=None, # Opcional: LLM separado para chamadas de ferramentas + verbose=False, # Padrão: False + allow_delegation=False, # Padrão: False + max_iter=20, # Padrão: 20 iterações + max_rpm=None, # Opcional: Limite de requisições por minuto + max_execution_time=None, # Opcional: Tempo máximo de execução em segundos + max_retry_limit=2, # Padrão: 2 tentativas em caso de erro + allow_code_execution=False, # Padrão: False + code_execution_mode="safe", # Padrão: "safe" (opções: "safe", "unsafe") + respect_context_window=True, # Padrão: True + use_system_prompt=True, # Padrão: True + multimodal=False, # Padrão: False + inject_date=False, # Padrão: False + date_format="%Y-%m-%d", # Padrão: formato ISO + reasoning=False, # Padrão: False + max_reasoning_attempts=None, # Padrão: None + tools=[SerperDevTool()], # Opcional: Lista de ferramentas + knowledge_sources=None, # Opcional: Lista de fontes de conhecimento + embedder=None, # Opcional: Configuração de embedder customizado + system_template=None, # Opcional: Template de prompt de sistema + prompt_template=None, # Opcional: Template de prompt customizado + response_template=None, # Opcional: Template de resposta customizado + step_callback=None, # Opcional: Função de callback para monitoramento ) ``` @@ -185,65 +184,62 @@ Vamos detalhar algumas combinações de parâmetros-chave para casos de uso comu #### Agente de Pesquisa Básico ```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", + role="Analista de Pesquisa", + goal="Encontrar e resumir informações sobre tópicos específicos", + backstory="Você é um pesquisador experiente com atenção aos detalhes", tools=[SerperDevTool()], - verbose=True # Enable logging for debugging + verbose=True # Ativa logs para depuração ) ``` #### Agente de Desenvolvimento de Código ```python Code dev_agent = Agent( - role="Senior Python Developer", - goal="Write and debug Python code", - backstory="Expert Python developer with 10 years of experience", + role="Desenvolvedor Python Sênior", + goal="Escrever e depurar códigos Python", + backstory="Desenvolvedor Python especialista com 10 anos de experiência", 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 + code_execution_mode="safe", # Usa Docker para segurança + max_execution_time=300, # Limite de 5 minutos + max_retry_limit=3 # Mais tentativas para tarefas complexas ) ``` #### Agente de Análise de Longa Duração ```python Code analysis_agent = Agent( - role="Data Analyst", - goal="Perform deep analysis of large datasets", - backstory="Specialized in big data analysis and pattern recognition", + role="Analista de Dados", + goal="Realizar análise aprofundada de grandes conjuntos de dados", + backstory="Especialista em análise de big data e reconhecimento de padrões", memory=True, respect_context_window=True, - max_rpm=10, # Limit API calls - function_calling_llm="gpt-4o-mini" # Cheaper model for tool calls + max_rpm=10, # Limite de requisições por minuto + function_calling_llm="gpt-4o-mini" # Modelo mais econômico para chamadas de ferramentas ) ``` #### Agente com Template Personalizado ```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|>""", + role="Atendente de Suporte ao Cliente", + goal="Auxiliar clientes com suas dúvidas e solicitações", + backstory="Experiente em atendimento ao cliente com foco em satisfação", + system_template="""<|start_header_id|>system<|end_header_id|>\n {{ .System }}<|eot_id|>""", + prompt_template="""<|start_header_id|>user<|end_header_id|>\n {{ .Prompt }}<|eot_id|>""", + response_template="""<|start_header_id|>assistant<|end_header_id|>\n {{ .Response }}<|eot_id|>""", ) ``` #### Agente Ciente de Data, com Raciocínio ```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 + role="Analista de Mercado", + goal="Acompanhar movimentos do mercado com referências de datas precisas e planejamento estratégico", + backstory="Especialista em análise financeira sensível ao tempo e relatórios estratégicos", + inject_date=True, # Injeta automaticamente a data atual nas tarefas + date_format="%d de %B de %Y", # Exemplo: "21 de maio de 2025" + reasoning=True, # Ativa planejamento estratégico + max_reasoning_attempts=2, # Limite de iterações de planejamento verbose=True ) ``` @@ -251,12 +247,12 @@ strategic_agent = Agent( #### Agente de Raciocínio ```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 + role="Planejador Estratégico", + goal="Analisar problemas complexos e criar planos de execução detalhados", + backstory="Especialista em planejamento estratégico que desmembra desafios complexos metodicamente", + reasoning=True, # Ativa raciocínio e planejamento + max_reasoning_attempts=3, # Limite de tentativas de raciocínio + max_iter=30, # Permite mais iterações para planejamento complexo verbose=True ) ``` @@ -264,10 +260,10 @@ reasoning_agent = Agent( #### Agente Multimodal ```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 + role="Analista de Conteúdo Visual", + goal="Analisar e processar tanto conteúdo textual quanto visual", + backstory="Especialista em análise multimodal combinando compreensão de texto e imagem", + multimodal=True, # Ativa capacidades multimodais verbose=True ) ``` @@ -336,8 +332,8 @@ wiki_tool = WikipediaTools() # Adicionar ferramentas ao agente researcher = Agent( - role="AI Technology Researcher", - goal="Research the latest AI developments", + role="Pesquisador de Tecnologia em IA", + goal="Pesquisar os últimos avanços em IA", tools=[search_tool, wiki_tool], verbose=True ) @@ -351,9 +347,9 @@ Agentes podem manter a memória de suas interações e usar contexto de tarefas from crewai import Agent analyst = Agent( - role="Data Analyst", - goal="Analyze and remember complex data patterns", - memory=True, # Enable memory + role="Analista de Dados", + goal="Analisar e memorizar padrões complexos de dados", + memory=True, # Ativa memória verbose=True ) ``` @@ -380,10 +376,10 @@ Esta é a **configuração padrão e recomendada** para a maioria dos casos. Qua ```python Code # Agente com gerenciamento automático de contexto (padrão) 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 + role="Analista de Pesquisa", + goal="Analisar grandes documentos e conjuntos de dados", + backstory="Especialista em processar informações extensas", + respect_context_window=True, # 🔑 Padrão: gerencia limites de contexto automaticamente verbose=True ) ``` diff --git a/docs/pt-BR/concepts/cli.mdx b/docs/pt-BR/concepts/cli.mdx index af5c10872..bd2554406 100644 --- a/docs/pt-BR/concepts/cli.mdx +++ b/docs/pt-BR/concepts/cli.mdx @@ -75,6 +75,20 @@ Exemplo: crewai train -n 10 -f my_training_data.pkl ``` +# Exemplo de uso programático do comando train +n_iterations = 2 +inputs = {"topic": "Treinamento CrewAI"} +filename = "seu_modelo.pkl" + +try: + SuaCrew().crew().train( + n_iterations=n_iterations, + inputs=inputs, + filename=filename + ) +except Exception as e: + raise Exception(f"Ocorreu um erro ao treinar a crew: {e}") + ### 4. Replay Reexecute a execução do crew a partir de uma tarefa específica. diff --git a/docs/pt-BR/concepts/collaboration.mdx b/docs/pt-BR/concepts/collaboration.mdx index b5d0481c8..5c2a03b1c 100644 --- a/docs/pt-BR/concepts/collaboration.mdx +++ b/docs/pt-BR/concepts/collaboration.mdx @@ -15,18 +15,18 @@ 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 + role="Especialista em Pesquisa", + goal="Realizar pesquisas aprofundadas sobre qualquer tema", + backstory="Pesquisador especialista com acesso a diversas fontes", + allow_delegation=True, # 🔑 Configuração chave para colaboração 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 + role="Redator de Conteúdo", + goal="Criar conteúdo envolvente com base em pesquisas", + backstory="Redator habilidoso que transforma pesquisas em conteúdo atraente", + allow_delegation=True, # 🔑 Permite fazer perguntas a outros agentes verbose=True ) @@ -67,19 +67,17 @@ 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.""", + role="Especialista em Pesquisa", + goal="Realizar pesquisas aprofundadas sobre qualquer tema", + backstory="Pesquisador especialista com acesso a diversas fontes", 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.""", + role="Redator de Conteúdo", + goal="Criar conteúdo envolvente com base em pesquisas", + backstory="Redator habilidoso que transforma pesquisas em conteúdo atraente", allow_delegation=True, verbose=True ) @@ -95,17 +93,17 @@ editor = Agent( # 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 + description="""Escreva um artigo abrangente de 1000 palavras sobre 'O Futuro da IA na Saúde'. + +O artigo deve incluir: +- Aplicações atuais de IA na saúde +- Tendências e tecnologias emergentes +- Desafios potenciais e considerações éticas +- Previsões de especialistas para os próximos 5 anos + +Colabore com seus colegas para garantir precisão e qualidade.""", + expected_output="Um artigo bem pesquisado, envolvente, com 1000 palavras, estrutura adequada e citações", + agent=writer # O redator lidera, mas pode delegar pesquisa ao pesquisador ) # Create collaborative crew @@ -124,37 +122,37 @@ result = crew.kickoff() ### Padrão 1: Pesquisa → Redação → Edição ```python research_task = Task( - description="Research the latest developments in quantum computing", - expected_output="Comprehensive research summary with key findings and sources", + description="Pesquise os últimos avanços em computação quântica", + expected_output="Resumo abrangente da pesquisa com principais descobertas e fontes", agent=researcher ) writing_task = Task( - description="Write an article based on the research findings", - expected_output="Engaging 800-word article about quantum computing", + description="Escreva um artigo com base nos achados da pesquisa", + expected_output="Artigo envolvente de 800 palavras sobre computação quântica", agent=writer, - context=[research_task] # Gets research output as context + context=[research_task] # Recebe a saída da pesquisa como contexto ) editing_task = Task( - description="Edit and polish the article for publication", - expected_output="Publication-ready article with improved clarity and flow", + description="Edite e revise o artigo para publicação", + expected_output="Artigo pronto para publicação, com clareza e fluidez aprimoradas", agent=editor, - context=[writing_task] # Gets article draft as context + context=[writing_task] # Recebe o rascunho do artigo como contexto ) ``` ### Padrão 2: Tarefa Única Colaborativa ```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 + description="""Crie uma estratégia de marketing para um novo produto de IA. + +Redator: Foque em mensagens e estratégia de conteúdo +Pesquisador: Forneça análise de mercado e insights de concorrentes + +Trabalhem juntos para criar uma estratégia abrangente.""", + expected_output="Estratégia de marketing completa com embasamento em pesquisa", + agent=writer # Agente líder, mas pode delegar ao pesquisador ) ``` @@ -167,35 +165,35 @@ 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", + role="Gerente de Projetos", + goal="Coordenar esforços da equipe e garantir o sucesso do projeto", + backstory="Gerente de projetos experiente, habilidoso em delegação e controle de qualidade", 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 + role="Pesquisador", + goal="Fornecer pesquisa e análise precisas", + backstory="Pesquisador especialista com habilidades analíticas profundas", + allow_delegation=False, # Especialistas focam em sua expertise verbose=True ) writer = Agent( - role="Writer", - goal="Create compelling content", - backstory="Skilled writer who creates engaging content", + role="Redator", + goal="Criar conteúdo envolvente", + backstory="Redator habilidoso que cria conteúdo atraente", 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 + description="Crie um relatório de análise de mercado completo com recomendações", + expected_output="Resumo executivo, análise detalhada e recomendações estratégicas", + agent=manager # O gerente delega para especialistas ) # Hierarchical crew diff --git a/docs/pt-BR/concepts/crews.mdx b/docs/pt-BR/concepts/crews.mdx index 89a0641b7..7d348b3de 100644 --- a/docs/pt-BR/concepts/crews.mdx +++ b/docs/pt-BR/concepts/crews.mdx @@ -153,32 +153,32 @@ 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", + role="Analista de Dados", + goal="Analisar tendências de dados no mercado brasileiro", + backstory="Analista experiente com formação em economia", 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", + role="Pesquisador de Mercado", + goal="Coletar informações sobre a dinâmica do mercado nacional", + backstory="Pesquisador dedicado com olhar atento aos detalhes", 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.", + description="Coletar dados recentes do mercado brasileiro e identificar tendências.", + expected_output="Um relatório resumido com as principais tendências do mercado.", 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.", + description="Pesquisar fatores que afetam a dinâmica do mercado nacional.", + expected_output="Uma análise dos fatores que influenciam o mercado.", agent=self.agent_two() ) diff --git a/docs/pt-BR/concepts/event-listener.mdx b/docs/pt-BR/concepts/event-listener.mdx index cf24aa859..b925ac995 100644 --- a/docs/pt-BR/concepts/event-listener.mdx +++ b/docs/pt-BR/concepts/event-listener.mdx @@ -51,24 +51,24 @@ from crewai.utilities.events import ( ) from crewai.utilities.events.base_event_listener import BaseEventListener -class MyCustomListener(BaseEventListener): +class MeuListenerPersonalizado(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!") + def ao_iniciar_crew(source, event): + print(f"Crew '{event.crew_name}' iniciou a execução!") @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}") + def ao_finalizar_crew(source, event): + print(f"Crew '{event.crew_name}' finalizou a execução!") + print(f"Saída: {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}") + def ao_finalizar_execucao_agente(source, event): + print(f"Agente '{event.agent.role}' concluiu a tarefa") + print(f"Saída: {event.output}") ``` ## Registrando Corretamente Seu Listener diff --git a/docs/pt-BR/concepts/flows.mdx b/docs/pt-BR/concepts/flows.mdx index 433a53d1e..9c8b7cf8f 100644 --- a/docs/pt-BR/concepts/flows.mdx +++ b/docs/pt-BR/concepts/flows.mdx @@ -486,8 +486,9 @@ Existem duas formas de executar um flow: Você pode executar um flow programaticamente criando uma instância da sua classe de flow e chamando o método `kickoff()`: ```python -flow = ExampleFlow() -result = flow.kickoff() +# Exemplo de execução de flow em português +flow = ExemploFlow() +resultado = flow.kickoff() ``` ### Usando a CLI diff --git a/docs/pt-BR/concepts/knowledge.mdx b/docs/pt-BR/concepts/knowledge.mdx index faac60437..adddcfac3 100644 --- a/docs/pt-BR/concepts/knowledge.mdx +++ b/docs/pt-BR/concepts/knowledge.mdx @@ -39,17 +39,17 @@ 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.", + role="Sobre o Usuário", + goal="Você sabe tudo sobre o usuário.", + backstory="Você é mestre em entender pessoas e suas preferências.", 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.", + description="Responda às seguintes perguntas sobre o usuário: {question}", + expected_output="Uma resposta para a pergunta.", agent=agent, ) @@ -87,17 +87,17 @@ 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.", + role="Sobre artigos", + goal="Você sabe tudo sobre os artigos.", + backstory="Você é mestre em entender artigos e seus conteúdos.", 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.", + description="Responda às seguintes perguntas sobre os artigos: {question}", + expected_output="Uma resposta para a pergunta.", agent=agent, ) @@ -201,16 +201,16 @@ specialist_knowledge = StringKnowledgeSource( ) specialist_agent = Agent( - role="Technical Specialist", - goal="Provide technical expertise", - backstory="Expert in specialized technical domains", - knowledge_sources=[specialist_knowledge] # Agent-specific knowledge + role="Especialista Técnico", + goal="Fornecer expertise técnica", + backstory="Especialista em domínios técnicos especializados", + knowledge_sources=[specialist_knowledge] # Conhecimento específico do agente ) task = Task( - description="Answer technical questions", + description="Responda perguntas técnicas", agent=specialist_agent, - expected_output="Technical answer" + expected_output="Resposta técnica" ) # No crew-level knowledge required @@ -240,7 +240,7 @@ Cada nível de knowledge usa coleções de armazenamento independentes: ```python # Agent knowledge storage -agent_collection_name = agent.role # e.g., "Technical Specialist" +agent_collection_name = agent.role # e.g., "Especialista Técnico" # Crew knowledge storage crew_collection_name = "crew" @@ -248,7 +248,7 @@ 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 +# ├── Especialista Técnico/ # Agent knowledge collection # └── Another Agent Role/ # Another agent's collection ``` @@ -265,7 +265,7 @@ agent_knowledge = StringKnowledgeSource( ) agent = Agent( - role="Specialist", + role="Especialista", goal="Use specialized knowledge", backstory="Expert with specific knowledge", knowledge_sources=[agent_knowledge], @@ -299,10 +299,10 @@ specialist_knowledge = StringKnowledgeSource( ) specialist = Agent( - role="Technical Specialist", - goal="Provide technical expertise", - backstory="Technical expert", - knowledge_sources=[specialist_knowledge] # Agent-specific + role="Especialista Técnico", + goal="Fornecer expertise técnica", + backstory="Especialista em domínios técnicos especializados", + knowledge_sources=[specialist_knowledge] # Conhecimento específico do agente ) generalist = Agent( diff --git a/docs/pt-BR/concepts/llms.mdx b/docs/pt-BR/concepts/llms.mdx index e608b915d..b32c0b712 100644 --- a/docs/pt-BR/concepts/llms.mdx +++ b/docs/pt-BR/concepts/llms.mdx @@ -78,15 +78,15 @@ Existem diferentes locais no código do CrewAI onde você pode especificar o mod # Configuração avançada com parâmetros detalhados llm = LLM( - model="model-id-here", # gpt-4o, gemini-2.0-flash, anthropic/claude... - temperature=0.7, # Mais alto para saídas criativas - timeout=120, # Segundos para aguardar resposta - max_tokens=4000, # Comprimento máximo da resposta - top_p=0.9, # Parâmetro de amostragem nucleus - frequency_penalty=0.1 , # Reduz repetição - presence_penalty=0.1, # Incentiva diversidade de tópicos - response_format={"type": "json"}, # Para respostas estruturadas - seed=42 # Para resultados reproduzíveis + model="openai/gpt-4", + temperature=0.8, + max_tokens=150, + top_p=0.9, + frequency_penalty=0.1, + presence_penalty=0.1, + response_format={"type":"json"}, + stop=["FIM"], + seed=42 ) ``` @@ -127,13 +127,13 @@ Nesta seção, você encontrará exemplos detalhados que ajudam a selecionar, co from crewai import LLM llm = LLM( - model="openai/gpt-4", # chamar modelo por provider/model_name + model="openai/gpt-4", temperature=0.8, max_tokens=150, top_p=0.9, frequency_penalty=0.1, presence_penalty=0.1, - stop=["END"], + stop=["FIM"], seed=42 ) ``` @@ -169,7 +169,7 @@ Nesta seção, você encontrará exemplos detalhados que ajudam a selecionar, co llm = LLM( model="meta_llama/Llama-4-Scout-17B-16E-Instruct-FP8", temperature=0.8, - stop=["END"], + stop=["FIM"], seed=42 ) ``` diff --git a/docs/pt-BR/concepts/planning.mdx b/docs/pt-BR/concepts/planning.mdx index 2f16c9779..b26014ec7 100644 --- a/docs/pt-BR/concepts/planning.mdx +++ b/docs/pt-BR/concepts/planning.mdx @@ -17,7 +17,7 @@ Começar a usar o recurso de planejamento é muito simples, o único passo neces from crewai import Crew, Agent, Task, Process # Monte sua crew com capacidades de planejamento -my_crew = Crew( +minha_crew = Crew( agents=self.agents, tasks=self.tasks, process=Process.sequential, diff --git a/docs/pt-BR/concepts/processes.mdx b/docs/pt-BR/concepts/processes.mdx index 8864616f6..ad087be20 100644 --- a/docs/pt-BR/concepts/processes.mdx +++ b/docs/pt-BR/concepts/processes.mdx @@ -28,23 +28,23 @@ from crewai import Crew, Process # Exemplo: Criando uma crew com processo sequencial crew = Crew( - agents=my_agents, - tasks=my_tasks, + agents=meus_agentes, + tasks=minhas_tarefas, process=Process.sequential ) # Exemplo: Criando uma crew com processo hierárquico # Certifique-se de fornecer um manager_llm ou manager_agent crew = Crew( - agents=my_agents, - tasks=my_tasks, + agents=meus_agentes, + tasks=minhas_tarefas, process=Process.hierarchical, manager_llm="gpt-4o" # ou - # manager_agent=my_manager_agent + # manager_agent=meu_agente_gerente ) ``` -**Nota:** Certifique-se de que `my_agents` e `my_tasks` estejam definidos antes de criar o objeto `Crew`, e para o processo hierárquico, é necessário também fornecer o `manager_llm` ou `manager_agent`. +**Nota:** Certifique-se de que `meus_agentes` e `minhas_tarefas` estejam definidos antes de criar o objeto `Crew`, e para o processo hierárquico, é necessário também fornecer o `manager_llm` ou `manager_agent`. ## Processo Sequencial diff --git a/docs/pt-BR/concepts/reasoning.mdx b/docs/pt-BR/concepts/reasoning.mdx index 205edb48c..4c4fa5114 100644 --- a/docs/pt-BR/concepts/reasoning.mdx +++ b/docs/pt-BR/concepts/reasoning.mdx @@ -15,12 +15,12 @@ Para habilitar o reasoning para um agente, basta definir `reasoning=True` ao cri ```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 +analista = Agent( + role="Analista de Dados", + goal="Analisar dados e fornecer insights", + backstory="Você é um analista de dados especialista.", + reasoning=True, + max_reasoning_attempts=3 # Opcional: Defina um limite de tentativas de reasoning ) ``` @@ -53,23 +53,23 @@ Aqui está um exemplo completo: 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.", +analista = Agent( + role="Analista de Dados", + goal="Analisar dados e fornecer insights", + backstory="Você é um analista de dados especialista.", reasoning=True, - max_reasoning_attempts=3 # Optional: Set a limit on reasoning attempts + max_reasoning_attempts=3 # Opcional: Defina um limite de tentativas de reasoning ) # 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 + description="Analise os dados de vendas fornecidos e identifique as principais tendências.", + expected_output="Um relatório destacando as 3 principais tendências de vendas.", + agent=analista ) # Create a crew and run the task -crew = Crew(agents=[analyst], tasks=[analysis_task]) +crew = Crew(agents=[analista], tasks=[analysis_task]) result = crew.kickoff() print(result) @@ -90,16 +90,16 @@ logging.basicConfig(level=logging.INFO) # Create an agent with reasoning enabled agent = Agent( - role="Data Analyst", - goal="Analyze data and provide insights", + role="Analista de Dados", + goal="Analisar dados e fornecer insights", reasoning=True, max_reasoning_attempts=3 ) # Create a task task = Task( - description="Analyze the provided sales data and identify key trends.", - expected_output="A report highlighting the top 3 sales trends.", + description="Analise os dados de vendas fornecidos e identifique as principais tendências.", + expected_output="Um relatório destacando as 3 principais tendências de vendas.", agent=agent ) @@ -113,7 +113,7 @@ result = agent.execute_task(task) Veja um exemplo de como pode ser um plano de reasoning para uma tarefa de análise de dados: ``` -Task: Analyze the provided sales data and identify key trends. +Task: Analise os dados de vendas fornecidos e identifique as principais tendências. Reasoning Plan: I'll analyze the sales data to identify the top 3 trends. diff --git a/docs/pt-BR/concepts/tasks.mdx b/docs/pt-BR/concepts/tasks.mdx index 38604439e..8c65b7e80 100644 --- a/docs/pt-BR/concepts/tasks.mdx +++ b/docs/pt-BR/concepts/tasks.mdx @@ -386,7 +386,7 @@ def validate_with_context(result: TaskOutput) -> Tuple[bool, Any]: validated_data = perform_validation(result) return (True, validated_data) except ValidationError as e: - return (False, f"VALIDATION_ERROR: {str(e)}") + return (False, f"ERRO_DE_VALIDACAO: {str(e)}") except Exception as e: return (False, str(e)) ``` diff --git a/docs/pt-BR/concepts/tools.mdx b/docs/pt-BR/concepts/tools.mdx index da8069bc1..d4ad6d1cb 100644 --- a/docs/pt-BR/concepts/tools.mdx +++ b/docs/pt-BR/concepts/tools.mdx @@ -67,17 +67,17 @@ web_rag_tool = WebsiteSearchTool() # Criar agentes 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.', + role='Analista de Mercado', + goal='Fornecer análise de mercado atualizada da indústria de IA', + backstory='Analista especialista com olhar atento para tendências de mercado.', 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.', + role='Redator de Conteúdo', + goal='Criar posts de blog envolventes sobre a indústria de IA', + backstory='Redator habilidoso com paixão por tecnologia.', tools=[docs_tool, file_tool], verbose=True ) diff --git a/docs/pt-BR/concepts/training.mdx b/docs/pt-BR/concepts/training.mdx index ca98005e8..83dc92c45 100644 --- a/docs/pt-BR/concepts/training.mdx +++ b/docs/pt-BR/concepts/training.mdx @@ -36,19 +36,18 @@ Para treinar sua crew de forma programática, siga estes passos: 3. Execute o comando de treinamento dentro de um bloco try-except para tratar possíveis erros. ```python Code -n_iterations = 2 -inputs = {"topic": "CrewAI Training"} -filename = "your_model.pkl" +n_iteracoes = 2 +entradas = {"topic": "Treinamento CrewAI"} +nome_arquivo = "seu_modelo.pkl" try: - YourCrewName_Crew().crew().train( - n_iterations=n_iterations, - inputs=inputs, - filename=filename + SuaCrew().crew().train( + n_iterations=n_iteracoes, + inputs=entradas, + filename=nome_arquivo ) - except Exception as e: - raise Exception(f"An error occurred while training the crew: {e}") + raise Exception(f"Ocorreu um erro ao treinar a crew: {e}") ``` ### Pontos Importantes diff --git a/docs/pt-BR/enterprise/features/hallucination-guardrail.mdx b/docs/pt-BR/enterprise/features/hallucination-guardrail.mdx index 5cdfab77a..d7698b0de 100644 --- a/docs/pt-BR/enterprise/features/hallucination-guardrail.mdx +++ b/docs/pt-BR/enterprise/features/hallucination-guardrail.mdx @@ -26,13 +26,13 @@ from crewai.tasks.hallucination_guardrail import HallucinationGuardrail from crewai import LLM # Uso básico - utiliza o expected_output da tarefa como contexto -guardrail = HallucinationGuardrail( +protecao = HallucinationGuardrail( llm=LLM(model="gpt-4o-mini") ) # Com contexto de referência explícito -context_guardrail = HallucinationGuardrail( - context="AI helps with various tasks including analysis and generation.", +protecao_com_contexto = HallucinationGuardrail( + context="IA ajuda em várias tarefas, incluindo análise e geração.", llm=LLM(model="gpt-4o-mini") ) ``` @@ -43,11 +43,11 @@ context_guardrail = HallucinationGuardrail( from crewai import Task # Crie sua tarefa com a proteção -task = Task( - description="Write a summary about AI capabilities", - expected_output="A factual summary based on the provided context", - agent=my_agent, - guardrail=guardrail # Adiciona a proteção para validar a saída +minha_tarefa = Task( + description="Escreva um resumo sobre as capacidades da IA", + expected_output="Um resumo factual baseado no contexto fornecido", + agent=meu_agente, + guardrail=protecao # Adiciona a proteção para validar a saída ) ``` @@ -59,8 +59,8 @@ Para validação mais rigorosa, é possível definir um limiar de fidelidade per ```python # Proteção rigorosa exigindo alta pontuação de fidelidade -strict_guardrail = HallucinationGuardrail( - context="Quantum computing uses qubits that exist in superposition states.", +protecao_rigorosa = HallucinationGuardrail( + context="Computação quântica utiliza qubits que existem em estados de superposição.", llm=LLM(model="gpt-4o-mini"), threshold=8.0 # Requer pontuação >= 8 para validar ) @@ -72,10 +72,10 @@ Se sua tarefa utiliza ferramentas, você pode incluir as respostas das ferrament ```python # Proteção com contexto de resposta da ferramenta -weather_guardrail = HallucinationGuardrail( - context="Current weather information for the requested location", +protecao_clima = HallucinationGuardrail( + context="Informações meteorológicas atuais para o local solicitado", llm=LLM(model="gpt-4o-mini"), - tool_response="Weather API returned: Temperature 22°C, Humidity 65%, Clear skies" + tool_response="API do Clima retornou: Temperatura 22°C, Umidade 65%, Céu limpo" ) ``` @@ -123,15 +123,15 @@ Quando uma proteção é adicionada à tarefa, ela valida automaticamente a saí ```python # Fluxo de validação de saída da tarefa -task_output = agent.execute_task(task) -validation_result = guardrail(task_output) +task_output = meu_agente.execute_task(minha_tarefa) +resultado_validacao = protecao(task_output) -if validation_result.valid: +if resultado_validacao.valid: # Tarefa concluída com sucesso return task_output else: # Tarefa falha com feedback de validação - raise ValidationError(validation_result.feedback) + raise ValidationError(resultado_validacao.feedback) ``` ### Rastreamento de Eventos @@ -151,10 +151,10 @@ A proteção se integra ao sistema de eventos do CrewAI para fornecer observabil Inclua todas as informações factuais relevantes nas quais a IA deve basear sua saída: ```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. + contexto = """ + Empresa XYZ foi fundada em 2020 e é especializada em soluções de energia renovável. + Possui 150 funcionários e faturou R$ 50 milhões em 2023. + Seus principais produtos incluem painéis solares e turbinas eólicas. """ ``` @@ -164,10 +164,10 @@ A proteção se integra ao sistema de eventos do CrewAI para fornecer observabil ```python # Bom: Contexto focado - context = "The current weather in New York is 18°C with light rain." + contexto = "O clima atual em Nova York é 18°C com chuva leve." # Evite: Informações irrelevantes - context = "The weather is 18°C. The city has 8 million people. Traffic is heavy." + contexto = "The weather is 18°C. The city has 8 million people. Traffic is heavy." ``` diff --git a/docs/pt-BR/enterprise/features/integrations.mdx b/docs/pt-BR/enterprise/features/integrations.mdx index 8cfd6a208..a5f34dd16 100644 --- a/docs/pt-BR/enterprise/features/integrations.mdx +++ b/docs/pt-BR/enterprise/features/integrations.mdx @@ -84,31 +84,31 @@ from crewai import Agent, Task, Crew from crewai_tools import CrewaiEnterpriseTools # Obtenha ferramentas enterprise (a ferramenta Gmail será incluída) -enterprise_tools = CrewaiEnterpriseTools( - enterprise_token="your_enterprise_token" +ferramentas_enterprise = CrewaiEnterpriseTools( + enterprise_token="seu_token_enterprise" ) # imprima as ferramentas -print(enterprise_tools) +printf(ferramentas_enterprise) # Crie um agente com capacidades do Gmail -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 +agente_email = Agent( + role="Gerente de E-mails", + goal="Gerenciar e organizar comunicações por e-mail", + backstory="Um assistente de IA especializado em gestão de e-mails e comunicação.", + tools=ferramentas_enterprise ) # Tarefa para enviar um e-mail -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" +tarefa_email = Task( + description="Redigir e enviar um e-mail de acompanhamento para john@example.com sobre a atualização do projeto", + agent=agente_email, + expected_output="Confirmação de que o e-mail foi enviado com sucesso" ) # Execute a tarefa crew = Crew( - agents=[email_agent], - tasks=[email_task] + agents=[agente_email], + tasks=[tarefa_email] ) # Execute o crew @@ -125,23 +125,23 @@ enterprise_tools = CrewaiEnterpriseTools( ) 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.", +agente_gmail = Agent( + role="Gerente do Gmail", + goal="Gerenciar comunicações e notificações do gmail", + backstory="Um assistente de IA que ajuda a coordenar comunicações no gmail.", 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" +tarefa_notificacao = Task( + description="Encontrar o e-mail de john@example.com", + agent=agente_gmail, + expected_output="E-mail encontrado de john@example.com" ) # Execute a tarefa crew = Crew( - agents=[slack_agent], - tasks=[notification_task] + agents=[agente_gmail], + tasks=[tarefa_notificacao] ) ``` diff --git a/docs/pt-BR/enterprise/features/tool-repository.mdx b/docs/pt-BR/enterprise/features/tool-repository.mdx index e3616a2b5..0d745532b 100644 --- a/docs/pt-BR/enterprise/features/tool-repository.mdx +++ b/docs/pt-BR/enterprise/features/tool-repository.mdx @@ -30,7 +30,7 @@ Antes de usar o Repositório de Ferramentas, certifique-se de que você possui: Para instalar uma ferramenta: ```bash -crewai tool install +crewai tool install ``` Isso instala a ferramenta e a adiciona ao `pyproject.toml`. @@ -40,7 +40,7 @@ Isso instala a ferramenta e a adiciona ao `pyproject.toml`. Para criar um novo projeto de ferramenta: ```bash -crewai tool create +crewai tool create ``` Isso gera um projeto de ferramenta estruturado localmente. @@ -76,7 +76,7 @@ Para atualizar uma ferramenta publicada: 3. Faça o commit das alterações e publique ```bash -git commit -m "Update version to 0.1.1" +git commit -m "Atualizar versão para 0.1.1" crewai tool publish ``` diff --git a/docs/pt-BR/enterprise/features/webhook-streaming.mdx b/docs/pt-BR/enterprise/features/webhook-streaming.mdx index ac4cbc5ee..c38e5e7d1 100644 --- a/docs/pt-BR/enterprise/features/webhook-streaming.mdx +++ b/docs/pt-BR/enterprise/features/webhook-streaming.mdx @@ -12,16 +12,17 @@ O Enterprise Event Streaming permite que você receba atualizações em tempo re Ao utilizar a API Kickoff, inclua um objeto `webhooks` em sua requisição, por exemplo: +# Exemplo de uso da API Kickoff com webhooks ```json { "inputs": {"foo": "bar"}, "webhooks": { "events": ["crew_kickoff_started", "llm_call_started"], - "url": "https://your.endpoint/webhook", + "url": "https://seu.endpoint/webhook", "realtime": false, "authentication": { "strategy": "bearer", - "token": "my-secret-token" + "token": "meu-token-secreto" } } } @@ -33,19 +34,20 @@ Se `realtime` estiver definido como `true`, cada evento será entregue individua Cada webhook envia uma lista de eventos: +# Exemplo de evento enviado pelo webhook ```json { "events": [ { - "id": "event-id", - "execution_id": "crew-run-id", + "id": "id-do-evento", + "execution_id": "id-da-execucao-do-crew", "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."} + {"role": "system", "content": "Você é um assistente."}, + {"role": "user", "content": "Resuma este artigo."} ] } } diff --git a/docs/pt-BR/learn/before-and-after-kickoff-hooks.mdx b/docs/pt-BR/learn/before-and-after-kickoff-hooks.mdx index 6e9e520bf..16cbd0e77 100644 --- a/docs/pt-BR/learn/before-and-after-kickoff-hooks.mdx +++ b/docs/pt-BR/learn/before-and-after-kickoff-hooks.mdx @@ -16,17 +16,17 @@ from crewai import CrewBase from crewai.project import before_kickoff @CrewBase -class MyCrew: +class MinhaEquipe: @before_kickoff - def prepare_data(self, inputs): - # Preprocess or modify inputs - inputs['processed'] = True - return inputs + def preparar_dados(self, entradas): + # Pré-processa ou modifica as entradas + entradas['processado'] = True + return entradas #... ``` -Neste exemplo, a função prepare_data modifica as entradas adicionando um novo par chave-valor indicando que as entradas foram processadas. +Neste exemplo, a função preparar_dados modifica as entradas adicionando um novo par chave-valor indicando que as entradas foram processadas. ## Hook Depois do Kickoff @@ -39,17 +39,17 @@ from crewai import CrewBase from crewai.project import after_kickoff @CrewBase -class MyCrew: +class MinhaEquipe: @after_kickoff - def log_results(self, result): - # Log or modify the results - print("Crew execution completed with result:", result) - return result + def registrar_resultados(self, resultado): + # Registra ou modifica os resultados + print("Execução da equipe concluída com resultado:", resultado) + return resultado # ... ``` -Na função `log_results`, os resultados da execução da crew são simplesmente impressos. Você pode estender isso para realizar operações mais complexas, como enviar notificações ou integrar com outros serviços. +Na função `registrar_resultados`, os resultados da execução da crew são simplesmente impressos. Você pode estender isso para realizar operações mais complexas, como enviar notificações ou integrar com outros serviços. ## Utilizando Ambos os Hooks diff --git a/docs/pt-BR/learn/customizing-agents.mdx b/docs/pt-BR/learn/customizing-agents.mdx index 27c411a97..fee56ad39 100644 --- a/docs/pt-BR/learn/customizing-agents.mdx +++ b/docs/pt-BR/learn/customizing-agents.mdx @@ -77,9 +77,9 @@ search_tool = SerperDevTool() # Inicialize o agente com opções avançadas agent = Agent( - role='Research Analyst', - goal='Provide up-to-date market analysis', - backstory='An expert analyst with a keen eye for market trends.', + role='Analista de Pesquisa', + goal='Fornecer análises de mercado atualizadas', + backstory='Um analista especialista com olhar atento para tendências de mercado.', tools=[search_tool], memory=True, # Ativa memória verbose=True, @@ -98,14 +98,9 @@ eficiência dentro do ecossistema CrewAI. Se necessário, a delegação pode ser ```python Code agent = Agent( - role='Content Writer', - goal='Write engaging content on market trends', - backstory='A seasoned writer with expertise in market analysis.', + role='Redator de Conteúdo', + goal='Escrever conteúdo envolvente sobre tendências de mercado', + backstory='Um redator experiente com expertise em análise de mercado.', allow_delegation=True # Habilitando delegação ) -``` - -## Conclusão - -Personalizar agentes no CrewAI definindo seus papéis, objetivos, histórias e ferramentas, juntamente com opções avançadas como personalização de modelo de linguagem, memória, ajustes de performance e preferências de delegação, -proporciona uma equipe de IA sofisticada e preparada para enfrentar desafios complexos. \ No newline at end of file +``` \ No newline at end of file diff --git a/docs/pt-BR/learn/kickoff-async.mdx b/docs/pt-BR/learn/kickoff-async.mdx index d52639c45..ab2d1b296 100644 --- a/docs/pt-BR/learn/kickoff-async.mdx +++ b/docs/pt-BR/learn/kickoff-async.mdx @@ -45,17 +45,17 @@ from crewai import Crew, Agent, Task # Create an agent with code execution enabled coding_agent = Agent( - role="Python Data Analyst", - goal="Analyze data and provide insights using Python", - backstory="You are an experienced data analyst with strong Python skills.", + role="Analista de Dados Python", + goal="Analisar dados e fornecer insights usando Python", + backstory="Você é um analista de dados experiente com fortes habilidades em Python.", allow_code_execution=True ) # Create a task that requires code execution data_analysis_task = Task( - description="Analyze the given dataset and calculate the average age of participants. Ages: {ages}", + description="Analise o conjunto de dados fornecido e calcule a idade média dos participantes. Idades: {ages}", agent=coding_agent, - expected_output="The average age of the participants." + expected_output="A idade média dos participantes." ) # Create a crew and add the task @@ -83,23 +83,23 @@ from crewai import Crew, Agent, Task # Create an agent with code execution enabled coding_agent = Agent( - role="Python Data Analyst", - goal="Analyze data and provide insights using Python", - backstory="You are an experienced data analyst with strong Python skills.", + role="Analista de Dados Python", + goal="Analisar dados e fornecer insights usando Python", + backstory="Você é um analista de dados experiente com fortes habilidades em Python.", allow_code_execution=True ) # Create tasks that require code execution task_1 = Task( - description="Analyze the first dataset and calculate the average age of participants. Ages: {ages}", + description="Analise o primeiro conjunto de dados e calcule a idade média dos participantes. Idades: {ages}", agent=coding_agent, - expected_output="The average age of the participants." + expected_output="A idade média dos participantes." ) task_2 = Task( - description="Analyze the second dataset and calculate the average age of participants. Ages: {ages}", + description="Analise o segundo conjunto de dados e calcule a idade média dos participantes. Idades: {ages}", agent=coding_agent, - expected_output="The average age of the participants." + expected_output="A idade média dos participantes." ) # Create two crews and add tasks diff --git a/docs/pt-BR/mcp/multiple-servers.mdx b/docs/pt-BR/mcp/multiple-servers.mdx index 5044e19c7..0cb698f21 100644 --- a/docs/pt-BR/mcp/multiple-servers.mdx +++ b/docs/pt-BR/mcp/multiple-servers.mdx @@ -43,11 +43,11 @@ try: with MCPServerAdapter(server_params_list) as aggregated_tools: print(f"Available aggregated tools: {[tool.name for tool in aggregated_tools]}") - multi_server_agent = Agent( - role="Versatile Assistant", - goal="Utilize tools from local Stdio, remote SSE, and remote HTTP MCP servers.", - backstory="An AI agent capable of leveraging a diverse set of tools from multiple sources.", - tools=aggregated_tools, # All tools are available here + agente_multiservidor = Agent( + role="Assistente Versátil", + goal="Utilizar ferramentas de servidores MCP locais Stdio, remotos SSE e remotos HTTP.", + backstory="Um agente de IA capaz de aproveitar um conjunto diversificado de ferramentas de múltiplas fontes.", + tools=aggregated_tools, # Todas as ferramentas estão disponíveis aqui verbose=True, ) diff --git a/docs/pt-BR/mcp/overview.mdx b/docs/pt-BR/mcp/overview.mdx index dbdc0638d..5ce4444c9 100644 --- a/docs/pt-BR/mcp/overview.mdx +++ b/docs/pt-BR/mcp/overview.mdx @@ -73,10 +73,10 @@ server_params = { with MCPServerAdapter(server_params) as mcp_tools: print(f"Available tools: {[tool.name for tool in mcp_tools]}") - my_agent = Agent( - role="MCP Tool User", - goal="Utilize tools from an MCP server.", - backstory="I can connect to MCP servers and use their tools.", + meu_agente = Agent( + role="Usuário de Ferramentas MCP", + goal="Utilizar ferramentas de um servidor MCP.", + backstory="Posso conectar a servidores MCP e usar suas ferramentas.", tools=mcp_tools, # Passe as ferramentas carregadas para o seu agente reasoning=True, verbose=True @@ -91,10 +91,10 @@ Este padrão geral mostra como integrar ferramentas. Para exemplos específicos with MCPServerAdapter(server_params) as mcp_tools: print(f"Available tools: {[tool.name for tool in mcp_tools]}") - my_agent = Agent( - role="MCP Tool User", - goal="Utilize tools from an MCP server.", - backstory="I can connect to MCP servers and use their tools.", + meu_agente = Agent( + role="Usuário de Ferramentas MCP", + goal="Utilizar ferramentas de um servidor MCP.", + backstory="Posso conectar a servidores MCP e usar suas ferramentas.", tools=mcp_tools["tool_name"], # Passe as ferramentas filtradas para o seu agente reasoning=True, verbose=True diff --git a/docs/pt-BR/mcp/sse.mdx b/docs/pt-BR/mcp/sse.mdx index 380a346e0..b637f1387 100644 --- a/docs/pt-BR/mcp/sse.mdx +++ b/docs/pt-BR/mcp/sse.mdx @@ -37,24 +37,24 @@ try: print(f"Available tools from SSE MCP server: {[tool.name for tool in tools]}") # Example: Using a tool from the SSE MCP server - sse_agent = Agent( - role="Remote Service User", - goal="Utilize a tool provided by a remote SSE MCP server.", - backstory="An AI agent that connects to external services via SSE.", + agente_sse = Agent( + role="Usuário de Serviço Remoto", + goal="Utilizar uma ferramenta fornecida por um servidor MCP remoto via SSE.", + backstory="Um agente de IA que conecta a serviços externos via SSE.", tools=tools, reasoning=True, verbose=True, ) sse_task = Task( - description="Fetch real-time stock updates for 'AAPL' using an SSE tool.", - expected_output="The latest stock price for AAPL.", - agent=sse_agent, + description="Buscar atualizações em tempo real das ações 'AAPL' usando uma ferramenta SSE.", + expected_output="O preço mais recente da ação AAPL.", + agent=agente_sse, markdown=True ) sse_crew = Crew( - agents=[sse_agent], + agents=[agente_sse], tasks=[sse_task], verbose=True, process=Process.sequential @@ -101,16 +101,16 @@ try: print(f"Available tools (manual SSE): {[tool.name for tool in tools]}") manual_sse_agent = Agent( - role="Remote Data Analyst", - goal="Analyze data fetched from a remote SSE MCP server using manual connection management.", - backstory="An AI skilled in handling SSE connections explicitly.", + role="Analista Remoto de Dados", + goal="Analisar dados obtidos de um servidor MCP remoto SSE usando gerenciamento manual de conexão.", + backstory="Um agente de IA especializado em gerenciar conexões SSE explicitamente.", tools=tools, verbose=True ) analysis_task = Task( - description="Fetch and analyze the latest user activity trends from the SSE server.", - expected_output="A summary report of user activity trends.", + description="Buscar e analisar as tendências mais recentes de atividade de usuários do servidor SSE.", + expected_output="Um relatório resumido das tendências de atividade dos usuários.", agent=manual_sse_agent ) diff --git a/docs/pt-BR/mcp/stdio.mdx b/docs/pt-BR/mcp/stdio.mdx index e256c11f6..01019aef6 100644 --- a/docs/pt-BR/mcp/stdio.mdx +++ b/docs/pt-BR/mcp/stdio.mdx @@ -38,24 +38,24 @@ with MCPServerAdapter(server_params) as tools: print(f"Available tools from Stdio MCP server: {[tool.name for tool in tools]}") # Exemplo: Usando as ferramentas do servidor MCP Stdio em um Agente CrewAI - research_agent = Agent( - role="Local Data Processor", - goal="Process data using a local Stdio-based tool.", - backstory="An AI that leverages local scripts via MCP for specialized tasks.", + pesquisador_local = Agent( + role="Processador Local de Dados", + goal="Processar dados usando uma ferramenta local baseada em Stdio.", + backstory="Uma IA que utiliza scripts locais via MCP para tarefas especializadas.", tools=tools, reasoning=True, verbose=True, ) processing_task = Task( - description="Process the input data file 'data.txt' and summarize its contents.", - expected_output="A summary of the processed data.", - agent=research_agent, + description="Processar o arquivo de dados de entrada 'data.txt' e resumir seu conteúdo.", + expected_output="Um resumo dos dados processados.", + agent=pesquisador_local, markdown=True ) data_crew = Crew( - agents=[research_agent], + agents=[pesquisador_local], tasks=[processing_task], verbose=True, process=Process.sequential @@ -95,16 +95,16 @@ try: # Exemplo: Usando as ferramentas com sua configuração de Agent, Task, Crew manual_agent = Agent( - role="Local Task Executor", - goal="Execute a specific local task using a manually managed Stdio tool.", - backstory="An AI proficient in controlling local processes via MCP.", + role="Executor Local de Tarefas", + goal="Executar uma tarefa local específica usando uma ferramenta Stdio gerenciada manualmente.", + backstory="Uma IA proficiente em controlar processos locais via MCP.", tools=tools, verbose=True ) manual_task = Task( - description="Execute the 'perform_analysis' command via the Stdio tool.", - expected_output="Results of the analysis.", + description="Executar o comando 'perform_analysis' via ferramenta Stdio.", + expected_output="Resultados da análise.", agent=manual_agent ) diff --git a/docs/pt-BR/mcp/streamable-http.mdx b/docs/pt-BR/mcp/streamable-http.mdx index 4201e7a83..12837af9f 100644 --- a/docs/pt-BR/mcp/streamable-http.mdx +++ b/docs/pt-BR/mcp/streamable-http.mdx @@ -35,22 +35,22 @@ try: with MCPServerAdapter(server_params) as tools: print(f"Available tools from Streamable HTTP MCP server: {[tool.name for tool in tools]}") - http_agent = Agent( - role="HTTP Service Integrator", - goal="Utilize tools from a remote MCP server via Streamable HTTP.", - backstory="An AI agent adept at interacting with complex web services.", + agente_http = Agent( + role="Integrador de Serviços HTTP", + goal="Utilizar ferramentas de um servidor MCP remoto via Streamable HTTP.", + backstory="Um agente de IA especializado em interagir com serviços web complexos.", tools=tools, verbose=True, ) http_task = Task( - description="Perform a complex data query using a tool from the Streamable HTTP server.", - expected_output="The result of the complex data query.", - agent=http_agent, + description="Realizar uma consulta de dados complexa usando uma ferramenta do servidor Streamable HTTP.", + expected_output="O resultado da consulta de dados complexa.", + agent=agente_http, ) http_crew = Crew( - agents=[http_agent], + agents=[agente_http], tasks=[http_task], verbose=True, process=Process.sequential @@ -91,16 +91,16 @@ try: print(f"Available tools (manual Streamable HTTP): {[tool.name for tool in tools]}") manual_http_agent = Agent( - role="Advanced Web Service User", - goal="Interact with an MCP server using manually managed Streamable HTTP connections.", - backstory="An AI specialist in fine-tuning HTTP-based service integrations.", + role="Usuário Avançado de Serviços Web", + goal="Interagir com um servidor MCP usando conexões HTTP Streamable gerenciadas manualmente.", + backstory="Um especialista em IA em ajustar integrações baseadas em HTTP.", tools=tools, verbose=True ) data_processing_task = Task( - description="Submit data for processing and retrieve results via Streamable HTTP.", - expected_output="Processed data or confirmation.", + description="Enviar dados para processamento e recuperar resultados via Streamable HTTP.", + expected_output="Dados processados ou confirmação.", agent=manual_http_agent ) diff --git a/docs/pt-BR/observability/arize-phoenix.mdx b/docs/pt-BR/observability/arize-phoenix.mdx index fade391ec..ab3f858a1 100644 --- a/docs/pt-BR/observability/arize-phoenix.mdx +++ b/docs/pt-BR/observability/arize-phoenix.mdx @@ -78,47 +78,40 @@ CrewAIInstrumentor().instrument(skip_dep_check=True, tracer_provider=tracer_prov search_tool = SerperDevTool() # Defina seus agentes com papéis e objetivos -researcher = Agent( - role="Senior Research Analyst", - goal="Uncover cutting-edge developments in AI and data science", - backstory="""You work at a leading tech think tank. - Your expertise lies in identifying emerging trends. - You have a knack for dissecting complex data and presenting actionable insights.""", +pesquisador = Agent( + role="Analista Sênior de Pesquisa", + goal="Descobrir os avanços mais recentes em IA e ciência de dados", + backstory=""" +Você trabalha em um importante think tank de tecnologia. Sua especialidade é identificar tendências emergentes. Você tem habilidade para dissecar dados complexos e apresentar insights acionáveis. +""", verbose=True, allow_delegation=False, - # You can pass an optional llm attribute specifying what model you wanna use. - # llm=ChatOpenAI(model_name="gpt-3.5", temperature=0.7), tools=[search_tool], ) writer = Agent( - role="Tech Content Strategist", - goal="Craft compelling content on tech advancements", - backstory="""You are a renowned Content Strategist, known for your insightful and engaging articles. - You transform complex concepts into compelling narratives.""", + role="Estrategista de Conteúdo Técnico", + goal="Criar conteúdo envolvente sobre avanços tecnológicos", + backstory="Você é um Estrategista de Conteúdo renomado, conhecido por seus artigos perspicazes e envolventes. Você transforma conceitos complexos em narrativas atraentes.", verbose=True, allow_delegation=True, ) # Crie tarefas para seus agentes task1 = Task( - description="""Conduct a comprehensive analysis of the latest advancements in AI in 2024. - Identify key trends, breakthrough technologies, and potential industry impacts.""", - expected_output="Full analysis report in bullet points", - agent=researcher, + description="Realize uma análise abrangente dos avanços mais recentes em IA em 2024. Identifique tendências-chave, tecnologias inovadoras e impactos potenciais na indústria.", + expected_output="Relatório analítico completo em tópicos", + agent=pesquisador, ) task2 = Task( - description="""Using the insights provided, develop an engaging blog - post that highlights the most significant AI advancements. - Your post should be informative yet accessible, catering to a tech-savvy audience. - Make it sound cool, avoid complex words so it doesn't sound like AI.""", - expected_output="Full blog post of at least 4 paragraphs", + description="Utilizando os insights fornecidos, desenvolva um blog envolvente destacando os avanços mais significativos em IA. O post deve ser informativo e acessível, voltado para um público técnico. Dê um tom interessante, evite palavras complexas para não soar como IA.", + expected_output="Post de blog completo com pelo menos 4 parágrafos", agent=writer, ) # Instancie seu crew com um processo sequencial crew = Crew( - agents=[researcher, writer], tasks=[task1, task2], verbose=1, process=Process.sequential + agents=[pesquisador, writer], tasks=[task1, task2], verbose=1, process=Process.sequential ) # Coloque seu crew para trabalhar! diff --git a/docs/pt-BR/observability/langfuse.mdx b/docs/pt-BR/observability/langfuse.mdx index 3423bae72..9f166c60e 100644 --- a/docs/pt-BR/observability/langfuse.mdx +++ b/docs/pt-BR/observability/langfuse.mdx @@ -76,20 +76,20 @@ from crewai_tools import ( web_rag_tool = WebsiteSearchTool() -writer = Agent( - role="Writer", - goal="Você torna a matemática envolvente e compreensível para crianças pequenas através de poesias", - backstory="Você é especialista em escrever haicais mas não sabe nada de matemática.", - tools=[web_rag_tool], - ) +escritor = Agent( + role="Escritor", + goal="Você torna a matemática envolvente e compreensível para crianças pequenas através de poesias", + backstory="Você é especialista em escrever haicais mas não sabe nada de matemática.", + tools=[web_rag_tool], +) -task = Task(description=("O que é {multiplicação}?"), - expected_output=("Componha um haicai que inclua a resposta."), - agent=writer) +tarefa = Task(description=("O que é {multiplicação}?"), + expected_output=("Componha um haicai que inclua a resposta."), + agent=escritor) -crew = Crew( - agents=[writer], - tasks=[task], +equipe = Crew( + agents=[escritor], + tasks=[tarefa], share_crew=False ) ``` diff --git a/docs/pt-BR/observability/langtrace.mdx b/docs/pt-BR/observability/langtrace.mdx index e2e5ecd80..a8f1bba5f 100644 --- a/docs/pt-BR/observability/langtrace.mdx +++ b/docs/pt-BR/observability/langtrace.mdx @@ -35,7 +35,7 @@ Essa integração permite o registro de hiperparâmetros, o monitoramento de reg ```python from langtrace_python_sdk import langtrace - langtrace.init(api_key='') + langtrace.init(api_key='') # Agora importe os módulos do CrewAI from crewai import Agent, Task, Crew diff --git a/docs/pt-BR/observability/maxim.mdx b/docs/pt-BR/observability/maxim.mdx index 84271b3ea..81f5f5585 100644 --- a/docs/pt-BR/observability/maxim.mdx +++ b/docs/pt-BR/observability/maxim.mdx @@ -73,26 +73,24 @@ instrument_crewai(logger) ### 4. Crie e execute sua aplicação CrewAI normalmente ```python - -# Crie seu agente -researcher = Agent( - role='Senior Research Analyst', - goal='Uncover cutting-edge developments in AI', - backstory="You are an expert researcher at a tech think tank...", +pesquisador = Agent( + role='Pesquisador Sênior', + goal='Descobrir os avanços mais recentes em IA', + backstory="Você é um pesquisador especialista em um think tank de tecnologia...", verbose=True, llm=llm ) # Defina a tarefa research_task = Task( - description="Research the latest AI advancements...", + description="Pesquise os avanços mais recentes em IA...", expected_output="", - agent=researcher + agent=pesquisador ) # Configure e execute a crew crew = Crew( - agents=[researcher], + agents=[pesquisador], tasks=[research_task], verbose=True ) diff --git a/docs/pt-BR/observability/mlflow.mdx b/docs/pt-BR/observability/mlflow.mdx index e1845cccd..2675cd493 100644 --- a/docs/pt-BR/observability/mlflow.mdx +++ b/docs/pt-BR/observability/mlflow.mdx @@ -70,22 +70,19 @@ O tracing fornece uma forma de registrar os inputs, outputs e metadados associad class TripAgents: def city_selection_agent(self): - return Agent( - role="City Selection Expert", - goal="Select the best city based on weather, season, and prices", - backstory="An expert in analyzing travel data to pick ideal destinations", - tools=[ - search_tool, - ], + especialista_cidades = Agent( + role="Especialista em Seleção de Cidades", + goal="Selecionar a melhor cidade com base no clima, estação e preços", + backstory="Especialista em analisar dados de viagem para escolher destinos ideais", + tools=[search_tool], verbose=True, ) def local_expert(self): - return Agent( - role="Local Expert at this city", - goal="Provide the BEST insights about the selected city", - backstory="""A knowledgeable local guide with extensive information - about the city, it's attractions and customs""", + especialista_local = Agent( + role="Especialista Local nesta cidade", + goal="Fornecer as MELHORES informações sobre a cidade selecionada", + backstory="Um guia local experiente com amplo conhecimento sobre a cidade, suas atrações e costumes", tools=[search_tool], verbose=True, ) @@ -96,53 +93,36 @@ O tracing fornece uma forma de registrar os inputs, outputs e metadados associad return Task( description=dedent( f""" - Analyze and select the best city for the trip based - on specific criteria such as weather patterns, seasonal - events, and travel costs. This task involves comparing - multiple cities, considering factors like current weather - conditions, upcoming cultural or seasonal events, and - overall travel expenses. - Your final answer must be a detailed - report on the chosen city, and everything you found out - about it, including the actual flight costs, weather - forecast and attractions. + Analise e selecione a melhor cidade para a viagem com base em critérios específicos como padrões climáticos, eventos sazonais e custos de viagem. Esta tarefa envolve comparar várias cidades, considerando fatores como condições climáticas atuais, eventos culturais ou sazonais e despesas gerais de viagem. + Sua resposta final deve ser um relatório detalhado sobre a cidade escolhida e tudo o que você descobriu sobre ela, incluindo custos reais de voo, previsão do tempo e atrações. - Traveling from: {origin} - City Options: {cities} - Trip Date: {range} - Traveler Interests: {interests} + Saindo de: {origin} + Opções de cidades: {cities} + Data da viagem: {range} + Interesses do viajante: {interests} """ ), agent=agent, - expected_output="Detailed report on the chosen city including flight costs, weather forecast, and attractions", + expected_output="Relatório detalhado sobre a cidade escolhida incluindo custos de voo, previsão do tempo e atrações", ) def gather_task(self, agent, origin, interests, range): return Task( description=dedent( f""" - As a local expert on this city you must compile an - in-depth guide for someone traveling there and wanting - to have THE BEST trip ever! - Gather information about key attractions, local customs, - special events, and daily activity recommendations. - Find the best spots to go to, the kind of place only a - local would know. - This guide should provide a thorough overview of what - the city has to offer, including hidden gems, cultural - hotspots, must-visit landmarks, weather forecasts, and - high level costs. - The final answer must be a comprehensive city guide, - rich in cultural insights and practical tips, - tailored to enhance the travel experience. + Como especialista local nesta cidade, você deve compilar um guia aprofundado para alguém que está viajando para lá e quer ter a MELHOR viagem possível! + Reúna informações sobre principais atrações, costumes locais, eventos especiais e recomendações de atividades diárias. + Encontre os melhores lugares para ir, aqueles que só um local conhece. + Este guia deve fornecer uma visão abrangente do que a cidade tem a oferecer, incluindo joias escondidas, pontos culturais, marcos imperdíveis, previsão do tempo e custos gerais. + A resposta final deve ser um guia completo da cidade, rico em insights culturais e dicas práticas, adaptado para aprimorar a experiência de viagem. - Trip Date: {range} - Traveling from: {origin} - Traveler Interests: {interests} + Data da viagem: {range} + Saindo de: {origin} + Interesses do viajante: {interests} """ ), agent=agent, - expected_output="Comprehensive city guide including hidden gems, cultural hotspots, and practical travel tips", + expected_output="Guia completo da cidade incluindo joias escondidas, pontos culturais e dicas práticas", ) @@ -189,7 +169,7 @@ O tracing fornece uma forma de registrar os inputs, outputs e metadados associad trip_crew = TripCrew("California", "Tokyo", "Dec 12 - Dec 20", "sports") result = trip_crew.run() - print(result) + print("Resultado da equipe:", result) ``` Consulte a [Documentação de Tracing do MLflow](https://mlflow.org/docs/latest/llms/tracing/index.html) para mais configurações e casos de uso. diff --git a/docs/pt-BR/observability/openlit.mdx b/docs/pt-BR/observability/openlit.mdx index 7f07b345a..1cdf64f08 100644 --- a/docs/pt-BR/observability/openlit.mdx +++ b/docs/pt-BR/observability/openlit.mdx @@ -69,10 +69,10 @@ Essa configuração permite acompanhar hiperparâmetros e monitorar problemas de openlit.init(disable_metrics=True) # Definir seus agentes - researcher = Agent( - role="Researcher", - goal="Conduct thorough research and analysis on AI and AI agents", - backstory="You're an expert researcher, specialized in technology, software engineering, AI, and startups. You work as a freelancer and are currently researching for a new client.", + pesquisador = Agent( + role="Pesquisador", + goal="Realizar pesquisas e análises aprofundadas sobre IA e agentes de IA", + backstory="Você é um pesquisador especialista em tecnologia, engenharia de software, IA e startups. Trabalha como freelancer e está atualmente pesquisando para um novo cliente.", allow_delegation=False, llm='command-r' ) @@ -80,24 +80,24 @@ Essa configuração permite acompanhar hiperparâmetros e monitorar problemas de # Definir sua task task = Task( - description="Generate a list of 5 interesting ideas for an article, then write one captivating paragraph for each idea that showcases the potential of a full article on this topic. Return the list of ideas with their paragraphs and your notes.", - expected_output="5 bullet points, each with a paragraph and accompanying notes.", + description="Gere uma lista com 5 ideias interessantes para um artigo e escreva um parágrafo cativante para cada ideia, mostrando o potencial de um artigo completo sobre o tema. Retorne a lista de ideias com seus parágrafos e suas anotações.", + expected_output="5 tópicos, cada um com um parágrafo e notas complementares.", ) # Definir o agente gerente - manager = Agent( - role="Project Manager", - goal="Efficiently manage the crew and ensure high-quality task completion", - backstory="You're an experienced project manager, skilled in overseeing complex projects and guiding teams to success. Your role is to coordinate the efforts of the crew members, ensuring that each task is completed on time and to the highest standard.", + gerente = Agent( + role="Gerente de Projeto", + goal="Gerenciar eficientemente a equipe e garantir a conclusão de tarefas de alta qualidade", + backstory="Você é um gerente de projetos experiente, habilidoso em supervisionar projetos complexos e guiar equipes para o sucesso. Sua função é coordenar os esforços dos membros da equipe, garantindo que cada tarefa seja concluída no prazo e com o mais alto padrão.", allow_delegation=True, llm='command-r' ) # Instanciar sua crew com um manager personalizado crew = Crew( - agents=[researcher], + agents=[pesquisador], tasks=[task], - manager_agent=manager, + manager_agent=gerente, process=Process.hierarchical, ) @@ -132,18 +132,18 @@ Essa configuração permite acompanhar hiperparâmetros e monitorar problemas de # Criar um agente com execução de código habilitada coding_agent = Agent( - role="Python Data Analyst", - goal="Analyze data and provide insights using Python", - backstory="You are an experienced data analyst with strong Python skills.", + role="Analista de Dados Python", + goal="Analisar dados e fornecer insights usando Python", + backstory="Você é um analista de dados experiente com fortes habilidades em Python.", allow_code_execution=True, llm="command-r" ) # Criar uma task que exige execução de código data_analysis_task = Task( - description="Analyze the given dataset and calculate the average age of participants. Ages: {ages}", + description="Analise o conjunto de dados fornecido e calcule a idade média dos participantes. Idades: {ages}", agent=coding_agent, - expected_output="5 bullet points, each with a paragraph and accompanying notes.", + expected_output="5 tópicos, cada um com um parágrafo e notas complementares.", ) # Criar uma crew e adicionar a task diff --git a/docs/pt-BR/observability/opik.mdx b/docs/pt-BR/observability/opik.mdx index 16479318f..e48cddf55 100644 --- a/docs/pt-BR/observability/opik.mdx +++ b/docs/pt-BR/observability/opik.mdx @@ -58,43 +58,43 @@ Neste guia, utilizaremos o exemplo de início rápido da CrewAI. from crewai import Agent, Crew, Task, Process - class YourCrewName: - def agent_one(self) -> Agent: + class NomeDaEquipe: + def agente_um(self) -> Agent: return Agent( - role="Data Analyst", - goal="Analyze data trends in the market", - backstory="An experienced data analyst with a background in economics", + role="Analista de Dados", + goal="Analisar tendências de dados no mercado", + backstory="Analista de dados experiente com formação em economia", verbose=True, ) - def agent_two(self) -> Agent: + def agente_dois(self) -> Agent: return Agent( - role="Market Researcher", - goal="Gather information on market dynamics", - backstory="A diligent researcher with a keen eye for detail", + role="Pesquisador de Mercado", + goal="Coletar informações sobre a dinâmica do mercado", + backstory="Pesquisador dedicado com olhar atento para detalhes", verbose=True, ) - def task_one(self) -> Task: + def tarefa_um(self) -> Task: return Task( - name="Collect Data Task", - description="Collect recent market data and identify trends.", - expected_output="A report summarizing key trends in the market.", - agent=self.agent_one(), + name="Tarefa de Coleta de Dados", + description="Coletar dados recentes do mercado e identificar tendências.", + expected_output="Um relatório resumindo as principais tendências do mercado.", + agent=self.agente_um(), ) - def task_two(self) -> Task: + def tarefa_dois(self) -> Task: return Task( - name="Market Research Task", - description="Research factors affecting market dynamics.", - expected_output="An analysis of factors influencing the market.", - agent=self.agent_two(), + name="Tarefa de Pesquisa de Mercado", + description="Pesquisar fatores que afetam a dinâmica do mercado.", + expected_output="Uma análise dos fatores que influenciam o mercado.", + agent=self.agente_dois(), ) - def crew(self) -> Crew: + def equipe(self) -> Crew: return Crew( - agents=[self.agent_one(), self.agent_two()], - tasks=[self.task_one(), self.task_two()], + agents=[self.agente_um(), self.agente_dois()], + tasks=[self.tarefa_um(), self.tarefa_dois()], process=Process.sequential, verbose=True, ) @@ -108,7 +108,7 @@ Neste guia, utilizaremos o exemplo de início rápido da CrewAI. track_crewai(project_name="crewai-integration-demo") - my_crew = YourCrewName().crew() + my_crew = NomeDaEquipe().equipe() result = my_crew.kickoff() print(result) diff --git a/docs/pt-BR/observability/patronus-evaluation.mdx b/docs/pt-BR/observability/patronus-evaluation.mdx index 83ccbd17a..8105a6cba 100644 --- a/docs/pt-BR/observability/patronus-evaluation.mdx +++ b/docs/pt-BR/observability/patronus-evaluation.mdx @@ -64,17 +64,17 @@ patronus_eval_tool = PatronusEvalTool() # Define an agent that uses the tool coding_agent = Agent( - role="Coding Agent", - goal="Generate high quality code and verify that the output is code", - backstory="An experienced coder who can generate high quality python code.", + role="Agente de Programação", + goal="Gerar código de alta qualidade e verificar se a saída é código", + backstory="Um programador experiente que pode gerar código Python de alta qualidade.", tools=[patronus_eval_tool], verbose=True, ) # Example task to generate and evaluate code generate_code_task = Task( - description="Create a simple program to generate the first N numbers in the Fibonacci sequence. Select the most appropriate evaluator and criteria for evaluating your output.", - expected_output="Program that generates the first N numbers in the Fibonacci sequence.", + description="Crie um programa simples para gerar os N primeiros números da sequência de Fibonacci. Selecione o avaliador e os critérios mais apropriados para avaliar sua saída.", + expected_output="Programa que gera os N primeiros números da sequência de Fibonacci.", agent=coding_agent, ) @@ -98,17 +98,17 @@ patronus_eval_tool = PatronusPredefinedCriteriaEvalTool( # Define an agent that uses the tool coding_agent = Agent( - role="Coding Agent", - goal="Generate high quality code", - backstory="An experienced coder who can generate high quality python code.", + role="Agente de Programação", + goal="Gerar código de alta qualidade", + backstory="Um programador experiente que pode gerar código Python de alta qualidade.", tools=[patronus_eval_tool], verbose=True, ) # Example task to generate code generate_code_task = Task( - description="Create a simple program to generate the first N numbers in the Fibonacci sequence.", - expected_output="Program that generates the first N numbers in the Fibonacci sequence.", + description="Crie um programa simples para gerar os N primeiros números da sequência de Fibonacci.", + expected_output="Programa que gera os N primeiros números da sequência de Fibonacci.", agent=coding_agent, ) @@ -149,17 +149,17 @@ patronus_eval_tool = PatronusLocalEvaluatorTool( # Define an agent that uses the tool coding_agent = Agent( - role="Coding Agent", - goal="Generate high quality code", - backstory="An experienced coder who can generate high quality python code.", + role="Agente de Programação", + goal="Gerar código de alta qualidade", + backstory="Um programador experiente que pode gerar código Python de alta qualidade.", tools=[patronus_eval_tool], verbose=True, ) # Example task to generate code generate_code_task = Task( - description="Create a simple program to generate the first N numbers in the Fibonacci sequence.", - expected_output="Program that generates the first N numbers in the Fibonacci sequence.", + description="Crie um programa simples para gerar os N primeiros números da sequência de Fibonacci.", + expected_output="Programa que gera os N primeiros números da sequência de Fibonacci.", agent=coding_agent, ) diff --git a/docs/pt-BR/observability/weave.mdx b/docs/pt-BR/observability/weave.mdx index 43dbeb370..f1eac5e92 100644 --- a/docs/pt-BR/observability/weave.mdx +++ b/docs/pt-BR/observability/weave.mdx @@ -50,48 +50,48 @@ O Weave captura automaticamente rastreamentos (traces) de suas aplicações Crew llm = LLM(model="gpt-4o", temperature=0) # Crie os agentes - researcher = Agent( - role='Research Analyst', - goal='Find and analyze the best investment opportunities', - backstory='Expert in financial analysis and market research', + pesquisador = Agent( + role='Analista de Pesquisa', + goal='Encontrar e analisar as melhores oportunidades de investimento', + backstory='Especialista em análise financeira e pesquisa de mercado', llm=llm, verbose=True, allow_delegation=False, ) - writer = Agent( - role='Report Writer', - goal='Write clear and concise investment reports', - backstory='Experienced in creating detailed financial reports', + redator = Agent( + role='Redator de Relatórios', + goal='Escrever relatórios de investimento claros e concisos', + backstory='Experiente na criação de relatórios financeiros detalhados', llm=llm, verbose=True, allow_delegation=False, ) # Crie as tarefas - research_task = Task( - description='Deep research on the {topic}', - expected_output='Comprehensive market data including key players, market size, and growth trends.', - agent=researcher + pesquisa = Task( + description='Pesquisa aprofundada sobre o {tema}', + expected_output='Dados de mercado abrangentes incluindo principais players, tamanho de mercado e tendências de crescimento.', + agent=pesquisador ) - writing_task = Task( - description='Write a detailed report based on the research', - expected_output='The report should be easy to read and understand. Use bullet points where applicable.', - agent=writer + redacao = Task( + description='Escreva um relatório detalhado com base na pesquisa', + expected_output='O relatório deve ser fácil de ler e entender. Use tópicos quando aplicável.', + agent=redator ) # Crie o crew - crew = Crew( - agents=[researcher, writer], - tasks=[research_task, writing_task], + equipe = Crew( + agents=[pesquisador, redator], + tasks=[pesquisa, redacao], verbose=True, process=Process.sequential, ) # Execute o crew - result = crew.kickoff(inputs={"topic": "AI in material science"}) - print(result) + resultado = equipe.kickoff(inputs={"tema": "IA em ciência dos materiais"}) + print(resultado) ``` diff --git a/docs/pt-BR/quickstart.mdx b/docs/pt-BR/quickstart.mdx index 715369ef5..0fa214d96 100644 --- a/docs/pt-BR/quickstart.mdx +++ b/docs/pt-BR/quickstart.mdx @@ -39,23 +39,19 @@ Siga os passos abaixo para começar a tripular! 🚣‍♂️ # src/latest_ai_development/config/agents.yaml researcher: role: > - {topic} Senior Data Researcher + Pesquisador Sênior de Dados em {topic} goal: > - Uncover cutting-edge developments in {topic} + Descobrir os avanços mais recentes em {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. + Você é um pesquisador experiente com talento para descobrir os últimos avanços em {topic}. Conhecido por sua habilidade em encontrar as informações mais relevantes e apresentá-las de forma clara e concisa. reporting_analyst: role: > - {topic} Reporting Analyst + Analista de Relatórios em {topic} goal: > - Create detailed reports based on {topic} data analysis and research findings + Criar relatórios detalhados com base na análise de dados e descobertas de pesquisa em {topic} 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. + Você é um analista meticuloso com um olhar atento aos detalhes. É conhecido por sua capacidade de transformar dados complexos em relatórios claros e concisos, facilitando o entendimento e a tomada de decisão por parte dos outros. ``` @@ -63,20 +59,19 @@ Siga os passos abaixo para começar a tripular! 🚣‍♂️ # src/latest_ai_development/config/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. + Realize uma pesquisa aprofundada sobre {topic}. + Certifique-se de encontrar informações interessantes e relevantes considerando que o ano atual é 2025. expected_output: > - A list with 10 bullet points of the most relevant information about {topic} + Uma lista com 10 tópicos dos dados mais relevantes sobre {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. + Revise o contexto obtido e expanda cada tópico em uma seção completa para um relatório. + Certifique-se de que o relatório seja detalhado e contenha todas as informações relevantes. expected_output: > - A fully fledge reports with the mains topics, each with a full section of information. - Formatted as markdown without '```' + Um relatório completo com os principais tópicos, cada um com uma seção detalhada de informações. + Formate como markdown sem usar '```' agent: reporting_analyst output_file: report.md ``` @@ -122,15 +117,15 @@ Siga os passos abaixo para começar a tripular! 🚣‍♂️ def reporting_task(self) -> Task: return Task( config=self.tasks_config['reporting_task'], # type: ignore[index] - output_file='output/report.md' # This is the file that will be contain the final report. + output_file='output/report.md' # Este é o arquivo que conterá o relatório final. ) @crew def crew(self) -> Crew: """Creates the LatestAiDevelopment crew""" return Crew( - agents=self.agents, # Automatically created by the @agent decorator - tasks=self.tasks, # Automatically created by the @task decorator + agents=self.agents, # Criado automaticamente pelo decorador @agent + tasks=self.tasks, # Criado automaticamente pelo decorador @task process=Process.sequential, verbose=True, ) @@ -229,7 +224,7 @@ Siga os passos abaixo para começar a tripular! 🚣‍♂️ ```markdown output/report.md - # Comprehensive Report on the Rise and Impact of AI Agents in 2025 + # Relatório Abrangente sobre a Ascensão e o Impacto dos Agentes de IA em 2025 ## 1. Introduction to AI Agents In 2025, Artificial Intelligence (AI) agents are at the forefront of innovation across various industries. As intelligent systems that can perform tasks typically requiring human cognition, AI agents are paving the way for significant advancements in operational efficiency, decision-making, and overall productivity within sectors like Human Resources (HR) and Finance. This report aims to detail the rise of AI agents, their frameworks, applications, and potential implications on the workforce. diff --git a/docs/pt-BR/tools/search-research/linkupsearchtool.mdx b/docs/pt-BR/tools/search-research/linkupsearchtool.mdx index 522b85a26..e4dee2eff 100644 --- a/docs/pt-BR/tools/search-research/linkupsearchtool.mdx +++ b/docs/pt-BR/tools/search-research/linkupsearchtool.mdx @@ -35,78 +35,18 @@ from crewai_tools import LinkupSearchTool from crewai import Agent import os -# Initialize the tool with your API key -linkup_tool = LinkupSearchTool(api_key=os.getenv("LINKUP_API_KEY")) +# Inicialize a ferramenta com sua chave de API +linkup_ferramenta = LinkupSearchTool(api_key=os.getenv("LINKUP_API_KEY")) -# Define an agent that uses the tool +# Defina um agente que usa a ferramenta @agent -def researcher(self) -> Agent: +def pesquisador(self) -> Agent: ''' - This agent uses the LinkupSearchTool to retrieve contextual information - from the Linkup API. + Este agente usa o LinkupSearchTool para recuperar informações contextuais + da API do Linkup. ''' return Agent( - config=self.agents_config["researcher"], - tools=[linkup_tool] + config=self.agentes_config["pesquisador"], + tools=[linkup_ferramenta] ) -``` - -## Parâmetros - -O `LinkupSearchTool` aceita os seguintes parâmetros: - -### Parâmetros do Construtor -- **api_key**: Obrigatório. Sua chave de API do Linkup. - -### Parâmetros de Execução -- **query**: Obrigatório. O termo ou frase de busca. -- **depth**: Opcional. A profundidade da busca. O padrão é "standard". -- **output_type**: Opcional. O tipo de saída. O padrão é "searchResults". - -## Uso Avançado - -Você pode personalizar os parâmetros de busca para resultados mais específicos: - -```python Code -# Perform a search with custom parameters -results = linkup_tool.run( - query="Women Nobel Prize Physics", - depth="deep", - output_type="searchResults" -) -``` - -## Formato de Retorno - -A ferramenta retorna resultados no seguinte formato: - -```json -{ - "success": true, - "results": [ - { - "name": "Result Title", - "url": "https://example.com/result", - "content": "Content of the result..." - }, - // Additional results... - ] -} -``` - -Se ocorrer um erro, a resposta será: - -```json -{ - "success": false, - "error": "Error message" -} -``` - -## Tratamento de Erros - -A ferramenta lida com erros de API de forma amigável e fornece feedback estruturado. Se a requisição à API falhar, a ferramenta retornará um dicionário com `success: false` e uma mensagem de erro. - -## Conclusão - -O `LinkupSearchTool` oferece uma forma integrada de incorporar as capacidades de busca de informações contextuais do Linkup aos seus agentes CrewAI. Ao utilizar esta ferramenta, os agentes podem acessar informações relevantes e atualizadas para aprimorar sua tomada de decisão e execução de tarefas. \ No newline at end of file +``` \ No newline at end of file