2023-05-02 02:07:26 +00:00
|
|
|
from langchain.agents import __all__ as agents_all
|
|
|
|
|
|
|
|
_EXPECTED = [
|
|
|
|
"Agent",
|
|
|
|
"AgentExecutor",
|
|
|
|
"AgentOutputParser",
|
|
|
|
"AgentType",
|
|
|
|
"BaseMultiActionAgent",
|
|
|
|
"BaseSingleActionAgent",
|
|
|
|
"ConversationalAgent",
|
|
|
|
"ConversationalChatAgent",
|
|
|
|
"LLMSingleActionAgent",
|
|
|
|
"MRKLChain",
|
|
|
|
"ReActChain",
|
|
|
|
"ReActTextWorldAgent",
|
|
|
|
"SelfAskWithSearchChain",
|
2023-05-02 03:34:50 +00:00
|
|
|
"StructuredChatAgent",
|
2023-05-02 02:07:26 +00:00
|
|
|
"Tool",
|
|
|
|
"ZeroShotAgent",
|
|
|
|
"create_csv_agent",
|
|
|
|
"create_json_agent",
|
|
|
|
"create_openapi_agent",
|
|
|
|
"create_pandas_dataframe_agent",
|
|
|
|
"create_pbi_agent",
|
|
|
|
"create_pbi_chat_agent",
|
2023-05-04 05:45:23 +00:00
|
|
|
"create_spark_dataframe_agent",
|
Add Spark SQL support (#4602) (#4956)
# Add Spark SQL support
* Add Spark SQL support. It can connect to Spark via building a
local/remote SparkSession.
* Include a notebook example
I tried some complicated queries (window function, table joins), and the
tool works well.
Compared to the [Spark Dataframe
agent](https://python.langchain.com/en/latest/modules/agents/toolkits/examples/spark.html),
this tool is able to generate queries across multiple tables.
---------
# Your PR Title (What it does)
<!--
Thank you for contributing to LangChain! Your PR will appear in our next
release under the title you set. Please make sure it highlights your
valuable contribution.
Replace this with a description of the change, the issue it fixes (if
applicable), and relevant context. List any dependencies required for
this change.
After you're done, someone will review your PR. They may suggest
improvements. If no one reviews your PR within a few days, feel free to
@-mention the same people again, as notifications can get lost.
-->
<!-- Remove if not applicable -->
Fixes # (issue)
## Before submitting
<!-- If you're adding a new integration, include an integration test and
an example notebook showing its use! -->
## Who can review?
Community members can review the PR once tests pass. Tag
maintainers/contributors who might be interested:
<!-- For a quicker response, figure out the right person to tag with @
@hwchase17 - project lead
Tracing / Callbacks
- @agola11
Async
- @agola11
DataLoaders
- @eyurtsev
Models
- @hwchase17
- @agola11
Agents / Tools / Toolkits
- @vowelparrot
VectorStores / Retrievers / Memory
- @dev2049
-->
---------
Co-authored-by: Gengliang Wang <gengliang@apache.org>
Co-authored-by: Mike W <62768671+skcoirz@users.noreply.github.com>
Co-authored-by: Eugene Yurtsev <eyurtsev@gmail.com>
Co-authored-by: UmerHA <40663591+UmerHA@users.noreply.github.com>
Co-authored-by: 张城铭 <z@hyperf.io>
Co-authored-by: assert <zhangchengming@kkguan.com>
Co-authored-by: blob42 <spike@w530>
Co-authored-by: Yuekai Zhang <zhangyuekai@foxmail.com>
Co-authored-by: Richard He <he.yucheng@outlook.com>
Co-authored-by: Dev 2049 <dev.dev2049@gmail.com>
Co-authored-by: Leonid Ganeline <leo.gan.57@gmail.com>
Co-authored-by: Alexey Nominas <60900649+Chae4ek@users.noreply.github.com>
Co-authored-by: elBarkey <elbarkey@gmail.com>
Co-authored-by: Davis Chase <130488702+dev2049@users.noreply.github.com>
Co-authored-by: Jeffrey D <1289344+verygoodsoftwarenotvirus@users.noreply.github.com>
Co-authored-by: so2liu <yangliu35@outlook.com>
Co-authored-by: Viswanadh Rayavarapu <44315599+vishwa-rn@users.noreply.github.com>
Co-authored-by: Chakib Ben Ziane <contact@blob42.xyz>
Co-authored-by: Daniel Chalef <131175+danielchalef@users.noreply.github.com>
Co-authored-by: Daniel Chalef <daniel.chalef@private.org>
Co-authored-by: Jari Bakken <jari.bakken@gmail.com>
Co-authored-by: escafati <scafatieugenio@gmail.com>
2023-05-19 03:53:08 +00:00
|
|
|
"create_spark_sql_agent",
|
2023-05-02 02:07:26 +00:00
|
|
|
"create_sql_agent",
|
|
|
|
"create_vectorstore_agent",
|
|
|
|
"create_vectorstore_router_agent",
|
|
|
|
"get_all_tool_names",
|
|
|
|
"initialize_agent",
|
|
|
|
"load_agent",
|
2023-05-11 07:07:36 +00:00
|
|
|
"load_huggingface_tool",
|
2023-05-02 02:07:26 +00:00
|
|
|
"load_tools",
|
|
|
|
"tool",
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
def test_public_api() -> None:
|
|
|
|
"""Test for regressions or changes in the agents public API."""
|
2023-05-10 04:07:56 +00:00
|
|
|
assert sorted(agents_all) == sorted(_EXPECTED)
|