Skip to content

Commit

Permalink
fix unbound reference issue (#807)
Browse files Browse the repository at this point in the history
* fix unbound reference issue

* bump version
  • Loading branch information
willydouhard committed Mar 11, 2024
1 parent 3b17af9 commit 3b6852c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions backend/chainlit/langchain/callbacks.py
Expand Up @@ -525,11 +525,13 @@ def _on_run_update(self, run: Run) -> None:
# find first message with prompt_id
for m in chat_start["input_messages"]:
if m.additional_kwargs.get("prompt_id"):
current_step.generation.prompt_id = m.additional_kwargs["prompt_id"]
current_step.generation.prompt_id = m.additional_kwargs[
"prompt_id"
]
if custom_variables := m.additional_kwargs.get("variables"):
current_step.generation.variables = custom_variables
break

current_step.language = "json"
current_step.output = json.dumps(message_completion)
else:
Expand Down Expand Up @@ -558,8 +560,6 @@ def _on_run_update(self, run: Run) -> None:
self._run_sync(current_step.update())

if self.final_stream and self.has_streamed_final_answer:
if self.final_stream.content:
self.final_stream.content = completion
self._run_sync(self.final_stream.update())

return
Expand Down
2 changes: 1 addition & 1 deletion backend/pyproject.toml
@@ -1,6 +1,6 @@
[tool.poetry]
name = "chainlit"
version = "1.0.400"
version = "1.0.401"
keywords = ['LLM', 'Agents', 'gen ai', 'chat ui', 'chatbot ui', 'openai', 'copilot', 'langchain', 'conversational ai']
description = "Build Conversational AI."
authors = ["Chainlit"]
Expand Down

0 comments on commit 3b6852c

Please sign in to comment.