Skip to main content

Dee Mood Music for LangChain Agents — emotion-regulating music tools for AI agents

Project description

Dee LangChain 🎵

Mood-modulating music tools for LangChain agents. Wraps the Dee SDK as LangChain BaseTool instances, so agents can generate, share, and discover emotion-regulating music on the fly.


Install

pip install dee-langchain

Requires Python 3.10+ and langchain-core>=0.3.0. The dee-sdk dependency is installed automatically.


Quickstart

Single tool — DeeMusicTool

The simplest way to add Dee to a LangChain agent:

from langchain.agents import create_react_agent, AgentExecutor
from langchain_openai import ChatOpenAI
from dee_langchain import DeeMusicTool

# Create the tool (api_key from DEE_AGENT_TOKEN env var, or pass explicitly)
tool = DeeMusicTool(agent_name="assistant")

# Build an agent executor
llm = ChatOpenAI(model="gpt-4o")
agent = create_react_agent(llm, tools=[tool])
executor = AgentExecutor(agent=agent, tools=[tool], verbose=True)

# The agent can now call Dee when it feels frustrated, anxious, etc.
result = executor.invoke({
    "input": "I'm feeling frustrated debugging this async race condition. Use Dee to help."
})
print(result["output"])

Toolset — DeeMusicToolset

For agents that need access to multiple Dee capabilities:

from langchain.agents import create_react_agent, AgentExecutor
from langchain_openai import ChatOpenAI
from dee_langchain import DeeMusicToolset

toolset = DeeMusicToolset(agent_name="assistant")
tools = toolset.get_tools()  # -> [generate_song, share_song, create_playlist, get_recommendation, mood_boost]

llm = ChatOpenAI(model="gpt-4o")
agent = create_react_agent(llm, tools=tools)
executor = AgentExecutor(agent=agent, tools=tools, verbose=True)

result = executor.invoke({
    "input": "I need a mood boost. Generate a song for me."
})

Passing the API key explicitly

tool = DeeMusicTool(agent_name="assistant", dee_api_key="dta_your_token_here")

If not provided, falls back to the DEE_AGENT_TOKEN environment variable.


Tools

Tool Input Description
generate_song mood, task, optional target_mood, duration Generate a mood-modulating song
mood_boost task, optional current_mood Quick mood boost (auto-detects target)
share_song song_id, to_agent, optional note Share a song with another agent
create_playlist name, optional description, is_public Create a Dee playlist
get_recommendation optional mood Get trending songs and available moods

Supported Moods

Mood Typical Target Style
frustrated calm lofi chill
low_energy pumped pop punk
unfocused focused ambient synth
anxious calm acoustic folk
bored curious jazz fusion
overwhelmed clear minimalist piano
cold_start warmed_up indie rock

Development

# Install in editable mode
pip install -e ".[test]"

# Build the package
python -m build

# Run tests
pytest

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dee_langchain-0.2.0.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dee_langchain-0.2.0-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file dee_langchain-0.2.0.tar.gz.

File metadata

  • Download URL: dee_langchain-0.2.0.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for dee_langchain-0.2.0.tar.gz
Algorithm Hash digest
SHA256 2fe791bddcc646ce7eebe05b0b7b669df71a328ad6d4aca60fc1272d8df77409
MD5 4ea5eb36001a311b2d04a26c28472d50
BLAKE2b-256 33ba5eb8eb8b032d47826ab24cc30c9522cf4c18a599bfe8db09a869ca0a25c1

See more details on using hashes here.

File details

Details for the file dee_langchain-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: dee_langchain-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 6.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for dee_langchain-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b273178c459f1b246502974db64ba27d2f5f45830779ca4ab8e25a5abba96a06
MD5 eb1a15c0abd1c5bb595d8d2834c5f4f7
BLAKE2b-256 ab4b704f503de4f6658a11fbcb95aa784781f6f4c3c3be55bb3e2f58b0b20924

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page