Spaces:
Build error
Build error
niro commited on
Commit ·
0e4ec89
1
Parent(s): ae86b65
asdfsdf
Browse files- chatbot_legger.py +10 -1
- pandasai_demo.py +1 -2
- src/modules/chatbot.py +1 -2
- src/modules/history.py +1 -1
chatbot_legger.py
CHANGED
|
@@ -88,7 +88,16 @@ def main():
|
|
| 88 |
if is_ready:
|
| 89 |
history.append("user", user_input)
|
| 90 |
output = st.session_state["chatbot"].csv_agent(user_input)
|
| 91 |
-
st.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 92 |
history.append("assistant", output)
|
| 93 |
|
| 94 |
history.generate_messages(response_container)
|
|
|
|
| 88 |
if is_ready:
|
| 89 |
history.append("user", user_input)
|
| 90 |
output = st.session_state["chatbot"].csv_agent(user_input)
|
| 91 |
+
# st.text(sys.stdout)
|
| 92 |
+
# st.text(StringIO.getvalue())
|
| 93 |
+
old_stdout = sys.stdout
|
| 94 |
+
sys.stdout = captured_output = StringIO()
|
| 95 |
+
sys.stdout = old_stdout
|
| 96 |
+
thoughts = captured_output.getvalue()
|
| 97 |
+
# st.text(old_stdout)
|
| 98 |
+
# st.text(captured_output)
|
| 99 |
+
st.text('thoughts: '+thoughts)
|
| 100 |
+
|
| 101 |
history.append("assistant", output)
|
| 102 |
|
| 103 |
history.generate_messages(response_container)
|
pandasai_demo.py
CHANGED
|
@@ -7,8 +7,7 @@ import matplotlib.pyplot as plt
|
|
| 7 |
import toml
|
| 8 |
#
|
| 9 |
#
|
| 10 |
-
key = 'sk-
|
| 11 |
-
'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'
|
| 12 |
page_title = "Vanti chatBI"
|
| 13 |
page_icon = ":money_with_wings:" # emojis: https://www.webfx.com/tools/emoji-cheat-sheet/
|
| 14 |
|
|
|
|
| 7 |
import toml
|
| 8 |
#
|
| 9 |
#
|
| 10 |
+
key = 'sk-PAwB8Px5csNP53rZwl29T'+'3BlbkFJVs5voehhqRr3SJBC65vJ'
|
|
|
|
| 11 |
page_title = "Vanti chatBI"
|
| 12 |
page_icon = ":money_with_wings:" # emojis: https://www.webfx.com/tools/emoji-cheat-sheet/
|
| 13 |
|
src/modules/chatbot.py
CHANGED
|
@@ -1,10 +1,9 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
-
from langchain.chat_models import ChatOpenAI
|
| 3 |
from langchain.chains import ConversationalRetrievalChain
|
| 4 |
from langchain.prompts.prompt import PromptTemplate
|
| 5 |
from langchain.agents import create_csv_agent
|
| 6 |
-
from langchain.chat_models import ChatOpenAI
|
| 7 |
from langchain.llms import OpenAI
|
|
|
|
| 8 |
|
| 9 |
|
| 10 |
class Chatbot_txt:
|
|
|
|
| 1 |
import streamlit as st
|
|
|
|
| 2 |
from langchain.chains import ConversationalRetrievalChain
|
| 3 |
from langchain.prompts.prompt import PromptTemplate
|
| 4 |
from langchain.agents import create_csv_agent
|
|
|
|
| 5 |
from langchain.llms import OpenAI
|
| 6 |
+
from langchain.chat_models import ChatOpenAI
|
| 7 |
|
| 8 |
|
| 9 |
class Chatbot_txt:
|
src/modules/history.py
CHANGED
|
@@ -44,7 +44,7 @@ class ChatHistory:
|
|
| 44 |
st.session_state["user"][i],
|
| 45 |
is_user=True,
|
| 46 |
key=f"{i}_user",
|
| 47 |
-
avatar_style="
|
| 48 |
)
|
| 49 |
message(st.session_state["assistant"][i], key=str(i), avatar_style="thumbs")
|
| 50 |
|
|
|
|
| 44 |
st.session_state["user"][i],
|
| 45 |
is_user=True,
|
| 46 |
key=f"{i}_user",
|
| 47 |
+
avatar_style="fun-emoji",
|
| 48 |
)
|
| 49 |
message(st.session_state["assistant"][i], key=str(i), avatar_style="thumbs")
|
| 50 |
|