Skip to content

Commit

Permalink
Merge pull request #817 from WolframResearch/bugfix/fallback-for-chat…
Browse files Browse the repository at this point in the history
…-object-failure

Bugfix: If `ChatObject[...]` failed for some reason, save chat using the fallback dataset
  • Loading branch information
rhennigan authored Oct 7, 2024
2 parents 04caa69 + 99f6440 commit 72bf74b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Source/Chatbook/Storage.wl
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,10 @@ SaveChat[ messages: $$chatMessages, settings_Association, opts: OptionsPattern[
catchMine @ LogChatTiming @ saveChat[ messages, settings, OptionValue[ "AutoGenerateTitle" ] ];

SaveChat[ chat_ChatObject, settings_Association, opts: OptionsPattern[ ] ] :=
catchMine @ LogChatTiming @ saveChat[ chat[ "Messages" ], settings, OptionValue[ "AutoGenerateTitle" ] ];
catchMine @ SaveChat[ chat[ "Messages" ], settings, opts ];

SaveChat[ chat_Dataset, settings_Association, opts: OptionsPattern[ ] ] :=
catchMine @ SaveChat[ Normal @ chat, settings, opts ];

SaveChat // endExportedDefinition;

Expand Down

0 comments on commit 72bf74b

Please sign in to comment.