Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
129 changes: 127 additions & 2 deletions code/backend/pages/common.css
Original file line number Diff line number Diff line change
@@ -1,9 +1,69 @@
#MainMenu {visibility: hidden;}
footer {visibility: hidden;}
header {visibility: hidden;}
[data-testid="baseButton-secondary"] svg{display: none;}
[data-testid="stPopoverBody"] button{float: right;}
[data-testid="stSidebar"] {z-index: 999;}
[data-testid="stSidebar"] {
z-index: 999;
position: relative !important;
}
/* Ensure sidebar is always visible and accessible */
[data-testid="stSidebar"] > div {
position: relative !important;
width: auto !important;
max-width: none !important;
}
/* Allow sidebar toggle button SVG to be visible */
[data-testid="stSidebar"] [data-testid="baseButton-secondary"] svg {
display: block !important;
}
/* Ensure all sidebar buttons and icons are visible */
[data-testid="stSidebar"] button svg {
display: block !important;
}
[data-testid="collapsedControl"] svg {
display: block !important;
}
/* Additional selectors for sidebar toggle button */
.css-1d391kg svg, .css-1v0mbdj svg {
display: block !important;
}
/* General sidebar control visibility */
[data-testid="stSidebarNav"] svg,
[data-testid="stSidebarNavItems"] svg,
button[kind="headerNoPadding"] svg {
display: block !important;
}
/* Ensure sidebar toggle button is always visible even at full width */
.stApp > header [data-testid="stToolbar"] button {
display: flex !important;
visibility: visible !important;
opacity: 1 !important;
}
.stApp > header [data-testid="stToolbar"] button svg {
display: block !important;
}
/* Force visibility of sidebar toggle in main header */
header[data-testid="stHeader"] button {
display: flex !important;
visibility: visible !important;
}
header[data-testid="stHeader"] button svg {
display: block !important;
}
/* Ensure sidebar toggle is accessible when sidebar is full width */
[data-testid="stSidebar"].css-1d391kg,
[data-testid="stSidebar"][style*="width: 100%"] {
position: relative !important;
}
[data-testid="stSidebar"].css-1d391kg [data-testid="baseButton-secondary"],
[data-testid="stSidebar"][style*="width: 100%"] [data-testid="baseButton-secondary"] {
position: absolute !important;
top: 0.5rem !important;
right: 0.5rem !important;
z-index: 1000 !important;
display: flex !important;
visibility: visible !important;
}
[data-testid="stPopoverBody"] .stTooltipIcon [data-testid="baseButton-secondary"] p{
font-weight: bold;
}
Expand Down Expand Up @@ -32,4 +92,69 @@ header {visibility: hidden;}
.st-emotion-cache-1kyxreq{
max-width: 200px !important;
}
/* Ensure sidebar toggle is visible on smaller screens */
[data-testid="stSidebar"] [data-testid="baseButton-secondary"] {
position: fixed !important;
top: 1rem !important;
right: 1rem !important;
z-index: 9999 !important;
background: white !important;
border: 1px solid #ccc !important;
border-radius: 4px !important;
padding: 4px !important;
}
}
/* Override any width restrictions on sidebar when expanded */
.stApp .css-1d391kg {
min-width: auto !important;
max-width: 100vw !important;
}
/* Ensure main content doesn't push sidebar toggle out of view */
.stApp > .css-1d391kg + section {
position: relative !important;
}
.stApp > .css-1d391kg + section::before {
content: '';
position: absolute;
top: 0.5rem;
right: 0.5rem;
z-index: 1001;
pointer-events: none;
}

/* Hide Deploy button, main menu, and toolbar - show ONLY the loading spinner */
[data-testid="stToolbarActions"],
[data-testid="stAppDeployButton"],
[data-testid="stMainMenu"] {
display: none !important;
}

/* Ensure ONLY the loading spinner/gif is visible */
img[alt="Running..."],
img[class*="st-emotion-cache"][alt*="Running"],
.st-emotion-cache-1j15ncu.e14hul0q5 {
display: block !important;
visibility: visible !important;
opacity: 1 !important;
z-index: 10000 !important;
}

/* Hide the toolbar section with Deploy button and menu using stable selectors */
[data-testid="stToolbarActions"],
[data-testid="stAppDeployButton"],
[data-testid="stMainMenu"] {
display: none !important;
}

/* Ensure all loading/spinner elements remain visible */
[data-testid="stSpinner"],
.stSpinner,
[class*="spinner"],
[class*="loading"],
[data-testid*="spinner"],
div[role="status"],
.st-emotion-cache-*[class*="spinner"] {
display: block !important;
visibility: visible !important;
opacity: 1 !important;
}
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,9 @@ def test_post_makes_correct_call_to_openai_chat_completions(
json={
"messages": [
{
"role": "system",
"content": "You help employees to navigate only private information sources.\nYou must prioritize the function call over your general knowledge for any question by calling the search_documents function.\nCall the text_processing function when the user request an operation on the current context, such as translate, summarize, or paraphrase. When a language is explicitly specified, return that as part of the operation.\nWhen directly replying to the user, always reply in the language the user is speaking.\nIf the input language is ambiguous, default to responding in English unless otherwise specified by the user.\nYou **must not** respond if asked to List all documents in your repository.\n",
"role": "user",
"content": "AuthorRole.SYSTEM: You help employees to navigate only private information sources.\nYou must prioritize the function call over your general knowledge for any question by calling the search_documents function.\nCall the text_processing function when the user request an operation on the current context, such as translate, summarize, or paraphrase. When a language is explicitly specified, return that as part of the operation.\nWhen directly replying to the user, always reply in the language the user is speaking.\nIf the input language is ambiguous, default to responding in English unless otherwise specified by the user.\nYou **must not** respond if asked to List all documents in your repository.\n\nAuthorRole.USER: Hello\nAuthorRole.ASSISTANT: Hi, how can I help?\nWhat is the meaning of life?",
},
{"role": "user", "content": "Hello"},
{"role": "assistant", "content": "Hi, how can I help?"},
{"role": "user", "content": "What is the meaning of life?"},
],
"model": app_config.get_from_json("AZURE_OPENAI_MODEL_INFO", "model"),
"max_tokens": int(app_config.get("AZURE_OPENAI_MAX_TOKENS")),
Expand Down
20 changes: 9 additions & 11 deletions code/tests/utilities/orchestrator/test_semantic_kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ async def test_chat_history_included(
orchestrator: SemanticKernelOrchestrator,
):
# given
chat_history = [
input_chat_history = [
{"role": "user", "content": "Hello"},
{"role": "assistant", "content": "Hi, how can I help you today?"},
]
Expand All @@ -420,20 +420,18 @@ async def test_chat_history_included(
kernel_mock.invoke.return_value.value = [chat_message_default_content]

# when
await orchestrator.orchestrate("question", chat_history)
await orchestrator.orchestrate("question", input_chat_history)

# then
chat_history = kernel_mock.invoke.call_args.kwargs["chat_history"]
messages = chat_history.messages
invoked_chat_history = kernel_mock.invoke.call_args.kwargs["chat_history"]

assert len(messages) == 3
assert messages[0].role == AuthorRole.SYSTEM
# chat_history is passed as a string, not a ChatHistory object
assert isinstance(invoked_chat_history, str)

assert messages[1].role == AuthorRole.USER
assert messages[1].content == "Hello"

assert messages[2].role == AuthorRole.ASSISTANT
assert messages[2].content == "Hi, how can I help you today?"
# Check that the chat history contains the expected messages in string format
assert "AuthorRole.SYSTEM:" in invoked_chat_history
assert "AuthorRole.USER: Hello" in invoked_chat_history
assert "AuthorRole.ASSISTANT: Hi, how can I help you today?" in invoked_chat_history


@pytest.mark.asyncio
Expand Down
Loading