Rajesh Karra
commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,11 +1,12 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
import requests
|
|
|
|
| 3 |
|
| 4 |
-
#
|
| 5 |
-
GEMINI_API_KEY = "
|
| 6 |
|
| 7 |
def query_gemini(prompt):
|
| 8 |
-
url = "https://generativelanguage.googleapis.com/v1beta/models/gemini-
|
| 9 |
headers = {
|
| 10 |
"Content-Type": "application/json"
|
| 11 |
}
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import requests
|
| 3 |
+
import os
|
| 4 |
|
| 5 |
+
# Retrieve the API key from the environment variable
|
| 6 |
+
GEMINI_API_KEY = os.getenv("GEMINI_API_KEY")
|
| 7 |
|
| 8 |
def query_gemini(prompt):
|
| 9 |
+
url = "https://generativelanguage.googleapis.com/v1beta/models/gemini-pro:generateContent"
|
| 10 |
headers = {
|
| 11 |
"Content-Type": "application/json"
|
| 12 |
}
|