<@UKTUC906M> <@U03FYEHGY57> <@U02GMEZU18B> I was c...
# marvin-ai
r
@Jeremiah @Bianca Hoch @Nate I was correlating the prefect cloud logs with the controlflow logs in my local, and it seems like on the local server, the orchestrator was called twice, while on the prefect cloud, the log only shows one orchestrator call. Have attached the code snippet, and the logs in the thread.
logs.txt
Screenshot 2024-12-13 at 9.22.58 PM.png
n
hi @Rajan Sharma - please do not tag everyone like this. feel free to create an issue on the controlflow repo
r
Copy code
import controlflow as cf
from typing import List, Dict

text_analyst = cf.Agent(
    name="Text Analyst",
    description="An AI agent specialized in analyzing and processing text",
    instructions="""
    You are an expert at analyzing text and extracting key information.
    Follow these guidelines:
    1. Be thorough in your analysis
    2. Focus on key themes and patterns
    3. Provide clear, structured output
    """
)

theme_extractor = cf.Agent(
    name="Theme Extractor",
    description="An AI agent specialized in extracting key themes from text",
    instructions="""
    You are an expert at analyzing text and extracting key information.
    Follow these guidelines:
    1. Be thorough in your analysis
    2. Focus on key themes and patterns
    3. Provide clear, structured output
    """
)

if __name__ == "__main__":
    sample_text = """
    Artificial intelligence has transformed many industries, 
    from healthcare to transportation. As these technologies evolve,
    we must consider both their benefits and potential risks.
    """

    theme_task = cf.Task(
        "Extract key themes from the input text",
        context={"input_text": sample_text},
        result_type=List[str],
        agents=[theme_extractor, text_analyst],
    )

    analysis_task = cf.Task(
        "Generate a detailed analysis based on the themes",
        result_type=Dict,
        agents=[theme_extractor, text_analyst],
    )

    @cf.flow()
    def my_flow():
        cf.run_tasks([theme_task, analysis_task])

    my_flow()
sure, thanks @Nate, will do