File size: 640 Bytes
69643b3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import streamlit as st
from modules import model_selection, retrieve_query


# Streamlit functions to select the model
model, api_key = model_selection()

# RAG CHATBOT Interface
st.header("Rag Chatbot")
st.divider()
#-----------------------------------------------------
query = st.chat_input(placeholder="Enter Your Message")
if query:
    user_message = st.chat_message("User").write(query)
    response = retrieve_query(
        query=query, 
        df="Data/products.csv",
        column="product_info",
        api_key=api_key,
        model=model
        )
    ai_message = st.chat_message("AI").write(response)