semvec/pypi-packages huggingface dataset:
llama-index-readers-airbyte-shopify 0.4.1
llama-index readers airbyte_shopify integration
Requires Python: <4.0,>=3.9

# Airbyte Shopify Loader

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

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

## Usage

Here's an example usage of the AirbyteShopifyReader.

```python
from llama_index.readers.airbyte_shopify import AirbyteShopifyReader

shopify_config = {
    # ...
}
reader = AirbyteShopifyReader(config=shopify_config)
documents = reader.load_data(stream_name="orders")
```

## Configuration

Check out the [Airbyte documentation page](https://docs.airbyte.com/integrations/sources/shopify/) 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-shopify/source_shopify/spec.json](https://github.com/airbytehq/airbyte/blob/master/airbyte-integrations/connectors/source-shopify/source_shopify/spec.json).

The general shape looks like this:

```python
{
    "start_date": "<date from which to start retrieving records from in ISO format, e.g. 2020-10-20T00:00:00Z>",
    "shop": "<name of the shop you want to retrieve documents from>",
    "credentials": {
        "auth_method": "api_password",
        "api_password": "<your api password>",
    },
}
```

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 = AirbyteShopifyReader(
    config=shopify_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 = AirbyteShopifyReader(config={...})
documents = reader.load_data(stream_name="orders")
current_state = reader.last_state  # can be pickled away or stored otherwise

updated_documents = reader.load_data(
    stream_name="orders", 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-retrievers-mongodb-atlas-bm25-retriever 0.4.1
llama-index retrievers mongodb-atlas-bm25-retriever integration
Requires Python: <4.0,>=3.9

# LlamaIndex Retrievers Integration: MongoDBAtlasBM25Retriever

## What is this?

This is a BM25 Retriever for MongoDB Atlas that can be used with LlamaIndex.

## How to use

This was created with reference to [MongoDBAtlasVectorSearch](https://docs.llamaindex.ai/en/stable/examples/vector_stores/MongoDBAtlasVectorSearch.html), so it's mostly the same.

Please refer to that.

However, while `MongoDBAtlasVectorSearch` is an VectorStore, `MongoDBAtlasBM25Retriever` is a Retriever.

MongoDBAtlasBM25Retriever Example:

```python
mongodb_client = pymongo.MongoClient(mongo_uri)

retriever = MongoDBAtlasBM25Retriever(
    mongodb_client=mongodb_client,
    db_name="vectorstore",
    collection_name="vector_collection",
    index_name="index_vector_collection",
)
nodes = retriever.retrieve("retrieve_query")
```
llama-index-embeddings-xinference 0.3.1
llama-index embeddings xinference integration
Requires Python: <4.0,>=3.9

# LlamaIndex Embeddings Integration: Xinference

Xorbits Inference (Xinference) is an open-source platform to streamline the operation and integration of a wide array of AI models.

You can find a list of built-in embedding models in Xinference from its document [Embedding Models](https://inference.readthedocs.io/en/latest/models/builtin/embedding/index.html)

To learn more about Xinference in general, visit https://inference.readthedocs.io/en/latest/

## Installation

```shell
pip install llama-index-embeddings-xinference
```

## Usage

**Parameters Description:**

- `model_uid`: Model uid not the model name, sometimes they may be the same (e.g., `bce-embedding-base_v1`).
- `base_url`: base url of Xinference (e.g., `http://localhost:9997`).
- `timeout`: request timeout set (default 60s).
- `prompt`: Text to embed.

**Text Embedding Example**

```python
from llama_index.embeddings.xinference import XinferenceEmbedding

xi_model_uid = "xinference model uid"
xi_base_url = "xinference base url"

xi_embed = XinferenceEmbedding(
    model_uid=xi_model_uid,
    base_url=xi_base_url,
    timeout=60,
)


def text_embedding(prompt: str):
    embeddings = xi_embed.get_query_embedding(prompt)
    print(embeddings)


async def async_text_embedding(prompt: str):
    embeddings = await xi_embed.aget_query_embedding(prompt)
    print(embeddings)
```
llama-index-readers-feishu-docs 0.4.1
llama-index readers feishu_docs integration
Requires Python: <4.0,>=3.9

# Feishu Doc Loader

```bash
pip install llama-index-readers-feishu-docs
```

This loader takes in IDs of Feishu Docs and parses their text into `documents`. You can extract a Feishu Doc's ID directly from its URL. For example, the ID of `https://test-csl481dfkgqf.feishu.cn/docx/HIH2dHv21ox9kVxjRuwc1W0jnkf` is `HIH2dHv21ox9kVxjRuwc1W0jnkf`. As a prerequisite, you will need to register with Feishu and build an custom app. See [here](https://open.feishu.cn/document/home/introduction-to-custom-app-development/self-built-application-development-process) for instructions.

## Usage

To use this loader, you simply need to pass in an array of Feishu Doc IDs. The default API endpoints are for Feishu, in order to switch to Lark, we should use `set_lark_domain`.

```python
app_id = "cli_slkdjalasdkjasd"
app_secret = "dskLLdkasdjlasdKK"
doc_ids = ["HIH2dHv21ox9kVxjRuwc1W0jnkf"]
from llama_index.readers.feishu_docs import FeishuDocsReader

loader = FeishuDocsReader(app_id, app_secret)
documents = loader.load_data(document_ids=doc_ids)
```

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-astra-db 0.4.1
llama-index readers astra_db integration
Requires Python: <4.0,>=3.9

# Astra DB Loader

```bash
pip install llama-index-readers-astra-db
```

The Astra DB Loader returns a set of documents retrieved from Astra DB.
The user initializes the loader with an Astra DB index. They then pass in a vector.

## Usage

Here's an example usage of the AstraDBReader.

```python
from openai import OpenAI


# Get the credentials for Astra DB
api_endpoint = "https://324<...>f1c.astra.datastax.com"
token = "AstraCS:<...>"

# EXAMPLE: OpenAI embeddings
client = OpenAI(api_key="sk-<...>")

# Call OpenAI (or generate embeddings another way)
response = client.embeddings.create(
    input="Your text string goes here", model="text-embedding-ada-002"
)

# Get the embedding
query_vector = response.data[0].embedding

# Initialize the Reader object
from llama_index.readers.astra_db import AstraDBReader

# Your Astra DB Account will provide you with the endpoint URL and Token
reader = AstraDBReader(
    collection_name="astra_v_table",
    token=token,
    api_endpoint=api_endpoint,
    embedding_dimension=len(query_vector),
)

# Fetch data from the reader
documents = reader.load_data(vector=query_vector, limit=5)
```

This loader is designed to be used as a way to load data into [LlamaIndex](https://github.com/run-llama/llama_index/).

> **Note**: Please see the AstraDB documentation [here](https://docs.datastax.com/en/astra/astra-db-vector/clients/python.html).
llama-index-llms-gaudi 0.3.1
llama-index llms gaudi integration
Requires Python: <4.0,>=3.9

# LlamaIndex Llms Integration with Intel Gaudi

## Installation

```bash
pip install --upgrade-strategy eager optimum[habana]
pip install llama-index-llms-gaudi
pip install llama-index-llms-huggingface
```

## Usage

```python
import argparse
import os, logging
from llama_index.llms.gaudi import GaudiLLM


def setup_parser(parser):
    parser.add_argument(...)
    args = parser.parse_args()
    return args


if __name__ == "__main__":
    parser = argparse.ArgumentParser(
        description="GaudiLLM Basic Usage Example"
    )
    args = setup_parser(parser)
    args.model_name_or_path = "HuggingFaceH4/zephyr-7b-alpha"

    llm = GaudiLLM(
        args=args,
        logger=logger,
        model_name="HuggingFaceH4/zephyr-7b-alpha",
        tokenizer_name="HuggingFaceH4/zephyr-7b-alpha",
        query_wrapper_prompt=PromptTemplate(
            "
\n
\n
\n{query_str}
\n
\n"
        ),
        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,
        device_map="auto",
    )

    query = "Is the ocean blue?"
    print("\n----------------- Complete ------------------")
    completion_response = llm.complete(query)
    print(completion_response.text)
```

## Examples

- [More Examples](https://github.com/run-llama/llama_index/tree/main/llama-index-integrations/llms/llama-index-llms-gaudi/examples)
llama-index-tools-salesforce 0.4.1
llama-index tools salesforce integration
Requires Python: <4.0,>=3.9
Keywords: salesforce

# Salesforce Tool

This tool connects to a Salesforce environment and allow the Agent to perform SOQL and SOSL queries.

## Usage

This tool is a wrapper tool using the simple salesforce library. More information on this library [here](https://simple-salesforce.readthedocs.io/)

Here's an example usage of the Salesforce Tool:

```python
from llama_index.tools.salesforce import SalesforceToolSpec
from llama_index.core.agent.workflow import FunctionAgent
from llama_index.llms.openai import OpenAI

# Initialize the tool with your Salesforce credentials and other relevant details
sf = SalesforceToolSpec(
    username=sf_username,
    password=sf_password,
    consumer_key=sf_consumer_key,
    consumer_secret=sf_consumer_secret,
    domain="test",
)

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

print(await agent.run("List 3 Accounts in Salesforce"))
print(await agent.run("Provide information on a customer account John Doe"))
```

`execute_sosl` - Returns the result of a Salesforce search as a dict decoded from the Salesforce response JSON payload.

`execute_soql` - Returns the full set of results for the `query`. The returned dict is the decoded JSON payload from the final call to Salesforce, but with the `totalSize` field representing the full number of results retrieved and the `records` list representing the full list of records retrieved.

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

# LlamaIndex Llms Integration: OctoAI

Using the [OctoAI](https://octo.ai) LLMs Integration is a simple as:

```python
from llama_index.llms.octoai import OctoAI

octoai = OctoAI(token=OCTOAI_API_KEY)
response = octoai.complete("Paul Graham is ")
print(response)
```

## Calling `chat` with a list of messages

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

messages = [
    ChatMessage(
        role="system",
        content="Below is an instruction that describes a task. Write a response that appropriately completes the request.",
    ),
    ChatMessage(role="user", content="Write a blog about Seattle"),
]
response = octoai.chat(messages)
print(response)
```
llama-index-vector-store-firestore 0.4.1
llama-index vector_store firestore integration
Requires Python: <4.0,>=3.9

# LlamaIndex Vector_Store Integration: Firestore

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

A LlamaIndex vector store using Cloud Firestore as the backend.

## Usage

Pre-requisite:

```bash
pip install llama-index-vector-stores-firestore
```

Minimal example:

```python
from llama_index_vector_stores_firestore import FirestoreVectorStore

store = FirestoreVectorStore(
    collection_name=COLLECTION_NAME,
)
```

## More examples and references

Check out the [notebook](https://colab.research.google.com/github/run-llama/llama_index/blob/main/docs/examples/vector_stores/FirestoreVectorStore.ipynb) for detailed usage.
llama-index-packs-sub-question-weaviate 0.4.1
llama-index packs sub_question_weaviate integration
Requires Python: <4.0,>=3.9
Keywords: index, query, weaviate

# Sub Question Query Engine

This LlamaPack inserts your data into [Weaviate](https://weaviate.io/developers/weaviate) and uses the [Sub-Question Query Engine](https://gpt-index.readthedocs.io/en/latest/examples/query_engine/sub_question_query_engine.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 WeaviateSubQuestionPack --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
WeaviateSubQuestionPack = download_llama_pack(
    "WeaviateSubQuestionPack", "./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 = WeaviateSubQuestion(
    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-analyticdb 0.4.1
llama-index vector_stores analyticdb integration
Requires Python: <4.0,>=3.9

# Analytic DB Vector Store

A LlamaIndex vector store using Analytic DB as the backend.

## Usage

Pre-requisite:

```bash
pip install llama-index-vector-stores-analyticdb
```

A minimal example:

```python
from llama_index.vector_stores.analyticdb import AnalyticDBVectorStore

vector_store = AnalyticDBVectorStore.from_params(
    access_key_id="your-ak",  # Your alibaba cloud ram access key id
    access_key_secret="your-sk",  # Your alibaba cloud ram access key secret
    region_id="cn-hangzhou",  #  Region id of the AnalyticDB instance
    instance_id="gp-ab123456",  # Your AnalyticDB instance id
    account="testaccount",  # Account of the AnalyticDB instance
    account_password="testpassword",  # Account password of the AnalyticDB instance
    namespace="llama",  # Schema name of the AnalyticDB instance
    collection="llama",  # Table name of the AnalyticDB instance
    namespace_password="llamapassword",  # Namespace corresponding password of the AnalyticDB instance
    metrics="cosine",  # Similarity algorithm, e.g. "cosine", "l2", "ip"
    embedding_dimension=1536,  # Embedding dimension of the embeddings model used
)
```

## More references

[AnalyticDB for PostgreSQL](https://www.alibabacloud.com/help/en/analyticdb-for-postgresql/product-overview/overview-product-overview) is a massively parallel processing (MPP) data warehousing service that is designed to analyze large volumes of data online.

A more detailed usage guide can be found [at this document](https://www.alibabacloud.com/help/en/analyticdb-for-postgresql/getting-started/instances-with-vector-engine-optimization-enabled/).
llama-index-readers-boarddocs 0.4.1
llama-index readers boarddocs integration
Requires Python: <4.0,>=3.9
Keywords: board, boarddocs

# BoardDocs Loader

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

This loader retrieves an agenda and associated material from a BoardDocs site.

This loader is not endorsed by, developed by, supported by, or in any way formally affiliated with Diligent Corporation.

## Usage

To use this loader, you'll need to specify which BoardDocs site you want to load,
as well as the committee on the site you want to scrape.

```python
from llama_index.readers.boarddocs import BoardDocsReader

# For a site URL https://go.boarddocs.com/ca/redwood/Board.nsf/Public
# your site should be set to 'ca/redwood'
# You'll also need to specify which committee on the site you want to index,
# in this case A4EP6J588C05 is the Board of Trustees meeting.
loader = BoardDocsReader(site="ca/redwood", committee_id="A4EP6J588C05")

# You can optionally specify to load a specific set of meetings; if you don't
# pass in meeting_ids, the loader will attempt to load *all* meeting content.
# Since we're actually scraping a site, this can take a little while.
documents = loader.load_data(meeting_ids=["CPSNV9612DF1"])
```

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

# LlamaIndex Chat_Store Integration: Gel Chat Store

## Installation

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

## Usage

Using `GelChatStore`, you can persist your chat history automatically and not have to worry about saving and loading it manually.

```python
from llama_index.storage.chat_store.gel import GelChatStore
from llama_index.core.memory import ChatMemoryBuffer

chat_store = GelChatStore()

chat_memory = ChatMemoryBuffer.from_defaults(
    token_limit=3000,
    chat_store=chat_store,
    chat_store_key="user1",
)
```
llama-index-packs-evaluator-benchmarker 0.4.1
llama-index packs evaluator_benchmarker integration
Requires Python: <4.0,>=3.9

# Evaluator Benchmarker Pack

A pack for quick computation of benchmark results of your own LLM evaluator
on an Evaluation llama-dataset. Specifically, this pack supports benchmarking
an appropriate evaluator on the following llama-datasets:

- `LabelledEvaluatorDataset` for single-grading evaluations
- `LabelledPairwiseEvaluatorDataset` for pairwise-grading evaluations

These llama-datasets can be downloaed from [llama-hub](https://llamahub.ai).

## CLI Usage

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

```bash
llamaindex-cli download-llamapack EvaluatorBenchmarkerPack --download-dir ./evaluator_benchmarker_pack
```

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

## Code Usage

You can download the pack to the `./evaluator_benchmarker_pack` directory through python
code as well. The sample script below demonstrates how to construct `EvaluatorBenchmarkerPack`
using a `LabelledPairwiseEvaluatorDataset` downloaded from `llama-hub` and a
`PairwiseComparisonEvaluator` that uses GPT-4 as the LLM. Note though that this pack
can also be used on a `LabelledEvaluatorDataset` with a `BaseEvaluator` that performs
single-grading evaluation — in this case, the usage flow remains the same.

```python
from llama_index.core.llama_dataset import download_llama_dataset
from llama_index.core.llama_pack import download_llama_pack
from llama_index.core.evaluation import PairwiseComparisonEvaluator
from llama_index.llms.openai import OpenAI
from llama_index.core import ServiceContext

# download a LabelledRagDataset from llama-hub
pairwise_dataset = download_llama_dataset(
    "MiniMtBenchHumanJudgementDataset", "./data"
)

# define your evaluator
gpt_4_context = ServiceContext.from_defaults(
    llm=OpenAI(temperature=0, model="gpt-4"),
)
evaluator = PairwiseComparisonEvaluator(service_context=gpt_4_context)


# download and install dependencies
EvaluatorBenchmarkerPack = download_llama_pack(
    "EvaluatorBenchmarkerPack", "./pack"
)

# construction requires an evaluator and an eval_dataset
evaluator_benchmarker_pack = EvaluatorBenchmarkerPack(
    evaluator=evaluator,
    eval_dataset=pairwise_dataset,
    show_progress=True,
)

# PERFORM EVALUATION
benchmark_df = evaluator_benchmarker_pack.run()  # async arun() also supported
print(benchmark_df)
```

`Output:`

```text
number_examples                1689
inconclusives                  140
ties                           379
agreement_rate_with_ties       0.657844
agreement_rate_without_ties    0.828205
```

Note that `evaluator_benchmarker_pack.run()` will also save the `benchmark_df` files in the same directory.

```bash
.
└── benchmark.csv
```
llama-index-tools-bing-search 0.4.1
llama-index tools bing_search integration
Requires Python: <4.0,>=3.9

# Bing Search Tool

This tool connects to a Bing account and allows an Agent to perform searches for news, images and videos.

You will need to set up a search key using Azure,learn more here: https://learn.microsoft.com/en-us/bing/search-apis/bing-web-search/overview

## 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-bing-search/examples/bing_search.ipynb)

Here's an example usage of the BingSearchToolSpec.

```python
from llama_index.tools.bing_search import BingSearchToolSpec
from llama_index.core.agent.workflow import FunctionAgent
from llama_index.llms.openai import OpenAI

tool_spec = BingSearchToolSpec(api_key="your-key")

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

print(await agent.run("what's the latest news about superconductors"))
print(await agent.run("what does lk-99 look like"))
print(await agent.run("is there any videos of it levitating"))
```

`bing_news_search`: Search for news results related to a query
`bing_image_search`: Search for images related to a query
`bing_video_search`: Search for videos related to a query

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