Skip to content

Commit

Permalink
First
Browse files Browse the repository at this point in the history
  • Loading branch information
philipperolet committed Oct 6, 2023
1 parent b852320 commit d7f5f66
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions front/components/assistant/conversation/RetrievalAction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default function RetrievalAction({
}: {
retrievalAction: RetrievalActionType;
}) {
const { query, relativeTimeFrame } = retrievalAction.params;
const { query, relativeTimeFrame, topK } = retrievalAction.params;
const [docListVisible, setDocListVisible] = useState(false);

function shortText(text: string, maxLength = 20) {
Expand All @@ -55,9 +55,26 @@ export default function RetrievalAction({
}
/>
</Tooltip>
<Tooltip label={`Query used for semantic search: ${query}`}>
<Chip color="slate" label={query ? shortText(query) : "No query"} />
</Tooltip>
{query && (
<Tooltip label={`Query used for semantic search: ${query}`}>
<Chip
color="slate"
label={query ? shortText(query) : "No query"}
/>
</Tooltip>
)}
{!query && // exhaustive retrieval, checks whether all documents could be read
retrievalAction.documents &&
retrievalAction.documents.length === topK && (
<Tooltip
label={`Too much data to read in one go. Only part of the data was read.`}
>
<Chip
color="warning"
label={`Too much data, retrieved only the first ${topK} documents`}
/>
</Tooltip>
)}
</Chip.List>
</div>
<div className="grid grid-cols-[auto,1fr] gap-2">
Expand Down

0 comments on commit d7f5f66

Please sign in to comment.