File size: 6,555 Bytes
b2b6341 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 | import { KnowledgeSource, ChatMessage, RetrievedChunk } from '../types';
export const mockSources: KnowledgeSource[] = [
{
id: '1',
type: 'pdf',
title: 'Machine Learning Research Paper 2024',
language: 'EN',
status: 'completed',
chunkCount: 127,
dateAdded: new Date('2024-02-15'),
lastProcessed: new Date('2024-02-15'),
metadata: {
pageCount: 42,
},
},
{
id: '2',
type: 'pdf',
title: 'भारतीय संविधान और मौलिक अधिकार',
language: 'HI',
status: 'completed',
chunkCount: 89,
dateAdded: new Date('2024-02-10'),
lastProcessed: new Date('2024-02-10'),
metadata: {
pageCount: 28,
},
},
{
id: '3',
type: 'web',
title: 'Introduction to React Server Components',
language: 'EN',
status: 'completed',
chunkCount: 45,
dateAdded: new Date('2024-02-20'),
lastProcessed: new Date('2024-02-20'),
metadata: {
url: 'https://react.dev/blog/2023/03/22/react-labs-what-we-have-been-working-on-march-2023',
domain: 'react.dev',
},
},
{
id: '4',
type: 'web',
title: 'తెలుగు సాహిత్య చరిత్ర',
language: 'TE',
status: 'completed',
chunkCount: 67,
dateAdded: new Date('2024-02-18'),
lastProcessed: new Date('2024-02-18'),
metadata: {
url: 'https://example.te/literature',
domain: 'example.te',
},
},
{
id: '5',
type: 'youtube',
title: 'Understanding Transformer Architecture',
language: 'EN',
status: 'completed',
chunkCount: 156,
dateAdded: new Date('2024-02-22'),
lastProcessed: new Date('2024-02-22'),
metadata: {
videoId: 'dQw4w9WgXcQ',
thumbnail: 'https://images.unsplash.com/photo-1611162617474-5b21e879e113?w=400',
duration: '45:32',
},
},
{
id: '6',
type: 'youtube',
title: 'Deep Learning Fundamentals',
language: 'EN',
status: 'processing',
chunkCount: 0,
dateAdded: new Date('2024-03-07'),
metadata: {
videoId: 'abc123xyz',
thumbnail: 'https://images.unsplash.com/photo-1526374965328-7f61d4dc18c5?w=400',
duration: '1:12:45',
},
},
{
id: '7',
type: 'pdf',
title: 'Quantum Computing Basics',
language: 'EN',
status: 'completed',
chunkCount: 98,
dateAdded: new Date('2024-02-25'),
lastProcessed: new Date('2024-02-25'),
metadata: {
pageCount: 35,
},
},
];
export const mockRetrievedChunks: RetrievedChunk[] = [
{
id: 'chunk-1',
sourceId: '1',
sourceName: 'Machine Learning Research Paper 2024',
sourceType: 'pdf',
language: 'EN',
text: 'Transformers have revolutionized natural language processing by introducing self-attention mechanisms that allow models to weigh the importance of different words in a sentence regardless of their positional distance. This breakthrough has led to significant improvements in tasks such as machine translation, text summarization, and question answering.',
similarityScore: 0.94,
metadata: {
page: 5,
},
},
{
id: 'chunk-2',
sourceId: '5',
sourceName: 'Understanding Transformer Architecture',
sourceType: 'youtube',
language: 'EN',
text: 'The key innovation of the transformer architecture is the multi-head attention mechanism. Unlike RNNs which process sequences sequentially, transformers can process all tokens in parallel, making them much more efficient for training on modern hardware.',
similarityScore: 0.89,
metadata: {
timestamp: '12:34',
},
},
{
id: 'chunk-3',
sourceId: '3',
sourceName: 'Introduction to React Server Components',
sourceType: 'web',
language: 'EN',
text: 'React Server Components allow developers to build applications that span the server and client, combining the rich interactivity of client-side apps with the improved performance of traditional server rendering.',
similarityScore: 0.76,
metadata: {
url: 'https://react.dev/blog',
},
},
{
id: 'chunk-4',
sourceId: '1',
sourceName: 'Machine Learning Research Paper 2024',
sourceType: 'pdf',
language: 'EN',
text: 'Attention mechanisms compute a weighted sum of values based on the similarity between a query and a set of keys. This allows the model to focus on the most relevant parts of the input when making predictions.',
similarityScore: 0.72,
metadata: {
page: 7,
},
},
];
export const mockChatHistory: ChatMessage[] = [
{
id: 'msg-1',
role: 'user',
content: 'What are transformers and how do they work in machine learning?',
timestamp: new Date('2024-03-07T10:30:00'),
},
{
id: 'msg-2',
role: 'assistant',
content: 'Transformers are a revolutionary neural network architecture that have transformed natural language processing. According to the research, transformers introduced self-attention mechanisms that allow models to weigh the importance of different words in a sentence regardless of their positional distance. This breakthrough has led to significant improvements in tasks such as machine translation, text summarization, and question answering.\n\nThe key innovation is the multi-head attention mechanism. Unlike RNNs which process sequences sequentially, transformers can process all tokens in parallel, making them much more efficient for training on modern hardware. Attention mechanisms compute a weighted sum of values based on the similarity between a query and a set of keys, allowing the model to focus on the most relevant parts of the input when making predictions.',
timestamp: new Date('2024-03-07T10:30:15'),
citations: [
{
sourceTitle: 'Machine Learning Research Paper 2024',
sourceType: 'pdf',
reference: 'Page 5',
snippet: 'Transformers have revolutionized natural language processing by introducing self-attention mechanisms...',
},
{
sourceTitle: 'Understanding Transformer Architecture',
sourceType: 'youtube',
reference: '12:34',
snippet: 'The key innovation of the transformer architecture is the multi-head attention mechanism...',
},
{
sourceTitle: 'Machine Learning Research Paper 2024',
sourceType: 'pdf',
reference: 'Page 7',
snippet: 'Attention mechanisms compute a weighted sum of values based on the similarity...',
},
],
retrievedChunks: mockRetrievedChunks,
},
];
|