PraisonAI 0.0.53__tar.gz → 0.0.55__tar.gz

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.

Files changed (39) hide show
  1. {praisonai-0.0.53 → praisonai-0.0.55}/PKG-INFO +46 -59
  2. {praisonai-0.0.53 → praisonai-0.0.55}/README.md +43 -56
  3. {praisonai-0.0.53 → praisonai-0.0.55}/praisonai/deploy.py +1 -1
  4. {praisonai-0.0.53 → praisonai-0.0.55}/praisonai/ui/context.py +66 -20
  5. {praisonai-0.0.53 → praisonai-0.0.55}/pyproject.toml +2 -2
  6. {praisonai-0.0.53 → praisonai-0.0.55}/LICENSE +0 -0
  7. {praisonai-0.0.53 → praisonai-0.0.55}/praisonai/__init__.py +0 -0
  8. {praisonai-0.0.53 → praisonai-0.0.55}/praisonai/__main__.py +0 -0
  9. {praisonai-0.0.53 → praisonai-0.0.55}/praisonai/agents_generator.py +0 -0
  10. {praisonai-0.0.53 → praisonai-0.0.55}/praisonai/auto.py +0 -0
  11. {praisonai-0.0.53 → praisonai-0.0.55}/praisonai/chainlit_ui.py +0 -0
  12. {praisonai-0.0.53 → praisonai-0.0.55}/praisonai/cli.py +0 -0
  13. {praisonai-0.0.53 → praisonai-0.0.55}/praisonai/inbuilt_tools/__init__.py +0 -0
  14. {praisonai-0.0.53 → praisonai-0.0.55}/praisonai/inbuilt_tools/autogen_tools.py +0 -0
  15. {praisonai-0.0.53 → praisonai-0.0.55}/praisonai/inc/__init__.py +0 -0
  16. {praisonai-0.0.53 → praisonai-0.0.55}/praisonai/inc/models.py +0 -0
  17. {praisonai-0.0.53 → praisonai-0.0.55}/praisonai/public/android-chrome-192x192.png +0 -0
  18. {praisonai-0.0.53 → praisonai-0.0.55}/praisonai/public/android-chrome-512x512.png +0 -0
  19. {praisonai-0.0.53 → praisonai-0.0.55}/praisonai/public/apple-touch-icon.png +0 -0
  20. {praisonai-0.0.53 → praisonai-0.0.55}/praisonai/public/fantasy.svg +0 -0
  21. {praisonai-0.0.53 → praisonai-0.0.55}/praisonai/public/favicon-16x16.png +0 -0
  22. {praisonai-0.0.53 → praisonai-0.0.55}/praisonai/public/favicon-32x32.png +0 -0
  23. {praisonai-0.0.53 → praisonai-0.0.55}/praisonai/public/favicon.ico +0 -0
  24. {praisonai-0.0.53 → praisonai-0.0.55}/praisonai/public/game.svg +0 -0
  25. {praisonai-0.0.53 → praisonai-0.0.55}/praisonai/public/logo_dark.png +0 -0
  26. {praisonai-0.0.53 → praisonai-0.0.55}/praisonai/public/logo_light.png +0 -0
  27. {praisonai-0.0.53 → praisonai-0.0.55}/praisonai/public/movie.svg +0 -0
  28. {praisonai-0.0.53 → praisonai-0.0.55}/praisonai/public/thriller.svg +0 -0
  29. {praisonai-0.0.53 → praisonai-0.0.55}/praisonai/test.py +0 -0
  30. {praisonai-0.0.53 → praisonai-0.0.55}/praisonai/ui/chat.py +0 -0
  31. {praisonai-0.0.53 → praisonai-0.0.55}/praisonai/ui/code.py +0 -0
  32. {praisonai-0.0.53 → praisonai-0.0.55}/praisonai/ui/public/fantasy.svg +0 -0
  33. {praisonai-0.0.53 → praisonai-0.0.55}/praisonai/ui/public/game.svg +0 -0
  34. {praisonai-0.0.53 → praisonai-0.0.55}/praisonai/ui/public/logo_dark.png +0 -0
  35. {praisonai-0.0.53 → praisonai-0.0.55}/praisonai/ui/public/logo_light.png +0 -0
  36. {praisonai-0.0.53 → praisonai-0.0.55}/praisonai/ui/public/movie.svg +0 -0
  37. {praisonai-0.0.53 → praisonai-0.0.55}/praisonai/ui/public/thriller.svg +0 -0
  38. {praisonai-0.0.53 → praisonai-0.0.55}/praisonai/ui/sql_alchemy.py +0 -0
  39. {praisonai-0.0.53 → praisonai-0.0.55}/praisonai/version.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PraisonAI
3
- Version: 0.0.53
3
+ Version: 0.0.55
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
@@ -19,12 +19,12 @@ Provides-Extra: gradio
19
19
  Provides-Extra: openai
20
20
  Provides-Extra: ui
21
21
  Requires-Dist: agentops (>=0.2.6) ; extra == "agentops"
22
- Requires-Dist: aiosqlite (>=0.20.0) ; extra == "code"
22
+ Requires-Dist: aiosqlite (>=0.20.0) ; extra == "chat" or extra == "code"
23
23
  Requires-Dist: chainlit (>=1.1.301,<2.0.0) ; extra == "ui" or extra == "chat" or extra == "code"
24
24
  Requires-Dist: crewai (>=0.32.0)
25
25
  Requires-Dist: flask (>=3.0.0) ; extra == "api"
26
26
  Requires-Dist: gradio (>=4.26.0) ; extra == "gradio"
27
- Requires-Dist: greenlet (>=3.0.3) ; extra == "code"
27
+ Requires-Dist: greenlet (>=3.0.3) ; extra == "chat" or extra == "code"
28
28
  Requires-Dist: langchain-anthropic (>=0.1.13) ; extra == "anthropic"
29
29
  Requires-Dist: langchain-cohere (>=0.1.4) ; extra == "cohere"
30
30
  Requires-Dist: langchain-google-genai (>=1.0.4) ; extra == "google"
@@ -61,12 +61,46 @@ Description-Content-Type: text/markdown
61
61
 
62
62
  Praison AI, leveraging both AutoGen and CrewAI or any other agent framework, represents a low-code, centralised framework designed to simplify the creation and orchestration of multi-agent systems for various LLM applications, emphasizing ease of use, customization, and human-agent interaction.
63
63
 
64
+ <div align="center">
65
+ <picture>
66
+ <source media="(prefers-color-scheme: dark)" srcset="docs/images/architecture-dark.png">
67
+ <source media="(prefers-color-scheme: light)" srcset="docs/images/architecture-light.png">
68
+ <img alt="PraisonAI Architecture" src="docs/images/architecture-light.png">
69
+ </picture>
70
+ </div>
71
+
72
+ ## Different User Interfaces:
73
+
74
+ | Interface | Description | URL |
75
+ |---|---|---|
76
+ | **UI** | Multi Agents such as CrewAI or AutoGen | [https://docs.praison.ai/ui/ui](https://docs.praison.ai/ui/ui) |
77
+ | **Chat** | Chat with 100+ LLMs, single AI Agent | [https://docs.praison.ai/ui/chat](https://docs.praison.ai/ui/chat) |
78
+ | **Code** | Chat with entire Codebase, single AI Agent | [https://docs.praison.ai/ui/code](https://docs.praison.ai/ui/code) |
79
+
80
+ ## Google Colab Multi Agents
81
+
64
82
  | | Cookbook | Open in Colab |
65
83
  | ------------- | --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
66
84
  | Basic | PraisonAI | <a target="_blank" href="https://colab.research.google.com/github/MervinPraison/PraisonAI/blob/main/cookbooks/praisonai-googlecolab.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> |
67
85
  | Include Tools | PraisonAI Tools | <a target="_blank" href="https://colab.research.google.com/github/MervinPraison/PraisonAI/blob/main/cookbooks/praisonai-tools-googlecolab.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> |
68
86
 
69
- ## TL;DR
87
+ ## Install
88
+
89
+ | PraisonAI | PraisonAI Code | PraisonAI Chat |
90
+ | --- | --- | --- |
91
+ | `pip install praisonai` | `pip install "praisonai[code]"` | `pip install "praisonai[chat]"` |
92
+
93
+ ## Key Features
94
+
95
+ - Automated AI Agents Creation
96
+ - Use CrewAI or AutoGen Framework
97
+ - 100+ LLM Support
98
+ - Chat with ENTIRE Codebase
99
+ - Interactive UIs
100
+ - YAML-based Configuration
101
+ - Custom Tool Integration
102
+
103
+ ## TL;DR Multi Agents
70
104
 
71
105
  ```bash
72
106
  pip install praisonai
@@ -75,14 +109,6 @@ praisonai --init create a movie script about dog in moon
75
109
  praisonai
76
110
  ```
77
111
 
78
- ## Different User Interfaces:
79
-
80
- | Interface | Description | URL |
81
- |---|---|---|
82
- | **UI** | Multi Agents such as CrewAI or AutoGen | [https://docs.praison.ai/ui/ui](https://docs.praison.ai/ui/ui) |
83
- | **Chat** | Chat with 100+ LLMs, single AI Agent | [https://docs.praison.ai/ui/chat](https://docs.praison.ai/ui/chat) |
84
- | **Code** | Chat with entire Codebase, single AI Agent | [https://docs.praison.ai/ui/code](https://docs.praison.ai/ui/code) |
85
-
86
112
  ## Table of Contents
87
113
 
88
114
  - [Installation](#installation)
@@ -99,7 +125,7 @@ praisonai
99
125
  - [Contributing](#contributing)
100
126
  - [Star History](#star-history)
101
127
 
102
- ## Installation
128
+ ## Installation Multi Agents
103
129
 
104
130
  ```bash
105
131
  pip install praisonai
@@ -185,56 +211,17 @@ export OPENAI_API_KEY="Enter your API key"
185
211
  praisonai chat
186
212
  ```
187
213
 
188
- ## Create Custom Tools
189
-
190
- - https://docs.praison.ai/tools/custom/
191
-
192
- ### Step 1: Pre-requisite to Create a Custom Tool
193
-
194
- `agents.yaml` file should be present in the current directory.
195
-
196
- If it doesn't exist, create it by running the command `praisonai --init research about the latest AI News and prepare a detailed report`.
197
-
198
- ### Step 2: to Create a Custom Tool
199
-
200
- Create a file called tools.py in the same directory as the agents.yaml file.
214
+ ## Praison AI Code
201
215
 
202
- ```python
203
- # example tools.py
204
- from duckduckgo_search import DDGS
205
- from praisonai_tools import BaseTool
206
-
207
- class InternetSearchTool(BaseTool):
208
- name: str = "InternetSearchTool"
209
- description: str = "Search Internet for relevant information based on a query or latest news"
210
-
211
- def _run(self, query: str):
212
- ddgs = DDGS()
213
- results = ddgs.text(keywords=query, region='wt-wt', safesearch='moderate', max_results=5)
214
- return results
216
+ ```bash
217
+ pip install "praisonai[code]"
218
+ export OPENAI_API_KEY="Enter your API key"
219
+ praisonai code
215
220
  ```
216
221
 
217
- ### Step 3: to Create a Custom Tool
218
-
219
- Add the tool to the agents.yaml file as show below under the tools section `- InternetSearchTool`.
222
+ ## Create Custom Tools
220
223
 
221
- ```yaml
222
- framework: crewai
223
- topic: research about the latest AI News and prepare a detailed report
224
- roles:
225
- research_analyst:
226
- backstory: Experienced in gathering and analyzing data related to AI news trends.
227
- goal: Analyze AI News trends
228
- role: Research Analyst
229
- tasks:
230
- gather_data:
231
- description:
232
- Conduct in-depth research on the latest AI News trends from reputable
233
- sources.
234
- expected_output: Comprehensive report on current AI News trends.
235
- tools:
236
- - InternetSearchTool
237
- ```
224
+ - https://docs.praison.ai/tools/custom/
238
225
 
239
226
  ## Agents Playbook
240
227
 
@@ -20,12 +20,46 @@
20
20
 
21
21
  Praison AI, leveraging both AutoGen and CrewAI or any other agent framework, represents a low-code, centralised framework designed to simplify the creation and orchestration of multi-agent systems for various LLM applications, emphasizing ease of use, customization, and human-agent interaction.
22
22
 
23
+ <div align="center">
24
+ <picture>
25
+ <source media="(prefers-color-scheme: dark)" srcset="docs/images/architecture-dark.png">
26
+ <source media="(prefers-color-scheme: light)" srcset="docs/images/architecture-light.png">
27
+ <img alt="PraisonAI Architecture" src="docs/images/architecture-light.png">
28
+ </picture>
29
+ </div>
30
+
31
+ ## Different User Interfaces:
32
+
33
+ | Interface | Description | URL |
34
+ |---|---|---|
35
+ | **UI** | Multi Agents such as CrewAI or AutoGen | [https://docs.praison.ai/ui/ui](https://docs.praison.ai/ui/ui) |
36
+ | **Chat** | Chat with 100+ LLMs, single AI Agent | [https://docs.praison.ai/ui/chat](https://docs.praison.ai/ui/chat) |
37
+ | **Code** | Chat with entire Codebase, single AI Agent | [https://docs.praison.ai/ui/code](https://docs.praison.ai/ui/code) |
38
+
39
+ ## Google Colab Multi Agents
40
+
23
41
  | | Cookbook | Open in Colab |
24
42
  | ------------- | --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
25
43
  | Basic | PraisonAI | <a target="_blank" href="https://colab.research.google.com/github/MervinPraison/PraisonAI/blob/main/cookbooks/praisonai-googlecolab.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> |
26
44
  | Include Tools | PraisonAI Tools | <a target="_blank" href="https://colab.research.google.com/github/MervinPraison/PraisonAI/blob/main/cookbooks/praisonai-tools-googlecolab.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> |
27
45
 
28
- ## TL;DR
46
+ ## Install
47
+
48
+ | PraisonAI | PraisonAI Code | PraisonAI Chat |
49
+ | --- | --- | --- |
50
+ | `pip install praisonai` | `pip install "praisonai[code]"` | `pip install "praisonai[chat]"` |
51
+
52
+ ## Key Features
53
+
54
+ - Automated AI Agents Creation
55
+ - Use CrewAI or AutoGen Framework
56
+ - 100+ LLM Support
57
+ - Chat with ENTIRE Codebase
58
+ - Interactive UIs
59
+ - YAML-based Configuration
60
+ - Custom Tool Integration
61
+
62
+ ## TL;DR Multi Agents
29
63
 
30
64
  ```bash
31
65
  pip install praisonai
@@ -34,14 +68,6 @@ praisonai --init create a movie script about dog in moon
34
68
  praisonai
35
69
  ```
36
70
 
37
- ## Different User Interfaces:
38
-
39
- | Interface | Description | URL |
40
- |---|---|---|
41
- | **UI** | Multi Agents such as CrewAI or AutoGen | [https://docs.praison.ai/ui/ui](https://docs.praison.ai/ui/ui) |
42
- | **Chat** | Chat with 100+ LLMs, single AI Agent | [https://docs.praison.ai/ui/chat](https://docs.praison.ai/ui/chat) |
43
- | **Code** | Chat with entire Codebase, single AI Agent | [https://docs.praison.ai/ui/code](https://docs.praison.ai/ui/code) |
44
-
45
71
  ## Table of Contents
46
72
 
47
73
  - [Installation](#installation)
@@ -58,7 +84,7 @@ praisonai
58
84
  - [Contributing](#contributing)
59
85
  - [Star History](#star-history)
60
86
 
61
- ## Installation
87
+ ## Installation Multi Agents
62
88
 
63
89
  ```bash
64
90
  pip install praisonai
@@ -144,56 +170,17 @@ export OPENAI_API_KEY="Enter your API key"
144
170
  praisonai chat
145
171
  ```
146
172
 
147
- ## Create Custom Tools
148
-
149
- - https://docs.praison.ai/tools/custom/
150
-
151
- ### Step 1: Pre-requisite to Create a Custom Tool
152
-
153
- `agents.yaml` file should be present in the current directory.
154
-
155
- If it doesn't exist, create it by running the command `praisonai --init research about the latest AI News and prepare a detailed report`.
156
-
157
- ### Step 2: to Create a Custom Tool
158
-
159
- Create a file called tools.py in the same directory as the agents.yaml file.
173
+ ## Praison AI Code
160
174
 
161
- ```python
162
- # example tools.py
163
- from duckduckgo_search import DDGS
164
- from praisonai_tools import BaseTool
165
-
166
- class InternetSearchTool(BaseTool):
167
- name: str = "InternetSearchTool"
168
- description: str = "Search Internet for relevant information based on a query or latest news"
169
-
170
- def _run(self, query: str):
171
- ddgs = DDGS()
172
- results = ddgs.text(keywords=query, region='wt-wt', safesearch='moderate', max_results=5)
173
- return results
175
+ ```bash
176
+ pip install "praisonai[code]"
177
+ export OPENAI_API_KEY="Enter your API key"
178
+ praisonai code
174
179
  ```
175
180
 
176
- ### Step 3: to Create a Custom Tool
177
-
178
- Add the tool to the agents.yaml file as show below under the tools section `- InternetSearchTool`.
181
+ ## Create Custom Tools
179
182
 
180
- ```yaml
181
- framework: crewai
182
- topic: research about the latest AI News and prepare a detailed report
183
- roles:
184
- research_analyst:
185
- backstory: Experienced in gathering and analyzing data related to AI news trends.
186
- goal: Analyze AI News trends
187
- role: Research Analyst
188
- tasks:
189
- gather_data:
190
- description:
191
- Conduct in-depth research on the latest AI News trends from reputable
192
- sources.
193
- expected_output: Comprehensive report on current AI News trends.
194
- tools:
195
- - InternetSearchTool
196
- ```
183
+ - https://docs.praison.ai/tools/custom/
197
184
 
198
185
  ## Agents Playbook
199
186
 
@@ -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.0.53 gunicorn markdown\n")
59
+ file.write("RUN pip install flask praisonai==0.0.55 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,5 @@
1
1
  import os
2
2
  import fnmatch
3
- import re
4
3
  import yaml
5
4
  from pathlib import Path
6
5
  import logging
@@ -34,10 +33,12 @@ class ContextGatherer:
34
33
  self.max_file_size = max_file_size
35
34
  self.max_tokens = int(os.getenv("PRAISONAI_MAX_TOKENS", max_tokens))
36
35
  self.ignore_patterns = self.get_ignore_patterns()
36
+ self.include_paths = self.get_include_paths()
37
+ self.included_files = []
37
38
 
38
39
  def get_ignore_patterns(self):
39
40
  """
40
- Loads ignore patterns from various sources, prioritizing them in
41
+ Loads ignore patterns from various sources, prioritizing them in
41
42
  the following order:
42
43
  1. .praisonignore
43
44
  2. settings.yaml (under code.ignore_files)
@@ -95,6 +96,19 @@ class ContextGatherer:
95
96
  logger.debug(f"Final ignore patterns: {modified_ignore_patterns}")
96
97
  return modified_ignore_patterns
97
98
 
99
+ def get_include_paths(self):
100
+ include_paths = []
101
+
102
+ # 1. Load from .praisoninclude
103
+ include_file = os.path.join(self.directory, '.praisoninclude')
104
+ if os.path.exists(include_file):
105
+ with open(include_file, 'r') as f:
106
+ include_paths.extend(
107
+ line.strip() for line in f
108
+ if line.strip() and not line.startswith('#')
109
+ )
110
+ return include_paths
111
+
98
112
  def should_ignore(self, file_path):
99
113
  """
100
114
  Check if a file or directory should be ignored based on patterns.
@@ -116,31 +130,65 @@ class ContextGatherer:
116
130
  any(file_path.endswith(ext) for ext in self.relevant_extensions)
117
131
 
118
132
  def gather_context(self):
119
- """Gather context from relevant files, respecting ignore patterns."""
133
+ """Gather context from relevant files, respecting ignore patterns and include paths."""
120
134
  context = []
121
135
  total_files = 0
122
136
  processed_files = 0
123
137
 
124
- for root, dirs, files in os.walk(self.directory):
125
- total_files += len(files)
126
- dirs[:] = [d for d in dirs if not self.should_ignore(os.path.join(root, d))]
127
- for file in files:
128
- file_path = os.path.join(root, file)
129
- if not self.should_ignore(file_path) and self.is_relevant_file(file_path):
138
+ if not self.include_paths:
139
+ # No include paths specified, process the entire directory
140
+ for root, dirs, files in os.walk(self.directory):
141
+ total_files += len(files)
142
+ dirs[:] = [d for d in dirs if not self.should_ignore(os.path.join(root, d))]
143
+ for file in files:
144
+ file_path = os.path.join(root, file)
145
+ if not self.should_ignore(file_path) and self.is_relevant_file(file_path):
146
+ try:
147
+ with open(file_path, 'r', encoding='utf-8') as f:
148
+ content = f.read()
149
+ context.append(f"File: {file_path}\n\n{content}\n\n{'='*50}\n")
150
+ self.included_files.append(Path(file_path).relative_to(self.directory))
151
+ except Exception as e:
152
+ logger.error(f"Error reading {file_path}: {e}")
153
+ processed_files += 1
154
+ print(f"\rProcessed {processed_files}/{total_files} files", end="", flush=True)
155
+ else:
156
+ # Process specified include paths
157
+ for include_path in self.include_paths:
158
+ full_path = os.path.join(self.directory, include_path)
159
+ if os.path.isdir(full_path):
160
+ for root, dirs, files in os.walk(full_path):
161
+ total_files += len(files)
162
+ dirs[:] = [d for d in dirs if not self.should_ignore(os.path.join(root, d))]
163
+ for file in files:
164
+ file_path = os.path.join(root, file)
165
+ if not self.should_ignore(file_path) and self.is_relevant_file(file_path):
166
+ try:
167
+ with open(file_path, 'r', encoding='utf-8') as f:
168
+ content = f.read()
169
+ context.append(f"File: {file_path}\n\n{content}\n\n{'='*50}\n")
170
+ self.included_files.append(Path(file_path).relative_to(self.directory))
171
+ except Exception as e:
172
+ logger.error(f"Error reading {file_path}: {e}")
173
+ processed_files += 1
174
+ print(f"\rProcessed {processed_files}/{total_files} files", end="", flush=True)
175
+ elif os.path.isfile(full_path) and self.is_relevant_file(full_path):
130
176
  try:
131
- with open(file_path, 'r', encoding='utf-8') as f:
177
+ with open(full_path, 'r', encoding='utf-8') as f:
132
178
  content = f.read()
133
- context.append(f"File: {file_path}\n\n{content}\n\n{'='*50}\n")
179
+ context.append(f"File: {full_path}\n\n{content}\n\n{'='*50}\n")
180
+ self.included_files.append(Path(full_path).relative_to(self.directory))
134
181
  except Exception as e:
135
- logger.error(f"Error reading {file_path}: {e}")
136
- processed_files += 1
137
- print(f"\rProcessed {processed_files}/{total_files} files", end="", flush=True)
182
+ logger.error(f"Error reading {full_path}: {e}")
183
+ processed_files += 1
184
+ print(f"\rProcessed {processed_files}/{total_files} files", end="", flush=True)
185
+
138
186
  print() # New line after progress indicator
139
187
  return '\n'.join(context)
140
188
 
141
189
  def count_tokens(self, text):
142
190
  """Count tokens using a simple whitespace-based tokenizer."""
143
- return len(text.split())
191
+ return len(text.split())
144
192
 
145
193
  def truncate_context(self, context):
146
194
  """Truncate context to stay within the token limit."""
@@ -165,12 +213,9 @@ class ContextGatherer:
165
213
  contents = sorted(path.iterdir())
166
214
  pointers = [('└── ' if i == len(contents) - 1 else '├── ') for i in range(len(contents))]
167
215
  for pointer, item in zip(pointers, contents):
168
- # Use should_ignore for consistency
169
- if self.should_ignore(item):
170
- continue
171
-
172
216
  rel_path = item.relative_to(start_dir)
173
- tree.append(f"{prefix}{pointer}{rel_path}")
217
+ if rel_path in self.included_files:
218
+ tree.append(f"{prefix}{pointer}{rel_path}")
174
219
 
175
220
  if item.is_dir():
176
221
  add_to_tree(item, prefix + (' ' if pointer == '└── ' else '│ '))
@@ -193,6 +238,7 @@ class ContextGatherer:
193
238
  def main():
194
239
  gatherer = ContextGatherer()
195
240
  context, token_count, context_tree = gatherer.run()
241
+ print(context_tree)
196
242
  print(f"\nThe context contains approximately {token_count} tokens.")
197
243
  print("First 500 characters of context:")
198
244
  print(context[:500] + "...")
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "PraisonAI"
3
- version = "0.0.53"
3
+ version = "0.0.55"
4
4
  description = "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
  authors = ["Mervin Praison"]
6
6
  license = ""
@@ -99,5 +99,5 @@ google = ["langchain-google-genai"]
99
99
  openai = ["langchain-openai"]
100
100
  anthropic = ["langchain-anthropic"]
101
101
  cohere = ["langchain-cohere"]
102
- chat = ["chainlit", "litellm"]
102
+ chat = ["chainlit", "litellm", "aiosqlite", "greenlet"]
103
103
  code = ["chainlit", "litellm", "aiosqlite", "greenlet"]
File without changes
File without changes
File without changes
File without changes