mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 17:00:15 +01:00
🔧 fix: Streamline Builder Links and Enhance UI Consistency (#5229)
* fix: Include iconURL in Bedrock client initialization * fix: unnecessary filtering for agent file_search files * chore: use theme bg colors * refactor: rely on endpoint config for enabling builder links in side navigation instead of parameters * fix: remove unnecessary keyProvided check for agent builder link
This commit is contained in:
parent
dd927583a7
commit
687ab32bd3
4 changed files with 15 additions and 21 deletions
|
|
@ -61,6 +61,7 @@ const initializeClient = async ({ req, res, endpointOption }) => {
|
||||||
eventHandlers,
|
eventHandlers,
|
||||||
collectedUsage,
|
collectedUsage,
|
||||||
spec: endpointOption.spec,
|
spec: endpointOption.spec,
|
||||||
|
iconURL: endpointOption.iconURL,
|
||||||
endpoint: EModelEndpoint.bedrock,
|
endpoint: EModelEndpoint.bedrock,
|
||||||
resendFiles: endpointOption.resendFiles,
|
resendFiles: endpointOption.resendFiles,
|
||||||
maxContextTokens:
|
maxContextTokens:
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@ import {
|
||||||
EToolResources,
|
EToolResources,
|
||||||
mergeFileConfig,
|
mergeFileConfig,
|
||||||
AgentCapabilities,
|
AgentCapabilities,
|
||||||
retrievalMimeTypes,
|
|
||||||
fileConfig as defaultFileConfig,
|
fileConfig as defaultFileConfig,
|
||||||
} from 'librechat-data-provider';
|
} from 'librechat-data-provider';
|
||||||
import type { ExtendedFile, AgentForm } from '~/common';
|
import type { ExtendedFile, AgentForm } from '~/common';
|
||||||
|
|
@ -77,6 +76,15 @@ export default function FileSearch({
|
||||||
</div>
|
</div>
|
||||||
<FileSearchCheckbox />
|
<FileSearchCheckbox />
|
||||||
<div className="flex flex-col gap-3">
|
<div className="flex flex-col gap-3">
|
||||||
|
{/* File Search (RAG API) Files */}
|
||||||
|
<FileRow
|
||||||
|
files={files}
|
||||||
|
setFiles={setFiles}
|
||||||
|
setFilesLoading={setFilesLoading}
|
||||||
|
agent_id={agent_id}
|
||||||
|
tool_resource={EToolResources.file_search}
|
||||||
|
Wrapper={({ children }) => <div className="flex flex-wrap gap-2">{children}</div>}
|
||||||
|
/>
|
||||||
<div>
|
<div>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
|
|
@ -105,18 +113,6 @@ export default function FileSearch({
|
||||||
{localize('com_agents_file_search_disabled')}
|
{localize('com_agents_file_search_disabled')}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{/* Knowledge Files */}
|
|
||||||
<FileRow
|
|
||||||
files={files}
|
|
||||||
setFiles={setFiles}
|
|
||||||
setFilesLoading={setFilesLoading}
|
|
||||||
agent_id={agent_id}
|
|
||||||
tool_resource={EToolResources.file_search}
|
|
||||||
fileFilter={(file: ExtendedFile) =>
|
|
||||||
retrievalMimeTypes.some((regex) => regex.test(file.type ?? ''))
|
|
||||||
}
|
|
||||||
Wrapper={({ children }) => <div className="flex flex-wrap gap-2">{children}</div>}
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -183,7 +183,7 @@ const SidePanel = ({
|
||||||
<ResizablePanelGroup
|
<ResizablePanelGroup
|
||||||
direction="horizontal"
|
direction="horizontal"
|
||||||
onLayout={(sizes) => throttledSaveLayout(sizes)}
|
onLayout={(sizes) => throttledSaveLayout(sizes)}
|
||||||
className="transition-width relative h-full w-full flex-1 overflow-auto bg-white dark:bg-gray-800"
|
className="transition-width relative h-full w-full flex-1 overflow-auto bg-presentation"
|
||||||
>
|
>
|
||||||
<ResizablePanel
|
<ResizablePanel
|
||||||
defaultSize={currentLayout[0]}
|
defaultSize={currentLayout[0]}
|
||||||
|
|
@ -195,7 +195,7 @@ const SidePanel = ({
|
||||||
</ResizablePanel>
|
</ResizablePanel>
|
||||||
{artifacts != null && (
|
{artifacts != null && (
|
||||||
<>
|
<>
|
||||||
<ResizableHandleAlt withHandle className="ml-3 bg-border-medium dark:text-white" />
|
<ResizableHandleAlt withHandle className="ml-3 bg-border-medium text-text-primary" />
|
||||||
<ResizablePanel
|
<ResizablePanel
|
||||||
defaultSize={currentLayout[1]}
|
defaultSize={currentLayout[1]}
|
||||||
minSize={minSizeMain}
|
minSize={minSizeMain}
|
||||||
|
|
@ -227,7 +227,7 @@ const SidePanel = ({
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
{(!isCollapsed || minSize > 0) && !isSmallScreen && !fullCollapse && (
|
{(!isCollapsed || minSize > 0) && !isSmallScreen && !fullCollapse && (
|
||||||
<ResizableHandleAlt withHandle className="bg-transparent dark:text-white" />
|
<ResizableHandleAlt withHandle className="bg-transparent text-text-primary" />
|
||||||
)}
|
)}
|
||||||
<ResizablePanel
|
<ResizablePanel
|
||||||
tagName="nav"
|
tagName="nav"
|
||||||
|
|
|
||||||
|
|
@ -59,8 +59,7 @@ export default function useSideNavLinks({
|
||||||
isAssistantsEndpoint(endpoint) &&
|
isAssistantsEndpoint(endpoint) &&
|
||||||
assistants &&
|
assistants &&
|
||||||
assistants.disableBuilder !== true &&
|
assistants.disableBuilder !== true &&
|
||||||
keyProvided &&
|
keyProvided
|
||||||
interfaceConfig.parameters === true
|
|
||||||
) {
|
) {
|
||||||
links.push({
|
links.push({
|
||||||
title: 'com_sidepanel_assistant_builder',
|
title: 'com_sidepanel_assistant_builder',
|
||||||
|
|
@ -76,9 +75,7 @@ export default function useSideNavLinks({
|
||||||
hasAccessToCreateAgents &&
|
hasAccessToCreateAgents &&
|
||||||
isAgentsEndpoint(endpoint) &&
|
isAgentsEndpoint(endpoint) &&
|
||||||
agents &&
|
agents &&
|
||||||
agents.disableBuilder !== true &&
|
agents.disableBuilder !== true
|
||||||
keyProvided &&
|
|
||||||
interfaceConfig.parameters === true
|
|
||||||
) {
|
) {
|
||||||
links.push({
|
links.push({
|
||||||
title: 'com_sidepanel_agent_builder',
|
title: 'com_sidepanel_agent_builder',
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue