Spaces:
Sleeping
Sleeping
Commit
·
6c42dc2
1
Parent(s):
a40db2d
fix the issue
Browse files- app.py +4 -7
- backend/api/services/agent_orchestrator.py +9 -1
app.py
CHANGED
|
@@ -1393,14 +1393,11 @@ def search_knowledge_base(tenant_id: str, role: str, query: str):
|
|
| 1393 |
|
| 1394 |
|
| 1395 |
# Create Gradio interface
|
|
|
|
|
|
|
|
|
|
| 1396 |
with gr.Blocks(
|
| 1397 |
-
title="IntegraChat — MCP Autonomous Agent",
|
| 1398 |
-
theme=gr.themes.Soft(
|
| 1399 |
-
primary_hue="cyan",
|
| 1400 |
-
secondary_hue="blue",
|
| 1401 |
-
neutral_hue="slate",
|
| 1402 |
-
font=("Inter", "system-ui", "sans-serif")
|
| 1403 |
-
),
|
| 1404 |
css="""
|
| 1405 |
/* Global dark theme with simpler, basic colors */
|
| 1406 |
body, .gradio-container {
|
|
|
|
| 1393 |
|
| 1394 |
|
| 1395 |
# Create Gradio interface
|
| 1396 |
+
# Note: some Gradio versions (especially older ones) do not support the `theme` argument
|
| 1397 |
+
# on `Blocks`. To keep the Docker image compatible across environments, we rely on
|
| 1398 |
+
# custom CSS for styling instead of passing a `theme` kwarg here.
|
| 1399 |
with gr.Blocks(
|
| 1400 |
+
title="IntegraChat — MCP Autonomous Agent",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1401 |
css="""
|
| 1402 |
/* Global dark theme with simpler, basic colors */
|
| 1403 |
body, .gradio-container {
|
backend/api/services/agent_orchestrator.py
CHANGED
|
@@ -1894,6 +1894,14 @@ Answer:"""
|
|
| 1894 |
else:
|
| 1895 |
web_guidance_section = ""
|
| 1896 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1897 |
prompt = (
|
| 1898 |
f"<system>\n"
|
| 1899 |
f"You are an assistant helping tenant {req.tenant_id}. "
|
|
@@ -1923,7 +1931,7 @@ Answer:"""
|
|
| 1923 |
f"8. **Directness**: Get straight to the point - provide the answer the user needs without unnecessary preamble.\n"
|
| 1924 |
f"9. **Actionability**: If the question requires steps or actions, provide clear, actionable guidance.\n"
|
| 1925 |
f"10. **Citation**: When referencing specific sources, indicate which source(s) you used (e.g., '[RAG]', '[WEB]').\n"
|
| 1926 |
-
f"{
|
| 1927 |
f"</instructions>\n\n"
|
| 1928 |
f"If the information is incomplete, explain what can and cannot be concluded from the available data. "
|
| 1929 |
f"Focus on giving the user exactly what they need—clear guidance, accurate facts, and practical steps whenever possible.\n\n"
|
|
|
|
| 1894 |
else:
|
| 1895 |
web_guidance_section = ""
|
| 1896 |
|
| 1897 |
+
if has_web:
|
| 1898 |
+
brief_web_instruction = (
|
| 1899 |
+
"11. **Brief Web Content**: If using web search, keep that portion of the response brief "
|
| 1900 |
+
"(2-4 sentences). Add professional disclaimers for legal/medical/financial topics.\n"
|
| 1901 |
+
)
|
| 1902 |
+
else:
|
| 1903 |
+
brief_web_instruction = ""
|
| 1904 |
+
|
| 1905 |
prompt = (
|
| 1906 |
f"<system>\n"
|
| 1907 |
f"You are an assistant helping tenant {req.tenant_id}. "
|
|
|
|
| 1931 |
f"8. **Directness**: Get straight to the point - provide the answer the user needs without unnecessary preamble.\n"
|
| 1932 |
f"9. **Actionability**: If the question requires steps or actions, provide clear, actionable guidance.\n"
|
| 1933 |
f"10. **Citation**: When referencing specific sources, indicate which source(s) you used (e.g., '[RAG]', '[WEB]').\n"
|
| 1934 |
+
f"{brief_web_instruction}"
|
| 1935 |
f"</instructions>\n\n"
|
| 1936 |
f"If the information is incomplete, explain what can and cannot be concluded from the available data. "
|
| 1937 |
f"Focus on giving the user exactly what they need—clear guidance, accurate facts, and practical steps whenever possible.\n\n"
|