diff --git a/libs/community/langchain_community/utilities/polygon.py b/libs/community/langchain_community/utilities/polygon.py index c7ab49f4054..f14069bd4fa 100644 --- a/libs/community/langchain_community/utilities/polygon.py +++ b/libs/community/langchain_community/utilities/polygon.py @@ -45,7 +45,7 @@ class PolygonAPIWrapper(BaseModel): data = response.json() status = data.get("status", None) - if status not in ("OK", "STOCKBUSINESS"): + if status not in ("OK", "STOCKBUSINESS", "STOCKSBUSINESS"): raise ValueError(f"API Error: {data}") return data.get("results", None) @@ -61,7 +61,7 @@ class PolygonAPIWrapper(BaseModel): data = response.json() status = data.get("status", None) - if status not in ("OK", "STOCKBUSINESS"): + if status not in ("OK", "STOCKBUSINESS", "STOCKSBUSINESS"): raise ValueError(f"API Error: {data}") return data.get("results", None) @@ -82,7 +82,7 @@ class PolygonAPIWrapper(BaseModel): data = response.json() status = data.get("status", None) - if status not in ("OK", "STOCKBUSINESS"): + if status not in ("OK", "STOCKBUSINESS", "STOCKSBUSINESS"): raise ValueError(f"API Error: {data}") return data.get("results", None) @@ -116,7 +116,7 @@ class PolygonAPIWrapper(BaseModel): data = response.json() status = data.get("status", None) - if status not in ("OK", "STOCKBUSINESS"): + if status not in ("OK", "STOCKBUSINESS", "STOCKSBUSINESS"): raise ValueError(f"API Error: {data}") return data.get("results", None)