Commit Graph

12 Commits

Author SHA1 Message Date
HanishKVC 6eb1e0fbde SimpleChat:JS: bottom of element visible, Set focus to user input
As the generated text could be multiple lines and occupy more space
that the full scrollable div's vertical space, make the bottom of
the last element (which can be such a generated text) in the div
visible by scrolling.

Ensure that the user input box has focus
2024-05-18 22:59:21 +05:30
HanishKVC a944ce7cbe SimpleChat:JS: Try ensure the last entry in chat is visible
Needed because now only the chat div is scrollable and not the full
page.

In last commit the chat div size was fixed to 75% vertical height,
so the full page no longer scrolls, so the old bring user-input
element to view wont work, instead now the last element in the
chat div should be brought into view.
2024-05-18 22:23:34 +05:30
HanishKVC 601fedf8c1 SimpleChat: Move handling systemprompt into its own func 2024-05-18 03:19:59 +05:30
HanishKVC 72151aa634 SimpleChat:Alert user if they provide sysprompt late or change it 2024-05-18 03:16:30 +05:30
HanishKVC 884adfd739 SimpleChat: Ignore empty user input, without trimming 2024-05-18 03:07:40 +05:30
HanishKVC ae52ad1675 SimpleChat:Allow system prompt to be set, if provided before user 2024-05-18 02:59:42 +05:30
HanishKVC b3644172e0 SimpleChat:JS: Force completion mode be single message by default 2024-05-18 00:36:23 +05:30
HanishKVC aef32d9cc0 SimpleChat:JS: Handle difference in response
Try read the assistance response from appropriate field in the
response got.

Also examples/server seems to return the response in a slightly
different field, so try account for that also.
2024-05-18 00:36:23 +05:30
HanishKVC 3e5edbacd6 SimpleChat: Dont submit if already submitted and waiting
Also make chat the default selection wrt mode
2024-05-18 00:36:23 +05:30
HanishKVC 9feb58eaa5 SimpleChat: Allow user to select chat or completion mode 2024-05-18 00:36:23 +05:30
HanishKVC e62087bf3f SimpleChat:JS: Try trap enter key press wrt input text field
So user can either press submit button or press enter key
2024-05-18 00:36:23 +05:30
HanishKVC ebe330d098 SimpleChat: Move into its own sub directory to avoid confusion 2024-05-18 00:36:23 +05:30
Renamed from examples/server/public/simplechat.js (Browse further)