Skip to main content

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 Context Retriever

You can retrieve search results from Valyu as follows:

from langchain_valyu import ValyuContextRetriever

valyu_api_key = "YOUR API KEY"

# Create a new instance of the ValyuContextRetriever
valyu_retriever = ValyuContextRetriever(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 Context Search Tool

You can run the ValyuTool 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,
    similarity_threshold=0.4,
    query_rewrite=False,
    max_price=20.0
)

print("Search Results:", search_results)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

langchain_valyu-0.1.0.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

langchain_valyu-0.1.0-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file langchain_valyu-0.1.0.tar.gz.

File metadata

  • Download URL: langchain_valyu-0.1.0.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.9 Darwin/24.2.0

File hashes

Hashes for langchain_valyu-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b2c6b6c73284892ceb27db320d1a0b8909ca221ebb7310e05193ace0ede0803c
MD5 cf06f158fa59597413a2b6f5506e36b4
BLAKE2b-256 b8152c1e35fba1dad9608de7a552379ae5194728115c490b27ce20f5ea1d6534

See more details on using hashes here.

File details

Details for the file langchain_valyu-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: langchain_valyu-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.7 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

Hashes for langchain_valyu-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a073e52d43760ac1929792c7b17bd31f4dae32487015b1a7927e9d98a73b3890
MD5 df110bddce8e63d93f1231a2f28cd764
BLAKE2b-256 f20ac9efcc4158b06bda177788f2b1f4d8691b1e97811bf9c682fd0d307ff508

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page