Joshua Sundance Bailey
commited on
Commit
·
13d3324
1
Parent(s):
4527240
llmmath
Browse files- langchain-streamlit-demo/app.py +7 -2
- requirements.txt +1 -0
langchain-streamlit-demo/app.py
CHANGED
@@ -450,6 +450,7 @@ if st.session_state.llm:
|
|
450 |
WikipediaQueryRun(api_wrapper=WikipediaAPIWrapper()),
|
451 |
]
|
452 |
default_tools += load_tools(["requests_get"])
|
|
|
453 |
if st.session_state.provider in ("Azure OpenAI", "OpenAI"):
|
454 |
research_assistant_chain = get_research_assistant_chain(
|
455 |
search_llm=get_llm(**get_llm_args_temp_zero), # type: ignore
|
@@ -463,7 +464,9 @@ if st.session_state.llm:
|
|
463 |
# config=get_config(callbacks),
|
464 |
),
|
465 |
name="web-research-assistant",
|
466 |
-
description="this assistant returns a comprehensive report based on web research.
|
|
|
|
|
467 |
)
|
468 |
|
469 |
TOOLS = [research_assistant_tool] + default_tools
|
@@ -483,7 +486,9 @@ if st.session_state.llm:
|
|
483 |
# config=get_config(callbacks),
|
484 |
),
|
485 |
name="user-document-chat",
|
486 |
-
description="this assistant returns a response based on the user's custom context.
|
|
|
|
|
487 |
)
|
488 |
TOOLS = [doc_chain_tool, research_assistant_tool] + default_tools
|
489 |
|
|
|
450 |
WikipediaQueryRun(api_wrapper=WikipediaAPIWrapper()),
|
451 |
]
|
452 |
default_tools += load_tools(["requests_get"])
|
453 |
+
default_tools += load_tools(["llm-math"], llm=st.session_state.llm)
|
454 |
if st.session_state.provider in ("Azure OpenAI", "OpenAI"):
|
455 |
research_assistant_chain = get_research_assistant_chain(
|
456 |
search_llm=get_llm(**get_llm_args_temp_zero), # type: ignore
|
|
|
464 |
# config=get_config(callbacks),
|
465 |
),
|
466 |
name="web-research-assistant",
|
467 |
+
description="this assistant returns a comprehensive report based on web research. "
|
468 |
+
"it's slow and relatively expensive, so use it sparingly. "
|
469 |
+
"for quick facts, use duckduckgo instead.",
|
470 |
)
|
471 |
|
472 |
TOOLS = [research_assistant_tool] + default_tools
|
|
|
486 |
# config=get_config(callbacks),
|
487 |
),
|
488 |
name="user-document-chat",
|
489 |
+
description="this assistant returns a response based on the user's custom context. "
|
490 |
+
"if the user's meaning is unclear, perhaps the answer is here. "
|
491 |
+
"generally speaking, try this tool before conducting web research.",
|
492 |
)
|
493 |
TOOLS = [doc_chain_tool, research_assistant_tool] + default_tools
|
494 |
|
requirements.txt
CHANGED
@@ -4,6 +4,7 @@ duckduckgo-search==4.0.0
|
|
4 |
faiss-cpu==1.7.4
|
5 |
langchain==0.0.348
|
6 |
langsmith==0.0.69
|
|
|
7 |
numpy>=1.22.2 # not directly required, pinned by Snyk to avoid a vulnerability
|
8 |
openai==1.3.8
|
9 |
pillow>=10.0.1 # not directly required, pinned by Snyk to avoid a vulnerability
|
|
|
4 |
faiss-cpu==1.7.4
|
5 |
langchain==0.0.348
|
6 |
langsmith==0.0.69
|
7 |
+
numexpr==2.8.8
|
8 |
numpy>=1.22.2 # not directly required, pinned by Snyk to avoid a vulnerability
|
9 |
openai==1.3.8
|
10 |
pillow>=10.0.1 # not directly required, pinned by Snyk to avoid a vulnerability
|