llama-index-readers-airbyte-gong


Namellama-index-readers-airbyte-gong JSON
Version 0.1.3 PyPI version JSON
download
home_page
Summaryllama-index readers airbyte_gong integration
upload_time2024-02-21 19:16:05
maintainerflash1293
docs_urlNone
authorYour Name
requires_python>=3.8.1,<4.0
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Airbyte Gong Loader

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

## Installation

- Install llama_hub: `pip install llama_hub`
- Install the gong source: `pip install airbyte-source-gong`

## Usage

Here's an example usage of the AirbyteGongReader.

```python
from llama_hub.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/tree/main/llama_index) and/or subsequently used as a Tool in a [LangChain](https://github.com/hwchase17/langchain) Agent. See [here](https://github.com/emptycrown/llama-hub/tree/main) for examples.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "llama-index-readers-airbyte-gong",
    "maintainer": "flash1293",
    "docs_url": null,
    "requires_python": ">=3.8.1,<4.0",
    "maintainer_email": "",
    "keywords": "",
    "author": "Your Name",
    "author_email": "you@example.com",
    "download_url": "https://files.pythonhosted.org/packages/b6/32/9e4c44829d40947e19b9894d9ae9e442ac5c46eed1d92710784418717a05/llama_index_readers_airbyte_gong-0.1.3.tar.gz",
    "platform": null,
    "description": "# Airbyte Gong Loader\n\nThe Airbyte Gong Loader allows you to access different Gong objects.\n\n## Installation\n\n- Install llama_hub: `pip install llama_hub`\n- Install the gong source: `pip install airbyte-source-gong`\n\n## Usage\n\nHere's an example usage of the AirbyteGongReader.\n\n```python\nfrom llama_hub.airbyte_gong import AirbyteGongReader\n\ngong_config = {\n    # ...\n}\nreader = AirbyteGongReader(config=gong_config)\ndocuments = reader.load_data(stream_name=\"calls\")\n```\n\n## Configuration\n\nCheck out the [Airbyte documentation page](https://docs.airbyte.com/integrations/sources/gong/) for details about how to configure the reader.\nThe 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).\n\nThe general shape looks like this:\n\n```python\n{\n    \"access_key\": \"<access key name>\",\n    \"access_key_secret\": \"<access key secret>\",\n    \"start_date\": \"<date from which to start retrieving records from in ISO format, e.g. 2020-10-20T00:00:00Z>\",\n}\n```\n\nBy 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:\n\n```python\ndef handle_record(record, id):\n    return Document(\n        doc_id=id, text=record.data[\"title\"], extra_info=record.data\n    )\n\n\nreader = AirbyteGongReader(config=gong_config, record_handler=handle_record)\n```\n\n## Lazy loads\n\nThe `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.\n\n## Incremental loads\n\nThis loader supports loading data incrementally (only returning documents that weren't loaded last time or got updated in the meantime):\n\n```python\nreader = AirbyteGongReader(config={...})\ndocuments = reader.load_data(stream_name=\"calls\")\ncurrent_state = reader.last_state  # can be pickled away or stored otherwise\n\nupdated_documents = reader.load_data(\n    stream_name=\"calls\", state=current_state\n)  # only loads documents that were updated since last time\n```\n\nThis 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. See [here](https://github.com/emptycrown/llama-hub/tree/main) for examples.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "llama-index readers airbyte_gong integration",
    "version": "0.1.3",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2656bb9e4ac43ec6282416188c7e4320dd37a0da9f7e12716dc9cc157e38ff42",
                "md5": "7005301711584e8f75dce8d91fec3a17",
                "sha256": "839af2005840556fefd6a2b3ffa63290fb6230609b1eae119e2e58a4bfe1931f"
            },
            "downloads": -1,
            "filename": "llama_index_readers_airbyte_gong-0.1.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7005301711584e8f75dce8d91fec3a17",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8.1,<4.0",
            "size": 3108,
            "upload_time": "2024-02-21T19:16:03",
            "upload_time_iso_8601": "2024-02-21T19:16:03.991204Z",
            "url": "https://files.pythonhosted.org/packages/26/56/bb9e4ac43ec6282416188c7e4320dd37a0da9f7e12716dc9cc157e38ff42/llama_index_readers_airbyte_gong-0.1.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b6329e4c44829d40947e19b9894d9ae9e442ac5c46eed1d92710784418717a05",
                "md5": "f9c071187164a56e5d10d461dd75fcc4",
                "sha256": "50083feba7bc1668a3e076f999e757b4dd2343105663a9b763a2e89b91fa8a08"
            },
            "downloads": -1,
            "filename": "llama_index_readers_airbyte_gong-0.1.3.tar.gz",
            "has_sig": false,
            "md5_digest": "f9c071187164a56e5d10d461dd75fcc4",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8.1,<4.0",
            "size": 2808,
            "upload_time": "2024-02-21T19:16:05",
            "upload_time_iso_8601": "2024-02-21T19:16:05.023011Z",
            "url": "https://files.pythonhosted.org/packages/b6/32/9e4c44829d40947e19b9894d9ae9e442ac5c46eed1d92710784418717a05/llama_index_readers_airbyte_gong-0.1.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-21 19:16:05",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "llama-index-readers-airbyte-gong"
}
        
Elapsed time: 0.18957s