Skip to main content

llama-index tools valyu integration

Project description

LlamaIndex Tools Integration: Valyu

This tool connects to Valyu and its Exchange Platform to easily enable your agent to search and get content from programmatically licensed proprietary content and the web using Valyu's deep search API.

To begin, you need to obtain an API key on the Valyu developer dashboard. You can also use the SDK without an API key by setting the VALYU_API_KEY environment variable.

Usage

Here's an example usage of the ValyuToolSpec.

# %pip install llama-index llama-index-core llama-index-tools-valyu

from llama_index.tools.valyu import ValyuToolSpec
from llama_index.core.agent.workflow import FunctionAgent
from llama_index.llms.openai import OpenAI
import os

valyu_tool = ValyuToolSpec(
    api_key=os.environ["VALYU_API_KEY"],
    max_price=100,  # default is 100
)
agent = FunctionAgent(
    tools=valyu_tool.to_tool_list(),
    llm=OpenAI(model="gpt-4.1"),
)

print(
    await agent.run(
        "What are the implications of using different volatility calculation methods (EWMA vs. GARCH) in Value at Risk (VaR) modeling for fixed income portfolios?"
    )
)

# You can also search directly with the new parameters
results = valyu_tool.search(
    query="artificial intelligence trends 2024",
    included_sources=[
        "arxiv.org",
        "nature.com",
    ],  # Only search academic sources
    response_length="medium",  # 50k characters per result
    max_num_results=3,
    relevance_threshold=0.5,
)

search: Search and retrieve relevant content from proprietary and public sources using Valyu's deep search. Supports filtering by:

  • Search type ("all", "proprietary", or "web")
  • Relevance threshold
  • Date ranges (start_date, end_date)
  • Source filtering (included_sources, excluded_sources)
  • Response length (integer for character count or preset values: "short" 25k, "medium" 50k, "large" 100k, "max" full content)

This loader is designed to be used as a way to load data as a Tool in a Agent.

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

llama_index_tools_valyu-0.4.0.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

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

llama_index_tools_valyu-0.4.0-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file llama_index_tools_valyu-0.4.0.tar.gz.

File metadata

File hashes

Hashes for llama_index_tools_valyu-0.4.0.tar.gz
Algorithm Hash digest
SHA256 63e1f4d00bfe2eb067e2c9a9c95e970348f90d8e30950c26e4ed56255febd8c4
MD5 52c584520e26a3332236ff8e20db99b3
BLAKE2b-256 16fe8a3be8434f50be2197e91c4a3993d207ce81d3b1628025a33f82ef52c597

See more details on using hashes here.

File details

Details for the file llama_index_tools_valyu-0.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for llama_index_tools_valyu-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8d50c751db29fc6cd68ba84b3783b85cf228e97cd4f315d3657343c8f9a2bf11
MD5 1602883e29c2fd2a8921c8e972c9c739
BLAKE2b-256 043ecb16bbea79c7d235870bceb01a8cea5c072e2d7de9117fe06fd0538b03e9

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