semvec/pypi-packages huggingface dataset:
llama-index-llms-contextual 0.1.1
llama-index contextual integration
Requires Python: <4.0,>=3.9

# Contextual LLM Integration for LlamaIndex

This package provides a Contextual LLM integration for LlamaIndex.

## Installation

```bash
pip install llama-index-llms-contextual
```

## Usage

```python
from llama_index.llms.contextual import Contextual

llm = Contextual(model="contextual-clm", api_key="your_api_key")

response = llm.complete("Explain the importance of Grounded Language Models.")
```

See [Colab Notebook](https://colab.research.google.com/github/run-llama/llama_index/blob/main/llama-index-integrations/llms/llama-index-llms-contextual/llama_index/llms/contextual/test-contextual.ipynb) for more examples.
llama-index-readers-bagel 0.4.1
llama-index readers bagel integration
Requires Python: <4.0,>=3.10
Keywords: bagelDB, database, storage, vector

# LlamaIndex Readers Integration: Bagel

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

## Bagel Loader

## Usage

```python
from llama_index.core.schema import Document
from llama_index.readers.bagel import BagelReader

# Initialize BagelReader with the collection name
reader = BagelReader(collection_name="example_collection")

# Load data from Bagel
documents = reader.load_data(
    query_vector=None,
    query_texts=["example text"],
    limit=10,
    where=None,
    where_document=None,
    include=["documents", "embeddings"],
)
```

## Features

- Retrieve documents, embeddings, and metadata efficiently.
- Filter results based on specified conditions.
- Specify what data to include in the retrieved results.

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-airbyte-gong 0.4.1
llama-index readers airbyte_gong integration
Requires Python: <4.0,>=3.9

# Airbyte Gong Loader

```bash
pip install llama-index-readers-airbyte-gong
```

The Airbyte Gong Loader allows you to access different Gong objects.

## Usage

Here's an example usage of the AirbyteGongReader.

```python
from llama_index.readers.airbyte_gong import AirbyteGongReader

gong_config = {
    # ...
}
reader = AirbyteGongReader(config=gong_config)
documents = reader.load_data(stream_name="calls")
```

## Configuration

Check out the [Airbyte documentation page](https://docs.airbyte.com/integrations/sources/gong/) for details about how to configure the reader.
The JSON schema the config object should adhere to can be found on Github: [https://github.com/airbytehq/airbyte/blob/master/airbyte-integrations/connectors/source-gong/source_gong/spec.yaml](https://github.com/airbytehq/airbyte/blob/master/airbyte-integrations/connectors/source-gong/source_gong/spec.yaml).

The general shape looks like this:

```python
{
    "access_key": "<access key name>",
    "access_key_secret": "<access key secret>",
    "start_date": "<date from which to start retrieving records from in ISO format, e.g. 2020-10-20T00:00:00Z>",
}
```

By default all fields are stored as metadata in the documents and the text is set to the JSON representation of all the fields. Construct the text of the document by passing a `record_handler` to the reader:

```python
def handle_record(record, id):
    return Document(
        doc_id=id, text=record.data["title"], extra_info=record.data
    )


reader = AirbyteGongReader(config=gong_config, record_handler=handle_record)
```

## Lazy loads

The `reader.load_data` endpoint will collect all documents and return them as a list. If there are a large number of documents, this can cause issues. By using `reader.lazy_load_data` instead, an iterator is returned which can be consumed document by document without the need to keep all documents in memory.

## Incremental loads

This loader supports loading data incrementally (only returning documents that weren't loaded last time or got updated in the meantime):

```python
reader = AirbyteGongReader(config={...})
documents = reader.load_data(stream_name="calls")
current_state = reader.last_state  # can be pickled away or stored otherwise

updated_documents = reader.load_data(
    stream_name="calls", state=current_state
)  # only loads documents that were updated since last time
```

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

# LlamaIndex Vector_Stores Integration: Lindorm

- LindormVectorStore support pure vector search, search with metadata filtering, hybrid search, async, etc.
- Please refer to the [notebook](../../../docs/docs/examples/vector_stores/LindormDemo.ipynb) for usage of Lindorm as vector store in LlamaIndex.

# Example Usage

```sh
pip install llama-index
pip install opensearch-py
pip install llama-index-vector-stores-lindorm
```

```python
from llama_index.vector_stores.lindorm import (
    LindormVectorStore,
    LindormVectorClient,
)

# how to obtain an lindorm search instance:
# https://alibabacloud.com/help/en/lindorm/latest/create-an-instance

# how to access your lindorm search instance:
# https://www.alibabacloud.com/help/en/lindorm/latest/view-endpoints

# run curl commands to connect to and use LindormSearch:
# https://www.alibabacloud.com/help/en/lindorm/latest/connect-and-use-the-search-engine-with-the-curl-command

# lindorm instance info
host = "ld-bp******jm*******-proxy-search-pub.lindorm.aliyuncs.com"
port = 30070
username = "your_username"
password = "your_password"

# index to demonstrate the VectorStore impl
index_name = "lindorm_test_index"

# extension param of lindorm search, number of cluster units to query; between 1 and method.parameters.nlist.
nprobe = "a number(string type)"

# extension param of lindorm search, usually used to improve recall accuracy, but it increases performance overhead;
#   between 1 and 200; default: 10.
reorder_factor = "a number(string type)"

# LindormVectorClient encapsulates logic for a single index with vector search enabled
client = LindormVectorClient(
    host=host,
    port=port,
    username=username,
    password=password,
    index=index_name,
    dimension=1536,  # match with your embedding model
    nprobe=nprobe,
    reorder_factor=reorder_factor,
    # filter_type="pre_filter/post_filter(default)"
)

# initialize vector store
vector_store = LindormVectorStore(client)
```
llama-index-readers-mondaydotcom 0.4.1
llama-index readers mondaydotcom integration
Requires Python: <4.0,>=3.9
Keywords: monday, mondaydotcom

# Monday Loader

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

This loader loads data from monday.com. The user specifies an API token to initialize the MondayReader. They then specify a monday.com board id to load in the corresponding Document objects.

## Usage

Here's an example usage of the MondayReader.

```python
from llama_index.readers.mondaydotcom import MondayReader

reader = MondayReader("<monday_api_token>")
documents = reader.load_data("<board_id: int>")
```

Check out monday.com API docs - [here](https://developer.monday.com/apps/docs/mondayapi)

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/jerryjliu/llama_index) for examples.
llama-index-readers-gpt-repo 0.4.1
llama-index readers gpt_repo integration
Requires Python: <4.0,>=3.9

# GPT Repository Loader

```bash
pip install llama-index-readers-gpt-repo
```

This loader is an adaptation of https://github.com/mpoon/gpt-repository-loader
to LlamaIndex. Full credit goes to mpoon for coming up with this!

## Usage

To use this loader, you need to pass in a path to a local Git repository

```python
from llama_index.readers.gpt_repo import GPTRepoReader

loader = GPTRepoReader()
documents = loader.load_data(
    repo_path="/path/to/git/repo",
    preamble_str="<text to put at beginning of Document>",
)
```

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

# LlamaIndex Retrievers Integration: Galaxia

## Galaxia Knowledge Base

> Galaxia Knowledge Base is an integrated knowledge base and retrieval mechanism for RAG. In contrast to standard solution, it is based on Knowledge Graphs built using symbolic NLP and Knowledge Representation solutions. Provided texts are analysed and transformed into Graphs containing text, language and semantic information. This rich structure allows for retrieval that is based on semantic information, not on vector similarity/distance.

Implementing RAG using Galaxia involves first uploading your files to [Galaxia](https://beta.cloud.smabbler.com/home), analyzing them there and then building a model (knowledge graph). When the model is built, you can use `GalaxiaRetriever` to connect to the API and start retrieving.

## Installation

```
pip install llama-index-retrievers-galaxia
```

## Usage

```
from llama_index.retrievers.galaxia import GalaxiaRetriever
from llama_index.core.schema import QueryBundle

retriever = GalaxiaRetriever(
    api_url="beta.api.smabbler.com",
    api_key="<key>",
    knowledge_base_id="<knowledge_base_id>",
)

result = retriever._retrieve(QueryBundle(
    "<test question>"
))

print(result)

```
llama-index-llms-optimum-intel 0.4.1
llama-index llms optimum intel integration
Requires Python: <4.0,>=3.9

# LlamaIndex Llms Integration: Optimum Intel IPEX backend

## Installation

To install the required packages, run:

```bash
%pip install llama-index-llms-optimum-intel
!pip install llama-index
```

## Setup

### Define Functions for Prompt Handling

You will need functions to convert messages and completions into prompts:

```python
from llama_index.llms.optimum_intel import OptimumIntelLLM


def messages_to_prompt(messages):
    prompt = ""
    for message in messages:
        if message.role == "system":
            prompt += f"
\n{message.content}
\n"
        elif message.role == "user":
            prompt += f"
\n{message.content}
\n"
        elif message.role == "assistant":
            prompt += f"
\n{message.content}
\n"

    # Ensure we start with a system prompt, insert blank if needed
    if not prompt.startswith("
\n"):
        prompt = "
\n
\n" + prompt

    # Add final assistant prompt
    prompt = prompt + "
\n"

    return prompt


def completion_to_prompt(completion):
    return f"
\n
\n
\n{completion}
\n
\n"
```

### Model Loading

Models can be loaded by specifying parameters using the `OptimumIntelLLM` method:

```python
oi_llm = OptimumIntelLLM(
    model_name="Intel/neural-chat-7b-v3-3",
    tokenizer_name="Intel/neural-chat-7b-v3-3",
    context_window=3900,
    max_new_tokens=256,
    generate_kwargs={"temperature": 0.7, "top_k": 50, "top_p": 0.95},
    messages_to_prompt=messages_to_prompt,
    completion_to_prompt=completion_to_prompt,
    device_map="cpu",
)

response = oi_llm.complete("What is the meaning of life?")
print(str(response))
```

### Streaming Responses

To use the streaming capabilities, you can use the `stream_complete` and `stream_chat` methods:

#### Using `stream_complete`

```python
response = oi_llm.stream_complete("Who is Mother Teresa?")
for r in response:
    print(r.delta, end="")
```

#### Using `stream_chat`

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

messages = [
    ChatMessage(
        role="system",
        content="You are an American chef in a small restaurant in New Orleans",
    ),
    ChatMessage(role="user", content="What is your dish of the day?"),
]

resp = oi_llm.stream_chat(messages)

for r in resp:
    print(r.delta, end="")
```

### LLM Implementation example

https://docs.llamaindex.ai/en/stable/examples/llm/optimum_intel/
llama-index-readers-microsoft-outlook-emails 0.2.1
llama-index readers microsoft_outlook_emails integration
Requires Python: <4.0,>=3.9
Keywords: emails, microsoft 365, microsoft365, outlook

# Microsoft Outlook Email Reader

```bash
pip install llama-index-readers-microsoft-outlook-emails
```

The loader retrieves emails from an Outlook mailbox and indexes the subject and body of the emails.

## Prerequisites

### App Authentication using Microsoft Entra ID (formerly Azure AD)

1. You need to create an App Registration in Microsoft Entra ID. Refer [here](https://learn.microsoft.com/en-us/azure/healthcare-apis/register-application)
2. API Permissions for the created app:
   1. Microsoft Graph --> Application Permissions --> Mail.Read (**Grant Admin Consent**)

More info on Microsoft Graph APIs - [Refer here](https://learn.microsoft.com/en-us/graph/permissions-reference)

## Usage

To use this loader, `client_id`, `client_secret`, and `tenant_id` of the registered app in Microsoft Azure Portal are required.

This loader fetches emails from a specified folder in an Outlook mailbox.

```python
from llama_index.readers.outlook_emails import OutlookEmailReader

loader = OutlookEmailReader(
    client_id="<Client ID of the app>",
    client_secret="<Client Secret of the app>",
    tenant_id="<Tenant ID of the Microsoft Azure Directory>",
    user_email="<User Email Address>",
    folder="Inbox",
    num_mails=10,
)

documents = loader.load_data()
```

The loader retrieves the subject and body of the emails from the specified folder in Outlook.
llama-index-retrievers-videodb 0.4.1
llama-index VideoDB Retriever integration
Requires Python: <4.0,>=3.9

# VideoDB Retriever

## Overview

[VideoDB](https://videodb.io) is a serverless database designed to streamline the storage, search, editing, and streaming of video content. VideoDB offers random access to sequential video data by building indexes and developing interfaces for querying and browsing video content. Learn more at [docs.videodb.io](https://docs.videodb.io).

## Getting Started

### Prerequisites

- Obtain API keys from [VideoDB dashboard](https://console.videodb.io)

### Installation

Install the necessary packages with the following command:

```
pip install llama-index llama-index-retrievers-videodb videodb
```

## Building Your Pipeline

1. **Data Ingestion**: Upload your videos to VideoDB and leverage its managed indexing for efficient data organization, choosing between semantic or scene-based indexing.
2. **Querying**: Utilize `VideoDBRetriever` to retrieve relevant video segments and `llama-index` for constructing your RAG pipeline, enhancing your LLM's context with video-based insights.

## 👨‍👩‍👧‍👦 Support & Community

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

- [Discord](https://discord.gg/py9P639jGz)
- [Github](https://github.com/video-db)
- [VideoDB](https://videodb.io)
- [Email](mailto:ashu@videodb.io)
llama-index-readers-dad-jokes 0.4.1
llama-index readers dad_jokes integration
Requires Python: <4.0,>=3.9
Keywords: dad jokes, jokes

# DadJoke Loader

```bash
pip install llama-index-readers-dad-jokes
```

This loader fetches a joke from icanhazdadjoke.

## Usage

To use this loader, load it.

```python
from llama_index.readers.dad_jokes import DadJokesReader

loader = DadJokesReader()
documents = loader.load_data()
```

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-legacy-office 0.2.1
LlamaIndex Legacy Office Reader, handles .doc files loading with Apache Tika
Requires Python: <4.0,>=3.9

# LlamaIndex Legacy Office Reader

<a href="https://colab.research.google.com/github/run-llama/llama_index/blob/main/docs/docs/examples/data_connectors/lagecy_office_reader.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>

## Overview

The Legacy Office Reader allows loading data from legacy Office documents (like Word 97 `.doc` files) using Apache Tika. It runs the Tika server locally to avoid remote server calls.

### Installation

You can install the Legacy Office Reader via pip:

```bash
pip install llama-index-readers-legacy-office
```

### Usage

#### Basic Usage

```python
from llama_index.readers.legacy_office import LegacyOfficeReader

# Initialize LegacyOfficeReader
reader = LegacyOfficeReader(
    tika_server_jar_path="path/to/tika-server.jar",  # Optional: Path to Tika server JAR
)

# Load data from a legacy Office document
documents = reader.load_data(
    file="path/to/document.doc",  # Path to the legacy Office document
)
```

#### Using with SimpleDirectoryReader

```python
from llama_index.core import SimpleDirectoryReader
from llama_index.readers.legacy_office import LegacyOfficeReader

reader = SimpleDirectoryReader(
    input_dir="path/to/directory/",
    file_extractor={".doc": LegacyOfficeReader()},
)
documents = reader.load_data()
```

### Features

- Parses legacy Office documents (`.doc`) using Apache Tika
- Optionally (default) runs Tika server locally to avoid remote server calls/dependencies
- Extracts both content and metadata from documents
- Supports batch processing of multiple documents
- Seamless integration with SimpleDirectoryReader

### Requirements

- Java Runtime Environment (JRE) 11 or higher (required for Apache Tika 3.x)
- Python 3.8 or higher

### Notes

- The first time you use the reader, it will download the Tika server JAR file if not provided
- The Tika server will run locally on port `9998`
- All document metadata is preserved in the Document objects
- Make sure you have Java 11+ installed and available in your system PATH
- The reader uses Apache Tika 3.x

### Credits

This reader is built on top of:

- [Apache Tika](https://tika.apache.org/) - Content analysis toolkit
- [tika-python](https://github.com/chrismattmann/tika-python/) - Python bindings for Apache Tika
llama-index-embeddings-upstage 0.5.1
llama-index embeddings upstage integration
Requires Python: <4.0,>=3.9

# LlamaIndex Embeddings Integration: Upstage

[Upstage](https://www.upstage.ai/) is a leading artificial intelligence (AI) company specializing in delivering above-human-grade performance LLM components.

## Solar Embeddings

The embeddings API converts text into numbers that computers can understand. Imagine converting a sentence into a list of numbers, each capturing a piece of the sentence's meaning. This makes it easier for machines to do tasks like finding similar texts, sorting information, or even answering questions.

Check more details [here](https://developers.upstage.ai/docs/apis/embeddings).
llama-index-readers-toggl 0.4.1
llama-index readers toggl integration
Requires Python: <4.0,>=3.9

# Toggl reader

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

This loader fetches time entries from Toggl workspace and project into `Document`s.

Before working with Toggl's API, you need to get API token:

1. Log in to Toggl
2. [Open profile](https://track.toggl.com/profile)
3. Scroll down and click `-- Click to reveal --` for API token

## Usage

```python
from llama_index.readers.toggl import TogglReader
from llama_index.readers.toggl.dto import TogglOutFormat
import datetime

reader = TogglReader(api_token="{{YOUR_API_TOKEN}}")

docs = reader.load_data(
    workspace_id="{{WORKSPACE_ID}}",
    project_id="{{PROJECT_ID}}",
    start_date=datetime.datetime.now() - datetime.timedelta(days=7),
    out_format=TogglOutFormat.markdown,
)
```

## 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-tools-code-interpreter 0.4.1
llama-index tools code_interpreter integration
Requires Python: <4.0,>=3.9

# Code Interpreter Tool

This tool can be used to run python scripts and capture the results of stdout and stderr

WARNING: This tool provides the Agent access to the `subprocess.run` command.
Arbitrary code execution is possible on the machine running this tool.
This tool is not recommended to be used in a production setting, and would require heavy sandboxing or virtual machines

## Usage

Here's an example usage of the CodeInterpreterToolSpec.

```python
from llama_index.tools.code_interpreter import CodeInterpreterToolSpec
from llama_index.core.agent.workflow import FunctionAgent
from llama_index.llms.openai import OpenAI

code_spec = CodeInterpreterToolSpec()

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

# Prime the agent to use the tool
resp = await agent.run(
    "Can you help me write some python code to pass to the code_interpreter tool"
)
resp = await agent.run(
    "write a python function to calculate volume of a sphere with radius 4.3cm"
)
```

The tools available are:

`code_interpreter`: A tool to evaluate a python script

This loader is designed to be used as a way to load data as a Tool in a Agent.
llama-index-packs-arize-phoenix-query-engine 0.4.1
llama-index packs arize_phoenix_query_engine integration
Requires Python: <3.12,>=3.9
Keywords: arize, engine, index, phoenix, query

# Arize-Phoenix LlamaPack

This LlamaPack instruments your LlamaIndex app for LLM tracing with [Phoenix](https://github.com/Arize-ai/phoenix), an open-source LLM observability library from [Arize AI](https://phoenix.arize.com/).

## CLI Usage

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

```bash
llamaindex-cli download-llamapack ArizePhoenixQueryEnginePack --download-dir ./arize_pack
```

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

## Code Usage

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

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

# download and install dependencies
ArizePhoenixQueryEnginePack = download_llama_pack(
    "ArizePhoenixQueryEnginePack", "./arize_pack"
)
```

You can then inspect the files at `./arize_pack` or continue on to use the module.

```python
import os

from llama_index.core.node_parser import SentenceSplitter
from llama_index.readers.web import SimpleWebPageReader
from tqdm.auto import tqdm
```

Configure your OpenAI API key.

```python
os.environ["OPENAI_API_KEY"] = "copy-your-openai-api-key-here"
```

Parse your documents into a list of nodes and pass to your LlamaPack. In this example, use nodes from a Paul Graham essay as input.

```python
documents = SimpleWebPageReader().load_data(
    [
        "https://raw.githubusercontent.com/jerryjliu/llama_index/adb054429f642cc7bbfcb66d4c232e072325eeab/examples/paul_graham_essay/data/paul_graham_essay.txt"
    ]
)
parser = SentenceSplitter()
nodes = parser.get_nodes_from_documents(documents)
phoenix_pack = ArizePhoenixQueryEnginePack(nodes=nodes)
```

Run a set of queries via the pack's `run` method, which delegates to the underlying query engine.

```python
queries = [
    "What did Paul Graham do growing up?",
    "When and how did Paul Graham's mother die?",
    "What, in Paul Graham's opinion, is the most distinctive thing about YC?",
    "When and how did Paul Graham meet Jessica Livingston?",
    "What is Bel, and when and where was it written?",
]
for query in tqdm(queries):
    print("Query")
    print("=====")
    print(query)
    print()
    response = phoenix_pack.run(query)
    print("Response")
    print("========")
    print(response)
    print()
```

View your trace data in the Phoenix UI.

```python
phoenix_session_url = phoenix_pack.get_modules()["session_url"]
print(f"Open the Phoenix UI to view your trace data: {phoenix_session_url}")
```

You can access the internals of the LlamaPack, including your Phoenix session and your query engine, via the `get_modules` method.

```python
phoenix_pack.get_modules()
```

Check out the [Phoenix documentation](https://docs.arize.com/phoenix/) for more information!