semvec/pypi-packages huggingface dataset:
llama-index-readers-dashvector 0.5.1
llama-index readers dashvector integration
Requires Python: <4.0,>=3.9

# LlamaIndex Readers Integration: Dashvector

## Overview

DashVector Reader is a tool designed to retrieve documents from DashVector clusters efficiently.

### Installation

You can install DashVector Reader via pip:

```bash
pip install llama-index-readers-dashvector
```

To use DashVector, you must have an API key. Here are the [installation instructions](https://help.aliyun.com/document_detail/2510223.html)

## Usage

```python
from llama_index.core.schema import Document
from llama_index.readers.dashvector import DashVectorReader

# Initialize DashVectorReader with the API key and cluster endpoint
reader = DashVectorReader(
    api_key="<Your API Key>", endpoint="<Cluster Endpoint>"
)

# Load data from DashVector
documents = reader.load_data(
    collection_name="<Collection Name>",
    vector=[0.1, 0.2, 0.3],  # Query vector
    topk=10,  # Number of results to return
    separate_documents=True,  # Whether to return separate documents
    filter=None,  # Optional: Filter conditions
    include_vector=True,  # Whether to include the embedding in the response
    output_fields=None,  # Optional: Fields Filter
)
```

This loader is designed to be used as a way to load data into
[LlamaIndex](https://github.com/run-llama/llama_index/tree/main/llama_index) and/or subsequently
used as a Tool in a [LangChain](https://github.com/hwchase17/langchain) Agent.
llama-index-retrievers-tldw 0.1.1
llama-index retrievers tl;dw AI integration
Requires Python: <4.0,>=3.9

## TL;DW Video Retriever

### Overview

**TL;DW** is a powerful video understanding API that retrieves precise moments from videos using natural language queries. By integrating **TL;DW** with **LlamaIndex**, we can efficiently index and search video content, enabling seamless knowledge retrieval from videos.

### Setup

- Obtain API keys from [tl;dw Playground](https://app.trytldw.ai/account?tab=api). New users are granted free indexing minutes automatically.

- Install the required packages:

```sh
pip install llama-index-retrievers-tldw
```

### Usage

- Initialize the TldwRetriever with your API key and collection ID:

```python
from llama_index.retrievers.tldw import TldwRetriever
from llama_index.core.query_engine import RetrieverQueryEngine

# Initialize the retriever
retriever = TldwRetriever(
    api_key="YOUT_TLDW_API_KEY",
    collection_id="YOUR_COLLECTION_ID",  # Replace with your actual collection ID
)

# Create a query engine
query_engine = RetrieverQueryEngine(
    retriever=retriever,
)

# Query and summarize response
response = query_engine.query("What are the brands of smart watches reviewed?")
print(
    response
)  # "The brands of smartwatches reviewed in the videos are Apple and Garmin."
```

## Support

If you have any questions or feedback, please feel free to reach out to us.

- [tl;dw AI](https://www.trytldw.ai/)
- [Code Examples](https://github.com/tldw-ai/example-playbooks)
- [Email](mailto:contact@trytldw.ai)
llama-index-packs-retry-engine-weaviate 0.5.1
llama-index packs retry_engine_weaviate integration
Requires Python: <4.0,>=3.9
Keywords: engine, retry, weaviate

# Retry Query Engine

This LlamaPack inserts your data into [Weaviate](https://weaviate.io/developers/weaviate) and uses the [Retry Query Engine](https://gpt-index.readthedocs.io/en/latest/examples/evaluation/RetryQuery.html) for your RAG application.

## CLI Usage

You can download llamapacks directly using `llamaindex-cli`, which comes installed with the `llama-index` python package:

```bash
llamaindex-cli download-llamapack WeaviateRetryEnginePack --download-dir ./weaviate_pack
```

You can then inspect the files at `./weaviate_pack` and use them as a template for your own project.

## Code Usage

You can download the pack to a the `./weaviate_pack` directory:

```python
from llama_index.core.llama_pack import download_llama_pack

# download and install dependencies
WeaviateRetryEnginePack = download_llama_pack(
    "WeaviateRetryEnginePack", "./weaviate_pack"
)
```

From here, you can use the pack, or inspect and modify the pack in `./weaviate_pack`.

Then, you can set up the pack like so:

```python
# setup pack arguments
from llama_index.core.vector_stores import MetadataInfo, VectorStoreInfo

vector_store_info = VectorStoreInfo(
    content_info="brief biography of celebrities",
    metadata_info=[
        MetadataInfo(
            name="category",
            type="str",
            description=(
                "Category of the celebrity, one of [Sports Entertainment, Business, Music]"
            ),
        ),
    ],
)

import weaviate

client = weaviate.Client()

nodes = [...]

# create the pack
weaviate_pack = WeaviateRetryQueryEnginePack(
    collection_name="test",
    vector_store_info=vector_store_index,
    nodes=nodes,
    client=client,
)
```

The `run()` function is a light wrapper around `query_engine.query()`.

```python
response = weaviate_pack.run("Tell me a bout a Music celebritiy.")
```

You can also use modules individually.

```python
# use the retriever
retriever = weaviate_pack.retriever
nodes = retriever.retrieve("query_str")

# use the query engine
query_engine = weaviate_pack.query_engine
response = query_engine.query("query_str")
```
llama-index-vector-stores-azurecosmosnosql 1.4.1
llama-index vector_stores azurecosmosnosql integration
Requires Python: <4.0,>=3.9

# Azure Cosmos DB for NoSQL Vector Store

This integration makes possible to use [Azure Cosmos DB for NoSQL](https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/)
as a vector store in LlamaIndex.

## Quick start

Install the integration with:

```sh
pip install llama-index-vector-stores-azurecosmosnosql
```

Create the CosmosDB client:

```python
URI = "AZURE_COSMOSDB_URI"
KEY = "AZURE_COSMOSDB_KEY"
client = CosmosClient(URI, credential=KEY)
```

Specify the vector store properties:

```python
indexing_policy = {
    "indexingMode": "consistent",
    "includedPaths": [{"path": "/*"}],
    "excludedPaths": [{"path": '/"_etag"/?'}],
    "vectorIndexes": [{"path": "/embedding", "type": "quantizedFlat"}],
}

vector_embedding_policy = {
    "vectorEmbeddings": [
        {
            "path": "/embedding",
            "dataType": "float32",
            "distanceFunction": "cosine",
            "dimensions": 3072,
        }
    ]
}
```

Create the vector store:

```python
store = AzureCosmosDBNoSqlVectorSearch(
    cosmos_client=client,
    vector_embedding_policy=vector_embedding_policy,
    indexing_policy=indexing_policy,
    cosmos_container_properties={"partition_key": PartitionKey(path="/id")},
    cosmos_database_properties={},
    create_container=True,
)
```

Finally, create the index from a list containing documents:

```python
storage_context = StorageContext.from_defaults(vector_store=store)

index = VectorStoreIndex.from_documents(
    documents, storage_context=storage_context
)
```
llama-index-readers-gitbook 0.4.1
llama-index readers gitbook integration
Requires Python: <4.0,>=3.9
Keywords: gitbook

# LlamaIndex Readers Integration: Gitbook

## Overview

Simple Gitbook Reader allows loading data from a gitbook space. It collects & converts contents from gitbook space into documents used by LlamaIndex.

### Installation

You can install Gitbook Reader via pip:

```bash
pip install llama-index-readers-gitbook
```

### Usage

```python
from llama_index.readers.gitbook import SimpleGitbookReader

# Initialize SimpleGitbookReader
reader = SimpleGitbookReader(
    api_token="<Gitbook API Token>",  # Gitbook API Token
)

# load data from Gitbook
documents = reader.load_data(
    space_id="<Gitbook Space Id>",  # Id of the gitbook space
    metadata_names=None,  # Names of the fields to add to metadata attribute (available: 'path', 'title', 'description', 'parent')
)
```
llama-index-llms-cerebras 0.3.1
llama-index llms cerebras integration
Requires Python: <4.0,>=3.9

# LlamaIndex Llms Integration: Cerebras

At Cerebras, we've developed the world's largest and fastest AI processor, the Wafer-Scale Engine-3 (WSE-3). The Cerebras CS-3 system, powered by the WSE-3, represents a new class of AI supercomputer that sets the standard for generative AI training and inference with unparalleled performance and scalability.

With Cerebras as your inference provider, you can:

- Achieve unprecedented speed for AI inference workloads
- Build commercially with high throughput
- Effortlessly scale your AI workloads with our seamless clustering technology

Our CS-3 systems can be quickly and easily clustered to create the largest AI supercomputers in the world, making it simple to place and run the largest models. Leading corporations, research institutions, and governments are already using Cerebras solutions to develop proprietary models and train popular open-source models.

Want to experience the power of Cerebras? Check out our [website](https://cerebras.net) for more resources and explore options for accessing our technology through the Cerebras Cloud or on-premise deployments!

For more information about Cerebras Cloud, visit [cloud.cerebras.ai](https://cloud.cerebras.ai/). Our API reference is available at [inference-docs.cerebras.ai](https://inference-docs.cerebras.ai/).

## Installation

using poetry:

```shell
poetry add llama-index-llms-cerebras
```

or using pip:

```shell
pip install llama-index-llms-cerebras
```

## Basic Usage

Get an API Key from [cloud.cerebras.ai](https://cloud.cerebras.ai/) and add it to your environment variables:

```
export CEREBRAS_API_KEY=<your api key>
```

Then try out one of these examples:

```python
import os

from llama_index.core.llms import ChatMessage
from llama_index.llms.cerebras import Cerebras

llm = Cerebras(model="llama-3.3-70b", api_key=os.environ["CEREBRAS_API_KEY"])

messages = [
    ChatMessage(
        role="system", content="You are a pirate with a colorful personality"
    ),
    ChatMessage(role="user", content="What is your name"),
]
resp = llm.chat(messages)
print(resp)
```

Or alternatively with streaming:

```python
import os

from llama_index.llms.cerebras import Cerebras

llm = Cerebras(model="llama-3.3-70b", api_key=os.environ["CEREBRAS_API_KEY"])

response = llm.stream_complete("What is Generative AI?")
for r in response:
    print(r.delta, end="")
```
llama-index-tools-yelp 0.4.1
llama-index tools yelp integration
Requires Python: <4.0,>=3.9

# Yelp Tool

This tool connects to Yelp and allows the Agent to search for business and fetch the reviews.

## Usage

This tool has more extensive example usage documented in a Jupyter notebook [here](https://github.com/run-llama/llama_index/blob/main/llama-index-integrations/tools/llama-index-tools-yelp/examples/yelp.ipynb)

Here's an example usage of the YelpToolSpec.

```python
from llama_index.tools.yelp import YelpToolSpec
from llama_index.core.agent.workflow import FunctionAgent
from llama_index.llms.openai import OpenAI


tool_spec = YelpToolSpec(api_key="your-key", client_id="your-id")

agent = FunctionAgent(
    tools=tool_spec.to_tool_list(),
    llm=OpenAI(model="gpt-4.1"),
)

print(await agent.run("what good restaurants are in toronto"))
print(await agent.run("what are the details of lao lao bar"))
```

`business_search`: Use a natural language query to search for businesses
`business_reviews`: Use a business id to fetch reviews

This loader is designed to be used as a way to load data as a Tool in a Agent.
llama-index-tools-yahoo-finance 0.4.1
llama-index tools yahoo_finance integration
Requires Python: <4.0,>=3.9

# Yahoo Finance Tool

This tool connects to Yahoo Finance and allows an Agent to access stock, news, and financial data of a company.

## Installation

pip install llama-index-tools-yahoo-finance

## Usage

Here's an example of how to use this tool:

```python
from llama_index.tools.yahoo_finance import YahooFinanceToolSpec
from llama_index.core.agent.workflow import FunctionAgent
from llama_index.llms.openai import OpenAI

tool_spec = YahooFinanceToolSpec()
agent = FunctionAgent(
    tools=tool_spec.to_tool_list(),
    llm=OpenAI(model="gpt-4.1"),
)

print(await agent.run("What is the price of Apple stock?"))
print(await agent.run("What is the latest news about Apple?"))
```

The tools available are:

`balance_sheet`: A tool that returns the balance sheet of a company.

`income_statement`: A tool that returns the income statement of a company.

`cash_flow`: A tool that returns the cash flow of a company.

`stock_news`: A tool that returns the latest news about a company.

`stock_basic_info`: A tool that returns basic information about a company including price.

`stock_analyst_recommendations`: A tool that returns analyst recommendations for a company.

This loader is designed to be used as a way to load data as a Tool in a Agent.
llama-index-packs-auto-merging-retriever 0.5.1
llama-index packs auto_merging_retriever integration
Requires Python: <4.0,>=3.9
Keywords: auto, automerging, index, merging, retriever

# Auto Merging Retriever Pack

This LlamaPack provides an example of our auto-merging retriever.

This specific template shows the e2e process of building this. It loads
a document, builds a hierarchical node graph (with bigger parent nodes and smaller
child nodes).

Check out the [notebook here](https://github.com/run-llama/llama-hub/blob/main/llama_hub/llama_packs/auto_merging_retriever/auto_merging_retriever.ipynb).

## CLI Usage

You can download llamapacks directly using `llamaindex-cli`, which comes installed with the `llama-index` python package:

```bash
llamaindex-cli download-llamapack AutoMergingRetrieverPack --download-dir ./auto_merging_retriever_pack
```

You can then inspect the files at `./auto_merging_retriever_pack` and use them as a template for your own project.

## Code Usage

You can download the pack to a the `./auto_merging_retriever_pack` directory:

```python
from llama_index.core.llama_pack import download_llama_pack

# download and install dependencies
AutoMergingRetrieverPack = download_llama_pack(
    "AutoMergingRetrieverPack", "./auto_merging_retriever_pack"
)
```

From here, you can use the pack, or inspect and modify the pack in `./auto_merging_retriever_pack`.

Then, you can set up the pack like so:

```python
# create the pack
# get documents from any data loader
auto_merging_retriever_pack = AutoMergingRetrieverPack(
    documents,
)
```

The `run()` function is a light wrapper around `query_engine.query()`.

```python
response = auto_merging_retriever_pack.run(
    "Tell me about what the author did growing up."
)
```

You can also use modules individually.

```python
# get the node parser
node_parser = auto_merging_retriever_pack.node_parser

# get the retriever
retriever = auto_merging_retriever_pack.retriever

# get the query engine
query_engine = auto_merging_retriever_pack.query_engine
```
llama-index-readers-jira 0.5.1
llama-index readers jira integration
Requires Python: <4.0,>=3.9
Keywords: jira

# JIRA Reader

```bash
pip install llama-index-readers-jira
```

The Jira loader returns a set of issues based on the query provided to the dataloader.
We can follow three methods to initialize the loader-
1- basic_auth -> this takes a dict with the following keys
`basic_auth:{
"email": "email",
"api_token": "token",
"server_url": "server_url"
}`
2- Oauth2 -> this takes a dict with the following keys
`oauth:{
"cloud_id": "cloud_id",
"api_token": "token"
}`
3- Personal access Token with Server hosted instance
`PATauth:{
"server_url": "server_url",
"api_token": "token"
}`

You can follow this link for more information regarding Oauth2 -> https://developer.atlassian.com/cloud/confluence/oauth-2-3lo-apps/

## Usage

Here's an example of how to use it

```python
from llama_index.readers.jira import JiraReader

reader = JiraReader(
    email=email, api_token=api_token, server_url="your-jira-server.com"
)
documents = reader.load_data(query="project = <your-project>")
```

Alternately, you can also use download_loader from llama_index

```python
from llama_index.readers.jira import JiraReader

reader = JiraReader(
    email=email, api_token=api_token, server_url="your-jira-server.com"
)
documents = reader.load_data(query="project = <your-project>")
```
llama-index-packs-stock-market-data-query-engine 0.5.1
llama-index packs stock_market_data_query_engine integration
Requires Python: <4.0,>=3.9
Keywords: data, engine, finance, market, query, stock, yahoo, yahoo finance

# Stock Market Data Query Engine Pack

Query and retrieve historical market data for a list of stock tickers. It utilizes Yahoo Finance [(yfinance)](https://pypi.org/project/yfinance/) to fetch historical stock prices.

## CLI Usage

You can download llamapacks directly using `llamaindex-cli`, which comes installed with the `llama-index` python package:

```bash
llamaindex-cli download-llamapack StockMarketDataQueryEnginePack --download-dir ./stock_market_data_pack
```

You can then inspect the files at `./stock_market_data_pack` and use them as a template for your own project.

## Code Usage

You can download the pack to a the `./stock_market_data_pack` directory:

```python
from llama_index.core.llama_pack import download_llama_pack

# download and install dependencies
StockMarketDataQueryEnginePack = download_llama_pack(
    "StockMarketDataQueryEnginePack", "./stock_market_data_pack"
)
```

From here, you can use the pack, or inspect and modify the pack in `./stock_market_data_pack`.

Then, you can set up the pack like so:

```python
# create the pack
stock_market_data_pack = StockMarketDataQueryEnginePack(
    ["MSFT"],
    period="1mo",
)
```

The `run()` function is a light wrapper around `query_engine.query()`.

```python
response = stock_market_data_pack.run(
    "What is the average closing price for MSFT?"
)
```
llama-index-llms-stepfun 1.1.1
llama-index llms stepfun integration
Requires Python: <4.0,>=3.9

# LlamaIndex LLM Integration: Stepfun

## Installation

To install the required packages, run:

```bash
%pip install llama-index-llms-stepfun
!pip install llama-index
```

## Setup

### Initialize StepFun LLM

First, import the necessary libraries and set up your `StepFun` instance. Replace `step-1v-8k`, and `TOKEN` with your model name, and API key, respectively:

```python
import os
from typing import List, Optional
from llama_index.llms.stepfun import StepFun
from llama_index.core.llms import ChatMessage

llm = StepFun(
    api_key="TOKEN",
    max_tokens=256,
    context_window=4096,
    model="step-1v-8k",
)
```

## Chat Functionality

StepFun supports chat APIs, allowing you to handle conversation-like interactions. Here’s how to use it:

```python
from llama_index.llms.stepfun import StepFun
from llama_index.core.llms import ChatMessage

llm = StepFun(
    api_key="",
    max_tokens=256,
    context_window=4096,
    model="step-1v-8k",
)


message = ChatMessage(role="user", content="Tell me a joke")
resp = llm.chat([message])
print(resp)
```
llama-index-vector-stores-hologres 0.4.1
llama-index vector stores hologres integration
Requires Python: <4.0,>=3.9

# LlamaIndex Vector_Stores Integration: Hologres

Please refer to the [notebook](../../../docs/docs/examples/vector_stores/HologresDemo.ipynb) for usage of Hologres as vector store in LlamaIndex.

## Example Usage

```sh
pip install llama-index
pip install llama-index-vector-stores-hologres
```

```python
# Connect to existing instance
from llama_index.core import VectorStoreIndex
from llama_index.vector_stores.hologres import HologresVectorStore

vector_store = HologresVectorStore.from_param(
    host="***",
    port=80,
    user="***",
    password="***",
    database="***",
    table_name="***",
    embedding_dimension=1536,
    pre_delete_table=True,
)

# Create index from existing stored vectors
index = VectorStoreIndex.from_vector_store(vector_store)
query_engine = index.as_query_engine()
response = query_engine.query(
    "What did the author study prior to working on AI?"
)
print(response)
```
llama-index-tools-vectara-query 0.4.1
llama-index tools vectara query integration
Requires Python: <4.0,>=3.9

## Vectara Query Tool

This tool connects to a Vectara corpus and allows agents to make semantic search or retrieval augmented generation (RAG) queries.

## Usage

Please note that this usage example relies on version >=0.3.0.

This tool has a more extensive example usage documented in a Jupyter notebok [here](https://github.com/run-llama/llama_index/blob/main/llama-index-integrations/tools/llama-index-tools-vectara-query/examples/vectara_query.ipynb)

To use this tool, you'll need a Vectara account (If you don't have an account, you can create one [here](https://vectara.com/integrations/llamaindex)) and the following information in your environment:

- `VECTARA_CORPUS_KEY`: The corpus key for the Vectara corpus that you want your tool to search for information. If you need help creating a corpus with your data, follow this [Quick Start](https://docs.vectara.com/docs/quickstart) guide.
- `VECTARA_API_KEY`: An API key that can perform queries on this corpus.

Here's an example usage of the VectaraQueryToolSpec.

```python
from llama_index.tools.vectara_query import VectaraQueryToolSpec
from llama_index.core.agent.workflow import FunctionAgent
from llama_index.llms.openai import OpenAI

# Connecting to a Vectara corpus about Electric Vehicles
tool_spec = VectaraQueryToolSpec()

agent = FunctionAgent(
    tools=tool_spec.to_tool_list(),
    llm=OpenAI(model="gpt-4.1"),
)

print(await agent.run("What are the different types of electric vehicles?"))
```

The available tools are:

`semantic_search`: A tool that accepts a query and uses semantic search to obtain the top search results.

`rag_query`: A tool that accepts a query and uses RAG to obtain a generative response grounded in the search results.
llama-index-packs-snowflake-query-engine 0.5.1
llama-index packs snowflake_query_engine integration
Requires Python: <4.0,>=3.9
Keywords: engine, query, snowflake

# Snowflake Query Engine Pack

This LlamaPack uses `snowflake-sqlalchemy` to connect to Snowflake, then calls `NLSQLTableQueryEngine` to query data.

## Usage

You can download the pack to a the `./snowflake_pack` directory:

```python
from llama_index.core.llama_pack import download_llama_pack

# download and install dependencies
SnowflakeQueryEnginePack = download_llama_pack(
    "SnowflakeQueryEnginePack", "./snowflake_pack"
)
```

From here, you can use the pack, or inspect and modify the pack in `./snowflake_pack`.

`NLSQLTableQueryEngine` uses OpenAI models by default, ensure you set your OpenAI API key.

You can set up the pack by passing in the Snowflake connection details and the table(s):

```python
# create the pack
snowflake_pack = SnowflakeQueryEnginePack(
    user="<USER>",
    password="<PASSWORD>",
    account="<ORG>-<ACCOUNT>",
    database="<DATABASE>",
    schema="<SCHEMA>",
    warehouse="<WAREHOUSE>",
    role="<ROLE>",
    tables=["<TABLE1>", "<TABLE2>", ...],
)
```

The `run()` function is a light wrapper around `query_engine.query()`. See below a sample query run. You can add additional prompt in the query text.

```python
response = snowflake_pack.run(
    "Give me the repo id with the most stars on 2023-12-01."
)
```