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",
|
||||
"translate": "Translate",
|
||||
"custom": "Custom"
|
||||
}
|
||||
},
|
||||
"citations": "Citations"
|
||||
}
|
@ -94,5 +94,6 @@
|
||||
"explain": "Explicar",
|
||||
"rephrase": "Reformular",
|
||||
"translate": "Traducir"
|
||||
}
|
||||
},
|
||||
"citations": "Citas"
|
||||
}
|
@ -88,5 +88,6 @@
|
||||
}
|
||||
},
|
||||
"advanced": "تنظیمات بیشتر مدل"
|
||||
}
|
||||
},
|
||||
"citations": "منابع"
|
||||
}
|
@ -94,5 +94,6 @@
|
||||
"explain": "Expliquer",
|
||||
"rephrase": "Reformuler",
|
||||
"translate": "Traduire"
|
||||
}
|
||||
},
|
||||
"citations": "Citations"
|
||||
}
|
@ -93,5 +93,6 @@
|
||||
"explain": "Spiegare",
|
||||
"rephrase": "Riformulare",
|
||||
"translate": "Tradurre"
|
||||
}
|
||||
},
|
||||
"citations": "Citazioni"
|
||||
}
|
@ -94,5 +94,6 @@
|
||||
"explain": "説明",
|
||||
"rephrase": "言い換え",
|
||||
"translate": "翻訳"
|
||||
}
|
||||
},
|
||||
"citations": "引用"
|
||||
}
|
@ -93,5 +93,6 @@
|
||||
"explain": "വിശദീകരിക്കുക",
|
||||
"rephrase": "പുനഃരൂപീകരിക്കുക",
|
||||
"translate": "വിവർത്തനം ചെയ്യുക"
|
||||
}
|
||||
},
|
||||
"citations": "ഉദ്ധരണികൾ"
|
||||
}
|
@ -94,5 +94,6 @@
|
||||
"explain": "Explicar",
|
||||
"rephrase": "Reformular",
|
||||
"translate": "Traduzir"
|
||||
}
|
||||
},
|
||||
"citations": "Citações"
|
||||
}
|
@ -93,5 +93,6 @@
|
||||
"explain": "Объяснить",
|
||||
"rephrase": "Перефразировать",
|
||||
"translate": "Перевести"
|
||||
}
|
||||
},
|
||||
"citations": "Цитаты"
|
||||
}
|
@ -94,5 +94,6 @@
|
||||
"explain": "解释",
|
||||
"rephrase": "重述",
|
||||
"translate": "翻译"
|
||||
}
|
||||
},
|
||||
"citations": "引用"
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
import Markdown from "../../Common/Markdown"
|
||||
import React from "react"
|
||||
import { Tag, Image, Tooltip } from "antd"
|
||||
import { Tag, Image, Tooltip, Collapse } from "antd"
|
||||
import { WebSearch } from "./WebSearch"
|
||||
import {
|
||||
CheckIcon,
|
||||
@ -127,6 +127,18 @@ export const PlaygroundMessage = (props: Props) => {
|
||||
)}
|
||||
|
||||
{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">
|
||||
{props?.sources?.map((source, index) => (
|
||||
<MessageSource
|
||||
@ -136,6 +148,10 @@ export const PlaygroundMessage = (props: Props) => {
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
]}
|
||||
/>
|
||||
)}
|
||||
{!props.isProcessing && !editMode && (
|
||||
<div
|
||||
|
Loading…
x
Reference in New Issue
Block a user