Skip to content
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
7 changes: 1 addition & 6 deletions web/src/components/llm-select/llm-label.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,7 @@ const LLMLabel = ({ value }: IProps) => {

return (
<div className="flex items-center gap-1 text-xs text-text-secondary">
<LlmIcon
name={getLLMIconName(fId, llmName)}
width={20}
height={20}
size={'small'}
/>
<LlmIcon name={getLLMIconName(fId, llmName)} width={20} height={20} />
<span className="flex-1 truncate"> {llmName}</span>
</div>
);
Expand Down
14 changes: 12 additions & 2 deletions web/src/pages/agent/canvas/node/card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ import {
SelectTrigger,
SelectValue,
} from '@/components/ui/select';
import { useSelectFlatLlmList } from '@/hooks/use-llm-request';
import { cn } from '@/lib/utils';
import { PropsWithChildren } from 'react';
import { PropsWithChildren, useMemo } from 'react';

export function CardWithForm() {
return (
Expand Down Expand Up @@ -79,8 +80,17 @@ export function LabelCard({ children, className, ...props }: LabelCardProps) {
}

export function LLMLabelCard({ llmId }: { llmId?: string }) {
const flatLlmList = useSelectFlatLlmList();

const isValidLlm = useMemo(() => {
if (!llmId) return false;
return flatLlmList.some((llm) => llm.uuid === llmId);
}, [flatLlmList, llmId]);

return (
<LabelCard>
<LabelCard
className={isValidLlm ? '' : 'bg-state-error-5 border-state-error border'}
>
<LLMLabel value={llmId}></LLMLabel>
</LabelCard>
);
Expand Down
2 changes: 1 addition & 1 deletion web/src/utils/api.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
let api_host = `/v1`;
const api_host = `/v1`;
const ExternalApi = `/api`;

export { ExternalApi, api_host };
Expand Down
Loading