feat: Add citations display to playground message
Adds a collapsible section to the playground message that displays citations for the response. This is intended to help users better understand the sources used by the model.
This commit is contained in:
parent
9bd3193ad9
commit
3f61c6afc2
@ -95,5 +95,6 @@
|
|||||||
"rephrase": "Rephrase",
|
"rephrase": "Rephrase",
|
||||||
"translate": "Translate",
|
"translate": "Translate",
|
||||||
"custom": "Custom"
|
"custom": "Custom"
|
||||||
}
|
},
|
||||||
|
"citations": "Citations"
|
||||||
}
|
}
|
@ -94,5 +94,6 @@
|
|||||||
"explain": "Explicar",
|
"explain": "Explicar",
|
||||||
"rephrase": "Reformular",
|
"rephrase": "Reformular",
|
||||||
"translate": "Traducir"
|
"translate": "Traducir"
|
||||||
}
|
},
|
||||||
|
"citations": "Citas"
|
||||||
}
|
}
|
@ -88,5 +88,6 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"advanced": "تنظیمات بیشتر مدل"
|
"advanced": "تنظیمات بیشتر مدل"
|
||||||
}
|
},
|
||||||
|
"citations": "منابع"
|
||||||
}
|
}
|
@ -94,5 +94,6 @@
|
|||||||
"explain": "Expliquer",
|
"explain": "Expliquer",
|
||||||
"rephrase": "Reformuler",
|
"rephrase": "Reformuler",
|
||||||
"translate": "Traduire"
|
"translate": "Traduire"
|
||||||
}
|
},
|
||||||
|
"citations": "Citations"
|
||||||
}
|
}
|
@ -93,5 +93,6 @@
|
|||||||
"explain": "Spiegare",
|
"explain": "Spiegare",
|
||||||
"rephrase": "Riformulare",
|
"rephrase": "Riformulare",
|
||||||
"translate": "Tradurre"
|
"translate": "Tradurre"
|
||||||
}
|
},
|
||||||
|
"citations": "Citazioni"
|
||||||
}
|
}
|
@ -94,5 +94,6 @@
|
|||||||
"explain": "説明",
|
"explain": "説明",
|
||||||
"rephrase": "言い換え",
|
"rephrase": "言い換え",
|
||||||
"translate": "翻訳"
|
"translate": "翻訳"
|
||||||
}
|
},
|
||||||
|
"citations": "引用"
|
||||||
}
|
}
|
@ -93,5 +93,6 @@
|
|||||||
"explain": "വിശദീകരിക്കുക",
|
"explain": "വിശദീകരിക്കുക",
|
||||||
"rephrase": "പുനഃരൂപീകരിക്കുക",
|
"rephrase": "പുനഃരൂപീകരിക്കുക",
|
||||||
"translate": "വിവർത്തനം ചെയ്യുക"
|
"translate": "വിവർത്തനം ചെയ്യുക"
|
||||||
}
|
},
|
||||||
|
"citations": "ഉദ്ധരണികൾ"
|
||||||
}
|
}
|
@ -94,5 +94,6 @@
|
|||||||
"explain": "Explicar",
|
"explain": "Explicar",
|
||||||
"rephrase": "Reformular",
|
"rephrase": "Reformular",
|
||||||
"translate": "Traduzir"
|
"translate": "Traduzir"
|
||||||
}
|
},
|
||||||
|
"citations": "Citações"
|
||||||
}
|
}
|
@ -93,5 +93,6 @@
|
|||||||
"explain": "Объяснить",
|
"explain": "Объяснить",
|
||||||
"rephrase": "Перефразировать",
|
"rephrase": "Перефразировать",
|
||||||
"translate": "Перевести"
|
"translate": "Перевести"
|
||||||
}
|
},
|
||||||
|
"citations": "Цитаты"
|
||||||
}
|
}
|
@ -94,5 +94,6 @@
|
|||||||
"explain": "解释",
|
"explain": "解释",
|
||||||
"rephrase": "重述",
|
"rephrase": "重述",
|
||||||
"translate": "翻译"
|
"translate": "翻译"
|
||||||
}
|
},
|
||||||
|
"citations": "引用"
|
||||||
}
|
}
|
@ -1,6 +1,6 @@
|
|||||||
import Markdown from "../../Common/Markdown"
|
import Markdown from "../../Common/Markdown"
|
||||||
import React from "react"
|
import React from "react"
|
||||||
import { Tag, Image, Tooltip } from "antd"
|
import { Tag, Image, Tooltip, Collapse } from "antd"
|
||||||
import { WebSearch } from "./WebSearch"
|
import { WebSearch } from "./WebSearch"
|
||||||
import {
|
import {
|
||||||
CheckIcon,
|
CheckIcon,
|
||||||
@ -127,6 +127,18 @@ export const PlaygroundMessage = (props: Props) => {
|
|||||||
)}
|
)}
|
||||||
|
|
||||||
{props.isBot && props?.sources && props?.sources.length > 0 && (
|
{props.isBot && props?.sources && props?.sources.length > 0 && (
|
||||||
|
<Collapse
|
||||||
|
className="mt-6"
|
||||||
|
ghost
|
||||||
|
items={[
|
||||||
|
{
|
||||||
|
key: "1",
|
||||||
|
label: (
|
||||||
|
<div className="italic text-gray-500 dark:text-gray-400">
|
||||||
|
{t('citations')}
|
||||||
|
</div>
|
||||||
|
),
|
||||||
|
children: (
|
||||||
<div className="mb-3 flex flex-wrap gap-2">
|
<div className="mb-3 flex flex-wrap gap-2">
|
||||||
{props?.sources?.map((source, index) => (
|
{props?.sources?.map((source, index) => (
|
||||||
<MessageSource
|
<MessageSource
|
||||||
@ -136,6 +148,10 @@ export const PlaygroundMessage = (props: Props) => {
|
|||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
]}
|
||||||
|
/>
|
||||||
)}
|
)}
|
||||||
{!props.isProcessing && !editMode && (
|
{!props.isProcessing && !editMode && (
|
||||||
<div
|
<div
|
||||||
|
Loading…
x
Reference in New Issue
Block a user