Skip to content

Commit

Permalink
Still debugging mysterious issues with "MessageTag" in tagging rules
Browse files Browse the repository at this point in the history
  • Loading branch information
rhennigan committed Oct 31, 2023
1 parent 5bd53bd commit 3b8abe7
Showing 1 changed file with 22 additions and 17 deletions.
39 changes: 22 additions & 17 deletions Source/Chatbook/SendChat.wl
Original file line number Diff line number Diff line change
Expand Up @@ -392,21 +392,21 @@ chatSubmit0[ container_, messages: { __Association }, cellObject_, settings_ ] :
Needs[ "LLMServices`" -> None ];
$lastChatSubmitResult = ReleaseHold[
$lastChatSubmit = HoldForm @ applyProcessingFunction[
settings,
"ChatSubmit",
HoldComplete[
standardizeMessageKeys @ messages,
makeLLMConfiguration @ settings,
HandlerFunctions -> chatHandlers[ container, cellObject, settings ],
HandlerFunctionsKeys -> chatHandlerFunctionsKeys @ settings
],
<|
"Container" :> container,
"Messages" -> messages,
"CellObject" -> cellObject,
"DefaultSubmitFunction" -> LLMServices`ChatSubmit
|>,
LLMServices`ChatSubmit
settings,
"ChatSubmit",
HoldComplete[
standardizeMessageKeys @ messages,
makeLLMConfiguration @ settings,
HandlerFunctions -> chatHandlers[ container, cellObject, settings ],
HandlerFunctionsKeys -> chatHandlerFunctionsKeys @ settings
],
<|
"Container" :> container,
"Messages" -> messages,
"CellObject" -> cellObject,
"DefaultSubmitFunction" -> LLMServices`ChatSubmit
|>,
LLMServices`ChatSubmit
]
],
{ LLMServices`ChatSubmit::unsupported }
Expand Down Expand Up @@ -1635,10 +1635,15 @@ writeReformattedCell[ settings_, None, cell_CellObject ] :=

writeReformattedCell[ settings_, string_String, cell_CellObject ] := Enclose[
Block[ { $dynamicText = False },
Module[ { scroll, tag, open, label, pageData, uuid, new, output, createTask, info },
Module[ { tag, scroll, open, label, pageData, uuid, new, output, createTask, info },

tag = ConfirmMatch[
Replace[ CurrentValue[ cell, { TaggingRules, "MessageTag" } ], $Failed -> Inherited ],
_String|Inherited,
"Tag"
];

scroll = scrollOutputQ[ settings, cell ];
tag = ConfirmMatch[ CurrentValue[ cell, { TaggingRules, "MessageTag" } ], _String|Inherited, "Tag" ];
open = $lastOpen = cellOpenQ @ cell;
label = RawBoxes @ TemplateBox[ { }, "MinimizedChat" ];
pageData = CurrentValue[ cell, { TaggingRules, "PageData" } ];
Expand Down

0 comments on commit 3b8abe7

Please sign in to comment.