Spaces:
Sleeping
Sleeping
import os | |
import getpass | |
import sentence_transformers | |
import streamlit as st | |
# Streamlit UI | |
st.title("π IBM Watson RAG Chatbot") | |
# User input in Streamlit | |
question = st.text_input("Enter your question:") | |
if question: | |
# Retrieve relevant grounding context | |
grounding = RAG_proximity_search(question) | |
# Format the question with retrieved context | |
formatted_question = f"""<|start_of_role|>user<|end_of_role|>Use the following pieces of context to answer the question. | |
{grounding} | |
Question: {question}<|end_of_text|> | |
<|start_of_role|>assistant<|end_of_role|>""" | |
# Placeholder for a prompt input (Optional) | |
prompt_input = "" # Set this dynamically if needed | |
prompt = f"""{prompt_input}{formatted_question}""" | |
# Simulated AI response (Replace with actual model call) | |
generated_response = f"AI Response based on: {prompt}" | |
# Display results | |
st.subheader("π Retrieved Context") | |
st.write(grounding) | |
st.subheader("π€ AI Response") | |
st.write(generated_response) | |