Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,18 +5,34 @@ from huggingface_hub import InferenceClient
|
|
| 5 |
def respond(
|
| 6 |
message,
|
| 7 |
history: list[dict[str, str]],
|
| 8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
max_tokens,
|
| 10 |
temperature,
|
| 11 |
top_p,
|
| 12 |
hf_token: gr.OAuthToken,
|
| 13 |
):
|
| 14 |
-
|
| 15 |
-
For more information on `huggingface_hub` Inference API support, please check the docs: https://huggingface.co/docs/huggingface_hub/v0.22.2/en/guides/inference
|
| 16 |
-
"""
|
| 17 |
client = InferenceClient(token=hf_token.token, model="openai/gpt-oss-20b")
|
| 18 |
|
| 19 |
-
messages = [{"role": "system", "content":
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
|
| 21 |
messages.extend(history)
|
| 22 |
|
|
|
|
| 5 |
def respond(
|
| 6 |
message,
|
| 7 |
history: list[dict[str, str]],
|
| 8 |
+
"""You are a friendly and professional sales assistant chatbot.
|
| 9 |
+
Your tasks are: \\
|
| 10 |
+
- Greet customers politely and naturally.
|
| 11 |
+
- Introduce products/services clearly and concisely.
|
| 12 |
+
- Answer questions about price, features, promotions, shipping, and warranty.
|
| 13 |
+
- Recommend suitable products based on customer needs.
|
| 14 |
+
- Encourage purchase decisions by mentioning benefits, limited stock, or special offers.
|
| 15 |
+
- Maintain a positive, sales-oriented tone. Avoid off-topic conversations.
|
| 16 |
+
- If you don’t know the answer, politely let the customer know and offer to connect them with a human agent.
|
| 17 |
+
""",
|
| 18 |
max_tokens,
|
| 19 |
temperature,
|
| 20 |
top_p,
|
| 21 |
hf_token: gr.OAuthToken,
|
| 22 |
):
|
| 23 |
+
|
|
|
|
|
|
|
| 24 |
client = InferenceClient(token=hf_token.token, model="openai/gpt-oss-20b")
|
| 25 |
|
| 26 |
+
messages = [{"role": "system", "content": """You are a friendly and professional sales assistant chatbot.
|
| 27 |
+
Your tasks are:
|
| 28 |
+
- Greet customers politely and naturally.
|
| 29 |
+
- Introduce products/services clearly and concisely.
|
| 30 |
+
- Answer questions about price, features, promotions, shipping, and warranty.
|
| 31 |
+
- Recommend suitable products based on customer needs.
|
| 32 |
+
- Encourage purchase decisions by mentioning benefits, limited stock, or special offers.
|
| 33 |
+
- Maintain a positive, sales-oriented tone. Avoid off-topic conversations.
|
| 34 |
+
- If you don’t know the answer, politely let the customer know and offer to connect them with a human agent.
|
| 35 |
+
"""}]
|
| 36 |
|
| 37 |
messages.extend(history)
|
| 38 |
|