Skip to main contentü¶úÔ∏èüîó LangChainDocsUse casesIntegrationsAPICommunityChat our docsLangSmithJS/TS DocsSearchCTRLKProvidersAnthropicAWSGoogleMicrosoftOpenAIMoreComponentsLLMsChat modelsDocument loadersDocument transformersText embedding modelsVector storesRetrieversToolsAgents and toolkitsAINetworkAirbyte Question AnsweringAmadeusAzure Cognitive ServicesClickUp Langchain ToolkitCSVDocument ComparisonGithubGitlabGmailGoogle Drive toolJiraJSONMultiOnOffice365OpenAPINatural Language APIsPandas DataframePlayWright BrowserPowerBI DatasetPythonSpark DataframeSpark SQLSQL DatabaseVectorstoreXorbitsMemoryCallbacksChat loadersComponentsAgents and toolkitsAirbyte Question AnsweringAirbyte Question AnsweringThis notebook shows how to do question answering over structured data, in this case using the AirbyteStripeLoader.Vectorstores often have a hard time answering questions that requires computing, grouping and filtering structured data so the high level idea is to use a pandas¬†dataframe to help with these types of questions. Load data from Stripe using Airbyte. user the record_handler¬†paramater to return a JSON from the data loader.import osimport pandas as pdfrom langchain.document_loaders.airbyte import AirbyteStripeLoaderfrom langchain.chat_models.openai import ChatOpenAIfrom langchain.agents import AgentType, create_pandas_dataframe_agentstream_name = "customers"config = {    "client_secret": os.getenv("STRIPE_CLIENT_SECRET"),    "account_id": os.getenv("STRIPE_ACCOUNT_D"),    "start_date": "2023-01-20T00:00:00Z",}def handle_record(record: dict, _id: str):    return record.dataloader = AirbyteStripeLoader(    config=config,    record_handler=handle_record,    stream_name=stream_name,)data = loader.load()Pass the data to pandas¬†dataframe.df = pd.DataFrame(data)Pass the dataframe df to the create_pandas_dataframe_agent and invokeagent = create_pandas_dataframe_agent(    ChatOpenAI(temperature=0, model="gpt-4"),    df,    verbose=True,
This notebook shows how to do question answering over structured data, in this case using the AirbyteStripeLoader.
This notebook shows how to do question answering over structured data, in this case using the AirbyteStripeLoader. ->: Skip to main contentü¶úÔ∏èüîó LangChainDocsUse casesIntegrationsAPICommunityChat our docsLangSmithJS/TS DocsSearchCTRLKProvidersAnthropicAWSGoogleMicrosoftOpenAIMoreComponentsLLMsChat modelsDocument loadersDocument transformersText embedding modelsVector storesRetrieversToolsAgents and toolkitsAINetworkAirbyte Question AnsweringAmadeusAzure Cognitive ServicesClickUp Langchain ToolkitCSVDocument ComparisonGithubGitlabGmailGoogle Drive toolJiraJSONMultiOnOffice365OpenAPINatural Language APIsPandas DataframePlayWright BrowserPowerBI DatasetPythonSpark DataframeSpark SQLSQL DatabaseVectorstoreXorbitsMemoryCallbacksChat loadersComponentsAgents and toolkitsAirbyte Question AnsweringAirbyte Question AnsweringThis notebook shows how to do question answering over structured data, in this case using the AirbyteStripeLoader.Vectorstores often have a hard time answering questions that requires computing, grouping and filtering structured data so the high level idea is to use a pandas¬†dataframe to help with these types of questions. Load data from Stripe using Airbyte. user the record_handler¬†paramater to return a JSON from the data loader.import osimport pandas as pdfrom langchain.document_loaders.airbyte import AirbyteStripeLoaderfrom langchain.chat_models.openai import ChatOpenAIfrom langchain.agents import AgentType, create_pandas_dataframe_agentstream_name = "customers"config = {    "client_secret": os.getenv("STRIPE_CLIENT_SECRET"),    "account_id": os.getenv("STRIPE_ACCOUNT_D"),    "start_date": "2023-01-20T00:00:00Z",}def handle_record(record: dict, _id: str):    return record.dataloader = AirbyteStripeLoader(    config=config,    record_handler=handle_record,    stream_name=stream_name,)data = loader.load()Pass the data to pandas¬†dataframe.df = pd.DataFrame(data)Pass the dataframe df to the create_pandas_dataframe_agent and invokeagent = create_pandas_dataframe_agent(    ChatOpenAI(temperature=0, model="gpt-4"),    df,    verbose=True,