PraisonAI 2.2.36__cp313-cp313-manylinux_2_39_x86_64.whl → 2.2.38__cp313-cp313-manylinux_2_39_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/deploy.py CHANGED
@@ -1,5 +1,6 @@
1
1
  import subprocess
2
2
  import os
3
+ import platform
3
4
  from dotenv import load_dotenv
4
5
 
5
6
  class CloudDeployer:
@@ -56,7 +57,7 @@ class CloudDeployer:
56
57
  file.write("FROM python:3.11-slim\n")
57
58
  file.write("WORKDIR /app\n")
58
59
  file.write("COPY . .\n")
59
- file.write("RUN pip install flask praisonai==2.2.36 gunicorn markdown\n")
60
+ file.write("RUN pip install flask praisonai==2.2.38 gunicorn markdown\n")
60
61
  file.write("EXPOSE 8080\n")
61
62
  file.write('CMD ["gunicorn", "-b", "0.0.0.0:8080", "api:app"]\n')
62
63
 
@@ -116,20 +117,66 @@ class CloudDeployer:
116
117
  self.create_api_file()
117
118
  self.create_dockerfile()
118
119
  """Runs a sequence of shell commands for deployment, continues on error."""
120
+
121
+ # Get project ID upfront for Windows compatibility
122
+ try:
123
+ result = subprocess.run(['gcloud', 'config', 'get-value', 'project'],
124
+ capture_output=True, text=True, check=True)
125
+ project_id = result.stdout.strip()
126
+ except subprocess.CalledProcessError:
127
+ print("ERROR: Failed to get GCP project ID. Ensure gcloud is configured.")
128
+ return
129
+
130
+ # Get environment variables
131
+ openai_model = os.environ.get('OPENAI_MODEL_NAME', 'gpt-4o')
132
+ openai_key = os.environ.get('OPENAI_API_KEY', 'Enter your API key')
133
+ openai_base = os.environ.get('OPENAI_API_BASE', 'https://api.openai.com/v1')
134
+
135
+ # Build commands with actual values
119
136
  commands = [
120
- "yes | gcloud auth configure-docker us-central1-docker.pkg.dev",
121
- "gcloud artifacts repositories create praisonai-repository --repository-format=docker --location=us-central1",
122
- "docker build --platform linux/amd64 -t gcr.io/$(gcloud config get-value project)/praisonai-app:latest .",
123
- "docker tag gcr.io/$(gcloud config get-value project)/praisonai-app:latest us-central1-docker.pkg.dev/$(gcloud config get-value project)/praisonai-repository/praisonai-app:latest",
124
- "docker push us-central1-docker.pkg.dev/$(gcloud config get-value project)/praisonai-repository/praisonai-app:latest",
125
- "gcloud run deploy praisonai-service --image us-central1-docker.pkg.dev/$(gcloud config get-value project)/praisonai-repository/praisonai-app:latest --platform managed --region us-central1 --allow-unauthenticated --set-env-vars OPENAI_MODEL_NAME=${OPENAI_MODEL_NAME},OPENAI_API_KEY=${OPENAI_API_KEY},OPENAI_API_BASE=${OPENAI_API_BASE}"
137
+ ['gcloud', 'auth', 'configure-docker', 'us-central1-docker.pkg.dev'],
138
+ ['gcloud', 'artifacts', 'repositories', 'create', 'praisonai-repository',
139
+ '--repository-format=docker', '--location=us-central1'],
140
+ ['docker', 'build', '--platform', 'linux/amd64', '-t',
141
+ f'gcr.io/{project_id}/praisonai-app:latest', '.'],
142
+ ['docker', 'tag', f'gcr.io/{project_id}/praisonai-app:latest',
143
+ f'us-central1-docker.pkg.dev/{project_id}/praisonai-repository/praisonai-app:latest'],
144
+ ['docker', 'push',
145
+ f'us-central1-docker.pkg.dev/{project_id}/praisonai-repository/praisonai-app:latest'],
146
+ ['gcloud', 'run', 'deploy', 'praisonai-service',
147
+ '--image', f'us-central1-docker.pkg.dev/{project_id}/praisonai-repository/praisonai-app:latest',
148
+ '--platform', 'managed', '--region', 'us-central1', '--allow-unauthenticated',
149
+ '--set-env-vars', f'OPENAI_MODEL_NAME={openai_model},OPENAI_API_KEY={openai_key},OPENAI_API_BASE={openai_base}']
126
150
  ]
127
-
128
- for cmd in commands:
151
+
152
+ # Run commands with appropriate handling for each platform
153
+ for i, cmd in enumerate(commands):
129
154
  try:
130
- subprocess.run(cmd, shell=True, check=True)
155
+ if i == 0: # First command (gcloud auth configure-docker)
156
+ if platform.system() != 'Windows':
157
+ # On Unix, pipe 'yes' to auto-confirm
158
+ proc = subprocess.Popen(cmd, stdin=subprocess.PIPE)
159
+ proc.communicate(input=b'Y\n')
160
+ if proc.returncode != 0:
161
+ raise subprocess.CalledProcessError(proc.returncode, cmd)
162
+ else:
163
+ # On Windows, try with --quiet flag to avoid prompts
164
+ cmd_with_quiet = cmd + ['--quiet']
165
+ try:
166
+ subprocess.run(cmd_with_quiet, check=True)
167
+ except subprocess.CalledProcessError:
168
+ # If --quiet fails, try without it
169
+ print("Note: You may need to manually confirm the authentication prompt")
170
+ subprocess.run(cmd, check=True)
171
+ else:
172
+ # Run other commands normally
173
+ subprocess.run(cmd, check=True)
131
174
  except subprocess.CalledProcessError as e:
132
- print(f"ERROR: Command '{e.cmd}' failed with exit status {e.returncode}")
175
+ print(f"ERROR: Command failed with exit status {e.returncode}")
176
+ # Commands 2 (build) and 4 (push) and 5 (deploy) are critical
177
+ if i in [2, 4, 5]:
178
+ print("Critical command failed. Aborting deployment.")
179
+ return
133
180
  print(f"Continuing with the next command...")
134
181
 
135
182
  # Usage
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: PraisonAI
3
- Version: 2.2.36
3
+ Version: 2.2.38
4
4
  Summary: PraisonAI is an AI Agents Framework with Self Reflection. PraisonAI application combines PraisonAI Agents, AutoGen, and CrewAI into a low-code solution for building and managing multi-agent LLM systems, focusing on simplicity, customisation, and efficient human-agent collaboration.
5
5
  Author: Mervin Praison
6
6
  Requires-Python: >=3.10
@@ -64,7 +64,7 @@ Requires-Dist: playwright (>=1.47.0) ; extra == "code"
64
64
  Requires-Dist: plotly (>=5.24.0) ; extra == "realtime"
65
65
  Requires-Dist: praisonai-tools (>=0.0.15) ; extra == "autogen"
66
66
  Requires-Dist: praisonai-tools (>=0.0.15) ; extra == "crewai"
67
- Requires-Dist: praisonaiagents (>=0.0.109)
67
+ Requires-Dist: praisonaiagents (>=0.0.111)
68
68
  Requires-Dist: pyautogen (>=0.2.19) ; extra == "autogen"
69
69
  Requires-Dist: pydantic (<=2.10.1) ; extra == "chat"
70
70
  Requires-Dist: pydantic (<=2.10.1) ; extra == "code"
@@ -6,7 +6,7 @@ praisonai/api/call.py,sha256=-dV9DKNDi4w9vN6K63TUh15_PC0M5KzYOmBqHbuJqq0,11079
6
6
  praisonai/auto.py,sha256=0omuyIIuu-zBAXpsGo3JwuhX6zpjQg3ZtqbPtF5LZbg,12331
7
7
  praisonai/chainlit_ui.py,sha256=1lmqZ7_W9Pp1ueFYLvOq1YoH5NnKy3blssDrVvn95pc,12236
8
8
  praisonai/cli.py,sha256=FGepKutQsDlpwVm21KXWu6G2ZSSdLjBa_mBgVHBnZLY,38260
9
- praisonai/deploy.py,sha256=jbbNRagr1uXeFUSBqQ6xQzqyqCoQKcOx9i0zq-D1QnY,6028
9
+ praisonai/deploy.py,sha256=OfpcqkF4DugeF7ak-zeWPaSq92U9bhgX5xy4a9nWSd8,8255
10
10
  praisonai/inbuilt_tools/__init__.py,sha256=mZOEximj3zCyJHq9Lz0bGXhQpBsa_QR-R-yA9UKC3zI,565
11
11
  praisonai/inbuilt_tools/autogen_tools.py,sha256=kJdEv61BTYvdHOaURNEpBcWq8Rs-oC03loNFTIjT-ak,4687
12
12
  praisonai/inc/__init__.py,sha256=sPDlYBBwdk0VlWzaaM_lG0_LD07lS2HRGvPdxXJFiYg,62
@@ -74,7 +74,7 @@ praisonai/ui/sql_alchemy.py,sha256=ilWAWicUGja7ADbXW9_OgIYeyKNuAQ1ZI_RMqjmMI9k,2
74
74
  praisonai/ui/tools.md,sha256=Ad3YH_ZCLMWlz3mDXllQnQ_S5l55LWqLdcZSh-EXrHI,3956
75
75
  praisonai/upload_vision.py,sha256=lMpFn993UiYVJxRNZQTmcbPbEajQ5TFKCNGK1Icn_hg,5253
76
76
  praisonai/version.py,sha256=ugyuFliEqtAwQmH4sTlc16YXKYbFWDmfyk87fErB8-8,21
77
- praisonai-2.2.36.dist-info/METADATA,sha256=c9yMkNhAtryWowkzf47wTzRYu8B5X2p4b8p8hn2baW4,4762
78
- praisonai-2.2.36.dist-info/WHEEL,sha256=dCzwOzx-VmbmLA5u8QpkARaxx3rsePBxa1nmZphhNQk,110
79
- praisonai-2.2.36.dist-info/entry_points.txt,sha256=QSSfuXjZMhf16FZ201I_oSoX_s1nWYbi_4_UXPE3S-o,145
80
- praisonai-2.2.36.dist-info/RECORD,,
77
+ praisonai-2.2.38.dist-info/METADATA,sha256=YWH1i1w-HMUBp6W6YztJxrM6MeMI0WmZ8FOW5yFsSvA,4762
78
+ praisonai-2.2.38.dist-info/WHEEL,sha256=dCzwOzx-VmbmLA5u8QpkARaxx3rsePBxa1nmZphhNQk,110
79
+ praisonai-2.2.38.dist-info/entry_points.txt,sha256=QSSfuXjZMhf16FZ201I_oSoX_s1nWYbi_4_UXPE3S-o,145
80
+ praisonai-2.2.38.dist-info/RECORD,,