Skip to content

Commit

Permalink
Merge pull request #1036 from WolframResearch/1007-stopchat-can-fail-…
Browse files Browse the repository at this point in the history
…if-container-for-streaming-content-has-not-been-fully-initialized

Bugfix: Prevent failure in `StopChat` when container hasn't been fully initialized
  • Loading branch information
rhennigan authored Jan 21, 2025
2 parents 98ae65e + 36c19c6 commit f9de227
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion PacletInfo.wl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PacletObject[ <|
"Name" -> "Wolfram/Chatbook",
"PublisherID" -> "Wolfram",
"Version" -> "2.1.0",
"Version" -> "2.1.1",
"WolframVersion" -> "14.1+",
"Description" -> "Wolfram Notebooks + LLMs",
"License" -> "MIT",
Expand Down
4 changes: 2 additions & 2 deletions Source/Chatbook/Actions.wl
Original file line number Diff line number Diff line change
Expand Up @@ -739,8 +739,8 @@ StopChat[ cell0_CellObject ] := Enclose[
settings = ConfirmMatch[ currentChatSettings @ cell, _Association|_Missing, "ChatNotebookSettings" ];
If[ MissingQ @ settings, finish[ ] ];
removeTask @ Lookup[ settings, "Task", None ];
container = ConfirmMatch[ Lookup[ settings, "Container", None ], _Association|None, "Container" ];
If[ container === None, finish[ ] ];
container = ConfirmMatch[ Lookup[ settings, "Container", None ], _Association|_Symbol, "Container" ];
If[ MatchQ[ container, _Symbol ], finish[ ] ];
content = ConfirmMatch[ Lookup[ container, "FullContent" ], _String|$$progressIndicator, "Content" ];
FinishDynamic[ ];
Block[ { createFETask = # & }, writeReformattedCell[ settings, content, cell ] ]
Expand Down

0 comments on commit f9de227

Please sign in to comment.