Skip to main content

llama-index readers airbyte_gong integration

Project description

Airbyte Gong Loader

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.

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 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.

The general shape looks like this:

{
    "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:

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):

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

llama_index_readers_airbyte_gong-0.4.0.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file llama_index_readers_airbyte_gong-0.4.0.tar.gz.

File metadata

File hashes

Hashes for llama_index_readers_airbyte_gong-0.4.0.tar.gz
Algorithm Hash digest
SHA256 75f421c4ae580c03dc7348a2ec521e8a7ee934a020b5e687791dceb9bf020a24
MD5 4f926e8292a38cd028c40ec9ab632703
BLAKE2b-256 d43808c0a51b8e3036af2a7ba61b2795c4d9c18e8f1fd2c6d0d8a4f3253e94b0

See more details on using hashes here.

File details

Details for the file llama_index_readers_airbyte_gong-0.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for llama_index_readers_airbyte_gong-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c25dc6e1a6629180a5268b4d29f53ee81a37f2f5b9a5f0473c8cf342a94ddc7e
MD5 3190f4f23b552bd2261179af7691f121
BLAKE2b-256 86b25ea80ba5de0ed8a57693056eef272695241ff0bced5ba72c587b1c06d1b7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page