Spaces:
Runtime error
Runtime error
app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
GNU nano 8.3 ossy1.py
|
| 2 |
+
import gradio as gr
|
| 3 |
+
import requests
|
| 4 |
+
import json
|
| 5 |
+
import os
|
| 6 |
+
from dotenv import load_dotenv
|
| 7 |
+
|
| 8 |
+
# Load environment variables for API key
|
| 9 |
+
load_dotenv()
|
| 10 |
+
|
| 11 |
+
# Get API key from environment variables - this is now hidden from users
|
| 12 |
+
OPENROUTER_API_KEY = os.environ.get("OPENROUTER_API_KEY", "")
|
| 13 |
+
if not OPENROUTER_API_KEY:
|
| 14 |
+
print("Warning: OPENROUTER_API_KEY not found in environment variables.")
|
| 15 |
+
print("Please set it before running the app or the app won't function.")
|
| 16 |
+
|
| 17 |
+
def answer_bible_question(question, temperature=0.7, max_tokens=1000):
|
| 18 |
+
"""
|
| 19 |
+
Send a Bible question to the DeepSeek model via OpenRouter API
|
| 20 |
+
and return the response.
|
| 21 |
+
"""
|
| 22 |
+
[ Read 176 lines ]
|
| 23 |
+
^G Help ^O Write Out ^F Where Is ^K Cut ^T Execute ^C Location
|
| 24 |
+
^X Exit ^R Read File ^\ Replace ^U Paste ^J Justify ^/ Go To Line
|