Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -175,56 +175,7 @@ with gr.Blocks(title="Groq Chat Interface", theme=gr.themes.Soft(), css="""
|
|
| 175 |
inputs=[topic_input],
|
| 176 |
outputs=[history_output]
|
| 177 |
)
|
| 178 |
-
|
| 179 |
-
with gr.Tab("π§ API Tools"):
|
| 180 |
-
gr.Markdown("### API Configuration & Testing")
|
| 181 |
-
|
| 182 |
-
# API Status
|
| 183 |
-
api_status = gr.Markdown(f"""
|
| 184 |
-
**π API Status:** {'β
Ready' if API_KEY else 'β No API Key Set'}
|
| 185 |
-
**π Endpoint:** `{API_URL}`
|
| 186 |
-
**π€ Available Models:**
|
| 187 |
-
- `llama-3.3-70b-versatile` (Default - Most Capable)
|
| 188 |
-
- `llama3-8b-8192` (Fast)
|
| 189 |
-
- `llama3-70b-8192` (Balanced)
|
| 190 |
-
- `mixtral-8x7b-32768` (Long Context)
|
| 191 |
-
""")
|
| 192 |
-
|
| 193 |
-
# cURL Generator
|
| 194 |
-
gr.Markdown("### π Generate cURL Command")
|
| 195 |
-
curl_btn = gr.Button("π Generate cURL Example", variant="primary")
|
| 196 |
-
curl_output = gr.Code(
|
| 197 |
-
label="cURL Command",
|
| 198 |
-
language="shell",
|
| 199 |
-
lines=8
|
| 200 |
-
)
|
| 201 |
-
curl_btn.click(manual_curl_example, outputs=[curl_output])
|
| 202 |
-
|
| 203 |
-
# Setup Instructions
|
| 204 |
-
if not API_KEY:
|
| 205 |
-
gr.Markdown("""
|
| 206 |
-
### β οΈ Setup Required
|
| 207 |
-
|
| 208 |
-
**To use this interface:**
|
| 209 |
-
1. π Get your API key from [Groq Console](https://console.groq.com/)
|
| 210 |
-
2. π» Set environment variable:
|
| 211 |
-
```bash
|
| 212 |
-
export GROQ_API_KEY="your-groq-api-key-here"
|
| 213 |
-
```
|
| 214 |
-
3. π Restart the application
|
| 215 |
-
|
| 216 |
-
**Alternative:** Set in your system environment or `.env` file
|
| 217 |
-
""")
|
| 218 |
-
else:
|
| 219 |
-
gr.Markdown("""
|
| 220 |
-
### β
Ready to Chat!
|
| 221 |
-
|
| 222 |
-
**Tips for better conversations:**
|
| 223 |
-
- π― Use specific topics to organize conversations
|
| 224 |
-
- π Enable summarization for long conversations
|
| 225 |
-
- π Check history to review past interactions
|
| 226 |
-
- π‘ Try different models in the API for various needs
|
| 227 |
-
""")
|
| 228 |
|
| 229 |
# Launch message
|
| 230 |
print("π Starting Groq Chat Interface...")
|
|
|
|
| 175 |
inputs=[topic_input],
|
| 176 |
outputs=[history_output]
|
| 177 |
)
|
| 178 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 179 |
|
| 180 |
# Launch message
|
| 181 |
print("π Starting Groq Chat Interface...")
|