Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,4 +1,6 @@
|
|
| 1 |
from langchain_community.chat_models import ChatOpenAI
|
|
|
|
|
|
|
| 2 |
from langchain.chains import ConversationChain
|
| 3 |
from langchain.chains.conversation.memory import (ConversationBufferMemory,
|
| 4 |
ConversationSummaryMemory,
|
|
@@ -8,6 +10,16 @@ from langchain.chains.conversation.memory import (ConversationBufferMemory,
|
|
| 8 |
import tiktoken
|
| 9 |
from langchain.memory import ConversationTokenBufferMemory
|
| 10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
llm = ChatOpenAI(
|
| 12 |
temperature=0,
|
| 13 |
model_name='gpt-3.5-turbo-0125'
|
|
|
|
| 1 |
from langchain_community.chat_models import ChatOpenAI
|
| 2 |
+
import streamlit as st
|
| 3 |
+
from streamlit_chat import message
|
| 4 |
from langchain.chains import ConversationChain
|
| 5 |
from langchain.chains.conversation.memory import (ConversationBufferMemory,
|
| 6 |
ConversationSummaryMemory,
|
|
|
|
| 10 |
import tiktoken
|
| 11 |
from langchain.memory import ConversationTokenBufferMemory
|
| 12 |
|
| 13 |
+
|
| 14 |
+
st.set_page_config(page_title="Chat with me")
|
| 15 |
+
st.markdown("<h1 style= 'text_align : center;'>How can I assist you? </h1>", unsafe_allow_html = True)
|
| 16 |
+
|
| 17 |
+
st.sidebar.title(":)")
|
| 18 |
+
api_key = st.sidebar.text_input("Enter you API key",type = "password")
|
| 19 |
+
summarise_button = st.sidebar.button("Summarise",type = "summarise")
|
| 20 |
+
if summarise_button:
|
| 21 |
+
summarise_placeholder = st.sidebar.write("Thanks for chatting \n\n"+"Hi Friend")
|
| 22 |
+
|
| 23 |
llm = ChatOpenAI(
|
| 24 |
temperature=0,
|
| 25 |
model_name='gpt-3.5-turbo-0125'
|