mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-05 13:06:03 +00:00
[docs]: combine tools and toolkits (#25158)
This commit is contained in:
@@ -2,6 +2,11 @@ import sys
|
||||
from pathlib import Path
|
||||
|
||||
SEARCH_TOOL_FEAT_TABLE = {
|
||||
"Tavily Search": {
|
||||
"pricing": "1000 free searches/month",
|
||||
"available_data": "URL, Content, Title, Images, Answer",
|
||||
"link": "/docs/integrations/tools/tavily_search",
|
||||
},
|
||||
"Exa Search": {
|
||||
"pricing": "1000 free searches/month",
|
||||
"available_data": "URL, Author, Title, Published Date",
|
||||
@@ -90,6 +95,74 @@ CODE_INTERPRETER_TOOL_FEAT_TABLE = {
|
||||
},
|
||||
}
|
||||
|
||||
PRODUCTIVITY_TOOL_FEAT_TABLE = {
|
||||
"Gmail Toolkit": {
|
||||
"link": "/docs/integrations/tools/gmail",
|
||||
"pricing": "Free, with limit of 250 quota units per user per second",
|
||||
},
|
||||
"Github Toolkit": {
|
||||
"link": "/docs/integrations/tools/github",
|
||||
"pricing": "Free",
|
||||
},
|
||||
"Gitlab Toolkit": {
|
||||
"link": "/docs/integrations/tools/gitlab",
|
||||
"pricing": "Free for personal project",
|
||||
},
|
||||
"Slack Toolkit": {
|
||||
"link": "/docs/integrations/tools/slack",
|
||||
"pricing": "Free",
|
||||
},
|
||||
"Jira Toolkit": {
|
||||
"link": "/docs/integrations/tools/jira",
|
||||
"pricing": "Free, with [rate limits](https://developer.atlassian.com/cloud/jira/platform/rate-limiting/)",
|
||||
},
|
||||
"Office365 Toolkit": {
|
||||
"link": "/docs/integrations/tools/office365",
|
||||
"pricing": "Free with Office365, includes [rate limits](https://learn.microsoft.com/en-us/graph/throttling-limits)",
|
||||
},
|
||||
"Twilio Tool": {
|
||||
"link": "/docs/integrations/tools/twilio",
|
||||
"pricing": "Free trial, with [pay-as-you-go pricing](https://www.twilio.com/en-us/pricing) after",
|
||||
},
|
||||
"Infobip Tool": {
|
||||
"link": "/docs/integrations/tools/infobip",
|
||||
"pricing": "Free trial, with variable pricing after",
|
||||
},
|
||||
}
|
||||
|
||||
WEBBROWSING_TOOL_FEAT_TABLE = {
|
||||
"Requests Toolkit": {
|
||||
"link": "/docs/integrations/tools/requests",
|
||||
"interactions": False,
|
||||
"pricing": "Free",
|
||||
},
|
||||
"PlayWright Browser Toolkit": {
|
||||
"link": "/docs/integrations/tools/playwright",
|
||||
"interactions": True,
|
||||
"pricing": "Free",
|
||||
},
|
||||
"MultiOn Toolkit": {
|
||||
"link": "/docs/integrations/tools/multion",
|
||||
"interactions": True,
|
||||
"pricing": "40 free requests/day",
|
||||
},
|
||||
}
|
||||
|
||||
DATABASE_TOOL_FEAT_TABLE = {
|
||||
"SQLDatabase Toolkit": {
|
||||
"link": "/docs/integrations/tools/sql_database",
|
||||
"operations": "Any SQL operation",
|
||||
},
|
||||
"Spark SQL Toolkit": {
|
||||
"link": "/docs/integrations/tools/spark_sql",
|
||||
"operations": "Any SQL operation",
|
||||
},
|
||||
"Cassandra Database Toolkit": {
|
||||
"link": "/docs/integrations/tools/cassandra_database",
|
||||
"operations": "SELECT and schema introspection",
|
||||
},
|
||||
}
|
||||
|
||||
TOOLS_TEMPLATE = """\
|
||||
---
|
||||
sidebar_position: 0
|
||||
@@ -107,25 +180,104 @@ If you'd like to contribute an integration, see [Contributing integrations](/doc
|
||||
|
||||
:::
|
||||
|
||||
## Search Tools
|
||||
## Search
|
||||
|
||||
The following table shows tools that execute online searches in some shape or form:
|
||||
|
||||
{search_table}
|
||||
|
||||
## Code Interpreter Tools
|
||||
## Code Interpreter
|
||||
|
||||
The following table shows tools that can be used as code interpreters:
|
||||
|
||||
{code_interpreter_table}
|
||||
|
||||
"""
|
||||
## Productivity
|
||||
|
||||
The following table shows tools that can be used to automate tasks in productivity tools:
|
||||
|
||||
{productivity_table}
|
||||
|
||||
## Web Browsing
|
||||
|
||||
The following table shows tools that can be used to automate tasks in web browsers:
|
||||
|
||||
{webbrowsing_table}
|
||||
|
||||
## Database
|
||||
|
||||
The following table shows tools that can be used to automate tasks in databases:
|
||||
|
||||
{database_table}
|
||||
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
def get_productivity_table() -> str:
|
||||
"""Get the table of productivity tools."""
|
||||
header = [
|
||||
"tool",
|
||||
"pricing",
|
||||
]
|
||||
title = [
|
||||
"Tool/Toolkit",
|
||||
"Pricing",
|
||||
]
|
||||
rows = [title, [":-"] + [":-:"] * (len(title) - 1)]
|
||||
for productivity_tool, feats in sorted(PRODUCTIVITY_TOOL_FEAT_TABLE.items()):
|
||||
# Fields are in the order of the header
|
||||
row = [
|
||||
f"[{productivity_tool}]({feats['link']})",
|
||||
]
|
||||
for h in header[1:]:
|
||||
row.append(feats.get(h))
|
||||
rows.append(row)
|
||||
return "\n".join(["|".join(row) for row in rows])
|
||||
|
||||
|
||||
def get_webbrowsing_table() -> str:
|
||||
"""Get the table of web browsing tools."""
|
||||
header = ["tool", "pricing", "interactions"]
|
||||
title = ["Tool/Toolkit", "Pricing", "Supports Interacting with the Browser"]
|
||||
rows = [title, [":-"] + [":-:"] * (len(title) - 1)]
|
||||
for web_browsing_tool, feats in sorted(WEBBROWSING_TOOL_FEAT_TABLE.items()):
|
||||
# Fields are in the order of the header
|
||||
row = [
|
||||
f"[{web_browsing_tool}]({feats['link']})",
|
||||
]
|
||||
for h in header[1:]:
|
||||
value = feats.get(h)
|
||||
if h == "interactions":
|
||||
if value is True:
|
||||
row.append("✅")
|
||||
else:
|
||||
row.append("❌")
|
||||
else:
|
||||
row.append(value)
|
||||
rows.append(row)
|
||||
return "\n".join(["|".join(row) for row in rows])
|
||||
|
||||
|
||||
def get_database_table() -> str:
|
||||
"""Get the table of database tools."""
|
||||
header = ["tool", "operations"]
|
||||
title = ["Tool/Toolkit", "Allowed Operations"]
|
||||
rows = [title, [":-"] + [":-:"] * (len(title) - 1)]
|
||||
for database_tool, feats in sorted(DATABASE_TOOL_FEAT_TABLE.items()):
|
||||
# Fields are in the order of the header
|
||||
row = [
|
||||
f"[{database_tool}]({feats['link']})",
|
||||
]
|
||||
for h in header[1:]:
|
||||
row.append(feats.get(h))
|
||||
rows.append(row)
|
||||
return "\n".join(["|".join(row) for row in rows])
|
||||
|
||||
|
||||
def get_search_tools_table() -> str:
|
||||
"""Get the table of search tools."""
|
||||
header = ["tool", "pricing", "available_data"]
|
||||
title = ["Tool", "Free/Paid", "Return Data"]
|
||||
title = ["Tool/Toolkit", "Free/Paid", "Return Data"]
|
||||
rows = [title, [":-"] + [":-:"] * (len(title) - 1)]
|
||||
for search_tool, feats in sorted(SEARCH_TOOL_FEAT_TABLE.items()):
|
||||
# Fields are in the order of the header
|
||||
@@ -148,7 +300,7 @@ def get_code_interpreter_table() -> str:
|
||||
"return_results",
|
||||
]
|
||||
title = [
|
||||
"Tool",
|
||||
"Tool/Toolkit",
|
||||
"Supported Languages",
|
||||
"Sandbox Lifetime",
|
||||
"Supports File Uploads",
|
||||
@@ -182,6 +334,9 @@ if __name__ == "__main__":
|
||||
tools_page = TOOLS_TEMPLATE.format(
|
||||
search_table=get_search_tools_table(),
|
||||
code_interpreter_table=get_code_interpreter_table(),
|
||||
productivity_table=get_productivity_table(),
|
||||
webbrowsing_table=get_webbrowsing_table(),
|
||||
database_table=get_database_table(),
|
||||
)
|
||||
with open(output_integrations_dir / "tools" / "index.mdx", "w") as f:
|
||||
f.write(tools_page)
|
||||
|
Reference in New Issue
Block a user