Skip to content

Commit

Permalink
Merge branch 'main' into feature/default-stylesheet-testing
Browse files Browse the repository at this point in the history
  • Loading branch information
rhennigan committed Jan 30, 2024
2 parents 8467c32 + 72d88ac commit 72acd1a
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions Source/Chatbook/Tools/Common.wl
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,7 @@ toolAppearanceRules // beginDefinition;

toolAppearanceRules[ tool: $$llmToolH[ as_Association, { opts: OptionsPattern[ ] }, ___ ] ] := Enclose[
Module[ { optValue, optSetting, inlineSetting, autoSettings, combined },
(* cSpell: ignore nodef *)
optValue = Association @ Quiet[ OptionValue[ LLMTool, { opts }, AppearanceRules ], OptionValue::nodef ];
optValue = Association @ quietOptionValue[ LLMTool, { opts }, AppearanceRules ];
optSetting = If[ AssociationQ @ optValue, optValue, <| |> ];
inlineSetting = ConfirmBy[ KeyTake[ as, $appearanceRulesKeys ], AssociationQ, "Inline" ];
autoSettings = ConfirmBy[ $autoAppearanceRules, AssociationQ, "Auto" ];
Expand All @@ -230,6 +229,22 @@ toolAppearanceRules[ tool: $$llmToolH[ as_Association, ___ ] ] :=

toolAppearanceRules // endDefinition;

(* ::**************************************************************************************************************:: *)
(* ::Subsubsubsection::Closed:: *)
(*quietOptionValue*)
quietOptionValue // beginDefinition;

quietOptionValue[ sym_Symbol, opts_List, name_ ] :=
quietOptionValue[ sym, opts, name, Automatic ];

quietOptionValue[ sym_Symbol, { opts: OptionsPattern[ ] }, name_, default_ ] := Quiet[
Replace[ OptionValue[ sym, { opts }, name ], HoldPattern[ name ] :> default ],
(* cSpell: ignore nodef, optnf *)
{ OptionValue::nodef, OptionValue::optnf }
];

quietOptionValue // endDefinition;

(* ::**************************************************************************************************************:: *)
(* ::Subsubsection::Closed:: *)
(*toolDefaultIcon*)
Expand Down

0 comments on commit 72acd1a

Please sign in to comment.