Skip to content

Commit 285e6c5

Browse files
Merge pull request #157 from MervinPraison/develop
Fixing the bug to update the model name
2 parents 07fb9a3 + f586465 commit 285e6c5

File tree

6 files changed

+21
-8
lines changed

6 files changed

+21
-8
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.69 gunicorn markdown
4+
RUN pip install flask praisonai==0.0.70 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.69 gunicorn markdown\n&#34;)
113+
file.write(&#34;RUN pip install flask praisonai==0.0.70 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

praisonai.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ class Praisonai < Formula
33

44
desc "AI tools for various AI applications"
55
homepage "https://github.com/MervinPraison/PraisonAI"
6-
url "https://github.com/MervinPraison/PraisonAI/archive/refs/tags/0.0.69.tar.gz"
6+
url "https://github.com/MervinPraison/PraisonAI/archive/refs/tags/0.0.70.tar.gz"
77
sha256 "1828fb9227d10f991522c3f24f061943a254b667196b40b1a3e4a54a8d30ce32" # Replace with actual SHA256 checksum
88
license "MIT"
99

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.69 gunicorn markdown\n")
59+
file.write("RUN pip install flask praisonai==0.0.70 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/code.py

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,13 +216,19 @@ async def setup_agent(settings):
216216
# Save in thread metadata
217217
thread_id = cl.user_session.get("thread_id")
218218
if thread_id:
219-
thread = await cl_data.get_thread(thread_id)
219+
thread = await cl_data._data_layer.get_thread(thread_id)
220220
if thread:
221221
metadata = thread.get("metadata", {})
222+
if isinstance(metadata, str):
223+
try:
224+
metadata = json.loads(metadata)
225+
except json.JSONDecodeError:
226+
metadata = {}
227+
222228
metadata["model_name"] = model_name
223229

224230
# Always store metadata as a JSON string
225-
await cl_data.update_thread(thread_id, metadata=json.dumps(metadata))
231+
await cl_data._data_layer.update_thread(thread_id, metadata=json.dumps(metadata))
226232

227233
# Update the user session with the new metadata
228234
cl.user_session.set("metadata", metadata)
@@ -318,7 +324,14 @@ async def on_chat_resume(thread: ThreadDict):
318324
message_history.append({"role": "user", "content": message.get("output", "")})
319325
elif msg_type == "assistant_message":
320326
message_history.append({"role": "assistant", "content": message.get("output", "")})
327+
elif msg_type == "run":
328+
# Handle 'run' type messages
329+
if message.get("isError"):
330+
message_history.append({"role": "system", "content": f"Error: {message.get('output', '')}"})
331+
else:
332+
# You might want to handle non-error 'run' messages differently
333+
pass
321334
else:
322-
logger.warning(f"Message without type: {message}")
335+
logger.warning(f"Message without recognized type: {message}")
323336

324337
cl.user_session.set("message_history", message_history)

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.69"
3+
version = "0.0.70"
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)