Spaces:
Sleeping
Sleeping
Commit
·
a72fec7
1
Parent(s):
49f77e8
Upd OS import
Browse files- helpers/diagram.py +1 -0
- helpers/models.py +1 -0
- helpers/namer.py +1 -1
- memo/consolidation.py +1 -1
- memo/context.py +1 -0
- memo/conversation.py +1 -0
- memo/history.py +1 -0
- memo/legacy.py +1 -0
- memo/plan/execution.py +1 -0
- memo/plan/intent.py +1 -1
- memo/plan/strategy.py +1 -0
- memo/planning.py +1 -0
- memo/retrieval.py +1 -1
- memo/sessions.py +1 -1
- routes/analytics.py +1 -0
- routes/auth.py +1 -1
- routes/health.py +1 -1
- routes/projects.py +1 -1
- routes/search.py +1 -1
- routes/sessions.py +1 -1
helpers/diagram.py
CHANGED
|
@@ -4,6 +4,7 @@ helpers/diagram.py
|
|
| 4 |
Mermaid diagram generation with NVIDIA_LARGE (gpt-oss). Includes a CoT retry
|
| 5 |
mechanism that feeds back rendering errors to refine the diagram prompt.
|
| 6 |
"""
|
|
|
|
| 7 |
|
| 8 |
from typing import Dict, Any
|
| 9 |
from utils.logger import get_logger
|
|
|
|
| 4 |
Mermaid diagram generation with NVIDIA_LARGE (gpt-oss). Includes a CoT retry
|
| 5 |
mechanism that feeds back rendering errors to refine the diagram prompt.
|
| 6 |
"""
|
| 7 |
+
import os
|
| 8 |
|
| 9 |
from typing import Dict, Any
|
| 10 |
from utils.logger import get_logger
|
helpers/models.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
| 1 |
from typing import List, Dict, Any, Optional
|
| 2 |
from pydantic import BaseModel
|
|
|
|
| 3 |
|
| 4 |
|
| 5 |
# ────────────────────────────── Response Models ──────────────────────────────
|
|
|
|
| 1 |
from typing import List, Dict, Any, Optional
|
| 2 |
from pydantic import BaseModel
|
| 3 |
+
import os
|
| 4 |
|
| 5 |
|
| 6 |
# ────────────────────────────── Response Models ──────────────────────────────
|
helpers/namer.py
CHANGED
|
@@ -4,7 +4,7 @@ Session Auto-Naming Module
|
|
| 4 |
This module handles automatic naming of chat sessions based on the first user query.
|
| 5 |
Uses NVIDIA_SMALL API to generate concise, descriptive session names.
|
| 6 |
"""
|
| 7 |
-
|
| 8 |
import asyncio
|
| 9 |
from typing import Optional
|
| 10 |
from utils.logger import get_logger
|
|
|
|
| 4 |
This module handles automatic naming of chat sessions based on the first user query.
|
| 5 |
Uses NVIDIA_SMALL API to generate concise, descriptive session names.
|
| 6 |
"""
|
| 7 |
+
import os
|
| 8 |
import asyncio
|
| 9 |
from typing import Optional
|
| 10 |
from utils.logger import get_logger
|
memo/consolidation.py
CHANGED
|
@@ -6,7 +6,7 @@ Handles memory consolidation, pruning, and optimization
|
|
| 6 |
to prevent information overload and maintain performance.
|
| 7 |
"""
|
| 8 |
|
| 9 |
-
import re
|
| 10 |
from typing import List, Dict, Any, Optional
|
| 11 |
|
| 12 |
from utils.logger import get_logger
|
|
|
|
| 6 |
to prevent information overload and maintain performance.
|
| 7 |
"""
|
| 8 |
|
| 9 |
+
import re, os
|
| 10 |
from typing import List, Dict, Any, Optional
|
| 11 |
|
| 12 |
from utils.logger import get_logger
|
memo/context.py
CHANGED
|
@@ -7,6 +7,7 @@ Functions for retrieving and managing conversation context.
|
|
| 7 |
|
| 8 |
import numpy as np
|
| 9 |
from typing import List, Dict, Any, Tuple, Optional
|
|
|
|
| 10 |
|
| 11 |
from utils.logger import get_logger
|
| 12 |
from utils.rag.embeddings import EmbeddingClient
|
|
|
|
| 7 |
|
| 8 |
import numpy as np
|
| 9 |
from typing import List, Dict, Any, Tuple, Optional
|
| 10 |
+
import os
|
| 11 |
|
| 12 |
from utils.logger import get_logger
|
| 13 |
from utils.rag.embeddings import EmbeddingClient
|
memo/conversation.py
CHANGED
|
@@ -7,6 +7,7 @@ context retrieval, and memory consolidation for natural conversation flow.
|
|
| 7 |
"""
|
| 8 |
|
| 9 |
from typing import List, Dict, Any, Tuple, Optional
|
|
|
|
| 10 |
|
| 11 |
from utils.logger import get_logger
|
| 12 |
from utils.rag.embeddings import EmbeddingClient
|
|
|
|
| 7 |
"""
|
| 8 |
|
| 9 |
from typing import List, Dict, Any, Tuple, Optional
|
| 10 |
+
import os
|
| 11 |
|
| 12 |
from utils.logger import get_logger
|
| 13 |
from utils.rag.embeddings import EmbeddingClient
|
memo/history.py
CHANGED
|
@@ -6,6 +6,7 @@ Functions for managing conversation history and context.
|
|
| 6 |
"""
|
| 7 |
|
| 8 |
from typing import List, Dict, Any, Tuple, Optional
|
|
|
|
| 9 |
|
| 10 |
from utils.logger import get_logger
|
| 11 |
from memo.nvidia import summarize_qa, files_relevance, related_recent_context
|
|
|
|
| 6 |
"""
|
| 7 |
|
| 8 |
from typing import List, Dict, Any, Tuple, Optional
|
| 9 |
+
import os
|
| 10 |
|
| 11 |
from utils.logger import get_logger
|
| 12 |
from memo.nvidia import summarize_qa, files_relevance, related_recent_context
|
memo/legacy.py
CHANGED
|
@@ -7,6 +7,7 @@ In-memory LRU system for backward compatibility.
|
|
| 7 |
|
| 8 |
from collections import deque, defaultdict
|
| 9 |
from typing import List, Dict
|
|
|
|
| 10 |
|
| 11 |
from utils.logger import get_logger
|
| 12 |
|
|
|
|
| 7 |
|
| 8 |
from collections import deque, defaultdict
|
| 9 |
from typing import List, Dict
|
| 10 |
+
import os
|
| 11 |
|
| 12 |
from utils.logger import get_logger
|
| 13 |
|
memo/plan/execution.py
CHANGED
|
@@ -6,6 +6,7 @@ Handles memory retrieval execution based on planned strategies.
|
|
| 6 |
"""
|
| 7 |
|
| 8 |
from typing import List, Dict, Any, Tuple, Optional
|
|
|
|
| 9 |
|
| 10 |
from utils.logger import get_logger
|
| 11 |
from utils.rag.embeddings import EmbeddingClient
|
|
|
|
| 6 |
"""
|
| 7 |
|
| 8 |
from typing import List, Dict, Any, Tuple, Optional
|
| 9 |
+
import os
|
| 10 |
|
| 11 |
from utils.logger import get_logger
|
| 12 |
from utils.rag.embeddings import EmbeddingClient
|
memo/plan/intent.py
CHANGED
|
@@ -5,7 +5,7 @@ Intent Detection
|
|
| 5 |
Handles user intent detection for memory planning.
|
| 6 |
"""
|
| 7 |
|
| 8 |
-
import re
|
| 9 |
from typing import List, Dict, Any, Tuple, Optional
|
| 10 |
from enum import Enum
|
| 11 |
|
|
|
|
| 5 |
Handles user intent detection for memory planning.
|
| 6 |
"""
|
| 7 |
|
| 8 |
+
import re, os
|
| 9 |
from typing import List, Dict, Any, Tuple, Optional
|
| 10 |
from enum import Enum
|
| 11 |
|
memo/plan/strategy.py
CHANGED
|
@@ -7,6 +7,7 @@ Handles memory strategy planning and parameter optimization.
|
|
| 7 |
|
| 8 |
from typing import List, Dict, Any, Tuple, Optional
|
| 9 |
from enum import Enum
|
|
|
|
| 10 |
|
| 11 |
from utils.logger import get_logger
|
| 12 |
from memo.plan.intent import QueryIntent
|
|
|
|
| 7 |
|
| 8 |
from typing import List, Dict, Any, Tuple, Optional
|
| 9 |
from enum import Enum
|
| 10 |
+
import os
|
| 11 |
|
| 12 |
from utils.logger import get_logger
|
| 13 |
from memo.plan.intent import QueryIntent
|
memo/planning.py
CHANGED
|
@@ -7,6 +7,7 @@ intent detection, strategy planning, and execution.
|
|
| 7 |
"""
|
| 8 |
|
| 9 |
from typing import List, Dict, Any, Tuple, Optional
|
|
|
|
| 10 |
|
| 11 |
from utils.logger import get_logger
|
| 12 |
from utils.rag.embeddings import EmbeddingClient
|
|
|
|
| 7 |
"""
|
| 8 |
|
| 9 |
from typing import List, Dict, Any, Tuple, Optional
|
| 10 |
+
import os
|
| 11 |
|
| 12 |
from utils.logger import get_logger
|
| 13 |
from utils.rag.embeddings import EmbeddingClient
|
memo/retrieval.py
CHANGED
|
@@ -6,7 +6,7 @@ Handles intelligent context retrieval, enhancement decisions,
|
|
| 6 |
and input optimization for natural conversation flow.
|
| 7 |
"""
|
| 8 |
|
| 9 |
-
import re
|
| 10 |
from typing import List, Dict, Any, Tuple, Optional
|
| 11 |
|
| 12 |
from utils.logger import get_logger
|
|
|
|
| 6 |
and input optimization for natural conversation flow.
|
| 7 |
"""
|
| 8 |
|
| 9 |
+
import re, os
|
| 10 |
from typing import List, Dict, Any, Tuple, Optional
|
| 11 |
|
| 12 |
from utils.logger import get_logger
|
memo/sessions.py
CHANGED
|
@@ -6,7 +6,7 @@ Handles conversation session tracking, context switching detection,
|
|
| 6 |
and conversation insights.
|
| 7 |
"""
|
| 8 |
|
| 9 |
-
import re
|
| 10 |
import time
|
| 11 |
from typing import Dict, Any, Tuple, Optional
|
| 12 |
|
|
|
|
| 6 |
and conversation insights.
|
| 7 |
"""
|
| 8 |
|
| 9 |
+
import re, os
|
| 10 |
import time
|
| 11 |
from typing import Dict, Any, Tuple, Optional
|
| 12 |
|
routes/analytics.py
CHANGED
|
@@ -4,6 +4,7 @@ Analytics API Routes
|
|
| 4 |
|
| 5 |
Provides endpoints for retrieving user and global analytics data.
|
| 6 |
"""
|
|
|
|
| 7 |
|
| 8 |
from fastapi import HTTPException, Query
|
| 9 |
from typing import Optional, Dict, Any, List
|
|
|
|
| 4 |
|
| 5 |
Provides endpoints for retrieving user and global analytics data.
|
| 6 |
"""
|
| 7 |
+
import os
|
| 8 |
|
| 9 |
from fastapi import HTTPException, Query
|
| 10 |
from typing import Optional, Dict, Any, List
|
routes/auth.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
# routes/auth.py
|
| 2 |
-
import uuid, time, hashlib, secrets
|
| 3 |
from typing import Optional
|
| 4 |
from fastapi import Form, HTTPException
|
| 5 |
|
|
|
|
| 1 |
# routes/auth.py
|
| 2 |
+
import uuid, time, hashlib, secrets, os
|
| 3 |
from typing import Optional
|
| 4 |
from fastapi import Form, HTTPException
|
| 5 |
|
routes/health.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
from helpers.setup import app, rag, logger
|
| 2 |
from helpers.models import HealthResponse
|
| 3 |
-
|
| 4 |
|
| 5 |
@app.get("/healthz", response_model=HealthResponse)
|
| 6 |
def health():
|
|
|
|
| 1 |
from helpers.setup import app, rag, logger
|
| 2 |
from helpers.models import HealthResponse
|
| 3 |
+
import os
|
| 4 |
|
| 5 |
@app.get("/healthz", response_model=HealthResponse)
|
| 6 |
def health():
|
routes/projects.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
# routes/projects.py
|
| 2 |
-
import uuid
|
| 3 |
import time
|
| 4 |
from datetime import datetime, timezone
|
| 5 |
from fastapi import Form, HTTPException
|
|
|
|
| 1 |
# routes/projects.py
|
| 2 |
+
import uuid, os
|
| 3 |
import time
|
| 4 |
from datetime import datetime, timezone
|
| 5 |
from fastapi import Form, HTTPException
|
routes/search.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
# routes/search.py
|
| 2 |
-
import re, asyncio, time, json
|
| 3 |
from typing import List, Dict, Any, Tuple
|
| 4 |
from helpers.setup import logger, embedder, gemini_rotator, nvidia_rotator
|
| 5 |
from utils.api.router import select_model, generate_answer_with_model, qwen_chat_completion, nvidia_large_chat_completion
|
|
|
|
| 1 |
# routes/search.py
|
| 2 |
+
import re, asyncio, time, json, os
|
| 3 |
from typing import List, Dict, Any, Tuple
|
| 4 |
from helpers.setup import logger, embedder, gemini_rotator, nvidia_rotator
|
| 5 |
from utils.api.router import select_model, generate_answer_with_model, qwen_chat_completion, nvidia_large_chat_completion
|
routes/sessions.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
# routes/sessions.py
|
| 2 |
-
import json, time, uuid
|
| 3 |
from datetime import datetime, timezone
|
| 4 |
from typing import Any, Dict, List, Optional
|
| 5 |
from fastapi import Form, HTTPException
|
|
|
|
| 1 |
# routes/sessions.py
|
| 2 |
+
import json, time, uuid, os
|
| 3 |
from datetime import datetime, timezone
|
| 4 |
from typing import Any, Dict, List, Optional
|
| 5 |
from fastapi import Form, HTTPException
|