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
Metadata
Release files for mapsi-langchain 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| mapsi_langchain-1.0.0.tar.gz | 4.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mapsi_langchain-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.4 kB
Release files / mapsi_langchain-1.0.0.tar.gz
| Download URL | mapsi_langchain-1.0.0.tar.gz |
|---|---|
| Size | 4.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5d47642718b2a816ef1141045b721a93032ad43e5a3d4404cc9e0947def60645
|
|
BLAKE2b-256 checksum How to use checksums |
c53ef699c1af206f2440cd326529be53a84eb49ebe5f411a2a48f7955d337021
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.12
|
Release files / mapsi_langchain-1.0.0-py3-none-any.whl
| Download URL | mapsi_langchain-1.0.0-py3-none-any.whl |
|---|---|
| Size | 4.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
66c2a7f43961789f745f14e1e7bb296ba99b934e7a35d00574d6d9fa2864215b
|
|
BLAKE2b-256 checksum How to use checksums |
51df2683c6c3150bdec074b58717940fd2f57d0f5de0a2819941356382577450
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.12
|