feat: add expert search, legal search and UI improvements

This commit is contained in:
Aktraiser 2024-12-30 13:34:26 +01:00
parent 2c5ca94b3c
commit 271199c527
53 changed files with 4595 additions and 708 deletions

1
src/types/index.ts Normal file
View file

@ -0,0 +1 @@
export * from './types';

73
src/types/types.ts Normal file
View file

@ -0,0 +1,73 @@
import { BaseMessage } from '@langchain/core/messages';
export interface Expert {
id: number;
id_expert: string;
nom: string;
prenom: string;
adresse: string;
pays: string;
ville: string;
expertises: string;
specialite: string;
biographie: string;
tarif: number;
services: any;
created_at: string;
image_url: string;
}
export interface ExpertSearchRequest {
query: string;
chat_history: BaseMessage[];
messageId: string;
chatId: string;
}
export interface ExpertSearchResponse {
experts: Expert[];
synthese: string;
}
export interface EnrichedResponse {
text: string;
sources: Source[];
suggestions: string[];
images: ImageResult[];
}
export interface Source {
title: string;
url: string;
snippet: string;
}
export interface ImageResult {
url: string;
title: string;
source: string;
}
export interface DocumentMetadata {
title?: string;
source?: string;
type?: string;
url?: string;
pageNumber?: number;
score?: number;
expertData?: any;
searchText?: string;
illustrationImage?: string;
imageTitle?: string;
[key: string]: any;
}
export interface NormalizedSource {
pageContent: string;
metadata: DocumentMetadata;
}
export interface SearchResult {
pageContent: string;
metadata: DocumentMetadata;
}