PraisonAI 0.1.4__cp312-cp312-manylinux_2_35_x86_64.whl → 0.1.6__cp312-cp312-manylinux_2_35_x86_64.whl

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.

Potentially problematic release.


This version of PraisonAI might be problematic. Click here for more details.

praisonai/api/call.py CHANGED
@@ -6,18 +6,20 @@ import websockets
6
6
  from fastapi import FastAPI, WebSocket, Request
7
7
  from fastapi.responses import HTMLResponse
8
8
  from fastapi.websockets import WebSocketDisconnect
9
- from twilio.twiml.voice_response import VoiceResponse, Connect, Say, Stream
9
+ from twilio.twiml.voice_response import VoiceResponse, Connect
10
10
  from dotenv import load_dotenv
11
- import typer
12
11
  import uvicorn
13
- from pyngrok import ngrok
12
+ from pyngrok import ngrok, conf
14
13
  from rich import print
14
+ import argparse
15
15
 
16
16
  load_dotenv()
17
17
 
18
18
  # Configuration
19
- OPENAI_API_KEY = os.getenv('OPENAI_API_KEY') # requires OpenAI Realtime API Access
19
+ OPENAI_API_KEY = os.getenv('OPENAI_API_KEY') # requires OpenAI Realtime API Access
20
20
  PORT = int(os.getenv('PORT', 8090))
21
+ NGROK_AUTH_TOKEN = os.getenv('NGROK_AUTH_TOKEN')
22
+ PUBLIC = os.getenv('PUBLIC', 'false').lower() == 'true'
21
23
  SYSTEM_MESSAGE = (
22
24
  "You are a helpful and bubbly AI assistant who loves to chat about "
23
25
  "anything the user is interested in and is prepared to offer them facts. "
@@ -36,7 +38,7 @@ app = FastAPI()
36
38
  if not OPENAI_API_KEY:
37
39
  raise ValueError('Missing the OpenAI API key. Please set it in the .env file.')
38
40
 
39
- @app.get("/", response_class=HTMLResponse)
41
+ @app.get("/status", response_class=HTMLResponse)
40
42
  async def index_page():
41
43
  return """
42
44
  <html>
@@ -49,7 +51,7 @@ async def index_page():
49
51
  </html>
50
52
  """
51
53
 
52
- @app.api_route("/call", methods=["GET", "POST"])
54
+ @app.api_route("/", methods=["GET", "POST"])
53
55
  async def handle_incoming_call(request: Request):
54
56
  """Handle incoming call and return TwiML response to connect to Media Stream."""
55
57
  response = VoiceResponse()
@@ -153,36 +155,36 @@ async def send_session_update(openai_ws):
153
155
  print('Sending session update:', json.dumps(session_update))
154
156
  await openai_ws.send(json.dumps(session_update))
155
157
 
156
- def run_server(port: int, use_ngrok: bool = False):
158
+ def setup_public_url(port):
159
+ if NGROK_AUTH_TOKEN:
160
+ conf.get_default().auth_token = NGROK_AUTH_TOKEN
161
+ public_url = ngrok.connect(addr=str(port)).public_url
162
+ print(f"Praison AI Voice URL: {public_url}")
163
+ return public_url
164
+
165
+ def run_server(port: int, use_public: bool = False):
157
166
  """Run the FastAPI server using uvicorn."""
158
- if use_ngrok:
159
- public_url = ngrok.connect(port).public_url
160
- # print(f"Ngrok tunnel established: {public_url}")
161
- print(f"Praison AI Voice URL: {public_url}/call")
162
-
163
- print(f"Starting Praison AI Call Server on port {port}...")
167
+ if use_public:
168
+ setup_public_url(port)
169
+ else:
170
+ print(f"Starting Praison AI Call Server on http://localhost:{port}")
164
171
  uvicorn.run(app, host="0.0.0.0", port=port, log_level="warning")
165
172
 
166
- app_cli = typer.Typer()
167
-
168
- @app_cli.command()
169
- def main(
170
- port: int = typer.Option(8090, help="Port to run the server on"),
171
- ngrok: bool = typer.Option(False, help="Use ngrok to expose the server")
172
- ):
173
+ def main(args=None):
173
174
  """Run the Praison AI Call Server."""
174
- # print(f"Received port value: {port}") # Debug print
175
- # print(f"Use ngrok: {ngrok}") # Debug print
176
-
177
- # Extract the actual port value from the OptionInfo object
178
- if isinstance(port, typer.models.OptionInfo):
179
- port_value = port.default
175
+ parser = argparse.ArgumentParser(description="Run the Praison AI Call Server.")
176
+ parser.add_argument('--public', action='store_true', help="Use ngrok to expose the server publicly")
177
+ parser.add_argument('--port', type=int, default=PORT, help="Port to run the server on")
178
+
179
+ if args is None:
180
+ args = parser.parse_args()
180
181
  else:
181
- port_value = port
182
-
183
- port_int = int(port_value)
184
-
185
- run_server(port=port_int, use_ngrok=ngrok)
182
+ args = parser.parse_args(args)
183
+
184
+ port = args.port
185
+ use_public = args.public or PUBLIC
186
+
187
+ run_server(port=port, use_public=use_public)
186
188
 
187
189
  if __name__ == "__main__":
188
- app_cli()
190
+ main()
praisonai/cli.py CHANGED
@@ -137,7 +137,10 @@ class PraisonAI:
137
137
  return
138
138
 
139
139
  if getattr(args, 'call', False):
140
- call_module.main()
140
+ call_args = []
141
+ if args.public:
142
+ call_args.append('--public')
143
+ call_module.main(call_args)
141
144
  return
142
145
 
143
146
  if args.agent_file == 'train':
@@ -268,6 +271,7 @@ class PraisonAI:
268
271
  parser.add_argument("--dataset", type=str, help="Dataset name for training", default="yahma/alpaca-cleaned")
269
272
  parser.add_argument("--realtime", action="store_true", help="Start the realtime voice interaction interface")
270
273
  parser.add_argument("--call", action="store_true", help="Start the PraisonAI Call server")
274
+ parser.add_argument("--public", action="store_true", help="Use ngrok to expose the server publicly (only with --call)")
271
275
  args, unknown_args = parser.parse_known_args()
272
276
 
273
277
  if unknown_args and unknown_args[0] == '-b' and unknown_args[1] == 'api:app':
praisonai/deploy.py CHANGED
@@ -56,7 +56,7 @@ class CloudDeployer:
56
56
  file.write("FROM python:3.11-slim\n")
57
57
  file.write("WORKDIR /app\n")
58
58
  file.write("COPY . .\n")
59
- file.write("RUN pip install flask praisonai==0.1.4 gunicorn markdown\n")
59
+ file.write("RUN pip install flask praisonai==0.1.6 gunicorn markdown\n")
60
60
  file.write("EXPOSE 8080\n")
61
61
  file.write('CMD ["gunicorn", "-b", "0.0.0.0:8080", "api:app"]\n')
62
62
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PraisonAI
3
- Version: 0.1.4
3
+ Version: 0.1.6
4
4
  Summary: PraisonAI application combines AutoGen and CrewAI or similar frameworks into a low-code solution for building and managing multi-agent LLM systems, focusing on simplicity, customization, and efficient human-agent collaboration.
5
5
  Author: Mervin Praison
6
6
  Requires-Python: >=3.10,<3.13
@@ -47,7 +47,6 @@ Requires-Dist: python-dotenv (>=0.19.0) ; extra == "call"
47
47
  Requires-Dist: rich (>=13.7) ; extra == "call"
48
48
  Requires-Dist: tavily-python (==0.5.0) ; extra == "chat" or extra == "code" or extra == "realtime"
49
49
  Requires-Dist: twilio (>=7.0.0) ; extra == "call"
50
- Requires-Dist: typer (>=0.9.0) ; extra == "call"
51
50
  Requires-Dist: uvicorn (>=0.20.0) ; extra == "call"
52
51
  Requires-Dist: websockets (>=12.0) ; extra == "realtime" or extra == "call"
53
52
  Requires-Dist: yfinance (>=0.2.44) ; extra == "realtime"
@@ -1,11 +1,11 @@
1
1
  praisonai/__init__.py,sha256=JrgyPlzZfLlozoW7SHZ1nVJ63rLPR3ki2k5ZPywYrnI,175
2
2
  praisonai/__main__.py,sha256=MVgsjMThjBexHt4nhd760JCqvP4x0IQcwo8kULOK4FQ,144
3
3
  praisonai/agents_generator.py,sha256=8d1WRbubvEkBrW1HZ7_xnGyqgJi0yxmXa3MgTIqef1c,19127
4
- praisonai/api/call.py,sha256=Xu6S81QMJCXvCoj89_OH2wUJvsf27mY9g4appkEAkz4,7124
4
+ praisonai/api/call.py,sha256=6yVJqczuCnVYk3EIKsPzLYjSLC79IwD5o57mpGz9dxo,7277
5
5
  praisonai/auto.py,sha256=9spTXqj47Hmmqv5QHRYE_RzSVHH_KoPbaZjskUj2UcE,7895
6
6
  praisonai/chainlit_ui.py,sha256=bNR7s509lp0I9JlJNvwCZRUZosC64qdvlFCt8NmFamQ,12216
7
- praisonai/cli.py,sha256=IBFmyVP1y-yh9MsVXxv9-sarZSvDph7-Ljv6UPm45g0,20430
8
- praisonai/deploy.py,sha256=NlwR5BLyWV10dkq6F_JqFKkQsWDnSBZrrDVCKDSXOI8,6027
7
+ praisonai/cli.py,sha256=BlVEsQW45pbYoqAtm-EiNpoHt8BFKX5frsbJ9s-tko0,20667
8
+ praisonai/deploy.py,sha256=tXQBqMtNxOYuTKBeUkhz6UTAfJMhYJ1CBtw5W8Jc-pM,6027
9
9
  praisonai/inbuilt_tools/__init__.py,sha256=mUKnbL6Gram9c9f2m8wJwEzURBLmPEOcHzwySBH89YA,74
10
10
  praisonai/inbuilt_tools/autogen_tools.py,sha256=svYkM2N7DVFvbiwgoAS7U_MqTOD8rHf8VD3BaFUV5_Y,14907
11
11
  praisonai/inc/__init__.py,sha256=sPDlYBBwdk0VlWzaaM_lG0_LD07lS2HRGvPdxXJFiYg,62
@@ -46,8 +46,8 @@ praisonai/ui/realtimeclient/realtimedocs.txt,sha256=hmgd8Uwy2SkjSndyyF_-ZOaNxiyH
46
46
  praisonai/ui/realtimeclient/tools.py,sha256=IJOYwVOBW5Ocn5_iV9pFkmSKR3WU3YpX3kwF0I3jikQ,7855
47
47
  praisonai/ui/sql_alchemy.py,sha256=kf025P_37C505YDDJZ-dPSmN_d62J2DCrkxbDAzXyrM,29884
48
48
  praisonai/version.py,sha256=ugyuFliEqtAwQmH4sTlc16YXKYbFWDmfyk87fErB8-8,21
49
- praisonai-0.1.4.dist-info/LICENSE,sha256=kqvFysVlnFxYOu0HxCe2HlmZmJtdmNGOxWRRkT9TsWc,1035
50
- praisonai-0.1.4.dist-info/METADATA,sha256=QhoTv6W2AE5a-CFiGMtVHqREY2xSwM85Tb9rjsoVKIE,13340
51
- praisonai-0.1.4.dist-info/WHEEL,sha256=Ie8mbC-etDUh6aDhzdvvvp_A-4mQQX7whlOFBnSJhcE,110
52
- praisonai-0.1.4.dist-info/entry_points.txt,sha256=LT8Ie95dy4JkUlpgS0YyvD4Tf9zTstjaXISJnijDxoM,172
53
- praisonai-0.1.4.dist-info/RECORD,,
49
+ praisonai-0.1.6.dist-info/LICENSE,sha256=kqvFysVlnFxYOu0HxCe2HlmZmJtdmNGOxWRRkT9TsWc,1035
50
+ praisonai-0.1.6.dist-info/METADATA,sha256=8_nLIQ4kHTff3Kmb3RMWJdf3bkKDw7sOWifoC5jVF2I,13291
51
+ praisonai-0.1.6.dist-info/WHEEL,sha256=Ie8mbC-etDUh6aDhzdvvvp_A-4mQQX7whlOFBnSJhcE,110
52
+ praisonai-0.1.6.dist-info/entry_points.txt,sha256=LT8Ie95dy4JkUlpgS0YyvD4Tf9zTstjaXISJnijDxoM,172
53
+ praisonai-0.1.6.dist-info/RECORD,,