avatarLaxfed Paulacy

Free AI web copilot to create summaries, insights and extended knowledge, download it at here

1809

Abstract

ort AirbyteStripeLoader <span class="hljs-built_in"> config </span>= { <span class="hljs-string">"client_secret"</span>: <span class="hljs-string">"<secret key>"</span>, <span class="hljs-string">"account_id"</span>: <span class="hljs-string">"<account id>"</span>, <span class="hljs-string">"start_date"</span>: <span class="hljs-string">"<date>"</span> }

loader = AirbyteStripeLoader(<span class="hljs-attribute">config</span>=config, <span class="hljs-attribute">stream_name</span>=<span class="hljs-string">"invoices"</span>) documents = loader.load()</pre></div><p id="ad42">By integrating Airbyte sources within LangChain, you gain the ability to run any Python-based source directly within your Python runtime without the need to spin up an Airbyte instance or make API calls to Airbyte Cloud.</p><p id="4fad">Furthermore, you have the flexibility to move between hosted and embedded Airbyte instances seamlessly, and have full control over timing and pipeline execution when running syncs with LangChain loaders.</p><p id="5929">In addition, the integration allows you to easily implement incremental loads and map Airbyte records to LangChain documents. You can also integrate custom Airbyte sources by using the Airbyte CDKLoader base class, allowing for a seamless transition between local embedded loaders and using a hosted Airbyte instance, depending on your requirements.</p><p id="3321">If you have implemented your own custom Airbyte sources, it’s also possible to integrate them by using the AirbyteCDKLoader base class that works with the Source interface of the Airbyte CDK:</p><div id="9073"><pre><span class="hljs-keyword">from</span> langchain.document_loaders.airbyte import AirbyteCDKLoader <span class="hljs-keyword">from</span> my_source.source import MyCus

Options

tomSource # plug <span class="hljs-keyword">in</span> your own source here <span class="hljs-built_in"> config </span>= {

your custom configuration

}

loader = AirbyteCDKLoader(<span class="hljs-attribute">source_class</span>=MyCustomSource, <span class="hljs-attribute">config</span>=config, <span class="hljs-attribute">stream_name</span>=<span class="hljs-string">"my-stream"</span>)</pre></div><p id="f2f5">You can also install sources from the main Airbyte repository by installing directly via git. For example, to fetch the Github source, simply run:</p><div id="11d8"><pre><span class="hljs-attribute">pip</span> install <span class="hljs-string">"source_github<span class="hljs-variable">@git</span>+https://github.com/airbytehq/airbyte.git<span class="hljs-variable">@master</span>#subdirectory=airbyte-integrations/connectors/source-github"</span></pre></div><div id="658f" class="link-block"> <a href="https://readmedium.com/langchain-is-langchainhub-a-useful-platform-for-language-learning-0d87335f4c1a"> <div> <div> <h2>LANGCHAIN — Is LangChainHub a Useful Platform for Language Learning?</h2> <div><h3>The most technologically efficient machine that man has ever invented is the book. — Northrop Frye</h3></div> <div><p>medium.com</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/1*nu7ZXSdSXeo6aCLEJYoZpg.jpeg)"></div> </div> </div> </a> </div><p id="9f95">This integration provides extensive flexibility and control over data loading, allowing you to seamlessly leverage the power of Airbyte sources within your LangChain-based applications.</p></article></body>

LANGCHAIN — Can Airbyte Sources be Integrated within LangChain?

The most dangerous phrase in the language is, ‘We’ve always done it this way.’ — Grace Hopper.

To integrate Airbyte sources within LangChain, you can now utilize various Airbyte sources including Gong, Hubspot, Salesforce, Shopify, Stripe, Typeform, and Zendesk Support directly within your LangChain-based application as document loaders.

First, you’ll need to install the desired Airbyte source package using pip. For example, to load Stripe invoices for a user, you can simply install the Airbyte Stripe source:

pip install airbyte-source-stripe

Once installed, you can then import the loader, pass in the configuration and the stream you want to load:

from langchain.document_loaders.airbyte import AirbyteStripeLoader

config = {
  "client_secret": "<secret key>",
  "account_id": "<account id>",
  "start_date": "<date>"
}

loader = AirbyteStripeLoader(config=config, stream_name="invoices")
documents = loader.load()

By integrating Airbyte sources within LangChain, you gain the ability to run any Python-based source directly within your Python runtime without the need to spin up an Airbyte instance or make API calls to Airbyte Cloud.

Furthermore, you have the flexibility to move between hosted and embedded Airbyte instances seamlessly, and have full control over timing and pipeline execution when running syncs with LangChain loaders.

In addition, the integration allows you to easily implement incremental loads and map Airbyte records to LangChain documents. You can also integrate custom Airbyte sources by using the Airbyte CDKLoader base class, allowing for a seamless transition between local embedded loaders and using a hosted Airbyte instance, depending on your requirements.

If you have implemented your own custom Airbyte sources, it’s also possible to integrate them by using the AirbyteCDKLoader base class that works with the Source interface of the Airbyte CDK:

from langchain.document_loaders.airbyte import AirbyteCDKLoader
from my_source.source import MyCustomSource # plug in your own source here

config = {
   # your custom configuration
}

loader = AirbyteCDKLoader(source_class=MyCustomSource, config=config, stream_name="my-stream")

You can also install sources from the main Airbyte repository by installing directly via git. For example, to fetch the Github source, simply run:

pip install "source_github@git+https://github.com/airbytehq/airbyte.git@master#subdirectory=airbyte-integrations/connectors/source-github"

This integration provides extensive flexibility and control over data loading, allowing you to seamlessly leverage the power of Airbyte sources within your LangChain-based applications.

Integrated
Within
Sources
Langchain
ChatGPT
Recommended from ReadMedium