diff --git a/src/core/routes/test.py b/src/core/routes/test.py index de5cd01..91b5396 100644 --- a/src/core/routes/test.py +++ b/src/core/routes/test.py @@ -31,6 +31,16 @@ class RequestConversation(BaseModel): "How to ensure data privacy in Hyperledger Fabric?": "To ensure data privacy in Hyperledger Fabric:\n1. Use private data collections to restrict access to sensitive data.\n2. Implement access control policies and endorsement policies.\n3. Utilize encryption for data at rest and in transit.\n4. Regularly review and update security configurations and practices.", } +@router.get("/response-keys", response_model=List[Dict[str, str]]) +async def get_response_keys() -> List[Dict[str, str]]: + + # Create a list of dictionaries with 'id' and 'name' keys + res =[ + {"id": str(index + 1), "name": key} + for index, key in enumerate(responses.keys()) +] + return res + def get_hyperledger_fabric_answer(question): return responses.get(question, "Question not found in the database.") diff --git a/src/frontend/components/chat-page.tsx b/src/frontend/components/chat-page.tsx index bdbfe7b..5a5b676 100644 --- a/src/frontend/components/chat-page.tsx +++ b/src/frontend/components/chat-page.tsx @@ -3,6 +3,8 @@ import React, { useState } from 'react'; import ChatHeader from './chat-header'; import { Message } from '@/lib/types'; +import { Suspense } from 'react'; +import WelcomeSection from './welcome-section'; import ChatBottomBar from './chat-bottom-bar'; import ChatSection from './chat-section'; @@ -27,6 +29,12 @@ const ChatPage = (props: Props) => {
+ + {messages.length === 0 && ( + Loading....

}> + +
+ )}
diff --git a/src/frontend/components/sidebar.tsx b/src/frontend/components/sidebar.tsx index 663f802..3553c5d 100644 --- a/src/frontend/components/sidebar.tsx +++ b/src/frontend/components/sidebar.tsx @@ -103,16 +103,9 @@ const Sidebar = (props: Props) => {