-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
31 lines (21 loc) · 754 Bytes
/
app.py
File metadata and controls
31 lines (21 loc) · 754 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from dotenv import load_dotenv
load_dotenv()
import streamlit as st
import os
import google.generativeai as genai
genai.configure(api_key='Keep_API_KEY')
model = genai.GenerativeModel('gemini-1.5-flash')
# Function for generating output from our gemini pro model
def get_gemini_response(question):
response = model.generate_content(question)
return response.text
# Streamlit app
st.set_page_config(page_title="Gemini Question answer testing")
st.header("Gemini LLM model by Vaibhav")
input = st.text_input('Input:',key='input')
submit = st.button('Ask your question')
# when submit is clicked
if submit:
response = get_gemini_response(input)
st.subheader('Your response is')
st.write(response)