PraisonAI 2.2.35__cp313-cp313-manylinux_2_39_x86_64.whl → 2.2.36__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.
praisonai/cli.py CHANGED
@@ -170,6 +170,25 @@ class PraisonAI:
170
170
  pass
171
171
  return None
172
172
 
173
+ def read_file_if_provided(self, file_path):
174
+ """
175
+ Read content from a file if the file path is provided.
176
+ Returns the file content or None if file cannot be read.
177
+ """
178
+ if not file_path:
179
+ return None
180
+
181
+ try:
182
+ with open(file_path, 'r', encoding='utf-8') as f:
183
+ file_content = f.read().strip()
184
+ return file_content if file_content else None
185
+ except FileNotFoundError:
186
+ print(f"[red]ERROR: File not found: {file_path}[/red]")
187
+ sys.exit(1)
188
+ except Exception as e:
189
+ print(f"[red]ERROR: Failed to read file: {e}[/red]")
190
+ sys.exit(1)
191
+
173
192
  def main(self):
174
193
  """
175
194
  The main function of the PraisonAI object. It parses the command-line arguments,
@@ -189,15 +208,24 @@ class PraisonAI:
189
208
 
190
209
  # Check for piped input from stdin
191
210
  stdin_input = self.read_stdin_if_available()
211
+
212
+ # Check for file input if --file is provided
213
+ file_input = self.read_file_if_provided(getattr(args, 'file', None))
192
214
 
193
215
  if args.command:
194
216
  if args.command.startswith("tests.test") or args.command.startswith("tests/test"): # Argument used for testing purposes
195
217
  print("test")
196
218
  return "test"
197
219
  else:
198
- # If stdin input is available, append it to the command
220
+ # Combine command with any available inputs (stdin and/or file)
221
+ combined_inputs = []
199
222
  if stdin_input:
200
- combined_prompt = f"{args.command} {stdin_input}"
223
+ combined_inputs.append(stdin_input)
224
+ if file_input:
225
+ combined_inputs.append(file_input)
226
+
227
+ if combined_inputs:
228
+ combined_prompt = f"{args.command} {' '.join(combined_inputs)}"
201
229
  result = self.handle_direct_prompt(combined_prompt)
202
230
  print(result)
203
231
  return result
@@ -206,20 +234,30 @@ class PraisonAI:
206
234
  elif hasattr(args, 'direct_prompt') and args.direct_prompt:
207
235
  # Only handle direct prompt if agent_file wasn't explicitly set in constructor
208
236
  if original_agent_file == "agents.yaml": # Default value, so safe to use direct prompt
209
- # If stdin input is available, append it to the direct prompt
210
- prompt = args.direct_prompt
237
+ # Combine direct prompt with any available inputs (stdin and/or file)
238
+ prompt_parts = [args.direct_prompt]
211
239
  if stdin_input:
212
- prompt = f"{args.direct_prompt} {stdin_input}"
240
+ prompt_parts.append(stdin_input)
241
+ if file_input:
242
+ prompt_parts.append(file_input)
243
+ prompt = ' '.join(prompt_parts)
213
244
  result = self.handle_direct_prompt(prompt)
214
245
  print(result)
215
246
  return result
216
247
  else:
217
248
  # Agent file was explicitly set, ignore direct prompt and use the file
218
249
  pass
219
- elif stdin_input:
220
- # If only stdin input is provided (no command), use it as direct prompt
221
- if original_agent_file == "agents.yaml": # Default value, so safe to use stdin as prompt
222
- result = self.handle_direct_prompt(stdin_input)
250
+ elif stdin_input or file_input:
251
+ # If only stdin/file input is provided (no command), use it as direct prompt
252
+ if original_agent_file == "agents.yaml": # Default value, so safe to use input as prompt
253
+ # Combine any available inputs
254
+ inputs = []
255
+ if stdin_input:
256
+ inputs.append(stdin_input)
257
+ if file_input:
258
+ inputs.append(file_input)
259
+ combined_input = ' '.join(inputs)
260
+ result = self.handle_direct_prompt(combined_input)
223
261
  print(result)
224
262
  return result
225
263
  # If no command or direct_prompt, preserve agent_file from constructor (don't overwrite)
@@ -530,6 +568,7 @@ class PraisonAI:
530
568
  parser.add_argument("--public", action="store_true", help="Use ngrok to expose the server publicly (only with --call)")
531
569
  parser.add_argument("--merge", action="store_true", help="Merge existing agents.yaml with auto-generated agents instead of overwriting")
532
570
  parser.add_argument("--claudecode", action="store_true", help="Enable Claude Code integration for file modifications and coding tasks")
571
+ parser.add_argument("--file", "-f", type=str, help="Read input from a file and append it to the prompt")
533
572
 
534
573
  # If we're in a test environment, parse with empty args to avoid pytest interference
535
574
  if in_test_env:
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==2.2.35 gunicorn markdown\n")
59
+ file.write("RUN pip install flask praisonai==2.2.36 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.3
2
2
  Name: PraisonAI
3
- Version: 2.2.35
3
+ Version: 2.2.36
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.108)
67
+ Requires-Dist: praisonaiagents (>=0.0.109)
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"
@@ -5,8 +5,8 @@ praisonai/agents_generator.py,sha256=IMD5VTYL0fUEiCUcoADGAfe2tBtPHJa-tRmN8g525bM
5
5
  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
- praisonai/cli.py,sha256=4mG3TVE4DJxOC2KFfJcOiOhd814q9WEK2W2XNp7fIY8,36627
9
- praisonai/deploy.py,sha256=MUguy-5jcKyxRolVXdOyHf2hRpqWRavodNKOGElYjPw,6028
8
+ praisonai/cli.py,sha256=FGepKutQsDlpwVm21KXWu6G2ZSSdLjBa_mBgVHBnZLY,38260
9
+ praisonai/deploy.py,sha256=jbbNRagr1uXeFUSBqQ6xQzqyqCoQKcOx9i0zq-D1QnY,6028
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.35.dist-info/METADATA,sha256=PAQy4iS7n5QgOsAZzkhA6p9-VXGeZMs6PuIkxDFPrtA,4762
78
- praisonai-2.2.35.dist-info/WHEEL,sha256=dCzwOzx-VmbmLA5u8QpkARaxx3rsePBxa1nmZphhNQk,110
79
- praisonai-2.2.35.dist-info/entry_points.txt,sha256=QSSfuXjZMhf16FZ201I_oSoX_s1nWYbi_4_UXPE3S-o,145
80
- praisonai-2.2.35.dist-info/RECORD,,
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,,