praisonaiagents 0.0.37__tar.gz → 0.0.38__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.38}/PKG-INFO +1 -1
  2. {praisonaiagents-0.0.37 → praisonaiagents-0.0.38}/praisonaiagents/knowledge/knowledge.py +29 -8
  3. {praisonaiagents-0.0.37 → praisonaiagents-0.0.38}/praisonaiagents.egg-info/PKG-INFO +1 -1
  4. {praisonaiagents-0.0.37 → praisonaiagents-0.0.38}/pyproject.toml +1 -1
  5. {praisonaiagents-0.0.37 → praisonaiagents-0.0.38}/praisonaiagents/__init__.py +0 -0
  6. {praisonaiagents-0.0.37 → praisonaiagents-0.0.38}/praisonaiagents/agent/__init__.py +0 -0
  7. {praisonaiagents-0.0.37 → praisonaiagents-0.0.38}/praisonaiagents/agent/agent.py +0 -0
  8. {praisonaiagents-0.0.37 → praisonaiagents-0.0.38}/praisonaiagents/agents/__init__.py +0 -0
  9. {praisonaiagents-0.0.37 → praisonaiagents-0.0.38}/praisonaiagents/agents/agents.py +0 -0
  10. {praisonaiagents-0.0.37 → praisonaiagents-0.0.38}/praisonaiagents/agents/autoagents.py +0 -0
  11. {praisonaiagents-0.0.37 → praisonaiagents-0.0.38}/praisonaiagents/knowledge/__init__.py +0 -0
  12. {praisonaiagents-0.0.37 → praisonaiagents-0.0.38}/praisonaiagents/knowledge/chunking.py +0 -0
  13. {praisonaiagents-0.0.37 → praisonaiagents-0.0.38}/praisonaiagents/main.py +0 -0
  14. {praisonaiagents-0.0.37 → praisonaiagents-0.0.38}/praisonaiagents/memory/memory.py +0 -0
  15. {praisonaiagents-0.0.37 → praisonaiagents-0.0.38}/praisonaiagents/process/__init__.py +0 -0
  16. {praisonaiagents-0.0.37 → praisonaiagents-0.0.38}/praisonaiagents/process/process.py +0 -0
  17. {praisonaiagents-0.0.37 → praisonaiagents-0.0.38}/praisonaiagents/task/__init__.py +0 -0
  18. {praisonaiagents-0.0.37 → praisonaiagents-0.0.38}/praisonaiagents/task/task.py +0 -0
  19. {praisonaiagents-0.0.37 → praisonaiagents-0.0.38}/praisonaiagents/tools/__init__.py +0 -0
  20. {praisonaiagents-0.0.37 → praisonaiagents-0.0.38}/praisonaiagents/tools/arxiv_tools.py +0 -0
  21. {praisonaiagents-0.0.37 → praisonaiagents-0.0.38}/praisonaiagents/tools/calculator_tools.py +0 -0
  22. {praisonaiagents-0.0.37 → praisonaiagents-0.0.38}/praisonaiagents/tools/csv_tools.py +0 -0
  23. {praisonaiagents-0.0.37 → praisonaiagents-0.0.38}/praisonaiagents/tools/duckdb_tools.py +0 -0
  24. {praisonaiagents-0.0.37 → praisonaiagents-0.0.38}/praisonaiagents/tools/duckduckgo_tools.py +0 -0
  25. {praisonaiagents-0.0.37 → praisonaiagents-0.0.38}/praisonaiagents/tools/excel_tools.py +0 -0
  26. {praisonaiagents-0.0.37 → praisonaiagents-0.0.38}/praisonaiagents/tools/file_tools.py +0 -0
  27. {praisonaiagents-0.0.37 → praisonaiagents-0.0.38}/praisonaiagents/tools/json_tools.py +0 -0
  28. {praisonaiagents-0.0.37 → praisonaiagents-0.0.38}/praisonaiagents/tools/newspaper_tools.py +0 -0
  29. {praisonaiagents-0.0.37 → praisonaiagents-0.0.38}/praisonaiagents/tools/pandas_tools.py +0 -0
  30. {praisonaiagents-0.0.37 → praisonaiagents-0.0.38}/praisonaiagents/tools/python_tools.py +0 -0
  31. {praisonaiagents-0.0.37 → praisonaiagents-0.0.38}/praisonaiagents/tools/shell_tools.py +0 -0
  32. {praisonaiagents-0.0.37 → praisonaiagents-0.0.38}/praisonaiagents/tools/spider_tools.py +0 -0
  33. {praisonaiagents-0.0.37 → praisonaiagents-0.0.38}/praisonaiagents/tools/test.py +0 -0
  34. {praisonaiagents-0.0.37 → praisonaiagents-0.0.38}/praisonaiagents/tools/tools.py +0 -0
  35. {praisonaiagents-0.0.37 → praisonaiagents-0.0.38}/praisonaiagents/tools/wikipedia_tools.py +0 -0
  36. {praisonaiagents-0.0.37 → praisonaiagents-0.0.38}/praisonaiagents/tools/xml_tools.py +0 -0
  37. {praisonaiagents-0.0.37 → praisonaiagents-0.0.38}/praisonaiagents/tools/yaml_tools.py +0 -0
  38. {praisonaiagents-0.0.37 → praisonaiagents-0.0.38}/praisonaiagents/tools/yfinance_tools.py +0 -0
  39. {praisonaiagents-0.0.37 → praisonaiagents-0.0.38}/praisonaiagents.egg-info/SOURCES.txt +0 -0
  40. {praisonaiagents-0.0.37 → praisonaiagents-0.0.38}/praisonaiagents.egg-info/dependency_links.txt +0 -0
  41. {praisonaiagents-0.0.37 → praisonaiagents-0.0.38}/praisonaiagents.egg-info/requires.txt +0 -0
  42. {praisonaiagents-0.0.37 → praisonaiagents-0.0.38}/praisonaiagents.egg-info/top_level.txt +0 -0
  43. {praisonaiagents-0.0.37 → praisonaiagents-0.0.38}/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.38
4
4
  Summary: Praison AI agents for completing complex tasks with Self Reflection Agents
5
5
  Author: Mervin Praison
6
6
  Requires-Dist: pydantic
@@ -43,9 +43,28 @@ class CustomMemory:
43
43
  }]
44
44
 
45
45
  class Knowledge:
46
- def __init__(self, config=None):
46
+ def __init__(self, config=None, verbose=None):
47
47
  self._config = config
48
+ self._verbose = verbose or 0
48
49
  os.environ['ANONYMIZED_TELEMETRY'] = 'False' # Chromadb
50
+
51
+ # Configure logging levels based on verbose setting
52
+ if not self._verbose:
53
+ # Suppress logs from all relevant dependencies
54
+ for logger_name in [
55
+ 'mem0',
56
+ 'chromadb',
57
+ 'local_persistent_hnsw',
58
+ '_client',
59
+ 'main'
60
+ ]:
61
+ logging.getLogger(logger_name).setLevel(logging.WARNING)
62
+
63
+ # Disable OpenAI API request logging
64
+ logging.getLogger('openai').setLevel(logging.WARNING)
65
+
66
+ # Set root logger to warning to catch any uncategorized logs
67
+ logging.getLogger().setLevel(logging.WARNING)
49
68
 
50
69
  @cached_property
51
70
  def _deps(self):
@@ -121,14 +140,17 @@ class Knowledge:
121
140
  chunk_overlap=50
122
141
  )
123
142
 
143
+ def _log(self, message, level=2):
144
+ """Internal logging helper"""
145
+ if self._verbose and self._verbose >= level:
146
+ logger.info(message)
147
+
124
148
  def store(self, content, user_id=None, agent_id=None, run_id=None, metadata=None):
125
149
  """Store a memory."""
126
150
  try:
127
- # Process content to match expected format
128
151
  if isinstance(content, str):
129
- # Check if content is actually a file path
130
152
  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}")
153
+ self._log(f"Content appears to be a file path, processing file: {content}")
132
154
  return self.add(content, user_id=user_id, agent_id=agent_id, run_id=run_id, metadata=metadata)
133
155
 
134
156
  content = content.strip()
@@ -136,7 +158,7 @@ class Knowledge:
136
158
  return []
137
159
 
138
160
  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}")
161
+ self._log(f"Store operation result: {result}")
140
162
  return result
141
163
  except Exception as e:
142
164
  logger.error(f"Error storing content: {str(e)}")
@@ -210,8 +232,7 @@ class Knowledge:
210
232
 
211
233
  # Check if input is URL
212
234
  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
235
+ self._log(f"Processing URL: {input_path}")
215
236
  raise NotImplementedError("URL processing not yet implemented")
216
237
 
217
238
  # Check if input ends with any supported extension
@@ -220,7 +241,7 @@ class Knowledge:
220
241
  for ext in (exts if isinstance(exts, tuple) else (exts,)))
221
242
 
222
243
  if is_supported_file:
223
- logger.info(f"Processing as file path: {input_path}")
244
+ self._log(f"Processing as file path: {input_path}")
224
245
  if not os.path.exists(input_path):
225
246
  logger.error(f"File not found: {input_path}")
226
247
  raise FileNotFoundError(f"File not found: {input_path}")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: praisonaiagents
3
- Version: 0.0.37
3
+ Version: 0.0.38
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.38"
8
8
  description = "Praison AI agents for completing complex tasks with Self Reflection Agents"
9
9
  authors = [
10
10
  { name="Mervin Praison" }