Issue: OutputParserException when using SQL Agent
Labels: name: area: agent, name: auto:bug

### Issue you'd like to raise.

I'm using a SQL Agent that is connected to BigQuery to build a QA model. I get OutputParserException fairly often. The Agent returns the correct answer some times, but I have never got an answer when the option view_support=True in SQLDatabase.from_uri().

For some questions, the agent generates a SQL query and executes it. It gets the results of the query as an Observation, but runs into an OutputParserException. The last line of output is almost always 'Thought:' before the OutputParserException.

Here's the code that I'm running:

```
from google.cloud import bigquery
from sqlalchemy import *
from sqlalchemy.engine import create_engine
from sqlalchemy.schema import *
import os

from langchain.agents import create_sql_agent
from langchain.agents.agent_toolkits import SQLDatabaseToolkit
from langchain import SQLDatabase
from langchain.agents import AgentExecutor
from langchain.agents.agent_types import AgentType
from langchain.llms import VertexAI
from vertexai.preview.language_models import TextGenerationModel

service_account_file = "masked.json"
project = "masked_project_name"
dataset = "SAP_REPORTING"
sqlalchemy_url = f'bigquery://{project}/{dataset}?credentials_path={service_account_file}'

llm = VertexAI(temperature=0)
db_2 = SQLDatabase.from_uri(sqlalchemy_url, view_support=True)
toolkit_2 = SQLDatabaseToolkit(db=db_2, llm=llm, use_query_checker=True)

PREFIX = '''You are a SQL expert. You have access to a BigQuery database.
            Identify which tables can be used to answer the user's question and write and execute a SQL query accordingly.
         '''

FORMAT_INSTRUCTIONS = """Please use the following format:
             
                     '''
                     Thought: 
                     Action: the action to take should be one of [{tool_names}]
                     Action Input: the input to the action
                     Observation: the result of the action
                     '''
                    
                    Provide the output in the Final Answer."""

SUFFIX = '''

Begin!

Previous conversation history:
{chat_history}

Instructions: {input}
{agent_scratchpad}
'''

agent_executor_2 = create_sql_agent(llm=llm,
                                  toolkit=toolkit_2,
                                  agent_type=AgentType.ZERO_SHOT_REACT_DESCRIPTION,
                                  verbose=True,
                                  # top_k=1000,
                                  handle_parsing_errors=True,
                                  agent_kwargs={
                                                'prefix': PREFIX, 
                                                'format_instructions': FORMAT_INSTRUCTIONS,
                                                'suffix': SUFFIX
                                                }
                                  )

agent_executor_2.run("Which customers are located in Cleveland?")

---------------------------------------------------------------------------
> Entering new AgentExecutor chain...
Action: sql_db_list_tables
Action Input: 
Observation: AccountingDocuments, AccountingDocumentsReceivable, AccountsPayable, AccountsPayableTurnover, AddressesMD, AugmentedDemandPlan, AugmentedWeeklySales, BatchesMD, BillOfMaterialsMD, Billing, BillingBlockingReasonsMD, BusinessPartnersMD, CashDiscountUtilization, CompaniesMD, CostCenterAmountsHierarchy_SAMPLE, CostCentersMD, CountriesMD, CurrenciesMD, CurrencyConvUtil, CurrencyConversion, CustomersMD, DaysPayableOutstanding, Deliveries, DeliveriesStatus_PerSalesOrg, DeliveryBlockingReasonsMD, DemandForecast, DemandPlan, DistributionChannelsMD, DivisionsMD, GLAccountsMD, HolidayCalendar, InventoryByPlant, InventoryKeyMetrics, InvoiceDocuments_Flow, Languages_T002, LedgersMD, MaterialGroupsMD, MaterialLedger, MaterialMovementTypesMD, MaterialPlantsMD, MaterialTypesMD, MaterialsBatchMD, MaterialsMD, MaterialsMovement, MaterialsValuation, OneTouchOrder, OrderToCash, POFulfillment, POOrderHistory, POSchedule, POScheduleLine, POVendorConfirmation, PlantsMD, PricingConditions, ProductHierarchiesMD, ProductHierarchy_Flatten, ProductionOrders, ProfitCenterAmountsHierarchy_SAMPLE, ProfitCentersMD, PromotionCalendar, PurchaseDocumentTypesMD, PurchaseDocuments, PurchaseDocumentsHistory, PurchaseDocuments_Flow, PurchasingGroupsMD, PurchasingOrganizationsMD, ReasonForMovementTypesMD, Regions_T005S, SDDocumentFlow, SDStatus_Items, SalesFulfillment, SalesFulfillment_perOrder, SalesOrderDetails_SAMPLE, SalesOrderHeaderStatus, SalesOrderPartnerFunction, SalesOrderPricing, SalesOrderScheduleLine, SalesOrderStatus, SalesOrders, SalesOrders_V2, SalesOrganizationsMD, SalesStatus_Items, SlowMovingThreshold, SpecialStocksMD, StockCharacteristicsConfig, StockInHand, StockMonthlySnapshots, StockWeeklySnapshots, Stock_NonValuated, Stock_PerPlant, Stock_Unrestricted_vs_Sales, StorageLocationsMD, TelephoneCodes_T005K, Trends, UoMConversionUtil, UoMMD, UoMUsage_SAMPLE, ValuationAreasMD, VendorConfig, VendorPerformance, VendorsMD, Weather, WeatherDaily
Thought:I should look at the schema of the CustomersMD table to see what columns I can query.
Action: sql_db_schema
Action Input: CustomersMD
Observation: 
CREATE TABLE `CustomersMD` (
	`Client_MANDT` STRING, 
	`CustomerNumber_KUNNR` STRING, 
	`CountryKey_LAND1` STRING, 
	`Name1_NAME1` STRING, 
	`Name2_NAME2` STRING, 
	`City_ORT01` STRING, 
	`PostalCode_PSTLZ` STRING, 
	`CustomerRegion_REGIO` STRING, 
	`SortField_SORTL` STRING, 
	`StreetAndNumber_STRAS` STRING, 
	`FirstTelephoneNumber_TELF1` STRING, 
	`FaxNumber_TELFX` STRING, 
	`OneTimeAccount_XCPDK` STRING, 
	`Address_ADRNR` STRING, 
	`MatchcodeSearch_MCOD1` STRING, 
	`MatchcodeSearch_MCOD2` STRING, 
	`MatchcodeSearch_MCOD3` STRING, 
	`Title_ANRED` STRING, 
	`CentralOrderBlockForCustomer_AUFSD` STRING, 
	`ExpressTrainStation_BAHNE` STRING, 
	`TrainStation_BAHNS` STRING, 
	`InternationalLocationNumber_BBBNR` STRING, 
	`InternationalLocationNumber_BBSNR` STRING, 
	`AuthorizationGroup_BEGRU` STRING, 
	`IndustryKey_BRSCH` STRING, 
	`CheckDigitForTheInternationalLocationNumber_BUBKZ` STRING, 
	`DataCommunicationLineNo_DATLT` STRING, 
	`DateCreated_ERDAT` DATE, 
	`CreatedBy_ERNAM` STRING, 
	`UnloadingPointsExist_EXABL` STRING, 
	`CentralBillingBlock_FAKSD` STRING, 
	`AccountNumberFiscalAddress_FISKN` STRING, 
	`WorkingTimeCalendar_KNAZK` STRING, 
	`AlternativePayer_KNRZA` STRING, 
	`GroupKey_KONZS` STRING, 
	`CustomerAccountGroup_KTOKD` STRING, 
	`CustomerClassification_KUKLA` STRING, 
	`AccountNumberOfVendorOrCreditor_LIFNR` STRING, 
	`CentralDeliveryBlockForTheCustomer_LIFSD` STRING, 
	`CityCoordinates_LOCCO` STRING, 
	`CentralDeletionFlagForMasterRecord_LOEVM` STRING, 
	`Name3_NAME3` STRING, 
	`Name4_NAME4` STRING, 
	`NielsenId_NIELS` STRING, 
	`District_ORT02` STRING, 
	`PoBox_PFACH` STRING, 
	`POBoxPostalCode_PSTL2` STRING, 
	`CountyCode_COUNC` STRING, 
	`CityCode_CITYC` STRING, 
	`RegionalMarket_RPMKR` STRING, 
	`CentralPostingBlock_SPERR` STRING, 
	`LanguageKey_SPRAS` STRING, 
	`TaxNumber1_STCD1` STRING, 
	`TaxNumber2_STCD2` STRING, 
	`SubjectToEqualizationTax_STKZA` STRING, 
	`LiableForVat_STKZU` STRING, 
	`TeleboxNumber_TELBX` STRING, 
	`SecondTelephoneNumber_TELF2` STRING, 
	`TeletexNumber_TELTX` STRING, 
	`TelexNumber_TELX1` STRING, 
	`TransportationZone_LZONE` STRING, 
	`AlternativePayerAllowed_XZEMP` STRING, 
	`CompanyIdOfTradingPartner_VBUND` STRING, 
	`VatRegistrationNumber_STCEG` STRING, 
	`Competitor_DEAR1` STRING, 
	`SalesPartner_DEAR2` STRING, 
	`SalesProspect_DEAR3` STRING, 
	`CustomerType4_DEAR4` STRING, 
	`IdForDefaultSoldToParty_DEAR5` STRING, 
	`LegalStatus_GFORM` STRING, 
	`IndustryCode1_BRAN1` STRING, 
	`IndustryCode2_BRAN2` STRING, 
	`IndustryCode3_BRAN3` STRING, 
	`IndustryCode4_BRAN4` STRING, 
	`IndustryCode5_BRAN5` STRING, 
	`InitialContact_EKONT` STRING, 
	`AnnualSales_UMSAT` NUMERIC, 
	`YearForWhichSalesAreGiven_UMJAH` STRING, 
	`CurrencyOfSalesFigure_UWAER` STRING, 
	`YearlyNumberOfEmployees_JMZAH` STRING, 
	`YearForWhichTheNumberOfEmployeesIsGiven_JMJAH` STRING, 
	`Attribute1_KATR1` STRING, 
	`Attribute2_KATR2` STRING, 
	`Attribute3_KATR3` STRING, 
	`Attribute4_KATR4` STRING, 
	`Attribute5_KATR5` STRING, 
	`Attribute6_KATR6` STRING, 
	`Attribute7_KATR7` STRING, 
	`Attribute8_KATR8` STRING, 
	`Attribute9_KATR9` STRING, 
	`Attribute10_KATR10` STRING, 
	`NaturalPerson_STKZN` STRING, 
	`AnnualSales_UMSA1` NUMERIC, 
	`TaxJurisdiction_TXJCD` STRING, 
	`FiscalYearVariant_PERIV` STRING, 
	`UsageIndicator_ABRVW` STRING, 
	`InspectionCarriedOutByCustomer_INSPBYDEBI` STRING, 
	`InspectionForADeliveryNote_INSPATDEBI` STRING, 
	`ReferenceAccountGroup_KTOCD` STRING, 
	`PoBoxCity_PFORT` STRING, 
	`Plant_WERKS` STRING, 
	`ReportKeyForDataMediumExchange_DTAMS` STRING, 
	`InstructionKeyForDataMediumExchange_DTAWS` STRING, 
	`StatusOfDataTransferIntoSubsequentRelease_DUEFL` STRING, 
	`AssignmentToHierarchy_HZUOR` STRING, 
	`PaymentBlock_SPERZ` STRING, 
	`RLabeling_CustomerplantGroup_ETIKG` STRING, 
	`IdNonMilitaryUse_CIVVE` STRING, 
	`IdForMilitaryUse_MILVE` STRING, 
	`ConditionGroup1_KDKG1` STRING, 
	`ConditionGroup2_KDKG2` STRING, 
	`ConditionGroup3_KDKG3` STRING, 
	`ConditionGroup4_KDKG4` STRING, 
	`ConditionGroup5_KDKG5` STRING, 
	`AlternativePayerUsingAccountNumber_XKNZA` STRING, 
	`TaxType_FITYP` STRING, 
	`TaxNumberType_STCDT` STRING, 
	`TaxNumber3_STCD3` STRING, 
	`TaxNumber4_STCD4` STRING, 
	`TaxNumber5_STCD5` STRING, 
	`CustomerIsIcmsExempt_XICMS` STRING, 
	`CustomerIsIpiExempt_XXIPI` STRING, 
	`CustomerGroupForSubstituicaoTributariaCalculation_XSUBT` STRING, 
	`CustomerCfopCategory_CFOPC` STRING, 
	`TaxLaw_Icms_TXLW1` STRING, 
	`TaxLaw_Ipi_TXLW2` STRING, 
	`IndicatorForBiochemicalWarfare_CCC01` STRING, 
	`IndicatorForNuclearNonproliferation_CCC02` STRING, 
	`IndicatorForNationalSecurity_CCC03` STRING, 
	`IndicatorForMissileTechnology_CCC04` STRING, 
	`CentralSalesBlock_CASSD` STRING, 
	`UniformResourceLocator_KNURL` STRING, 
	`NameOfRepresentative_J_1KFREPRE` STRING, 
	`TypeOfBusiness_J_1KFTBUS` STRING, 
	`TypeOfIndustry_J_1KFTIND` STRING, 
	`StatusOfChangeAuthorization_CONFS` STRING, 
	`DateOnWhichTheChangesWereConfirmed_UPDAT` DATE, 
	`TimeOfLastChangeConfirmation_UPTIM` TIME, 
	`CentralDeletionBlockForMasterRecord_NODEL` STRING, 
	`Indicator_Consumer_DEAR6` STRING, 
	`BusinessPurposeCompletedFlag_CVP_XBLCK` STRING, 
	`SuframaCode_SUFRAMA` STRING, 
	`RgNumber_RG` STRING, 
	`IssuedBy_EXP` STRING, 
	`State_UF` STRING, 
	`RgIssuingDate_RGDATE` DATE, 
	`RicNumber_RIC` STRING, 
	`ForeignNationalRegistration_RNE` STRING, 
	`RneIssuingDate_RNEDATE` DATE, 
	`Cnae_CNAE` STRING, 
	`LegalNature_LEGALNAT` STRING, 
	`CrtNumber_CRTN` STRING, 
	`IcmsTaxpayer_ICMSTAXPAY` STRING, 
	`IndustryMainType_INDTYP` STRING, 
	`TaxDeclarationType_TDT` STRING, 
	`CompanySize_COMSIZE` STRING, 
	`DeclarationRegimenForPiscofins_DECREGPC` STRING, 
	`AgencyLocationCode_ALC` STRING, 
	`PaymentOffice_PMT_OFFICE` STRING, 
	`FeeSchedule_FEE_SCHEDULE` STRING, 
	`DunsNumber_DUNS` STRING, 
	`Duns4_DUNS4` STRING, 
	`ProcessorGroup_PSOFG` STRING, 
	`SubledgerAcctPreprocessingProcedure_PSOIS` STRING, 
	`Name1_PSON1` STRING, 
	`Name2_PSON2` STRING, 
	`Name3_PSON3` STRING, 
	`FirstName_PSOVN` STRING, 
	`Title_PSOTL` STRING, 
	`Description_PSOO1` STRING, 
	`Description_PSOO2` STRING, 
	`Description_PSOO3` STRING, 
	`Description_PSOO4` STRING, 
	`Description_PSOO5` STRING, 
	`ValidFromDate_DATE_FROM` DATE, 
	`VersionIdForInternationalAddresses_NATION` STRING, 
	`ValidToDate_DATE_TO` DATE, 
	`FormOfAddressKey_TITLE` STRING, 
	`Addr_NAME1` STRING, 
	`Addr_NAME2` STRING, 
	`Addr_NAME3` STRING, 
	`Addr_NAME4` STRING, 
	`City_CITY1` STRING, 
	`District_CITY2` STRING, 
	`CityCodeForCitystreetFile_CITY_CODE` STRING, 
	`DistrictCodeForCityAndStreetFile_CITYP_CODE` STRING, 
	`City_HOME_CITY` STRING, 
	`DifferentCityForCitystreetFile_CITYH_CODE` STRING, 
	`RegionalStructureGrouping_REGIOGROUP` STRING, 
	`CityPostalCode_POST_CODE1` STRING, 
	`PoBoxPostalCode_POST_CODE2` STRING, 
	`CompanyPostalCode_POST_CODE3` STRING, 
	`PoBox_PO_BOX` STRING, 
	`PoBoxAddressUndeliverableFlag_DONT_USE_P` STRING, 
	`Flag_PoBoxWithoutNumber_PO_BOX_NUM` STRING, 
	`PoBoxCity_PO_BOX_LOC` STRING, 
	`CityPoBoxCode_CityFile_CITY_CODE2` STRING, 
	`RegionForPoBox_PO_BOX_REG` STRING, 
	`PoBoxCountry_PO_BOX_CTY` STRING, 
	`TransportationZoneToOrFromWhichTheGoodsAreDelivered_TRANSPZONE` STRING, 
	`Street_STREET` STRING, 
	`StreetAddressUndeliverableFlag_DONT_USE_S` STRING, 
	`StreetNumberForCitystreetFile_STREETCODE` STRING, 
	`HouseNumber_HOUSE_NUM1` STRING, 
	`HouseNumberSupplement_HOUSE_NUM2` STRING, 
	`Street2_STR_SUPPL1` STRING, 
	`Street3_STR_SUPPL2` STRING, 
	`Street4_STR_SUPPL3` STRING, 
	`Street5_LOCATION` STRING, 
	`Building_NumberOrCode_BUILDING` STRING, 
	`FloorInBuilding_FLOOR` STRING, 
	`RoomOrAppartmentNumber_ROOMNUMBER` STRING, 
	`CountryKey_COUNTRY` STRING, 
	`Language_LANGU` STRING, 
	`Region__REGION` STRING, 
	`AddressGroup_Key_BusinessAddressServices_ADDR_GROUP` STRING, 
	`Flag_ThereAreMoreAddressGroupAssignments_FLAGGROUPS` STRING, 
	`Flag_ThisIsAPersonalAddress_PERS_ADDR` STRING, 
	`SearchTerm1_SORT1` STRING, 
	`SearchTerm2_SORT2` STRING, 
	`FirstTelephoneNo_DiallingCodenumber_TEL_NUMBER` STRING, 
	`FirstTelephoneNo_Extension_TEL_EXTENS` STRING, 
	`CountyCodeForCounty_COUNTY_CODE` STRING, 
	`County_COUNTY` STRING, 
	`TownshipCodeForTownship_TOWNSHIP_CODE` STRING, 
	`Township_TOWNSHIP` STRING, 
	`CountyNameInUpperCaseForSearchHelp_MC_COUNTY` STRING, 
	`TownshipNameInUpperCaseForSearchHelp_MC_TOWNSHIP` STRING, 
	`BusinessPurposeCompletedFlag_XPCPT` STRING
)
OPTIONS(description='Customer Master Data')

/*
3 rows from CustomersMD table:
Client_MANDT	CustomerNumber_KUNNR	CountryKey_LAND1	Name1_NAME1	Name2_NAME2	City_ORT01	PostalCode_PSTLZ	CustomerRegion_REGIO	SortField_SORTL	StreetAndNumber_STRAS	FirstTelephoneNumber_TELF1	FaxNumber_TELFX	OneTimeAccount_XCPDK	Address_ADRNR	MatchcodeSearch_MCOD1	MatchcodeSearch_MCOD2	MatchcodeSearch_MCOD3	Title_ANRED	CentralOrderBlockForCustomer_AUFSD	ExpressTrainStation_BAHNE	TrainStation_BAHNS	InternationalLocationNumber_BBBNR	InternationalLocationNumber_BBSNR	AuthorizationGroup_BEGRU	IndustryKey_BRSCH	CheckDigitForTheInternationalLocationNumber_BUBKZ	DataCommunicationLineNo_DATLT	DateCreated_ERDAT	CreatedBy_ERNAM	UnloadingPointsExist_EXABL	CentralBillingBlock_FAKSD	AccountNumberFiscalAddress_FISKN	WorkingTimeCalendar_KNAZK	AlternativePayer_KNRZA	GroupKey_KONZS	CustomerAccountGroup_KTOKD	CustomerClassification_KUKLA	AccountNumberOfVendorOrCreditor_LIFNR	CentralDeliveryBlockForTheCustomer_LIFSD	CityCoordinates_LOCCO	CentralDeletionFlagForMasterRecord_LOEVM	Name3_NAME3	Name4_NAME4	NielsenId_NIELS	District_ORT02	PoBox_PFACH	POBoxPostalCode_PSTL2	CountyCode_COUNC	CityCode_CITYC	RegionalMarket_RPMKR	CentralPostingBlock_SPERR	LanguageKey_SPRAS	TaxNumber1_STCD1	TaxNumber2_STCD2	SubjectToEqualizationTax_STKZA	LiableForVat_STKZU	TeleboxNumber_TELBX	SecondTelephoneNumber_TELF2	TeletexNumber_TELTX	TelexNumber_TELX1	TransportationZone_LZONE	AlternativePayerAllowed_XZEMP	CompanyIdOfTradingPartner_VBUND	VatRegistrationNumber_STCEG	Competitor_DEAR1	SalesPartner_DEAR2	SalesProspect_DEAR3	CustomerType4_DEAR4	IdForDefaultSoldToParty_DEAR5	LegalStatus_GFORM	IndustryCode1_BRAN1	IndustryCode2_BRAN2	IndustryCode3_BRAN3	IndustryCode4_BRAN4	IndustryCode5_BRAN5	InitialContact_EKONT	AnnualSales_UMSAT	YearForWhichSalesAreGiven_UMJAH	CurrencyOfSalesFigure_UWAER	YearlyNumberOfEmployees_JMZAH	YearForWhichTheNumberOfEmployeesIsGiven_JMJAH	Attribute1_KATR1	Attribute2_KATR2	Attribute3_KATR3	Attribute4_KATR4	Attribute5_KATR5	Attribute6_KATR6	Attribute7_KATR7	Attribute8_KATR8	Attribute9_KATR9	Attribute10_KATR10	NaturalPerson_STKZN	AnnualSales_UMSA1	TaxJurisdiction_TXJCD	FiscalYearVariant_PERIV	UsageIndicator_ABRVW	InspectionCarriedOutByCustomer_INSPBYDEBI	InspectionForADeliveryNote_INSPATDEBI	ReferenceAccountGroup_KTOCD	PoBoxCity_PFORT	Plant_WERKS	ReportKeyForDataMediumExchange_DTAMS	InstructionKeyForDataMediumExchange_DTAWS	StatusOfDataTransferIntoSubsequentRelease_DUEFL	AssignmentToHierarchy_HZUOR	PaymentBlock_SPERZ	RLabeling_CustomerplantGroup_ETIKG	IdNonMilitaryUse_CIVVE	IdForMilitaryUse_MILVE	ConditionGroup1_KDKG1	ConditionGroup2_KDKG2	ConditionGroup3_KDKG3	ConditionGroup4_KDKG4	ConditionGroup5_KDKG5	AlternativePayerUsingAccountNumber_XKNZA	TaxType_FITYP	TaxNumberType_STCDT	TaxNumber3_STCD3	TaxNumber4_STCD4	TaxNumber5_STCD5	CustomerIsIcmsExempt_XICMS	CustomerIsIpiExempt_XXIPI	CustomerGroupForSubstituicaoTributariaCalculation_XSUBT	CustomerCfopCategory_CFOPC	TaxLaw_Icms_TXLW1	TaxLaw_Ipi_TXLW2	IndicatorForBiochemicalWarfare_CCC01	IndicatorForNuclearNonproliferation_CCC02	IndicatorForNationalSecurity_CCC03	IndicatorForMissileTechnology_CCC04	CentralSalesBlock_CASSD	UniformResourceLocator_KNURL	NameOfRepresentative_J_1KFREPRE	TypeOfBusiness_J_1KFTBUS	TypeOfIndustry_J_1KFTIND	StatusOfChangeAuthorization_CONFS	DateOnWhichTheChangesWereConfirmed_UPDAT	TimeOfLastChangeConfirmation_UPTIM	CentralDeletionBlockForMasterRecord_NODEL	Indicator_Consumer_DEAR6	BusinessPurposeCompletedFlag_CVP_XBLCK	SuframaCode_SUFRAMA	RgNumber_RG	IssuedBy_EXP	State_UF	RgIssuingDate_RGDATE	RicNumber_RIC	ForeignNationalRegistration_RNE	RneIssuingDate_RNEDATE	Cnae_CNAE	LegalNature_LEGALNAT	CrtNumber_CRTN	IcmsTaxpayer_ICMSTAXPAY	IndustryMainType_INDTYP	TaxDeclarationType_TDT	CompanySize_COMSIZE	DeclarationRegimenForPiscofins_DECREGPC	AgencyLocationCode_ALC	PaymentOffice_PMT_OFFICE	FeeSchedule_FEE_SCHEDULE	DunsNumber_DUNS	Duns4_DUNS4	ProcessorGroup_PSOFG	SubledgerAcctPreprocessingProcedure_PSOIS	Name1_PSON1	Name2_PSON2	Name3_PSON3	FirstName_PSOVN	Title_PSOTL	Description_PSOO1	Description_PSOO2	Description_PSOO3	Description_PSOO4	Description_PSOO5	ValidFromDate_DATE_FROM	VersionIdForInternationalAddresses_NATION	ValidToDate_DATE_TO	FormOfAddressKey_TITLE	Addr_NAME1	Addr_NAME2	Addr_NAME3	Addr_NAME4	City_CITY1	District_CITY2	CityCodeForCitystreetFile_CITY_CODE	DistrictCodeForCityAndStreetFile_CITYP_CODE	City_HOME_CITY	DifferentCityForCitystreetFile_CITYH_CODE	RegionalStructureGrouping_REGIOGROUP	CityPostalCode_POST_CODE1	PoBoxPostalCode_POST_CODE2	CompanyPostalCode_POST_CODE3	PoBox_PO_BOX	PoBoxAddressUndeliverableFlag_DONT_USE_P	Flag_PoBoxWithoutNumber_PO_BOX_NUM	PoBoxCity_PO_BOX_LOC	CityPoBoxCode_CityFile_CITY_CODE2	RegionForPoBox_PO_BOX_REG	PoBoxCountry_PO_BOX_CTY	TransportationZoneToOrFromWhichTheGoodsAreDelivered_TRANSPZONE	Street_STREET	StreetAddressUndeliverableFlag_DONT_USE_S	StreetNumberForCitystreetFile_STREETCODE	HouseNumber_HOUSE_NUM1	HouseNumberSupplement_HOUSE_NUM2	Street2_STR_SUPPL1	Street3_STR_SUPPL2	Street4_STR_SUPPL3	Street5_LOCATION	Building_NumberOrCode_BUILDING	FloorInBuilding_FLOOR	RoomOrAppartmentNumber_ROOMNUMBER	CountryKey_COUNTRY	Language_LANGU	Region__REGION	AddressGroup_Key_BusinessAddressServices_ADDR_GROUP	Flag_ThereAreMoreAddressGroupAssignments_FLAGGROUPS	Flag_ThisIsAPersonalAddress_PERS_ADDR	SearchTerm1_SORT1	SearchTerm2_SORT2	FirstTelephoneNo_DiallingCodenumber_TEL_NUMBER	FirstTelephoneNo_Extension_TEL_EXTENS	CountyCodeForCounty_COUNTY_CODE	County_COUNTY	TownshipCodeForTownship_TOWNSHIP_CODE	Township_TOWNSHIP	CountyNameInUpperCaseForSearchHelp_MC_COUNTY	TownshipNameInUpperCaseForSearchHelp_MC_TOWNSHIP	BusinessPurposeCompletedFlag_XPCPT
050	0001000053	US	Customer-Oregon	None	Portland		OR	OREGON	None	None	None	None	0000023139	CUSTOMER-OREGON	None	PORTLAND	Mr.	None	None	None	None	None	None	None	None	None	2022-03-10	DEEPAKV	None	None	None	None	None	None	1000	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	E	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	X	None	None	None	X	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	0001-01-01		9999-12-31	0002	Customer-Oregon				Portland																														US	E	OR	BP			OREGON										
050	0001000060	US	Customer- Seattle-Tacoma	None	Seattle-Tacoma		WA	SEATTLE-TA	None	None	None	None	0000023162	CUSTOMER- SEATTLE-TACOMA	None	SEATTLE-TACOMA	Company	None	None	None	None	None	None	None	None	None	2022-03-20	DEEPAKV	None	None	None	None	None	None	1000	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	E	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	X	None	None	None	X	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	0001-01-01		9999-12-31	0003	Customer- Seattle-Tacoma				Seattle-Tacoma																														US	E	WA	BP			SEATTLE-TACOMA										
050	0000000001	AU	Test	None	Territory	2612	ACT	TEST	None	None	None	None	0000023110	TEST	None	TERRITORY	Mr. and Mrs.	None	None	None	None	None	None	None	None	None	2022-02-28	MAHITHA	None	None	None	None	None	None	0004	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	E	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	X	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	None	0001-01-01		9999-12-31	0004	Test				Territory							2612																							AU	E	ACT	BP			TEST	ING									
*/
Thought:

---------------------------------------------------------------------------

OutputParserException                     Traceback (most recent call last)
Cell In[20], line 1
----> 1 agent_executor_2.run("Which customers are located in Cleveland?")

File /opt/conda/envs/env_preview_lc/lib/python3.11/site-packages/langchain/chains/base.py:436, in Chain.run(self, callbacks, tags, metadata, *args, **kwargs)
    434     if len(args) != 1:
    435         raise ValueError("`run` supports only one positional argument.")
--> 436     return self(args[0], callbacks=callbacks, tags=tags, metadata=metadata)[
    437         _output_key
    438     ]
    440 if kwargs and not args:
    441     return self(kwargs, callbacks=callbacks, tags=tags, metadata=metadata)[
    442         _output_key
    443     ]

File /opt/conda/envs/env_preview_lc/lib/python3.11/site-packages/langchain/chains/base.py:243, in Chain.__call__(self, inputs, return_only_outputs, callbacks, tags, metadata, include_run_info)
    241 except (KeyboardInterrupt, Exception) as e:
    242     run_manager.on_chain_error(e)
--> 243     raise e
    244 run_manager.on_chain_end(outputs)
    245 final_outputs: Dict[str, Any] = self.prep_outputs(
    246     inputs, outputs, return_only_outputs
    247 )

File /opt/conda/envs/env_preview_lc/lib/python3.11/site-packages/langchain/chains/base.py:237, in Chain.__call__(self, inputs, return_only_outputs, callbacks, tags, metadata, include_run_info)
    231 run_manager = callback_manager.on_chain_start(
    232     dumpd(self),
    233     inputs,
    234 )
    235 try:
    236     outputs = (
--> 237         self._call(inputs, run_manager=run_manager)
    238         if new_arg_supported
    239         else self._call(inputs)
    240     )
    241 except (KeyboardInterrupt, Exception) as e:
    242     run_manager.on_chain_error(e)

File /opt/conda/envs/env_preview_lc/lib/python3.11/site-packages/langchain/agents/agent.py:1029, in AgentExecutor._call(self, inputs, run_manager)
   1027 # We now enter the agent loop (until it returns something).
   1028 while self._should_continue(iterations, time_elapsed):
-> 1029     next_step_output = self._take_next_step(
   1030         name_to_tool_map,
   1031         color_mapping,
   1032         inputs,
   1033         intermediate_steps,
   1034         run_manager=run_manager,
   1035     )
   1036     if isinstance(next_step_output, AgentFinish):
   1037         return self._return(
   1038             next_step_output, intermediate_steps, run_manager=run_manager
   1039         )

File /opt/conda/envs/env_preview_lc/lib/python3.11/site-packages/langchain/agents/agent.py:843, in AgentExecutor._take_next_step(self, name_to_tool_map, color_mapping, inputs, intermediate_steps, run_manager)
    841     raise_error = False
    842 if raise_error:
--> 843     raise e
    844 text = str(e)
    845 if isinstance(self.handle_parsing_errors, bool):

File /opt/conda/envs/env_preview_lc/lib/python3.11/site-packages/langchain/agents/agent.py:832, in AgentExecutor._take_next_step(self, name_to_tool_map, color_mapping, inputs, intermediate_steps, run_manager)
    829     intermediate_steps = self._prepare_intermediate_steps(intermediate_steps)
    831     # Call the LLM to see what to do.
--> 832     output = self.agent.plan(
    833         intermediate_steps,
    834         callbacks=run_manager.get_child() if run_manager else None,
    835         **inputs,
    836     )
    837 except OutputParserException as e:
    838     if isinstance(self.handle_parsing_errors, bool):

File /opt/conda/envs/env_preview_lc/lib/python3.11/site-packages/langchain/agents/agent.py:457, in Agent.plan(self, intermediate_steps, callbacks, **kwargs)
    455 full_inputs = self.get_full_inputs(intermediate_steps, **kwargs)
    456 full_output = self.llm_chain.predict(callbacks=callbacks, **full_inputs)
--> 457 return self.output_parser.parse(full_output)

File /opt/conda/envs/env_preview_lc/lib/python3.11/site-packages/langchain/agents/mrkl/output_parser.py:44, in MRKLOutputParser.parse(self, text)
     39     return AgentFinish(
     40         {"output": text.split(FINAL_ANSWER_ACTION)[-1].strip()}, text
     41     )
     43 if not re.search(r"Action\s*\d*\s*:[\s]*(.*?)", text, re.DOTALL):
---> 44     raise OutputParserException(
     45         f"Could not parse LLM output: `{text}`",
     46         observation="Invalid Format: Missing 'Action:' after 'Thought:'",
     47         llm_output=text,
     48         send_to_llm=True,
     49     )
     50 elif not re.search(
     51     r"[\s]*Action\s*\d*\s*Input\s*\d*\s*:[\s]*(.*)", text, re.DOTALL
     52 ):
     53     raise OutputParserException(
     54         f"Could not parse LLM output: `{text}`",
     55         observation="Invalid Format:"
   (...)
     58         send_to_llm=True,
     59     )

OutputParserException: Could not parse LLM output: ````
CREATE TABLE CustomersMD (
  Client_MANDT STRING,
  CustomerNumber_KUNNR STRING,
  CountryKey_LAND1 STRING,
  Name1_NAME1 STRING,
  Name2_NAME2 STRING,
  City_ORT01 STRING,
  PostalCode_PSTLZ STRING,
  CustomerRegion_REGIO STRING,
  SortField_SORTL STRING,
  StreetAndNumber_STRAS STRING,
  FirstTelephoneNumber_TELF1 STRING,
  FaxNumber_TELFX STRING,
  OneTimeAccount_XCPDK STRING`

```

Appreciate any help with this :)


### Suggestion:

_No response_