Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
import streamlit as st
|
2 |
from streamlit_chat import message
|
3 |
-
from
|
4 |
from langchain.chains import ConversationChain
|
5 |
from langchain.chains.conversation.memory import (ConversationBufferMemory,
|
6 |
ConversationSummaryMemory,
|
@@ -24,7 +24,7 @@ st.sidebar.title("😎")
|
|
24 |
st.session_state['API_Key']= st.sidebar.text_input("What's your API key?",type="password")
|
25 |
summarise_button = st.sidebar.button("Summarise the conversation", key="summarise")
|
26 |
if summarise_button:
|
27 |
-
summarise_placeholder = st.sidebar.write("Nice chatting with you my friend ❤️:\n\n"
|
28 |
#summarise_placeholder.write("Nice chatting with you my friend ❤️:\n\n"+st.session_state['conversation'].memory.buffer)
|
29 |
|
30 |
#import os
|
@@ -34,10 +34,10 @@ def getresponse(userInput, api_key):
|
|
34 |
|
35 |
if st.session_state['conversation'] is None:
|
36 |
|
37 |
-
llm =
|
38 |
temperature=0,
|
39 |
openai_api_key=api_key,
|
40 |
-
model_name='
|
41 |
)
|
42 |
|
43 |
st.session_state['conversation'] = ConversationChain(
|
|
|
1 |
import streamlit as st
|
2 |
from streamlit_chat import message
|
3 |
+
from langchain_openai import ChatOpenAI
|
4 |
from langchain.chains import ConversationChain
|
5 |
from langchain.chains.conversation.memory import (ConversationBufferMemory,
|
6 |
ConversationSummaryMemory,
|
|
|
24 |
st.session_state['API_Key']= st.sidebar.text_input("What's your API key?",type="password")
|
25 |
summarise_button = st.sidebar.button("Summarise the conversation", key="summarise")
|
26 |
if summarise_button:
|
27 |
+
summarise_placeholder = st.sidebar.write("Nice chatting with you my friend ❤️:\n\n")
|
28 |
#summarise_placeholder.write("Nice chatting with you my friend ❤️:\n\n"+st.session_state['conversation'].memory.buffer)
|
29 |
|
30 |
#import os
|
|
|
34 |
|
35 |
if st.session_state['conversation'] is None:
|
36 |
|
37 |
+
llm = ChatOpenAI(
|
38 |
temperature=0,
|
39 |
openai_api_key=api_key,
|
40 |
+
model_name='gpt-3.5-turbo'
|
41 |
)
|
42 |
|
43 |
st.session_state['conversation'] = ConversationChain(
|