Update app.py
Browse files
app.py
CHANGED
|
@@ -1,25 +1,26 @@
|
|
| 1 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
-
|
| 4 |
-
import os
|
| 5 |
-
from groq import Groq
|
| 6 |
|
| 7 |
-
|
| 8 |
-
groq_client = Groq(api_key=os.environ.get("GROQ_API_KEY"))
|
| 9 |
|
| 10 |
-
|
| 11 |
-
async def start_chat():
|
| 12 |
-
await cl.Message(content="👋 Hello! I am your Chainlit + Groq AI Assistant. Ask me anything!").send()
|
| 13 |
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
)
|
| 24 |
-
reply = response.choices[0].message.content
|
| 25 |
-
await cl.Message(content=reply).send()
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: "Chainlit Groq Chatbot"
|
| 3 |
+
emoji: "🤖"
|
| 4 |
+
colorFrom: "blue"
|
| 5 |
+
colorTo: "green"
|
| 6 |
+
sdk: "chainlit"
|
| 7 |
+
sdk_version: "0.7.600" # Optional: You can omit or update this version
|
| 8 |
+
app_file: "app.py"
|
| 9 |
+
pinned: false
|
| 10 |
+
---
|
| 11 |
|
| 12 |
+
# 🤖 Chainlit Chatbot with Groq API
|
|
|
|
|
|
|
| 13 |
|
| 14 |
+
This is a simple AI chatbot powered by Chainlit and the Groq API (LLaMA 3). Deployed on Hugging Face Spaces.
|
|
|
|
| 15 |
|
| 16 |
+
## How to Use
|
|
|
|
|
|
|
| 17 |
|
| 18 |
+
Just open the Space and start chatting! 🎉
|
| 19 |
+
|
| 20 |
+
## Setup Instructions (for contributors)
|
| 21 |
+
|
| 22 |
+
1. Create a secret key named `GROQ_API_KEY` in the Hugging Face Space settings.
|
| 23 |
+
2. Upload the following files:
|
| 24 |
+
- `app.py`
|
| 25 |
+
- `requirements.txt`
|
| 26 |
+
- `README.md`
|
|
|
|
|
|
|
|
|