LangChain tools for Mapsi geospatial APIs — geocoding, routing, isochrone, places
Project description
mapsi-langchain
LangChain tools for Mapsi geospatial APIs. One package covers LangChain, CrewAI, AutoGen, and LangGraph.
Install
pip install mapsi-langchain
Get your API key at mapsi.dev/console/api-keys (free tier: 1,000 calls/day).
LangChain
from mapsi_langchain import get_tools
from langchain.agents import initialize_agent, AgentType
from langchain_openai import ChatOpenAI
llm = ChatOpenAI(model="gpt-4o")
agent = initialize_agent(
get_tools("your-mapsi-api-key"),
llm,
agent=AgentType.OPENAI_FUNCTIONS,
)
agent.run("Find the 3 nearest hospitals to 51.5074, -0.1278 and route to the closest one")
CrewAI
from mapsi_langchain import get_tools
from crewai import Agent
geo_agent = Agent(
role="Geospatial Analyst",
goal="Answer location questions using real map data",
tools=get_tools("your-mapsi-api-key"),
)
AutoGen / LangGraph
Both accept standard LangChain tools — pass get_tools("your-key") directly.
OpenAI Agents SDK (function calling)
from mapsi_langchain.openai_tools import MAPSI_TOOLS
import openai
response = openai.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": "Geocode 10 Downing Street London"}],
tools=MAPSI_TOOLS,
)
Available Tools
| Tool class | Tool name | What it does |
|---|---|---|
GeocodeTool |
mapsi_geocode |
Address → lat/lon |
ReverseGeocodeTool |
mapsi_reverse_geocode |
lat/lon → address |
RouteTool |
mapsi_route |
Turn-by-turn directions |
IsochroneTool |
mapsi_isochrone |
Reachability polygon |
PlacesSearchTool |
mapsi_places_search |
Nearby POI search |
Full API reference: mapsi.dev/docs
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mapsi_langchain-1.0.0.tar.gz.
File metadata
- Download URL: mapsi_langchain-1.0.0.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5d47642718b2a816ef1141045b721a93032ad43e5a3d4404cc9e0947def60645
|
|
| MD5 |
b863a066e1cb8d729184d4dfed11dc3c
|
|
| BLAKE2b-256 |
c53ef699c1af206f2440cd326529be53a84eb49ebe5f411a2a48f7955d337021
|
File details
Details for the file mapsi_langchain-1.0.0-py3-none-any.whl.
File metadata
- Download URL: mapsi_langchain-1.0.0-py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
66c2a7f43961789f745f14e1e7bb296ba99b934e7a35d00574d6d9fa2864215b
|
|
| MD5 |
6b03525aa1dc6126c744958f34127334
|
|
| BLAKE2b-256 |
51df2683c6c3150bdec074b58717940fd2f57d0f5de0a2819941356382577450
|