mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-04-18 05:39:05 +02:00
chore: typing, rename Context to Delete Button
This commit is contained in:
parent
70397c0490
commit
925aaadb9b
2 changed files with 16 additions and 16 deletions
|
|
@ -11,8 +11,8 @@ import Action from '~/components/SidePanel/Builder/Action';
|
||||||
import { useLocalize } from '~/hooks';
|
import { useLocalize } from '~/hooks';
|
||||||
import { ToolSelectDialog } from '~/components/Tools';
|
import { ToolSelectDialog } from '~/components/Tools';
|
||||||
import { useToastContext } from '~/Providers';
|
import { useToastContext } from '~/Providers';
|
||||||
import ContextButton from './ContextButton';
|
|
||||||
import { Spinner } from '~/components/svg';
|
import { Spinner } from '~/components/svg';
|
||||||
|
import DeleteButton from './DeleteButton';
|
||||||
import AgentAvatar from './AgentAvatar';
|
import AgentAvatar from './AgentAvatar';
|
||||||
import AgentTool from './AgentTool';
|
import AgentTool from './AgentTool';
|
||||||
import { Panel } from '~/common';
|
import { Panel } from '~/common';
|
||||||
|
|
@ -57,14 +57,14 @@ export default function AgentConfig({
|
||||||
() => agentsConfig?.capabilities?.includes(Capabilities.actions),
|
() => agentsConfig?.capabilities?.includes(Capabilities.actions),
|
||||||
[agentsConfig],
|
[agentsConfig],
|
||||||
);
|
);
|
||||||
const retrievalEnabled = useMemo(
|
// const retrievalEnabled = useMemo(
|
||||||
() => agentsConfig?.capabilities?.includes(Capabilities.retrieval),
|
// () => agentsConfig?.capabilities?.includes(Capabilities.retrieval),
|
||||||
[agentsConfig],
|
// [agentsConfig],
|
||||||
);
|
// );
|
||||||
const codeEnabled = useMemo(
|
// const codeEnabled = useMemo(
|
||||||
() => agentsConfig?.capabilities?.includes(Capabilities.code_interpreter),
|
// () => agentsConfig?.capabilities?.includes(Capabilities.code_interpreter),
|
||||||
[agentsConfig],
|
// [agentsConfig],
|
||||||
);
|
// );
|
||||||
|
|
||||||
/* Mutations */
|
/* Mutations */
|
||||||
const update = useUpdateAgentMutation({
|
const update = useUpdateAgentMutation({
|
||||||
|
|
@ -275,16 +275,16 @@ export default function AgentConfig({
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<span>{model ? model : localize('com_ui_select_model')}</span>
|
<span>{model != null ? model : localize('com_ui_select_model')}</span>
|
||||||
</div>
|
</div>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
{/* Agent Tools & Actions */}
|
{/* Agent Tools & Actions */}
|
||||||
<div className="mb-6">
|
<div className="mb-6">
|
||||||
<label className={labelClass}>
|
<label className={labelClass}>
|
||||||
{`${toolsEnabled ? localize('com_assistants_tools') : ''}
|
{`${toolsEnabled === true ? localize('com_assistants_tools') : ''}
|
||||||
${toolsEnabled && actionsEnabled ? ' + ' : ''}
|
${toolsEnabled === true && actionsEnabled === true ? ' + ' : ''}
|
||||||
${actionsEnabled ? localize('com_assistants_actions') : ''}`}
|
${actionsEnabled === true ? localize('com_assistants_actions') : ''}`}
|
||||||
</label>
|
</label>
|
||||||
<div className="space-y-2">
|
<div className="space-y-2">
|
||||||
{tools?.map((func, i) => (
|
{tools?.map((func, i) => (
|
||||||
|
|
@ -338,7 +338,7 @@ export default function AgentConfig({
|
||||||
</div>
|
</div>
|
||||||
{/* Context Button */}
|
{/* Context Button */}
|
||||||
<div className="flex items-center justify-end gap-2">
|
<div className="flex items-center justify-end gap-2">
|
||||||
<ContextButton
|
<DeleteButton
|
||||||
agent_id={agent_id}
|
agent_id={agent_id}
|
||||||
setCurrentAgentId={setCurrentAgentId}
|
setCurrentAgentId={setCurrentAgentId}
|
||||||
createMutation={create}
|
createMutation={create}
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ import { useDeleteAgentMutation } from '~/data-provider';
|
||||||
import { cn, removeFocusOutlines } from '~/utils/';
|
import { cn, removeFocusOutlines } from '~/utils/';
|
||||||
import { TrashIcon } from '~/components/svg';
|
import { TrashIcon } from '~/components/svg';
|
||||||
|
|
||||||
export default function ContextButton({
|
export default function DeleteButton({
|
||||||
agent_id,
|
agent_id,
|
||||||
setCurrentAgentId,
|
setCurrentAgentId,
|
||||||
createMutation,
|
createMutation,
|
||||||
|
|
@ -49,7 +49,7 @@ export default function ContextButton({
|
||||||
return setOption('agent_id')(firstAgent.id);
|
return setOption('agent_id')(firstAgent.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
const currentAgent = updatedList?.find((agent) => agent.id === conversation?.agent_id);
|
const currentAgent = updatedList.find((agent) => agent.id === conversation?.agent_id);
|
||||||
|
|
||||||
if (currentAgent) {
|
if (currentAgent) {
|
||||||
setCurrentAgentId(currentAgent.id);
|
setCurrentAgentId(currentAgent.id);
|
||||||
Loading…
Add table
Add a link
Reference in a new issue