Spaces:
Sleeping
Sleeping
Kelechi Osuji
commited on
Commit
·
f2ceeeb
1
Parent(s):
dc44c22
Fixed some deprecated imports
Browse files- config.py +1 -1
- requirements.txt +3 -3
- workflow.py +2 -1
config.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
import os
|
2 |
-
from
|
3 |
from langchain.callbacks.streaming_stdout import StreamingStdOutCallbackHandler
|
4 |
|
5 |
|
|
|
1 |
import os
|
2 |
+
from langchain_community.chat_models import ChatOpenAI
|
3 |
from langchain.callbacks.streaming_stdout import StreamingStdOutCallbackHandler
|
4 |
|
5 |
|
requirements.txt
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
-
gradio>=3.39.0
|
2 |
-
langchain>=0.0.240
|
3 |
langchain_community>=0.0.3
|
|
|
|
|
4 |
openai>=0.27.8
|
5 |
-
requests>=2.28.2
|
6 |
python-dotenv>=1.0.0
|
|
|
|
|
|
|
|
1 |
langchain_community>=0.0.3
|
2 |
+
langchain>=0.0.240
|
3 |
+
gradio>=3.39.0
|
4 |
openai>=0.27.8
|
|
|
5 |
python-dotenv>=1.0.0
|
6 |
+
requests>=2.28.2
|
workflow.py
CHANGED
@@ -3,6 +3,7 @@ from langchain.prompts import PromptTemplate
|
|
3 |
from langchain.memory import ConversationBufferMemory
|
4 |
from config import get_chat_model
|
5 |
|
|
|
6 |
def get_workflow():
|
7 |
"""Set up the chatbot workflow with memory and prompt template."""
|
8 |
|
@@ -18,7 +19,7 @@ def get_workflow():
|
|
18 |
chat_model = get_chat_model() # Fetch the configured model from config.py
|
19 |
|
20 |
# Set up the language model (you can use OpenAI or another model)
|
21 |
-
llm =
|
22 |
|
23 |
# Create the conversation chain
|
24 |
conversation_chain = ConversationChain(
|
|
|
3 |
from langchain.memory import ConversationBufferMemory
|
4 |
from config import get_chat_model
|
5 |
|
6 |
+
|
7 |
def get_workflow():
|
8 |
"""Set up the chatbot workflow with memory and prompt template."""
|
9 |
|
|
|
19 |
chat_model = get_chat_model() # Fetch the configured model from config.py
|
20 |
|
21 |
# Set up the language model (you can use OpenAI or another model)
|
22 |
+
llm = chat_model
|
23 |
|
24 |
# Create the conversation chain
|
25 |
conversation_chain = ConversationChain(
|