Skip to content

Commit

Permalink
fix(tool): fix system tool icon (#158)
Browse files Browse the repository at this point in the history
Signed-off-by: Milan Gallas <[email protected]>
  • Loading branch information
GALLLASMILAN authored Dec 18, 2024
1 parent 5851900 commit 38a73cb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
5 changes: 1 addition & 4 deletions src/modules/assistants/tools/ToolNameWithTooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@
*/

import { ToolReference } from '@/app/api/tools/types';
import {
getStaticToolName,
useToolInfo,
} from '@/modules/tools/hooks/useToolInfo';
import { useToolInfo } from '@/modules/tools/hooks/useToolInfo';
import classes from './ToolNameWithTooltip.module.scss';
import { ToolInfoButton } from './ToolInfoButton';
import { useProjectContext } from '@/layout/providers/ProjectProvider';
Expand Down
4 changes: 2 additions & 2 deletions src/modules/auth/AcceptToUForm.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
}

:global(
.#{$prefix}--checkbox:not(:checked) ~ .#{$prefix}--checkbox-label::before
) {
.#{$prefix}--checkbox:not(:checked) ~ .#{$prefix}--checkbox-label::before
) {
border-color: currentColor;
}
}
Expand Down
5 changes: 3 additions & 2 deletions src/modules/tools/hooks/useToolInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import { encodeEntityWithMetadata } from '@/app/api/utils';
import { Organization } from '@/app/api/organization/types';
import { Project } from '@/app/api/projects/types';
import { useTools } from './useTools';
import capitalize from 'lodash/capitalize';

export function useToolInfo({
toolReference,
Expand Down Expand Up @@ -87,7 +88,7 @@ export function useToolInfo({
if (tool?.name === 'DuckDuckGo') return DuckDuckGo;
return SkeletonIcon;
}
return SYSTEM_TOOL_ICONS[id];
return SYSTEM_TOOL_ICONS[id] ?? Tools;
}
if (type === 'file_search') return SearchLocate;
if (type === 'code_interpreter' || type === 'function') return Code;
Expand Down Expand Up @@ -123,7 +124,7 @@ export function getStaticToolName({ type, id, tool }: ToolReference) {

switch (type) {
case 'system':
return SYSTEM_TOOL_NAME[id];
return SYSTEM_TOOL_NAME[id] ?? id.split('_').map(capitalize).join(' ');
case 'code_interpreter':
return 'Python Intepreter';
case 'function':
Expand Down

0 comments on commit 38a73cb

Please sign in to comment.