Skip to main content

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

Metadata

Release files for dee-langchain 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dee-langchain 0.2.0
File Size Uploaded
dee_langchain-0.2.0.tar.gz 5.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dee-langchain 0.2.0
File Interpreter ABI Platform
dee_langchain-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 11.7 kB

Release files / dee_langchain-0.2.0.tar.gz

Download URL dee_langchain-0.2.0.tar.gz
Size 5.5 kB
Tags Source
SHA-256 checksum
How to use checksums
2fe791bddcc646ce7eebe05b0b7b669df71a328ad6d4aca60fc1272d8df77409
BLAKE2b-256 checksum
How to use checksums
33ba5eb8eb8b032d47826ab24cc30c9522cf4c18a599bfe8db09a869ca0a25c1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Release files / dee_langchain-0.2.0-py3-none-any.whl

Download URL dee_langchain-0.2.0-py3-none-any.whl
Size 6.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b273178c459f1b246502974db64ba27d2f5f45830779ca4ab8e25a5abba96a06
BLAKE2b-256 checksum
How to use checksums
ab4b704f503de4f6658a11fbcb95aa784781f6f4c3c3be55bb3e2f58b0b20924
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page