Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(community): add Google Maps geocoding integration #673

Merged

Conversation

von-development
Copy link
Contributor

PR Description

Add Google Maps Geocoding integration to the community package, providing a wrapper and tool for geocoding functionality with comprehensive error handling and type safety.

Type

🆕 New Feature
✅ Test

Changes

  • Add GoogleGeocodingAPIWrapper for Google Maps API integration

    • Comprehensive error handling
    • Proper type hints
    • Support for batch geocoding
    • Async support
    • Configurable retry mechanism
  • Add GoogleGeocodingTool for LangChain integration

    • Compatible with LangChain agents
    • Support for batch location queries
    • Configurable result limits
    • Proper error handling
  • Add integration tests

    • Async geocoding test
    • Batch geocoding test
    • Error handling scenarios
    • Tool functionality tests

Testing

✅ All checks passed:

  • poetry run ruff format . - Formatting
  • poetry run ruff check . - Linting
  • poetry run mypy . - Type checking
  • Integration tests with actual API calls

Test scenarios covered:

  • Single location geocoding
  • Batch location queries
  • Async geocoding operations
  • Error handling with invalid queries
  • Tool usage in agent context

Note

  • Requires GOOGLE_MAPS_API_KEY environment variable
  • All tests pass locally
  • Follows community package standards
  • Implements proper error handling for API responses
  • Includes comprehensive type hints
  • Supports both sync and async operations
  • Compatible with LangChain agents

Checklist

  • PR Title follows convention: "community: add Google Maps geocoding integration"
  • Added comprehensive tests
  • All linting and formatting checks pass
  • Type checking passes
  • Optional dependencies properly handled
  • Changes are backwards compatible

von-development and others added 2 commits January 6, 2025 18:17
- Add geocoding API wrapper and tool
- Add integration tests for geocoding
- Update environment example with Google Maps API key
- Update __init__.py to expose geocoding classes
@von-development
Copy link
Contributor Author

@lkuligin Thanks for taking the time to review the PR! Let me know if there's anything else needed.

@lkuligin lkuligin merged commit f30c971 into langchain-ai:main Jan 7, 2025
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants