Skip to content

Commit

Permalink
Merge branch 'diagrams' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
embernet committed May 14, 2024
2 parents 8bc9226 + b5fa9b3 commit 4866eb4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
20 changes: 14 additions & 6 deletions web_ui/src/Chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -1793,9 +1793,9 @@ const Chat = ({
<MenuItem divider style={{ minHeight: '10px' }} />
<MenuItem style={{ minHeight: '30px' }} onClick={handleDeleteThisMessage}>Delete this message</MenuItem>
<MenuItem style={{ minHeight: '30px' }} onClick={handleDeleteThisAndPreviousMessage}>Delete this and previous message</MenuItem>
<MenuItem style={{ minHeight: '30px' }} onClick={handleDeleteAllMessages}>Delete all messages</MenuItem>
<MenuItem style={{ minHeight: '30px' }} onClick={handleDeleteAllMessagesUpToHere}>Delete this and all previous messages</MenuItem>
<MenuItem style={{ minHeight: '30px' }} onClick={handleDeleteAllMessagesFromHere}>Delete this and all subseqeunt messages</MenuItem>
<MenuItem style={{ minHeight: '30px' }} onClick={handleDeleteAllMessages}>Delete all messages</MenuItem>
</Menu>
<Menu
id="menu-prompts"
Expand Down Expand Up @@ -2462,8 +2462,10 @@ const Chat = ({
</IconButton>
</span>
</Tooltip>
<Tooltip title={ aiLibraryOpen ? "Hide AI Library" : `Show AI Library (${Object.keys(selectedAiLibraryNotes).length} knowledge notes loaded)`}>
<IconButton edge="start" color="inherit" aria-label={ aiLibraryOpen ? "Hide AI Library" : "Show AI Library"}
<Tooltip title={ aiLibraryOpen ? "Hide AI Library" : `Show AI Library. You can then select notes to add to the chat context.
You can add individual notes to the AI library by opening them in the Note editor and clicking on the 'Add to AI Library' button.
(${Object.keys(selectedAiLibraryNotes).length} knowledge notes currently loaded)`}>
<IconButton edge="start" color="inherit" aria-label={ aiLibraryOpen ? "Hide AI Library" : "Show AI Library."}
onClick={handleToggleAILibraryOpen}>
{ Object.keys(selectedAiLibraryNotes).length === 0 ? <LocalLibraryOutlinedIcon/> : <LocalLibraryIcon/> }
</IconButton>
Expand Down Expand Up @@ -2552,11 +2554,17 @@ const Chat = ({
{ aiLibraryOpen ?
<Paper sx={{ margin: "2px 0px", padding: "2px 6px", display:"flex", gap: 1, backgroundColor: darkMode ? grey[900] : grey[100] }}>
<Box sx={{ mt: 2, display: "flex", flexDirection: "column", width: "100%" }}>
<FormLabel>
Loaded knowledge: { Object.keys(selectedAiLibraryNotes).length === 0 ? "None" : ""}
<SecondaryToolbar sx={{gap:1}} className={ClassNames.toolbar}>
<Typography fontWeight="bold">AI Library</Typography>
<Typography sx={{mr:1}}>Loaded notes: {Object.keys(selectedAiLibraryNotes).length}</Typography>
<TextStatsDisplay name="AI Library" sizeInCharacters={selectedAiLibraryFullTextSize}
maxTokenSize={myModelSettings.contextTokenSize}/>
</FormLabel>
<Tooltip title='Close AI library'>
<IconButton sx={{ml:'auto'}} onClick={()=>{setAiLibraryOpen(false)}}>
<CloseIcon />
</IconButton>
</Tooltip>
</SecondaryToolbar>
<List dense sx={{ width: "100%", overflow: "auto", maxHeight: "100px" }}>
{Object.values(selectedAiLibraryNotes).map(note =>(
<ListItem
Expand Down
4 changes: 2 additions & 2 deletions web_ui/src/Note.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ Don't repeat the CONTEXT_TEXT or the REQUEST in your response. Create a response

useEffect(()=>{
if(pageLoaded && appendNoteContent.content !== "" && noteContentRef?.current) {
setNoteOpen({id: id, timestamp: Date.now()});
setNoteOpen({id: id, timestamp: Date.now()}); // to scroll the note into view if its off the screen
let newNotePart = appendNoteContent.content.trim();
if(typeof newNotePart === "string") {
let newNote = noteContentRef.current.innerText;
Expand Down Expand Up @@ -721,7 +721,7 @@ Don't repeat the CONTEXT_TEXT or the REQUEST in your response. Create a response
{ markdownRenderingOn ? <CodeOffIcon/> : <CodeIcon/> }
</IconButton>
</Tooltip>
<Tooltip title={ inAILibrary ? "Remove from AI Library" : "Add to AI library" }>
<Tooltip title={ inAILibrary ? "Remove from AI Library" : "Add to AI library. When you click the same library icon in the Chat Prompt Editor it will give you the option of adding notes to the context of your chat. These notes do not appear in the chat transcript but are sent to the AI every time you prompt it so it has them as context." }>
<IconButton edge="start" color="inherit" aria-label={ inAILibrary ? "Remove from AI Library" : "Add to AI library" } onClick={handleToggleInAILibrary}>
{ inAILibrary ? <LocalLibraryIcon/> : <LocalLibraryOutlinedIcon/> }
</IconButton>
Expand Down

0 comments on commit 4866eb4

Please sign in to comment.