lalitwale100's picture
Create app.py
0bc8da8 verified
raw
history blame contribute delete
839 Bytes
from langchain_google_genai import ChatGoogleGenerativeAI
from dotenv import load_dotenv
import streamlit as st
import os
from PIL import Image
load_dotenv()
logo = Image.open('icon.jfif')
st.set_page_config(page_title = 'ChatBot', page_icon = logo)
st.markdown("<h1 style='text-align:center; color:black;'>ChatBot using LangChain</h1>", unsafe_allow_html = True)
with open('style1.css') as f:
st.markdown(f'<style>{f.read()}</style>', unsafe_allow_html=True)
input = st.text_input('Please enter your input here:')
response_button = st.button('Get Response', type = 'primary')
if response_button:
llm = ChatGoogleGenerativeAI(model="gemini-2.0-flash-lite", temperature=0.3, google_api_key=os.getenv('GOOGLE_API_KEY'))
response = llm.invoke(input).content
st.subheader('The response is')
st.write(response)