Spaces:
Sleeping
Sleeping
bigwolfe
commited on
Commit
·
9fb4382
1
Parent(s):
05c9551
init
Browse files- backend/pyproject.toml +3 -0
- frontend/src/types/rag.ts +44 -0
backend/pyproject.toml
CHANGED
|
@@ -10,6 +10,9 @@ dependencies = [
|
|
| 10 |
"fastapi>=0.121.2",
|
| 11 |
"fastmcp>=2.13.1",
|
| 12 |
"huggingface-hub>=1.1.4",
|
|
|
|
|
|
|
|
|
|
| 13 |
"mcp>=1.21.0",
|
| 14 |
"pyjwt>=2.10.1",
|
| 15 |
"python-dotenv>=1.0.0",
|
|
|
|
| 10 |
"fastapi>=0.121.2",
|
| 11 |
"fastmcp>=2.13.1",
|
| 12 |
"huggingface-hub>=1.1.4",
|
| 13 |
+
"llama-index>=0.10.0",
|
| 14 |
+
"llama-index-embeddings-google-genai>=0.10.0",
|
| 15 |
+
"llama-index-llms-google-genai>=0.10.0",
|
| 16 |
"mcp>=1.21.0",
|
| 17 |
"pyjwt>=2.10.1",
|
| 18 |
"python-dotenv>=1.0.0",
|
frontend/src/types/rag.ts
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
export type Role = 'user' | 'assistant';
|
| 2 |
+
|
| 3 |
+
export interface SourceReference {
|
| 4 |
+
path: string;
|
| 5 |
+
title: string;
|
| 6 |
+
snippet: string;
|
| 7 |
+
score?: number;
|
| 8 |
+
}
|
| 9 |
+
|
| 10 |
+
export interface NoteWritten {
|
| 11 |
+
path: string;
|
| 12 |
+
title: string;
|
| 13 |
+
action: 'created' | 'updated';
|
| 14 |
+
}
|
| 15 |
+
|
| 16 |
+
export interface ChatMessage {
|
| 17 |
+
role: Role;
|
| 18 |
+
content: string;
|
| 19 |
+
timestamp: string; // ISO 8601
|
| 20 |
+
sources?: SourceReference[];
|
| 21 |
+
notes_written?: NoteWritten[];
|
| 22 |
+
is_error?: boolean; // Frontend-only state for error messages
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
export interface ChatRequest {
|
| 26 |
+
messages: ChatMessage[];
|
| 27 |
+
}
|
| 28 |
+
|
| 29 |
+
export interface ChatResponse {
|
| 30 |
+
answer: string;
|
| 31 |
+
sources: SourceReference[];
|
| 32 |
+
notes_written: NoteWritten[];
|
| 33 |
+
}
|
| 34 |
+
|
| 35 |
+
export interface StatusResponse {
|
| 36 |
+
status: 'ready' | 'building' | 'error';
|
| 37 |
+
doc_count: number;
|
| 38 |
+
last_updated: string | null;
|
| 39 |
+
}
|
| 40 |
+
|
| 41 |
+
export interface ErrorResponse {
|
| 42 |
+
error: string;
|
| 43 |
+
detail?: string;
|
| 44 |
+
}
|