Skip to main content

Hive Tool for LlamaIndex

This tool provides integration with Hive Intelligence, enabling powerful crypto and Web3 intelligence capabilities.

Installation

Install the package using pip:

pip install llama-index-tools-hive

Setup

Set your Hive API key as an environment variable:

export HIVE_API_KEY=your_api_key_here

On Windows:

set HIVE_API_KEY=your_api_key_here

Basic Usage

Import and Initialize

from llama_index.tools.hive import HiveToolSpec, HiveSearchMessage

# Initialize with API key and optional search parameters
hive_tool = HiveToolSpec(
    api_key="your_api_key_here",  # or it will use HIVE_API_KEY env var
)

Simple Search

# Single prompt search
results = hive_tool.search(
    prompt="What is the current price of Ethereum?", include_data_sources=True
)
print("Search results:", results)

Chat-style Conversation

# Create conversation messages
chat_msgs = [
    HiveSearchMessage(role="user", content="Price of what?"),
    HiveSearchMessage(role="assistant", content="Please specify asset."),
    HiveSearchMessage(role="user", content="BTC"),
]

# Execute chat search
results = hive_tool.search(messages=chat_msgs, include_data_sources=True)
print("Chat response:", results)

Advanced Usage

Search with Custom Parameters

results = hive_tool.search(
    prompt="Analyze the latest trends in DeFi",
    include_data_sources=True,  # Include sources in response
)

API Reference

HiveToolSpec

__init__(self, api_key: str, temperature: Optional[float] = None, top_k: Optional[int] = None, top_p: Optional[float] = None)

  • api_key: Your Hive Intelligence API key
  • temperature: Controls randomness (0.0 to 1.0) - optional
  • top_k: Limit number of results returned - optional
  • top_p: Nucleus sampling parameter - optional

search(self, prompt: str = None, messages: List[HiveSearchMessage] = None, include_data_sources: bool = False) -> HiveSearchResponse

Parameters:

  • prompt: The search query or question (string)
  • messages: List of HiveSearchMessage objects for chat-style conversations
  • include_data_sources: Whether to include data sources in the response

Returns:

  • HiveSearchResponse containing the search results

Examples

Full Example Script

from llama_index.tools.hive import HiveToolSpec, HiveSearchMessage


def main():
    # Initialize with API key and search parameters
    hive = HiveToolSpec(api_key="your_api_key_here")

    # Simple search
    print("--- Simple Search ---")
    results = hive.search(
        prompt="What is the current price of Bitcoin?",
        include_data_sources=True,
    )
    print("Results:", results)

    # Chat conversation
    print("\n--- Chat Conversation ---")
    chat = [
        HiveSearchMessage(role="user", content="Tell me about"),
        HiveSearchMessage(
            role="assistant", content="What would you like to know about?"
        ),
        HiveSearchMessage(role="user", content="Ethereum upgrades"),
    ]
    results = hive.search(messages=chat)
    print("Chat response:", results)


if __name__ == "__main__":
    main()

Metadata

Release files for llama-index-tools-hive 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for llama-index-tools-hive 0.2.1
File Size Uploaded Provenance Actions
llama_index_tools_hive-0.2.1.tar.gz 2.9 kB Without provenance Details for llama_index_tools_hive-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for llama-index-tools-hive 0.2.1
File Interpreter ABI Platform Actions
llama_index_tools_hive-0.2.1-py3-none-any.whl Python 3 none any Details for llama_index_tools_hive-0.2.1-py3-none-any.whl

Total release size: 6.3 kB

Release files / llama_index_tools_hive-0.2.1.tar.gz

Download URL llama_index_tools_hive-0.2.1.tar.gz
Size 2.9 kB
Tags Source
SHA-256 checksum
How to use checksums
e9209310c41b36803cb86ada9d0d1bf2c62390cce037c4f5d866e693c81ddd64
BLAKE2b-256 checksum
How to use checksums
8e7e39cc63dc0ce7ea1b8521735b94354124387ff84ba6caa16be17f0c124980
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.13

Release files / llama_index_tools_hive-0.2.1-py3-none-any.whl

Download URL llama_index_tools_hive-0.2.1-py3-none-any.whl
Size 3.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
afe44c97e678e3901bbbd94005d01adc6af2f741497e7770b8abae6fba346b6c
BLAKE2b-256 checksum
How to use checksums
806296133036867274a053b229757c134740c023849a609112ee7ee65acaafde
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.13

Security for llama-index-tools-hive 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page