Given that now fetch_web_url_raw can also fetch local files, if local
file access scheme is enabled in simpleproxy.py, so rename this
tool call by dropping web from its name, given that some ai models
were getting confused because of the same.
Maintain raw and sanitized versions of line.
Make blockquote work with raw line and not the sanitized line.
So irrespective of whether sanitize is enabled or not, the logic
will still work. Inturn re-enable HtmlSanitize.
Similar to listitem before, now also allow a para to have its long
lines split into adjacent lines. Inturn the logic will take care of
merging them into single para.
The common logic wrt both flows moved into its own helper function.
If the split lines dont have any empty lines inbetween and also
remain within the block area of the list item which they belong
to, then the split line will be appended to the corresponding
list item, ELSE a new list item will be created.
To help with same a generic keyed empty lines tracker logic has
been added.
TODO: Account similar semantic wrt paragraph related split lines
If a split line is found which remains within the constraints of
the preceding list item, then dont unwind the list, rather for
now add the split line as a new item at the same level.
Start ordered or unordered list as the case may be and push the
same into endType for matching unwinding.
Ignore empty lines and dont force a list unwind.
Avoid seperate new list level logic for a fresh list and list with
in list paths. Rather adjust lastOffset specifically for fresh list.
All paths lead to need to insert list item and the difference to be
handled wrt starting or ending a list level is handled by respective
condition check blocks directly without delaying it for later so no
need for that sList state, so remove.
Avoid check for same level list item path, as nothing special needs
to be do in that path currently.
Live identify the last offset, when unwinding.
NOTE: Logic currently will handle ordered lists on their own or
unordered lists on thier own or intermixed list containing both
type of lists within them, however remember that all will be shown
as unordered lists.
ALERT: if there is a really long line, the logic currently doesnt
support it being broken into smaller line with same or greater
offset than the line identifying the current list item.
Save copy of data being processed.
Try and sanitize the data passed for markdown to html conversion,
so that if there are any special characters wrt html in the passed
markdown content, it gets translated into a harmless text.
This also ensures that those text dont disappear, bcas of browser
trying to interpret them as html tagged content.
Trap any errors during sanitizing and or processing of the lines
in general and push them into a errors array. Callers of this
markdown class can decide whether to use the converted html or
not based on errors being empty or not or ...
Move the processing of unordered list into a function of its own.
Rather the ordered list can also use the same flow in general except
for some tiny changes including wrt the regex, potentially.
User can enable or disable the simple minded bruteforce markdown
parsing from the per session settings.
Add grey shading and align text to left wrt table headings of
markdown to html converted tables.
Switch to the simpler split based flow.
Include tr wrt the table head block also.
Add a css entry to try and have header cell contents text aling
to left for now, given that there is no border or color shaded
or so distinguishing characteristics wrt the table cells for now.
Rather this wont work, need to refresh on regex, been too long.
Rather using split should be simpler
However the extraction of head and body parts with seperation
inbetween for transition should work
Rather the seperation is blindly assumed and corresponding line
discarded for now
Allow fenced code block / pre to be demarkated using either ```
or ~~~
Ensure the termination line wrt fenced block doesnt contain anything
else.
Same starting marker needs to be present wrt ending also
Ensure '---' is treated as a horizontal line and doesnt mess with
unordered list handling.
Take care of unwinding the unordered list everywhere it is needed.
Remove markdown heading markers
Fix pre equivalent blocks of markdown given that they can have
the block type following ``` marker
Remember to add line break at end of line wrt pre block.
By default ensure external_ai tool call related special chat session
starts with tool calls disabled and client side sliding window of 1.
Add a helper in SimpleChat class to set these along with clearing of
any chat history.
Inturn now give the user flexibility to change this from within
the program, if they need to for what ever reason, till the program
restarts.
Gives quick overview of the features, given that the original readme
(now docs/details.md++) got created over a period of disjoined time
as features got added.
Ensure we are working with the Chat Messages in Chat session, which
are in the currently active sliding window.
Remove any chat message blocks in the chat session ui, which are
no longer in the sliding window of context.
This brings uirefresh semantic to be in sync with chat_show logic
Rename the default 2 chat session names to make them neutral.
Update internal name to include AnveshikaSallap, better matching
the semantic of the logic, given support for tool calling, vision,
reasoning, ...
Also update usage note wrt simpleproxy.py for web access related
tool calls and few other minor tweeks.
Ensure toolNames array is reset, each time setup is called, so
that it doesnt end up with duplicate entries and equally dont
end up with entries of tool calls which are no longer available,
maybe because some config changed etal.
Ensure the ChatId is logged wrt the toolweb related setup actions.
Ensure that ExternalAi tool call related chat session, has its
tools config disabled, when its created itself, so that end user
doesnt get confused, given that external_ai toolcall explicitly
forces tools support to disabled.
Update some of the notes and readme
When switching to settings ui, hide the User input and ValidateTC
areas.
When switching back to any chat session, unhide User input, while
the ValidateTC ui will be handled by corresponding helper logic
called through the ShowMessage
Given that ValidatedToolCallTrigger UI setup has to also setup
the auto trigger logic, which inturn is dependent on the autosecs
value in the Config associated with the Chat session involved, so
pass chatId to ShowMessage and inturn ValidatedToolCallTriggerUI
setup logic
Rename the function name to better match the semantic.
Split init from setup wrt Tools. Init is called when the program
is started, while setup is called when ever a session is created
and or when ever any tools setup related config is changed (like
proxyUrl getting modified or so).
This allows one to modify tool related config and inturn update
the tools related states wrt same (like wrt the proxyUrl, bcas
the simpleproxy server will change, one needs to cross check which
and all web services are available with the new simpleproxy server
and so and so ...)
To help with the above, now ToolsManager maintains multiple tool
call switches, where there will be a tc_switch wrt each chat
session.
All tool related codes, where needed have been updated to work
with the chat session for which they have been called, instead
of any global states.
In future, this can enable one to allow user to enable or disable
the tool calls exposed in each of the chat sessions,
This immidiately needed toolweb and toolai to account for chat
session as needed.
In future, if we want to keep the data store isolated across
chat sessions, then this can be useful, in that it can create
uniq store names for each of the chat sessions, isntead of
sharing a common store name across all sessions.
The chat session creation as well as tool init/setup related
flows have been updated to chain through or account for the
promises as needed
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
Update SimpleChat to have a duplicated instance of Config instead
of a reference to the global Me instance.
Most logics updated to work with the config entries corresponding
to the current chat session.
ShowSettings, ShowInfo and getting current sliding window size in
user friendly textual form have been moved to Config from Me.
ALERT: With this now, user clicking settings will be able to modify
only the settings corresponding to current in focus chat session.
TODO:
ToolsMgr related use within SimpleChat and beyond needs to be thought
through and updated as needed.
Should tools.proxyUrl be unique to each SimpleChat or ...