Spaces:
Build error
Build error
Update pages/2_🧠_context_aware_chatbot.py
Browse files
pages/2_🧠_context_aware_chatbot.py
CHANGED
|
@@ -18,7 +18,8 @@ class ContextChatbot:
|
|
| 18 |
|
| 19 |
@st.cache_resource
|
| 20 |
def setup_chain(_self):
|
| 21 |
-
|
|
|
|
| 22 |
llm = ChatOpenAI(model_name=_self.openai_model, temperature=0, streaming=True)
|
| 23 |
chain = ConversationChain(llm=llm, memory=memory, verbose=True)
|
| 24 |
return chain
|
|
|
|
| 18 |
|
| 19 |
@st.cache_resource
|
| 20 |
def setup_chain(_self):
|
| 21 |
+
summarizer = ChatOpenAI(model_name= "gpt-4o", temperature=0, streaming=True)
|
| 22 |
+
memory = ConversationSummaryMemory(llm = summarizer)
|
| 23 |
llm = ChatOpenAI(model_name=_self.openai_model, temperature=0, streaming=True)
|
| 24 |
chain = ConversationChain(llm=llm, memory=memory, verbose=True)
|
| 25 |
return chain
|