# FridayMusic
This program reads your **Daily Notes** from [Obsidian](https://obsidian.md/) and uses AI to determine the "mood" for the entire week. It then recommends appropriate music according to your preferences and plays it automatically. It also recommends a drink for your listening session, based on the mood (can be disabled).
Technically, you can point it to any directory with Markdown files as long as they follow the same format as Obsidian's daily notes. It only reads the files that have been created in the last 7 days. The weekly mood is calculated based on weights, with Friday being the most important, then going backwards in the week.
# DSPy
The program uses the powerful [DSPy](https://github.com/stanfordnlp/dspy) framework for AI generation, due to its simplicity and flexibility. It is setup to use GPT 3.5, but it can be adapted to virtually any language model, local or otherwise, all without ever having to change the prompts.
In its current form, it uses only `dspy.Signature` classes. However, it would be fairly easy and more elegant to convert the entire program into a `dspy.Module` that calls those signature instances as needed in the `forward` function. That will have to be left for the future (PRs are welcome).
This program makes extensive use of the [Typed Predictors](https://dspy-docs.vercel.app/docs/building-blocks/typed_predictors) in order to enforce the Pydantic data types outputs.
## Configuration
You can configure your preferences primarily in two different files, `config.ini` and `config.py`. Eventually, I'd like to consolidate everything on a single file, but this is the current state.
After the installation, create a `.env` file in the main folder and ensure you have `OPENAI_API_KEY=xxxxxx` with your API key.
## Roon Integration
The program is integrated with [Roon](https://roon.app/en/) for music playback.
In the perfect world, I would have liked to create unique playlists, but the Roon API is limited to basic playback and some browsing functionality. It will not allow the direct creation of playlists. I also tried to do this via my music subscription of choice, [Qobuz](https://www.qobuz.com/us-en/discover), but they also lack a public API (shame).
The playback is a locking function unfortunately, so that means the program will need to run during the playback. However, you can Control-C at any point and then manipulate your queue directly on the Roon client.
## Installation
```
git clone https://github.com/RamXX/FridayMusic && cd FridayMusic
python3.11 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt -U
python fridaymusic
```
For Roon integration, you will need to `git clone https://github.com/pavoni/pyroon` separately, go to the `examples` directory, and run the `discovery.py` file. While you run this file, you need to open your Roon app, go to Settings -> Extensions, and authorize the extension listed.
This will create two files in the `examples` directory: `my_core_id_file` and `my_token_file`. Copy both files to the `FridayMusic` directory. If you change the names or locations, make sure you also change the settings under the `[Roon]` section in the `setup.ini` file.
## Disclaimer
Needless to say, I built this program for me, and it's tailored to my habit of enjoying 90 minutes of music in my dedicated audio room while enjoying a drink every Friday at 6 PM.
However, I figured I release it as an example on how easy it is to integrate DSPy and AI in general into specific tasks that require deterministic output formats. I hope this is useful to others in some form.
没有合适的资源?快使用搜索试试~ 我知道了~
该程序从Obsidian读取您的每日笔记,并使用人工智能来确定整周的“心情”
共10个文件
py:5个
txt:1个
gitignore:1个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 97 浏览量
2024-04-15
16:52:52
上传
评论
收藏 22KB ZIP 举报
温馨提示
该程序从Obsidian读取您的每日笔记,并使用人工智能来确定整周的“心情”。然后它会根据您的喜好推荐合适的音乐并自动播放。它还会根据心情为您的聆听会话推荐一杯饮料(可以禁用).zip
资源推荐
资源详情
资源评论
收起资源包目录
该程序从Obsidian读取您的每日笔记,并使用人工智能来确定整周的“心情”。然后它会根据您的喜好推荐合适的音乐并自动播放。它还会根据心情为您的聆听会话推荐一杯饮料(可以禁用).zip (10个子文件)
1
FridayMusic-main
roon_integration.py 2KB
drinks.py 3KB
LICENSE 34KB
config.ini 2KB
fridaymusic.py 2KB
obsidian.py 4KB
requirements.txt 109B
.gitignore 2KB
README.md 4KB
config.py 2KB
共 10 条
- 1
资源评论
GZM888888
- 粉丝: 176
- 资源: 2943
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功