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
Built Distribution
File details
Details for the file llama_index_readers_airbyte_gong-0.2.0.tar.gz
.
File metadata
- Download URL: llama_index_readers_airbyte_gong-0.2.0.tar.gz
- Upload date:
- Size: 2.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.10.13 Darwin/23.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 26a4388077eeeba0333788ab075ec01caa0ea0099a9b4070f1ae0e01c055f54b |
|
MD5 | 63ad8b58365b8559eea909a9ce3b9f19 |
|
BLAKE2b-256 | 5187b219b68e3ba656897f95e8e2c86e52e4384029102f7d4bdb9ed8d2873be4 |
File details
Details for the file llama_index_readers_airbyte_gong-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: llama_index_readers_airbyte_gong-0.2.0-py3-none-any.whl
- Upload date:
- Size: 3.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.10.13 Darwin/23.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d22cbf374c3137bd054b98ce6ffcbb62025fcccf8461770a2906d142cac050f7 |
|
MD5 | 7a8bfb13dea3daa89063d493c8a51fdf |
|
BLAKE2b-256 | e0c4c0d1fac5258584eae0f67e54030c88750af1fd452e422bdaaa8aad5c6f59 |