Skip to content

Commit edcfea1

Browse files
Merge pull request #164 from MervinPraison/develop
Release version 0.0.74
2 parents 232ba25 + d2925c3 commit edcfea1

File tree

13 files changed

+1620
-402
lines changed

13 files changed

+1620
-402
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM python:3.11-slim
22
WORKDIR /app
33
COPY . .
4-
RUN pip install flask praisonai==0.0.73 gunicorn markdown
4+
RUN pip install flask praisonai==0.0.74 gunicorn markdown
55
EXPOSE 8080
66
CMD ["gunicorn", "-b", "0.0.0.0:8080", "api:app"]

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ Praison AI, leveraging both AutoGen and CrewAI or any other agent framework, rep
3535
| **UI** | Multi Agents such as CrewAI or AutoGen | [https://docs.praison.ai/ui/ui](https://docs.praison.ai/ui/ui) |
3636
| **Chat** | Chat with 100+ LLMs, single AI Agent | [https://docs.praison.ai/ui/chat](https://docs.praison.ai/ui/chat) |
3737
| **Code** | Chat with entire Codebase, single AI Agent | [https://docs.praison.ai/ui/code](https://docs.praison.ai/ui/code) |
38+
| **Realtime** | Real-time voice interaction with AI | [https://docs.praison.ai/ui/realtime](https://docs.praison.ai/ui/realtime) |
3839

3940
| Other Features | Description | Docs |
4041
|---|---|---|
@@ -56,6 +57,7 @@ Praison AI, leveraging both AutoGen and CrewAI or any other agent framework, rep
5657
| **PraisonAI Code** | `pip install "praisonai[code]"` |
5758
| **PraisonAI Chat** | `pip install "praisonai[chat]"` |
5859
| **PraisonAI Train** | `pip install "praisonai[train]"` |
60+
| **PraisonAI Realtime** | `pip install "praisonai[realtime]"` |
5961

6062
## Key Features
6163

@@ -68,6 +70,7 @@ Praison AI, leveraging both AutoGen and CrewAI or any other agent framework, rep
6870
- Custom Tool Integration
6971
- Internet Search Capability (using Crawl4AI and Tavily)
7072
- Vision Language Model (VLM) Support
73+
- Real-time Voice Interaction
7174

7275
## TL;DR Multi Agents
7376

docs/api/praisonai/deploy.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ <h2 id="raises">Raises</h2>
110110
file.write(&#34;FROM python:3.11-slim\n&#34;)
111111
file.write(&#34;WORKDIR /app\n&#34;)
112112
file.write(&#34;COPY . .\n&#34;)
113-
file.write(&#34;RUN pip install flask praisonai==0.0.73 gunicorn markdown\n&#34;)
113+
file.write(&#34;RUN pip install flask praisonai==0.0.74 gunicorn markdown\n&#34;)
114114
file.write(&#34;EXPOSE 8080\n&#34;)
115115
file.write(&#39;CMD [&#34;gunicorn&#34;, &#34;-b&#34;, &#34;0.0.0.0:8080&#34;, &#34;api:app&#34;]\n&#39;)
116116

docs/ui/realtime.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Realtime Voice Interface
2+
3+
The Realtime Voice Interface in PraisonAI provides an interactive, voice-based communication channel with AI models. This interface allows for real-time audio input and output, enabling a more natural and dynamic conversation experience.
4+
5+
## Features
6+
7+
- Real-time voice input processing
8+
- Text-to-speech output for AI responses
9+
- Seamless integration with OpenAI's realtime API
10+
- Support for various AI models
11+
- Persistent conversation history
12+
13+
## Getting Started
14+
15+
To use the Realtime Voice Interface, follow these steps:
16+
17+
1. Install PraisonAI with the realtime dependencies:
18+
```bash
19+
pip install "praisonai[realtime]"
20+
```
21+
22+
2. Set up your OpenAI API key:
23+
```bash
24+
export OPENAI_API_KEY="your-api-key-here"
25+
```
26+
27+
3. Launch the Realtime Voice Interface:
28+
```bash
29+
praisonai realtime
30+
```
31+
32+
## Usage
33+
34+
Once the interface is launched:
35+
36+
1. Click the microphone button or press 'P' to start voice input.
37+
2. Speak your message or query.
38+
3. The AI will process your input and respond with both text and voice.
39+
4. The conversation history is maintained for context in ongoing discussions.
40+
41+
## Configuration
42+
43+
You can configure various aspects of the Realtime Voice Interface:
44+
45+
- Model selection: Choose different AI models for processing.
46+
- Voice settings: Adjust voice characteristics for the AI's speech output.
47+
- Audio settings: Configure input/output audio formats and quality.
48+
49+
## Troubleshooting
50+
51+
If you encounter issues:
52+
53+
- Ensure your microphone is properly connected and permitted in your browser.
54+
- Check your internet connection for stable real-time communication.
55+
- Verify that your OpenAI API key is correctly set and has the necessary permissions.
56+
57+
For more detailed information and advanced usage, please refer to the [PraisonAI documentation](https://docs.praison.ai).

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ nav:
1818
- User Interface: ui/ui.md
1919
- Chat: ui/chat.md
2020
- Code: ui/code.md
21+
- Realtime: ui/realtime.md
2122
- Train: train.md
2223
- CrewAI: framework/crewai.md
2324
- AutoGen: framework/autogen.md

poetry.lock

Lines changed: 309 additions & 395 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

praisonai.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ class Praisonai < Formula
33

44
desc "AI tools for various AI applications"
55
homepage "https://github.com/MervinPraison/PraisonAI"
6-
url "https://github.com/MervinPraison/PraisonAI/archive/refs/tags/0.0.73.tar.gz"
6+
url "https://github.com/MervinPraison/PraisonAI/archive/refs/tags/0.0.74.tar.gz"
77
sha256 "1828fb9227d10f991522c3f24f061943a254b667196b40b1a3e4a54a8d30ce32" # Replace with actual SHA256 checksum
88
license "MIT"
99

praisonai/cli.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,10 @@ def main(self):
130130
self.create_code_interface()
131131
return
132132

133+
if getattr(args, 'realtime', False):
134+
self.create_realtime_interface()
135+
return
136+
133137
if args.agent_file == 'train':
134138
package_root = os.path.dirname(os.path.abspath(__file__))
135139
config_yaml_destination = os.path.join(os.getcwd(), 'config.yaml')
@@ -256,6 +260,7 @@ def parse_args(self):
256260
parser.add_argument("--hf", type=str, help="Hugging Face model name")
257261
parser.add_argument("--ollama", type=str, help="Ollama model name")
258262
parser.add_argument("--dataset", type=str, help="Dataset name for training", default="yahma/alpaca-cleaned")
263+
parser.add_argument("--realtime", action="store_true", help="Start the realtime voice interaction interface")
259264
args, unknown_args = parser.parse_known_args()
260265

261266
if unknown_args and unknown_args[0] == '-b' and unknown_args[1] == 'api:app':
@@ -270,6 +275,8 @@ def parse_args(self):
270275
if args.agent_file == 'code':
271276
args.ui = 'chainlit'
272277
args.code = True
278+
if args.agent_file == 'realtime':
279+
args.realtime = True
273280

274281
return args
275282

@@ -416,6 +423,29 @@ def create_chainlit_interface(self):
416423
else:
417424
print("ERROR: Chainlit is not installed. Please install it with 'pip install \"praisonai\[ui]\"' to use the UI.")
418425

426+
def create_realtime_interface(self):
427+
"""
428+
Create a Chainlit interface for the realtime voice interaction application.
429+
"""
430+
if CHAINLIT_AVAILABLE:
431+
import praisonai
432+
os.environ["CHAINLIT_PORT"] = "8088" # Ensure this port is not in use by another service
433+
root_path = os.path.join(os.path.expanduser("~"), ".praison")
434+
os.environ["CHAINLIT_APP_ROOT"] = root_path
435+
public_folder = os.path.join(os.path.dirname(praisonai.__file__), 'public')
436+
if not os.path.exists(os.path.join(root_path, "public")):
437+
if os.path.exists(public_folder):
438+
shutil.copytree(public_folder, os.path.join(root_path, "public"), dirs_exist_ok=True)
439+
logging.info("Public folder copied successfully!")
440+
else:
441+
logging.info("Public folder not found in the package.")
442+
else:
443+
logging.info("Public folder already exists.")
444+
realtime_ui_path = os.path.join(os.path.dirname(praisonai.__file__), 'ui', 'realtime.py')
445+
chainlit_run([realtime_ui_path])
446+
else:
447+
print("ERROR: Realtime UI is not installed. Please install it with 'pip install \"praisonai[realtime]\"' to use the realtime UI.")
448+
419449
if __name__ == "__main__":
420450
praison_ai = PraisonAI()
421451
praison_ai.main()

praisonai/deploy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def create_dockerfile(self):
5656
file.write("FROM python:3.11-slim\n")
5757
file.write("WORKDIR /app\n")
5858
file.write("COPY . .\n")
59-
file.write("RUN pip install flask praisonai==0.0.73 gunicorn markdown\n")
59+
file.write("RUN pip install flask praisonai==0.0.74 gunicorn markdown\n")
6060
file.write("EXPOSE 8080\n")
6161
file.write('CMD ["gunicorn", "-b", "0.0.0.0:8080", "api:app"]\n')
6262

0 commit comments

Comments
 (0)