Spaces:
Running
# =================== MATRXI API ============================================
Browse files# Import the required modules
import os
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
from dotenv import load_dotenv
# Load the environment variables from the .env file
load_dotenv()
# Get the Hugging Face API key from the environment variables
HF_TOKEN = os.getenv('HUGGINGFACE_API_KEY')
MODEL_NAME = "meta-llama/Meta-Llama-3-8B-Instruct"
def huggingface_completion(prompt: str) -> dict:
'''
Call Hugging Face API for text completion
Parameters:
- prompt: user query (str)
Returns:
- dict
'''
try:
# Load the tokenizer and model
tokenizer = AutoTokenizer.from_pretrained(MODEL_NAME, token=HF_TOKEN)
model = AutoModelForCausalLM.from_pretrained(
MODEL_NAME,
device_map="auto",
torch_dtype="auto",
token=HF_TOKEN,
)
# Create a pipeline for text generation
pipe = pipeline("text-generation", model=model, tokenizer=tokenizer)
# Generate response
response = pipe(
prompt,
max_new_tokens=512,
temperature=0.7,
top_p=0.9,
do_sample=True,
)
# Extract the generated text
output_text = response[0]["generated_text"]
if output_text.startswith(prompt):
output_text = output_text[len(prompt):].strip()
# Print a success message with the response from the Hugging Face API call
print(f"Hugging Face API call successful. Response: {output_text[:100]}...")
# Return a dictionary with the status and the content of the response
return {
'status': 1,
'response': output_text
}
except Exception as e:
# Print any error that occurs during the Hugging Face API call
print(f"Hugging Face API call failed. Error: {e}")
# Return a dictionary with the status and an empty response
return {'status': 0, 'response': ''}
# ==================== MATRIX API CLIENT ====================
# Import the required modules
import os
from dotenv import load_dotenv
# Load the environment variables from the .env file
load_dotenv()
homeserver = os.getenv("MATRIX_HOMESERVER")
user = os.getenv("MATRIX_USER")
password = os.getenv("MATRIX_PASSWORD")
room_id = os.getenv("MATRIX_ROOM_ID")
class MatrixClient:
"""Handles Matrix server communication"""
def __init__(self, homeserver, user, password):
self.homeserver = homeserver
self.user = user
self.password = password
self.access_token = None
def login(self):
"""Authenticate and get access token"""
url = f"{self.homeserver}/_matrix/client/v3/login"
data = {
"type": "m.login.password",
"user": self.user,
"password": self.password,
}
res = requests.post(url, json=data)
res.raise_for_status()
self.access_token = res.json()["access_token"]
logger.info("Successfully logged into Matrix")
return self.access_token
def send_message(self, room_id, message):
"""Send message to a room"""
url = f"{self.homeserver}/_matrix/client/v3/rooms/{room_id}/send/m.room.message"
headers = {"Authorization": f"Bearer {self.access_token}"}
data = {
"msgtype": "m.text",
"body": message,
}
res = requests.post(url, headers=headers, json=data)
res.raise_for_status()
logger.info(f"Message sent to room {room_id}")
def sync_messages(self, sync_token=None):
"""Sync with matrix server to get new messages"""
url = f"{self.homeserver}/_matrix/client/v3/sync"
headers = {"Authorization": f"Bearer {self.access_token}"}
params = {"timeout": 30000}
if sync_token:
params["since"] = sync_token
res = requests.get(url, headers=headers, params=params)
res.raise_for_status()
data = res.json()
new_messages = []
for room_id, room_info in data.get("rooms", {}).get("join", {}).items():
room_events = room_info.get("timeline", {}).get("events", [])
for event in room_events:
if (event.get("type") == "m.room.message" and
event.get("sender") != self.user and
event.get("content", {}).get("msgtype") == "m.text"):
new_messages.append(event)
next_batch = data.get("next_batch")
return next_batch, new_messages
def join_room(self, room_id):
"""Join a room that the bot has been invited to"""
url = f"{self.homeserver}/_matrix/client/v3/join/{room_id}"
headers = {"Authorization": f"Bearer {self.access_token}"}
res = requests.post(url, headers=headers)
res.raise_for_status()
logger.info(f"Joined room: {room_id}")
def get_invited_rooms(self, sync_token=None):
"""Check for room invitations"""
url = f"{self.homeserver}/_matrix/client/v3/sync"
headers = {"Authorization": f"Bearer {self.access_token}"}
params = {"timeout": 30000}
if sync_token:
params["since"] = sync_token
res = requests.get(url, headers=headers, params=params)
res.raise_for_status()
data = res.json()
invited_rooms = []
for room_id, invite_info in data.get("rooms", {}).get("invite", {}).items():
invited_rooms.append(room_id)
return invited_rooms
# ==================== DOCUMENT LOADER ====================
class DocumentLoader:
def __init__(self, text_files_path):
self.text_files_path = text_files_path
self.required_files = {
'services_policies': 'service_policies.txt',
'faqs': 'faq.txt',
'prompt_config': 'rag_prompt_config.txt'
}
def load_documents(self):
"""Load documents from specified path"""
documents = []
for doc_type, filename in self.required_files.items():
file_path = Path(self.text_files_path) / filename
if not file_path.exists():
logger.warning(f"File not found: {filename} at {file_path}")
continue
try:
with open(file_path, 'r', encoding='utf-8') as f:
content = f.read()
document = Document(
page_content=content,
metadata={"source": filename, "type": doc_type}
)
documents.append(document)
logger.info(f"Loaded {filename}")
except Exception as e:
logger.error(f"Error loading {filename}: {e}")
continue
if not documents:
logger.error("No documents loaded. Please check your file paths")
return []
return documents
class TigressTechRAG:
def __init__(self):
self.embedding_model = HuggingFaceEmbeddings(
model_name="sentence-transformers/all-MiniLM-L6-v2",
model_kwargs={'device': 'cpu'},
encode_kwargs={'normalize_embeddings': True}
)
self.vectorstore = None
self.retriever = None
self.document_loader = DocumentLoader(TEXT_FILES_PATH)
def setup_rag(self, persist_directory=PERSIST_DIRECTORY):
"""Setup RAG system with document processing"""
logger.info("Setting up RAG system...")
# Load documents
documents = self.document_loader.load_documents()
if not documents:
logger.error("No documents to process")
return False
# Split documents
text_splitter = RecursiveCharacterTextSplitter(
chunk_size=800,
chunk_overlap=150,
length_function=len,
)
splits = text_splitter.split_documents(documents)
logger.info(f"Split into {len(splits)} chunks")
# Create vector store
self.vectorstore = Chroma.from_documents(
documents=splits,
embedding=self.embedding_model,
persist_directory=persist_directory
)
# Create retriever
self.retriever = self.vectorstore.as_retriever(
search_type="similarity",
search_kwargs={"k": 3}
)
logger.info("RAG system setup complete")
return True
def query_knowledge_base(self, query, max_context_length=2500):
"""Query the knowledge base for relevant information"""
if not self.retriever:
return "Knowledge base not available."
try:
# Retrieve relevant documents
relevant_docs = self.retriever.get_relevant_documents(query)
if not relevant_docs:
return "No specific information found. Please contact our team for detailed assistance."
# Combine context
context = "\n\n".join([doc.page_content for doc in relevant_docs])
if len(context) > max_context_length:
context = context[:max_context_length] + "..."
return context
except Exception as e:
logger.error(f"Error in query: {e}")
return "Unable to retrieve information."
# ==================== PROMPT MANAGER ====================
class PromptManager:
def __init__(self, config_path=PROMPT_CONFIG_PATH):
self.config = self._load_config(config_path)
self.business_info = self.config.get('business', {})
def _load_config(self, config_path):
"""Load unified YAML configuration"""
try:
with open(config_path, 'r', encoding='utf-8') as f:
return yaml.safe_load(f)
except Exception as e:
logger.error(f"Error loading prompt config: {e}")
return self._create_fallback_
- README.md +7 -5
- index.html +312 -18
|
@@ -1,10 +1,12 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
| 1 |
---
|
| 2 |
+
title: custom-support
|
| 3 |
+
emoji: 🐳
|
| 4 |
+
colorFrom: red
|
| 5 |
+
colorTo: blue
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
| 8 |
+
tags:
|
| 9 |
+
- deepsite
|
| 10 |
---
|
| 11 |
|
| 12 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
@@ -1,19 +1,313 @@
|
|
| 1 |
-
<!
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
</html>
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>TigressTech AI Dashboard</title>
|
| 7 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 8 |
+
<script src="https://unpkg.com/feather-icons"></script>
|
| 9 |
+
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
|
| 10 |
+
<script src="https://cdn.jsdelivr.net/npm/animejs/lib/anime.iife.min.js"></script>
|
| 11 |
+
<script>const { animate } = anime;</script>
|
| 12 |
+
<style>
|
| 13 |
+
.gradient-bg {
|
| 14 |
+
background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
|
| 15 |
+
}
|
| 16 |
+
.message-bubble {
|
| 17 |
+
border-radius: 18px;
|
| 18 |
+
transition: all 0.3s ease;
|
| 19 |
+
}
|
| 20 |
+
.message-bubble:hover {
|
| 21 |
+
transform: translateY(-2px);
|
| 22 |
+
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
|
| 23 |
+
}
|
| 24 |
+
.pulse {
|
| 25 |
+
animation: pulse 2s infinite;
|
| 26 |
+
}
|
| 27 |
+
@keyframes pulse {
|
| 28 |
+
0% { opacity: 1; }
|
| 29 |
+
50% { opacity: 0.5; }
|
| 30 |
+
100% { opacity: 1; }
|
| 31 |
+
}
|
| 32 |
+
</style>
|
| 33 |
+
</head>
|
| 34 |
+
<body class="bg-gray-50 min-h-screen">
|
| 35 |
+
<div class="flex flex-col min-h-screen">
|
| 36 |
+
<!-- Header -->
|
| 37 |
+
<header class="gradient-bg text-white shadow-lg">
|
| 38 |
+
<div class="container mx-auto px-4 py-6">
|
| 39 |
+
<div class="flex items-center justify-between">
|
| 40 |
+
<div class="flex items-center space-x-4">
|
| 41 |
+
<div class="bg-white rounded-full p-2 shadow-md">
|
| 42 |
+
<i data-feather="cpu" class="text-indigo-600 w-8 h-8"></i>
|
| 43 |
+
</div>
|
| 44 |
+
<h1 class="text-2xl font-bold">TigressTech AI Dashboard</h1>
|
| 45 |
+
</div>
|
| 46 |
+
<div class="flex items-center space-x-4">
|
| 47 |
+
<div class="bg-white/20 rounded-full px-4 py-1 flex items-center">
|
| 48 |
+
<span class="h-3 w-3 bg-green-400 rounded-full mr-2 pulse"></span>
|
| 49 |
+
<span>Connected</span>
|
| 50 |
+
</div>
|
| 51 |
+
<button class="bg-white/20 hover:bg-white/30 rounded-full p-2 transition">
|
| 52 |
+
<i data-feather="settings"></i>
|
| 53 |
+
</button>
|
| 54 |
+
</div>
|
| 55 |
+
</div>
|
| 56 |
+
</div>
|
| 57 |
+
</header>
|
| 58 |
+
|
| 59 |
+
<!-- Main Content -->
|
| 60 |
+
<main class="flex-1 container mx-auto px-4 py-8">
|
| 61 |
+
<div class="grid grid-cols-1 lg:grid-cols-3 gap-8">
|
| 62 |
+
<!-- Left Column -->
|
| 63 |
+
<div class="lg:col-span-2 space-y-8">
|
| 64 |
+
<!-- Conversation Panel -->
|
| 65 |
+
<div class="bg-white rounded-xl shadow-md overflow-hidden">
|
| 66 |
+
<div class="bg-gray-50 px-6 py-4 border-b flex items-center justify-between">
|
| 67 |
+
<h2 class="text-lg font-semibold text-gray-800">
|
| 68 |
+
<i data-feather="message-square" class="inline mr-2"></i>
|
| 69 |
+
Recent Conversations
|
| 70 |
+
</h2>
|
| 71 |
+
<button class="text-indigo-600 hover:text-indigo-800">
|
| 72 |
+
<i data-feather="refresh-cw" class="w-5 h-5"></i>
|
| 73 |
+
</button>
|
| 74 |
+
</div>
|
| 75 |
+
<div class="p-6 h-96 overflow-y-auto" id="conversation-container">
|
| 76 |
+
<!-- Messages will be loaded here -->
|
| 77 |
+
<div class="space-y-4">
|
| 78 |
+
<div class="flex justify-end">
|
| 79 |
+
<div class="message-bubble bg-indigo-100 text-gray-800 px-4 py-3 max-w-xs lg:max-w-md">
|
| 80 |
+
<p class="font-medium">User:</p>
|
| 81 |
+
<p>How do I reset my password?</p>
|
| 82 |
+
<p class="text-xs text-gray-500 mt-1">2 min ago</p>
|
| 83 |
+
</div>
|
| 84 |
+
</div>
|
| 85 |
+
<div class="flex justify-start">
|
| 86 |
+
<div class="message-bubble bg-white border border-gray-200 px-4 py-3 max-w-xs lg:max-w-md">
|
| 87 |
+
<p class="font-medium">Tigra:</p>
|
| 88 |
+
<p>You can reset your password by going to Settings > Account > Reset Password. Let me know if you need further assistance!</p>
|
| 89 |
+
<p class="text-xs text-gray-500 mt-1">1 min ago</p>
|
| 90 |
+
</div>
|
| 91 |
+
</div>
|
| 92 |
+
</div>
|
| 93 |
+
</div>
|
| 94 |
+
<div class="bg-gray-50 px-6 py-4 border-t">
|
| 95 |
+
<div class="flex">
|
| 96 |
+
<input type="text" placeholder="Type a message..." class="flex-1 border rounded-l-lg px-4 py-2 focus:outline-none focus:ring-2 focus:ring-indigo-500">
|
| 97 |
+
<button class="bg-indigo-600 text-white px-4 py-2 rounded-r-lg hover:bg-indigo-700 transition">
|
| 98 |
+
<i data-feather="send" class="w-5 h-5"></i>
|
| 99 |
+
</button>
|
| 100 |
+
</div>
|
| 101 |
+
</div>
|
| 102 |
+
</div>
|
| 103 |
+
|
| 104 |
+
<!-- System Status -->
|
| 105 |
+
<div class="bg-white rounded-xl shadow-md overflow-hidden">
|
| 106 |
+
<div class="bg-gray-50 px-6 py-4 border-b">
|
| 107 |
+
<h2 class="text-lg font-semibold text-gray-800">
|
| 108 |
+
<i data-feather="activity" class="inline mr-2"></i>
|
| 109 |
+
System Status
|
| 110 |
+
</h2>
|
| 111 |
+
</div>
|
| 112 |
+
<div class="p-6">
|
| 113 |
+
<div class="grid grid-cols-1 md:grid-cols-3 gap-6">
|
| 114 |
+
<div class="bg-gray-50 rounded-lg p-4 border border-gray-200">
|
| 115 |
+
<div class="flex items-center justify-between">
|
| 116 |
+
<div>
|
| 117 |
+
<p class="text-sm text-gray-500">Matrix Status</p>
|
| 118 |
+
<p class="text-2xl font-bold text-green-600">Online</p>
|
| 119 |
+
</div>
|
| 120 |
+
<div class="bg-green-100 p-3 rounded-full">
|
| 121 |
+
<i data-feather="check-circle" class="text-green-600 w-6 h-6"></i>
|
| 122 |
+
</div>
|
| 123 |
+
</div>
|
| 124 |
+
</div>
|
| 125 |
+
<div class="bg-gray-50 rounded-lg p-4 border border-gray-200">
|
| 126 |
+
<div class="flex items-center justify-between">
|
| 127 |
+
<div>
|
| 128 |
+
<p class="text-sm text-gray-500">LLM Status</p>
|
| 129 |
+
<p class="text-2xl font-bold text-green-600">Active</p>
|
| 130 |
+
</div>
|
| 131 |
+
<div class="bg-green-100 p-3 rounded-full">
|
| 132 |
+
<i data-feather="cpu" class="text-green-600 w-6 h-6"></i>
|
| 133 |
+
</div>
|
| 134 |
+
</div>
|
| 135 |
+
</div>
|
| 136 |
+
<div class="bg-gray-50 rounded-lg p-4 border border-gray-200">
|
| 137 |
+
<div class="flex items-center justify-between">
|
| 138 |
+
<div>
|
| 139 |
+
<p class="text-sm text-gray-500">RAG Status</p>
|
| 140 |
+
<p class="text-2xl font-bold text-green-600">Ready</p>
|
| 141 |
+
</div>
|
| 142 |
+
<div class="bg-green-100 p-3 rounded-full">
|
| 143 |
+
<i data-feather="database" class="text-green-600 w-6 h-6"></i>
|
| 144 |
+
</div>
|
| 145 |
+
</div>
|
| 146 |
+
</div>
|
| 147 |
+
</div>
|
| 148 |
+
</div>
|
| 149 |
+
</div>
|
| 150 |
+
</div>
|
| 151 |
+
|
| 152 |
+
<!-- Right Column -->
|
| 153 |
+
<div class="space-y-8">
|
| 154 |
+
<!-- Quick Stats -->
|
| 155 |
+
<div class="bg-white rounded-xl shadow-md overflow-hidden">
|
| 156 |
+
<div class="bg-gray-50 px-6 py-4 border-b">
|
| 157 |
+
<h2 class="text-lg font-semibold text-gray-800">
|
| 158 |
+
<i data-feather="bar-chart-2" class="inline mr-2"></i>
|
| 159 |
+
Quick Stats
|
| 160 |
+
</h2>
|
| 161 |
+
</div>
|
| 162 |
+
<div class="p-6">
|
| 163 |
+
<div class="space-y-6">
|
| 164 |
+
<div>
|
| 165 |
+
<p class="text-sm text-gray-500">Messages Today</p>
|
| 166 |
+
<p class="text-3xl font-bold">42</p>
|
| 167 |
+
</div>
|
| 168 |
+
<div>
|
| 169 |
+
<p class="text-sm text-gray-500">Active Rooms</p>
|
| 170 |
+
<p class="text-3xl font-bold">8</p>
|
| 171 |
+
</div>
|
| 172 |
+
<div>
|
| 173 |
+
<p class="text-sm text-gray-500">Response Time</p>
|
| 174 |
+
<p class="text-3xl font-bold">1.2s</p>
|
| 175 |
+
</div>
|
| 176 |
+
</div>
|
| 177 |
+
</div>
|
| 178 |
+
</div>
|
| 179 |
+
|
| 180 |
+
<!-- Query Types -->
|
| 181 |
+
<div class="bg-white rounded-xl shadow-md overflow-hidden">
|
| 182 |
+
<div class="bg-gray-50 px-6 py-4 border-b">
|
| 183 |
+
<h2 class="text-lg font-semibold text-gray-800">
|
| 184 |
+
<i data-feather="filter" class="inline mr-2"></i>
|
| 185 |
+
Query Types
|
| 186 |
+
</h2>
|
| 187 |
+
</div>
|
| 188 |
+
<div class="p-6">
|
| 189 |
+
<div class="space-y-4">
|
| 190 |
+
<div class="flex items-center justify-between">
|
| 191 |
+
<div class="flex items-center">
|
| 192 |
+
<div class="bg-indigo-100 p-2 rounded-full mr-3">
|
| 193 |
+
<i data-feather="help-circle" class="text-indigo-600 w-5 h-5"></i>
|
| 194 |
+
</div>
|
| 195 |
+
<span>General</span>
|
| 196 |
+
</div>
|
| 197 |
+
<span class="bg-gray-100 px-3 py-1 rounded-full text-sm">65%</span>
|
| 198 |
+
</div>
|
| 199 |
+
<div class="flex items-center justify-between">
|
| 200 |
+
<div class="flex items-center">
|
| 201 |
+
<div class="bg-purple-100 p-2 rounded-full mr-3">
|
| 202 |
+
<i data-feather="tool" class="text-purple-600 w-5 h-5"></i>
|
| 203 |
+
</div>
|
| 204 |
+
<span>Technical</span>
|
| 205 |
+
</div>
|
| 206 |
+
<span class="bg-gray-100 px-3 py-1 rounded-full text-sm">20%</span>
|
| 207 |
+
</div>
|
| 208 |
+
<div class="flex items-center justify-between">
|
| 209 |
+
<div class="flex items-center">
|
| 210 |
+
<div class="bg-pink-100 p-2 rounded-full mr-3">
|
| 211 |
+
<i data-feather="shopping-bag" class="text-pink-600 w-5 h-5"></i>
|
| 212 |
+
</div>
|
| 213 |
+
<span>Sales</span>
|
| 214 |
+
</div>
|
| 215 |
+
<span class="bg-gray-100 px-3 py-1 rounded-full text-sm">10%</span>
|
| 216 |
+
</div>
|
| 217 |
+
<div class="flex items-center justify-between">
|
| 218 |
+
<div class="flex items-center">
|
| 219 |
+
<div class="bg-yellow-100 p-2 rounded-full mr-3">
|
| 220 |
+
<i data-feather="alert-triangle" class="text-yellow-600 w-5 h-5"></i>
|
| 221 |
+
</div>
|
| 222 |
+
<span>Complaints</span>
|
| 223 |
+
</div>
|
| 224 |
+
<span class="bg-gray-100 px-3 py-1 rounded-full text-sm">5%</span>
|
| 225 |
+
</div>
|
| 226 |
+
</div>
|
| 227 |
+
</div>
|
| 228 |
+
</div>
|
| 229 |
+
|
| 230 |
+
<!-- Recent Activity -->
|
| 231 |
+
<div class="bg-white rounded-xl shadow-md overflow-hidden">
|
| 232 |
+
<div class="bg-gray-50 px-6 py-4 border-b">
|
| 233 |
+
<h2 class="text-lg font-semibold text-gray-800">
|
| 234 |
+
<i data-feather="clock" class="inline mr-2"></i>
|
| 235 |
+
Recent Activity
|
| 236 |
+
</h2>
|
| 237 |
+
</div>
|
| 238 |
+
<div class="p-6">
|
| 239 |
+
<div class="space-y-4">
|
| 240 |
+
<div class="flex items-start">
|
| 241 |
+
<div class="bg-green-100 p-2 rounded-full mr-3">
|
| 242 |
+
<i data-feather="message-square" class="text-green-600 w-5 h-5"></i>
|
| 243 |
+
</div>
|
| 244 |
+
<div>
|
| 245 |
+
<p class="font-medium">New message processed</p>
|
| 246 |
+
<p class="text-sm text-gray-500">2 minutes ago</p>
|
| 247 |
+
</div>
|
| 248 |
+
</div>
|
| 249 |
+
<div class="flex items-start">
|
| 250 |
+
<div class="bg-blue-100 p-2 rounded-full mr-3">
|
| 251 |
+
<i data-feather="database" class="text-blue-600 w-5 h-5"></i>
|
| 252 |
+
</div>
|
| 253 |
+
<div>
|
| 254 |
+
<p class="font-medium">RAG context retrieved</p>
|
| 255 |
+
<p class="text-sm text-gray-500">5 minutes ago</p>
|
| 256 |
+
</div>
|
| 257 |
+
</div>
|
| 258 |
+
<div class="flex items-start">
|
| 259 |
+
<div class="bg-purple-100 p-2 rounded-full mr-3">
|
| 260 |
+
<i data-feather="cpu" class="text-purple-600 w-5 h-5"></i>
|
| 261 |
+
</div>
|
| 262 |
+
<div>
|
| 263 |
+
<p class="font-medium">LLM response generated</p>
|
| 264 |
+
<p class="text-sm text-gray-500">8 minutes ago</p>
|
| 265 |
+
</div>
|
| 266 |
+
</div>
|
| 267 |
+
</div>
|
| 268 |
+
</div>
|
| 269 |
+
</div>
|
| 270 |
+
</div>
|
| 271 |
+
</div>
|
| 272 |
+
</main>
|
| 273 |
+
|
| 274 |
+
<!-- Footer -->
|
| 275 |
+
<footer class="bg-gray-100 border-t py-6">
|
| 276 |
+
<div class="container mx-auto px-4">
|
| 277 |
+
<div class="flex flex-col md:flex-row justify-between items-center">
|
| 278 |
+
<div class="flex items-center space-x-2 mb-4 md:mb-0">
|
| 279 |
+
<i data-feather="code" class="text-indigo-600"></i>
|
| 280 |
+
<span class="text-gray-700">TigressTech AI v1.0.0</span>
|
| 281 |
+
</div>
|
| 282 |
+
<div class="flex space-x-6">
|
| 283 |
+
<a href="#" class="text-gray-600 hover:text-indigo-600 transition">
|
| 284 |
+
<i data-feather="github"></i>
|
| 285 |
+
</a>
|
| 286 |
+
<a href="#" class="text-gray-600 hover:text-indigo-600 transition">
|
| 287 |
+
<i data-feather="twitter"></i>
|
| 288 |
+
</a>
|
| 289 |
+
<a href="#" class="text-gray-600 hover:text-indigo-600 transition">
|
| 290 |
+
<i data-feather="mail"></i>
|
| 291 |
+
</a>
|
| 292 |
+
</div>
|
| 293 |
+
</div>
|
| 294 |
+
</div>
|
| 295 |
+
</footer>
|
| 296 |
+
</div>
|
| 297 |
+
|
| 298 |
+
<script>
|
| 299 |
+
feather.replace();
|
| 300 |
+
|
| 301 |
+
// Simple animation for message bubbles
|
| 302 |
+
document.addEventListener('DOMContentLoaded', function() {
|
| 303 |
+
anime({
|
| 304 |
+
targets: '.message-bubble',
|
| 305 |
+
opacity: [0, 1],
|
| 306 |
+
translateY: [20, 0],
|
| 307 |
+
duration: 800,
|
| 308 |
+
delay: anime.stagger(100)
|
| 309 |
+
});
|
| 310 |
+
});
|
| 311 |
+
</script>
|
| 312 |
+
</body>
|
| 313 |
</html>
|