LangChain integration for Disvr — AI agent tool discovery
Project description
langchain-disvr
LangChain integration for Disvr — tool search engine for AI agents.
Your agent says "I need a translation tool" → Disvr finds the best one.
Install
pip install langchain-disvr
Quick Start
from langchain_disvr import DisvrDiscoverTool, DisvrToolDetails
# Create tools
discover = DisvrDiscoverTool(api_key="dsvr_your_key_here")
details = DisvrToolDetails(api_key="dsvr_your_key_here")
# Use standalone
result = discover.invoke({"need": "translate Chinese to Thai"})
print(result)
# Get full details for a recommended tool
detail = details.invoke({"service_id": "service-uuid-from-results"})
print(detail)
Use with LangChain Agent
from langchain_openai import ChatOpenAI
from langchain.agents import AgentExecutor, create_tool_calling_agent
from langchain_core.prompts import ChatPromptTemplate
from langchain_disvr import DisvrDiscoverTool, DisvrToolDetails
# Set up tools
tools = [
DisvrDiscoverTool(api_key="dsvr_your_key_here"),
DisvrToolDetails(api_key="dsvr_your_key_here"),
]
# Create agent
llm = ChatOpenAI(model="gpt-4o")
prompt = ChatPromptTemplate.from_messages([
("system", "You are a helpful assistant. When you need an external tool, use disvr_discover to find one."),
("human", "{input}"),
("placeholder", "{agent_scratchpad}"),
])
agent = create_tool_calling_agent(llm, tools, prompt)
executor = AgentExecutor(agent=agent, tools=tools, verbose=True)
# Run
result = executor.invoke({"input": "I need to translate a Chinese legal contract to Thai. Find me the best tool."})
Use with Claude + LangChain
from langchain_anthropic import ChatAnthropic
from langchain.agents import AgentExecutor, create_tool_calling_agent
from langchain_core.prompts import ChatPromptTemplate
from langchain_disvr import DisvrDiscoverTool, DisvrToolDetails
tools = [
DisvrDiscoverTool(api_key="dsvr_your_key_here"),
DisvrToolDetails(api_key="dsvr_your_key_here"),
]
llm = ChatAnthropic(model="claude-sonnet-4-20250514")
prompt = ChatPromptTemplate.from_messages([
("system", "You are a helpful assistant. Use disvr_discover to find external tools when needed."),
("human", "{input}"),
("placeholder", "{agent_scratchpad}"),
])
agent = create_tool_calling_agent(llm, tools, prompt)
executor = AgentExecutor(agent=agent, tools=tools, verbose=True)
result = executor.invoke({"input": "Find me a tool that can do OCR on scanned documents"})
API Key
Get a free API key at https://www.disvr.top/keys (1,000 requests/day).
Tools Provided
| Tool | Description |
|---|---|
disvr_discover |
Find the best tools for a task. Returns ranked recommendations. |
disvr_tool_details |
Get full details: install command, env vars, available functions. |
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
langchain_disvr-0.1.1.tar.gz
(5.9 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file langchain_disvr-0.1.1.tar.gz.
File metadata
- Download URL: langchain_disvr-0.1.1.tar.gz
- Upload date:
- Size: 5.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a0f94cb89f8d94fcb08d34d2190f7abd5c9700ae7384b53dced056a12d984610
|
|
| MD5 |
97607beeeb77edab4e0d5c2ac896277e
|
|
| BLAKE2b-256 |
434b6dde0e541bf46676d290d44a05112a557ed6ded183bbe7aa476caec30be9
|
File details
Details for the file langchain_disvr-0.1.1-py3-none-any.whl.
File metadata
- Download URL: langchain_disvr-0.1.1-py3-none-any.whl
- Upload date:
- Size: 6.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2317edfea5beb353bc9df3fa5d727500d3b340a11eee3f215d51a4e3177b4d74
|
|
| MD5 |
5c5f9a844be0f083b847ea9219bdc98f
|
|
| BLAKE2b-256 |
cee5c3907a2e8e91fa7dd428e2cf0e95f6b2dbb2f4c4433c2d9dd630e9474b80
|