praisonaiagents 0.0.37__tar.gz → 0.0.39__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. {praisonaiagents-0.0.37 → praisonaiagents-0.0.39}/PKG-INFO +1 -1
  2. {praisonaiagents-0.0.37 → praisonaiagents-0.0.39}/praisonaiagents/knowledge/knowledge.py +49 -15
  3. {praisonaiagents-0.0.37 → praisonaiagents-0.0.39}/praisonaiagents.egg-info/PKG-INFO +1 -1
  4. {praisonaiagents-0.0.37 → praisonaiagents-0.0.39}/pyproject.toml +1 -1
  5. {praisonaiagents-0.0.37 → praisonaiagents-0.0.39}/praisonaiagents/__init__.py +0 -0
  6. {praisonaiagents-0.0.37 → praisonaiagents-0.0.39}/praisonaiagents/agent/__init__.py +0 -0
  7. {praisonaiagents-0.0.37 → praisonaiagents-0.0.39}/praisonaiagents/agent/agent.py +0 -0
  8. {praisonaiagents-0.0.37 → praisonaiagents-0.0.39}/praisonaiagents/agents/__init__.py +0 -0
  9. {praisonaiagents-0.0.37 → praisonaiagents-0.0.39}/praisonaiagents/agents/agents.py +0 -0
  10. {praisonaiagents-0.0.37 → praisonaiagents-0.0.39}/praisonaiagents/agents/autoagents.py +0 -0
  11. {praisonaiagents-0.0.37 → praisonaiagents-0.0.39}/praisonaiagents/knowledge/__init__.py +0 -0
  12. {praisonaiagents-0.0.37 → praisonaiagents-0.0.39}/praisonaiagents/knowledge/chunking.py +0 -0
  13. {praisonaiagents-0.0.37 → praisonaiagents-0.0.39}/praisonaiagents/main.py +0 -0
  14. {praisonaiagents-0.0.37 → praisonaiagents-0.0.39}/praisonaiagents/memory/memory.py +0 -0
  15. {praisonaiagents-0.0.37 → praisonaiagents-0.0.39}/praisonaiagents/process/__init__.py +0 -0
  16. {praisonaiagents-0.0.37 → praisonaiagents-0.0.39}/praisonaiagents/process/process.py +0 -0
  17. {praisonaiagents-0.0.37 → praisonaiagents-0.0.39}/praisonaiagents/task/__init__.py +0 -0
  18. {praisonaiagents-0.0.37 → praisonaiagents-0.0.39}/praisonaiagents/task/task.py +0 -0
  19. {praisonaiagents-0.0.37 → praisonaiagents-0.0.39}/praisonaiagents/tools/__init__.py +0 -0
  20. {praisonaiagents-0.0.37 → praisonaiagents-0.0.39}/praisonaiagents/tools/arxiv_tools.py +0 -0
  21. {praisonaiagents-0.0.37 → praisonaiagents-0.0.39}/praisonaiagents/tools/calculator_tools.py +0 -0
  22. {praisonaiagents-0.0.37 → praisonaiagents-0.0.39}/praisonaiagents/tools/csv_tools.py +0 -0
  23. {praisonaiagents-0.0.37 → praisonaiagents-0.0.39}/praisonaiagents/tools/duckdb_tools.py +0 -0
  24. {praisonaiagents-0.0.37 → praisonaiagents-0.0.39}/praisonaiagents/tools/duckduckgo_tools.py +0 -0
  25. {praisonaiagents-0.0.37 → praisonaiagents-0.0.39}/praisonaiagents/tools/excel_tools.py +0 -0
  26. {praisonaiagents-0.0.37 → praisonaiagents-0.0.39}/praisonaiagents/tools/file_tools.py +0 -0
  27. {praisonaiagents-0.0.37 → praisonaiagents-0.0.39}/praisonaiagents/tools/json_tools.py +0 -0
  28. {praisonaiagents-0.0.37 → praisonaiagents-0.0.39}/praisonaiagents/tools/newspaper_tools.py +0 -0
  29. {praisonaiagents-0.0.37 → praisonaiagents-0.0.39}/praisonaiagents/tools/pandas_tools.py +0 -0
  30. {praisonaiagents-0.0.37 → praisonaiagents-0.0.39}/praisonaiagents/tools/python_tools.py +0 -0
  31. {praisonaiagents-0.0.37 → praisonaiagents-0.0.39}/praisonaiagents/tools/shell_tools.py +0 -0
  32. {praisonaiagents-0.0.37 → praisonaiagents-0.0.39}/praisonaiagents/tools/spider_tools.py +0 -0
  33. {praisonaiagents-0.0.37 → praisonaiagents-0.0.39}/praisonaiagents/tools/test.py +0 -0
  34. {praisonaiagents-0.0.37 → praisonaiagents-0.0.39}/praisonaiagents/tools/tools.py +0 -0
  35. {praisonaiagents-0.0.37 → praisonaiagents-0.0.39}/praisonaiagents/tools/wikipedia_tools.py +0 -0
  36. {praisonaiagents-0.0.37 → praisonaiagents-0.0.39}/praisonaiagents/tools/xml_tools.py +0 -0
  37. {praisonaiagents-0.0.37 → praisonaiagents-0.0.39}/praisonaiagents/tools/yaml_tools.py +0 -0
  38. {praisonaiagents-0.0.37 → praisonaiagents-0.0.39}/praisonaiagents/tools/yfinance_tools.py +0 -0
  39. {praisonaiagents-0.0.37 → praisonaiagents-0.0.39}/praisonaiagents.egg-info/SOURCES.txt +0 -0
  40. {praisonaiagents-0.0.37 → praisonaiagents-0.0.39}/praisonaiagents.egg-info/dependency_links.txt +0 -0
  41. {praisonaiagents-0.0.37 → praisonaiagents-0.0.39}/praisonaiagents.egg-info/requires.txt +0 -0
  42. {praisonaiagents-0.0.37 → praisonaiagents-0.0.39}/praisonaiagents.egg-info/top_level.txt +0 -0
  43. {praisonaiagents-0.0.37 → praisonaiagents-0.0.39}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: praisonaiagents
3
- Version: 0.0.37
3
+ Version: 0.0.39
4
4
  Summary: Praison AI agents for completing complex tasks with Self Reflection Agents
5
5
  Author: Mervin Praison
6
6
  Requires-Dist: pydantic
@@ -4,6 +4,7 @@ import uuid
4
4
  import time
5
5
  from .chunking import Chunking
6
6
  from functools import cached_property
7
+ from rich.progress import Progress, SpinnerColumn, TextColumn, BarColumn, TaskProgressColumn
7
8
 
8
9
  logger = logging.getLogger(__name__)
9
10
 
@@ -43,9 +44,28 @@ class CustomMemory:
43
44
  }]
44
45
 
45
46
  class Knowledge:
46
- def __init__(self, config=None):
47
+ def __init__(self, config=None, verbose=None):
47
48
  self._config = config
49
+ self._verbose = verbose or 0
48
50
  os.environ['ANONYMIZED_TELEMETRY'] = 'False' # Chromadb
51
+
52
+ # Configure logging levels based on verbose setting
53
+ if not self._verbose:
54
+ # Suppress logs from all relevant dependencies
55
+ for logger_name in [
56
+ 'mem0',
57
+ 'chromadb',
58
+ 'local_persistent_hnsw',
59
+ '_client',
60
+ 'main'
61
+ ]:
62
+ logging.getLogger(logger_name).setLevel(logging.WARNING)
63
+
64
+ # Disable OpenAI API request logging
65
+ logging.getLogger('openai').setLevel(logging.WARNING)
66
+
67
+ # Set root logger to warning to catch any uncategorized logs
68
+ logging.getLogger().setLevel(logging.WARNING)
49
69
 
50
70
  @cached_property
51
71
  def _deps(self):
@@ -121,14 +141,17 @@ class Knowledge:
121
141
  chunk_overlap=50
122
142
  )
123
143
 
144
+ def _log(self, message, level=2):
145
+ """Internal logging helper"""
146
+ if self._verbose and self._verbose >= level:
147
+ logger.info(message)
148
+
124
149
  def store(self, content, user_id=None, agent_id=None, run_id=None, metadata=None):
125
150
  """Store a memory."""
126
151
  try:
127
- # Process content to match expected format
128
152
  if isinstance(content, str):
129
- # Check if content is actually a file path
130
153
  if any(content.lower().endswith(ext) for ext in ['.pdf', '.doc', '.docx', '.txt']):
131
- logger.info(f"Content appears to be a file path, processing file: {content}")
154
+ self._log(f"Content appears to be a file path, processing file: {content}")
132
155
  return self.add(content, user_id=user_id, agent_id=agent_id, run_id=run_id, metadata=metadata)
133
156
 
134
157
  content = content.strip()
@@ -136,7 +159,7 @@ class Knowledge:
136
159
  return []
137
160
 
138
161
  result = self.memory.add(content, user_id=user_id, agent_id=agent_id, run_id=run_id, metadata=metadata)
139
- logger.info(f"Store operation result: {result}")
162
+ self._log(f"Store operation result: {result}")
140
163
  return result
141
164
  except Exception as e:
142
165
  logger.error(f"Error storing content: {str(e)}")
@@ -210,8 +233,7 @@ class Knowledge:
210
233
 
211
234
  # Check if input is URL
212
235
  if isinstance(input_path, str) and (input_path.startswith('http://') or input_path.startswith('https://')):
213
- logger.info(f"Processing URL: {input_path}")
214
- # TODO: Implement URL handling
236
+ self._log(f"Processing URL: {input_path}")
215
237
  raise NotImplementedError("URL processing not yet implemented")
216
238
 
217
239
  # Check if input ends with any supported extension
@@ -220,7 +242,7 @@ class Knowledge:
220
242
  for ext in (exts if isinstance(exts, tuple) else (exts,)))
221
243
 
222
244
  if is_supported_file:
223
- logger.info(f"Processing as file path: {input_path}")
245
+ self._log(f"Processing as file path: {input_path}")
224
246
  if not os.path.exists(input_path):
225
247
  logger.error(f"File not found: {input_path}")
226
248
  raise FileNotFoundError(f"File not found: {input_path}")
@@ -253,14 +275,26 @@ class Knowledge:
253
275
  # Treat as raw text content only if no file extension
254
276
  memories = [self.normalize_content(input_path)]
255
277
 
256
- # Store memories
278
+ # Create progress display
279
+ progress = Progress(
280
+ SpinnerColumn(),
281
+ TextColumn("[progress.description]{task.description}"),
282
+ BarColumn(),
283
+ TaskProgressColumn(),
284
+ transient=True
285
+ )
286
+
287
+ # Store memories with progress bar
257
288
  all_results = []
258
- for memory in memories:
259
- if memory:
260
- memory_result = self.store(memory, user_id=user_id, agent_id=agent_id,
261
- run_id=run_id, metadata=metadata)
262
- if memory_result:
263
- all_results.extend(memory_result.get('results', []))
289
+ with progress:
290
+ store_task = progress.add_task(f"Adding to Knowledge from {os.path.basename(input_path)}", total=len(memories))
291
+ for memory in memories:
292
+ if memory:
293
+ memory_result = self.store(memory, user_id=user_id, agent_id=agent_id,
294
+ run_id=run_id, metadata=metadata)
295
+ if memory_result:
296
+ all_results.extend(memory_result.get('results', []))
297
+ progress.advance(store_task)
264
298
 
265
299
  return {'results': all_results, 'relations': []}
266
300
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: praisonaiagents
3
- Version: 0.0.37
3
+ Version: 0.0.39
4
4
  Summary: Praison AI agents for completing complex tasks with Self Reflection Agents
5
5
  Author: Mervin Praison
6
6
  Requires-Dist: pydantic
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "praisonaiagents"
7
- version = "0.0.37"
7
+ version = "0.0.39"
8
8
  description = "Praison AI agents for completing complex tasks with Self Reflection Agents"
9
9
  authors = [
10
10
  { name="Mervin Praison" }