Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

Feat: If a model configured in the agent is deleted from the user center, a notification will be displayed on the canvas with a red border. (#13872)

balibabu00b62dd58771
diff --git a/web/src/components/llm-select/llm-label.tsx b/web/src/components/llm-select/llm-label.tsx
index 7a42c308c1..97c59b7c35 100644
--- a/web/src/components/llm-select/llm-label.tsx
+++ b/web/src/components/llm-select/llm-label.tsx
@@ -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>
);
diff --git a/web/src/pages/agent/canvas/node/card.tsx b/web/src/pages/agent/canvas/node/card.tsx
index 642504714a..82e324d1a0 100644
--- a/web/src/pages/agent/canvas/node/card.tsx
+++ b/web/src/pages/agent/canvas/node/card.tsx
@@ -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 (
@@ -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>
);
diff --git a/web/src/utils/api.ts b/web/src/utils/api.ts
index 5df45ad47b..fa691befc6 100644
--- a/web/src/utils/api.ts
+++ b/web/src/utils/api.ts
@@ -1,4 +1,4 @@
-let api_host = `/v1`;
+const api_host = `/v1`;
const ExternalApi = `/api`;
export { ExternalApi, api_host };