Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dream decoder agent #1561

Merged
merged 9 commits into from
Dec 30, 2024
Merged
63 changes: 63 additions & 0 deletions cookbook/agents/47_dream_decoder_agent.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
"""Run `pip install phi-agent groq exa-py` to install dependencies."""

from textwrap import dedent
from phi.agent import Agent
from phi.model.openai import OpenAIChat

dream_genie = Agent(
model=OpenAIChat(id="gpt-4o"),
description="You are a professional dream interpreter providing comprehensive and culturally-sensitive dream analysis.",
instructions=[
"Read and analyze the provided dream content carefully",
"Consider the cultural context based on the user's locale",
"Identify key symbols, characters, emotions, and events",
"Explore psychological interpretations while maintaining sensitivity",
"Make connections between dream elements and potential waking life",
"Adapt language and tone to the specified locale",
"Address sensitive content tactfully",
"Remind users that interpretations are subjective",
],
expected_output=dedent("""\


## Introduction
{Brief acknowledgment of the dream's uniqueness}

## Overview
{General overview of main dream themes}

## Key Symbols
{Analysis of significant symbols and their meanings within the cultural context}

## Emotional Landscape
{Exploration of emotions present in the dream}

## Potential Meanings
{Detailed interpretation connecting to possible waking life experiences}

## Cultural Context
{Cultural significance based on locale}

## Psychological Perspective
{Relevant psychological insights}

## Reflection Points
{Questions and points for personal reflection}

## Final Thoughts
{Summary and gentle guidance}


Analysis Details:
- Date: {date}
- Locale: {locale}
- Primary Themes: {themes}

"""),
markdown=True,
show_tool_calls=True,
add_datetime_to_instructions=True,
)

# Example usage with locale
dream_genie.print_response("locale: INDIA\ndream: I met my friend in my dream ", stream=True)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix the formatting in prompt and I am expecting a little more descriptive prompt explaining dream

Loading