llama-index-readers-airbyte-gong


Namellama-index-readers-airbyte-gong JSON
Version 0.3.0 PyPI version JSON
download
home_pageNone
Summaryllama-index readers airbyte_gong integration
upload_time2024-11-18 01:05:08
maintainerflash1293
docs_urlNone
authorYour Name
requires_python<4.0,>=3.9
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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/).

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "llama-index-readers-airbyte-gong",
    "maintainer": "flash1293",
    "docs_url": null,
    "requires_python": "<4.0,>=3.9",
    "maintainer_email": null,
    "keywords": null,
    "author": "Your Name",
    "author_email": "you@example.com",
    "download_url": "https://files.pythonhosted.org/packages/39/aa/2bab6c967922b7c747198d8e9cdaec5856f76d92086773223dad467dd047/llama_index_readers_airbyte_gong-0.3.0.tar.gz",
    "platform": null,
    "description": "# Airbyte Gong Loader\n\n```bash\npip install llama-index-readers-airbyte-gong\n```\n\nThe Airbyte Gong Loader allows you to access different Gong objects.\n\n## Usage\n\nHere's an example usage of the AirbyteGongReader.\n\n```python\nfrom llama_index.readers.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/).\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "llama-index readers airbyte_gong integration",
    "version": "0.3.0",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "fa8888899d076a6586c0ca30d9d17659f5e4f15c92d6cb9e484528dabe5e0d1f",
                "md5": "098dac1d7bf4fb982b68a1f4ae5203cf",
                "sha256": "077a182443da0700fda7222c02f6aa3b2b8553715fa16b8afeb3a91dfda6c783"
            },
            "downloads": -1,
            "filename": "llama_index_readers_airbyte_gong-0.3.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "098dac1d7bf4fb982b68a1f4ae5203cf",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.9",
            "size": 3001,
            "upload_time": "2024-11-18T01:05:07",
            "upload_time_iso_8601": "2024-11-18T01:05:07.094081Z",
            "url": "https://files.pythonhosted.org/packages/fa/88/88899d076a6586c0ca30d9d17659f5e4f15c92d6cb9e484528dabe5e0d1f/llama_index_readers_airbyte_gong-0.3.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "39aa2bab6c967922b7c747198d8e9cdaec5856f76d92086773223dad467dd047",
                "md5": "7ce8f1aea00b40fc9803527b322ded68",
                "sha256": "9eae1f078dea73f0bda27c003af6b6a37b60d1413255cf8bb40cdc5c433b6376"
            },
            "downloads": -1,
            "filename": "llama_index_readers_airbyte_gong-0.3.0.tar.gz",
            "has_sig": false,
            "md5_digest": "7ce8f1aea00b40fc9803527b322ded68",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.9",
            "size": 2721,
            "upload_time": "2024-11-18T01:05:08",
            "upload_time_iso_8601": "2024-11-18T01:05:08.677484Z",
            "url": "https://files.pythonhosted.org/packages/39/aa/2bab6c967922b7c747198d8e9cdaec5856f76d92086773223dad467dd047/llama_index_readers_airbyte_gong-0.3.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-18 01:05:08",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "llama-index-readers-airbyte-gong"
}
        
Elapsed time: 0.43798s