Skip to content

Commit 2845328

Browse files
Merge pull request #85 from MervinPraison/develop
Set Max Tokens Env Variable
2 parents 9072177 + 8985715 commit 2845328

File tree

6 files changed

+20
-6
lines changed

6 files changed

+20
-6
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM python:3.11-slim
22
WORKDIR /app
33
COPY . .
4-
RUN pip install flask praisonai==0.0.49 gunicorn markdown
4+
RUN pip install flask praisonai==0.0.50 gunicorn markdown
55
EXPOSE 8080
66
CMD ["gunicorn", "-b", "0.0.0.0:8080", "api:app"]

docs/api/praisonai/deploy.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ <h2 id="raises">Raises</h2>
110110
file.write(&#34;FROM python:3.11-slim\n&#34;)
111111
file.write(&#34;WORKDIR /app\n&#34;)
112112
file.write(&#34;COPY . .\n&#34;)
113-
file.write(&#34;RUN pip install flask praisonai==0.0.49 gunicorn markdown\n&#34;)
113+
file.write(&#34;RUN pip install flask praisonai==0.0.50 gunicorn markdown\n&#34;)
114114
file.write(&#34;EXPOSE 8080\n&#34;)
115115
file.write(&#39;CMD [&#34;gunicorn&#34;, &#34;-b&#34;, &#34;0.0.0.0:8080&#34;, &#34;api:app&#34;]\n&#39;)
116116

docs/ui/code.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,17 @@ code:
6767
```bash
6868
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"
6969
```
70+
71+
## Set Max Tokens
72+
73+
```bash
74+
export PRAISONAI_MAX_TOKENS=200000
75+
```
76+
77+
or
78+
79+
* Create a .env file in the root folder of the project
80+
* Add below Variables and required Max Tokens
81+
* ```
82+
PRAISONAI_MAX_TOKENS=200000
83+
```

praisonai/deploy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def create_dockerfile(self):
5656
file.write("FROM python:3.11-slim\n")
5757
file.write("WORKDIR /app\n")
5858
file.write("COPY . .\n")
59-
file.write("RUN pip install flask praisonai==0.0.49 gunicorn markdown\n")
59+
file.write("RUN pip install flask praisonai==0.0.50 gunicorn markdown\n")
6060
file.write("EXPOSE 8080\n")
6161
file.write('CMD ["gunicorn", "-b", "0.0.0.0:8080", "api:app"]\n')
6262

praisonai/ui/context.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@
2020

2121
class ContextGatherer:
2222
def __init__(self, directory='.', output_file='context.txt',
23-
relevant_extensions=None, max_file_size=1_000_000, max_tokens=60000):
23+
relevant_extensions=None, max_file_size=1_000_000, max_tokens=128000):
2424
self.directory = directory
2525
self.output_file = output_file
2626
self.relevant_extensions = relevant_extensions or ['.py']
2727
self.max_file_size = max_file_size
28-
self.max_tokens = max_tokens
28+
self.max_tokens = int(os.getenv("PRAISONAI_MAX_TOKENS", max_tokens))
2929
self.ignore_patterns = self.get_ignore_patterns()
3030

3131
def get_ignore_patterns(self):

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "PraisonAI"
3-
version = "0.0.49"
3+
version = "0.0.50"
44
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."
55
authors = ["Mervin Praison"]
66
license = ""

0 commit comments

Comments
 (0)