mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-24 20:09:01 +00:00
community[minor]: Connery Tool and Toolkit (#14506)
## Summary This PR implements the "Connery Action Tool" and "Connery Toolkit". Using them, you can integrate Connery actions into your LangChain agents and chains. Connery is an open-source plugin infrastructure for AI. With Connery, you can easily create a custom plugin with a set of actions and seamlessly integrate them into your LangChain agents and chains. Connery will handle the rest: runtime, authorization, secret management, access management, audit logs, and other vital features. Additionally, Connery and our community offer a wide range of ready-to-use open-source plugins for your convenience. Learn more about Connery: - GitHub: https://github.com/connery-io/connery-platform - Documentation: https://docs.connery.io - Twitter: https://twitter.com/connery_io ## TODOs - [x] API wrapper - [x] Integration tests - [x] Connery Action Tool - [x] Docs - [x] Example - [x] Integration tests - [x] Connery Toolkit - [x] Docs - [x] Example - [x] Formatting (`make format`) - [x] Linting (`make lint`) - [x] Testing (`make test`)
This commit is contained in:
committed by
GitHub
parent
8457c31c04
commit
32c5be8b73
@@ -0,0 +1,41 @@
|
||||
"""Integration test for Connery API Wrapper."""
|
||||
from langchain_community.tools.connery import ConneryService
|
||||
|
||||
|
||||
def test_list_actions() -> None:
|
||||
"""Test for listing Connery Actions."""
|
||||
connery = ConneryService()
|
||||
output = connery._list_actions()
|
||||
assert output is not None
|
||||
assert len(output) > 0
|
||||
|
||||
|
||||
def test_get_action() -> None:
|
||||
"""Test for getting Connery Action."""
|
||||
connery = ConneryService()
|
||||
# This is the ID of the preinstalled action "Refresh plugin cache"
|
||||
output = connery._get_action("CAF979E6D2FF4C8B946EEBAFCB3BA475")
|
||||
assert output is not None
|
||||
assert output.id == "CAF979E6D2FF4C8B946EEBAFCB3BA475"
|
||||
|
||||
|
||||
def test_run_action_with_no_iput() -> None:
|
||||
"""Test for running Connery Action without input."""
|
||||
connery = ConneryService()
|
||||
# refreshPluginCache action from connery-io/connery-runner-administration plugin
|
||||
output = connery._run_action("CAF979E6D2FF4C8B946EEBAFCB3BA475")
|
||||
assert output is not None
|
||||
assert output == {}
|
||||
|
||||
|
||||
def test_run_action_with_iput() -> None:
|
||||
"""Test for running Connery Action with input."""
|
||||
connery = ConneryService()
|
||||
# summarizePublicWebpage action from connery-io/summarization-plugin plugin
|
||||
output = connery._run_action(
|
||||
"CA72DFB0AB4DF6C830B43E14B0782F70",
|
||||
{"publicWebpageUrl": "http://www.paulgraham.com/vb.html"},
|
||||
)
|
||||
assert output is not None
|
||||
assert output["summary"] is not None
|
||||
assert len(output["summary"]) > 0
|
Reference in New Issue
Block a user