File size: 640 Bytes
b884933
 
 
472ca28
f16688d
 
b884933
472ca28
b884933
f16688d
 
 
472ca28
 
 
 
f16688d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
32
33
import os

import streamlit as st
import
from langchain_openai import OpenAI
from langchain_core.prompts import ChatPromptTemplate


st.title("Chat with your data")

inp = st.text_input("Enter your prompt here")

llm = OpenAI(
    api_key=os.environ.get("OPENAI_API_KEY"), 
    temperature=0.2,
    model='gpt-3.5-turbo-0125')

# prompt = ChatPromptTemplate.from_messages(
#     [
#         (
#             "system",
#             "You are a helpful assistant that answer questions from user.",
#         ),
#         ("human", "{input}"),
#     ]
# )

chain = llm
if inp:
    response = chain.invoke(input=inp)
    st.write(response)