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.0.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.0.tar.gz.
File metadata
- Download URL: langchain_disvr-0.1.0.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 |
5491ca5ca2be1a8bb3c6ab8e4145211a3948cc5dcf96f07d7e5fcd49da426ab2
|
|
| MD5 |
a90febc5f787c33c0cca6b2b9b27e091
|
|
| BLAKE2b-256 |
3d795849f1d41114dc7a14b300dca36ae6f3a5e94835121bc215c4d9ecbba767
|
File details
Details for the file langchain_disvr-0.1.0-py3-none-any.whl.
File metadata
- Download URL: langchain_disvr-0.1.0-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 |
bbc9489fc5113fe7dd279adbbf3166c170cdb5b1fa34a982a995539d9d2acc00
|
|
| MD5 |
e124a2f7fd66cb0e154dfe69edc3bacf
|
|
| BLAKE2b-256 |
b3765897ea90d7fafa9cb7b6edb5076a611cca98972b2f839db6984108e5d4fb
|