Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -7,7 +7,7 @@ from dotenv import load_dotenv
|
|
7 |
load_dotenv()
|
8 |
|
9 |
# Retrieve API key from environment variable
|
10 |
-
GEMINI_API_KEY =
|
11 |
|
12 |
# Configure Google Gemini API
|
13 |
genai.configure(api_key=GEMINI_API_KEY)
|
@@ -67,12 +67,12 @@ with gr.Blocks(theme="Hev832/Applio") as iface:
|
|
67 |
chat_history_state = gr.State([]) # State input for chat history
|
68 |
response_output = gr.Textbox(label="Response")
|
69 |
|
70 |
-
|
|
|
|
|
71 |
fn=generate_response,
|
72 |
inputs=[chat_input, chat_history_state],
|
73 |
-
outputs=[response_output, chat_history_state]
|
74 |
-
title="Shadow Chat",
|
75 |
-
description="<center>Chat with Shadow the Hedgehog!</center>"
|
76 |
)
|
77 |
|
78 |
iface.launch()
|
|
|
7 |
load_dotenv()
|
8 |
|
9 |
# Retrieve API key from environment variable
|
10 |
+
GEMINI_API_KEY = "AIzaSyA0SnGcdEuesDusLiM93N68-vaFF14RCYg" # public api
|
11 |
|
12 |
# Configure Google Gemini API
|
13 |
genai.configure(api_key=GEMINI_API_KEY)
|
|
|
67 |
chat_history_state = gr.State([]) # State input for chat history
|
68 |
response_output = gr.Textbox(label="Response")
|
69 |
|
70 |
+
# Define the layout and components
|
71 |
+
generate_button = gr.Button("Generate Response")
|
72 |
+
generate_button.click(
|
73 |
fn=generate_response,
|
74 |
inputs=[chat_input, chat_history_state],
|
75 |
+
outputs=[response_output, chat_history_state]
|
|
|
|
|
76 |
)
|
77 |
|
78 |
iface.launch()
|