llama-index readers airbyte_typeform integration
Project description
Airbyte Typeform Loader
The Airbyte Typeform Loader allows you to access different Typeform objects.
Installation
- Install llama_hub:
pip install llama_hub
- Install the typeform source:
pip install airbyte-source-typeform
Usage
Here's an example usage of the AirbyteTypeformReader.
from llama_hub.airbyte_typeform import AirbyteTypeformReader
typeform_config = {
# ...
}
reader = AirbyteTypeformReader(config=typeform_config)
documents = reader.load_data(stream_name="forms")
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-typeform/source_typeform/spec.json.
The general shape looks like this:
{
"credentials": {
"auth_type": "Private Token",
"access_token": "<your auth token>",
},
"start_date": "<date from which to start retrieving records from in ISO format, e.g. 2020-10-20T00:00:00Z>",
"form_ids": [
"<id of form to load records for>"
], # if omitted, records from all forms will be loaded
}
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 = AirbyteTypeformReader(
config=typeform_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 = AirbyteTypeformReader(config={...})
documents = reader.load_data(stream_name="forms")
current_state = reader.last_state # can be pickled away or stored otherwise
updated_documents = reader.load_data(
stream_name="forms", 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 and/or subsequently used as a Tool in a LangChain Agent. See here for examples.
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_typeform-0.1.3.tar.gz
.
File metadata
- Download URL: llama_index_readers_airbyte_typeform-0.1.3.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.10.13 Darwin/23.0.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 687b39e08479a0453381fadd146e9f7cb2ed1a1886bf4b742424dd4fac5bcf7c |
|
MD5 | 11f311a47b7cfdcbe11c811317146318 |
|
BLAKE2b-256 | 21ddb8cf76f771687e39f62b74b3f0a1caf7db60cfec5357d16dc857d86b79fb |
File details
Details for the file llama_index_readers_airbyte_typeform-0.1.3-py3-none-any.whl
.
File metadata
- Download URL: llama_index_readers_airbyte_typeform-0.1.3-py3-none-any.whl
- Upload date:
- Size: 3.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.10.13 Darwin/23.0.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 17e7ac8db874a90293370e445e2a05c91427e5d82b88cca3335734ffbd775db2 |
|
MD5 | 26c78962c0e7253f7168e02dad76c14a |
|
BLAKE2b-256 | 5a813bc7717958f0990f26b30025c902dd28378afe43baec495bb20bc9cc253d |