mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-16 06:53:16 +00:00
community: Add PolygonAPIWrapper and get_last_quote endpoint (#15971)
- **Description:** Added a `PolygonAPIWrapper` and an initial `get_last_quote` endpoint, which allows us to get the last price quote for a given `ticker`. Once merged, I can add a Polygon tool in `tools/` for agents to use. - **Twitter handle:** [@virattt](https://twitter.com/virattt) The Polygon.io Stocks API provides REST endpoints that let you query the latest market data from all US stock exchanges.
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
"""Integration test for Polygon API Wrapper."""
|
||||
from langchain_community.utilities.polygon import PolygonAPIWrapper
|
||||
|
||||
|
||||
def test_get_last_quote() -> None:
|
||||
"""Test for getting the last quote of a ticker from the Polygon API."""
|
||||
polygon = PolygonAPIWrapper()
|
||||
output = polygon.run("get_last_quote", "AAPL")
|
||||
assert output is not None
|
Reference in New Issue
Block a user