diff --git a/src/assets/locale/ar/common.json b/src/assets/locale/ar/common.json index a4be827..c6d3985 100644 --- a/src/assets/locale/ar/common.json +++ b/src/assets/locale/ar/common.json @@ -109,7 +109,7 @@ "translate": "ترجمة", "custom": "مخصص" }, - "citations": "الاقتباسات", + "webCitations": "الاقتباسات", "segmented": { "ollama": "نماذج Ollama", "custom": "نماذج مخصصة" diff --git a/src/assets/locale/da/common.json b/src/assets/locale/da/common.json index f03f256..4aaf1b8 100644 --- a/src/assets/locale/da/common.json +++ b/src/assets/locale/da/common.json @@ -106,7 +106,7 @@ "translate": "Oversæt", "custom": "Brugerdefineret" }, - "citations": "Citater", + "webCitations": "Citater", "downloadCode": "Download Kode", "date": { "pinned": "Fastgjort", diff --git a/src/assets/locale/de/common.json b/src/assets/locale/de/common.json index ec6c25e..b36ebf5 100644 --- a/src/assets/locale/de/common.json +++ b/src/assets/locale/de/common.json @@ -106,7 +106,7 @@ "translate": "Übersetzen", "custom": "Benutzerdefiniert" }, - "citations": "Zitate", + "webCitations": "Zitate", "downloadCode": "Code herunterladen", "date": { "pinned": "Angepinnt", diff --git a/src/assets/locale/en/common.json b/src/assets/locale/en/common.json index 03fb2e6..6b69bc5 100644 --- a/src/assets/locale/en/common.json +++ b/src/assets/locale/en/common.json @@ -39,6 +39,7 @@ }, "copyToClipboard": "Copy to clipboard", "webSearch": "Searching the web", + "iodSearch": "Searching the Internet of Data", "regenerate": "Regenerate", "edit": "Edit", "delete": "Delete", @@ -136,7 +137,8 @@ "translate": "Translate", "custom": "Custom" }, - "citations": "Citations", + "webCitations": "Web Citations", + "iodCitations": "Internet of Data Citations", "segmented": { "ollama": "Ollama Models", "custom": "Custom Models" diff --git a/src/assets/locale/en/playground.json b/src/assets/locale/en/playground.json index d673f04..bb9ce16 100644 --- a/src/assets/locale/en/playground.json +++ b/src/assets/locale/en/playground.json @@ -20,6 +20,7 @@ }, "tooltip": { "searchInternet": "Search Internet", + "searchIod": "Search Internet of Data", "speechToText": "Speech to Text", "uploadImage": "Upload Image", "stopStreaming": "Stop Streaming", diff --git a/src/assets/locale/es/common.json b/src/assets/locale/es/common.json index aa5b01e..9bf4334 100644 --- a/src/assets/locale/es/common.json +++ b/src/assets/locale/es/common.json @@ -105,7 +105,7 @@ "rephrase": "Reformular", "translate": "Traducir" }, - "citations": "Citas", + "webCitations": "Citas", "downloadCode": "Descargar Código", "date": { "pinned": "Fijado", diff --git a/src/assets/locale/fa/common.json b/src/assets/locale/fa/common.json index dfe57d9..c7633fb 100644 --- a/src/assets/locale/fa/common.json +++ b/src/assets/locale/fa/common.json @@ -99,7 +99,7 @@ }, "advanced": "تنظیمات بیشتر مدل" }, - "citations": "منابع", + "webCitations": "منابع", "downloadCode": "دانلود کد", "date": { "pinned": "پین شده", diff --git a/src/assets/locale/fr/common.json b/src/assets/locale/fr/common.json index 1fa66aa..52d49d9 100644 --- a/src/assets/locale/fr/common.json +++ b/src/assets/locale/fr/common.json @@ -105,7 +105,7 @@ "rephrase": "Reformuler", "translate": "Traduire" }, - "citations": "Citations", + "webCitations": "Citations", "downloadCode": "Télécharger le code", "date": { "pinned": "Épinglé", diff --git a/src/assets/locale/it/common.json b/src/assets/locale/it/common.json index 027101d..1edc7eb 100644 --- a/src/assets/locale/it/common.json +++ b/src/assets/locale/it/common.json @@ -105,7 +105,7 @@ "rephrase": "Riformulare", "translate": "Tradurre" }, - "citations": "Citazioni", + "webCitations": "Citazioni", "downloadCode": "Scarica Codice", "date": { "pinned": "Fissato", diff --git a/src/assets/locale/ja-JP/common.json b/src/assets/locale/ja-JP/common.json index d742427..a185035 100644 --- a/src/assets/locale/ja-JP/common.json +++ b/src/assets/locale/ja-JP/common.json @@ -105,7 +105,7 @@ "rephrase": "言い換え", "translate": "翻訳" }, - "citations": "引用", + "webCitations": "引用", "downloadCode": "コードをダウンロード", "date": { "pinned": "固定", diff --git a/src/assets/locale/ko/common.json b/src/assets/locale/ko/common.json index ef6511b..5df5c9d 100644 --- a/src/assets/locale/ko/common.json +++ b/src/assets/locale/ko/common.json @@ -105,7 +105,7 @@ "rephrase": "다르게 표현", "translate": "번역" }, - "citations": "인용", + "webCitations": "인용", "downloadCode": "코드 다운로드", "date": { "pinned": "고정됨", diff --git a/src/assets/locale/ml/common.json b/src/assets/locale/ml/common.json index ddaff67..4285b55 100644 --- a/src/assets/locale/ml/common.json +++ b/src/assets/locale/ml/common.json @@ -104,7 +104,7 @@ "rephrase": "പുനഃരൂപീകരിക്കുക", "translate": "വിവർത്തനം ചെയ്യുക" }, - "citations": "ഉദ്ധരണികൾ", + "webCitations": "ഉദ്ധരണികൾ", "downloadCode": "കോഡ് ഡൗൺലോഡ് ചെയ്യുക", "date": { "pinned": "പിൻ ചെയ്തത്", diff --git a/src/assets/locale/no/common.json b/src/assets/locale/no/common.json index a762bed..ad8500f 100644 --- a/src/assets/locale/no/common.json +++ b/src/assets/locale/no/common.json @@ -106,7 +106,7 @@ "translate": "Oversett", "custom": "Egendefinert" }, - "citations": "Sitater", + "webCitations": "Sitater", "downloadCode": "Last ned kode", "date": { "pinned": "Festet", diff --git a/src/assets/locale/pt-BR/common.json b/src/assets/locale/pt-BR/common.json index 6e3b387..334723b 100644 --- a/src/assets/locale/pt-BR/common.json +++ b/src/assets/locale/pt-BR/common.json @@ -105,7 +105,7 @@ "rephrase": "Reformular", "translate": "Traduzir" }, - "citations": "Citações", + "webCitations": "Citações", "downloadCode": "Baixar Código", "date": { "pinned": "Fixado", diff --git a/src/assets/locale/ru/common.json b/src/assets/locale/ru/common.json index e661445..4e2af27 100644 --- a/src/assets/locale/ru/common.json +++ b/src/assets/locale/ru/common.json @@ -105,7 +105,7 @@ "rephrase": "Перефразировать", "translate": "Перевести" }, - "citations": "Цитаты", + "webCitations": "Цитаты", "downloadCode": "Скачать код", "date": { "pinned": "Закреплено", diff --git a/src/assets/locale/sv/common.json b/src/assets/locale/sv/common.json index 18cf17f..8e931a7 100644 --- a/src/assets/locale/sv/common.json +++ b/src/assets/locale/sv/common.json @@ -106,7 +106,7 @@ "translate": "Översätt", "custom": "Custom" }, - "citations": "Citat", + "webCitations": "Citat", "segmented": { "ollama": "Ollama-modeller", "custom": "Custom modeller" diff --git a/src/assets/locale/uk/common.json b/src/assets/locale/uk/common.json index 16b4c48..32b47c1 100644 --- a/src/assets/locale/uk/common.json +++ b/src/assets/locale/uk/common.json @@ -106,7 +106,7 @@ "translate": "Перекласти", "custom": "Власне" }, - "citations": "Цитати", + "webCitations": "Цитати", "segmented": { "ollama": "Моделі Ollama", "custom": "Власні моделі" diff --git a/src/assets/locale/zh/common.json b/src/assets/locale/zh/common.json index 6117f1a..e57d65a 100644 --- a/src/assets/locale/zh/common.json +++ b/src/assets/locale/zh/common.json @@ -38,7 +38,8 @@ } }, "copyToClipboard": "复制到剪贴板", - "webSearch": "搜索网络", + "webSearch": "搜索万维网", + "iodSearch": "搜索数联网", "regenerate": "重新生成", "edit": "编辑", "delete": "删除", @@ -105,7 +106,8 @@ "rephrase": "重述", "translate": "翻译" }, - "citations": "引用", + "webCitations": "万维网引用", + "iodCitations": "数联网引用", "downloadCode": "下载代码", "date": { "pinned": "已置顶", diff --git a/src/assets/locale/zh/playground.json b/src/assets/locale/zh/playground.json index 08c0863..8b371d1 100644 --- a/src/assets/locale/zh/playground.json +++ b/src/assets/locale/zh/playground.json @@ -19,7 +19,8 @@ } }, "tooltip": { - "searchInternet": "搜索互联网", + "searchInternet": "搜索万维网", + "searchIod": "搜索数联网", "speechToText": "语音到文本", "uploadImage": "上传图片", "stopStreaming": "停止流媒体", diff --git a/src/components/Common/Playground/Message.tsx b/src/components/Common/Playground/Message.tsx index 90fccb9..ee330cb 100644 --- a/src/components/Common/Playground/Message.tsx +++ b/src/components/Common/Playground/Message.tsx @@ -18,7 +18,7 @@ import { useTTS } from "@/hooks/useTTS" import { tagColors } from "@/utils/color" import { removeModelSuffix } from "@/db/models" import { GenerationInfo } from "./GenerationInfo" -import { parseReasoning, } from "@/libs/reasoning" +import { parseReasoning } from "@/libs/reasoning" import { humanizeMilliseconds } from "@/utils/humanize-milliseconds" type Props = { message: string @@ -36,7 +36,8 @@ type Props = { isProcessing: boolean webSearch?: {} isSearchingInternet?: boolean - sources?: any[] + webSources?: any[] + iodSources?: any[] hideEditAndRegenerate?: boolean onSourceClick?: (source: any) => void isTTSEnabled?: boolean @@ -166,7 +167,7 @@ export const PlaygroundMessage = (props: Props) => { )} - {props.isBot && props?.sources && props?.sources.length > 0 && ( + {props.isBot && props?.webSources && props?.webSources.length > 0 && ( { key: "1", label: (
- {t("citations")} + {t("webCitations")}
), children: (
- {props?.sources?.map((source, index) => ( + {props?.webSources?.map((source, index) => ( + ))} +
+ ) + } + ]} + /> + )} + {props.isBot && props?.iodSources && props?.iodSources.length > 0 && ( + + {t("iodCitations")} + + ), + children: ( +
+ {props?.iodSources?.map((source, index) => ( + ))} diff --git a/src/components/Common/Playground/MessageSource.tsx b/src/components/Common/Playground/MessageSource.tsx index b0d3ad9..95f2735 100644 --- a/src/components/Common/Playground/MessageSource.tsx +++ b/src/components/Common/Playground/MessageSource.tsx @@ -1,6 +1,9 @@ +import { useState } from "react" +import type React from "react" import { KnowledgeIcon } from "@/components/Option/Knowledge/KnowledgeIcon" type Props = { + index: number source: { name?: string url?: string @@ -8,11 +11,20 @@ type Props = { type?: string pageContent?: string content?: string + doId?: string + description?: string } onSourceClick?: (source: any) => void } -export const MessageSource: React.FC = ({ source, onSourceClick }) => { +export const MessageSource: React.FC = ({ + index, + source, + onSourceClick +}) => { + // Add state for tracking and content visibility + const [showContent, setShowContent] = useState(false) + if (source?.mode === "rag" || source?.mode === "chat") { return (