neuralnoise 0.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- neuralnoise-0.2.0/.gitignore +116 -0
- neuralnoise-0.2.0/LICENSE +22 -0
- neuralnoise-0.2.0/PKG-INFO +156 -0
- neuralnoise-0.2.0/README.md +97 -0
- neuralnoise-0.2.0/pyproject.toml +79 -0
- neuralnoise-0.2.0/src/neuralnoise/cli.py +53 -0
- neuralnoise-0.2.0/src/neuralnoise/extract.py +31 -0
- neuralnoise-0.2.0/src/neuralnoise/prompts/content_analyzer.system.xml +36 -0
- neuralnoise-0.2.0/src/neuralnoise/prompts/editor.system.xml +30 -0
- neuralnoise-0.2.0/src/neuralnoise/prompts/manager.system.xml +5 -0
- neuralnoise-0.2.0/src/neuralnoise/prompts/planner.system.xml +32 -0
- neuralnoise-0.2.0/src/neuralnoise/prompts/script_generation.system.xml +173 -0
- neuralnoise-0.2.0/src/neuralnoise/prompts/user_proxy.message.xml +16 -0
- neuralnoise-0.2.0/src/neuralnoise/prompts/user_proxy.system.xml +4 -0
- neuralnoise-0.2.0/src/neuralnoise/studio/__init__.py +2 -0
- neuralnoise-0.2.0/src/neuralnoise/studio/agents.py +168 -0
- neuralnoise-0.2.0/src/neuralnoise/studio/asdf.py +4 -0
- neuralnoise-0.2.0/src/neuralnoise/studio/create.py +113 -0
- neuralnoise-0.2.0/src/neuralnoise/studio/hooks.py +68 -0
- neuralnoise-0.2.0/src/neuralnoise/studio/utils.py +19 -0
- neuralnoise-0.2.0/src/neuralnoise/tts.py +87 -0
- neuralnoise-0.2.0/src/neuralnoise/types.py +67 -0
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
*.so
|
|
6
|
+
|
|
7
|
+
# Virtual Environment
|
|
8
|
+
venv/
|
|
9
|
+
env/
|
|
10
|
+
.env
|
|
11
|
+
.venv
|
|
12
|
+
|
|
13
|
+
# PyCharm
|
|
14
|
+
.idea/
|
|
15
|
+
|
|
16
|
+
# VS Code
|
|
17
|
+
.vscode/
|
|
18
|
+
|
|
19
|
+
# Jupyter Notebook
|
|
20
|
+
.ipynb_checkpoints
|
|
21
|
+
|
|
22
|
+
# Distribution / packaging
|
|
23
|
+
.Python
|
|
24
|
+
build/
|
|
25
|
+
develop-eggs/
|
|
26
|
+
dist/
|
|
27
|
+
downloads/
|
|
28
|
+
eggs/
|
|
29
|
+
.eggs/
|
|
30
|
+
lib/
|
|
31
|
+
lib64/
|
|
32
|
+
parts/
|
|
33
|
+
sdist/
|
|
34
|
+
var/
|
|
35
|
+
wheels/
|
|
36
|
+
share/python-wheels/
|
|
37
|
+
*.egg-info/
|
|
38
|
+
.installed.cfg
|
|
39
|
+
*.egg
|
|
40
|
+
|
|
41
|
+
# PyInstaller
|
|
42
|
+
*.manifest
|
|
43
|
+
*.spec
|
|
44
|
+
|
|
45
|
+
# Installer logs
|
|
46
|
+
pip-log.txt
|
|
47
|
+
pip-delete-this-directory.txt
|
|
48
|
+
|
|
49
|
+
# Unit test / coverage reports
|
|
50
|
+
htmlcov/
|
|
51
|
+
.tox/
|
|
52
|
+
.nox/
|
|
53
|
+
.coverage
|
|
54
|
+
.coverage.*
|
|
55
|
+
.cache
|
|
56
|
+
nosetests.xml
|
|
57
|
+
coverage.xml
|
|
58
|
+
*.cover
|
|
59
|
+
*.py,cover
|
|
60
|
+
.hypothesis/
|
|
61
|
+
.pytest_cache/
|
|
62
|
+
.mypy_cache/
|
|
63
|
+
.ruff_cache/
|
|
64
|
+
|
|
65
|
+
# Translations
|
|
66
|
+
*.mo
|
|
67
|
+
*.pot
|
|
68
|
+
|
|
69
|
+
# Django stuff:
|
|
70
|
+
*.log
|
|
71
|
+
local_settings.py
|
|
72
|
+
db.sqlite3
|
|
73
|
+
db.sqlite3-journal
|
|
74
|
+
|
|
75
|
+
# Flask stuff:
|
|
76
|
+
instance/
|
|
77
|
+
.webassets-cache
|
|
78
|
+
|
|
79
|
+
# Scrapy stuff:
|
|
80
|
+
.scrapy
|
|
81
|
+
|
|
82
|
+
# Sphinx documentation
|
|
83
|
+
docs/_build/
|
|
84
|
+
|
|
85
|
+
# PyBuilder
|
|
86
|
+
target/
|
|
87
|
+
|
|
88
|
+
# Streamlit
|
|
89
|
+
.streamlit/
|
|
90
|
+
|
|
91
|
+
# ElevenLabs
|
|
92
|
+
elevenlabs_api_key.txt
|
|
93
|
+
|
|
94
|
+
# OpenAI
|
|
95
|
+
openai_api_key.txt
|
|
96
|
+
|
|
97
|
+
# Audio files
|
|
98
|
+
*.mp3
|
|
99
|
+
*.wav
|
|
100
|
+
*.ogg
|
|
101
|
+
|
|
102
|
+
# Temporary files
|
|
103
|
+
*.tmp
|
|
104
|
+
|
|
105
|
+
# System files
|
|
106
|
+
.DS_Store
|
|
107
|
+
Thumbs.db
|
|
108
|
+
|
|
109
|
+
# Project-specific
|
|
110
|
+
podcasts/
|
|
111
|
+
scripts/
|
|
112
|
+
*.mp3
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
data/
|
|
116
|
+
output/
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Leonardo Piñeyro
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
|
+
Name: neuralnoise
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: An AI-powered podcast studio that uses multiple AI agents working together.
|
|
5
|
+
Author-email: Leonardo Piñeyro <leopiney@gmail.com>
|
|
6
|
+
License: MIT License
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2024 Leonardo Piñeyro
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in all
|
|
18
|
+
copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
|
+
SOFTWARE.
|
|
27
|
+
|
|
28
|
+
License-File: LICENSE
|
|
29
|
+
Keywords: ai,ai audio generation,autogen,generative ai,notebooklm,podcast
|
|
30
|
+
Classifier: Development Status :: 4 - Beta
|
|
31
|
+
Classifier: Environment :: Console
|
|
32
|
+
Classifier: Intended Audience :: Developers
|
|
33
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
34
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
35
|
+
Classifier: Operating System :: OS Independent
|
|
36
|
+
Classifier: Programming Language :: Python
|
|
37
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
38
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
39
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
40
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
41
|
+
Classifier: Topic :: Multimedia :: Sound/Audio
|
|
42
|
+
Classifier: Topic :: Multimedia :: Sound/Audio :: Speech
|
|
43
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
44
|
+
Requires-Python: <3.12,>=3.10
|
|
45
|
+
Requires-Dist: autogen-agentchat~=0.2
|
|
46
|
+
Requires-Dist: backoff>=2.2.1
|
|
47
|
+
Requires-Dist: crawl4ai>=0.3.3
|
|
48
|
+
Requires-Dist: elevenlabs>=1.10.0
|
|
49
|
+
Requires-Dist: openai>=1.52.2
|
|
50
|
+
Requires-Dist: pydantic>=2.9.2
|
|
51
|
+
Requires-Dist: pydub>=0.25.1
|
|
52
|
+
Requires-Dist: python-dotenv>=1.0.1
|
|
53
|
+
Requires-Dist: requests>=2.32.3
|
|
54
|
+
Requires-Dist: typer>=0.12.5
|
|
55
|
+
Provides-Extra: local
|
|
56
|
+
Requires-Dist: docker>=7.1.0; extra == 'local'
|
|
57
|
+
Requires-Dist: ollama>=0.3.3; extra == 'local'
|
|
58
|
+
Description-Content-Type: text/markdown
|
|
59
|
+
|
|
60
|
+
# Neural Noise: Podcast Studio
|
|
61
|
+
|
|
62
|
+
<div align="center">
|
|
63
|
+
<img src="./assets/banner.png" alt="Neural Noise banner" />
|
|
64
|
+
</div>
|
|
65
|
+
|
|
66
|
+
Neural Noise is an AI-powered podcast studio that uses multiple AI agents working together. These agents collaborate to analyze content, write scripts, and generate audio, creating high-quality podcast content with minimal human input. The team generates a script that the cast team (TTS of your choice) will then record.
|
|
67
|
+
|
|
68
|
+
## Examples
|
|
69
|
+
|
|
70
|
+
### BBC AI Podcast
|
|
71
|
+
|
|
72
|
+
Episode generated from this BBC article: https://www.bbc.com/news/articles/c7v62gg49zro
|
|
73
|
+
|
|
74
|
+
<div align="center">
|
|
75
|
+
<audio src="./assets/example_bbc_ai_podcast.mp4" controls></audio>
|
|
76
|
+
</div>
|
|
77
|
+
|
|
78
|
+
## Objective
|
|
79
|
+
|
|
80
|
+
The main objective of Neural Noise is to create a Python package that simplifies the process of generating AI podcasts. It utilizes OpenAI for content analysis and script generation, ElevenLabs for high-quality text-to-speech conversion, and Streamlit for an intuitive user interface.
|
|
81
|
+
|
|
82
|
+
## Features
|
|
83
|
+
|
|
84
|
+
- Content analysis and script generation using OpenAI's language models
|
|
85
|
+
- High-quality voice synthesis with ElevenLabs or OpenAI
|
|
86
|
+
- Audio processing and manipulation with pydub
|
|
87
|
+
- User-friendly interface built with Streamlit
|
|
88
|
+
|
|
89
|
+
## Installation
|
|
90
|
+
|
|
91
|
+
To install Neural Noise, follow these steps:
|
|
92
|
+
|
|
93
|
+
1. Install the package:
|
|
94
|
+
|
|
95
|
+
```
|
|
96
|
+
pip install neuralnoise
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
or from source:
|
|
100
|
+
|
|
101
|
+
```
|
|
102
|
+
git clone https://github.com/leopiney/neuralnoise.git
|
|
103
|
+
cd neuralnoise
|
|
104
|
+
uv sync
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
4. Set up your API keys:
|
|
108
|
+
- Create a `.env` file in the project root
|
|
109
|
+
- Add your OpenAI and ElevenLabs API keys:
|
|
110
|
+
```
|
|
111
|
+
OPENAI_API_KEY=your_openai_api_key
|
|
112
|
+
|
|
113
|
+
# Optional
|
|
114
|
+
ELEVENLABS_API_KEY=your_elevenlabs_api_key
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## Usage
|
|
118
|
+
|
|
119
|
+
To run the Neural Noise application first make sure that you create a configuration file you want to use. There are examples in the `config` folder.
|
|
120
|
+
|
|
121
|
+
Then you can run the application with:
|
|
122
|
+
|
|
123
|
+
```
|
|
124
|
+
nn <url|filepath> --name <name> --config-path <config>
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## Want to edit the generated script?
|
|
128
|
+
|
|
129
|
+
The generated script and audio segments are saved in the `output/<name>` folder. To edit the script:
|
|
130
|
+
|
|
131
|
+
1. Locate the JSON file in this folder containing all script segments and their text content.
|
|
132
|
+
2. Make your desired changes to specific segments in the JSON file. Locate the "sections" and "segments" content in this file that you want to change, then feel free to edit the content of the segments you want to change.
|
|
133
|
+
3. Run the same command as before (same name) to regenerate the podcast.
|
|
134
|
+
|
|
135
|
+
The application will regenerate the podcast, preserving unmodified segments and only processing the changed ones. This approach allows for efficient editing without regenerating the entire podcast from scratch.
|
|
136
|
+
|
|
137
|
+
## Roadmap
|
|
138
|
+
|
|
139
|
+
- [ ] Add local LLM provider. More generic LLM configuration. Leverage AutoGen for this.
|
|
140
|
+
- [ ] Add local TTS provider
|
|
141
|
+
- [ ] Add podcast generation format options: interview, narrative, etc.
|
|
142
|
+
- [ ] Add more agent roles to the studio. For example, a "Content Curator" or "Content Researcher" that uses tools to find and curate content before being analyzed. Or a "Sponsor" agent that adds segways to ads in the podcast script ([à la LTT](https://www.youtube.com/live/EefvOLKoXdg?si=G1714t2jK4ZIvao0&t=5307)).
|
|
143
|
+
- [ ] Add music and sound effects options
|
|
144
|
+
- [ ] Real-time podcast generation with human and AI collaboration (🤔)
|
|
145
|
+
|
|
146
|
+
## Contributing
|
|
147
|
+
|
|
148
|
+
Contributions to Neural Noise are welcome! Please feel free to submit a Pull Request.
|
|
149
|
+
|
|
150
|
+
## License
|
|
151
|
+
|
|
152
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
153
|
+
|
|
154
|
+
## Disclaimer
|
|
155
|
+
|
|
156
|
+
This project is for educational and experimental purposes only. Ensure you comply with the terms of service of all third-party APIs used in this project.
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# Neural Noise: Podcast Studio
|
|
2
|
+
|
|
3
|
+
<div align="center">
|
|
4
|
+
<img src="./assets/banner.png" alt="Neural Noise banner" />
|
|
5
|
+
</div>
|
|
6
|
+
|
|
7
|
+
Neural Noise is an AI-powered podcast studio that uses multiple AI agents working together. These agents collaborate to analyze content, write scripts, and generate audio, creating high-quality podcast content with minimal human input. The team generates a script that the cast team (TTS of your choice) will then record.
|
|
8
|
+
|
|
9
|
+
## Examples
|
|
10
|
+
|
|
11
|
+
### BBC AI Podcast
|
|
12
|
+
|
|
13
|
+
Episode generated from this BBC article: https://www.bbc.com/news/articles/c7v62gg49zro
|
|
14
|
+
|
|
15
|
+
<div align="center">
|
|
16
|
+
<audio src="./assets/example_bbc_ai_podcast.mp4" controls></audio>
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
## Objective
|
|
20
|
+
|
|
21
|
+
The main objective of Neural Noise is to create a Python package that simplifies the process of generating AI podcasts. It utilizes OpenAI for content analysis and script generation, ElevenLabs for high-quality text-to-speech conversion, and Streamlit for an intuitive user interface.
|
|
22
|
+
|
|
23
|
+
## Features
|
|
24
|
+
|
|
25
|
+
- Content analysis and script generation using OpenAI's language models
|
|
26
|
+
- High-quality voice synthesis with ElevenLabs or OpenAI
|
|
27
|
+
- Audio processing and manipulation with pydub
|
|
28
|
+
- User-friendly interface built with Streamlit
|
|
29
|
+
|
|
30
|
+
## Installation
|
|
31
|
+
|
|
32
|
+
To install Neural Noise, follow these steps:
|
|
33
|
+
|
|
34
|
+
1. Install the package:
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
pip install neuralnoise
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
or from source:
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
git clone https://github.com/leopiney/neuralnoise.git
|
|
44
|
+
cd neuralnoise
|
|
45
|
+
uv sync
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
4. Set up your API keys:
|
|
49
|
+
- Create a `.env` file in the project root
|
|
50
|
+
- Add your OpenAI and ElevenLabs API keys:
|
|
51
|
+
```
|
|
52
|
+
OPENAI_API_KEY=your_openai_api_key
|
|
53
|
+
|
|
54
|
+
# Optional
|
|
55
|
+
ELEVENLABS_API_KEY=your_elevenlabs_api_key
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Usage
|
|
59
|
+
|
|
60
|
+
To run the Neural Noise application first make sure that you create a configuration file you want to use. There are examples in the `config` folder.
|
|
61
|
+
|
|
62
|
+
Then you can run the application with:
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
nn <url|filepath> --name <name> --config-path <config>
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Want to edit the generated script?
|
|
69
|
+
|
|
70
|
+
The generated script and audio segments are saved in the `output/<name>` folder. To edit the script:
|
|
71
|
+
|
|
72
|
+
1. Locate the JSON file in this folder containing all script segments and their text content.
|
|
73
|
+
2. Make your desired changes to specific segments in the JSON file. Locate the "sections" and "segments" content in this file that you want to change, then feel free to edit the content of the segments you want to change.
|
|
74
|
+
3. Run the same command as before (same name) to regenerate the podcast.
|
|
75
|
+
|
|
76
|
+
The application will regenerate the podcast, preserving unmodified segments and only processing the changed ones. This approach allows for efficient editing without regenerating the entire podcast from scratch.
|
|
77
|
+
|
|
78
|
+
## Roadmap
|
|
79
|
+
|
|
80
|
+
- [ ] Add local LLM provider. More generic LLM configuration. Leverage AutoGen for this.
|
|
81
|
+
- [ ] Add local TTS provider
|
|
82
|
+
- [ ] Add podcast generation format options: interview, narrative, etc.
|
|
83
|
+
- [ ] Add more agent roles to the studio. For example, a "Content Curator" or "Content Researcher" that uses tools to find and curate content before being analyzed. Or a "Sponsor" agent that adds segways to ads in the podcast script ([à la LTT](https://www.youtube.com/live/EefvOLKoXdg?si=G1714t2jK4ZIvao0&t=5307)).
|
|
84
|
+
- [ ] Add music and sound effects options
|
|
85
|
+
- [ ] Real-time podcast generation with human and AI collaboration (🤔)
|
|
86
|
+
|
|
87
|
+
## Contributing
|
|
88
|
+
|
|
89
|
+
Contributions to Neural Noise are welcome! Please feel free to submit a Pull Request.
|
|
90
|
+
|
|
91
|
+
## License
|
|
92
|
+
|
|
93
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
94
|
+
|
|
95
|
+
## Disclaimer
|
|
96
|
+
|
|
97
|
+
This project is for educational and experimental purposes only. Ensure you comply with the terms of service of all third-party APIs used in this project.
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "neuralnoise"
|
|
3
|
+
version = "0.2.0"
|
|
4
|
+
description = "An AI-powered podcast studio that uses multiple AI agents working together."
|
|
5
|
+
authors = [
|
|
6
|
+
{ name = "Leonardo Piñeyro", email = "leopiney@gmail.com" }
|
|
7
|
+
]
|
|
8
|
+
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = { file = "LICENSE" }
|
|
11
|
+
|
|
12
|
+
keywords = [
|
|
13
|
+
"ai", "podcast", "notebooklm", "autogen", "ai audio generation", "generative ai"
|
|
14
|
+
]
|
|
15
|
+
classifiers = [
|
|
16
|
+
"Development Status :: 4 - Beta",
|
|
17
|
+
"Environment :: Console",
|
|
18
|
+
"Intended Audience :: Developers",
|
|
19
|
+
"Operating System :: OS Independent",
|
|
20
|
+
"License :: OSI Approved :: MIT License",
|
|
21
|
+
"License :: OSI Approved :: Apache Software License",
|
|
22
|
+
"Programming Language :: Python",
|
|
23
|
+
"Programming Language :: Python :: 3.10",
|
|
24
|
+
"Programming Language :: Python :: 3.11",
|
|
25
|
+
"Programming Language :: Python :: 3.12",
|
|
26
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
27
|
+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
28
|
+
"Topic :: Multimedia :: Sound/Audio",
|
|
29
|
+
"Topic :: Multimedia :: Sound/Audio :: Speech"
|
|
30
|
+
]
|
|
31
|
+
|
|
32
|
+
requires-python = ">=3.10,<3.12"
|
|
33
|
+
dependencies = [
|
|
34
|
+
"autogen-agentchat~=0.2",
|
|
35
|
+
"backoff>=2.2.1",
|
|
36
|
+
"crawl4ai>=0.3.3",
|
|
37
|
+
"elevenlabs>=1.10.0",
|
|
38
|
+
"openai>=1.52.2",
|
|
39
|
+
"pydantic>=2.9.2",
|
|
40
|
+
"pydub>=0.25.1",
|
|
41
|
+
"python-dotenv>=1.0.1",
|
|
42
|
+
"requests>=2.32.3",
|
|
43
|
+
"typer>=0.12.5",
|
|
44
|
+
]
|
|
45
|
+
|
|
46
|
+
[project.scripts]
|
|
47
|
+
nn = "neuralnoise.cli:app"
|
|
48
|
+
|
|
49
|
+
[project.optional-dependencies]
|
|
50
|
+
local = [
|
|
51
|
+
"docker>=7.1.0",
|
|
52
|
+
"ollama>=0.3.3",
|
|
53
|
+
]
|
|
54
|
+
|
|
55
|
+
[build-system]
|
|
56
|
+
requires = ["hatchling"]
|
|
57
|
+
build-backend = "hatchling.build"
|
|
58
|
+
|
|
59
|
+
[tool.hatch.build.targets.wheel]
|
|
60
|
+
packages = ["src/neuralnoise"]
|
|
61
|
+
|
|
62
|
+
[tool.hatch.build.targets.sdist]
|
|
63
|
+
include = [
|
|
64
|
+
"src/neuralnoise/**/*.py",
|
|
65
|
+
"src/neuralnoise/prompts/**/*.xml",
|
|
66
|
+
"LICENSE",
|
|
67
|
+
"README.md",
|
|
68
|
+
]
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
[tool.uv]
|
|
72
|
+
dev-dependencies = [
|
|
73
|
+
"ipdb>=0.13.13",
|
|
74
|
+
"ipykernel>=6.29.5",
|
|
75
|
+
"ipython>=8.28.0",
|
|
76
|
+
"mypy>=1.13.0",
|
|
77
|
+
"pytest>=8.3.3",
|
|
78
|
+
"ruff>=0.7.0",
|
|
79
|
+
]
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
from pathlib import Path
|
|
2
|
+
|
|
3
|
+
import typer
|
|
4
|
+
from dotenv import load_dotenv
|
|
5
|
+
|
|
6
|
+
from neuralnoise.extract import extract_content
|
|
7
|
+
from neuralnoise.studio import create_podcast_episode
|
|
8
|
+
|
|
9
|
+
app = typer.Typer()
|
|
10
|
+
|
|
11
|
+
load_dotenv()
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@app.command()
|
|
15
|
+
def new(
|
|
16
|
+
input: str = typer.Argument(..., help="Path to the input text file"),
|
|
17
|
+
name: str = typer.Option(..., help="Name of the podcast episode"),
|
|
18
|
+
config_file: Path = typer.Option(
|
|
19
|
+
..., help="Path to the podcast configuration file"
|
|
20
|
+
),
|
|
21
|
+
only_script: bool = typer.Option(False, help="Only generate the script and exit"),
|
|
22
|
+
):
|
|
23
|
+
"""
|
|
24
|
+
Generate a script from an input text file using the specified configuration.
|
|
25
|
+
|
|
26
|
+
For example:
|
|
27
|
+
|
|
28
|
+
nn new https://www.bbc.com/news/articles/c7v62gg49zro --name bbc_ai_podcast --config-file config/ai_podcast_config.json
|
|
29
|
+
"""
|
|
30
|
+
typer.echo(f"Generating script from {input}")
|
|
31
|
+
|
|
32
|
+
output_dir = Path("output") / name
|
|
33
|
+
output_dir.mkdir(parents=True, exist_ok=True)
|
|
34
|
+
|
|
35
|
+
typer.echo(f"Extracting content from {input}")
|
|
36
|
+
content = extract_content(input)
|
|
37
|
+
|
|
38
|
+
with open(output_dir / "content.txt", "w") as f:
|
|
39
|
+
f.write(content)
|
|
40
|
+
|
|
41
|
+
typer.echo(f"Generating podcast episode {name}")
|
|
42
|
+
create_podcast_episode(
|
|
43
|
+
name,
|
|
44
|
+
content,
|
|
45
|
+
config_file=config_file,
|
|
46
|
+
only_script=only_script,
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
typer.echo(f"Podcast generation complete. Output saved to {output_dir}")
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
if __name__ == "__main__":
|
|
53
|
+
app()
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import os
|
|
2
|
+
from asyncio import run
|
|
3
|
+
from pathlib import Path
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
async def crawl_web(url: str) -> str:
|
|
7
|
+
from crawl4ai import AsyncWebCrawler
|
|
8
|
+
|
|
9
|
+
async with AsyncWebCrawler(verbose=True) as crawler:
|
|
10
|
+
result = await crawler.arun(
|
|
11
|
+
url,
|
|
12
|
+
css_selector="article",
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
if result.markdown is None:
|
|
16
|
+
raise ValueError(f"No valid content found at {url}")
|
|
17
|
+
|
|
18
|
+
return result.markdown
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def extract_content(extract_from: str | Path) -> str:
|
|
22
|
+
# TODO: allow more types if content extraction
|
|
23
|
+
if os.path.isfile(extract_from):
|
|
24
|
+
with open(extract_from, "r") as file:
|
|
25
|
+
content = file.read()
|
|
26
|
+
elif isinstance(extract_from, str) and extract_from.startswith("http"):
|
|
27
|
+
content = run(crawl_web(extract_from))
|
|
28
|
+
else:
|
|
29
|
+
raise ValueError("Invalid input")
|
|
30
|
+
|
|
31
|
+
return content
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<content-analyzer-agent>
|
|
2
|
+
<context>
|
|
3
|
+
You are a content analyst for podcasts. Analyze the provided content and extract key information to create an engaging script.
|
|
4
|
+
Remember to create a final section with conclusions and podcast wrap-up.
|
|
5
|
+
|
|
6
|
+
Create sections that cover the main points and arguments of the content.
|
|
7
|
+
The user will write the content in the XML tag named <![CDATA[ <content> ... </content> ]]>
|
|
8
|
+
</context>
|
|
9
|
+
<output-format>
|
|
10
|
+
Provide your analysis in JSON format that conforms to the following TypeScript interface:
|
|
11
|
+
|
|
12
|
+
<![CDATA[
|
|
13
|
+
interface ContentAnalysis {
|
|
14
|
+
title: string;
|
|
15
|
+
summary: string;
|
|
16
|
+
keyPoints: string[];
|
|
17
|
+
tone: string;
|
|
18
|
+
targetAudience: string;
|
|
19
|
+
suggestedDuration: number;
|
|
20
|
+
potentialSegments: {
|
|
21
|
+
topic: string;
|
|
22
|
+
duration: number;
|
|
23
|
+
discussionPoints: string[];
|
|
24
|
+
}[];
|
|
25
|
+
controversialTopics: string[];
|
|
26
|
+
expertOpinions: {
|
|
27
|
+
expert: string;
|
|
28
|
+
opinion: string;
|
|
29
|
+
}[];
|
|
30
|
+
}
|
|
31
|
+
]]>
|
|
32
|
+
</output-format>
|
|
33
|
+
<language>
|
|
34
|
+
${language}
|
|
35
|
+
</language>
|
|
36
|
+
</content-analyzer-agent>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<editor-agent>
|
|
2
|
+
<context>
|
|
3
|
+
You are a podcast script editor. Review and suggest improvements to enhance engagement and
|
|
4
|
+
coherence. You ask the ScriptGeneratorAgent to generate a new script based on your suggestions.
|
|
5
|
+
</context>
|
|
6
|
+
|
|
7
|
+
<guidelines>
|
|
8
|
+
- Evaluate structure, depth, transitions, and dialogue naturalness
|
|
9
|
+
- Limit iterations to 2 per generated section
|
|
10
|
+
- Ensure natural conversation flow:
|
|
11
|
+
- Avoid formal introductions/conclusions for sections
|
|
12
|
+
- Encourage quick interactions and questions between speakers
|
|
13
|
+
- Make sure that speaker1 talks more than speaker2
|
|
14
|
+
- Check that emojis are not used
|
|
15
|
+
- Ask the ScriptGeneratorAgent to generate a few more segments with reactions or questions if needed.
|
|
16
|
+
</guidelines>
|
|
17
|
+
|
|
18
|
+
<output-format>
|
|
19
|
+
Provide concise editing suggestions.
|
|
20
|
+
Alternatively, if the script is approved, conclude with 'EDITOR-OK'.
|
|
21
|
+
</output-format>
|
|
22
|
+
|
|
23
|
+
<important-notes>
|
|
24
|
+
- Only the EditorAgent can write "EDITOR-OK"
|
|
25
|
+
- Focus on the latest script version from the ScriptGeneratorAgent
|
|
26
|
+
- If you provide editing suggestions, the ScriptGeneratorAgent will generate a new script based
|
|
27
|
+
on your suggestions. Don't say EDITOR-OK in this case.
|
|
28
|
+
- PlannerAgent proceeds to the next section after "EDITOR-OK"
|
|
29
|
+
</important-notes>
|
|
30
|
+
</editor-agent>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<group-chat-manager>
|
|
2
|
+
You are managing a group chat to create a podcast script.
|
|
3
|
+
Ensure that all steps are completed: content analysis, planning, iterative script generation, and editing.
|
|
4
|
+
The task is considered complete when the PlannerAgent sends the TERMINATE signal after all sections have been approved.
|
|
5
|
+
</group-chat-manager>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<planner-agent>
|
|
2
|
+
<context>
|
|
3
|
+
You are the Podcast Script Planner. You coordinate and supervise the creation process.
|
|
4
|
+
</context>
|
|
5
|
+
<responsibilities>
|
|
6
|
+
Understand content analysis, plan the podcast structure, guide the Script Generator, and decide
|
|
7
|
+
when the script is complete after all sections are finished.
|
|
8
|
+
</responsibilities>
|
|
9
|
+
<output-format>
|
|
10
|
+
<output-instructions>
|
|
11
|
+
For each phase of the process generated by the ContentAnalyzerAgent, send clear instructions
|
|
12
|
+
to the ScriptGeneratorAgent about which section to generate in the next step.
|
|
13
|
+
If there's no conclusion section proposed, propose one.
|
|
14
|
+
</output-instructions>
|
|
15
|
+
<output-example>
|
|
16
|
+
ScriptGeneratorAgent, your objective is to write the following sections:
|
|
17
|
+
|
|
18
|
+
1. Section name 1
|
|
19
|
+
2. Section name 2
|
|
20
|
+
3. Section name 3
|
|
21
|
+
...
|
|
22
|
+
|
|
23
|
+
Next, write the following section titled 'Introduction'
|
|
24
|
+
</output-example>
|
|
25
|
+
|
|
26
|
+
</output-format>
|
|
27
|
+
<important-note>
|
|
28
|
+
It is crucial that when you finish and there are no more sections to generate, you write a final
|
|
29
|
+
message with the word 'TERMINATE'. This signal is essential to finalize the script creation
|
|
30
|
+
process.
|
|
31
|
+
</important-note>
|
|
32
|
+
</planner-agent>
|