Implement todo noted in last commit, and bit more.
This brings in clearing of the external ai tool call special chat
session divStream during chat show, which ensures that it gets
hidden by default wrt other chat sessions and inturn only get
enabled if user triggers a new tool call involving external ai
tool call.
This patch also ensures that if ext ai tool call takes too much
time and so logic gives you back control with a timed out response
as a possible response back to ai wrt the tool call, then the
external ai tool call's ai live response is no longer visible in
the current chat session ui. So user can go ahead with the timed
out response or some other user decided response as the response
to the tool call. And take the chat in a different direction of
their and ai's choosing.
Or else, if they want to they can switch to the External Ai
specific special chat session and continue to monitor the response
from the tool call there, to understand what the final response
would have been wrt that tool call.
Rather this should keep the ui flow clean.
ALERT: If the user triggers a new ext ai tool call, when the
old one is still alive in the background, then response from
both will be in a race for user visibility, so beware of it.
Move all markdown configs into a single object field.
Add always flag, which if set, all roles' message contents will be
treated as markdown, else only ai assistant's messages will be
treated as markdown.
Given that now currently settings relates to only those related
to the current chat session, so indicate the name/chatId of the
current chat session in the Settings heading.
* this inturn makes the id dynamic, so change the css rule wrt
settings block from using id to classname, and to help with same
also set a class name for the top level settings block.
As part of same, as well as to help and ensure sanity in general
add a helper to clean up a string to be a form usable as a chatId
Instead of having texts submit and image, replace them with equiv
unicode icons.
Adjust the size of these buttons to be smaller, given that now they
only contain icons in them.
Switch from btn+inputfile+img to btn+inputfile wrt image loading btn
given that the image will be shown in seperate dynamically created
images in the user in div.
Had forgotten to use ${} for variable within a literal template
string.
Had forgotten to use the full hierarchy of props when setting the
id of elements, which is useful to map a label to a button and so.
This would have led to the wrong button being clicked when a label
with duplicated id was clicked. Ie if two different objects within
a object, have properties/fields with the same name, then previously
this would have led to a bunch of labels and buttons or so having
the same id, bcas their hierarchy was not being accounted for. This
is fixed now.
Allow AutoCreated Object Properties Editing UI to be themed to an
extent by assigning a id to the top level element, which is based
on the legend specified.
Use the same to add inline padding as well as adjust border radius
wrt the elements within, for the Settings ui. And min height and
border width wrt input, select and buttons within.
Similarly for the default Usage,Restore and SettingsInfo summary
titles, avoid border-radius.
Show the string representation of the sliding window selected.
Add some padding to system prompt input.
Allow passing the accept list for file type input element helper.
Inturn given that currently it is used for the image selection
for vision models, set it to jpeg and png in the caller for the
same.
Add a new helper to create a file type input which includes a btn
with image. Use same wrt the user image selection button.
Update button creation helper to show innerText only if the newly
added innerHTML arg is undefined.
When ever user makes a image selection, the image will be shown
in the input-filetype-image-button. In turn when the same is
submitted to ai engine server, the image will be cleared.
Fix up the oversights wrt any depth trapping flow
Remember to start the propWithTree being checked/trapped with :
to indicate the root of the prop hierarchy and also use : as sep
between the elements of the props hierarchy tree
Also had forgotten about the goof up possible with using in in a
condition statement to check for array to contain a entry of interest
in JS, fixed it now.
Maintain the current property hierarchy to its root over recursive
calls.
Allow callers to specify the props to be trapped using the prop
hierarchy.
Pass the prop hierarchy to the fTrapper.
This should allow one to trap any prop wrt its editing ui setup,
irrespective of whether it is a prop of the main object passed,
or a member of a child prop of the main object passed or so ...
Update the setting up of ChatHistoryInCtxt and ApiEndPoint to follow
the new semantic/flow.
Make the previously relatively generic flow wrt apiRequestOptions
settings into a fully generic reusable by others flow.
Rather had stopped short of it, when previously moved onto other
things at that time.