2025-04-27 15:13:19 -04:00
|
|
|
import React, { forwardRef, useState, useCallback, useMemo, useEffect, useRef } from 'react';
|
2024-05-14 11:00:01 -04:00
|
|
|
import debounce from 'lodash/debounce';
|
2025-04-27 15:13:19 -04:00
|
|
|
import { useRecoilState } from 'recoil';
|
2023-06-02 09:41:34 +05:30
|
|
|
import { Search, X } from 'lucide-react';
|
2024-05-14 11:00:01 -04:00
|
|
|
import { QueryKeys } from 'librechat-data-provider';
|
|
|
|
|
import { useQueryClient } from '@tanstack/react-query';
|
2025-04-17 03:07:43 +02:00
|
|
|
import { useLocation, useNavigate } from 'react-router-dom';
|
2025-01-12 12:57:10 -05:00
|
|
|
import { useLocalize, useNewConvo } from '~/hooks';
|
♾️ style: Infinite Scroll Nav and Sort Convos by Date/Usage (#1708)
* Style: Infinite Scroll and Group convos by date
* Style: Infinite Scroll and Group convos by date- Redesign NavBar
* Style: Infinite Scroll and Group convos by date- Redesign NavBar - Clean code
* Style: Infinite Scroll and Group convos by date- Redesign NavBar - Redesign NewChat Component
* Style: Infinite Scroll and Group convos by date- Redesign NavBar - Redesign NewChat Component
* Style: Infinite Scroll and Group convos by date- Redesign NavBar - Redesign NewChat Component
* Including OpenRouter and Mistral icon
* refactor(Conversations): cleanup use of utility functions and typing
* refactor(Nav/NewChat): use localStorage `lastConversationSetup` to determine the endpoint to use, as well as icons -> JSX components, remove use of `endpointSelected`
* refactor: remove use of `isFirstToday`
* refactor(Nav): remove use of `endpointSelected`, consolidate scrolling logic to its own hook `useNavScrolling`, remove use of recoil `conversation`
* refactor: Add spinner to bottom of list, throttle fetching, move query hooks to client workspace
* chore: sort by `updatedAt` field
* refactor: optimize conversation infinite query, use optimistic updates, add conversation helpers for managing pagination, remove unnecessary operations
* feat: gen_title route for generating the title for the conversation
* style(Convo): change hover bg-color
* refactor: memoize groupedConversations and return as array of tuples, correctly update convos pre/post message stream, only call genTitle if conversation is new, make `addConversation` dynamically either add/update depending if convo exists in pages already, reorganize type definitions
* style: rename Header NewChat Button -> HeaderNewChat, add NewChatIcon, closely match main Nav New Chat button to ChatGPT
* style(NewChat): add hover bg color
* style: cleanup comments, match ChatGPT nav styling, redesign search bar, make part of new chat sticky header, move Nav under same parent as outlet/mobilenav, remove legacy code, search only if searchQuery is not empty
* feat: add tests for conversation helpers and ensure no duplicate conversations are ever grouped
* style: hover bg-color
* feat: alt-click on convo item to open conversation in new tab
* chore: send error message when `gen_title` fails
---------
Co-authored-by: Walber Cardoso <walbercardoso@gmail.com>
2024-02-03 20:25:35 -05:00
|
|
|
import { cn } from '~/utils';
|
2023-03-28 20:36:21 +08:00
|
|
|
import store from '~/store';
|
2023-03-18 01:40:49 -04:00
|
|
|
|
2023-08-06 21:30:16 -04:00
|
|
|
type SearchBarProps = {
|
2024-08-16 10:30:14 +02:00
|
|
|
isSmallScreen?: boolean;
|
2023-08-06 21:30:16 -04:00
|
|
|
};
|
|
|
|
|
|
2025-04-27 15:13:19 -04:00
|
|
|
const SearchBar = forwardRef((props: SearchBarProps, ref: React.Ref<HTMLDivElement>) => {
|
2025-01-12 12:57:10 -05:00
|
|
|
const localize = useLocalize();
|
|
|
|
|
const location = useLocation();
|
2024-05-14 11:00:01 -04:00
|
|
|
const queryClient = useQueryClient();
|
2025-04-17 03:07:43 +02:00
|
|
|
const navigate = useNavigate();
|
2025-04-15 10:04:00 +02:00
|
|
|
const { isSmallScreen } = props;
|
2025-01-12 12:57:10 -05:00
|
|
|
|
|
|
|
|
const [text, setText] = useState('');
|
2025-04-27 15:13:19 -04:00
|
|
|
const inputRef = useRef<HTMLInputElement>(null);
|
2025-01-12 12:57:10 -05:00
|
|
|
const [showClearIcon, setShowClearIcon] = useState(false);
|
|
|
|
|
|
2025-09-19 07:52:16 -04:00
|
|
|
const { newConversation: newConvo } = useNewConvo();
|
2025-04-27 15:13:19 -04:00
|
|
|
const [search, setSearchState] = useRecoilState(store.search);
|
2025-01-12 12:57:10 -05:00
|
|
|
|
2025-09-19 07:52:16 -04:00
|
|
|
const clearSearch = useCallback(
|
|
|
|
|
(pathname?: string) => {
|
|
|
|
|
if (pathname?.includes('/search') || pathname === '/c/new') {
|
|
|
|
|
queryClient.removeQueries([QueryKeys.messages]);
|
|
|
|
|
newConvo({ disableFocus: true });
|
|
|
|
|
navigate('/c/new');
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
[newConvo, navigate, queryClient],
|
|
|
|
|
);
|
2023-03-29 00:08:02 +08:00
|
|
|
|
2025-09-19 07:52:16 -04:00
|
|
|
const clearText = useCallback(
|
|
|
|
|
(pathname?: string) => {
|
|
|
|
|
setShowClearIcon(false);
|
|
|
|
|
setText('');
|
|
|
|
|
setSearchState((prev) => ({
|
|
|
|
|
...prev,
|
|
|
|
|
query: '',
|
|
|
|
|
debouncedQuery: '',
|
|
|
|
|
isTyping: false,
|
|
|
|
|
}));
|
|
|
|
|
clearSearch(pathname);
|
|
|
|
|
inputRef.current?.focus();
|
|
|
|
|
},
|
|
|
|
|
[setSearchState, clearSearch],
|
|
|
|
|
);
|
2023-10-11 17:05:47 -04:00
|
|
|
|
2025-09-19 07:52:16 -04:00
|
|
|
const handleKeyUp = useCallback(
|
|
|
|
|
(e: React.KeyboardEvent<HTMLInputElement>) => {
|
|
|
|
|
const { value } = e.target as HTMLInputElement;
|
|
|
|
|
if (e.key === 'Backspace' && value === '') {
|
|
|
|
|
clearText(location.pathname);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
[clearText, location.pathname],
|
|
|
|
|
);
|
2023-03-18 01:40:49 -04:00
|
|
|
|
2024-05-14 11:00:01 -04:00
|
|
|
const sendRequest = useCallback(
|
|
|
|
|
(value: string) => {
|
|
|
|
|
if (!value) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
queryClient.invalidateQueries([QueryKeys.messages]);
|
|
|
|
|
},
|
2025-04-17 03:07:43 +02:00
|
|
|
[queryClient],
|
2024-05-14 11:00:01 -04:00
|
|
|
);
|
2024-09-22 04:45:50 +02:00
|
|
|
|
2025-04-17 03:07:43 +02:00
|
|
|
const debouncedSetDebouncedQuery = useMemo(
|
2025-04-15 10:04:00 +02:00
|
|
|
() =>
|
|
|
|
|
debounce((value: string) => {
|
2025-04-17 03:07:43 +02:00
|
|
|
setSearchState((prev) => ({ ...prev, debouncedQuery: value, isTyping: false }));
|
2025-04-15 10:04:00 +02:00
|
|
|
sendRequest(value);
|
2025-04-17 03:07:43 +02:00
|
|
|
}, 500),
|
|
|
|
|
[setSearchState, sendRequest],
|
2025-04-15 10:04:00 +02:00
|
|
|
);
|
2023-10-11 17:05:47 -04:00
|
|
|
|
2025-04-15 10:04:00 +02:00
|
|
|
const onChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
|
|
|
|
const value = e.target.value;
|
2023-06-02 09:41:34 +05:30
|
|
|
setShowClearIcon(value.length > 0);
|
2023-10-11 17:05:47 -04:00
|
|
|
setText(value);
|
2025-04-17 03:07:43 +02:00
|
|
|
setSearchState((prev) => ({
|
|
|
|
|
...prev,
|
|
|
|
|
query: value,
|
|
|
|
|
isTyping: true,
|
|
|
|
|
}));
|
|
|
|
|
debouncedSetDebouncedQuery(value);
|
|
|
|
|
if (value.length > 0 && location.pathname !== '/search') {
|
|
|
|
|
navigate('/search', { replace: true });
|
|
|
|
|
}
|
2023-05-18 15:22:48 -04:00
|
|
|
};
|
|
|
|
|
|
2025-04-17 03:07:43 +02:00
|
|
|
// Automatically set isTyping to false when loading is done and debouncedQuery matches query
|
|
|
|
|
// (prevents stuck loading state if input is still focused)
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
if (search.isTyping && !search.isSearching && search.debouncedQuery === search.query) {
|
|
|
|
|
setSearchState((prev) => ({ ...prev, isTyping: false }));
|
|
|
|
|
}
|
|
|
|
|
}, [search.isTyping, search.isSearching, search.debouncedQuery, search.query, setSearchState]);
|
|
|
|
|
|
2023-03-18 01:40:49 -04:00
|
|
|
return (
|
2023-05-19 16:02:41 -04:00
|
|
|
<div
|
|
|
|
|
ref={ref}
|
2024-08-16 10:30:14 +02:00
|
|
|
className={cn(
|
2024-08-16 13:50:47 -04:00
|
|
|
'group relative mt-1 flex h-10 cursor-pointer items-center gap-3 rounded-lg border-border-medium px-3 py-2 text-text-primary transition-colors duration-200 focus-within:bg-surface-hover hover:bg-surface-hover',
|
2025-06-02 13:50:44 +02:00
|
|
|
isSmallScreen === true ? 'mb-2 h-14 rounded-xl' : '',
|
2024-08-16 10:30:14 +02:00
|
|
|
)}
|
2023-05-19 16:02:41 -04:00
|
|
|
>
|
2025-04-15 10:04:00 +02:00
|
|
|
<Search className="absolute left-3 h-4 w-4 text-text-secondary group-focus-within:text-text-primary group-hover:text-text-primary" />
|
2023-03-18 01:40:49 -04:00
|
|
|
<input
|
|
|
|
|
type="text"
|
2025-04-27 15:13:19 -04:00
|
|
|
ref={inputRef}
|
2024-12-18 11:10:34 -05:00
|
|
|
className="m-0 mr-0 w-full border-none bg-transparent p-0 pl-7 text-sm leading-tight placeholder-text-secondary placeholder-opacity-100 focus-visible:outline-none group-focus-within:placeholder-text-primary group-hover:placeholder-text-primary"
|
2023-10-11 17:05:47 -04:00
|
|
|
value={text}
|
2023-05-18 15:22:48 -04:00
|
|
|
onChange={onChange}
|
|
|
|
|
onKeyDown={(e) => {
|
|
|
|
|
e.code === 'Space' ? e.stopPropagation() : null;
|
|
|
|
|
}}
|
🤲 feat(a11y): Initial a11y improvements, added linters, tests; fix: close sidebars in mobile view (#3536)
* chore: playwright setup update
* refactor: update ChatRoute component with accessible loading spinner with live region
* chore(Message): typing
* ci: first pass, a11y testing
* refactor: update lang attribute in index.html to "en-US"
* ci: jsx-a11y dev eslint plugin
* ci: jsx plugin
* fix: Exclude 'vite.config.ts' from TypeScript compilation for testing
* fix(a11y): Remove tabIndex from non-interactive element in MessagesView component
* fix(a11y):
- Visible, non-interactive elements with click handlers must have at least one keyboard listener.eslintjsx-a11y/click-events-have-key-events
- Avoid non-native interactive elements. If using native HTML is not possible, add an appropriate role and support for tabbing, mouse, keyboard, and touch inputs to an interactive content element.eslintjsx-a11y/no-static-element-interactions
chore: remove unused bookmarks panel
- fix some "Unexpected nullable boolean value in conditional" warnings
* fix(NewChat): a11y, nested button issue, add aria-label, remove implicit role
* fix(a11y):
- partially address #3515 with `main` landmark
other:
- eslint@typescript-eslint/strict-boolean-expressions
* chore(MenuButton): Use button element instead of div for accessibility
* chore: Update TitleButton to use button element for accessibility
* chore: Update TitleButton to use button element for accessibility
* refactor(ChatMenuItem): Improve focus accessibility and code readability
* chore(MenuButton): Update aria-label to dynamically include primaryText
* fix(a11y): SearchBar
- If a form control does not have a properly associated text label, the function or purpose of that form control may not be presented to screen reader users. Visible form labels also provide visible descriptions and larger clickable targets for form controls which placeholders do not.
* chore: remove duplicate SearchBar twcss
* fix(a11y):
- The edit and copy buttons that are visually hidden are exposed to Assistive technology and are announced to screen reader users.
* fix(a11y): visible focus outline
* fix(a11y): The button to select the LLM Model has the aria-haspopup and aria- expanded attributes which makes its role ambuguous and unclear. It functions like a combobox but doesn't fully support that interaction and also fucntions like a dialog but doesn't completely support that interaction either.
* fix(a11y): fix visible focus outline
* fix(a11y): Scroll to bottom button missing accessible name #3474
* fix(a11y): The page lacks any heading structure. There should be at least one H1 and other headings to help users understand the orgainzation of the page and the contents.
Note: h1 won't be correct here so made it h2
* fix(a11y): LLM controls aria-labels
* fix(a11y): There is no visible focus outline to the 'send message' button
* fix(a11y): fix visible focus outline for Fork button
* refactor(MessageRender): add focus ring to message cards, consolidate complex conditions, add logger for setting latest message, add tabindex for card
* fix: focus border color and fix set latest message card condition
* fix(a11y): Adequate contrast for MessageAudio buttton
* feat: Add GitHub Actions workflow for accessibility linting
* chore: Update GitHub Actions workflow for accessibility linting to include client/src/** path
* fix(Nav): navmask and accessibility
* fix: Update Nav component to handle potential undefined type in SearchContext
* fix(a11y): add focus visibility to attach files button #3475
* fix(a11y): discernible text for NewChat button
* fix(a11y): accessible landmark names, all page content in landmarks, ensures landmarks are unique #3514 #3515
* fix(Prompts): update isChatRoute prop to be required in List component
* fix(a11y): buttons must have discernible text
2024-08-04 20:39:52 -04:00
|
|
|
aria-label={localize('com_nav_search_placeholder')}
|
2023-08-06 21:30:16 -04:00
|
|
|
placeholder={localize('com_nav_search_placeholder')}
|
2023-03-18 01:40:49 -04:00
|
|
|
onKeyUp={handleKeyUp}
|
2025-04-17 03:07:43 +02:00
|
|
|
onFocus={() => setSearchState((prev) => ({ ...prev, isSearching: true }))}
|
|
|
|
|
onBlur={() => setSearchState((prev) => ({ ...prev, isSearching: false }))}
|
🤖 feat: OpenAI Assistants v2 (initial support) (#2781)
* 🤖 Assistants V2 Support: Part 1
- Separated Azure Assistants to its own endpoint
- File Search / Vector Store integration is incomplete, but can toggle and use storage from playground
- Code Interpreter resource files can be added but not deleted
- GPT-4o is supported
- Many improvements to the Assistants Endpoint overall
data-provider v2 changes
copy existing route as v1
chore: rename new endpoint to reduce comparison operations and add new azure filesource
api: add azureAssistants part 1
force use of version for assistants/assistantsAzure
chore: switch name back to azureAssistants
refactor type version: string | number
Ensure assistants endpoints have version set
fix: isArchived type issue in ConversationListParams
refactor: update assistants mutations/queries with endpoint/version definitions, update Assistants Map structure
chore: FilePreview component ExtendedFile type assertion
feat: isAssistantsEndpoint helper
chore: remove unused useGenerations
chore(buildTree): type issue
chore(Advanced): type issue (unused component, maybe in future)
first pass for multi-assistant endpoint rewrite
fix(listAssistants): pass params correctly
feat: list separate assistants by endpoint
fix(useTextarea): access assistantMap correctly
fix: assistant endpoint switching, resetting ID
fix: broken during rewrite, selecting assistant mention
fix: set/invalidate assistants endpoint query data correctly
feat: Fix issue with assistant ID not being reset correctly
getOpenAIClient helper function
feat: add toast for assistant deletion
fix: assistants delete right after create issue for azure
fix: assistant patching
refactor: actions to use getOpenAIClient
refactor: consolidate logic into helpers file
fix: issue where conversation data was not initially available
v1 chat support
refactor(spendTokens): only early return if completionTokens isNaN
fix(OpenAIClient): ensure spendTokens has all necessary params
refactor: route/controller logic
fix(assistants/initializeClient): use defaultHeaders field
fix: sanitize default operation id
chore: bump openai package
first pass v2 action service
feat: retroactive domain parsing for actions added via v1
feat: delete db records of actions/assistants on openai assistant deletion
chore: remove vision tools from v2 assistants
feat: v2 upload and delete assistant vision images
WIP first pass, thread attachments
fix: show assistant vision files (save local/firebase copy)
v2 image continue
fix: annotations
fix: refine annotations
show analyze as error if is no longer submitting before progress reaches 1 and show file_search as retrieval tool
fix: abort run, undefined endpoint issue
refactor: consolidate capabilities logic and anticipate versioning
frontend version 2 changes
fix: query selection and filter
add endpoint to unknown filepath
add file ids to resource, deleting in progress
enable/disable file search
remove version log
* 🤖 Assistants V2 Support: Part 2
🎹 fix: Autocompletion Chrome Bug on Action API Key Input
chore: remove `useOriginNavigate`
chore: set correct OpenAI Storage Source
fix: azure file deletions, instantiate clients by source for deletion
update code interpret files info
feat: deleteResourceFileId
chore: increase poll interval as azure easily rate limits
fix: openai file deletions, TODO: evaluate rejected deletion settled promises to determine which to delete from db records
file source icons
update table file filters
chore: file search info and versioning
fix: retrieval update with necessary tool_resources if specified
fix(useMentions): add optional chaining in case listMap value is undefined
fix: force assistant avatar roundedness
fix: azure assistants, check correct flag
chore: bump data-provider
* fix: merge conflict
* ci: fix backend tests due to new updates
* chore: update .env.example
* meilisearch improvements
* localization updates
* chore: update comparisons
* feat: add additional metadata: endpoint, author ID
* chore: azureAssistants ENDPOINTS exclusion warning
2024-05-19 12:56:55 -04:00
|
|
|
autoComplete="off"
|
2024-06-27 18:56:12 +04:00
|
|
|
dir="auto"
|
2023-03-18 01:40:49 -04:00
|
|
|
/>
|
2025-04-27 15:13:19 -04:00
|
|
|
<button
|
|
|
|
|
type="button"
|
|
|
|
|
aria-label={`${localize('com_ui_clear')} ${localize('com_ui_search')}`}
|
♾️ style: Infinite Scroll Nav and Sort Convos by Date/Usage (#1708)
* Style: Infinite Scroll and Group convos by date
* Style: Infinite Scroll and Group convos by date- Redesign NavBar
* Style: Infinite Scroll and Group convos by date- Redesign NavBar - Clean code
* Style: Infinite Scroll and Group convos by date- Redesign NavBar - Redesign NewChat Component
* Style: Infinite Scroll and Group convos by date- Redesign NavBar - Redesign NewChat Component
* Style: Infinite Scroll and Group convos by date- Redesign NavBar - Redesign NewChat Component
* Including OpenRouter and Mistral icon
* refactor(Conversations): cleanup use of utility functions and typing
* refactor(Nav/NewChat): use localStorage `lastConversationSetup` to determine the endpoint to use, as well as icons -> JSX components, remove use of `endpointSelected`
* refactor: remove use of `isFirstToday`
* refactor(Nav): remove use of `endpointSelected`, consolidate scrolling logic to its own hook `useNavScrolling`, remove use of recoil `conversation`
* refactor: Add spinner to bottom of list, throttle fetching, move query hooks to client workspace
* chore: sort by `updatedAt` field
* refactor: optimize conversation infinite query, use optimistic updates, add conversation helpers for managing pagination, remove unnecessary operations
* feat: gen_title route for generating the title for the conversation
* style(Convo): change hover bg-color
* refactor: memoize groupedConversations and return as array of tuples, correctly update convos pre/post message stream, only call genTitle if conversation is new, make `addConversation` dynamically either add/update depending if convo exists in pages already, reorganize type definitions
* style: rename Header NewChat Button -> HeaderNewChat, add NewChatIcon, closely match main Nav New Chat button to ChatGPT
* style(NewChat): add hover bg color
* style: cleanup comments, match ChatGPT nav styling, redesign search bar, make part of new chat sticky header, move Nav under same parent as outlet/mobilenav, remove legacy code, search only if searchQuery is not empty
* feat: add tests for conversation helpers and ensure no duplicate conversations are ever grouped
* style: hover bg-color
* feat: alt-click on convo item to open conversation in new tab
* chore: send error message when `gen_title` fails
---------
Co-authored-by: Walber Cardoso <walbercardoso@gmail.com>
2024-02-03 20:25:35 -05:00
|
|
|
className={cn(
|
2025-04-27 15:13:19 -04:00
|
|
|
'absolute right-[7px] flex h-5 w-5 items-center justify-center rounded-full border-none bg-transparent p-0 transition-opacity duration-200',
|
♾️ style: Infinite Scroll Nav and Sort Convos by Date/Usage (#1708)
* Style: Infinite Scroll and Group convos by date
* Style: Infinite Scroll and Group convos by date- Redesign NavBar
* Style: Infinite Scroll and Group convos by date- Redesign NavBar - Clean code
* Style: Infinite Scroll and Group convos by date- Redesign NavBar - Redesign NewChat Component
* Style: Infinite Scroll and Group convos by date- Redesign NavBar - Redesign NewChat Component
* Style: Infinite Scroll and Group convos by date- Redesign NavBar - Redesign NewChat Component
* Including OpenRouter and Mistral icon
* refactor(Conversations): cleanup use of utility functions and typing
* refactor(Nav/NewChat): use localStorage `lastConversationSetup` to determine the endpoint to use, as well as icons -> JSX components, remove use of `endpointSelected`
* refactor: remove use of `isFirstToday`
* refactor(Nav): remove use of `endpointSelected`, consolidate scrolling logic to its own hook `useNavScrolling`, remove use of recoil `conversation`
* refactor: Add spinner to bottom of list, throttle fetching, move query hooks to client workspace
* chore: sort by `updatedAt` field
* refactor: optimize conversation infinite query, use optimistic updates, add conversation helpers for managing pagination, remove unnecessary operations
* feat: gen_title route for generating the title for the conversation
* style(Convo): change hover bg-color
* refactor: memoize groupedConversations and return as array of tuples, correctly update convos pre/post message stream, only call genTitle if conversation is new, make `addConversation` dynamically either add/update depending if convo exists in pages already, reorganize type definitions
* style: rename Header NewChat Button -> HeaderNewChat, add NewChatIcon, closely match main Nav New Chat button to ChatGPT
* style(NewChat): add hover bg color
* style: cleanup comments, match ChatGPT nav styling, redesign search bar, make part of new chat sticky header, move Nav under same parent as outlet/mobilenav, remove legacy code, search only if searchQuery is not empty
* feat: add tests for conversation helpers and ensure no duplicate conversations are ever grouped
* style: hover bg-color
* feat: alt-click on convo item to open conversation in new tab
* chore: send error message when `gen_title` fails
---------
Co-authored-by: Walber Cardoso <walbercardoso@gmail.com>
2024-02-03 20:25:35 -05:00
|
|
|
showClearIcon ? 'opacity-100' : 'opacity-0',
|
2024-08-16 10:30:14 +02:00
|
|
|
isSmallScreen === true ? 'right-[16px]' : '',
|
♾️ style: Infinite Scroll Nav and Sort Convos by Date/Usage (#1708)
* Style: Infinite Scroll and Group convos by date
* Style: Infinite Scroll and Group convos by date- Redesign NavBar
* Style: Infinite Scroll and Group convos by date- Redesign NavBar - Clean code
* Style: Infinite Scroll and Group convos by date- Redesign NavBar - Redesign NewChat Component
* Style: Infinite Scroll and Group convos by date- Redesign NavBar - Redesign NewChat Component
* Style: Infinite Scroll and Group convos by date- Redesign NavBar - Redesign NewChat Component
* Including OpenRouter and Mistral icon
* refactor(Conversations): cleanup use of utility functions and typing
* refactor(Nav/NewChat): use localStorage `lastConversationSetup` to determine the endpoint to use, as well as icons -> JSX components, remove use of `endpointSelected`
* refactor: remove use of `isFirstToday`
* refactor(Nav): remove use of `endpointSelected`, consolidate scrolling logic to its own hook `useNavScrolling`, remove use of recoil `conversation`
* refactor: Add spinner to bottom of list, throttle fetching, move query hooks to client workspace
* chore: sort by `updatedAt` field
* refactor: optimize conversation infinite query, use optimistic updates, add conversation helpers for managing pagination, remove unnecessary operations
* feat: gen_title route for generating the title for the conversation
* style(Convo): change hover bg-color
* refactor: memoize groupedConversations and return as array of tuples, correctly update convos pre/post message stream, only call genTitle if conversation is new, make `addConversation` dynamically either add/update depending if convo exists in pages already, reorganize type definitions
* style: rename Header NewChat Button -> HeaderNewChat, add NewChatIcon, closely match main Nav New Chat button to ChatGPT
* style(NewChat): add hover bg color
* style: cleanup comments, match ChatGPT nav styling, redesign search bar, make part of new chat sticky header, move Nav under same parent as outlet/mobilenav, remove legacy code, search only if searchQuery is not empty
* feat: add tests for conversation helpers and ensure no duplicate conversations are ever grouped
* style: hover bg-color
* feat: alt-click on convo item to open conversation in new tab
* chore: send error message when `gen_title` fails
---------
Co-authored-by: Walber Cardoso <walbercardoso@gmail.com>
2024-02-03 20:25:35 -05:00
|
|
|
)}
|
2025-09-19 07:52:16 -04:00
|
|
|
onClick={() => clearText(location.pathname)}
|
2025-04-27 15:13:19 -04:00
|
|
|
tabIndex={showClearIcon ? 0 : -1}
|
|
|
|
|
disabled={!showClearIcon}
|
|
|
|
|
>
|
2025-12-11 15:35:17 -06:00
|
|
|
<X className="h-5 w-5 cursor-pointer" aria-hidden="true" />
|
2025-04-27 15:13:19 -04:00
|
|
|
</button>
|
2023-03-18 01:40:49 -04:00
|
|
|
</div>
|
|
|
|
|
);
|
2023-05-19 16:02:41 -04:00
|
|
|
});
|
|
|
|
|
|
feat: ChatGPT Plugins/OpenAPI specs for Plugins Endpoint (#620)
* wip: proof of concept for openapi chain
* chore(api): update langchain dependency to version 0.0.105
* feat(Plugins): use ChatGPT Plugins/OpenAPI specs (first pass)
* chore(manifest.json): update pluginKey for "Browser" tool to "web-browser"
chore(handleTools.js): update customConstructor key for "web-browser" tool
* fix(handleSubmit.js): set unfinished property to false for all endpoints
* fix(handlers.js): remove unnecessary capitalizeWords function and use action.tool directly
refactor(endpoints.js): rename availableTools to tools and transform it into a map
* feat(endpoints): add plugins selector to endpoints file
refactor(CodeBlock.tsx): refactor to typescript
refactor(Plugin.tsx): use recoil Map for plugin name and refactor to typescript
chore(Message.jsx): linting
chore(PluginsOptions/index.jsx): remove comment/linting
chore(svg): export Clipboard and CheckMark components from SVG index and refactor to typescript
* fix(OpenAPIPlugin.js): rename readYamlFile function to readSpecFile
fix(OpenAPIPlugin.js): handle JSON files in readSpecFile function
fix(OpenAPIPlugin.js): handle JSON URLs in getSpec function
fix(OpenAPIPlugin.js): handle JSON variables in createOpenAPIPlugin function
fix(OpenAPIPlugin.js): add description for variables in createOpenAPIPlugin function
fix(OpenAPIPlugin.js): add optional flag for is_user_authenticated and has_user_authentication in ManifestDefinition
fix(loadSpecs.js): add optional flag for is_user_authenticated and has_user_authentication in ManifestDefinition
fix(Plugin.tsx): remove unnecessary callback parameter in getPluginName function
fix(getDefaultConversation.js): fix browser console error: handle null value for lastConversationSetup in getDefaultConversation function
* feat(api): add new tools
Add Ai PDF tool for super-fast, interactive chats with PDFs of any size, complete with page references for fact checking.
Add VoxScript tool for searching through YouTube transcripts, financial data sources, Google Search results, and more.
Add WebPilot tool for browsing and QA of webpages, PDFs, and data. Generate articles from one or more URLs.
feat(api): update OpenAPIPlugin.js
- Add support for bearer token authorization in the OpenAPIPlugin.
- Add support for custom headers in the OpenAPIPlugin.
fix(api): fix loadTools.js
- Pass the user parameter to the loadSpecs function.
* feat(PluginsClient.js): import findMessageContent function from utils
feat(PluginsClient.js): add message parameter to options object in initializeCustomAgent function
feat(PluginsClient.js): add content to errorMessage if message content is found
feat(PluginsClient.js): break out of loop if message content is found
feat(PluginsClient.js): add delay option with value of 8 to generateTextStream function
feat(PluginsClient.js): add support for process.env.PORT environment variable in app.listen function
feat(askyourpdf.json): add askyourpdf plugin configuration
feat(metar.json): add metar plugin configuration
feat(askyourpdf.yaml): add askyourpdf plugin OpenAPI specification
feat(OpenAPIPlugin.js): add message parameter to createOpenAPIPlugin function
feat(OpenAPIPlugin.js): add description_for_model to chain run message
feat(addOpenAPISpecs.js): remove verbose option from loadSpecs function call
fix(loadSpecs.js): add 'message' parameter to the loadSpecs function
feat(findMessageContent.js): add utility function to find message content in JSON objects
* fix(PluginStoreDialog.tsx): update z-index value for the dialog container
The z-index value for the dialog container was updated to "102" to ensure it appears above other elements on the page.
* chore(web_pilot.json): add "params" field with "user_has_request" parameter set to true
* chore(eslintrc.js): update eslint rules
fix(Login.tsx): add missing semicolon after import statement
* fix(package-lock.json): update langchain dependency to version ^0.0.105
* fix(OpenAPIPlugin.js): change header key from 'id' to 'librechat_user_id' for consistency and clarity
feat(plugins): add documentation for using official ChatGPT Plugins with OpenAPI specs
This commit adds a new file `chatgpt_plugins_openapi.md` to the `docs/features/plugins` directory. The file provides detailed information on how to use official ChatGPT Plugins with OpenAPI specifications. It explains the components of a plugin, including the Plugin Manifest file and the OpenAPI spec. It also covers the process of adding a plugin, editing manifest files, and customizing OpenAPI spec files. Additionally, the commit includes disclaimers about the limitations and compatibility of plugins with LibreChat. The documentation also clarifies that the use of ChatGPT Plugins with LibreChat does not violate OpenAI's Terms of Service.
The purpose of this commit is to provide comprehensive documentation for developers who want to integrate ChatGPT Plugins into their projects using OpenAPI specs. It aims to guide them through the process of adding and configuring plugins, as well as addressing potential issues and
chore(introduction.md): update link to ChatGPT Plugins documentation
docs(introduction.md): clarify the purpose of the plugins endpoint and its capabilities
* fix(OpenAPIPlugin.js): update SUFFIX variable to provide a clearer description
docs(chatgpt_plugins_openapi.md): update information about adding plugins via url on the frontend
* feat(PluginsClient.js): sendIntermediateMessage on successful Agent load
fix(PluginsClient.js, server/index.js, gptPlugins.js): linting fixes
docs(chatgpt_plugins_openapi.md): update links and add additional information
* Update chatgpt_plugins_openapi.md
* chore: rebuild package-lock file
* chore: format/lint all files with new rules
* chore: format all files
* chore(README.md): update AI model selection list
The AI model selection list in the README.md file has been updated to reflect the current options available. The "Anthropic" model has been added as an alternative name for the "Claude" model.
* fix(Plugin.tsx): type issue
* feat(tools): add new tool WebPilot
feat(tools): remove tool Weather Report
feat(tools): add new tool Prompt Perfect
feat(tools): add new tool Scholarly Graph Link
* feat(OpenAPIPlugin.js): add getSpec and readSpecFile functions
feat(OpenAPIPlugin.spec.js): add tests for readSpecFile, getSpec, and createOpenAPIPlugin functions
* chore(agent-demo-1.js): remove unused code and dependencies
chore(agent-demo-2.js): remove unused code and dependencies
chore(demo.js): remove unused code and dependencies
* feat(addOpenAPISpecs): add function to transform OpenAPI specs into desired format
feat(addOpenAPISpecs.spec): add tests for transformSpec function
fix(loadSpecs): remove debugging code
* feat(loadSpecs.spec.js): add unit tests for ManifestDefinition, validateJson, and loadSpecs functions
* fix: package file resolution bug
* chore: move scholarly_graph_link manifest to 'has-issues'
* refactor(client/hooks): convert to TS and export from index
* Update introduction.md
* Update chatgpt_plugins_openapi.md
2023-07-16 12:19:47 -04:00
|
|
|
export default SearchBar;
|