Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Connery Actions to the list of available tools #164

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ AZURE_OPENAI_API_BASE=placeholder
AZURE_OPENAI_API_VERSION=placeholder
ROBOCORP_ACTION_SERVER_URL=https://dummy-action-server.robocorp.link
ROBOCORP_ACTION_SERVER_KEY=dummy-api-key
CONNERY_RUNNER_URL=https://your-personal-connery-runner-url
CONNERY_RUNNER_API_KEY=placeholder
2 changes: 2 additions & 0 deletions .env.gcp.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ AZURE_OPENAI_API_KEY: your_secret_here
KAY_API_KEY: your_secret_here
ROBOCORP_ACTION_SERVER_URL: https://dummy-action-server.robocorp.link
ROBOCORP_ACTION_SERVER_KEY: dummy-api-key
CONNERY_RUNNER_URL: https://your-personal-connery-runner-url
CONNERY_RUNNER_API_KEY: your_secret_here
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,17 @@ ROBOCORP_ACTION_SERVER_URL=https://dummy-action-server.robocorp.link
ROBOCORP_ACTION_SERVER_KEY=dummy-api-key
```

**_Connery Actions_**

Connect OpenGPTs to the real world with [Connery](https://github.com/connery-io/connery).

Requires setting an environment variable, which you get during the [Connery Runner setup](https://docs.connery.io/docs/runner/quick-start/):

```shell
CONNERY_RUNNER_URL=https://your-personal-connery-runner-url
CONNERY_RUNNER_API_KEY=...
```

**DuckDuckGo Search**

Search the web with [DuckDuckGo](https://pypi.org/project/duckduckgo-search/). Does not require any API keys.
Expand Down
15 changes: 15 additions & 0 deletions backend/app/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
)
from langchain_community.retrievers.you import YouRetriever
from langchain_community.tools import ArxivQueryRun, DuckDuckGoSearchRun
from langchain_community.agent_toolkits.connery import ConneryToolkit
from langchain_community.tools.connery import ConneryService
from langchain_community.tools.tavily_search import TavilyAnswer, TavilySearchResults
from langchain_community.utilities.arxiv import ArxivAPIWrapper
from langchain_community.utilities.tavily_search import TavilySearchAPIWrapper
Expand Down Expand Up @@ -128,9 +130,21 @@ def _get_action_server():
tools = toolkit.get_tools()
return tools

@lru_cache(maxsize=1)
def _get_connery_actions():
connery_service = ConneryService(
runner_url=os.environ.get("CONNERY_RUNNER_URL"),
api_key=os.environ.get("CONNERY_RUNNER_API_KEY"),
)
connery_toolkit = ConneryToolkit.create_instance(connery_service)
tools = connery_toolkit.get_tools()
return tools



class AvailableTools(str, Enum):
ACTION_SERVER = "Action Server by Robocorp"
CONNERY = "\"AI Action Runner\" by Connery"
DDG_SEARCH = "DDG Search"
TAVILY = "Search (Tavily)"
TAVILY_ANSWER = "Search (short answer, Tavily)"
Expand All @@ -145,6 +159,7 @@ class AvailableTools(str, Enum):

TOOLS = {
AvailableTools.ACTION_SERVER: _get_action_server,
AvailableTools.CONNERY: _get_connery_actions,
AvailableTools.DDG_SEARCH: _get_duck_duck_go,
AvailableTools.ARXIV: _get_arxiv,
AvailableTools.YOU_SEARCH: _get_you_search,
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/components/Config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ const TOOL_DESCRIPTIONS = {
Retrieval: "Look up information in uploaded files.",
"Action Server by Robocorp":
"Run AI actions with [Robocorp Action Server](https://github.com/robocorp/robocorp).",
"\"AI Action Runner\" by Connery":
"Connect OpenGPTs to the real world with [Connery](https://github.com/connery-io/connery).",
"DDG Search":
"Search the web with [DuckDuckGo](https://pypi.org/project/duckduckgo-search/).",
"Search (Tavily)":
Expand Down
Loading