Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

frontend: Change message for Agent with no tools #877

Merged
merged 1 commit into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/backend/config/default_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def get_default_agent() -> AgentPublic:
return AgentPublic(
id=DEFAULT_AGENT_ID,
name='Command R+',
description='Ask questions and get answers based on your files.',
description='Ask questions and get answers based on your tools and files.',
created_at=datetime.datetime.now(),
updated_at=datetime.datetime.now(),
preamble="",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import React from 'react';

import { AssistantTools } from '@/components/MessagingContainer';
import { CoralLogo, Icon, Text } from '@/components/UI';
import { useAvailableTools } from '@/hooks';
import { useAgent, useBrandedColors, useListTools } from '@/hooks';
import { checkIsDefaultAgent } from '@/utils';
import { cn } from '@/utils';
Expand All @@ -24,8 +25,15 @@ export const Welcome: React.FC<Props> = ({ show, agentId }) => {

const isDefaultAgent = checkIsDefaultAgent(agent);

// // Filter out tools that are excluded for the base agent
let toolsFiltered = [...tools];
const { availableTools } = useAvailableTools({
agent,
allTools: tools,
});

let toolToggleMessage = 'Toggle Tools On/Off';
if (availableTools.length === 0) {
toolToggleMessage = 'Your Agent has no Tools enabled. Update your Agent to add Tools.';
}

return (
<Transition
Expand Down Expand Up @@ -65,16 +73,15 @@ export const Welcome: React.FC<Props> = ({ show, agentId }) => {
)}
</div>
<Text className="text-mushroom-300 dark:text-marble-800">
{agent?.description || 'Ask questions and get answers based on your files.'}
{agent?.description || 'Ask questions and get answers based on your tools and files.'}
</Text>

{tools.length > 0 && (
<div className="flex items-center gap-x-1">
<Icon name="circles-four" kind="outline" />
<Text className="font-medium">Toggle Tools On/Off</Text>
</div>
)}
<AssistantTools agent={agent} tools={toolsFiltered} />
<div className="flex items-center gap-x-1">
<Icon name="circles-four" kind="outline" />
<Text className="font-medium">{toolToggleMessage}</Text>
</div>

<AssistantTools agent={agent} tools={tools} />
</div>
</Transition>
);
Expand Down
Loading