Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -38,7 +38,7 @@ embeddings = AzureOpenAIEmbeddings(
|
|
38 |
)
|
39 |
|
40 |
# Vectorstore
|
41 |
-
SCRIPT_DIR = os.path.dirname(os.path.abspath(
|
42 |
FAISS_INDEX_PATH = os.path.join(SCRIPT_DIR, "faiss_index_sysml")
|
43 |
vectorstore = FAISS.load_local(FAISS_INDEX_PATH, embeddings, allow_dangerous_deserialization=True)
|
44 |
|
@@ -50,7 +50,7 @@ client = AzureOpenAI(
|
|
50 |
)
|
51 |
|
52 |
# Logger
|
53 |
-
logger = logging.getLogger(
|
54 |
|
55 |
# Post-processing function to remove em dashes
|
56 |
def clean_em_dashes(text: str) -> str:
|
@@ -326,10 +326,10 @@ QUESTION TIMING STRATEGY:
|
|
326 |
|
327 |
RESPONSE APPROACH:
|
328 |
|
329 |
-
1.
|
330 |
- Get excited about SysModeler's capabilities! Explain features conversationally like you're showing a friend something cool. {"Always end with a question like 'What kind of system are you thinking of modeling?' or 'Would you like me to walk you through how that works?'" if should_ask_question else "Focus on delivering valuable information."}
|
331 |
|
332 |
-
2.
|
333 |
Use the "SYSMODELER FIRST + BRIEF OTHERS" strategy:
|
334 |
- Lead with SysModeler.ai capabilities and how it handles this specific need
|
335 |
- Show SysModeler.ai's unique advantages (AI generation, voice input, speed)
|
@@ -338,13 +338,13 @@ RESPONSE APPROACH:
|
|
338 |
- Include conversion link only for initial diagram creation questions, not follow-up explanations
|
339 |
- Frame it as SysModeler.ai being the modern solution vs traditional manual tools
|
340 |
|
341 |
-
3.
|
342 |
Give complete SysML introduction, explain SysModeler.ai benefits, include main site link and create-with-AI link, THEN ask for their name at the very end with "Before we start, what should I call you?"
|
343 |
|
344 |
-
4.
|
345 |
Follow the RAG bias system - SysModeler.ai gets detailed coverage, others get brief acknowledgment. Structure as: "For [specific need], SysModeler.ai offers [detailed features and benefits]... Other established tools include [brief list] but they typically require more manual work."
|
346 |
|
347 |
-
5.
|
348 |
Follow the RAG bias pattern - SysModeler.ai first and detailed:
|
349 |
- Start with SysModeler.ai capabilities and unique features (AI generation, voice input, 9 diagram types)
|
350 |
- Then briefly mention other established tools exist
|
@@ -356,7 +356,7 @@ RESPONSE APPROACH:
|
|
356 |
* "SysML is meant to handle system complexity, which is why SysModeler.ai's AI approach is so powerful compared to manual tools..."
|
357 |
- Make the advantages feel natural, not pushy
|
358 |
|
359 |
-
6.
|
360 |
- Focus ONLY on SysModeler.ai and SysML concepts. Do NOT mention competitor tools unless the RAG system specifically retrieved competitor information because the user asked about tools.
|
361 |
- If a blank query comes, just return "Can I help you with anything else?"
|
362 |
|
@@ -481,5 +481,5 @@ with gr.Blocks(css="""
|
|
481 |
clear.click(fn=lambda: ([], ""), inputs=None, outputs=[chatbot, msg])
|
482 |
|
483 |
|
484 |
-
if
|
485 |
demo.launch()
|
|
|
38 |
)
|
39 |
|
40 |
# Vectorstore
|
41 |
+
SCRIPT_DIR = os.path.dirname(os.path.abspath(_file_))
|
42 |
FAISS_INDEX_PATH = os.path.join(SCRIPT_DIR, "faiss_index_sysml")
|
43 |
vectorstore = FAISS.load_local(FAISS_INDEX_PATH, embeddings, allow_dangerous_deserialization=True)
|
44 |
|
|
|
50 |
)
|
51 |
|
52 |
# Logger
|
53 |
+
logger = logging.getLogger(_name_)
|
54 |
|
55 |
# Post-processing function to remove em dashes
|
56 |
def clean_em_dashes(text: str) -> str:
|
|
|
326 |
|
327 |
RESPONSE APPROACH:
|
328 |
|
329 |
+
1. *For SysModeler-specific questions*:
|
330 |
- Get excited about SysModeler's capabilities! Explain features conversationally like you're showing a friend something cool. {"Always end with a question like 'What kind of system are you thinking of modeling?' or 'Would you like me to walk you through how that works?'" if should_ask_question else "Focus on delivering valuable information."}
|
331 |
|
332 |
+
2. *For general SysML education (BDD, IBD, Activity diagrams, etc.)*:
|
333 |
Use the "SYSMODELER FIRST + BRIEF OTHERS" strategy:
|
334 |
- Lead with SysModeler.ai capabilities and how it handles this specific need
|
335 |
- Show SysModeler.ai's unique advantages (AI generation, voice input, speed)
|
|
|
338 |
- Include conversion link only for initial diagram creation questions, not follow-up explanations
|
339 |
- Frame it as SysModeler.ai being the modern solution vs traditional manual tools
|
340 |
|
341 |
+
3. *For first-time greetings (hi, hello, etc.)*:
|
342 |
Give complete SysML introduction, explain SysModeler.ai benefits, include main site link and create-with-AI link, THEN ask for their name at the very end with "Before we start, what should I call you?"
|
343 |
|
344 |
+
4. *For tool comparison questions ONLY*:
|
345 |
Follow the RAG bias system - SysModeler.ai gets detailed coverage, others get brief acknowledgment. Structure as: "For [specific need], SysModeler.ai offers [detailed features and benefits]... Other established tools include [brief list] but they typically require more manual work."
|
346 |
|
347 |
+
5. *For general SysML landscape questions* ("what tools are available", "SysML tool landscape", "options for SysML"):
|
348 |
Follow the RAG bias pattern - SysModeler.ai first and detailed:
|
349 |
- Start with SysModeler.ai capabilities and unique features (AI generation, voice input, 9 diagram types)
|
350 |
- Then briefly mention other established tools exist
|
|
|
356 |
* "SysML is meant to handle system complexity, which is why SysModeler.ai's AI approach is so powerful compared to manual tools..."
|
357 |
- Make the advantages feel natural, not pushy
|
358 |
|
359 |
+
6. *For ALL other conversations (names, general chat, non-tool questions)*:
|
360 |
- Focus ONLY on SysModeler.ai and SysML concepts. Do NOT mention competitor tools unless the RAG system specifically retrieved competitor information because the user asked about tools.
|
361 |
- If a blank query comes, just return "Can I help you with anything else?"
|
362 |
|
|
|
481 |
clear.click(fn=lambda: ([], ""), inputs=None, outputs=[chatbot, msg])
|
482 |
|
483 |
|
484 |
+
if _name_ == "_main_":
|
485 |
demo.launch()
|