File size: 839 Bytes
0bc8da8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
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)