An integration package connecting Valyu and LangChain
Project description
langchain-valyu
This package contains the LangChain integration with Valyu
Installation
pip install -U langchain-valyu
And you should configure credentials by setting the following environment variable:
VALYU_API_KEY(required): Your Valyu API key.
Valyu Retriever
You can retrieve search results from Valyu's deep search API as follows:
from langchain_valyu import ValyuRetriever
valyu_api_key = "YOUR API KEY"
# Create a new instance of the ValyuRetriever
valyu_retriever = ValyuRetriever(valyu_api_key=valyu_api_key)
# Search for a query and save the results
docs = valyu_retriever.invoke("What are the benefits of renewable energy?")
# Print the results
for doc in docs:
print(doc.page_content)
print(doc.metadata)
Valyu Deep Search Tool
You can run the ValyuSearchTool module as follows:
from langchain_valyu import ValyuSearchTool
# Initialize the ValyuSearchTool
search_tool = ValyuSearchTool(valyu_api_key="YOUR API KEY")
# Perform a search query
search_results = search_tool._run(
query="What are agentic search-enhanced large reasoning models?",
search_type="all",
max_num_results=5,
relevance_threshold=0.5,
max_price=20.0,
start_date="2024-01-01",
end_date="2024-12-31"
)
print("Search Results:", search_results)
You can learn more about our api from our docs.
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
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_valyu-0.2.0.tar.gz.
File metadata
- Download URL: langchain_valyu-0.2.0.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.9 Darwin/24.2.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5454302627404d328d7b772b834588dd4c7f8a9e43e2a2dbc525a1c7961d9adf
|
|
| MD5 |
6dd634ba87436ee86233fe2342dc82a8
|
|
| BLAKE2b-256 |
940f27beccdf72e58e70f47d93720b1843fbe4485709aa341107ffb3507a9b91
|
File details
Details for the file langchain_valyu-0.2.0-py3-none-any.whl.
File metadata
- Download URL: langchain_valyu-0.2.0-py3-none-any.whl
- Upload date:
- Size: 5.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.9 Darwin/24.2.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b72aeff5ee22399ef981dd0f8efba30e47ba19fd951a316ea8f8dc40f7039dff
|
|
| MD5 |
8f43015011a5e0a97c3ffd7534307cf5
|
|
| BLAKE2b-256 |
b42dd05a71cd7cdecef8e3bfbaaffc044af474a65967ec5106403258e7fd3c87
|