semvec/pypi-packages huggingface dataset:
llama-index-tools-azure-translate 0.4.1
llama-index tools azure_translate integration
Requires Python: <4.0,>=3.9

# Azure Translate Tool

This tool connects to a Azure account and allows an Agent to perform text translation into a variet of different languages

You will need to set up an api key and translate instance using Azure, learn more here: https://learn.microsoft.com/en-us/azure/ai-services/translator/translator-overview

For a full list of supported languages see here: https://learn.microsoft.com/en-us/azure/ai-services/translator/language-support

This tool has a 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-azure-speech/examples/azure_speech.ipynb)

## Usage

Here's an example usage of the AzureTranslateToolSpec.

```python
from llama_index.core.agent.workflow import FunctionAgent
from llama_index.llms.openai import OpenAI
from llama_index.tools.azure_translate import AzureTranslateToolSpec

translate_tool = AzureTranslateToolSpec(api_key="your-key", region="eastus")

agent = FunctionAgent(
    tools=translate_tool.to_tool_list(),
    llm=OpenAI(model="gpt-4.1"),
)
print(await agent.run('Say "hello world" in 5 different languages'))
```

`translate`: Translate text to a target language

This loader is designed to be used as a way to load data as a Tool in a Agent.
llama-index-packs-multi-tenancy-rag 0.5.1
llama-index packs multi_tenancy_rag integration
Requires Python: <4.0,>=3.9
Keywords: multi, multi-tenancy, rag, tenancy

# Multi-Tenancy RAG Pack

Create a Multi-Tenancy RAG using VectorStoreIndex.

## CLI Usage

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

```bash
llamaindex-cli download-llamapack MultiTenancyRAGPack --download-dir ./multitenancy_rag_pack
```

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

## Code Usage

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

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

# download and install dependencies
MultiTenancyRAGPack = download_llama_pack(
    "MultiTenancyRAGPack", "./multitenancy_rag_pack"
)

# You can use any llama-hub loader to get documents and add them to index for a user!
multitenancy_rag_pack = MultiTenancyRAGPack()
multitenancy_rag_pack.add(documents, "<user>")
```

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

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

```python
response = multitenancy_rag_pack.run(
    "<user query>", user="<user>", similarity_top_k=2
)
```

You can also use modules individually.

```python
# Use the index directly
index = multitenancy_rag_pack.index
query_engine = index.as_query_engine(
    filters=MetadataFilters(
        filters=[
            ExactMatchFilter(
                key="user",
                value="<user>",
            )
        ]
    )
)
retriever = index.as_retriever(
    filters=MetadataFilters(
        filters=[
            ExactMatchFilter(
                key="user",
                value="<user>",
            )
        ]
    )
)
```
llama-index-readers-guru 0.4.1
llama-index readers guru integration
Requires Python: <4.0,>=3.9
Keywords: getguru, guru, knowledge base

# Guru Loader

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

This loader loads documents from [Guru](https://www.getguru.com/). The user specifies a username and api key to initialize the GuruReader.

Note this is not your password. You need to create a new api key in the admin tab of the portal.

## Usage

Here's an example usage of the GuruReader.

```python
from llama_index.readers.guru import GuruReader

reader = GuruReader(username="<GURU_USERNAME>", api_key="<GURU_API_KEY>")

# Load all documents in a collection
documents = reader.load_data(
    collection_ids=["<COLLECTION_ID_1>", "<COLLECTION_ID_2>"]
)

# Load specific cards by card id
documents = reader.load_data(card_ids=["<CARD_ID_1>", "<CARD_ID_2>"])
```

This loader is designed to be used as a way to load data into [LlamaIndex](https://github.com/run-llama/llama_index/).
llama-index-tools-azure-speech 0.4.1
llama-index tools azure_speech integration
Requires Python: <4.0,>=3.9

# Azure Speech Tool

This tool allows Agents to use Microsoft Azure speech services to transcribe audio files to text, and create audio files from text. To see more and get started, visit https://azure.microsoft.com/en-us/products/ai-services/ai-speech

## Usage

This tool has a 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-azure-speech/examples/azure_speech.ipynb)

```python
from llama_index.tools.azure_speech import AzureSpeechToolSpec
from llama_index.core.agent.workflow import FunctionAgent
from llama_index.llms.openai import OpenAI

speech_tool = AzureSpeechToolSpec(speech_key="your-key", region="eastus")

agent = FunctionAgent(
    tools=speech_tool.to_tool_list(),
    llm=OpenAI(model="gpt-4.1"),
)
print(await agent.run('Say "hello world"'))
print(
    await agent.run(
        "summarize the data/speech.wav audio file into a few sentences"
    )
)
```

`text_to_speech`: Takes an input string and synthesizes audio to play on the users computer
`speech_to_text`: Takes a .wav file and transcribes it into text

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

# LlamaIndex Llms Integration: `mistral.rs`

To use this integration, please install the Python `mistralrs` package:

## Installation of `mistralrs` from PyPi

0. Install Rust: https://rustup.rs/

   ```bash
   curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
   source $HOME/.cargo/env
   ```

1. `mistralrs` depends on the `openssl` library.

To install it on Ubuntu:

```
sudo apt install libssl-dev
sudo apt install pkg-config
```

2. Install it!

- CUDA

  `pip install mistralrs-cuda`

- Metal

  `pip install mistralrs-metal`

- Apple Accelerate

  `pip install mistralrs-accelerate`

- Intel MKL

  `pip install mistralrs-mkl`

- Without accelerators

  `pip install mistralrs`

All installations will install the `mistralrs` package. The suffix on the package installed by `pip` only controls the feature activation.

## Installation from source

Please follow the instructions [here](https://github.com/EricLBuehler/mistral.rs/blob/master/mistralrs-pyo3/README.md).

## Usage

```python
from llama_index.llms.mistral_rs import MistralRS
from mistralrs import Which

llm = MistralRS(
    which=Which.GGUF(
        tok_model_id="mistralai/Mistral-7B-Instruct-v0.1",
        quantized_model_id="TheBloke/Mistral-7B-Instruct-v0.1-GGUF",
        quantized_filename="mistral-7b-instruct-v0.1.Q4_K_M.gguf",
        tokenizer_json=None,
        repeat_last_n=64,
    ),
    max_new_tokens=4096,
    context_window=1024 * 5,
)
```
llama-index-readers-twitter 0.4.1
llama-index readers twitter integration
Requires Python: <4.0,>=3.9

# LlamaIndex Readers Integration: TwitterTweet

## Overview

The TwitterTweet Reader allows you to read tweets of a specified Twitter handle. It retrieves tweets from Twitter using the Twitter API.

### Installation

You can install the TwitterTweet Reader via pip:

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

Check [Twitter API](https://developer.twitter.com/en/docs/twitter-api/getting-started/getting-access-to-the-twitter-api) on how to get access to twitter API.

### Usage

```python
from llama_index.readers.twitter import TwitterTweetReader

# Initialize TwitterTweetReader
reader = TwitterTweetReader(
    bearer_token="<Twitter Bearer Token>", num_tweets=100
)

# Load tweets of user twitter handles
documents = reader.load_data(twitterhandles=["user1", "user2"])
```

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-readers-mangadex 0.4.1
llama-index readers mangadex integration
Requires Python: <4.0,>=3.9
Keywords: anime, manga

# MangaDex Loader

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

This loader fetches information from the MangaDex API, by manga title.

## Usage

```python
from llama_index.readers.mangadex import MangaDexReader

loader = MangaDexReader()
documents = loader.load_data(
    titles=["manga title 1", "manga title 2"], lang="en"
)
```

## Output

### Text

Document text is the manga title. There are alternate titles for many manga, so the canonical title will be returned, even if it is not the title that the user queried with.

### Extra Info

| Data                              | Description                                                                                        |
| --------------------------------- | -------------------------------------------------------------------------------------------------- |
| id (str)                          | MangaDex manga id                                                                                  |
| author (str)                      | Author's full name                                                                                 |
| artist (str)                      | Artist's full name                                                                                 |
| description (str)                 | Manga description                                                                                  |
| original_language (str)           | The language of the source material (before translation)                                           |
| tags (List[str])                  | Describes the manga's genre, e.g. "slice of life"                                                  |
| chapter_count (int)               | How many chapters exist in the requested language                                                  |
| latest_chapter_published_at (str) | Timestamp (YYYY-MM-DDTHH:MM:SS in timezone UTC+0) for the latest chapter in the requested language |

## Examples

This loader is designed to be used as a way to load data into [LlamaIndex](https://github.com/run-llama/llama_index/).
llama-index-packs-deeplake-deepmemory-retriever 0.4.1
llama-index packs deeplake_deepmemory_retriever integration
Requires Python: <4.0,>=3.9
Keywords: deeplake, deepmemory, retriever

# DeepLake DeepMemory Pack

This LlamaPack inserts your data into deeplake and instantiates a [deepmemory](https://docs.activeloop.ai/performance-features/deep-memory) retriever, which will use deepmemory during runtime to increase RAG's retrieval accuracy (recall).

## CLI Usage

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

```bash
llamaindex-cli download-llamapack DeepMemoryRetrieverPack --download-dir ./deepmemory_pack
```

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

## Code Usage

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

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

# download and install dependencies
DeepMemoryRetriever = download_llama_pack(
    "DeepMemoryRetrieverPack", "./deepmemory_pack"
)
```

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

Then, you can set up the pack like so:

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

nodes = [...]

# create the pack
deepmemory_pack = DeepMemoryRetriever(
    dataset_path="llama_index",
    overwrite=False,
    nodes=nodes,
)
```

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

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

You can also use modules individually.

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

# use the query engine
query_engine = deepmemory_pack.query_engine
response = query_engine.query("query_str")
```
llama-index-postprocessor-jinaai-rerank 0.4.1
llama-index postprocessor jinaai rerank integration
Requires Python: <4.0,>=3.9

# LlamaIndex Postprocessor Integration: Jina AI Rerank

Jina Rerank is based on [Jina Reranking](), which is a state-of-the-art reranking model in terms of

1. Input context length - Jina Reranking is capable of accepting 8K-length input context
2. Reranking performance - Jina Reranking outperforms other models on Mean Reciprocal Rank (MRR) and hit-rate, as shown in these [benchmarks]().

Please `pip install llama-index-postprocessor-jinaai-rerank` to install Jina Rerank package.
llama-index-readers-pdb 0.4.1
llama-index readers pdb integration
Requires Python: <4.0,>=3.9
Keywords: Protein Data Bank, academic papers, pdb, proteins

# Protein Data Bank (PDB) publication Loader

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

This loader fetches the abstract of PDB entries using the RCSB (Research Collaboratory for Structural Bioinformatics) or EBI (European Bioinformatics Institute) REST api.

## Usage

To use this loader, simply pass an array of PDB ids into `load_data`:

```python
from llama_index.readers.pdb import PdbAbstractReader

loader = PdbAbstractReader()
documents = loader.load_data(pdb_id=["1cbs"])
```

This loader is designed to be used as a way to load data into [LlamaIndex](https://github.com/run-llama/llama_index/).
llama-index-readers-couchbase 0.4.1
llama-index readers couchbase integration
Requires Python: <4.0,>=3.9
Keywords: Capella, Couchbase, NoSQL

# LlamaIndex Readers Integration: Couchbase

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

This loader loads documents from Couchbase cluster.
The user specifies a Couchbase client or credentials to initialize the reader. They can specify the SQL++ query to
fetch the relevant docs.

## Usage

Here's an example usage of the CouchbaseReader.

```python
import os

from llama_index.readers.couchbase import CouchbaseReader

connection_string = (
    "couchbase://localhost"  # valid Couchbase connection string
)
db_username = "<valid_database_user_with_read_access_to_bucket_with_data>"
db_password = "<password_for_database_user>"

# query is a valid SQL++ query that is passed to client.query()
query = """
    SELECT h.* FROM `travel-sample`.inventory.hotel h
        WHERE h.country = 'United States'
        LIMIT 5
        """

reader = CouchbaseLoader(
    connection_string=connection_string,
    db_username=db_username,
    db_password=db_password,
)

# It is also possible to pass an initialized Couchbase client to the document loader
# from couchbase.auth import PasswordAuthenticator  # noqa: E402
# from couchbase.cluster import Cluster # noqa: E402
# from couchbase.options import ClusterOptions # noqa: E402

# auth = PasswordAuthenticator(
#    db_username,
#    db_password,
# )

# couchbase_client = Cluster(connection_string, ClusterOptions(auth))
# reader = CouchbaseLoader(client=couchbase_client)

# fields to be written to the document
text_fields = ["name", "title", "address", "reviews"]

# metadata fields to be written to the document's metadata
metadata_fields = (["country", "city"],)

documents = reader.load_data(
    query=query, text_fields=text_fields, metadata_fields=metadata_fields
)
```

This loader is designed to be used as a way to load data into [LlamaIndex](https://github.com/run-llama/llama_index/). See [here](https://github.com/run-llama/llama-hub/tree/main) for examples.
llama-index-storage-chat-store-upstash 0.3.1
llama-index storage-chat-store upstash integration
Requires Python: <4.0,>=3.9

# LlamaIndex Chat_Store Integration: Upstash Chat Store

## Installation

`pip install llama-index-storage-chat-store-upstash`

## Usage

```python
from llama_index.storage.chat_store.upstash import UpstashChatStore
from llama_index.core.memory import ChatMemoryBuffer

chat_store = UpstashChatStore(
    redis_url="YOUR_UPSTASH_REDIS_URL",
    redis_token="YOUR_UPSTASH_REDIS_TOKEN",
    ttl=300,  # Optional: Time to live in seconds
)

chat_memory = ChatMemoryBuffer.from_defaults(
    token_limit=3000,
    chat_store=chat_store,
    chat_store_key="user1",
)
```

UpstashChatStore supports both synchronous and asynchronous operations. Here's an example of using async methods:

```python
import asyncio
from llama_index.core.llms import ChatMessage


async def main():
    # Add messages
    messages = [
        ChatMessage(content="Hello", role="user"),
        ChatMessage(content="Hi there!", role="assistant"),
    ]
    await chat_store.async_set_messages("conversation1", messages)

    # Retrieve messages
    retrieved_messages = await chat_store.async_get_messages("conversation1")
    print(retrieved_messages)

    # Delete last message
    deleted_message = await chat_store.async_delete_last_message(
        "conversation1"
    )
    print(f"Deleted message: {deleted_message}")


asyncio.run(main())
```
llama-index-graph-stores-neptune 0.4.1
llama-index graph stores amazon neptune integration
Requires Python: <4.0,>=3.9

# LlamaIndex Graph_Stores Integration: Neptune

Amazon Neptune makes it easy to work with graph data in the AWS Cloud. Amazon Neptune includes both Neptune Database and Neptune Analytics.

Neptune Database is a serverless graph database designed for optimal scalability and availability. It provides a solution for graph database workloads that need to scale to 100,000 queries per second, Multi-AZ high availability, and multi-Region deployments. You can use Neptune Database for social networking, fraud alerting, and Customer 360 applications.

Neptune Analytics is an analytics database engine that can quickly analyze large amounts of graph data in memory to get insights and find trends. Neptune Analytics is a solution for quickly analyzing existing graph databases or graph datasets stored in a data lake. It uses popular graph analytic algorithms and low-latency analytic queries.

In this project, we integrate both Neptune Database and Neptune Analytics as the graph store to store the LlamaIndex graph data,

and use openCypher to query the graph data. so that people can use Neptune to interact with LlamaIndex graph index.

- Neptune Database

  - Property Graph Store: `NeptuneDatabasePropertyGraphStore`
  - Knowledge Graph Store: `NeptuneDatabaseGraphStore`

- Neptune Analytics
  - Property Graph Store: `NeptuneAnalyticsPropertyGraphStore`
  - Knowledge Graph Store: `NeptuneAnalyticsGraphStore`

## Installation

```shell
pip install llama-index llama-index-graph-stores-neptune
```

## Usage

### Property Graph Store

Please checkout this [tutorial](https://github.com/run-llama/llama_index/blob/main/docs/docs/examples/property_graph/property_graph_neptune.ipynb) to learn how to use Amazon Neptune with LlamaIndex.

### Knowledge Graph Store

Checkout this [tutorial](https://github.com/run-llama/llama_index/blob/main/docs/docs/examples/index_structs/knowledge_graph/NeptuneDatabaseKGIndexDemo.ipynb) to learn how to use Amazon Neptune with LlamaIndex.
llama-index-readers-airtable 0.4.1
llama-index readers airtable integration
Requires Python: <4.0,>=3.9

# Airtable Loader

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

This loader loads documents from Airtable. The user specifies an API token to initialize the AirtableReader. They then specify a `table_id` and a `base_id` to load in the corresponding Document objects.

## Usage

Here's an example usage of the AirtableReader.

```python
import os

from llama_index.readers.airtable import AirtableReader

reader = AirtableReader("<Airtable_TOKEN>")
documents = reader.load_data(table_id="<TABLE_ID>", base_id="<BASE_ID>")
```

This loader is designed to be used as a way to load data into [LlamaIndex](https://github.com/run-llama/llama_index/).
llama-index-multi-modal-llms-openai-like 0.2.1
llama-index multi-modal-llms openai-like integration
Requires Python: <4.0,>=3.9

# LlamaIndex Llms Integration: Openai Like

## Overview

This package is a thin wrapper around the OpenAI API. It is designed to be used with the OpenAI API, but can be used with any OpenAI-compatible API into multimodal language models of the LlamaIndex framework.

## Installation

```bash
pip install llama-index-multi-modal-llms-openai-like
```

## Usage

### Initialization

```python
from llama_index.multi_modal_llms.openai_like import OpenAILikeMultiModal

llm = OpenAILikeMultiModal(
    model="Qwen/Qwen2-VL-72B-Instruct-base",
    api_base="http://localhost:1234/v1",
)
```

#### Without environmental variables

```python
from llama_index.multi_modal_llms.openai_like import OpenAILikeMultiModal

llm = OpenAILikeMultiModal(
    api_key="your_api_key",
    model="Qwen/Qwen2-VL-72B-Instruct-base",
    api_base="http://localhost:1234/v1",
)
```

### Launching

#### Load images

```python
from llama_index.core.multi_modal_llms.generic_utils import load_image_urls

image_urls = [
    "https://res.cloudinary.com/hello-tickets/image/upload/c_limit,f_auto,q_auto,w_1920/v1640835927/o3pfl41q7m5bj8jardk0.jpg",
]
image_documents = load_image_urls(image_urls)
```

#### Call `complete` with a prompt

```python
complete_response = mm_llm.complete(
    prompt="Describe the images as an alternative text",
    image_documents=image_documents,
)
```
llama-index-readers-zyte-serp 0.3.1
llama-index readers zyte-serp integration
Requires Python: <4.0,>=3.9

# LlamaIndex Readers Integration: Zyte-Serp

ZyteSerp can be used to add organic search results from Google Search. It takes a `query` and returns top search results urls.

## Instructions for ZyteSerpReader

### Setup and Installation

`pip install llama-index-readers-zyte-serp`

Secure an API key from [Zyte](https://www.zyte.com/zyte-api/) to access the Zyte services.

### Using ZyteSerpReader

- **Initialization**: Initialize the ZyteSerpReader by providing the API key and the option for extraction ("httpResponseBody" or "browserHtml").

  ```python
  from llama_index.readers.zyte_serp import ZyteSerpReader

  zyte_serp = ZyteSerpReader(
      api_key="your_api_key_here",
      extract_from="httpResponseBody",  # or "browserHtml"
  )
  ```

- **Loading Data**: To load search results, use the `load_data` method with the query you wish to search.

```python
documents = zyte_serp.load_data(query="llama index docs")
```

### Example Usage

Here is an example demonstrating how to initialize the ZyteSerpReader and get top search URLs.
Further the content from these URLs can be loaded using ZyteWebReader in "article" mode to obtain just the article content from webpage.

```python
from llama_index.readers.zyte_serp import ZyteSerpReader
from llama_index.readers.web.zyte.base import ZyteWebReader

# Initialize the ZyteSerpReader with your API key
zyte_serp = ZyteSerpReader(
    api_key="your_api_key_here",  # Replace with your actual API key
)

# Get the search results (URLs from google search results)
search_urls = zyte_serp.load_data(query="llama index docs")

# Display the results
print(search_urls)

urls = [result.text for result in search_urls]

# Initialize the ZyteWebReader to load the content from search results
zyte_web = ZyteWebReader(
    api_key="your_api_key_here",  # Replace with your actual API key
    mode="article",
)

documents = zyte_web.load_data(urls)
print(documents)
```