Skip to content

Commit

Permalink
Updating documentation on formatting of citations
Browse files Browse the repository at this point in the history
  • Loading branch information
bwitzig-zen committed Jun 5, 2024
1 parent 87c7c64 commit 0aa4e26
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/features/chat-page/chat-services/citation-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,16 @@ export const FindCitationByID = async (
}
};

// metadata = filename
// pageContent = text from document
// ChatThreadId = idneitifier for which chat thread the document was used for
export const FormatCitations = (citation: any[]) => {
const withoutEmbedding: DocumentSearchResponse[] = [];
citation.forEach((d) => {
withoutEmbedding.push({
score: d.score,
document: {
metadata: d.document.metadata || d.document.title,
metadata: d.document.metadata || d.document.title,
pageContent: d.document.pageContent || d.document.search.captions.text || d.document.chunk,
chatThreadId: d.document.chatThreadId,
id: "",
Expand Down

0 comments on commit 0aa4e26

Please sign in to comment.