mirror of
https://github.com/MervinPraison/PraisonAI.git
synced 2026-11-08 01:08:39 -10:00
Adding Ignore files features to PraisonAI Code
This commit is contained in:
1 parent
5491f1619b
commit
4ac449bb4b
14 files changed
+639
-21
No files matched your search
+1
-1
@@ -1,6 +1,6 @@
|
||||
FROM python:3.11-slim
|
||||
WORKDIR /app
|
||||
COPY . .
|
||||
RUN pip install flask praisonai==0.0.48 gunicorn markdown
|
||||
RUN pip install flask praisonai==0.0.49 gunicorn markdown
|
||||
EXPOSE 8080
|
||||
CMD ["gunicorn", "-b", "0.0.0.0:8080", "api:app"]
|
||||
@@ -97,6 +97,12 @@ init (bool): A flag indicating whether to enable initialization mode. Defaults t
|
||||
self.auto = auto
|
||||
self.init = init
|
||||
|
||||
def run(self):
|
||||
"""
|
||||
Run the PraisonAI application.
|
||||
"""
|
||||
self.main()
|
||||
|
||||
def main(self):
|
||||
"""
|
||||
The main function of the PraisonAI object. It parses the command-line arguments,
|
||||
@@ -126,6 +132,10 @@ init (bool): A flag indicating whether to enable initialization mode. Defaults t
|
||||
self.create_chainlit_chat_interface()
|
||||
return
|
||||
|
||||
if getattr(args, 'code', False):
|
||||
self.create_code_interface()
|
||||
return
|
||||
|
||||
invocation_cmd = "praisonai"
|
||||
version_string = f"PraisonAI version {__version__}"
|
||||
|
||||
@@ -208,6 +218,9 @@ init (bool): A flag indicating whether to enable initialization mode. Defaults t
|
||||
if args.agent_file == 'chat':
|
||||
args.ui = 'chainlit'
|
||||
args.chat = True
|
||||
if args.agent_file == 'code':
|
||||
args.ui = 'chainlit'
|
||||
args.code = True
|
||||
|
||||
return args
|
||||
|
||||
@@ -225,10 +238,47 @@ init (bool): A flag indicating whether to enable initialization mode. Defaults t
|
||||
if CHAINLIT_AVAILABLE:
|
||||
import praisonai
|
||||
os.environ["CHAINLIT_PORT"] = "8084"
|
||||
public_folder = os.path.join(os.path.dirname(praisonai.__file__), 'public')
|
||||
if not os.path.exists("public"): # Check if the folder exists in the current directory
|
||||
if os.path.exists(public_folder):
|
||||
shutil.copytree(public_folder, 'public', dirs_exist_ok=True)
|
||||
logging.info("Public folder copied successfully!")
|
||||
else:
|
||||
logging.info("Public folder not found in the package.")
|
||||
else:
|
||||
logging.info("Public folder already exists.")
|
||||
chat_ui_path = os.path.join(os.path.dirname(praisonai.__file__), 'ui', 'chat.py')
|
||||
chainlit_run([chat_ui_path])
|
||||
else:
|
||||
print("ERROR: Chat UI is not installed. Please install it with 'pip install \"praisonai\[chat]\"' to use the chat UI.")
|
||||
|
||||
def create_code_interface(self):
|
||||
"""
|
||||
Create a Chainlit interface for the code application.
|
||||
|
||||
This function sets up a Chainlit application that listens for messages.
|
||||
When a message is received, it runs PraisonAI with the provided message as the topic.
|
||||
The generated agents are then used to perform tasks.
|
||||
|
||||
Returns:
|
||||
None: This function does not return any value. It starts the Chainlit application.
|
||||
"""
|
||||
if CHAINLIT_AVAILABLE:
|
||||
import praisonai
|
||||
os.environ["CHAINLIT_PORT"] = "8086"
|
||||
public_folder = os.path.join(os.path.dirname(praisonai.__file__), 'public')
|
||||
if not os.path.exists("public"): # Check if the folder exists in the current directory
|
||||
if os.path.exists(public_folder):
|
||||
shutil.copytree(public_folder, 'public', dirs_exist_ok=True)
|
||||
logging.info("Public folder copied successfully!")
|
||||
else:
|
||||
logging.info("Public folder not found in the package.")
|
||||
else:
|
||||
logging.info("Public folder already exists.")
|
||||
code_ui_path = os.path.join(os.path.dirname(praisonai.__file__), 'ui', 'code.py')
|
||||
chainlit_run([code_ui_path])
|
||||
else:
|
||||
print("ERROR: Code UI is not installed. Please install it with 'pip install \"praisonai\[code]\"' to use the code UI.")
|
||||
|
||||
def create_gradio_interface(self):
|
||||
"""
|
||||
@@ -343,6 +393,20 @@ The generated agents are then used to perform tasks.</p>
|
||||
<dd>This function does not return any value. It starts the Chainlit application.</dd>
|
||||
</dl></div>
|
||||
</dd>
|
||||
<dt id="praisonai.cli.PraisonAI.create_code_interface"><code class="name flex">
|
||||
<span>def <span class="ident">create_code_interface</span></span>(<span>self)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Create a Chainlit interface for the code application.</p>
|
||||
<p>This function sets up a Chainlit application that listens for messages.
|
||||
When a message is received, it runs PraisonAI with the provided message as the topic.
|
||||
The generated agents are then used to perform tasks.</p>
|
||||
<h2 id="returns">Returns</h2>
|
||||
<dl>
|
||||
<dt><code>None</code></dt>
|
||||
<dd>This function does not return any value. It starts the Chainlit application.</dd>
|
||||
</dl></div>
|
||||
</dd>
|
||||
<dt id="praisonai.cli.PraisonAI.create_gradio_interface"><code class="name flex">
|
||||
<span>def <span class="ident">create_gradio_interface</span></span>(<span>self)</span>
|
||||
</code></dt>
|
||||
@@ -412,6 +476,12 @@ the successful creation of a file.</p></div>
|
||||
>>> print(args.agent_file) # Output: 'agents.yaml'
|
||||
</code></pre></div>
|
||||
</dd>
|
||||
<dt id="praisonai.cli.PraisonAI.run"><code class="name flex">
|
||||
<span>def <span class="ident">run</span></span>(<span>self)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Run the PraisonAI application.</p></div>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd>
|
||||
</dl>
|
||||
@@ -434,9 +504,11 @@ the successful creation of a file.</p></div>
|
||||
<ul class="">
|
||||
<li><code><a title="praisonai.cli.PraisonAI.create_chainlit_chat_interface" href="#praisonai.cli.PraisonAI.create_chainlit_chat_interface">create_chainlit_chat_interface</a></code></li>
|
||||
<li><code><a title="praisonai.cli.PraisonAI.create_chainlit_interface" href="#praisonai.cli.PraisonAI.create_chainlit_interface">create_chainlit_interface</a></code></li>
|
||||
<li><code><a title="praisonai.cli.PraisonAI.create_code_interface" href="#praisonai.cli.PraisonAI.create_code_interface">create_code_interface</a></code></li>
|
||||
<li><code><a title="praisonai.cli.PraisonAI.create_gradio_interface" href="#praisonai.cli.PraisonAI.create_gradio_interface">create_gradio_interface</a></code></li>
|
||||
<li><code><a title="praisonai.cli.PraisonAI.main" href="#praisonai.cli.PraisonAI.main">main</a></code></li>
|
||||
<li><code><a title="praisonai.cli.PraisonAI.parse_args" href="#praisonai.cli.PraisonAI.parse_args">parse_args</a></code></li>
|
||||
<li><code><a title="praisonai.cli.PraisonAI.run" href="#praisonai.cli.PraisonAI.run">run</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@@ -110,7 +110,7 @@ Loads environment variables from .env file or system and sets them.</p>
|
||||
file.write("FROM python:3.11-slim\n")
|
||||
file.write("WORKDIR /app\n")
|
||||
file.write("COPY . .\n")
|
||||
file.write("RUN pip install flask praisonai==0.0.48 gunicorn markdown\n")
|
||||
file.write("RUN pip install flask praisonai==0.0.49 gunicorn markdown\n")
|
||||
file.write("EXPOSE 8080\n")
|
||||
file.write('CMD ["gunicorn", "-b", "0.0.0.0:8080", "api:app"]\n')
|
||||
|
||||
@@ -132,8 +132,8 @@ Loads environment variables from .env file or system and sets them.</p>
|
||||
file.write("import markdown\n\n")
|
||||
file.write("app = Flask(__name__)\n\n")
|
||||
file.write("def basic():\n")
|
||||
file.write(" praison_ai = PraisonAI(agent_file=\"agents.yaml\")\n")
|
||||
file.write(" return praison_ai.main()\n\n")
|
||||
file.write(" praisonai = PraisonAI(agent_file=\"agents.yaml\")\n")
|
||||
file.write(" return praisonai.run()\n\n")
|
||||
file.write("@app.route('/')\n")
|
||||
file.write("def home():\n")
|
||||
file.write(" output = basic()\n")
|
||||
|
||||
@@ -57,6 +57,10 @@ hljs.highlightAll();
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt><code class="name"><a title="praisonai.ui" href="ui/index.html">praisonai.ui</a></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt><code class="name"><a title="praisonai.version" href="version.html">praisonai.version</a></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
@@ -84,6 +88,7 @@ hljs.highlightAll();
|
||||
<li><code><a title="praisonai.inbuilt_tools" href="inbuilt_tools/index.html">praisonai.inbuilt_tools</a></code></li>
|
||||
<li><code><a title="praisonai.inc" href="inc/index.html">praisonai.inc</a></code></li>
|
||||
<li><code><a title="praisonai.test" href="test.html">praisonai.test</a></code></li>
|
||||
<li><code><a title="praisonai.ui" href="ui/index.html">praisonai.ui</a></code></li>
|
||||
<li><code><a title="praisonai.version" href="version.html">praisonai.version</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
@@ -0,0 +1,295 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
|
||||
<meta name="generator" content="pdoc3 0.11.1">
|
||||
<title>praisonai.ui.context API documentation</title>
|
||||
<meta name="description" content="">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/sanitize.min.css" integrity="sha512-y1dtMcuvtTMJc1yPgEqF0ZjQbhnc/bFhyvIyVNb9Zk5mIGtqVaAB1Ttl28su8AvFMOY0EwRbAe+HCLqj6W7/KA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/typography.min.css" integrity="sha512-Y1DYSb995BAfxobCkKepB1BqJJTPrOp3zPL74AWFugHHmmdcvO+C48WLrUOlhGMc0QG7AE3f7gmvvcrmX2fDoA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css" crossorigin>
|
||||
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:1.5em;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:2em 0 .50em 0}h3{font-size:1.4em;margin:1.6em 0 .7em 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .2s ease-in-out}a:visited{color:#503}a:hover{color:#b62}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900;font-weight:bold}pre code{font-size:.8em;line-height:1.4em;padding:1em;display:block}code{background:#f3f3f3;font-family:"DejaVu Sans Mono",monospace;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em 1em;margin-bottom:1em}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
|
||||
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul ul{padding-left:1em}.toc > ul > li{margin-top:.5em}}</style>
|
||||
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
|
||||
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js" integrity="sha512-D9gUyxqja7hBtkWpPWGt9wfbfaMGVt9gnyCvYa+jojwwPHLCzUm5i8rpk7vD7wNee9bA35eYIjobYPaQuKS1MQ==" crossorigin></script>
|
||||
<script>window.addEventListener('DOMContentLoaded', () => {
|
||||
hljs.configure({languages: ['bash', 'css', 'diff', 'graphql', 'ini', 'javascript', 'json', 'plaintext', 'python', 'python-repl', 'rust', 'shell', 'sql', 'typescript', 'xml', 'yaml']});
|
||||
hljs.highlightAll();
|
||||
})</script>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<article id="content">
|
||||
<header>
|
||||
<h1 class="title">Module <code>praisonai.ui.context</code></h1>
|
||||
</header>
|
||||
<section id="section-intro">
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
<h2 class="section-title" id="header-functions">Functions</h2>
|
||||
<dl>
|
||||
<dt id="praisonai.ui.context.main"><code class="name flex">
|
||||
<span>def <span class="ident">main</span></span>(<span>)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
</dl>
|
||||
</section>
|
||||
<section>
|
||||
<h2 class="section-title" id="header-classes">Classes</h2>
|
||||
<dl>
|
||||
<dt id="praisonai.ui.context.ContextGatherer"><code class="flex name class">
|
||||
<span>class <span class="ident">ContextGatherer</span></span>
|
||||
<span>(</span><span>directory='.', output_file='context.txt', relevant_extensions=None, max_file_size=1000000, max_tokens=60000)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">class ContextGatherer:
|
||||
def __init__(self, directory='.', output_file='context.txt',
|
||||
relevant_extensions=None, max_file_size=1_000_000, max_tokens=60000):
|
||||
self.directory = directory
|
||||
self.output_file = output_file
|
||||
self.relevant_extensions = relevant_extensions or ['.py']
|
||||
self.max_file_size = max_file_size
|
||||
self.max_tokens = max_tokens
|
||||
self.ignore_patterns = self.get_ignore_patterns()
|
||||
|
||||
def get_ignore_patterns(self):
|
||||
"""Read .gitignore file and return ignore patterns."""
|
||||
|
||||
settings_path = os.path.join(self.directory, 'settings.yaml')
|
||||
if os.path.exists(settings_path):
|
||||
with open(settings_path, 'r') as f:
|
||||
settings = yaml.safe_load(f)
|
||||
if 'code' in settings and 'ignore_files' in settings['code']:
|
||||
logger.debug(f"Ignored settings.yaml files: {settings['code']['ignore_files']}")
|
||||
return settings['code']['ignore_files']
|
||||
|
||||
# If settings.yaml doesn't exist, get from env variable
|
||||
ignore_files_env = os.getenv("PRAISONAI_IGNORE_FILES")
|
||||
if ignore_files_env:
|
||||
logger.debug(f"Ignored PRAISONAI_IGNORE_FILES ENV files: {ignore_files_env}")
|
||||
return ignore_files_env.split(",")
|
||||
|
||||
default_patterns = [".*", "*.pyc", "__pycache__", ".git", ".gitignore", ".vscode",
|
||||
".idea", ".DS_Store", "*.lock", "*.pyc", ".env",
|
||||
"docs", "tests", "test", "tmp", "temp",
|
||||
"*.txt", "*.md", "*.json", "*.csv", "*.tsv","public",
|
||||
"*.sql", "*.sqlite", "*.db", "*.db3", "*.sqlite3", "*.log", "*.zip", "*.gz",
|
||||
"*.tar", "*.rar", "*.7z", "*.pdf", "*.jpg", "*.jpeg", "*.png", "*.gif", "*.svg",
|
||||
"cookbooks", "assets", "__pycache__", "dist", "build", "node_modules", "venv",]
|
||||
gitignore_path = os.path.join(self.directory, '.gitignore')
|
||||
if os.path.exists(gitignore_path):
|
||||
with open(gitignore_path, 'r') as f:
|
||||
gitignore_patterns = [line.strip() for line in f if line.strip() and not line.startswith('#')]
|
||||
logger.debug(f"Ignored gitignore and default files: {ignore_files_env}")
|
||||
return list(set(default_patterns + gitignore_patterns))
|
||||
return default_patterns
|
||||
|
||||
def should_ignore(self, file_path):
|
||||
"""Check if a file should be ignored based on patterns."""
|
||||
relative_path = os.path.relpath(file_path, self.directory)
|
||||
if relative_path.startswith('.'):
|
||||
return True
|
||||
for pattern in self.ignore_patterns:
|
||||
if fnmatch.fnmatch(relative_path, pattern):
|
||||
return True
|
||||
return False
|
||||
|
||||
def is_relevant_file(self, file_path):
|
||||
"""Determine if a file is relevant for the context."""
|
||||
if os.path.getsize(file_path) > self.max_file_size:
|
||||
return False
|
||||
return any(file_path.endswith(ext) for ext in self.relevant_extensions)
|
||||
|
||||
def gather_context(self):
|
||||
"""Gather context from relevant files in the directory."""
|
||||
context = []
|
||||
total_files = sum(len(files) for _, _, files in os.walk(self.directory))
|
||||
processed_files = 0
|
||||
|
||||
for root, dirs, files in os.walk(self.directory):
|
||||
dirs[:] = [d for d in dirs if not self.should_ignore(os.path.join(root, d))]
|
||||
for file in files:
|
||||
file_path = os.path.join(root, file)
|
||||
if not self.should_ignore(file_path) and self.is_relevant_file(file_path):
|
||||
try:
|
||||
with open(file_path, 'r', encoding='utf-8') as f:
|
||||
content = f.read()
|
||||
context.append(f"File: {file_path}\n\n{content}\n\n{'='*50}\n")
|
||||
except Exception as e:
|
||||
print(f"Error reading {file_path}: {e}")
|
||||
processed_files += 1
|
||||
print(f"\rProcessed {processed_files}/{total_files} files", end="", flush=True)
|
||||
print() # New line after progress indicator
|
||||
return '\n'.join(context)
|
||||
|
||||
def count_tokens(self, text):
|
||||
"""Count the number of tokens in the given text using a simple tokenizer."""
|
||||
# Split on whitespace and punctuation
|
||||
tokens = re.findall(r'\b\w+\b|[^\w\s]', text)
|
||||
return len(tokens)
|
||||
|
||||
def truncate_context(self, context):
|
||||
"""Truncate context to fit within the specified token limit."""
|
||||
tokens = re.findall(r'\b\w+\b|[^\w\s]', context)
|
||||
if len(tokens) > self.max_tokens:
|
||||
truncated_tokens = tokens[:self.max_tokens]
|
||||
return ' '.join(truncated_tokens)
|
||||
return context
|
||||
|
||||
def save_context(self, context):
|
||||
"""Save the gathered context to a file."""
|
||||
with open(self.output_file, 'w', encoding='utf-8') as f:
|
||||
f.write(context)
|
||||
|
||||
def get_context_tree(self):
|
||||
"""Generate a formatted tree structure of the folder, including only relevant files."""
|
||||
tree = []
|
||||
start_dir = os.path.abspath(self.directory)
|
||||
|
||||
def add_to_tree(path, prefix=''):
|
||||
contents = sorted(os.listdir(path))
|
||||
pointers = [('└── ' if i == len(contents) - 1 else '├── ') for i in range(len(contents))]
|
||||
for pointer, name in zip(pointers, contents):
|
||||
full_path = os.path.join(path, name)
|
||||
if self.should_ignore(full_path):
|
||||
continue
|
||||
|
||||
rel_path = os.path.relpath(full_path, start_dir)
|
||||
tree.append(f"{prefix}{pointer}{name}")
|
||||
|
||||
if os.path.isdir(full_path):
|
||||
add_to_tree(full_path, prefix + (' ' if pointer == '└── ' else '│ '))
|
||||
elif self.is_relevant_file(full_path):
|
||||
continue # We've already added the file to the tree
|
||||
|
||||
add_to_tree(start_dir)
|
||||
return '\n'.join(tree)
|
||||
|
||||
def run(self):
|
||||
"""Run the context gathering process and return the context and token count."""
|
||||
context = self.gather_context()
|
||||
context = self.truncate_context(context)
|
||||
token_count = self.count_tokens(context)
|
||||
print(f"Context gathered successfully.")
|
||||
print(f"Total number of tokens (estimated): {token_count}")
|
||||
# self.save_context(context)
|
||||
context_tree = self.get_context_tree()
|
||||
print("\nContext Tree Structure:")
|
||||
print(context_tree)
|
||||
|
||||
return context, token_count, context_tree</code></pre>
|
||||
</details>
|
||||
<h3>Methods</h3>
|
||||
<dl>
|
||||
<dt id="praisonai.ui.context.ContextGatherer.count_tokens"><code class="name flex">
|
||||
<span>def <span class="ident">count_tokens</span></span>(<span>self, text)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Count the number of tokens in the given text using a simple tokenizer.</p></div>
|
||||
</dd>
|
||||
<dt id="praisonai.ui.context.ContextGatherer.gather_context"><code class="name flex">
|
||||
<span>def <span class="ident">gather_context</span></span>(<span>self)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Gather context from relevant files in the directory.</p></div>
|
||||
</dd>
|
||||
<dt id="praisonai.ui.context.ContextGatherer.get_context_tree"><code class="name flex">
|
||||
<span>def <span class="ident">get_context_tree</span></span>(<span>self)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Generate a formatted tree structure of the folder, including only relevant files.</p></div>
|
||||
</dd>
|
||||
<dt id="praisonai.ui.context.ContextGatherer.get_ignore_patterns"><code class="name flex">
|
||||
<span>def <span class="ident">get_ignore_patterns</span></span>(<span>self)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Read .gitignore file and return ignore patterns.</p></div>
|
||||
</dd>
|
||||
<dt id="praisonai.ui.context.ContextGatherer.is_relevant_file"><code class="name flex">
|
||||
<span>def <span class="ident">is_relevant_file</span></span>(<span>self, file_path)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Determine if a file is relevant for the context.</p></div>
|
||||
</dd>
|
||||
<dt id="praisonai.ui.context.ContextGatherer.run"><code class="name flex">
|
||||
<span>def <span class="ident">run</span></span>(<span>self)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Run the context gathering process and return the context and token count.</p></div>
|
||||
</dd>
|
||||
<dt id="praisonai.ui.context.ContextGatherer.save_context"><code class="name flex">
|
||||
<span>def <span class="ident">save_context</span></span>(<span>self, context)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Save the gathered context to a file.</p></div>
|
||||
</dd>
|
||||
<dt id="praisonai.ui.context.ContextGatherer.should_ignore"><code class="name flex">
|
||||
<span>def <span class="ident">should_ignore</span></span>(<span>self, file_path)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Check if a file should be ignored based on patterns.</p></div>
|
||||
</dd>
|
||||
<dt id="praisonai.ui.context.ContextGatherer.truncate_context"><code class="name flex">
|
||||
<span>def <span class="ident">truncate_context</span></span>(<span>self, context)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Truncate context to fit within the specified token limit.</p></div>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd>
|
||||
</dl>
|
||||
</section>
|
||||
</article>
|
||||
<nav id="sidebar">
|
||||
<div class="toc">
|
||||
<ul></ul>
|
||||
</div>
|
||||
<ul id="index">
|
||||
<li><h3>Super-module</h3>
|
||||
<ul>
|
||||
<li><code><a title="praisonai.ui" href="index.html">praisonai.ui</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><h3><a href="#header-functions">Functions</a></h3>
|
||||
<ul class="">
|
||||
<li><code><a title="praisonai.ui.context.main" href="#praisonai.ui.context.main">main</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><h3><a href="#header-classes">Classes</a></h3>
|
||||
<ul>
|
||||
<li>
|
||||
<h4><code><a title="praisonai.ui.context.ContextGatherer" href="#praisonai.ui.context.ContextGatherer">ContextGatherer</a></code></h4>
|
||||
<ul class="two-column">
|
||||
<li><code><a title="praisonai.ui.context.ContextGatherer.count_tokens" href="#praisonai.ui.context.ContextGatherer.count_tokens">count_tokens</a></code></li>
|
||||
<li><code><a title="praisonai.ui.context.ContextGatherer.gather_context" href="#praisonai.ui.context.ContextGatherer.gather_context">gather_context</a></code></li>
|
||||
<li><code><a title="praisonai.ui.context.ContextGatherer.get_context_tree" href="#praisonai.ui.context.ContextGatherer.get_context_tree">get_context_tree</a></code></li>
|
||||
<li><code><a title="praisonai.ui.context.ContextGatherer.get_ignore_patterns" href="#praisonai.ui.context.ContextGatherer.get_ignore_patterns">get_ignore_patterns</a></code></li>
|
||||
<li><code><a title="praisonai.ui.context.ContextGatherer.is_relevant_file" href="#praisonai.ui.context.ContextGatherer.is_relevant_file">is_relevant_file</a></code></li>
|
||||
<li><code><a title="praisonai.ui.context.ContextGatherer.run" href="#praisonai.ui.context.ContextGatherer.run">run</a></code></li>
|
||||
<li><code><a title="praisonai.ui.context.ContextGatherer.save_context" href="#praisonai.ui.context.ContextGatherer.save_context">save_context</a></code></li>
|
||||
<li><code><a title="praisonai.ui.context.ContextGatherer.should_ignore" href="#praisonai.ui.context.ContextGatherer.should_ignore">should_ignore</a></code></li>
|
||||
<li><code><a title="praisonai.ui.context.ContextGatherer.truncate_context" href="#praisonai.ui.context.ContextGatherer.truncate_context">truncate_context</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.11.1</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,67 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
|
||||
<meta name="generator" content="pdoc3 0.11.1">
|
||||
<title>praisonai.ui API documentation</title>
|
||||
<meta name="description" content="">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/sanitize.min.css" integrity="sha512-y1dtMcuvtTMJc1yPgEqF0ZjQbhnc/bFhyvIyVNb9Zk5mIGtqVaAB1Ttl28su8AvFMOY0EwRbAe+HCLqj6W7/KA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/typography.min.css" integrity="sha512-Y1DYSb995BAfxobCkKepB1BqJJTPrOp3zPL74AWFugHHmmdcvO+C48WLrUOlhGMc0QG7AE3f7gmvvcrmX2fDoA==" crossorigin>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css" crossorigin>
|
||||
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:1.5em;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:2em 0 .50em 0}h3{font-size:1.4em;margin:1.6em 0 .7em 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .2s ease-in-out}a:visited{color:#503}a:hover{color:#b62}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900;font-weight:bold}pre code{font-size:.8em;line-height:1.4em;padding:1em;display:block}code{background:#f3f3f3;font-family:"DejaVu Sans Mono",monospace;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em 1em;margin-bottom:1em}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
|
||||
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul ul{padding-left:1em}.toc > ul > li{margin-top:.5em}}</style>
|
||||
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
|
||||
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js" integrity="sha512-D9gUyxqja7hBtkWpPWGt9wfbfaMGVt9gnyCvYa+jojwwPHLCzUm5i8rpk7vD7wNee9bA35eYIjobYPaQuKS1MQ==" crossorigin></script>
|
||||
<script>window.addEventListener('DOMContentLoaded', () => {
|
||||
hljs.configure({languages: ['bash', 'css', 'diff', 'graphql', 'ini', 'javascript', 'json', 'plaintext', 'python', 'python-repl', 'rust', 'shell', 'sql', 'typescript', 'xml', 'yaml']});
|
||||
hljs.highlightAll();
|
||||
})</script>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<article id="content">
|
||||
<header>
|
||||
<h1 class="title">Namespace <code>praisonai.ui</code></h1>
|
||||
</header>
|
||||
<section id="section-intro">
|
||||
</section>
|
||||
<section>
|
||||
<h2 class="section-title" id="header-submodules">Sub-modules</h2>
|
||||
<dl>
|
||||
<dt><code class="name"><a title="praisonai.ui.context" href="context.html">praisonai.ui.context</a></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
</dl>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
</article>
|
||||
<nav id="sidebar">
|
||||
<div class="toc">
|
||||
<ul></ul>
|
||||
</div>
|
||||
<ul id="index">
|
||||
<li><h3>Super-module</h3>
|
||||
<ul>
|
||||
<li><code><a title="praisonai" href="../index.html">praisonai</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><h3><a href="#header-submodules">Sub-modules</a></h3>
|
||||
<ul>
|
||||
<li><code><a title="praisonai.ui.context" href="context.html">praisonai.ui.context</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.11.1</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
File renamed without changes.
@@ -0,0 +1,69 @@
|
||||
# PraisonAI Code
|
||||
|
||||
PraisonAI Code helps you to interact with your whole codebase using the power of AI.
|
||||
|
||||
1.
|
||||
```bash
|
||||
pip install "praisonai[code]"
|
||||
```
|
||||
|
||||
2.
|
||||
```bash
|
||||
export OPENAI_API_KEY=xxxxxxxx
|
||||
```
|
||||
|
||||
3.
|
||||
```bash
|
||||
praisonai code
|
||||
```
|
||||
|
||||
4. Set Model name to be gpt-3.5-turbo in the settings
|
||||
|
||||
|
||||
## Other Models
|
||||
|
||||
* Use 100+ LLMs
|
||||
* Includes Gemini 1.5 for 2 Million Context Length
|
||||
|
||||
## To Use Gemini 1.5
|
||||
|
||||
* ```export GEMINI_API_KEY=xxxxxxxxx```
|
||||
* ```praisonai code```
|
||||
* Set Model name to be ```gemini/gemini-1.5-flash``` in the settings
|
||||
|
||||
## Ignore Files
|
||||
|
||||
### Using settings.yaml
|
||||
|
||||
* Create a settings.yaml file in the root folder of the project
|
||||
* Add below Variables and required Ignore Files
|
||||
|
||||
```yaml
|
||||
code:
|
||||
ignore_files:
|
||||
- ".*"
|
||||
- "*.pyc"
|
||||
- "pycache"
|
||||
- ".git"
|
||||
- ".gitignore"
|
||||
- ".vscode"
|
||||
- ".idea"
|
||||
- ".DS_Store"
|
||||
- ".lock"
|
||||
- ".pyc"
|
||||
- ".env"
|
||||
```
|
||||
|
||||
### Using .env File
|
||||
|
||||
* Create a .env file in the root folder of the project
|
||||
* Add below Variables and required Ignore Files
|
||||
* ```
|
||||
PRAISONAI_IGNORE_FILES=".*,*.pyc,__pycache__,.git,.gitignore,.vscode,.idea,.DS_Store,*.lock,.env,docs,tests,test,tmp,temp,*.txt,*.md,*.json,*.csv,*.tsv,public,*.sql,*.sqlite,*.db,*.db3,*.sqlite3,*.log,*.zip,*.gz,*.tar,*.rar,*.7z,*.pdf,*.jpg,*.jpeg,*.png,*.gif,*.svg,cookbooks,assets,dist,build,node_modules,venv,crewAI,.cache,*.__pycache__,*chroma.sqlite3,test/,dist/,praisonAI.egg-info,test.yaml,db,praisonai_prompt.txt,watch.sh,docs.sh,other,output,*.chainlit,.files,site,flagged,*public,threads.db,trained_agents_data.pkl,.pytest_cache"
|
||||
```
|
||||
|
||||
### Using Environment Variables in the Terminal
|
||||
|
||||
```bash
|
||||
export PRAISONAI_IGNORE_FILES=".*,*.pyc,__pycache__,.git,.gitignore,.vscode,.idea,.DS_Store,*.lock,.env,docs,tests,test,tmp,temp,*.txt,*.md,*.json,*.csv,*.tsv,public,*.sql,*.sqlite,*.db,*.db3,*.sqlite3,*.log,*.zip,*.gz,*.tar,*.rar,*.7z,*.pdf,*.jpg,*.jpeg,*.png,*.gif,*.svg,cookbooks,assets,dist,build,node_modules,venv,crewAI,.cache,*.__pycache__,*chroma.sqlite3,test/,dist/,praisonAI.egg-info,test.yaml,db,praisonai_prompt.txt,watch.sh,docs.sh,other,output,*.chainlit,.files,site,flagged,*public,threads.db,trained_agents_data.pkl,.pytest_cache"
|
||||
```
|
||||
+11
-11
@@ -48,36 +48,36 @@ streamlit run app.py
|
||||
## Run Automatically
|
||||
|
||||
### Install Required Package
|
||||

|
||||

|
||||
|
||||
### User Interface
|
||||

|
||||

|
||||
|
||||
### Select Auto Mode
|
||||

|
||||

|
||||
|
||||
### Configure Agent Settings
|
||||

|
||||

|
||||
|
||||
### Define a Task to Auto Generate Agents and Run
|
||||

|
||||

|
||||
|
||||
### Output
|
||||

|
||||

|
||||
|
||||
## Run Manually
|
||||
|
||||
### Select Manual Mode
|
||||

|
||||

|
||||
|
||||
### Modify Agents and Tools
|
||||

|
||||

|
||||
|
||||
## Review Generated Agents
|
||||

|
||||

|
||||
|
||||
### Run Agents
|
||||

|
||||

|
||||
|
||||
### Manual Model Output
|
||||

|
||||

|
||||
+3
-2
@@ -15,8 +15,9 @@ nav:
|
||||
- Initialise: initialise.md
|
||||
- Run: run.md
|
||||
- Full Automatic: auto.md
|
||||
- User Interface: ui.md
|
||||
- Chat: chat.md
|
||||
- User Interface: ui/ui.md
|
||||
- Chat: ui/chat.md
|
||||
- Code: ui/code.md
|
||||
- CrewAI: framework/crewai.md
|
||||
- AutoGen: framework/autogen.md
|
||||
|
||||
|
||||
+1
-1
@@ -56,7 +56,7 @@ class CloudDeployer:
|
||||
file.write("FROM python:3.11-slim\n")
|
||||
file.write("WORKDIR /app\n")
|
||||
file.write("COPY . .\n")
|
||||
file.write("RUN pip install flask praisonai==0.0.48 gunicorn markdown\n")
|
||||
file.write("RUN pip install flask praisonai==0.0.49 gunicorn markdown\n")
|
||||
file.write("EXPOSE 8080\n")
|
||||
file.write('CMD ["gunicorn", "-b", "0.0.0.0:8080", "api:app"]\n')
|
||||
|
||||
|
||||
+33
-1
@@ -1,6 +1,22 @@
|
||||
import os
|
||||
import fnmatch
|
||||
import re
|
||||
import yaml
|
||||
import logging
|
||||
# Set up logging
|
||||
logger = logging.getLogger(__name__)
|
||||
log_level = os.getenv("LOGLEVEL", "INFO").upper()
|
||||
logger.handlers = []
|
||||
|
||||
# Set up logging to console
|
||||
console_handler = logging.StreamHandler()
|
||||
console_handler.setLevel(log_level)
|
||||
console_formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
|
||||
console_handler.setFormatter(console_formatter)
|
||||
logger.addHandler(console_handler)
|
||||
|
||||
# Set the logging level for the logger
|
||||
logger.setLevel(log_level)
|
||||
|
||||
class ContextGatherer:
|
||||
def __init__(self, directory='.', output_file='context.txt',
|
||||
@@ -14,10 +30,25 @@ class ContextGatherer:
|
||||
|
||||
def get_ignore_patterns(self):
|
||||
"""Read .gitignore file and return ignore patterns."""
|
||||
|
||||
settings_path = os.path.join(self.directory, 'settings.yaml')
|
||||
if os.path.exists(settings_path):
|
||||
with open(settings_path, 'r') as f:
|
||||
settings = yaml.safe_load(f)
|
||||
if 'code' in settings and 'ignore_files' in settings['code']:
|
||||
logger.debug(f"Ignored settings.yaml files: {settings['code']['ignore_files']}")
|
||||
return settings['code']['ignore_files']
|
||||
|
||||
# If settings.yaml doesn't exist, get from env variable
|
||||
ignore_files_env = os.getenv("PRAISONAI_IGNORE_FILES")
|
||||
if ignore_files_env:
|
||||
logger.debug(f"Ignored PRAISONAI_IGNORE_FILES ENV files: {ignore_files_env}")
|
||||
return ignore_files_env.split(",")
|
||||
|
||||
default_patterns = [".*", "*.pyc", "__pycache__", ".git", ".gitignore", ".vscode",
|
||||
".idea", ".DS_Store", "*.lock", "*.pyc", ".env",
|
||||
"docs", "tests", "test", "tmp", "temp",
|
||||
"*.txt", "*.md", "*.json", "*.csv", "*.tsv", "*.yaml", "*.yml","public",
|
||||
"*.txt", "*.md", "*.json", "*.csv", "*.tsv","public",
|
||||
"*.sql", "*.sqlite", "*.db", "*.db3", "*.sqlite3", "*.log", "*.zip", "*.gz",
|
||||
"*.tar", "*.rar", "*.7z", "*.pdf", "*.jpg", "*.jpeg", "*.png", "*.gif", "*.svg",
|
||||
"cookbooks", "assets", "__pycache__", "dist", "build", "node_modules", "venv",]
|
||||
@@ -25,6 +56,7 @@ class ContextGatherer:
|
||||
if os.path.exists(gitignore_path):
|
||||
with open(gitignore_path, 'r') as f:
|
||||
gitignore_patterns = [line.strip() for line in f if line.strip() and not line.startswith('#')]
|
||||
logger.debug(f"Ignored gitignore and default files: {ignore_files_env}")
|
||||
return list(set(default_patterns + gitignore_patterns))
|
||||
return default_patterns
|
||||
|
||||
|
||||
+4
-2
@@ -1,6 +1,6 @@
|
||||
[tool.poetry]
|
||||
name = "PraisonAI"
|
||||
version = "0.0.48"
|
||||
version = "0.0.49"
|
||||
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."
|
||||
authors = ["Mervin Praison"]
|
||||
license = ""
|
||||
@@ -30,6 +30,7 @@ langchain-anthropic = {version = ">=0.1.13", optional = true}
|
||||
langchain-openai = {version = ">=0.1.7", optional = true}
|
||||
langchain-cohere = {version = ">=0.1.4", optional = true}
|
||||
litellm = {version = ">=1.41.8", optional = true}
|
||||
aiosqlite= {version = ">=0.20.0", optional = true}
|
||||
|
||||
[tool.poetry.group.docs.dependencies]
|
||||
mkdocs = "*"
|
||||
@@ -77,6 +78,7 @@ langchain-anthropic = ">=0.1.13"
|
||||
langchain-openai = ">=0.1.7"
|
||||
langchain-cohere = ">=0.1.4"
|
||||
litellm = ">=1.41.8"
|
||||
aiosqlite = ">=0.20.0"
|
||||
|
||||
[build-system]
|
||||
requires = ["poetry-core"]
|
||||
@@ -96,4 +98,4 @@ openai = ["langchain-openai"]
|
||||
anthropic = ["langchain-anthropic"]
|
||||
cohere = ["langchain-cohere"]
|
||||
chat = ["chainlit", "litellm"]
|
||||
code = ["chainlit", "litellm"]
|
||||
code = ["chainlit", "litellm", "aiosqlite"]
|
||||
@@ -0,0 +1,75 @@
|
||||
code:
|
||||
ignore_files:
|
||||
- ".*"
|
||||
- "*.pyc"
|
||||
- "pycache"
|
||||
- ".git"
|
||||
- ".gitignore"
|
||||
- ".vscode"
|
||||
- ".idea"
|
||||
- ".DS_Store"
|
||||
- ".lock"
|
||||
- ".pyc"
|
||||
- ".env"
|
||||
- "docs"
|
||||
- "tests"
|
||||
- "test"
|
||||
- "tmp"
|
||||
- "temp"
|
||||
- ".txt"
|
||||
- ".md"
|
||||
- ".json"
|
||||
- ".csv"
|
||||
- ".tsv"
|
||||
- "public"
|
||||
- ".sql"
|
||||
- ".sqlite"
|
||||
- ".db"
|
||||
- ".db3"
|
||||
- ".sqlite3"
|
||||
- ".log"
|
||||
- ".zip"
|
||||
- ".gz"
|
||||
- ".tar"
|
||||
- ".rar"
|
||||
- ".7z"
|
||||
- ".pdf"
|
||||
- ".jpg"
|
||||
- ".jpeg"
|
||||
- ".png"
|
||||
- ".gif"
|
||||
- ".svg"
|
||||
- "cookbooks"
|
||||
- "assets"
|
||||
- "pycache"
|
||||
- "dist"
|
||||
- "build"
|
||||
- "node_modules"
|
||||
- "venv"
|
||||
- "crewAI"
|
||||
- ".vscode"
|
||||
- ".cache"
|
||||
- "*.__pycache__"
|
||||
- "*chroma.sqlite3"
|
||||
- test/
|
||||
- dist/
|
||||
- .env
|
||||
- assets/*
|
||||
- .idea
|
||||
- .DS_Store
|
||||
- .pytest_cache
|
||||
- praisonAI.egg-info
|
||||
- test.yaml
|
||||
- db
|
||||
- praisonai_prompt.txt
|
||||
- watch.sh
|
||||
- docs.sh
|
||||
- other
|
||||
- output
|
||||
- "*.chainlit"
|
||||
- .files
|
||||
- site
|
||||
- flagged
|
||||
- "*public"
|
||||
- "threads.db"
|
||||
- "trained_agents_data.pkl"
|
||||
Reference in new issue
Block a user