-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathHome.py
More file actions
44 lines (38 loc) · 1.19 KB
/
Home.py
File metadata and controls
44 lines (38 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import asyncio
import uuid
import nest_asyncio # type: ignore
import streamlit as st
from app.chat.ui.chat_ui import ChatUI
from internal.di.container import Container
nest_asyncio.apply()
async def main() -> None:
st.set_page_config(
page_title="Home",
layout="wide",
page_icon="👋",
menu_items={
'Get Help': 'https://my_website.com/help',
'Report a bug': "https://my_website.com/bug",
'About': "# This is a header. This is an *extremely* cool app!"
}
)
st.title("Welcome to Local RAG! 👋")
query_params = st.query_params
di = Container()
chat_service = di.chat_service()
file_service = di.file_service()
message_service = di.message_service()
ai_service = di.ai_service()
if "chat_id" in query_params:
chat_id = uuid.UUID(query_params["chat_id"])
await ChatUI.view(
chat_id=chat_id,
chat_service=chat_service,
file_service=file_service,
message_service=message_service,
ai_service=ai_service,
)
else:
await ChatUI.list(chat_service=chat_service)
if __name__ == "__main__":
asyncio.run(main())