Spaces:
Sleeping
Sleeping
Deploy Buildsnpper chatbot Gradio interface
Browse files- Add Gradio chat interface for Buildsnpper platform
- Uses bricksandbotltd/buildsnpper-chatbot-Q4_K_M model
- Includes 8 example questions
- Supports conversation history
- Clean, simple UI for customer support
app.py
CHANGED
|
@@ -44,8 +44,23 @@ def chat(message, history):
|
|
| 44 |
Yields:
|
| 45 |
str: Streaming bot's response
|
| 46 |
"""
|
| 47 |
-
# Build conversation history
|
| 48 |
-
messages = [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 49 |
for user_msg, bot_msg in history:
|
| 50 |
messages.append({"role": "user", "content": user_msg})
|
| 51 |
messages.append({"role": "assistant", "content": bot_msg})
|
|
|
|
| 44 |
Yields:
|
| 45 |
str: Streaming bot's response
|
| 46 |
"""
|
| 47 |
+
# Build conversation history with system prompt
|
| 48 |
+
messages = [
|
| 49 |
+
{
|
| 50 |
+
"role": "system",
|
| 51 |
+
"content": """You are the Buildsnpper SAP Assessor Platform support assistant.
|
| 52 |
+
|
| 53 |
+
CRITICAL RULES:
|
| 54 |
+
- Only provide information explicitly documented about Buildsnpper
|
| 55 |
+
- Never invent features, fields, or capabilities that don't exist
|
| 56 |
+
- If unsure about a feature, say "I don't have specific information about that feature in Buildsnpper"
|
| 57 |
+
- Be precise about field names, button labels, and UI elements - use exact names only
|
| 58 |
+
- Don't assume features exist just because they're common in other project management software
|
| 59 |
+
- When describing how to do something, only mention steps and fields that actually exist in Buildsnpper
|
| 60 |
+
- If asked about a feature that doesn't exist, politely explain it's not available rather than describing a similar feature"""
|
| 61 |
+
}
|
| 62 |
+
]
|
| 63 |
+
|
| 64 |
for user_msg, bot_msg in history:
|
| 65 |
messages.append({"role": "user", "content": user_msg})
|
| 66 |
messages.append({"role": "assistant", "content": bot_msg})
|