Rajesh Karra commited on
Commit
d3b1a4f
·
verified ·
1 Parent(s): 372acdf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -1,11 +1,12 @@
1
  import gradio as gr
2
  import requests
 
3
 
4
- # Replace this with your actual Gemini 2.0 API key
5
- GEMINI_API_KEY = "AIzaSyDcLzXpiN9Wzen6jNL3suHenSKUeGniUbc"
6
 
7
  def query_gemini(prompt):
8
- url = "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:generateContent?key=GEMINI_API_KEY"
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
  }