Intelex / frontend /src /app /data /mockData.ts
yakub
Initial cloud-ready commit
b2b6341
Raw
History Blame Contribute Delete
6.56 kB
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,
},
];