Skip to content

Commit 384b72e

Browse files
committed
feat: Implement new layout and styling for the frontend application
- Added Layout component with responsive header and navigation. - Created Layout.module.css for styling the header, navigation links, and menu toggle. - Integrated LoginButton and menu toggle functionality. - Set up TypeScript configuration and Vite for the frontend build process. - Removed obsolete approaches related to chat retrieval and reading vision. - Updated backend paths in start scripts and Azure configuration.
1 parent 6c1f9e4 commit 384b72e

File tree

170 files changed

+51
-854
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

170 files changed

+51
-854
lines changed
File renamed without changes.
File renamed without changes.

app/hrchatbot/backend/Dockerfile renamed to app/backend/Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,10 @@ WORKDIR /app
3030
# Copy application code
3131
COPY . .
3232

33-
# Ensure we use the venv
33+
# Ensure we use the venv and set Python path
3434
ENV PATH="/app/.venv/bin:$PATH"
35+
ENV PYTHONPATH="/app:$PYTHONPATH"
3536

3637
# Run the application
3738
EXPOSE 8000
38-
CMD ["python", "-m", "gunicorn", "-b", "0.0.0.0:8000", "main:app"]
39+
CMD ["python", "-m", "gunicorn", "-c", "gunicorn.conf.py", "hrchatbot.main:app"]

app/hrchatbot/backend/gunicorn.conf.py renamed to app/backend/gunicorn.conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@
1515
workers = 1
1616
else:
1717
workers = (num_cpus * 2) + 1
18-
worker_class = "custom_uvicorn_worker.CustomUvicornWorker"
18+
worker_class = "hrchatbot.custom_uvicorn_worker.CustomUvicornWorker"
File renamed without changes.

app/hrchatbot/backend/app.py renamed to app/backend/hrchatbot/app.py

Lines changed: 12 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,11 @@
5050
)
5151
from quart_cors import cors
5252

53-
from approaches.approach import Approach
54-
from approaches.chatreadretrieveread import ChatReadRetrieveReadApproach
55-
from approaches.chatreadretrievereadvision import ChatReadRetrieveReadVisionApproach
56-
from approaches.promptmanager import PromptyManager
57-
from approaches.retrievethenread import RetrieveThenReadApproach
58-
from approaches.retrievethenreadvision import RetrieveThenReadVisionApproach
59-
from chat_history.cosmosdb import chat_history_cosmosdb_bp
60-
from config import (
53+
from hrchatbot.approaches.approach import Approach
54+
from hrchatbot.approaches.chatreadretrieveread import ChatReadRetrieveReadApproach
55+
from hrchatbot.approaches.promptmanager import PromptyManager
56+
from hrchatbot.chat_history.cosmosdb import chat_history_cosmosdb_bp
57+
from hrchatbot.config import (
6158
CONFIG_AGENT_CLIENT,
6259
CONFIG_AGENTIC_RETRIEVAL_ENABLED,
6360
CONFIG_ASK_APPROACH,
@@ -90,18 +87,18 @@
9087
CONFIG_USER_UPLOAD_ENABLED,
9188
CONFIG_VECTOR_SEARCH_ENABLED,
9289
)
93-
from core.authentication import AuthenticationHelper
94-
from core.sessionhelper import create_session_id
95-
from decorators import authenticated, authenticated_path
96-
from error import error_dict, error_response
97-
from prepdocs import (
90+
from hrchatbot.core.authentication import AuthenticationHelper
91+
from hrchatbot.core.sessionhelper import create_session_id
92+
from hrchatbot.decorators import authenticated, authenticated_path
93+
from hrchatbot.error import error_dict, error_response
94+
from hrchatbot.prepdocs import (
9895
clean_key_if_exists,
9996
setup_embeddings_service,
10097
setup_file_processors,
10198
setup_search_info,
10299
)
103-
from prepdocslib.filestrategy import UploadUserFileStrategy
104-
from prepdocslib.listfilestrategy import File
100+
from hrchatbot.prepdocslib.filestrategy import UploadUserFileStrategy
101+
from hrchatbot.prepdocslib.listfilestrategy import File
105102

106103
bp = Blueprint("routes", __name__, static_folder="static")
107104
# Fix Windows registry issue with mimetypes
@@ -828,29 +825,6 @@ async def setup_clients():
828825

829826
prompt_manager = PromptyManager()
830827

831-
# Set up the two default RAG approaches for /ask and /chat
832-
# RetrieveThenReadApproach is used by /ask for single-turn Q&A
833-
current_app.config[CONFIG_ASK_APPROACH] = RetrieveThenReadApproach(
834-
search_client=search_client,
835-
search_index_name=AZURE_SEARCH_INDEX,
836-
agent_model=AZURE_OPENAI_SEARCHAGENT_MODEL,
837-
agent_deployment=AZURE_OPENAI_SEARCHAGENT_DEPLOYMENT,
838-
agent_client=agent_client,
839-
openai_client=openai_client,
840-
auth_helper=auth_helper,
841-
chatgpt_model=OPENAI_CHATGPT_MODEL,
842-
chatgpt_deployment=AZURE_OPENAI_CHATGPT_DEPLOYMENT,
843-
embedding_model=OPENAI_EMB_MODEL,
844-
embedding_deployment=AZURE_OPENAI_EMB_DEPLOYMENT,
845-
embedding_dimensions=OPENAI_EMB_DIMENSIONS,
846-
embedding_field=AZURE_SEARCH_FIELD_NAME_EMBEDDING,
847-
sourcepage_field=KB_FIELDS_SOURCEPAGE,
848-
content_field=KB_FIELDS_CONTENT,
849-
query_language=AZURE_SEARCH_QUERY_LANGUAGE,
850-
query_speller=AZURE_SEARCH_QUERY_SPELLER,
851-
prompt_manager=prompt_manager,
852-
reasoning_effort=OPENAI_REASONING_EFFORT,
853-
)
854828

855829
# ChatReadRetrieveReadApproach is used by /chat for multi-turn conversation
856830
current_app.config[CONFIG_CHAT_APPROACH] = ChatReadRetrieveReadApproach(
@@ -898,50 +872,6 @@ async def setup_clients():
898872
azure_credential, "https://cognitiveservices.azure.com/.default"
899873
)
900874

901-
current_app.config[CONFIG_ASK_VISION_APPROACH] = RetrieveThenReadVisionApproach(
902-
search_client=search_client,
903-
openai_client=openai_client,
904-
blob_container_client=blob_container_client,
905-
auth_helper=auth_helper,
906-
vision_endpoint=AZURE_VISION_ENDPOINT,
907-
vision_token_provider=token_provider,
908-
gpt4v_deployment=AZURE_OPENAI_GPT4V_DEPLOYMENT,
909-
gpt4v_model=AZURE_OPENAI_GPT4V_MODEL,
910-
embedding_model=OPENAI_EMB_MODEL,
911-
embedding_deployment=AZURE_OPENAI_EMB_DEPLOYMENT,
912-
embedding_dimensions=OPENAI_EMB_DIMENSIONS,
913-
embedding_field=AZURE_SEARCH_FIELD_NAME_EMBEDDING,
914-
sourcepage_field=KB_FIELDS_SOURCEPAGE,
915-
content_field=KB_FIELDS_CONTENT,
916-
query_language=AZURE_SEARCH_QUERY_LANGUAGE,
917-
query_speller=AZURE_SEARCH_QUERY_SPELLER,
918-
prompt_manager=prompt_manager,
919-
)
920-
921-
current_app.config[CONFIG_CHAT_VISION_APPROACH] = (
922-
ChatReadRetrieveReadVisionApproach(
923-
search_client=search_client,
924-
openai_client=openai_client,
925-
blob_container_client=blob_container_client,
926-
auth_helper=auth_helper,
927-
vision_endpoint=AZURE_VISION_ENDPOINT,
928-
vision_token_provider=token_provider,
929-
chatgpt_model=OPENAI_CHATGPT_MODEL,
930-
chatgpt_deployment=AZURE_OPENAI_CHATGPT_DEPLOYMENT,
931-
gpt4v_deployment=AZURE_OPENAI_GPT4V_DEPLOYMENT,
932-
gpt4v_model=AZURE_OPENAI_GPT4V_MODEL,
933-
embedding_model=OPENAI_EMB_MODEL,
934-
embedding_deployment=AZURE_OPENAI_EMB_DEPLOYMENT,
935-
embedding_dimensions=OPENAI_EMB_DIMENSIONS,
936-
embedding_field=AZURE_SEARCH_FIELD_NAME_EMBEDDING,
937-
sourcepage_field=KB_FIELDS_SOURCEPAGE,
938-
content_field=KB_FIELDS_CONTENT,
939-
query_language=AZURE_SEARCH_QUERY_LANGUAGE,
940-
query_speller=AZURE_SEARCH_QUERY_SPELLER,
941-
prompt_manager=prompt_manager,
942-
)
943-
)
944-
945875

946876
@bp.after_app_serving
947877
async def close_clients():

app/hrchatbot/backend/approaches/approach.py renamed to app/backend/hrchatbot/approaches/approach.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333
ChatCompletionToolParam,
3434
)
3535

36-
from approaches.promptmanager import PromptManager
37-
from core.authentication import AuthenticationHelper
36+
from hrchatbot.approaches.promptmanager import PromptManager
37+
from hrchatbot.core.authentication import AuthenticationHelper
3838

3939

4040
@dataclass

app/hrchatbot/backend/approaches/chatapproach.py renamed to app/backend/hrchatbot/approaches/chatapproach.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
ChatCompletionMessageParam,
1212
)
1313

14-
from approaches.approach import (
14+
from hrchatbot.approaches.approach import (
1515
Approach,
1616
ExtraInfo,
1717
)

app/hrchatbot/backend/approaches/chatreadretrieveread.py renamed to app/backend/hrchatbot/approaches/chatreadretrieveread.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
ChatCompletionToolParam,
1313
)
1414

15-
from approaches.approach import DataPoints, ExtraInfo, ThoughtStep
16-
from approaches.chatapproach import ChatApproach
17-
from approaches.promptmanager import PromptManager
18-
from core.authentication import AuthenticationHelper
15+
from hrchatbot.approaches.approach import DataPoints, ExtraInfo, ThoughtStep
16+
from hrchatbot.approaches.chatapproach import ChatApproach
17+
from hrchatbot.approaches.promptmanager import PromptManager
18+
from hrchatbot.core.authentication import AuthenticationHelper
1919

2020

2121
class ChatReadRetrieveReadApproach(ChatApproach):

0 commit comments

Comments
 (0)