Add WolframAlpha tool
Browse files- app.py +9 -8
- requirements.txt +3 -2
- videos/tempfile.mp4 +2 -2
app.py
CHANGED
|
@@ -18,7 +18,7 @@ from langchain.llms import OpenAI
|
|
| 18 |
news_api_key = os.environ["NEWS_API_KEY"]
|
| 19 |
tmdb_bearer_token = os.environ["TMDB_BEARER_TOKEN"]
|
| 20 |
|
| 21 |
-
TOOLS_LIST = ['serpapi', 'pal-math', 'pal-colored-objects', 'news-api', 'tmdb-api', 'open-meteo-api']
|
| 22 |
TOOLS_DEFAULT_LIST = ['serpapi', 'pal-math', 'pal-colored-objects']
|
| 23 |
|
| 24 |
|
|
@@ -137,13 +137,6 @@ with block:
|
|
| 137 |
htm_video = f'<video width="256" height="256" autoplay muted loop><source src={tmp_file_url} type="video/mp4" poster="Masahiro.png"></video>'
|
| 138 |
video_html = gr.HTML(htm_video)
|
| 139 |
|
| 140 |
-
tools_cb_group = gr.CheckboxGroup(label="Tools:", choices=TOOLS_LIST,
|
| 141 |
-
value=TOOLS_DEFAULT_LIST)
|
| 142 |
-
|
| 143 |
-
tools_cb_group.change(update_selected_tools,
|
| 144 |
-
inputs=[tools_cb_group, tools_list_state, llm_state],
|
| 145 |
-
outputs=[tools_list_state, llm_state, chain_state])
|
| 146 |
-
|
| 147 |
with gr.Column(scale=0.75):
|
| 148 |
chatbot = gr.Chatbot()
|
| 149 |
|
|
@@ -159,6 +152,14 @@ with block:
|
|
| 159 |
# interactive=True, streaming=False)
|
| 160 |
# audio_comp.change(transcribe, inputs=[audio_comp], outputs=[message])
|
| 161 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 162 |
gr.Examples(
|
| 163 |
examples=["How many people live in Canada?",
|
| 164 |
"What is 2 to the 30th power?",
|
|
|
|
| 18 |
news_api_key = os.environ["NEWS_API_KEY"]
|
| 19 |
tmdb_bearer_token = os.environ["TMDB_BEARER_TOKEN"]
|
| 20 |
|
| 21 |
+
TOOLS_LIST = ['serpapi', 'wolfram-alpha', 'google-search', 'pal-math', 'pal-colored-objects', 'news-api', 'tmdb-api', 'open-meteo-api']
|
| 22 |
TOOLS_DEFAULT_LIST = ['serpapi', 'pal-math', 'pal-colored-objects']
|
| 23 |
|
| 24 |
|
|
|
|
| 137 |
htm_video = f'<video width="256" height="256" autoplay muted loop><source src={tmp_file_url} type="video/mp4" poster="Masahiro.png"></video>'
|
| 138 |
video_html = gr.HTML(htm_video)
|
| 139 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 140 |
with gr.Column(scale=0.75):
|
| 141 |
chatbot = gr.Chatbot()
|
| 142 |
|
|
|
|
| 152 |
# interactive=True, streaming=False)
|
| 153 |
# audio_comp.change(transcribe, inputs=[audio_comp], outputs=[message])
|
| 154 |
|
| 155 |
+
with gr.Row():
|
| 156 |
+
tools_cb_group = gr.CheckboxGroup(label="Tools:", choices=TOOLS_LIST,
|
| 157 |
+
value=TOOLS_DEFAULT_LIST)
|
| 158 |
+
|
| 159 |
+
tools_cb_group.change(update_selected_tools,
|
| 160 |
+
inputs=[tools_cb_group, tools_list_state, llm_state],
|
| 161 |
+
outputs=[tools_list_state, llm_state, chain_state])
|
| 162 |
+
|
| 163 |
gr.Examples(
|
| 164 |
examples=["How many people live in Canada?",
|
| 165 |
"What is 2 to the 30th power?",
|
requirements.txt
CHANGED
|
@@ -1,7 +1,8 @@
|
|
| 1 |
openai==0.26.0
|
| 2 |
gradio==3.16.1
|
| 3 |
google-search-results
|
| 4 |
-
google-api-python-client
|
| 5 |
-
|
|
|
|
| 6 |
requests~=2.28.1
|
| 7 |
git+https://github.com/openai/whisper.git
|
|
|
|
| 1 |
openai==0.26.0
|
| 2 |
gradio==3.16.1
|
| 3 |
google-search-results
|
| 4 |
+
google-api-python-client==2.72.0
|
| 5 |
+
wolframalpha
|
| 6 |
+
langchain==0.0.61
|
| 7 |
requests~=2.28.1
|
| 8 |
git+https://github.com/openai/whisper.git
|
videos/tempfile.mp4
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:73a02f897e7589b58d2a7643a885e49ba1b3d99d8f3a98100dbec9b88fd9e50c
|
| 3 |
+
size 96
|