An integration package connecting Camino AI Reality Grounding API and LangChain
Project description
langchain-camino
An integration package connecting Camino AI Reality Grounding API and LangChain.
Installation
pip install langchain-camino
Setup
To use this package, you need to get a Camino API key from https://app.getcamino.ai/.
export CAMINO_API_KEY="your-api-key"
Usage
CaminoSearch - Place Search
Search for places by name using Nominatim:
from langchain_camino import CaminoSearch
# Initialize the tool
search = CaminoSearch()
# Search for places
result = search.invoke({"place_name": "coffee shops in San Francisco"})
print(result)
CaminoQuery - Natural Language Location Queries
Make natural language location queries with optional AI ranking:
from langchain_camino import CaminoQuery
# Initialize the tool
query = CaminoQuery(ai_ranking=True)
# Query with natural language
result = query.invoke({
"query": "Find good restaurants near me",
"lat": 37.7749,
"lon": -122.4194,
"radius": 1.0
})
print(result)
CaminoJourney - Multi-waypoint Journey Planning
Plan optimized journeys with multiple stops:
from langchain_camino import CaminoJourney
# Initialize the tool
journey = CaminoJourney(transport_mode="car", optimize=True)
# Plan a journey
waypoints = [
(37.7749, -122.4194), # San Francisco
(37.7849, -122.4094), # Next stop
(37.7949, -122.3994) # Final destination
]
result = journey.invoke({
"waypoints": waypoints,
"transport_mode": "car",
"optimize": True
})
print(result)
Using with LangChain Agents
All tools can be used with LangChain agents:
from langchain.agents import initialize_agent, AgentType
from langchain_openai import ChatOpenAI
from langchain_camino import CaminoSearch, CaminoQuery, CaminoJourney
# Initialize LLM
llm = ChatOpenAI(temperature=0)
# Initialize tools
tools = [
CaminoSearch(),
CaminoQuery(),
CaminoJourney()
]
# Create agent
agent = initialize_agent(
tools,
llm,
agent=AgentType.STRUCTURED_CHAT_ZERO_SHOT_REACT_DESCRIPTION,
verbose=True
)
# Use the agent
response = agent.run("Find a coffee shop in downtown San Francisco and plan a route there from the Golden Gate Bridge")
API Reference
CaminoSearch
Search for places by name using the Camino API.
Parameters:
place_name(str): Name of the place to search forlimit(int, optional): Maximum number of results (default: 5)
CaminoQuery
Make natural language location queries.
Parameters:
query(str): Natural language querylat(float, optional): Latitude for location contextlon(float, optional): Longitude for location contextradius(float, optional): Search radius in kilometerslimit(int, optional): Maximum number of results (default: 10)ai_ranking(bool, optional): Use AI-powered ranking (default: True)
CaminoJourney
Plan multi-waypoint journeys with route optimization.
Parameters:
waypoints(List[Tuple[float, float]]): List of (lat, lon) coordinatestransport_mode(str, optional): Transport mode - "car", "bike", "foot", "transit" (default: "car")optimize(bool, optional): Optimize route for time/distance (default: True)
Development
Setup
git clone https://github.com/your-repo/langchain-camino
cd langchain-camino
pip install -e ".[test,lint]"
Testing
# Run unit tests
pytest tests/unit_tests/
# Run integration tests (requires API key)
pytest tests/integration_tests/
# Run all tests
pytest
Linting
# Run linting
ruff check .
# Run type checking
mypy langchain_camino/
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
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 langchain_camino-0.1.0.tar.gz.
File metadata
- Download URL: langchain_camino-0.1.0.tar.gz
- Upload date:
- Size: 113.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.4 CPython/3.13.3 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
79f4388831f7e80e95dfbd87c34e31d921a5db2ec2adc1d8c1c2e96f0263582f
|
|
| MD5 |
aa3a96e9663a15376b2a249f555c2321
|
|
| BLAKE2b-256 |
5346ff404fff2d276debb1a8e925a05227f89b5bea96c6b0b9b62a77a91b065e
|
File details
Details for the file langchain_camino-0.1.0-py3-none-any.whl.
File metadata
- Download URL: langchain_camino-0.1.0-py3-none-any.whl
- Upload date:
- Size: 15.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.4 CPython/3.13.3 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d7d5a18001e8279ff3899c502fd221d2d5933eedbdaeb01becda81061879daf8
|
|
| MD5 |
328d52c96dfc91b6bf00e8308858b959
|
|
| BLAKE2b-256 |
c239fb37de6f3d9b0f8e99f1e283150d0dae8c2831204cad97a1efc8670ca647
|